Merge branch '2.2.x' into devel

Conflicts:
	airtime_mvc/application/controllers/LibraryController.php
	airtime_mvc/application/views/scripts/library/library.phtml
	airtime_mvc/public/js/airtime/showbuilder/builder.js
	airtime_mvc/public/js/airtime/showbuilder/main_builder.js
This commit is contained in:
denise 2012-11-02 12:28:21 -04:00
commit 135aadf16b
56 changed files with 5240 additions and 4806 deletions

View File

@ -183,7 +183,8 @@ class LibraryController extends Zend_Controller_Action
} }
} }
} }
if ($isAdminOrPM) {
if ($isAdminOrPM || $file->getFileOwnerId() == $user->getId()) {
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $baseUrl."/library/delete"); $menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $baseUrl."/library/delete");
$menu["edit"] = array("name"=> "Edit Metadata", "icon" => "edit", "url" => $baseUrl."/library/edit-file-md/id/{$id}"); $menu["edit"] = array("name"=> "Edit Metadata", "icon" => "edit", "url" => $baseUrl."/library/edit-file-md/id/{$id}");
} }
@ -279,6 +280,7 @@ class LibraryController extends Zend_Controller_Action
$streams = array(); $streams = array();
$message = null; $message = null;
$noPermissionMsg = "You don't have permission to delete selected items.";
foreach ($mediaItems as $media) { foreach ($mediaItems as $media) {
@ -296,19 +298,21 @@ class LibraryController extends Zend_Controller_Action
try { try {
Application_Model_Playlist::deletePlaylists($playlists, $user->getId()); Application_Model_Playlist::deletePlaylists($playlists, $user->getId());
} catch (PlaylistNoPermissionException $e) { } catch (PlaylistNoPermissionException $e) {
$this->view->message = "You don't have permission to delete selected items."; $message = $noPermissionMsg;
return;
} }
try { try {
Application_Model_Block::deleteBlocks($blocks, $user->getId()); Application_Model_Block::deleteBlocks($blocks, $user->getId());
} catch (BlockNoPermissionException $e) {
$message = $noPermissionMsg;
} catch (Exception $e) { } catch (Exception $e) {
//TODO: warn user that not all blocks could be deleted. //TODO: warn user that not all blocks could be deleted.
} }
try { try {
Application_Model_Webstream::deleteStreams($streams, $user->getId()); Application_Model_Webstream::deleteStreams($streams, $user->getId());
} catch (WebstreamNoPermissionException $e) {
$message = $noPermissionMsg;
} catch (Exception $e) { } catch (Exception $e) {
//TODO: warn user that not all streams could be deleted. //TODO: warn user that not all streams could be deleted.
Logging::info($e); Logging::info($e);
@ -321,6 +325,8 @@ class LibraryController extends Zend_Controller_Action
if (isset($file)) { if (isset($file)) {
try { try {
$res = $file->delete(true); $res = $file->delete(true);
} catch (FileNoPermissionException $e) {
$message = $noPermissionMsg;
} catch (Exception $e) { } catch (Exception $e) {
//could throw a scheduled in future exception. //could throw a scheduled in future exception.
$message = "Could not delete some scheduled files."; $message = "Could not delete some scheduled files.";
@ -367,15 +373,17 @@ class LibraryController extends Zend_Controller_Action
{ {
$user = Application_Model_User::getCurrentUser(); $user = Application_Model_User::getCurrentUser();
$isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
if (!$isAdminOrPM) {
return;
}
$request = $this->getRequest(); $request = $this->getRequest();
$form = new Application_Form_EditAudioMD();
$file_id = $this->_getParam('id', null); $file_id = $this->_getParam('id', null);
$file = Application_Model_StoredFile::Recall($file_id); $file = Application_Model_StoredFile::Recall($file_id);
if (!$isAdminOrPM && $file->getFileOwnerId() != $user->getId()) {
return;
}
$form = new Application_Form_EditAudioMD();
$form->populate($file->getDbColMetadata()); $form->populate($file->getDbColMetadata());
if ($request->isPost()) { if ($request->isPost()) {

View File

@ -513,6 +513,7 @@ class PlaylistController extends Zend_Controller_Action
} catch (BlockNotFoundException $e) { } catch (BlockNotFoundException $e) {
$this->playlistNotFound('block', true); $this->playlistNotFound('block', true);
} catch (Exception $e) { } catch (Exception $e) {
//Logging::info($e);
$this->playlistUnknownError($e); $this->playlistUnknownError($e);
} }
} }

View File

@ -212,6 +212,14 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
}//for }//for
$repeatTracks = new Zend_Form_Element_Checkbox('sp_repeat_tracks');
$repeatTracks->setDecorators(array('viewHelper'))
->setLabel('Allow Repeat Tracks:');
if (isset($storedCrit["repeat_tracks"])) {
$repeatTracks->setChecked($storedCrit["repeat_tracks"]["value"] == 1?true:false);
}
$this->addElement($repeatTracks);
$limit = new Zend_Form_Element_Select('sp_limit_options'); $limit = new Zend_Form_Element_Select('sp_limit_options');
$limit->setAttrib('class', 'sp_input_select') $limit->setAttrib('class', 'sp_input_select')
->setDecorators(array('viewHelper')) ->setDecorators(array('viewHelper'))
@ -220,7 +228,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$limit->setValue($storedCrit["limit"]["modifier"]); $limit->setValue($storedCrit["limit"]["modifier"]);
} }
$this->addElement($limit); $this->addElement($limit);
$limitValue = new Zend_Form_Element_Text('sp_limit_value'); $limitValue = new Zend_Form_Element_Text('sp_limit_value');
$limitValue->setAttrib('class', 'sp_input_text_limit') $limitValue->setAttrib('class', 'sp_input_text_limit')
->setLabel('Limit to') ->setLabel('Limit to')

View File

@ -308,10 +308,11 @@ SQL;
$length = $value." ".$modifier; $length = $value." ".$modifier;
} else { } else {
$hour = "00"; $hour = "00";
$mins = "00";
if ($modifier == "minutes") { if ($modifier == "minutes") {
if ($value >59) { if ($value >59) {
$hour = intval($value/60); $hour = intval($value/60);
$value = $value%60; $mins = $value%60;
} }
} elseif ($modifier == "hours") { } elseif ($modifier == "hours") {
@ -1092,6 +1093,14 @@ SQL;
->setDbValue($p_criteriaData['etc']['sp_limit_value']) ->setDbValue($p_criteriaData['etc']['sp_limit_value'])
->setDbBlockId($this->id) ->setDbBlockId($this->id)
->save(); ->save();
// insert repeate track option
$qry = new CcBlockcriteria();
$qry->setDbCriteria("repeat_tracks")
->setDbModifier("N/A")
->setDbValue($p_criteriaData['etc']['sp_repeat_tracks'])
->setDbBlockId($this->id)
->save();
} }
/** /**
@ -1104,7 +1113,12 @@ SQL;
$this->saveSmartBlockCriteria($p_criteria); $this->saveSmartBlockCriteria($p_criteria);
$insertList = $this->getListOfFilesUnderLimit(); $insertList = $this->getListOfFilesUnderLimit();
$this->deleteAllFilesFromBlock(); $this->deleteAllFilesFromBlock();
$this->addAudioClips(array_keys($insertList)); // constrcut id array
$ids = array();
foreach ($insertList as $ele) {
$ids[] = $ele['id'];
}
$this->addAudioClips(array_values($ids));
// update length in playlist contents. // update length in playlist contents.
$this->updateBlockLengthInAllPlaylist(); $this->updateBlockLengthInAllPlaylist();
@ -1133,6 +1147,7 @@ SQL;
$info = $this->getListofFilesMeetCriteria(); $info = $this->getListofFilesMeetCriteria();
$files = $info['files']; $files = $info['files'];
$limit = $info['limit']; $limit = $info['limit'];
$repeat = $info['repeat_tracks'];
$insertList = array(); $insertList = array();
$totalTime = 0; $totalTime = 0;
@ -1141,19 +1156,37 @@ SQL;
// this moves the pointer to the first element in the collection // this moves the pointer to the first element in the collection
$files->getFirst(); $files->getFirst();
$iterator = $files->getIterator(); $iterator = $files->getIterator();
while ($iterator->valid() && $totalTime < $limit['time']) {
$isBlockFull = false;
while ($iterator->valid()) {
$id = $iterator->current()->getDbId(); $id = $iterator->current()->getDbId();
$length = Application_Common_DateHelper::calculateLengthInSeconds($iterator->current()->getDbLength()); $length = Application_Common_DateHelper::calculateLengthInSeconds($iterator->current()->getDbLength());
$insertList[$id] = $length; $insertList[] = array('id'=>$id, 'length'=>$length);
$totalTime += $length; $totalTime += $length;
$totalItems++; $totalItems++;
if ((!is_null($limit['items']) && $limit['items'] == count($insertList)) || $totalItems > 500) { if ((!is_null($limit['items']) && $limit['items'] == count($insertList)) || $totalItems > 500 || $totalTime > $limit['time']) {
$isBlockFull = true;
break; break;
} }
$iterator->next(); $iterator->next();
} }
$sizeOfInsert = count($insertList);
// if block is not full and reapeat_track is check, fill up more
while (!$isBlockFull && $repeat == 1) {
$randomEleKey = array_rand(array_slice($insertList, 0, $sizeOfInsert));
$insertList[] = $insertList[$randomEleKey];
$totalTime += $insertList[$randomEleKey]['length'];
$totalItems++;
if ((!is_null($limit['items']) && $limit['items'] == count($insertList)) || $totalItems > 500 || $totalTime > $limit['time']) {
break;
}
}
return $insertList; return $insertList;
} }
@ -1201,6 +1234,8 @@ SQL;
if ($criteria == "limit") { if ($criteria == "limit") {
$storedCrit["limit"] = array("value"=>$value, "modifier"=>$modifier); $storedCrit["limit"] = array("value"=>$value, "modifier"=>$modifier);
} else if($criteria == "repeat_tracks") {
$storedCrit["repeat_tracks"] = array("value"=>$value);
} else { } else {
$storedCrit["crit"][$criteria][] = array("criteria"=>$criteria, "value"=>$value, "modifier"=>$modifier, "extra"=>$extra, "display_name"=>$criteriaOptions[$criteria]); $storedCrit["crit"][$criteria][] = array("criteria"=>$criteria, "value"=>$value, "modifier"=>$modifier, "extra"=>$extra, "display_name"=>$criteriaOptions[$criteria]);
} }
@ -1316,6 +1351,7 @@ SQL;
} }
// construct limit restriction // construct limit restriction
$limits = array(); $limits = array();
if (isset($storedCrit['limit'])) { if (isset($storedCrit['limit'])) {
if ($storedCrit['limit']['modifier'] == "items") { if ($storedCrit['limit']['modifier'] == "items") {
$limits['time'] = 1440 * 60; $limits['time'] = 1440 * 60;
@ -1327,10 +1363,16 @@ SQL;
$limits['items'] = null; $limits['items'] = null;
} }
} }
$repeatTracks = 0;
if (isset($storedCrit['repeat_tracks'])) {
$repeatTracks = $storedCrit['repeat_tracks']['value'];
}
try { try {
$out = $qry->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)->find(); $out = $qry->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)->find();
return array("files"=>$out, "limit"=>$limits, "count"=>$out->count()); return array("files"=>$out, "limit"=>$limits, "repeat_tracks"=> $repeatTracks, "count"=>$out->count());
} catch (Exception $e) { } catch (Exception $e) {
Logging::info($e); Logging::info($e);
} }
@ -1376,7 +1418,7 @@ SQL;
$output['etc'][$ele['name']] = $ele['value']; $output['etc'][$ele['name']] = $ele['value'];
} }
} }
return $output; return $output;
} }
// smart block functions end // smart block functions end

View File

@ -13,9 +13,9 @@ class Application_Model_Datatables
if ($dbname == 'utime' || $dbname == 'mtime') { if ($dbname == 'utime' || $dbname == 'mtime') {
$input1 = isset($info[0])?Application_Common_DateHelper::ConvertToUtcDateTimeString($info[0]):null; $input1 = isset($info[0])?Application_Common_DateHelper::ConvertToUtcDateTimeString($info[0]):null;
$input2 = isset($info[1])?Application_Common_DateHelper::ConvertToUtcDateTimeString($info[1]):null; $input2 = isset($info[1])?Application_Common_DateHelper::ConvertToUtcDateTimeString($info[1]):null;
} else if($dbname == 'bit_rate') { } else if($dbname == 'bit_rate' || $dbname == 'sample_rate') {
$input1 = isset($info[0])?intval($info[0]) * 1000:null; $input1 = isset($info[0])?doubleval($info[0]) * 1000:null;
$input2 = isset($info[1])?intval($info[1]) * 1000:null; $input2 = isset($info[1])?doubleval($info[1]) * 1000:null;
} else { } else {
$input1 = isset($info[0])?$info[0]:null; $input1 = isset($info[0])?$info[0]:null;
$input2 = isset($info[1])?$info[1]:null; $input2 = isset($info[1])?$info[1]:null;

View File

@ -268,7 +268,7 @@ SQL;
//We need to search 24 hours before and after the show times so that that we //We need to search 24 hours before and after the show times so that that we
//capture all of the show's contents. //capture all of the show's contents.
$p_track_start= $p_start->sub(new DateInterval("PT24H"))->format("Y-m-d H:i:s"); $p_track_start= $p_start->sub(new DateInterval("PT24H"))->format("Y-m-d H:i:s");
$p_track_end = $p_end->add(new DateInterval("PT24H"))->format("Y-m-d H:i:s"); $p_track_end = $p_end->add(new DateInterval("PT24H"))->format("Y-m-d H:i:s");
@ -292,7 +292,8 @@ SQL;
ft.artist_name AS file_artist_name, ft.artist_name AS file_artist_name,
ft.album_title AS file_album_title, ft.album_title AS file_album_title,
ft.length AS file_length, ft.length AS file_length,
ft.file_exists AS file_exists ft.file_exists AS file_exists,
ft.mime AS file_mime
SQL; SQL;
$filesJoin = <<<SQL $filesJoin = <<<SQL
cc_schedule AS sched cc_schedule AS sched
@ -319,7 +320,8 @@ SQL;
sub.login AS file_artist_name, sub.login AS file_artist_name,
ws.description AS file_album_title, ws.description AS file_album_title,
ws.length AS file_length, ws.length AS file_length,
't'::BOOL AS file_exists 't'::BOOL AS file_exists,
NULL as file_mime
SQL; SQL;
$streamJoin = <<<SQL $streamJoin = <<<SQL
cc_schedule AS sched cc_schedule AS sched
@ -661,6 +663,7 @@ SQL;
$data["media"][$switch_start]['start'] = $switch_start; $data["media"][$switch_start]['start'] = $switch_start;
$data["media"][$switch_start]['end'] = $switch_start; $data["media"][$switch_start]['end'] = $switch_start;
$data["media"][$switch_start]['event_type'] = "switch_off"; $data["media"][$switch_start]['event_type'] = "switch_off";
$data["media"][$switch_start]['type'] = "event";
$data["media"][$switch_start]['independent_event'] = true; $data["media"][$switch_start]['independent_event'] = true;
} }
} }

View File

@ -270,6 +270,13 @@ SQL;
try { try {
//update the status flag in cc_schedule. //update the status flag in cc_schedule.
/* Since we didn't use a propel object when updating
* cc_show_instances table we need to clear the instances
* so the correct information is retrieved from the db
*/
CcShowInstancesPeer::clearInstancePool();
$instances = CcShowInstancesQuery::create() $instances = CcShowInstancesQuery::create()
->filterByDbEnds($current_timestamp, Criteria::GREATER_THAN) ->filterByDbEnds($current_timestamp, Criteria::GREATER_THAN)
->filterByDbShowId($this->_showId) ->filterByDbShowId($this->_showId)
@ -1253,6 +1260,7 @@ SQL;
if ($data['add_show_id'] != -1) { if ($data['add_show_id'] != -1) {
$con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME); $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME);
$con->beginTransaction(); $con->beginTransaction();
//current timesamp in UTC. //current timesamp in UTC.
$current_timestamp = gmdate("Y-m-d H:i:s"); $current_timestamp = gmdate("Y-m-d H:i:s");

View File

@ -41,6 +41,7 @@ class Application_Model_ShowBuilder
"fadein" => "", "fadein" => "",
"fadeout" => "", "fadeout" => "",
"image" => false, "image" => false,
"mime" => null,
"color" => "", //in hex without the '#' sign. "color" => "", //in hex without the '#' sign.
"backgroundColor" => "", //in hex without the '#' sign. "backgroundColor" => "", //in hex without the '#' sign.
); );
@ -277,6 +278,7 @@ class Application_Model_ShowBuilder
$row["cueout"] = $p_item["cue_out"]; $row["cueout"] = $p_item["cue_out"];
$row["fadein"] = round(substr($p_item["fade_in"], 6), 6); $row["fadein"] = round(substr($p_item["fade_in"], 6), 6);
$row["fadeout"] = round(substr($p_item["fade_out"], 6), 6); $row["fadeout"] = round(substr($p_item["fade_out"], 6), 6);
$row["mime"] = $p_item["file_mime"];
$row["pos"] = $this->pos++; $row["pos"] = $this->pos++;
@ -471,7 +473,7 @@ class Application_Model_ShowBuilder
$display_items[] = $this->makeFooterRow($scheduled_items[ $display_items[] = $this->makeFooterRow($scheduled_items[
count($scheduled_items)-1]); count($scheduled_items)-1]);
} }
return array( return array(
"schedule" => $display_items, "schedule" => $display_items,
"showInstances" => $this->showInstances); "showInstances" => $this->showInstances);

View File

@ -344,6 +344,13 @@ SQL;
throw new DeleteScheduledFileException(); throw new DeleteScheduledFileException();
} }
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id);
$isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
if (!$isAdminOrPM && $this->getFileOwnerId() != $user->getId()) {
throw new FileNoPermissionException();
}
$music_dir = Application_Model_MusicDir::getDirByPK($this->_file->getDbDirectory()); $music_dir = Application_Model_MusicDir::getDirByPK($this->_file->getDbDirectory());
$type = $music_dir->getType(); $type = $music_dir->getType();
@ -1163,6 +1170,10 @@ SQL;
return $this->_file->getDbFileExists(); return $this->_file->getDbFileExists();
} }
public function getFileOwnerId()
{
return $this->_file->getDbOwnerId();
}
// note: never call this method from controllers because it does a sleep // note: never call this method from controllers because it does a sleep
public function uploadToSoundCloud() public function uploadToSoundCloud()
@ -1211,3 +1222,4 @@ SQL;
class DeleteScheduledFileException extends Exception {} class DeleteScheduledFileException extends Exception {}
class FileDoesNotExistException extends Exception {} class FileDoesNotExistException extends Exception {}
class FileNoPermissionException extends Exception {}

View File

@ -92,7 +92,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
if (count($leftOver) == 0) { if (count($leftOver) == 0) {
CcWebstreamQuery::create()->findPKs($p_ids)->delete(); CcWebstreamQuery::create()->findPKs($p_ids)->delete();
} else { } else {
throw new Exception("Invalid user permissions"); throw new WebstreamNoPermissionException;
} }
} }
@ -185,7 +185,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
} }
$mediaUrl = self::getMediaUrl($url, $mime, $content_length_found); $mediaUrl = self::getMediaUrl($url, $mime, $content_length_found);
if (preg_match("/(x-mpegurl)|(xspf\+xml)|(pls\+xml)/", $mime)) { if (preg_match("/(x-mpegurl)|(xspf\+xml)|(pls\+xml)|(x-scpls)/", $mime)) {
list($mime, $content_length_found) = self::discoverStreamMime($mediaUrl); list($mime, $content_length_found) = self::discoverStreamMime($mediaUrl);
} }
} catch (Exception $e) { } catch (Exception $e) {
@ -307,7 +307,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
$media_url = self::getM3uUrl($url); $media_url = self::getM3uUrl($url);
} elseif (preg_match("/xspf\+xml/", $mime)) { } elseif (preg_match("/xspf\+xml/", $mime)) {
$media_url = self::getXspfUrl($url); $media_url = self::getXspfUrl($url);
} elseif (preg_match("/pls\+xml/", $mime)) { } elseif (preg_match("/pls\+xml/", $mime) || preg_match("/x-scpls/", $mime)) {
$media_url = self::getPlsUrl($url); $media_url = self::getPlsUrl($url);
} elseif (preg_match("/(mpeg|ogg)/", $mime)) { } elseif (preg_match("/(mpeg|ogg)/", $mime)) {
if ($content_length_found) { if ($content_length_found) {
@ -370,3 +370,6 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
return $webstream->getDbId(); return $webstream->getDbId();
} }
} }
class WebstreamNoPermissionException extends Exception {}

View File

@ -54,7 +54,7 @@ class CcBlockTableMap extends TableMap {
*/ */
public function buildRelations() public function buildRelations()
{ {
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('creator_id' => 'id', ), null, null); $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('creator_id' => 'id', ), 'CASCADE', null);
$this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null); $this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null);
$this->addRelation('CcBlockcontents', 'CcBlockcontents', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null); $this->addRelation('CcBlockcontents', 'CcBlockcontents', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null);
$this->addRelation('CcBlockcriteria', 'CcBlockcriteria', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null); $this->addRelation('CcBlockcriteria', 'CcBlockcriteria', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null);

View File

@ -64,7 +64,7 @@ class CcSubjsTableMap extends TableMap {
$this->addRelation('CcPerms', 'CcPerms', RelationMap::ONE_TO_MANY, array('id' => 'subj', ), 'CASCADE', null); $this->addRelation('CcPerms', 'CcPerms', RelationMap::ONE_TO_MANY, array('id' => 'subj', ), 'CASCADE', null);
$this->addRelation('CcShowHosts', 'CcShowHosts', RelationMap::ONE_TO_MANY, array('id' => 'subjs_id', ), 'CASCADE', null); $this->addRelation('CcShowHosts', 'CcShowHosts', RelationMap::ONE_TO_MANY, array('id' => 'subjs_id', ), 'CASCADE', null);
$this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::ONE_TO_MANY, array('id' => 'creator_id', ), 'CASCADE', null); $this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::ONE_TO_MANY, array('id' => 'creator_id', ), 'CASCADE', null);
$this->addRelation('CcBlock', 'CcBlock', RelationMap::ONE_TO_MANY, array('id' => 'creator_id', ), null, null); $this->addRelation('CcBlock', 'CcBlock', RelationMap::ONE_TO_MANY, array('id' => 'creator_id', ), 'CASCADE', null);
$this->addRelation('CcPref', 'CcPref', RelationMap::ONE_TO_MANY, array('id' => 'subjid', ), 'CASCADE', null); $this->addRelation('CcPref', 'CcPref', RelationMap::ONE_TO_MANY, array('id' => 'subjid', ), 'CASCADE', null);
$this->addRelation('CcSess', 'CcSess', RelationMap::ONE_TO_MANY, array('id' => 'userid', ), 'CASCADE', null); $this->addRelation('CcSess', 'CcSess', RelationMap::ONE_TO_MANY, array('id' => 'userid', ), 'CASCADE', null);
$this->addRelation('CcSubjsToken', 'CcSubjsToken', RelationMap::ONE_TO_MANY, array('id' => 'user_id', ), 'CASCADE', null); $this->addRelation('CcSubjsToken', 'CcSubjsToken', RelationMap::ONE_TO_MANY, array('id' => 'user_id', ), 'CASCADE', null);

View File

@ -407,6 +407,9 @@ abstract class BaseCcSubjsPeer {
// Invalidate objects in CcPlaylistPeer instance pool, // Invalidate objects in CcPlaylistPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
CcPlaylistPeer::clearInstancePool(); CcPlaylistPeer::clearInstancePool();
// Invalidate objects in CcBlockPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
CcBlockPeer::clearInstancePool();
// Invalidate objects in CcPrefPeer instance pool, // Invalidate objects in CcPrefPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
CcPrefPeer::clearInstancePool(); CcPrefPeer::clearInstancePool();

View File

@ -1,3 +1,3 @@
<?php <?php
echo $status; echo $status;

View File

@ -1,182 +1,182 @@
<div id="register_popup" class="dialogPopup register-dialog" title="Register Airtime" style="display: none;"> <div id="register_popup" class="dialogPopup register-dialog" title="Register Airtime" style="display: none;">
<form id="register-form" method="<?php echo $this->element->getMethod() ?>" action="<?php echo $this->element->getAction() ?>" enctype="multipart/form-data"> <form id="register-form" method="<?php echo $this->element->getMethod() ?>" action="<?php echo $this->element->getAction() ?>" enctype="multipart/form-data">
<fieldset> <fieldset>
<dl class="zend_form"> <dl class="zend_form">
<dt class="block-display info-text"> <dt class="block-display info-text">
Help Airtime improve by letting us know how you are using it. This info Help Airtime improve by letting us know how you are using it. This info
will be collected regularly in order to enhance your user experience. will be collected regularly in order to enhance your user experience.
<br /><br /> <br /><br />
Click "Yes, help Airtime" and we'll make sure the features you use are Click "Yes, help Airtime" and we'll make sure the features you use are
constantly improving. constantly improving.
</dt> </dt>
<dd id="SupportFeedback-element" class="block-display"> <dd id="SupportFeedback-element" class="block-display">
<label class="optional" for="SupportFeedback"> <label class="optional" for="SupportFeedback">
<?php echo $this->element->getElement('SupportFeedback') ?> <?php echo $this->element->getElement('SupportFeedback') ?>
<strong><?php echo $this->element->getElement('SupportFeedback')->getLabel() ?></strong> <strong><?php echo $this->element->getElement('SupportFeedback')->getLabel() ?></strong>
</label> </label>
<?php if($this->element->getElement('SupportFeedback')->hasErrors()) : ?> <?php if($this->element->getElement('SupportFeedback')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('SupportFeedback')->getMessages() as $error): ?> <?php foreach($this->element->getElement('SupportFeedback')->getMessages() as $error): ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt class="block-display info-text"> <dt class="block-display info-text">
Click the box below to advertise your station on Click the box below to advertise your station on
<a id="link_to_whos_using" href="http://sourcefabric.org/en/airtime/whosusing" onclick="window.open(this.href); return false">Sourcefabric.org</a>. <a id="link_to_whos_using" href="http://sourcefabric.org/en/airtime/whosusing" onclick="window.open(this.href); return false">Sourcefabric.org</a>.
In order to promote your station, "Send support feedback" must be enabled. This data will be collected in addition to the support feedback. In order to promote your station, "Send support feedback" must be enabled. This data will be collected in addition to the support feedback.
</dt> </dt>
<dd id="publicize-element" class="block-display"> <dd id="publicize-element" class="block-display">
<label class="optional" for="Publicise"> <label class="optional" for="Publicise">
<?php echo $this->element->getElement('Publicise') ?> <?php echo $this->element->getElement('Publicise') ?>
<strong><?php echo $this->element->getElement('Publicise')->getLabel() ?></strong> <strong><?php echo $this->element->getElement('Publicise')->getLabel() ?></strong>
</label> </label>
<?php if($this->element->getElement('Publicise')->hasErrors()) : ?> <?php if($this->element->getElement('Publicise')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('Publicise')->getMessages() as $error): ?> <?php foreach($this->element->getElement('Publicise')->getMessages() as $error): ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
</dl> </dl>
<dl id="public-info" style="display:none;"> <dl id="public-info" style="display:none;">
<dt id="stnName-label"> <dt id="stnName-label">
<label class="optional" for="stnName"><?php echo $this->element->getElement('stnName')->getLabel() ?> <label class="optional" for="stnName"><?php echo $this->element->getElement('stnName')->getLabel() ?>
<span class="info-text-small">(Required)</span> : <span class="info-text-small">(Required)</span> :
</label> </label>
</dt> </dt>
<dd id="stnName-element"> <dd id="stnName-element">
<?php echo $this->element->getElement('stnName') ?> <?php echo $this->element->getElement('stnName') ?>
<?php if($this->element->getElement('stnName')->hasErrors()) : ?> <?php if($this->element->getElement('stnName')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('stnName')->getMessages() as $error): ?> <?php foreach($this->element->getElement('stnName')->getMessages() as $error): ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="Phone-label"> <dt id="Phone-label">
<label class="optional" for="Phone"><?php echo $this->element->getElement('Phone')->getLabel() ?></label> <label class="optional" for="Phone"><?php echo $this->element->getElement('Phone')->getLabel() ?></label>
</dt> </dt>
<dd id="Phone-element"> <dd id="Phone-element">
<?php echo $this->element->getElement('Phone') ?> <?php echo $this->element->getElement('Phone') ?>
<span class="info-text-small">(for verification purposes only, will not be published)</span> <span class="info-text-small">(for verification purposes only, will not be published)</span>
<?php if($this->element->getElement('Phone')->hasErrors()) : ?> <?php if($this->element->getElement('Phone')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('Phone')->getMessages() as $error): ?> <?php foreach($this->element->getElement('Phone')->getMessages() as $error): ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="Email-label"> <dt id="Email-label">
<label class="optional" for="Email"><?php echo $this->element->getElement('Email')->getLabel() ?></label> <label class="optional" for="Email"><?php echo $this->element->getElement('Email')->getLabel() ?></label>
</dt> </dt>
<dd id="Email-element"> <dd id="Email-element">
<?php echo $this->element->getElement('Email') ?> <?php echo $this->element->getElement('Email') ?>
<span class="info-text-small">(for verification purposes only, will not be published)</span> <span class="info-text-small">(for verification purposes only, will not be published)</span>
<?php if($this->element->getElement('Email')->hasErrors()) : ?> <?php if($this->element->getElement('Email')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('Email')->getMessages() as $error): ?> <?php foreach($this->element->getElement('Email')->getMessages() as $error): ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="StationWebSite-label"> <dt id="StationWebSite-label">
<label class="optional" for="StationWebSite"><?php echo $this->element->getElement('StationWebSite')->getLabel() ?></label> <label class="optional" for="StationWebSite"><?php echo $this->element->getElement('StationWebSite')->getLabel() ?></label>
</dt> </dt>
<dd id="StationWebSite-element"> <dd id="StationWebSite-element">
<?php echo $this->element->getElement('StationWebSite') ?> <?php echo $this->element->getElement('StationWebSite') ?>
<?php if($this->element->getElement('StationWebSite')->hasErrors()) : ?> <?php if($this->element->getElement('StationWebSite')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('StationWebSite')->getMessages() as $error): ?> <?php foreach($this->element->getElement('StationWebSite')->getMessages() as $error): ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="Country-label"> <dt id="Country-label">
<label class="optional" for="Country"><?php echo $this->element->getElement('Country')->getLabel() ?></label> <label class="optional" for="Country"><?php echo $this->element->getElement('Country')->getLabel() ?></label>
</dt> </dt>
<dd id="Country-element"> <dd id="Country-element">
<?php echo $this->element->getElement('Country') ?> <?php echo $this->element->getElement('Country') ?>
<?php if($this->element->getElement('Country')->hasErrors()) : ?> <?php if($this->element->getElement('Country')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('Country')->getMessages() as $error): ?> <?php foreach($this->element->getElement('Country')->getMessages() as $error): ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="City-label"> <dt id="City-label">
<label class="optional" for="City"><?php echo $this->element->getElement('City')->getLabel() ?></label> <label class="optional" for="City"><?php echo $this->element->getElement('City')->getLabel() ?></label>
</dt> </dt>
<dd id="City-element"> <dd id="City-element">
<?php echo $this->element->getElement('City') ?> <?php echo $this->element->getElement('City') ?>
<?php if($this->element->getElement('City')->hasErrors()) : ?> <?php if($this->element->getElement('City')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('City')->getMessages() as $error): ?> <?php foreach($this->element->getElement('City')->getMessages() as $error): ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="Description-label"> <dt id="Description-label">
<label class="optional" for="Description"><?php echo $this->element->getElement('Description')->getLabel() ?></label> <label class="optional" for="Description"><?php echo $this->element->getElement('Description')->getLabel() ?></label>
</dt> </dt>
<dd id="Description-element"> <dd id="Description-element">
<?php echo $this->element->getElement('Description') ?> <?php echo $this->element->getElement('Description') ?>
<?php if($this->element->getElement('Description')->hasErrors()) : ?> <?php if($this->element->getElement('Description')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('Description')->getMessages() as $error): ?> <?php foreach($this->element->getElement('Description')->getMessages() as $error): ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<dt id="Logo-label" class="block-display"> <dt id="Logo-label" class="block-display">
<label class="optional" for="Description"><?php echo $this->element->getElement('Logo')->getLabel() ?></label> <label class="optional" for="Description"><?php echo $this->element->getElement('Logo')->getLabel() ?></label>
</dt> </dt>
<dd id="Logo-element"> <dd id="Logo-element">
<?php if($this->element->getView()->logoImg){?> <?php if($this->element->getView()->logoImg){?>
<div id="Logo-img-container"><img id="logo-img" onload='resizeImg(this, 450, 450);' src="data:image/png;base64,<?php echo $this->element->getView()->logoImg ?>" /></div> <div id="Logo-img-container"><img id="logo-img" onload='resizeImg(this, 450, 450);' src="data:image/png;base64,<?php echo $this->element->getView()->logoImg ?>" /></div>
<?php }?> <?php }?>
<?php echo $this->element->getElement('Logo') ?> <?php echo $this->element->getElement('Logo') ?>
<p class="info-text">Note: Anything larger than 600x600 will be resized.</p> <p class="info-text">Note: Anything larger than 600x600 will be resized.</p>
<?php if($this->element->getElement('Logo')->hasErrors()) : ?> <?php if($this->element->getElement('Logo')->hasErrors()) : ?>
<ul class='errors'> <ul class='errors'>
<?php foreach($this->element->getElement('Logo')->getMessages() as $error): ?> <?php foreach($this->element->getElement('Logo')->getMessages() as $error): ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
</dl> </dl>
</fieldset> </fieldset>
<div id="show_what_sending" style="display: block;"> <div id="show_what_sending" style="display: block;">
<fieldset class="display_field toggle closed"> <fieldset class="display_field toggle closed">
<legend style="cursor: pointer;"><span class="ui-icon ui-icon-triangle-2-n-s"></span>Show me what I am sending </legend> <legend style="cursor: pointer;"><span class="ui-icon ui-icon-triangle-2-n-s"></span>Show me what I am sending </legend>
<dl> <dl>
<?php echo $this->element->getElement('SendInfo') ?> <?php echo $this->element->getElement('SendInfo') ?>
</dl> </dl>
</fieldset> </fieldset>
</div> </div>
<div> <div>
<br> <br>
<?php if(!$this->privacyChecked){?> <?php if(!$this->privacyChecked){?>
<label class="optional" for="Privacy"> <label class="optional" for="Privacy">
<?php echo $this->element->getElement('Privacy') ?> <?php echo $this->element->getElement('Privacy') ?>
<?php echo $this->element->getElement('Privacy')->getLabel() ?> <?php echo $this->element->getElement('Privacy')->getLabel() ?>
</label> </label>
<?php }else{?> <?php }else{?>
<a id="link_to_terms_and_condition" href="http://www.sourcefabric.org/en/about/policy/" onclick="window.open(this.href); return false;">Terms and Conditions</a> <a id="link_to_terms_and_condition" href="http://www.sourcefabric.org/en/about/policy/" onclick="window.open(this.href); return false;">Terms and Conditions</a>
<?php }?> <?php }?>
</div> </div>
</form> </form>
</div> </div>

View File

@ -30,8 +30,22 @@
<dd id='sp_criteria-element' class='criteria-element'> <dd id='sp_criteria-element' class='criteria-element'>
<?php for ($i = 0; $i < $this->criteriasLength; $i++) {?> <?php for ($i = 0; $i < $this->criteriasLength; $i++) {?>
<?php for ($j = 0; $j < $this->modRowMap[$i]; $j++) {?> <?php for ($j = 0; $j < $this->modRowMap[$i]; $j++) {
<div <?php if (($i > 0) && ($this->element->getElement("sp_criteria_field_".$i."_".$j)->getAttrib('disabled') == 'disabled')) { if ($this->modRowMap[$i] > 1 && $j != $this->modRowMap[$i]-1) $logicLabel = 'or';
else $logicLabel = 'and';
$disabled = $this->element->getElement("sp_criteria_field_".$i."_".$j)->getAttrib('disabled') == 'disabled'?true:false;
// determine if the next row is disabled and only display the logic label if it isn't
if ($j == $this->modRowMap[$i]-1 && $i < 25) {
$n = $i+1;
$nextIndex = $n."_0";
} elseif ($j+1 < $this->modRowMap[$i]-1) {
$n = $j+1;
$nextIndex = $i."_".$n;
}
$nextDisabled = $this->element->getElement("sp_criteria_field_".$nextIndex)->getAttrib('disabled') == 'disabled'?true:false;
?>
<div <?php if (($i > 0) && $disabled) {
echo 'style=display:none'; echo 'style=display:none';
} ?>> } ?>>
<?php echo $this->element->getElement("sp_criteria_field_".$i."_".$j) ?> <?php echo $this->element->getElement("sp_criteria_field_".$i."_".$j) ?>
@ -45,6 +59,9 @@
<a style='margin-right:3px' class='btn btn-small btn-danger' id='criteria_remove_<?php echo $i ?>'> <a style='margin-right:3px' class='btn btn-small btn-danger' id='criteria_remove_<?php echo $i ?>'>
<i class='icon-white icon-remove'></i> <i class='icon-white icon-remove'></i>
</a> </a>
<span class='db-logic-label' <?php if ($nextDisabled) echo "style='display:none'"?>>
<?php echo $logicLabel;?>
</span>
<?php if($this->element->getElement("sp_criteria_field_".$i."_".$j)->hasErrors()) : ?> <?php if($this->element->getElement("sp_criteria_field_".$i."_".$j)->hasErrors()) : ?>
<?php foreach($this->element->getElement("sp_criteria_field_".$i."_".$j)->getMessages() as $error): ?> <?php foreach($this->element->getElement("sp_criteria_field_".$i."_".$j)->getMessages() as $error): ?>
<span class='errors sp-errors'> <span class='errors sp-errors'>
@ -59,6 +76,20 @@
<br /> <br />
</dd> </dd>
<dd id='sp_repeate_tracks-element'>
<span class='sp_text_font'><?php echo $this->element->getElement('sp_repeat_tracks')->getLabel() ?></span>
<span class='repeat_tracks_help_icon'></span>
<?php echo $this->element->getElement('sp_repeat_tracks')?>
<?php if($this->element->getElement("sp_repeat_tracks")->hasErrors()) : ?>
<?php foreach($this->element->getElement("sp_repeat_tracks")->getMessages() as $error): ?>
<span class='errors sp-errors'>
<?php echo $error; ?>
</span>
<?php endforeach; ?>
<?php endif; ?>
<br />
</dd>
<dd id='sp_limit-element'> <dd id='sp_limit-element'>
<span class='sp_text_font'><?php echo $this->element->getElement('sp_limit_value')->getLabel() ?></span> <span class='sp_text_font'><?php echo $this->element->getElement('sp_limit_value')->getLabel() ?></span>
<?php echo $this->element->getElement('sp_limit_value')?> <?php echo $this->element->getElement('sp_limit_value')?>

View File

@ -1,6 +1,6 @@
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong"> <div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong">
<h2>Edit Metadata</h2> <h2>Edit Metadata</h2>
<?php $this->form->setAction($this->url()); <?php //$this->form->setAction($this->url());
echo $this->form; ?> echo $this->form; ?>
</div> </div>

View File

@ -92,5 +92,13 @@ if ($item['type'] == 2) {
<?php endforeach; ?> <?php endforeach; ?>
<?php else : ?> <?php else : ?>
<li class="spl_empty">Empty playlist</li> <li class="spl_empty">
<?php
if ($this->obj instanceof Application_Model_Block) {
echo 'Empty smart block';
} else {
echo 'Empty playlist';
}
?>
</li>
<?php endif; ?> <?php endif; ?>

View File

@ -1,2 +1,2 @@
<div id='json-string'></div> <div id='json-string'></div>
<div id='demo'></div> <div id='demo'></div>

View File

@ -1,7 +1,7 @@
<div class="wrapper"> <div class="wrapper">
<div id="library_content" class="lib-content tabs ui-widget ui-widget-content block-shadow alpha-block padded"> <div id="library_content" class="lib-content tabs ui-widget ui-widget-content block-shadow alpha-block padded">
<div id="import_status" style="display:none">File import in progress...</div> <div id="import_status" style="display:none">File import in progress...</div>
<fieldset class="toggle" id="filter_options"> <fieldset class="toggle closed" id="filter_options">
<legend style="cursor: pointer;"><span class="ui-icon ui-icon-triangle-2-n-s"></span>Advanced Search Options</legend> <legend style="cursor: pointer;"><span class="ui-icon ui-icon-triangle-2-n-s"></span>Advanced Search Options</legend>
<div id="advanced_search" class="advanced_search form-horizontal"></div> <div id="advanced_search" class="advanced_search form-horizontal"></div>
</fieldset> </fieldset>

View File

@ -9,6 +9,10 @@
<li id='lib-new-ws'><a href="#">New Webstream</a></li> <li id='lib-new-ws'><a href="#">New Webstream</a></li>
</ul> </ul>
</div> </div>
<div class="btn-group pull-right">
<button class="btn btn-inverse" type="submit" id="webstream_save" name="submit">Save</button>
</div>
<?php if (isset($this->obj)) : ?> <?php if (isset($this->obj)) : ?>
<div class="btn-group pull-right"> <div class="btn-group pull-right">
<button id="ws_delete" class="btn" <?php if ($this->action == "new"): ?>style="display:none;"<?php endif; ?>aria-disabled="false">Delete</button> <button id="ws_delete" class="btn" <?php if ($this->action == "new"): ?>style="display:none;"<?php endif; ?>aria-disabled="false">Delete</button>
@ -37,24 +41,23 @@
<dd id="description-element"> <dd id="description-element">
<textarea cols="80" rows="24" id="description" name="description"><?php echo $this->obj->getDescription(); ?></textarea> <textarea cols="80" rows="24" id="description" name="description"><?php echo $this->obj->getDescription(); ?></textarea>
</dd> </dd>
<dt id="submit-label" style="display: none;">&nbsp;</dt>
<div id="url-error" class="errors" style="display:none;"></div>
<dt id="streamurl-label"><label for="streamurl">Stream URL:</label></dt>
<dd id="streamurl-element">
<input type="text" value="<?php echo $this->obj->getUrl(); ?>" size="40"/>
</dd>
<div id="length-error" class="errors" style="display:none;"></div>
<dt id="streamlength-label"><label for="streamlength">Default Length:</label></dt>
<dd id="streamlength-element">
<input type="text" value="<?php echo $this->obj->getDefaultLength() ?>"/>
</dd>
<dd id="submit-element" class="buttons">
<input class="btn btn-inverse" type="submit" value="Save" id="webstream_save" name="submit">
</dd>
</dl> </dl>
</fieldset> </fieldset>
<dl class="zend_form">
<dt id="submit-label" style="display: none;">&nbsp;</dt>
<div id="url-error" class="errors" style="display:none;"></div>
<dt id="streamurl-label"><label for="streamurl">Stream URL:</label></dt>
<dd id="streamurl-element">
<input type="text" value="<?php echo $this->obj->getUrl(); ?>" size="40"/>
</dd>
<div id="length-error" class="errors" style="display:none;"></div>
<dt id="streamlength-label"><label for="streamlength">Default Length:</label></dt>
<dd id="streamlength-element">
<input type="text" value="<?php echo $this->obj->getDefaultLength() ?>"/>
</dd>
</dl>
<?php else : ?> <?php else : ?>
<div>No webstream</div> <div>No webstream</div>

View File

@ -250,7 +250,7 @@
<parameter name="foreign_table" value="cc_blockcontents" /> <parameter name="foreign_table" value="cc_blockcontents" />
<parameter name="expression" value="SUM(cliplength)" /> <parameter name="expression" value="SUM(cliplength)" />
</behavior> </behavior>
<foreign-key foreignTable="cc_subjs" name="cc_block_createdby_fkey"> <foreign-key foreignTable="cc_subjs" name="cc_block_createdby_fkey" onDelete="CASCADE">
<reference local="creator_id" foreign="id"/> <reference local="creator_id" foreign="id"/>
</foreign-key> </foreign-key>
</table> </table>

View File

@ -697,7 +697,7 @@ ALTER TABLE "cc_playlistcontents" ADD CONSTRAINT "cc_playlistcontents_block_id_f
ALTER TABLE "cc_playlistcontents" ADD CONSTRAINT "cc_playlistcontents_playlist_id_fkey" FOREIGN KEY ("playlist_id") REFERENCES "cc_playlist" ("id") ON DELETE CASCADE; ALTER TABLE "cc_playlistcontents" ADD CONSTRAINT "cc_playlistcontents_playlist_id_fkey" FOREIGN KEY ("playlist_id") REFERENCES "cc_playlist" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_block" ADD CONSTRAINT "cc_block_createdby_fkey" FOREIGN KEY ("creator_id") REFERENCES "cc_subjs" ("id"); ALTER TABLE "cc_block" ADD CONSTRAINT "cc_block_createdby_fkey" FOREIGN KEY ("creator_id") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_blockcontents" ADD CONSTRAINT "cc_blockcontents_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "cc_files" ("id") ON DELETE CASCADE; ALTER TABLE "cc_blockcontents" ADD CONSTRAINT "cc_blockcontents_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "cc_files" ("id") ON DELETE CASCADE;

View File

@ -1,129 +1,129 @@
#schedule-add-show, #schedule-add-show,
#fullcalendar_show_display { #fullcalendar_show_display {
float: left; float: left;
} }
#schedule-add-show { #schedule-add-show {
font-size: 12px; font-size: 12px;
/*width: 25%;*/ /*width: 25%;*/
width:310px; width:310px;
} }
#schedule-add-show textarea { #schedule-add-show textarea {
width: 99%; width: 99%;
height: 80px; height: 80px;
} }
#fullcalendar_show_display { #fullcalendar_show_display {
width: 60%; width: 60%;
} }
#schedule-add-show .ui-tabs-panel { #schedule-add-show .ui-tabs-panel {
padding-top: 8px; padding-top: 8px;
} }
#schedule-add-show fieldset { #schedule-add-show fieldset {
padding:8px; padding:8px;
margin-bottom:8px; margin-bottom:8px;
} }
#schedule-add-show dl { #schedule-add-show dl {
padding:8px; padding:8px;
margin-bottom:8px; margin-bottom:8px;
margin:0; margin:0;
padding:0; padding:0;
width:100%; width:100%;
} }
#schedule-add-show dd { #schedule-add-show dd {
padding: 4px 0; padding: 4px 0;
float: left; float: left;
font-size: 1.2em; font-size: 1.2em;
margin: 0; margin: 0;
padding: 4px 0 4px 15px; padding: 4px 0 4px 15px;
} }
#schedule-add-show dt, #schedule-add-show dt.big { #schedule-add-show dt, #schedule-add-show dt.big {
clear: left; clear: left;
color: #666666; color: #666666;
float: left; float: left;
font-size: 1.2em; font-size: 1.2em;
font-weight: bold; font-weight: bold;
margin: 0; margin: 0;
padding: 4px 0; padding: 4px 0;
text-align: left; text-align: left;
min-width:103px; min-width:103px;
clear:left; clear:left;
} }
#schedule-add-show dt.big { #schedule-add-show dt.big {
min-width:130px; min-width:130px;
} }
#schedule-add-show dt.block-display, #schedule-add-show dd.block-display { #schedule-add-show dt.block-display, #schedule-add-show dd.block-display {
display:block; display:block;
float:none; float:none;
margin-left:0; margin-left:0;
padding-left:0; padding-left:0;
} }
#schedule-add-show dt label { #schedule-add-show dt label {
padding-right:0; padding-right:0;
} }
.wrapp-label { .wrapp-label {
padding:0; padding:0;
height:16px; height:16px;
display:block; display:block;
line-height:18px; line-height:18px;
} }
label.wrapp-label input[type="checkbox"] { label.wrapp-label input[type="checkbox"] {
float:left; float:left;
margin:-1px 2px 0 0; margin:-1px 2px 0 0;
} }
#schedule-add-show fieldset:last-child { #schedule-add-show fieldset:last-child {
margin-bottom:0; margin-bottom:0;
} }
#schedule-add-show fieldset dd input[type="checkbox"] { #schedule-add-show fieldset dd input[type="checkbox"] {
margin-top:2px; margin-top:2px;
} }
#add_show_day_check-element.block-display { #add_show_day_check-element.block-display {
margin-bottom:15px; margin-bottom:15px;
margin-top:7px; margin-top:7px;
} }
#add_show_day_check-element.block-display label.wrapp-label { #add_show_day_check-element.block-display label.wrapp-label {
font-size:12px; font-size:12px;
float:left; float:left;
margin-right:10px; margin-right:10px;
} }
#add_show_name-element .input_text { #add_show_name-element .input_text {
/*width:99%;*/ /*width:99%;*/
} }
#schedule-add-show-overlap { #schedule-add-show-overlap {
border: 1px solid #c83f3f; border: 1px solid #c83f3f;
background: #c6b4b4; background: #c6b4b4;
margin-top:8px; margin-top:8px;
padding:8px; padding:8px;
color:#902d2d; color:#902d2d;
display:none; display:none;
} }
#add_show_hosts-element { #add_show_hosts-element {
max-height: 80px; max-height: 80px;
min-width: 150px; min-width: 150px;
overflow: auto; overflow: auto;
} }
#add_show_start_time, #add_show_end_time { #add_show_start_time, #add_show_end_time {
width: 54px; width: 54px;
margin-left:10px; margin-left:10px;
} }
#add_show_end_date_no_repeat, #add_show_start_date { #add_show_end_date_no_repeat, #add_show_start_date {
width: 89px; width: 89px;
} }
#add_show_duration { #add_show_duration {
background: #AAAAAA; background: #AAAAAA;
cursor: default; cursor: default;
width: 65px; width: 65px;
} }

View File

@ -1,162 +1,162 @@
.colorpicker { .colorpicker {
width: 356px; width: 356px;
height: 176px; height: 176px;
overflow: hidden; overflow: hidden;
position: absolute; position: absolute;
background: url(../images/colorpicker_background.png); background: url(../images/colorpicker_background.png);
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
display: none; display: none;
z-index: 1003; /* so it can display above the jQuery dialog*/ z-index: 1003; /* so it can display above the jQuery dialog*/
} }
.colorpicker_color { .colorpicker_color {
width: 150px; width: 150px;
height: 150px; height: 150px;
left: 14px; left: 14px;
top: 13px; top: 13px;
position: absolute; position: absolute;
background: #f00; background: #f00;
overflow: hidden; overflow: hidden;
cursor: crosshair; cursor: crosshair;
} }
.colorpicker_color div { .colorpicker_color div {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: 150px; width: 150px;
height: 150px; height: 150px;
background: url(../images/colorpicker_overlay.png); background: url(../images/colorpicker_overlay.png);
} }
.colorpicker_color div div { .colorpicker_color div div {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: 11px; width: 11px;
height: 11px; height: 11px;
overflow: hidden; overflow: hidden;
background: url(../images/colorpicker_select.gif); background: url(../images/colorpicker_select.gif);
margin: -5px 0 0 -5px; margin: -5px 0 0 -5px;
} }
.colorpicker_hue { .colorpicker_hue {
position: absolute; position: absolute;
top: 13px; top: 13px;
left: 171px; left: 171px;
width: 35px; width: 35px;
height: 150px; height: 150px;
cursor: n-resize; cursor: n-resize;
} }
.colorpicker_hue div { .colorpicker_hue div {
position: absolute; position: absolute;
width: 35px; width: 35px;
height: 9px; height: 9px;
overflow: hidden; overflow: hidden;
background: url(../images/colorpicker_indic.gif) left top; background: url(../images/colorpicker_indic.gif) left top;
margin: -4px 0 0 0; margin: -4px 0 0 0;
left: 0px; left: 0px;
} }
.colorpicker_new_color { .colorpicker_new_color {
position: absolute; position: absolute;
width: 60px; width: 60px;
height: 30px; height: 30px;
left: 213px; left: 213px;
top: 13px; top: 13px;
background: #f00; background: #f00;
} }
.colorpicker_current_color { .colorpicker_current_color {
position: absolute; position: absolute;
width: 60px; width: 60px;
height: 30px; height: 30px;
left: 283px; left: 283px;
top: 13px; top: 13px;
background: #f00; background: #f00;
} }
.colorpicker input { .colorpicker input {
background-color: transparent; background-color: transparent;
border: 1px solid transparent; border: 1px solid transparent;
position: absolute; position: absolute;
font-size: 10px; font-size: 10px;
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
color: #898989; color: #898989;
top: 4px; top: 4px;
right: 11px; right: 11px;
text-align: right; text-align: right;
margin: 0; margin: 0;
padding: 0; padding: 0;
height: 11px; height: 11px;
} }
.colorpicker_hex { .colorpicker_hex {
position: absolute; position: absolute;
width: 72px; width: 72px;
height: 22px; height: 22px;
background: url(../images/colorpicker_hex.png) top; background: url(../images/colorpicker_hex.png) top;
left: 212px; left: 212px;
top: 142px; top: 142px;
} }
.colorpicker_hex input { .colorpicker_hex input {
right: 6px; right: 6px;
} }
.colorpicker_field { .colorpicker_field {
height: 22px; height: 22px;
width: 62px; width: 62px;
background-position: top; background-position: top;
position: absolute; position: absolute;
} }
.colorpicker_field span { .colorpicker_field span {
position: absolute; position: absolute;
width: 12px; width: 12px;
height: 22px; height: 22px;
overflow: hidden; overflow: hidden;
top: 0; top: 0;
right: 0; right: 0;
cursor: n-resize; cursor: n-resize;
} }
.colorpicker_rgb_r { .colorpicker_rgb_r {
background-image: url(../images/colorpicker_rgb_r.png); background-image: url(../images/colorpicker_rgb_r.png);
top: 52px; top: 52px;
left: 212px; left: 212px;
} }
.colorpicker_rgb_g { .colorpicker_rgb_g {
background-image: url(../images/colorpicker_rgb_g.png); background-image: url(../images/colorpicker_rgb_g.png);
top: 82px; top: 82px;
left: 212px; left: 212px;
} }
.colorpicker_rgb_b { .colorpicker_rgb_b {
background-image: url(../images/colorpicker_rgb_b.png); background-image: url(../images/colorpicker_rgb_b.png);
top: 112px; top: 112px;
left: 212px; left: 212px;
} }
.colorpicker_hsb_h { .colorpicker_hsb_h {
background-image: url(../images/colorpicker_hsb_h.png); background-image: url(../images/colorpicker_hsb_h.png);
top: 52px; top: 52px;
left: 282px; left: 282px;
} }
.colorpicker_hsb_s { .colorpicker_hsb_s {
background-image: url(../images/colorpicker_hsb_s.png); background-image: url(../images/colorpicker_hsb_s.png);
top: 82px; top: 82px;
left: 282px; left: 282px;
} }
.colorpicker_hsb_b { .colorpicker_hsb_b {
background-image: url(../images/colorpicker_hsb_b.png); background-image: url(../images/colorpicker_hsb_b.png);
top: 112px; top: 112px;
left: 282px; left: 282px;
} }
.colorpicker_submit { .colorpicker_submit {
position: absolute; position: absolute;
width: 22px; width: 22px;
height: 22px; height: 22px;
background: url(../images/colorpicker_submit.png) top; background: url(../images/colorpicker_submit.png) top;
left: 322px; left: 322px;
top: 142px; top: 142px;
overflow: hidden; overflow: hidden;
} }
.colorpicker_focus { .colorpicker_focus {
background-position: center; background-position: center;
} }
.colorpicker_hex.colorpicker_focus { .colorpicker_hex.colorpicker_focus {
background-position: bottom; background-position: bottom;
} }
.colorpicker_submit.colorpicker_focus { .colorpicker_submit.colorpicker_focus {
background-position: bottom; background-position: bottom;
} }
.colorpicker_slider { .colorpicker_slider {
background-position: bottom; background-position: bottom;
} }

View File

@ -1,72 +1,72 @@
/* /*
* Timepicker stylesheet * Timepicker stylesheet
* Highly inspired from datepicker * Highly inspired from datepicker
* FG - Nov 2010 - Web3R * FG - Nov 2010 - Web3R
* *
* version 0.0.3 : Fixed some settings, more dynamic * version 0.0.3 : Fixed some settings, more dynamic
* version 0.0.4 : Removed width:100% on tables * version 0.0.4 : Removed width:100% on tables
* version 0.1.1 : set width 0 on tables to fix an ie6 bug * version 0.1.1 : set width 0 on tables to fix an ie6 bug
*/ */
.ui-timepicker-inline { display: inline; } .ui-timepicker-inline { display: inline; }
#ui-timepicker-div { #ui-timepicker-div {
padding: 0.2em; padding: 0.2em;
z-index: 1000; z-index: 1000;
} }
.ui-timepicker-table { display: inline-table; width: 0; } .ui-timepicker-table { display: inline-table; width: 0; }
.ui-timepicker-table table { margin:0.15em 0 0 0; border-collapse: collapse; } .ui-timepicker-table table { margin:0.15em 0 0 0; border-collapse: collapse; }
.ui-timepicker-hours, .ui-timepicker-minutes { padding: 0.2em; } .ui-timepicker-hours, .ui-timepicker-minutes { padding: 0.2em; }
.ui-timepicker-table .ui-timepicker-title { line-height: 1.8em; text-align: center; } .ui-timepicker-table .ui-timepicker-title { line-height: 1.8em; text-align: center; }
.ui-timepicker-table td { padding: 0.1em; width: 2.2em; } .ui-timepicker-table td { padding: 0.1em; width: 2.2em; }
.ui-timepicker-table th.periods { padding: 0.1em; width: 2.2em; } .ui-timepicker-table th.periods { padding: 0.1em; width: 2.2em; }
/* span for disabled cells */ /* span for disabled cells */
.ui-timepicker-table td span { .ui-timepicker-table td span {
display:block; display:block;
padding:0.2em 0.3em 0.2em 0.5em; padding:0.2em 0.3em 0.2em 0.5em;
width: 1.2em; width: 1.2em;
text-align:right; text-align:right;
text-decoration:none; text-decoration:none;
} }
/* anchors for clickable cells */ /* anchors for clickable cells */
.ui-timepicker-table td a { .ui-timepicker-table td a {
display:block; display:block;
padding:0.2em 0.3em 0.2em 0.5em; padding:0.2em 0.3em 0.2em 0.5em;
width: 1.2em; width: 1.2em;
cursor: pointer; cursor: pointer;
text-align:right; text-align:right;
text-decoration:none; text-decoration:none;
} }
/* buttons and button pane styling */ /* buttons and button pane styling */
.ui-timepicker .ui-timepicker-buttonpane { .ui-timepicker .ui-timepicker-buttonpane {
background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0;
} }
.ui-timepicker .ui-timepicker-buttonpane button { margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } .ui-timepicker .ui-timepicker-buttonpane button { margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
/* The close button */ /* The close button */
.ui-timepicker .ui-timepicker-close { float: right } .ui-timepicker .ui-timepicker-close { float: right }
/* the now button */ /* the now button */
.ui-timepicker .ui-timepicker-now { float: left; } .ui-timepicker .ui-timepicker-now { float: left; }
/* the deselect button */ /* the deselect button */
.ui-timepicker .ui-timepicker-deselect { float: left; } .ui-timepicker .ui-timepicker-deselect { float: left; }
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-timepicker-cover { .ui-timepicker-cover {
display: none; /*sorry for IE5*/ display: none; /*sorry for IE5*/
display/**/: block; /*sorry for IE5*/ display/**/: block; /*sorry for IE5*/
position: absolute; /*must have*/ position: absolute; /*must have*/
z-index: -1; /*must have*/ z-index: -1; /*must have*/
filter: mask(); /*must have*/ filter: mask(); /*must have*/
top: -4px; /*must have*/ top: -4px; /*must have*/
left: -4px; /*must have*/ left: -4px; /*must have*/
width: 200px; /*must have*/ width: 200px; /*must have*/
height: 200px; /*must have*/ height: 200px; /*must have*/
} }

View File

@ -1,176 +1,176 @@
/* /*
Plupload Plupload
------------------------------------------------------------------- */ ------------------------------------------------------------------- */
.plupload_button { .plupload_button {
display: -moz-inline-box; /* FF < 3*/ display: -moz-inline-box; /* FF < 3*/
display: inline-block; display: inline-block;
font: normal 12px sans-serif; font: normal 12px sans-serif;
text-decoration: none; text-decoration: none;
color: #42454a; color: #42454a;
border: 1px solid #bababa; border: 1px solid #bababa;
padding: 2px 8px 3px 20px; padding: 2px 8px 3px 20px;
margin-right: 4px; margin-right: 4px;
background: #f3f3f3 url('img/buttons.png') no-repeat 0 center; background: #f3f3f3 url('img/buttons.png') no-repeat 0 center;
outline: 0; outline: 0;
/* Optional rounded corners for browsers that support it */ /* Optional rounded corners for browsers that support it */
-moz-border-radius: 3px; -moz-border-radius: 3px;
-khtml-border-radius: 3px; -khtml-border-radius: 3px;
-webkit-border-radius: 3px; -webkit-border-radius: 3px;
border-radius: 3px; border-radius: 3px;
} }
.plupload_button:hover { .plupload_button:hover {
color: #000; color: #000;
text-decoration: none; text-decoration: none;
} }
.plupload_disabled, a.plupload_disabled:hover { .plupload_disabled, a.plupload_disabled:hover {
color: #737373; color: #737373;
border-color: #c5c5c5; border-color: #c5c5c5;
background: #ededed url('img/buttons-disabled.png') no-repeat 0 center; background: #ededed url('img/buttons-disabled.png') no-repeat 0 center;
cursor: default; cursor: default;
} }
.plupload_add { .plupload_add {
background-position: -181px center; background-position: -181px center;
} }
.plupload_wrapper { .plupload_wrapper {
font: normal 11px Verdana,sans-serif; font: normal 11px Verdana,sans-serif;
width: 100%; width: 100%;
} }
.plupload_container { .plupload_container {
padding: 8px; padding: 8px;
background: url('img/transp50.png'); background: url('img/transp50.png');
/*-moz-border-radius: 5px;*/ /*-moz-border-radius: 5px;*/
} }
.plupload_container input { .plupload_container input {
border: 1px solid #DDD; border: 1px solid #DDD;
font: normal 11px Verdana,sans-serif; font: normal 11px Verdana,sans-serif;
width: 98%; width: 98%;
} }
.plupload_header {background: #2A2C2E url('img/backgrounds.gif') repeat-x;} .plupload_header {background: #2A2C2E url('img/backgrounds.gif') repeat-x;}
.plupload_header_content { .plupload_header_content {
min-height: 56px; min-height: 56px;
padding-left: 10px; padding-left: 10px;
color: #FFF; color: #FFF;
} }
.plupload_header_title { .plupload_header_title {
font: normal 18px sans-serif; font: normal 18px sans-serif;
padding: 6px 0 3px; padding: 6px 0 3px;
} }
.plupload_header_text { .plupload_header_text {
font: normal 12px sans-serif; font: normal 12px sans-serif;
} }
.plupload_filelist { .plupload_filelist {
margin: 0; margin: 0;
padding: 0; padding: 0;
list-style: none; list-style: none;
} }
.plupload_scroll .plupload_filelist { .plupload_scroll .plupload_filelist {
height: 185px; height: 185px;
background: #F5F5F5; background: #F5F5F5;
overflow-y: scroll; overflow-y: scroll;
} }
.plupload_filelist li { .plupload_filelist li {
padding: 10px 8px; padding: 10px 8px;
background: #F5F5F5 url('img/backgrounds.gif') repeat-x 0 -156px; background: #F5F5F5 url('img/backgrounds.gif') repeat-x 0 -156px;
border-bottom: 1px solid #DDD; border-bottom: 1px solid #DDD;
} }
.plupload_filelist_header, .plupload_filelist_footer { .plupload_filelist_header, .plupload_filelist_footer {
background: #DFDFDF; background: #DFDFDF;
padding: 8px 8px; padding: 8px 8px;
color: #42454A; color: #42454A;
} }
.plupload_filelist_header { .plupload_filelist_header {
border-top: 1px solid #EEE; border-top: 1px solid #EEE;
border-bottom: 1px solid #CDCDCD; border-bottom: 1px solid #CDCDCD;
} }
.plupload_filelist_footer {border-top: 1px solid #FFF; height: 22px; line-height: 20px; vertical-align: middle;} .plupload_filelist_footer {border-top: 1px solid #FFF; height: 22px; line-height: 20px; vertical-align: middle;}
.plupload_file_name {float: left; overflow: hidden} .plupload_file_name {float: left; overflow: hidden}
.plupload_file_status {color: #777;} .plupload_file_status {color: #777;}
.plupload_file_status span {color: #42454A;} .plupload_file_status span {color: #42454A;}
.plupload_file_size, .plupload_file_status, .plupload_progress { .plupload_file_size, .plupload_file_status, .plupload_progress {
float: right; float: right;
width: 80px; width: 80px;
} }
.plupload_file_size, .plupload_file_status, .plupload_file_action {text-align: right;} .plupload_file_size, .plupload_file_status, .plupload_file_action {text-align: right;}
.plupload_filelist .plupload_file_name {width: 68%;} .plupload_filelist .plupload_file_name {width: 68%;}
.plupload_file_action { .plupload_file_action {
float: right; float: right;
width: 16px; width: 16px;
height: 16px; height: 16px;
margin-left: 15px; margin-left: 15px;
} }
.plupload_file_action * { .plupload_file_action * {
display: none; display: none;
width: 16px; width: 16px;
height: 16px; height: 16px;
} }
li.plupload_uploading {background: #ECF3DC url('img/backgrounds.gif') repeat-x 0 -238px;} li.plupload_uploading {background: #ECF3DC url('img/backgrounds.gif') repeat-x 0 -238px;}
li.plupload_done {color:#AAA} li.plupload_done {color:#AAA}
li.plupload_delete a { li.plupload_delete a {
background: url('img/delete.gif'); background: url('img/delete.gif');
} }
li.plupload_failed a { li.plupload_failed a {
background: url('img/error.gif'); background: url('img/error.gif');
cursor: default; cursor: default;
} }
li.plupload_done a { li.plupload_done a {
background: url('img/done.gif'); background: url('img/done.gif');
cursor: default; cursor: default;
} }
.plupload_progress, .plupload_upload_status { .plupload_progress, .plupload_upload_status {
display: none; display: none;
} }
.plupload_progress_container { .plupload_progress_container {
margin-top: 3px; margin-top: 3px;
border: 1px solid #CCC; border: 1px solid #CCC;
background: #FFF; background: #FFF;
padding: 1px; padding: 1px;
} }
.plupload_progress_bar { .plupload_progress_bar {
width: 0px; width: 0px;
height: 7px; height: 7px;
background: #CDEB8B; background: #CDEB8B;
} }
.plupload_scroll .plupload_filelist_header .plupload_file_action, .plupload_scroll .plupload_filelist_footer .plupload_file_action { .plupload_scroll .plupload_filelist_header .plupload_file_action, .plupload_scroll .plupload_filelist_footer .plupload_file_action {
margin-right: 17px; margin-right: 17px;
} }
/* Floats */ /* Floats */
.plupload_clear,.plupload_clearer {clear: both;} .plupload_clear,.plupload_clearer {clear: both;}
.plupload_clearer, .plupload_progress_bar { .plupload_clearer, .plupload_progress_bar {
display: block; display: block;
font-size: 0; font-size: 0;
line-height: 0; line-height: 0;
} }
li.plupload_droptext { li.plupload_droptext {
background: transparent; background: transparent;
text-align: center; text-align: center;
vertical-align: middle; vertical-align: middle;
border: 0; border: 0;
line-height: 165px; line-height: 165px;
} }

View File

@ -1,185 +1,185 @@
/* ================================================================ /* ================================================================
This copyright notice must be kept untouched in the stylesheet at This copyright notice must be kept untouched in the stylesheet at
all times. all times.
The original version of this stylesheet and the associated (x)html The original version of this stylesheet and the associated (x)html
is available at http://www.stunicholls.com/menu/pro_dropdown_3.html is available at http://www.stunicholls.com/menu/pro_dropdown_3.html
Copyright (c) 2005-2007 Stu Nicholls. All rights reserved. Copyright (c) 2005-2007 Stu Nicholls. All rights reserved.
This stylesheet and the associated (x)html may be modified in any This stylesheet and the associated (x)html may be modified in any
way to fit your requirements. way to fit your requirements.
=================================================================== */ =================================================================== */
#nav { #nav {
padding:7px 0 0 6px; padding:7px 0 0 6px;
margin:0; margin:0;
list-style:none; list-style:none;
height:28px; height:28px;
background:#353535; background:#353535;
position:relative; position:relative;
z-index:500; z-index:500;
font-family:Arial, Helvetica, sans-serif; font-family:Arial, Helvetica, sans-serif;
border-top:1px solid #7e7e7e; border-top:1px solid #7e7e7e;
border-bottom:1px solid #242424; border-bottom:1px solid #242424;
-moz-box-shadow: 0 2px 5px rgba(0,0,0,.35); -moz-box-shadow: 0 2px 5px rgba(0,0,0,.35);
-webkit-box-shadow: 0 2px 5px rgba(0,0,0,.35); -webkit-box-shadow: 0 2px 5px rgba(0,0,0,.35);
box-shadow: 0 2px 5px rgba(0,0,0,.35); box-shadow: 0 2px 5px rgba(0,0,0,.35);
} }
#nav li.top { #nav li.top {
display:block; display:block;
float:left; float:left;
margin:0 5px 0 0; margin:0 5px 0 0;
} }
#nav li a.top_link { #nav li a.top_link {
display:block; display:block;
float:left; float:left;
height:18px; height:18px;
color:#ccc; color:#ccc;
text-decoration:none; text-decoration:none;
font-size:11px; font-size:11px;
text-transform:uppercase; text-transform:uppercase;
font-weight:bold; font-weight:bold;
padding:4px 0 0 14px; padding:4px 0 0 14px;
cursor:pointer; cursor:pointer;
} }
#nav li a.top_link span { #nav li a.top_link span {
float:left; float:left;
display:block; display:block;
padding:0 14px 0 0; padding:0 14px 0 0;
} }
#nav li a.top_link span.down { #nav li a.top_link span.down {
float:left; float:left;
display:block; display:block;
padding:0 28px 0 0px; padding:0 28px 0 0px;
background:url(images/down_arrow.png) no-repeat right 50%; background:url(images/down_arrow.png) no-repeat right 50%;
} }
#nav li:hover a.top_link, #nav li.active a.top_link, #nav li.active:hover a.top_link { #nav li:hover a.top_link, #nav li.active a.top_link, #nav li.active:hover a.top_link {
color:#fff; color:#fff;
background:#000; background:#000;
-moz-border-radius: 3px; -moz-border-radius: 3px;
-webkit-border-radius: 3px; -webkit-border-radius: 3px;
border-radius: 3px; border-radius: 3px;
} }
#nav li:hover a.top_link span { #nav li:hover a.top_link span {
} }
#nav li:hover a.top_link span.down { #nav li:hover a.top_link span.down {
background:url(images/down_arrow.png) no-repeat right 50%; background:url(images/down_arrow.png) no-repeat right 50%;
} }
/* Default list styling */ /* Default list styling */
#nav li:hover { #nav li:hover {
position:relative; position:relative;
z-index:200; z-index:200;
} }
#nav li:hover ul.sub { #nav li:hover ul.sub {
left:1px; left:1px;
top:22px; top:22px;
background: #202020; background: #202020;
padding:3px; padding:3px;
border:1px solid #161616; border:1px solid #161616;
white-space:nowrap; white-space:nowrap;
width:200px; width:200px;
height:auto; height:auto;
z-index:300; z-index:300;
-moz-border-radius: 3px; -moz-border-radius: 3px;
-webkit-border-radius: 3px; -webkit-border-radius: 3px;
border-radius: 3px; border-radius: 3px;
} }
#nav li:hover ul.sub li { #nav li:hover ul.sub li {
display:block; display:block;
height:22px; height:22px;
position:relative; position:relative;
float:left; float:left;
width:200px; width:200px;
font-weight:normal; font-weight:normal;
} }
#nav li:hover ul.sub li a { #nav li:hover ul.sub li a {
display:block; display:block;
font-size:12px; font-size:12px;
height:20px; height:20px;
width:198px; width:198px;
line-height:20px; line-height:20px;
text-indent:5px; text-indent:5px;
color:#fff; color:#fff;
text-decoration:none; text-decoration:none;
border:1px solid #202020; border:1px solid #202020;
-moz-border-radius: 2px; -moz-border-radius: 2px;
-webkit-border-radius: 2px; -webkit-border-radius: 2px;
border-radius: 2px; border-radius: 2px;
} }
#nav li ul.sub li a.fly { #nav li ul.sub li a.fly {
background:#202020 url(images/arrow.png) 190px 6px no-repeat; background:#202020 url(images/arrow.png) 190px 6px no-repeat;
} }
#nav li:hover ul.sub li a:hover { #nav li:hover ul.sub li a:hover {
background:#3d3d3d; background:#3d3d3d;
color:#fff; color:#fff;
border-color:#4e4e4e; border-color:#4e4e4e;
} }
#nav li:hover ul.sub li a.fly:hover { #nav li:hover ul.sub li a.fly:hover {
background:#3d3d3d url(images/arrow_over.png) 190px 6px no-repeat; background:#3d3d3d url(images/arrow_over.png) 190px 6px no-repeat;
color:#fff; color:#fff;
} }
#nav li strong { #nav li strong {
display:block; display:block;
font-size:12px; font-size:12px;
height:20px; height:20px;
width:198px; width:198px;
line-height:20px; line-height:20px;
margin-bottom:3px; margin-bottom:3px;
text-indent:6px; text-indent:6px;
color:#ff5d1a; color:#ff5d1a;
border-bottom:1px solid #414141; border-bottom:1px solid #414141;
cursor:default; cursor:default;
font-weight:bold; font-weight:bold;
} }
#nav li:hover li:hover ul, #nav li:hover li:hover li:hover ul, #nav li:hover li:hover li:hover li:hover ul, #nav li:hover li:hover li:hover li:hover li:hover ul { #nav li:hover li:hover ul, #nav li:hover li:hover li:hover ul, #nav li:hover li:hover li:hover li:hover ul, #nav li:hover li:hover li:hover li:hover li:hover ul {
left:200px; left:200px;
top:-4px; top:-4px;
background: #202020; background: #202020;
padding:3px; padding:3px;
border:1px solid #161616; border:1px solid #161616;
white-space:nowrap; white-space:nowrap;
width:200px; width:200px;
z-index:400; z-index:400;
height:auto; height:auto;
-moz-border-radius: 3px; -moz-border-radius: 3px;
-webkit-border-radius: 3px; -webkit-border-radius: 3px;
border-radius: 3px; border-radius: 3px;
} }
#nav ul, #nav li:hover ul ul, #nav li:hover li:hover ul ul, #nav li:hover li:hover li:hover ul ul, #nav li:hover li:hover li:hover li:hover ul ul { #nav ul, #nav li:hover ul ul, #nav li:hover li:hover ul ul, #nav li:hover li:hover li:hover ul ul, #nav li:hover li:hover li:hover li:hover ul ul {
position:absolute; position:absolute;
left:-9999px; left:-9999px;
top:-9999px; top:-9999px;
width:0; width:0;
height:0; height:0;
margin:0; margin:0;
padding:0; padding:0;
list-style:none; list-style:none;
} }
#nav li:hover li:hover a.fly, #nav li:hover li:hover li:hover a.fly, #nav li:hover li:hover li:hover li:hover a.fly, #nav li:hover li:hover li:hover li:hover li:hover a.fly { #nav li:hover li:hover a.fly, #nav li:hover li:hover li:hover a.fly, #nav li:hover li:hover li:hover li:hover a.fly, #nav li:hover li:hover li:hover li:hover li:hover a.fly {
background:#3d3d3d url(images/arrow_over.png) 190px 6px no-repeat; background:#3d3d3d url(images/arrow_over.png) 190px 6px no-repeat;
color:#fff; color:#fff;
border-color:#4e4e4e; border-color:#4e4e4e;
} }
#nav li:hover li:hover li:hover a.fly { #nav li:hover li:hover li:hover a.fly {
background:#3d3d3d url(images/arrow_over.png) 190px 6px no-repeat; background:#3d3d3d url(images/arrow_over.png) 190px 6px no-repeat;
color:#fff; color:#fff;
border-color:#4e4e4e; border-color:#4e4e4e;
} }
#nav li:hover li:hover li:hover li:hover li:hover a.fly { #nav li:hover li:hover li:hover li:hover li:hover a.fly {
background:#3d3d3d url(images/arrow_over.png) 190px 6px no-repeat; background:#3d3d3d url(images/arrow_over.png) 190px 6px no-repeat;
color:#fff; color:#fff;
border-color:#4e4e4e; border-color:#4e4e4e;
} }
#nav li:hover li:hover li a.fly, #nav li:hover li:hover li a.fly,
#nav li:hover li:hover li:hover li a.fly, #nav li:hover li:hover li:hover li a.fly,
#nav li:hover li:hover li:hover li:hover li a.fly { #nav li:hover li:hover li:hover li:hover li a.fly {
background:#202020 url(images/arrow.png) 190px 6px no-repeat; background:#202020 url(images/arrow.png) 190px 6px no-repeat;
color:#fff; color:#fff;
border-color:#202020; border-color:#202020;
} }

File diff suppressed because it is too large Load Diff

View File

@ -105,7 +105,7 @@ select {
} }
.airtime_auth_help_icon, .custom_auth_help_icon, .stream_username_help_icon, .airtime_auth_help_icon, .custom_auth_help_icon, .stream_username_help_icon,
.playlist_type_help_icon, .master_username_help_icon { .playlist_type_help_icon, .master_username_help_icon, .repeat_tracks_help_icon{
cursor: help; cursor: help;
position: relative; position: relative;
display:inline-block; zoom:1; display:inline-block; zoom:1;
@ -514,6 +514,9 @@ table.library-get-file-md.table-small{
/***** SMART BLOCK SPECIFIC STYLES BEGIN *****/ /***** SMART BLOCK SPECIFIC STYLES BEGIN *****/
.db-logic-label{
font-size:11px;
}
.sp-invisible{ .sp-invisible{
visibility: hidden; visibility: hidden;
} }

View File

@ -14,5 +14,6 @@ function isAudioSupported(mime){
//Note that checking the navigator.mimeTypes value does not work for IE7, but the alternative //Note that checking the navigator.mimeTypes value does not work for IE7, but the alternative
//is adding a javascript library to do the work for you, which seems like overkill.... //is adding a javascript library to do the work for you, which seems like overkill....
return (!!audio.canPlayType && audio.canPlayType(bMime) != "") || return (!!audio.canPlayType && audio.canPlayType(bMime) != "") ||
(mime.indexOf("mp3") != -1 && navigator.mimeTypes ["application/x-shockwave-flash"] != undefined); (mime.indexOf("mp3") != -1 && navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) ||
(mime.indexOf("mp4") != -1 && navigator.mimeTypes ["application/x-shockwave-flash"] != undefined);
} }

View File

@ -37,6 +37,11 @@ var AIRTIME = (function(AIRTIME) {
var $nRow = $(nRow); var $nRow = $(nRow);
if (aData.ftype === "audioclip") { if (aData.ftype === "audioclip") {
$nRow.addClass("lib-audio"); $nRow.addClass("lib-audio");
$image = $nRow.find('td.library_type');
if (!isAudioSupported(aData.mime)) {
$image.html('<span class="ui-icon ui-icon-locked"></span>');
aData.image = '<span class="ui-icon ui-icon-locked"></span>';
}
} else if (aData.ftype === "stream") { } else if (aData.ftype === "stream") {
$nRow.addClass("lib-stream"); $nRow.addClass("lib-stream");
} else if (aData.ftype === "block") { } else if (aData.ftype === "block") {
@ -64,8 +69,9 @@ var AIRTIME = (function(AIRTIME) {
helper : function() { helper : function() {
var $el = $(this), selected = mod var $el = $(this), selected = mod
.getChosenAudioFilesLength(), container, message, li = $("#side_playlist ul[id='spl_sortable'] li:first"), width = li .getChosenAudioFilesLength(), container, message, li = $("#side_playlist ul[id='spl_sortable'] li:first"),
.width(), height = 55; width = li.width(), height = 55;
if (width > 798) width = 798;
// dragging an element that has an unselected // dragging an element that has an unselected
// checkbox. // checkbox.

View File

@ -29,6 +29,11 @@ var AIRTIME = (function(AIRTIME) {
if (aData.ftype === "audioclip") { if (aData.ftype === "audioclip") {
$nRow.addClass("lib-audio"); $nRow.addClass("lib-audio");
$image = $nRow.find('td.library_type');
if (!isAudioSupported(aData.mime)) {
$image.html('<span class="ui-icon ui-icon-locked"></span>');
aData.image = '<span class="ui-icon ui-icon-locked"></span>';
}
} else if (aData.ftype === "stream") { } else if (aData.ftype === "stream") {
$nRow.addClass("lib-stream"); $nRow.addClass("lib-stream");
} else { } else {

View File

@ -70,7 +70,7 @@ var AIRTIME = (function(AIRTIME) {
}; };
mod.getChosenAudioFilesLength = function(){ mod.getChosenAudioFilesLength = function(){
//var files = Object.keys(chosenItems), // var files = Object.keys(chosenItems),
var files, var files,
$trs, $trs,
cItem, cItem,
@ -215,7 +215,7 @@ var AIRTIME = (function(AIRTIME) {
mod.removeFromChosen = function($el) { mod.removeFromChosen = function($el) {
var id = $el.attr("id"); var id = $el.attr("id");
//used to not keep dragged items selected. // used to not keep dragged items selected.
if (!$el.hasClass(LIB_SELECTED_CLASS)) { if (!$el.hasClass(LIB_SELECTED_CLASS)) {
delete chosenItems[id]; delete chosenItems[id];
} }
@ -252,11 +252,11 @@ var AIRTIME = (function(AIRTIME) {
}; };
/* /*
* selects all items which the user can currently see. * selects all items which the user can currently see. (behaviour taken from
* (behaviour taken from gmail) * gmail)
* *
* by default the items are selected in reverse order * by default the items are selected in reverse order so we need to reverse
* so we need to reverse it back * it back
*/ */
mod.selectCurrentPage = function() { mod.selectCurrentPage = function() {
$.fn.reverse = [].reverse; $.fn.reverse = [].reverse;
@ -276,8 +276,8 @@ var AIRTIME = (function(AIRTIME) {
}; };
/* /*
* deselects all items that the user can currently see. * deselects all items that the user can currently see. (behaviour taken
* (behaviour taken from gmail) * from gmail)
*/ */
mod.deselectCurrentPage = function() { mod.deselectCurrentPage = function() {
var $inputs = $libTable.find("tbody input:checkbox"), var $inputs = $libTable.find("tbody input:checkbox"),
@ -328,7 +328,7 @@ var AIRTIME = (function(AIRTIME) {
temp, temp,
aMedia = []; aMedia = [];
//process selected files/playlists. // process selected files/playlists.
for (item in aData) { for (item in aData) {
temp = aData[item]; temp = aData[item];
if (temp !== null && temp.hasOwnProperty('id') ) { if (temp !== null && temp.hasOwnProperty('id') ) {
@ -433,36 +433,37 @@ var AIRTIME = (function(AIRTIME) {
oTable = $libTable.dataTable( { oTable = $libTable.dataTable( {
//put hidden columns at the top to insure they can never be visible on the table through column reordering. // put hidden columns at the top to insure they can never be visible
// on the table through column reordering.
"aoColumns": [ "aoColumns": [
/* ftype */ { "sTitle" : "" , "mDataProp" : "ftype" , "bSearchable" : false , "bVisible" : false } , /* ftype */ { "sTitle" : "" , "mDataProp" : "ftype" , "bSearchable" : false , "bVisible" : false } ,
/* Checkbox */ { "sTitle" : "" , "mDataProp" : "checkbox" , "bSortable" : false , "bSearchable" : false , "sWidth" : "25px" , "sClass" : "library_checkbox" } , /* Checkbox */ { "sTitle" : "" , "mDataProp" : "checkbox" , "bSortable" : false , "bSearchable" : false , "sWidth" : "25px" , "sClass" : "library_checkbox" } ,
/* Type */ { "sTitle" : "" , "mDataProp" : "image" , "bSearchable" : false , "sWidth" : "25px" , "sClass" : "library_type" , "iDataSort" : 0 } , /* Type */ { "sTitle" : "" , "mDataProp" : "image" , "bSearchable" : false , "sWidth" : "25px" , "sClass" : "library_type" , "iDataSort" : 0 } ,
/* Title */ { "sTitle" : "Title" , "mDataProp" : "track_title" , "sClass" : "library_title" , "sWidth" : "170px" } , /* Title */ { "sTitle" : "Title" , "mDataProp" : "track_title" , "sClass" : "library_title" , "sWidth" : "170px" } ,
/* Creator */ { "sTitle" : "Creator" , "mDataProp" : "artist_name" , "sClass" : "library_creator" , "sWidth" : "160px" } , /* Creator */ { "sTitle" : "Creator" , "mDataProp" : "artist_name" , "sClass" : "library_creator" , "sWidth" : "160px" } ,
/* Album */ { "sTitle" : "Album" , "mDataProp" : "album_title" , "sClass" : "library_album" , "sWidth" : "150px" } , /* Album */ { "sTitle" : "Album" , "mDataProp" : "album_title" , "sClass" : "library_album" , "sWidth" : "150px" } ,
/* Bit Rate */ { "sTitle" : "Bit Rate" , "mDataProp" : "bit_rate" , "bVisible" : false , "sClass" : "library_bitrate" , "sWidth" : "80px" }, /* Bit Rate */ { "sTitle" : "Bit Rate" , "mDataProp" : "bit_rate" , "bVisible" : false , "sClass" : "library_bitrate" , "sWidth" : "80px" },
/* BPM */ { "sTitle" : "BPM" , "mDataProp" : "bpm" , "bVisible" : false , "sClass" : "library_bpm" , "sWidth" : "50px" }, /* BPM */ { "sTitle" : "BPM" , "mDataProp" : "bpm" , "bVisible" : false , "sClass" : "library_bpm" , "sWidth" : "50px" },
/* Composer */ { "sTitle" : "Composer" , "mDataProp" : "composer" , "bVisible" : false , "sClass" : "library_composer" , "sWidth" : "150px" }, /* Composer */ { "sTitle" : "Composer" , "mDataProp" : "composer" , "bVisible" : false , "sClass" : "library_composer" , "sWidth" : "150px" },
/* Conductor */ { "sTitle" : "Conductor" , "mDataProp" : "conductor" , "bVisible" : false , "sClass" : "library_conductor" , "sWidth" : "125px" }, /* Conductor */ { "sTitle" : "Conductor" , "mDataProp" : "conductor" , "bVisible" : false , "sClass" : "library_conductor" , "sWidth" : "125px" },
/* Copyright */ { "sTitle" : "Copyright" , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "sWidth" : "125px" }, /* Copyright */ { "sTitle" : "Copyright" , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "sWidth" : "125px" },
/* Encoded */ { "sTitle" : "Encoded By" , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" }, /* Encoded */ { "sTitle" : "Encoded By" , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" },
/* Genre */ { "sTitle" : "Genre" , "mDataProp" : "genre" , "bVisible" : false , "sClass" : "library_genre" , "sWidth" : "100px" }, /* Genre */ { "sTitle" : "Genre" , "mDataProp" : "genre" , "bVisible" : false , "sClass" : "library_genre" , "sWidth" : "100px" },
/* ISRC Number */ { "sTitle" : "ISRC" , "mDataProp" : "isrc_number" , "bVisible" : false , "sClass" : "library_isrc" , "sWidth" : "150px" }, /* ISRC Number */ { "sTitle" : "ISRC" , "mDataProp" : "isrc_number" , "bVisible" : false , "sClass" : "library_isrc" , "sWidth" : "150px" },
/* Label */ { "sTitle" : "Label" , "mDataProp" : "label" , "bVisible" : false , "sClass" : "library_label" , "sWidth" : "125px" }, /* Label */ { "sTitle" : "Label" , "mDataProp" : "label" , "bVisible" : false , "sClass" : "library_label" , "sWidth" : "125px" },
/* Language */ { "sTitle" : "Language" , "mDataProp" : "language" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" }, /* Language */ { "sTitle" : "Language" , "mDataProp" : "language" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" },
/* Last Modified */ { "sTitle" : "Last Modified" , "mDataProp" : "mtime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" }, /* Last Modified */ { "sTitle" : "Last Modified" , "mDataProp" : "mtime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
/* Last Played */ { "sTitle" : "Last Played " , "mDataProp" : "lptime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" }, /* Last Played */ { "sTitle" : "Last Played " , "mDataProp" : "lptime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
/* Length */ { "sTitle" : "Length" , "mDataProp" : "length" , "sClass" : "library_length" , "sWidth" : "80px" } , /* Length */ { "sTitle" : "Length" , "mDataProp" : "length" , "sClass" : "library_length" , "sWidth" : "80px" } ,
/* Mime */ { "sTitle" : "Mime" , "mDataProp" : "mime" , "bVisible" : false , "sClass" : "library_mime" , "sWidth" : "80px" }, /* Mime */ { "sTitle" : "Mime" , "mDataProp" : "mime" , "bVisible" : false , "sClass" : "library_mime" , "sWidth" : "80px" },
/* Mood */ { "sTitle" : "Mood" , "mDataProp" : "mood" , "bVisible" : false , "sClass" : "library_mood" , "sWidth" : "70px" }, /* Mood */ { "sTitle" : "Mood" , "mDataProp" : "mood" , "bVisible" : false , "sClass" : "library_mood" , "sWidth" : "70px" },
/* Owner */ { "sTitle" : "Owner" , "mDataProp" : "owner_id" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" }, /* Owner */ { "sTitle" : "Owner" , "mDataProp" : "owner_id" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" },
/* Replay Gain */ { "sTitle" : "Replay Gain" , "mDataProp" : "replay_gain" , "bVisible" : false , "sClass" : "library_replay_gain" , "sWidth" : "80px" }, /* Replay Gain */ { "sTitle" : "Replay Gain" , "mDataProp" : "replay_gain" , "bVisible" : false , "sClass" : "library_replay_gain" , "sWidth" : "80px" },
/* Sample Rate */ { "sTitle" : "Sample Rate" , "mDataProp" : "sample_rate" , "bVisible" : false , "sClass" : "library_sr" , "sWidth" : "80px" }, /* Sample Rate */ { "sTitle" : "Sample Rate" , "mDataProp" : "sample_rate" , "bVisible" : false , "sClass" : "library_sr" , "sWidth" : "80px" },
/* Track Number */ { "sTitle" : "Track Number" , "mDataProp" : "track_number" , "bVisible" : false , "sClass" : "library_track" , "sWidth" : "65px" }, /* Track Number */ { "sTitle" : "Track Number" , "mDataProp" : "track_number" , "bVisible" : false , "sClass" : "library_track" , "sWidth" : "65px" },
/* Upload Time */ { "sTitle" : "Uploaded" , "mDataProp" : "utime" , "sClass" : "library_upload_time" , "sWidth" : "125px" } , /* Upload Time */ { "sTitle" : "Uploaded" , "mDataProp" : "utime" , "sClass" : "library_upload_time" , "sWidth" : "125px" } ,
/* Website */ { "sTitle" : "Website" , "mDataProp" : "info_url" , "bVisible" : false , "sClass" : "library_url" , "sWidth" : "150px" }, /* Website */ { "sTitle" : "Website" , "mDataProp" : "info_url" , "bVisible" : false , "sClass" : "library_url" , "sWidth" : "150px" },
/* Year */ { "sTitle" : "Year" , "mDataProp" : "year" , "bVisible" : false , "sClass" : "library_year" , "sWidth" : "60px" } /* Year */ { "sTitle" : "Year" , "mDataProp" : "year" , "bVisible" : false , "sClass" : "library_year" , "sWidth" : "60px" }
], ],
"bProcessing": true, "bProcessing": true,
@ -472,7 +473,7 @@ var AIRTIME = (function(AIRTIME) {
"bStateSave": true, "bStateSave": true,
"fnStateSaveParams": function (oSettings, oData) { "fnStateSaveParams": function (oSettings, oData) {
//remove oData components we don't want to save. // remove oData components we don't want to save.
delete oData.oSearch; delete oData.oSearch;
delete oData.aoSearchCols; delete oData.aoSearchCols;
}, },
@ -499,8 +500,8 @@ var AIRTIME = (function(AIRTIME) {
length, length,
a = oData.abVisCols; a = oData.abVisCols;
//putting serialized data back into the correct js type to make // putting serialized data back into the correct js type to make
//sure everything works properly. // sure everything works properly.
for (i = 0, length = a.length; i < length; i++) { for (i = 0, length = a.length; i < length; i++) {
if (typeof(a[i]) === "string") { if (typeof(a[i]) === "string") {
a[i] = (a[i] === "true") ? true : false; a[i] = (a[i] === "true") ? true : false;
@ -524,11 +525,12 @@ var AIRTIME = (function(AIRTIME) {
"sAjaxDataProp": "files", "sAjaxDataProp": "files",
"fnServerData": function ( sSource, aoData, fnCallback ) { "fnServerData": function ( sSource, aoData, fnCallback ) {
/* The real validation check is done in dataTables.columnFilter.js /*
* We also need to check it here because datatable is redrawn everytime * The real validation check is done in
* an action is performed in the Library page. * dataTables.columnFilter.js We also need to check it here
* In order for datatable to redraw the advanced search fields * because datatable is redrawn everytime an action is performed
* MUST all be valid. * in the Library page. In order for datatable to redraw the
* advanced search fields MUST all be valid.
*/ */
var advSearchFields = $("div#advanced_search").children(':visible'); var advSearchFields = $("div#advanced_search").children(':visible');
var advSearchValid = validateAdvancedSearch(advSearchFields); var advSearchValid = validateAdvancedSearch(advSearchFields);
@ -536,11 +538,11 @@ var AIRTIME = (function(AIRTIME) {
aoData.push( { name: "format", value: "json"} ); aoData.push( { name: "format", value: "json"} );
aoData.push( { name: "advSearch", value: advSearchValid} ); aoData.push( { name: "advSearch", value: advSearchValid} );
//push whether to search files/playlists or all. // push whether to search files/playlists or all.
type = $("#library_display_type").find("select").val(); type = $("#library_display_type").find("select").val();
type = (type === undefined) ? 0 : type; type = (type === undefined) ? 0 : type;
aoData.push( { name: "type", value: type} ); aoData.push( { name: "type", value: type} );
$.ajax( { $.ajax( {
"dataType": 'json', "dataType": 'json',
"type": "POST", "type": "POST",
@ -552,30 +554,39 @@ var AIRTIME = (function(AIRTIME) {
"fnRowCallback": AIRTIME.library.fnRowCallback, "fnRowCallback": AIRTIME.library.fnRowCallback,
"fnCreatedRow": function( nRow, aData, iDataIndex ) { "fnCreatedRow": function( nRow, aData, iDataIndex ) {
//add the play function to the library_type td // add the play function to the library_type td
$(nRow).find('td.library_type').click(function(){ $(nRow).find('td.library_type').click(function(){
if (aData.ftype === 'playlist' && aData.length !== '0.0'){ if (aData.ftype === 'playlist' && aData.length !== '0.0'){
playlistIndex = $(this).parent().attr('id').substring(3); //remove the pl_ playlistIndex = $(this).parent().attr('id').substring(3); // remove
// the
// pl_
open_playlist_preview(playlistIndex, 0); open_playlist_preview(playlistIndex, 0);
} else if (aData.ftype === 'audioclip') { } else if (aData.ftype === 'audioclip') {
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name); if (isAudioSupported(aData.mime)) {
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
}
} else if (aData.ftype == 'stream') { } else if (aData.ftype == 'stream') {
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name); open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
} else if (aData.ftype == 'block' && aData.bl_type == 'static') { } else if (aData.ftype == 'block' && aData.bl_type == 'static') {
blockIndex = $(this).parent().attr('id').substring(3); //remove the bl_ blockIndex = $(this).parent().attr('id').substring(3); // remove
// the
// bl_
open_block_preview(blockIndex, 0); open_block_preview(blockIndex, 0);
} }
return false; return false;
}); });
alreadyclicked=false; alreadyclicked=false;
//call the context menu so we can prevent the event from propagating. // call the context menu so we can prevent the event from
// propagating.
$(nRow).find('td:not(.library_checkbox, .library_type)').click(function(e){ $(nRow).find('td:not(.library_checkbox, .library_type)').click(function(e){
var el=$(this); var el=$(this);
if (alreadyclicked) if (alreadyclicked)
{ {
alreadyclicked=false; // reset alreadyclicked=false; // reset
clearTimeout(alreadyclickedTimeout); // prevent this from happening clearTimeout(alreadyclickedTimeout); // prevent this
// from
// happening
// do what needs to happen on double click. // do what needs to happen on double click.
$tr = $(el).parent(); $tr = $(el).parent();
@ -587,8 +598,8 @@ var AIRTIME = (function(AIRTIME) {
alreadyclicked=true; alreadyclicked=true;
alreadyclickedTimeout=setTimeout(function(){ alreadyclickedTimeout=setTimeout(function(){
alreadyclicked=false; // reset when it happens alreadyclicked=false; // reset when it happens
// do what needs to happen on single click. // do what needs to happen on single click.
// use el instead of $(this) because $(this) is // use el instead of $(this) because $(this) is
// no longer the element // no longer the element
el.contextMenu({x: e.pageX, y: e.pageY}); el.contextMenu({x: e.pageX, y: e.pageY});
},300); // <-- dblclick tolerance here },300); // <-- dblclick tolerance here
@ -596,7 +607,8 @@ var AIRTIME = (function(AIRTIME) {
return false; return false;
}); });
//add a tool tip to appear when the user clicks on the type icon. // add a tool tip to appear when the user clicks on the type
// icon.
$(nRow).find("td:not(.library_checkbox, .library_type)").qtip({ $(nRow).find("td:not(.library_checkbox, .library_type)").qtip({
content: { content: {
text: "Loading...", text: "Loading...",
@ -620,7 +632,8 @@ var AIRTIME = (function(AIRTIME) {
}, },
my: 'left center', my: 'left center',
at: 'right center', at: 'right center',
viewport: $(window), // Keep the tooltip on-screen at all times viewport: $(window), // Keep the tooltip on-screen at
// all times
effect: false // Disable positioning animation effect: false // Disable positioning animation
}, },
style: { style: {
@ -638,10 +651,11 @@ var AIRTIME = (function(AIRTIME) {
hide: {event:'mouseout', delay: 50, fixed:true} hide: {event:'mouseout', delay: 50, fixed:true}
}); });
}, },
//remove any selected nodes before the draw. // remove any selected nodes before the draw.
"fnPreDrawCallback": function( oSettings ) { "fnPreDrawCallback": function( oSettings ) {
//make sure any dragging helpers are removed or else they'll be stranded on the screen. // make sure any dragging helpers are removed or else they'll be
// stranded on the screen.
$("#draggingContainer").remove(); $("#draggingContainer").remove();
}, },
"fnDrawCallback": AIRTIME.library.fnDrawCallback, "fnDrawCallback": AIRTIME.library.fnDrawCallback,
@ -673,14 +687,32 @@ var AIRTIME = (function(AIRTIME) {
setColumnFilter(oTable); setColumnFilter(oTable);
oTable.fnSetFilteringDelay(350); oTable.fnSetFilteringDelay(350);
var simpleSearchText;
$libContent.on("click", "legend", function(){ $libContent.on("click", "legend", function(){
$simpleSearch = $libContent.find("#library_display_filter label");
var $fs = $(this).parents("fieldset"); var $fs = $(this).parents("fieldset");
if ($fs.hasClass("closed")) { if ($fs.hasClass("closed")) {
$fs.removeClass("closed"); $fs.removeClass("closed");
//keep value of simple search for when user switches back to it
simpleSearchText = $simpleSearch.find('input').val();
// clear the simple search text field and reset datatable
$(".dataTables_filter input").val("").keyup();
$simpleSearch.addClass("sp-invisible");
} }
else { else {
//clear the advanced search fields and reset datatable
$(".filter_column input").val("").keyup();
//reset datatable with previous simple search results (if any)
$(".dataTables_filter input").val(simpleSearchText).keyup();
$simpleSearch.removeClass("sp-invisible");
$fs.addClass("closed"); $fs.addClass("closed");
} }
}); });
@ -734,7 +766,7 @@ var AIRTIME = (function(AIRTIME) {
addQtipToSCIcons(); addQtipToSCIcons();
//begin context menu initialization. // begin context menu initialization.
$.contextMenu({ $.contextMenu({
selector: '#library_display td:not(.library_checkbox)', selector: '#library_display td:not(.library_checkbox)',
trigger: "left", trigger: "left",
@ -749,7 +781,7 @@ var AIRTIME = (function(AIRTIME) {
function processMenuItems(oItems) { function processMenuItems(oItems) {
//define an add to playlist callback. // define an add to playlist callback.
if (oItems.pl_add !== undefined) { if (oItems.pl_add !== undefined) {
var aItems = []; var aItems = [];
@ -761,7 +793,7 @@ var AIRTIME = (function(AIRTIME) {
oItems.pl_add.callback = callback; oItems.pl_add.callback = callback;
} }
//define an edit callback. // define an edit callback.
if (oItems.edit !== undefined) { if (oItems.edit !== undefined) {
if (data.ftype === "audioclip") { if (data.ftype === "audioclip") {
@ -785,7 +817,7 @@ var AIRTIME = (function(AIRTIME) {
oItems.edit.callback = callback; oItems.edit.callback = callback;
} }
//define a play callback. // define a play callback.
if (oItems.play !== undefined) { if (oItems.play !== undefined) {
if (oItems.play.mime !== undefined) { if (oItems.play.mime !== undefined) {
@ -796,23 +828,28 @@ var AIRTIME = (function(AIRTIME) {
callback = function() { callback = function() {
if (data.ftype === 'playlist' && data.length !== '0.0'){ if (data.ftype === 'playlist' && data.length !== '0.0'){
playlistIndex = $(this).parent().attr('id').substring(3); //remove the pl_ playlistIndex = $(this).parent().attr('id').substring(3); // remove
// the
// pl_
open_playlist_preview(playlistIndex, 0); open_playlist_preview(playlistIndex, 0);
} else if (data.ftype === 'audioclip' || data.ftype === 'stream') { } else if (data.ftype === 'audioclip' || data.ftype === 'stream') {
open_audio_preview(data.ftype, data.audioFile, data.track_title, data.artist_name); open_audio_preview(data.ftype, data.audioFile, data.track_title, data.artist_name);
} else if (data.ftype === 'block') { } else if (data.ftype === 'block') {
blockIndex = $(this).parent().attr('id').substring(3); //remove the pl_ blockIndex = $(this).parent().attr('id').substring(3); // remove
// the
// pl_
open_block_preview(blockIndex, 0); open_block_preview(blockIndex, 0);
} }
}; };
oItems.play.callback = callback; oItems.play.callback = callback;
} }
//define a delete callback. // define a delete callback.
if (oItems.del !== undefined) { if (oItems.del !== undefined) {
//delete through the playlist controller, will reset // delete through the playlist controller, will reset
//playlist screen if this is the currently edited playlist. // playlist screen if this is the currently edited
// playlist.
if ((data.ftype === "playlist" || data.ftype === "block") && screen === "playlist") { if ((data.ftype === "playlist" || data.ftype === "block") && screen === "playlist") {
callback = function() { callback = function() {
aMedia = []; aMedia = [];
@ -846,7 +883,7 @@ var AIRTIME = (function(AIRTIME) {
oItems.del.callback = callback; oItems.del.callback = callback;
} }
//define a download callback. // define a download callback.
if (oItems.download !== undefined) { if (oItems.download !== undefined) {
callback = function() { callback = function() {
@ -854,11 +891,11 @@ var AIRTIME = (function(AIRTIME) {
}; };
oItems.download.callback = callback; oItems.download.callback = callback;
} }
//add callbacks for Soundcloud menu items. // add callbacks for Soundcloud menu items.
if (oItems.soundcloud !== undefined) { if (oItems.soundcloud !== undefined) {
var soundcloud = oItems.soundcloud.items; var soundcloud = oItems.soundcloud.items;
//define an upload to soundcloud callback. // define an upload to soundcloud callback.
if (soundcloud.upload !== undefined) { if (soundcloud.upload !== undefined) {
callback = function() { callback = function() {
@ -869,7 +906,7 @@ var AIRTIME = (function(AIRTIME) {
soundcloud.upload.callback = callback; soundcloud.upload.callback = callback;
} }
//define a view on soundcloud callback // define a view on soundcloud callback
if (soundcloud.view !== undefined) { if (soundcloud.view !== undefined) {
callback = function() { callback = function() {
@ -985,7 +1022,8 @@ function addQtipToSCIcons(){
viewport: $(window) viewport: $(window)
}, },
show: { show: {
ready: true // Needed to make it show on first mouseover event ready: true // Needed to make it show on first mouseover
// event
} }
}); });
} }
@ -1012,7 +1050,8 @@ function addQtipToSCIcons(){
viewport: $(window) viewport: $(window)
}, },
show: { show: {
ready: true // Needed to make it show on first mouseover event ready: true // Needed to make it show on first mouseover
// event
} }
}); });
}else if($(this).hasClass("sc-error")){ }else if($(this).hasClass("sc-error")){
@ -1039,7 +1078,8 @@ function addQtipToSCIcons(){
viewport: $(window) viewport: $(window)
}, },
show: { show: {
ready: true // Needed to make it show on first mouseover event ready: true // Needed to make it show on first mouseover
// event
} }
}); });
} }
@ -1093,7 +1133,7 @@ function validateAdvancedSearch(divs) {
} }
} }
//string fields do not need validation // string fields do not need validation
if (searchTermType !== "s") { if (searchTermType !== "s") {
valid = regExpr.test(searchTerm[i]); valid = regExpr.test(searchTerm[i]);
if (!valid) allValid = false; if (!valid) allValid = false;
@ -1101,11 +1141,11 @@ function validateAdvancedSearch(divs) {
addRemoveValidationIcons(valid, $(field), searchTermType); addRemoveValidationIcons(valid, $(field), searchTermType);
/* Empty fields should not have valid/invalid indicator /*
* Range values are considered valid even if only the * Empty fields should not have valid/invalid indicator Range values
* 'From' value is provided. Therefore, if the 'To' value * are considered valid even if only the 'From' value is provided.
* is empty but the 'From' value is not empty we need to * Therefore, if the 'To' value is empty but the 'From' value is not
* keep the validation icon on screen. * empty we need to keep the validation icon on screen.
*/ */
} else if (searchTerm[0] === "" && searchTerm[1] !== "" || } else if (searchTerm[0] === "" && searchTerm[1] !== "" ||
searchTerm[0] === "" && searchTerm[1] === ""){ searchTerm[0] === "" && searchTerm[1] === ""){
@ -1141,7 +1181,7 @@ function addRemoveValidationIcons(valid, field, searchTermType) {
if (valid) { if (valid) {
if (!field.closest('div').children(':last-child').hasClass('checked-icon')) { if (!field.closest('div').children(':last-child').hasClass('checked-icon')) {
//remove invalid icon before adding valid icon // remove invalid icon before adding valid icon
if (field.closest('div').children(':last-child').hasClass('not-available-icon')) { if (field.closest('div').children(':last-child').hasClass('not-available-icon')) {
field.closest('div').children(':last-child').remove(); field.closest('div').children(':last-child').remove();
} }
@ -1149,7 +1189,7 @@ function addRemoveValidationIcons(valid, field, searchTermType) {
} }
} else { } else {
if (!field.closest('div').children(':last-child').hasClass('not-available-icon')) { if (!field.closest('div').children(':last-child').hasClass('not-available-icon')) {
//remove valid icon before adding invalid icon // remove valid icon before adding invalid icon
if (field.closest('div').children(':last-child').hasClass('checked-icon')) { if (field.closest('div').children(':last-child').hasClass('checked-icon')) {
field.closest('div').children(':last-child').remove(); field.closest('div').children(':last-child').remove();
} }
@ -1158,12 +1198,9 @@ function addRemoveValidationIcons(valid, field, searchTermType) {
} }
} }
/* Validation types: /*
* s => string * Validation types: s => string i => integer n => numeric (positive/negative,
* i => integer * whole/decimals) t => timestamp l => length
* n => numeric (positive/negative, whole/decimals)
* t => timestamp
* l => length
*/ */
var validationTypes = { var validationTypes = {
"album_title" : "s", "album_title" : "s",
@ -1192,7 +1229,7 @@ var validationTypes = {
"owner_id" : "s", "owner_id" : "s",
"rating" : "i", "rating" : "i",
"replay_gain" : "n", "replay_gain" : "n",
"sample_rate" : "i", "sample_rate" : "n",
"track_title" : "s", "track_title" : "s",
"track_number" : "i", "track_number" : "i",
"info_url" : "s", "info_url" : "s",

View File

@ -8,14 +8,17 @@ function setSmartBlockEvents() {
/********** ADD CRITERIA ROW **********/ /********** ADD CRITERIA ROW **********/
form.find('#criteria_add').live('click', function(){ form.find('#criteria_add').live('click', function(){
var div = $('dd[id="sp_criteria-element"]').children('div:visible:last').next(); var div = $('dd[id="sp_criteria-element"]').children('div:visible:last');
div.show(); div.find('.db-logic-label').text('and').show();
div = div.next().show();
div.children().removeAttr('disabled'); div.children().removeAttr('disabled');
div = div.next(); div = div.next();
if (div.length === 0) { if (div.length === 0) {
$(this).hide(); $(this).hide();
} }
appendAddButton(); appendAddButton();
appendModAddButton(); appendModAddButton();
removeButtonCheck(); removeButtonCheck();
@ -24,7 +27,7 @@ function setSmartBlockEvents() {
/********** ADD MODIFIER ROW **********/ /********** ADD MODIFIER ROW **********/
form.find('a[id^="modifier_add"]').live('click', function(){ form.find('a[id^="modifier_add"]').live('click', function(){
var criteria_value = $(this).siblings('select[name^="sp_criteria_field"]').val(); var criteria_value = $(this).siblings('select[name^="sp_criteria_field"]').val();
//make new modifier row //make new modifier row
var newRow = $(this).parent().clone(), var newRow = $(this).parent().clone(),
newRowCrit = newRow.find('select[name^="sp_criteria_field"]'), newRowCrit = newRow.find('select[name^="sp_criteria_field"]'),
@ -285,6 +288,11 @@ function reindexElements() {
var divs = $('#smart-block-form').find('div select[name^="sp_criteria_field"]').parent(), var divs = $('#smart-block-form').find('div select[name^="sp_criteria_field"]').parent(),
index = 0, index = 0,
modIndex = 0; modIndex = 0;
/* Hide all logic labels
* We will re-add them as each row gets indexed
*/
$('.db-logic-label').text('').hide();
$.each(divs, function(i, div){ $.each(divs, function(i, div){
if (i > 0 && index < 26) { if (i > 0 && index < 26) {
@ -292,8 +300,14 @@ function reindexElements() {
* a modifier row * a modifier row
*/ */
if ($(div).find('select[name^="sp_criteria_field"]').hasClass('sp-invisible')) { if ($(div).find('select[name^="sp_criteria_field"]').hasClass('sp-invisible')) {
if ($(div).is(':visible')) {
$(div).prev().find('.db-logic-label').text('or').show();
}
modIndex++; modIndex++;
} else { } else {
if ($(div).is(':visible')) {
$(div).prev().find('.db-logic-label').text('and').show();
}
index++; index++;
modIndex = 0; modIndex = 0;
} }
@ -337,8 +351,8 @@ function setupUI() {
*/ */
var plContents = $('#spl_sortable').children(); var plContents = $('#spl_sortable').children();
var shuffleButton = $('button[id="shuffle_button"]'); var shuffleButton = $('button[id="shuffle_button"]');
if (plContents.text() !== 'Empty playlist') { if (!plContents.hasClass('spl_empty')) {
if (shuffleButton.hasClass('ui-state-disabled')) { if (shuffleButton.hasClass('ui-state-disabled')) {
shuffleButton.removeClass('ui-state-disabled'); shuffleButton.removeClass('ui-state-disabled');
shuffleButton.removeAttr('disabled'); shuffleButton.removeAttr('disabled');
@ -384,6 +398,28 @@ function setupUI() {
at: "right center" at: "right center"
}, },
}); });
$(".repeat_tracks_help_icon").qtip({
content: {
text: "If your criteria is too strict, Airtime may not be able to fill up the desired smart block length." +
" Hence, if you check this option, tracks will be used more than once."
},
hide: {
delay: 500,
fixed: true
},
style: {
border: {
width: 0,
radius: 4
},
classes: "ui-tooltip-dark ui-tooltip-rounded"
},
position: {
my: "left bottom",
at: "right center"
},
});
} }
function enableAndShowExtraField(valEle, index) { function enableAndShowExtraField(valEle, index) {

View File

@ -339,11 +339,23 @@ var AIRTIME = (function(AIRTIME){
}); });
}; };
mod.jumpToCurrentTrack = function() {
var $scroll = $sbContent.find(".dataTables_scrolling");
var scrolled = $scroll.scrollTop();
var scrollingTop = $scroll.offset().top;
var oTable = $('#show_builder_table').dataTable();
var current = $sbTable.find("."+NOW_PLAYING_CLASS);
var currentTop = current.offset().top;
$scroll.scrollTop(currentTop - scrollingTop + scrolled);
}
mod.builderDataTable = function() { mod.builderDataTable = function() {
$sbContent = $('#show_builder'); $sbContent = $('#show_builder');
$lib = $("#library_content"), $lib = $("#library_content"),
$sbTable = $sbContent.find('table'); $sbTable = $sbContent.find('table');
var isInitialized = false;
oSchedTable = $sbTable.dataTable( { oSchedTable = $sbTable.dataTable( {
"aoColumns": [ "aoColumns": [
/* checkbox */ {"mDataProp": "allowed", "sTitle": "", "sWidth": "15px", "sClass": "sb-checkbox"}, /* checkbox */ {"mDataProp": "allowed", "sTitle": "", "sWidth": "15px", "sClass": "sb-checkbox"},
@ -357,7 +369,8 @@ var AIRTIME = (function(AIRTIME){
/* cue in */ {"mDataProp": "cuein", "sTitle": "Cue In", "bVisible": false, "sClass": "sb-cue-in"}, /* cue in */ {"mDataProp": "cuein", "sTitle": "Cue In", "bVisible": false, "sClass": "sb-cue-in"},
/* cue out */ {"mDataProp": "cueout", "sTitle": "Cue Out", "bVisible": false, "sClass": "sb-cue-out"}, /* cue out */ {"mDataProp": "cueout", "sTitle": "Cue Out", "bVisible": false, "sClass": "sb-cue-out"},
/* fade in */ {"mDataProp": "fadein", "sTitle": "Fade In", "bVisible": false, "sClass": "sb-fade-in"}, /* fade in */ {"mDataProp": "fadein", "sTitle": "Fade In", "bVisible": false, "sClass": "sb-fade-in"},
/* fade out */ {"mDataProp": "fadeout", "sTitle": "Fade Out", "bVisible": false, "sClass": "sb-fade-out"} /* fade out */ {"mDataProp": "fadeout", "sTitle": "Fade Out", "bVisible": false, "sClass": "sb-fade-out"},
/* Mime */ {"mDataProp" : "mime", "sTitle" : "Mime", "bVisible": false, "sClass": "sb-mime"}
], ],
"bJQueryUI": true, "bJQueryUI": true,
@ -537,11 +550,16 @@ var AIRTIME = (function(AIRTIME){
$image = $nRow.find('td.sb-image'); $image = $nRow.find('td.sb-image');
//check if the file exists. //check if the file exists.
if (aData.image === true) { if (aData.image === true) {
$image.html('<img title="Track preview" src="'+baseUrl+'/css/images/icon_audioclip.png"></img>') $nRow.addClass("lib-audio");
if (!isAudioSupported(aData.mime)) {
$image.html('<span class="ui-icon ui-icon-locked"></span>');
} else {
$image.html('<img title="Track preview" src="'+baseUrl+'/css/images/icon_audioclip.png"></img>')
.click(function() { .click(function() {
open_show_preview(aData.instance, aData.pos); open_show_preview(aData.instance, aData.pos);
return false; return false;
}); });
}
} }
else { else {
$image.html('<span class="ui-icon ui-icon-alert"></span>'); $image.html('<span class="ui-icon ui-icon-alert"></span>');
@ -636,6 +654,17 @@ var AIRTIME = (function(AIRTIME){
$("#draggingContainer").remove(); $("#draggingContainer").remove();
}, },
"fnDrawCallback": function fnBuilderDrawCallback(oSettings, json) { "fnDrawCallback": function fnBuilderDrawCallback(oSettings, json) {
var isInitialized = false;
if (!isInitialized) {
//when coming to 'Now Playing' page we want the page
//to jump to the current track
if ($(this).find("."+NOW_PLAYING_CLASS).length > 0) {
mod.jumpToCurrentTrack();
}
}
isInitialized = true;
var wrapperDiv, var wrapperDiv,
markerDiv, markerDiv,
$td, $td,
@ -966,13 +995,18 @@ var AIRTIME = (function(AIRTIME){
"<i class='icon-white icon-cut'></i></button></div>") "<i class='icon-white icon-cut'></i></button></div>")
.append("<div class='btn-group'>" + .append("<div class='btn-group'>" +
"<button title='Remove selected scheduled items' class='ui-state-disabled btn btn-small' disabled='disabled'>" + "<button title='Remove selected scheduled items' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
"<i class='icon-white icon-trash'></i></button></div>") "<i class='icon-white icon-trash'></i></button></div>");
.append("<div class='btn-group'>" +
//if 'Add/Remove content' was chosen from the context menu
//in the Calendar do not append these buttons
if ($(".ui-dialog-content").length === 0) {
$menu.append("<div class='btn-group'>" +
"<button title='Jump to the current playing track' class='ui-state-disabled btn btn-small' disabled='disabled'>" + "<button title='Jump to the current playing track' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
"<i class='icon-white icon-step-forward'></i></button></div>") "<i class='icon-white icon-step-forward'></i></button></div>")
.append("<div class='btn-group'>" + .append("<div class='btn-group'>" +
"<button title='Cancel current show' class='ui-state-disabled btn btn-small btn-danger' disabled='disabled'>" + "<button title='Cancel current show' class='ui-state-disabled btn btn-small btn-danger' disabled='disabled'>" +
"<i class='icon-white icon-ban-circle'></i></button></div>"); "<i class='icon-white icon-ban-circle'></i></button></div>");
}
$toolbar.append($menu); $toolbar.append($menu);
$menu = undefined; $menu = undefined;
@ -1021,7 +1055,7 @@ var AIRTIME = (function(AIRTIME){
if (AIRTIME.button.isDisabled('icon-step-forward', true) === true) { if (AIRTIME.button.isDisabled('icon-step-forward', true) === true) {
return; return;
} }
/*
var $scroll = $sbContent.find(".dataTables_scrolling"), var $scroll = $sbContent.find(".dataTables_scrolling"),
scrolled = $scroll.scrollTop(), scrolled = $scroll.scrollTop(),
scrollingTop = $scroll.offset().top, scrollingTop = $scroll.offset().top,
@ -1029,6 +1063,8 @@ var AIRTIME = (function(AIRTIME){
currentTop = current.offset().top; currentTop = current.offset().top;
$scroll.scrollTop(currentTop - scrollingTop + scrolled); $scroll.scrollTop(currentTop - scrollingTop + scrolled);
*/
mod.jumpToCurrentTrack();
}); });
//delete overbooked tracks. //delete overbooked tracks.
@ -1196,7 +1232,7 @@ var AIRTIME = (function(AIRTIME){
}; };
} }
}); });
}; };
return AIRTIME; return AIRTIME;

View File

@ -113,40 +113,179 @@ AIRTIME = (function(AIRTIME) {
} }
mod.onReady = function() { mod.onReady = function() {
//define module vars. // define module vars.
$lib = $("#library_content"); $lib = $("#library_content");
$builder = $("#show_builder"); $builder = $("#show_builder");
$fs = $builder.find('fieldset'); $fs = $builder.find('fieldset');
/*
* Icon hover states for search.
*/
$builder.on("mouseenter", ".sb-timerange .ui-button", function(ev) {
$(this).addClass("ui-state-hover");
});
$builder.on("mouseleave", ".sb-timerange .ui-button", function(ev) {
$(this).removeClass("ui-state-hover");
});
$builder.find(dateStartId).datepicker(oBaseDatePickerSettings);
$builder.find(timeStartId).timepicker(oBaseTimePickerSettings);
$builder.find(dateEndId).datepicker(oBaseDatePickerSettings);
$builder.find(timeEndId).timepicker(oBaseTimePickerSettings);
oRange = AIRTIME.utilities.fnGetScheduleRange(dateStartId, timeStartId, dateEndId, timeEndId);
AIRTIME.showbuilder.fnServerData.start = oRange.start;
AIRTIME.showbuilder.fnServerData.end = oRange.end;
AIRTIME.library.libraryInit(); /*
AIRTIME.showbuilder.builderDataTable(); * Icon hover states for search.
setWidgetSize(); */
$builder.on("mouseenter", ".sb-timerange .ui-button", function(ev) {
$libWrapper = $lib.find("#library_display_wrapper"); $(this).addClass("ui-state-hover");
$libWrapper.prepend($libClose); });
$builder.on("mouseleave", ".sb-timerange .ui-button", function(ev) {
$builder.find('.dataTables_scrolling').css("max-height", widgetHeight - 95); $(this).removeClass("ui-state-hover");
});
$builder.on("click", "#sb_submit", showSearchSubmit);
$builder.find(dateStartId).datepicker(oBaseDatePickerSettings);
$builder.find(timeStartId).timepicker(oBaseTimePickerSettings);
$builder.find(dateEndId).datepicker(oBaseDatePickerSettings);
$builder.find(timeEndId).timepicker(oBaseTimePickerSettings);
oRange = AIRTIME.utilities.fnGetScheduleRange(dateStartId, timeStartId,
dateEndId, timeEndId);
AIRTIME.showbuilder.fnServerData.start = oRange.start;
AIRTIME.showbuilder.fnServerData.end = oRange.end;
AIRTIME.library.libraryInit();
AIRTIME.showbuilder.builderDataTable();
setWidgetSize();
$libWrapper = $lib.find("#library_display_wrapper");
$libWrapper.prepend($libClose);
$builder.find('.dataTables_scrolling').css("max-height",
widgetHeight - 95);
$builder.on("click", "#sb_submit", showSearchSubmit);
$builder.on("click", "#sb_edit", function(ev) {
var schedTable = $("#show_builder_table").dataTable();
// reset timestamp to redraw the cursors.
AIRTIME.showbuilder.resetTimestamp();
$lib.show().width(Math.floor(screenWidth * 0.48));
$builder.width(Math.floor(screenWidth * 0.48)).find("#sb_edit")
.remove().end().find("#sb_date_start")
.css("margin-left", 0).end();
schedTable.fnDraw();
$.ajax( {
url : "/usersettings/set-now-playing-screen-settings",
type : "POST",
data : {
settings : {
library : true
},
format : "json"
},
dataType : "json",
success : function() {
}
});
});
$lib.on("click", "#sb_lib_close", function() {
var schedTable = $("#show_builder_table").dataTable();
$lib.hide();
$builder.width(screenWidth).find(".sb-timerange").prepend(
$toggleLib).find("#sb_date_start").css("margin-left", 30)
.end().end();
$toggleLib.removeClass("ui-state-hover");
schedTable.fnDraw();
$.ajax( {
url : "/usersettings/set-now-playing-screen-settings",
type : "POST",
data : {
settings : {
library : false
},
format : "json"
},
dataType : "json",
success : function() {
}
});
});
$builder.find('legend').click(
function(ev, item) {
if ($fs.hasClass("closed")) {
$fs.removeClass("closed");
$builder.find('.dataTables_scrolling').css(
"max-height", widgetHeight - 150);
} else {
$fs.addClass("closed");
// set defaults for the options.
$fs.find('select').val(0);
$fs.find('input[type="checkbox"]').attr("checked",
false);
$builder.find('.dataTables_scrolling').css(
"max-height", widgetHeight - 110);
}
});
// set click event for all my shows checkbox.
$builder.on("click", "#sb_my_shows", function(ev) {
if ($(this).is(':checked')) {
$(ev.delegateTarget).find('#sb_show_filter').val(0);
}
showSearchSubmit();
});
//set select event for choosing a show.
$builder.on("change", '#sb_show_filter', function(ev) {
if ($(this).val() !== 0) {
$(ev.delegateTarget).find('#sb_my_shows')
.attr("checked", false);
}
showSearchSubmit();
});
function checkScheduleUpdates() {
var data = {}, oTable = $('#show_builder_table').dataTable(), fn = oTable
.fnSettings().fnServerData, start = fn.start, end = fn.end;
data["format"] = "json";
data["start"] = start;
data["end"] = end;
data["timestamp"] = AIRTIME.showbuilder.getTimestamp();
data["instances"] = AIRTIME.showbuilder.getShowInstances();
if (fn.hasOwnProperty("ops")) {
data["myShows"] = fn.ops.myShows;
data["showFilter"] = fn.ops.showFilter;
}
$.ajax( {
"dataType" : "json",
"type" : "GET",
"url" : "/showbuilder/check-builder-feed",
"data" : data,
"success" : function(json) {
if (json.update === true) {
oTable.fnDraw();
}
}
});
}
//check if the timeline view needs updating.
setInterval(checkScheduleUpdates, 5 * 1000); //need refresh in milliseconds
};
mod.onResize = function() {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(setWidgetSize, 100);
};
return AIRTIME;
$builder.on("click","#sb_edit", function (ev){ $builder.on("click","#sb_edit", function (ev){
var schedTable = $("#show_builder_table").dataTable(); var schedTable = $("#show_builder_table").dataTable();
@ -280,7 +419,6 @@ AIRTIME = (function(AIRTIME) {
}; };
return AIRTIME; return AIRTIME;
} (AIRTIME || {})); } (AIRTIME || {}));
$(document).ready(AIRTIME.builderMain.onReady); $(document).ready(AIRTIME.builderMain.onReady);

View File

@ -574,7 +574,7 @@
}) })
}(window.jQuery);/* ============================================================ }(window.jQuery);/* ============================================================
* bootstrap-dropdown.js v2.1.0 * bootstrap-dropdown.js v2.2.1
* http://twitter.github.com/bootstrap/javascript.html#dropdowns * http://twitter.github.com/bootstrap/javascript.html#dropdowns
* ============================================================ * ============================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
@ -675,8 +675,9 @@
} }
function clearMenus() { function clearMenus() {
getParent($(toggle)) $(toggle).each(function () {
.removeClass('open') getParent($(this)).removeClass('open')
})
} }
function getParent($this) { function getParent($this) {
@ -685,7 +686,7 @@
if (!selector) { if (!selector) {
selector = $this.attr('href') selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
} }
$parent = $(selector) $parent = $(selector)
@ -713,14 +714,11 @@
/* APPLY TO STANDARD DROPDOWN ELEMENTS /* APPLY TO STANDARD DROPDOWN ELEMENTS
* =================================== */ * =================================== */
$(function () { $(document)
$('html') .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus) .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
$('body') .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('click.dropdown touchstart.dropdown.data-api', '.dropdown', function (e) { e.stopPropagation() }) .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
})
}(window.jQuery);/* ========================================================= }(window.jQuery);/* =========================================================
* bootstrap-modal.js v2.1.0 * bootstrap-modal.js v2.1.0

View File

@ -190,7 +190,7 @@
} else if (th.attr('id') == "length") { } else if (th.attr('id') == "length") {
label = " hh:mm:ss.t"; label = " hh:mm:ss.t";
} else if (th.attr('id') == "sample_rate") { } else if (th.attr('id') == "sample_rate") {
label = " Hz"; label = " kHz";
} }
th.html(_fnRangeLabelPart(0)); th.html(_fnRangeLabelPart(0));

View File

@ -0,0 +1,2 @@
<!-- b bs -->

View File

@ -27,11 +27,11 @@ code=`lsb_release -cs`
if [ "$dist" = "Debian" ]; then if [ "$dist" = "Debian" ]; then
set +e set +e
grep -E "deb +http://www.deb-multimedia.org/? squeeze +main +non-free" /etc/apt/sources.list grep -E "deb http://backports.debian.org/debian-backports squeeze-backports main" /etc/apt/sources.list
returncode=$? returncode=$?
set -e set -e
if [ "$returncode" -ne "0" ]; then if [ "$returncode" -ne "0" ]; then
echo "deb http://www.deb-multimedia.org squeeze main non-free" >> /etc/apt/sources.list echo "deb http://backports.debian.org/debian-backports squeeze-backports main" >> /etc/apt/sources.list
fi fi
fi fi

View File

@ -29,9 +29,9 @@ dist=`lsb_release -is`
code=`lsb_release -cs` code=`lsb_release -cs`
if [ "$dist" -eq "Debian" ]; then if [ "$dist" -eq "Debian" ]; then
grep "deb http://www.deb-multimedia.org squeeze main non-free" /etc/apt/sources.list grep "deb http://backports.debian.org/debian-backports squeeze-backports main" /etc/apt/sources.list
if [ "$?" -ne "0" ]; then if [ "$?" -ne "0" ]; then
echo "deb http://www.deb-multimedia.org squeeze main non-free" >> /etc/apt/sources.list echo "deb http://backports.debian.org/debian-backports squeeze-backports main" >> /etc/apt/sources.list
fi fi
fi fi

View File

@ -9,16 +9,16 @@ class Version20120405114454 extends AbstractMigration
{ {
public function up(Schema $schema) public function up(Schema $schema)
{ {
//create cc_subjs_token table //create cc_subjs_token table
$cc_subjs_token = $schema->createTable('cc_subjs_token'); $cc_subjs_token = $schema->createTable('cc_subjs_token');
$cc_subjs_token->addColumn('id', 'integer', array('unsigned' => true, 'autoincrement' => true)); $cc_subjs_token->addColumn('id', 'integer', array('unsigned' => true, 'autoincrement' => true));
$cc_subjs_token->addColumn('user_id', 'integer', array('notnull' => 1)); $cc_subjs_token->addColumn('user_id', 'integer', array('notnull' => 1));
$cc_subjs_token->addColumn('action', 'string', array('length' => 255, 'notnull' => 1)); $cc_subjs_token->addColumn('action', 'string', array('length' => 255, 'notnull' => 1));
$cc_subjs_token->addColumn('token', 'string', array('length' => 40, 'notnull' => 1)); $cc_subjs_token->addColumn('token', 'string', array('length' => 40, 'notnull' => 1));
$cc_subjs_token->addColumn('created', 'datetime', array('notnull' => 1)); $cc_subjs_token->addColumn('created', 'datetime', array('notnull' => 1));
$cc_subjs_token->setPrimaryKey(array('id')); $cc_subjs_token->setPrimaryKey(array('id'));
//end create cc_subjs_token table //end create cc_subjs_token table
} }

View File

@ -24,21 +24,21 @@ class Version20120410104441 extends AbstractMigration
$this->_addSql("ALTER TABLE cc_files ADD temp_br integer"); $this->_addSql("ALTER TABLE cc_files ADD temp_br integer");
$this->_addSql("ALTER TABLE cc_files ADD temp_sr integer"); $this->_addSql("ALTER TABLE cc_files ADD temp_sr integer");
$this->_addSql("UPDATE cc_files SET temp_br = bit_rate::integer"); $this->_addSql("UPDATE cc_files SET temp_br = bit_rate::integer");
$this->_addSql("UPDATE cc_files SET temp_sr = sample_rate::integer"); $this->_addSql("UPDATE cc_files SET temp_sr = sample_rate::integer");
$this->_addSql("ALTER TABLE cc_files DROP COLUMN sample_rate"); $this->_addSql("ALTER TABLE cc_files DROP COLUMN sample_rate");
$this->_addSql("ALTER TABLE cc_files DROP COLUMN bit_rate"); $this->_addSql("ALTER TABLE cc_files DROP COLUMN bit_rate");
$this->_addSql("ALTER TABLE cc_files RENAME COLUMN temp_sr TO sample_rate"); $this->_addSql("ALTER TABLE cc_files RENAME COLUMN temp_sr TO sample_rate");
$this->_addSql("ALTER TABLE cc_files RENAME COLUMN temp_br TO bit_rate"); $this->_addSql("ALTER TABLE cc_files RENAME COLUMN temp_br TO bit_rate");
//add utime, lptime //add utime, lptime
$this->_addSql("ALTER TABLE cc_files ADD utime timestamp"); $this->_addSql("ALTER TABLE cc_files ADD utime timestamp");
$this->_addSql("ALTER TABLE cc_files ADD lptime timestamp"); $this->_addSql("ALTER TABLE cc_files ADD lptime timestamp");
//setting these to a default now for timeline refresh purposes. //setting these to a default now for timeline refresh purposes.
$now = gmdate("Y-m-d H:i:s"); $now = gmdate("Y-m-d H:i:s");
$this->_addSql("UPDATE cc_files SET utime = '$now'"); $this->_addSql("UPDATE cc_files SET utime = '$now'");
} }

View File

@ -12,7 +12,7 @@ class Version20120410143340 extends AbstractMigration
*/ */
public function up(Schema $schema) public function up(Schema $schema)
{ {
//convert column creator to be creator_id on cc_playlist //convert column creator to be creator_id on cc_playlist
$this->_addSql("ALTER TABLE cc_playlist ADD creator_id integer"); $this->_addSql("ALTER TABLE cc_playlist ADD creator_id integer");
$this->_addSql("UPDATE cc_playlist SET creator_id = (SELECT id FROM cc_subjs WHERE creator = login)"); $this->_addSql("UPDATE cc_playlist SET creator_id = (SELECT id FROM cc_subjs WHERE creator = login)");
$this->_addSql("ALTER TABLE cc_playlist DROP COLUMN creator"); $this->_addSql("ALTER TABLE cc_playlist DROP COLUMN creator");

View File

@ -136,36 +136,36 @@ class CcShowInstances extends BaseCcShowInstances {
->update(array('DbPlayoutStatus' => 0), $con); ->update(array('DbPlayoutStatus' => 0), $con);
} }
/** /**
* Computes the value of the aggregate column time_filled * Computes the value of the aggregate column time_filled
* *
* @param PropelPDO $con A connection object * @param PropelPDO $con A connection object
* *
* @return mixed The scalar result from the aggregate query * @return mixed The scalar result from the aggregate query
*/ */
public function computeDbTimeFilled(PropelPDO $con) public function computeDbTimeFilled(PropelPDO $con)
{ {
$stmt = $con->prepare('SELECT SUM(clip_length) FROM "cc_schedule" WHERE cc_schedule.INSTANCE_ID = :p1'); $stmt = $con->prepare('SELECT SUM(clip_length) FROM "cc_schedule" WHERE cc_schedule.INSTANCE_ID = :p1');
$stmt->bindValue(':p1', $this->getDbId()); $stmt->bindValue(':p1', $this->getDbId());
$stmt->execute(); $stmt->execute();
return $stmt->fetchColumn(); return $stmt->fetchColumn();
} }
/** /**
* Updates the aggregate column time_filled * Updates the aggregate column time_filled
* *
* @param PropelPDO $con A connection object * @param PropelPDO $con A connection object
*/ */
public function updateDbTimeFilled(PropelPDO $con) public function updateDbTimeFilled(PropelPDO $con)
{ {
$this->setDbTimeFilled($this->computeDbTimeFilled($con)); $this->setDbTimeFilled($this->computeDbTimeFilled($con));
$this->save($con); $this->save($con);
} }
public function preInsert(PropelPDO $con = null) { public function preInsert(PropelPDO $con = null) {
$now = new DateTime("now", new DateTimeZone("UTC")); $now = new DateTime("now", new DateTimeZone("UTC"));
$this->setDbCreated($now); $this->setDbCreated($now);
return true; return true;
} }
} // CcShowInstances } // CcShowInstances

View File

@ -26,31 +26,31 @@ class UpgradeCommon {
*/ */
public static function connectToDatabase($p_exitOnError = true) public static function connectToDatabase($p_exitOnError = true)
{ {
try { try {
$con = Propel::getConnection(); $con = Propel::getConnection();
} catch (Exception $e) { } catch (Exception $e) {
echo $e->getMessage().PHP_EOL; echo $e->getMessage().PHP_EOL;
echo "Database connection problem.".PHP_EOL; echo "Database connection problem.".PHP_EOL;
echo "Check if database exists with corresponding permissions.".PHP_EOL; echo "Check if database exists with corresponding permissions.".PHP_EOL;
if ($p_exitOnError) { if ($p_exitOnError) {
exit(1); exit(1);
} }
return false; return false;
} }
return true; return true;
} }
public static function DbTableExists($p_name) public static function DbTableExists($p_name)
{ {
$con = Propel::getConnection(); $con = Propel::getConnection();
try { try {
$sql = "SELECT * FROM ".$p_name." LIMIT 1"; $sql = "SELECT * FROM ".$p_name." LIMIT 1";
$con->query($sql); $con->query($sql);
} catch (PDOException $e){ } catch (PDOException $e){
return false; return false;
} }
return true; return true;
} }
private static function GetAirtimeSrcDir() private static function GetAirtimeSrcDir()

View File

@ -1,7 +1,7 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="@*|node()"> <xsl:template match="@*|node()">
<xsl:copy> <xsl:copy>
<xsl:apply-templates select="@*|node()"/> <xsl:apply-templates select="@*|node()"/>
</xsl:copy> </xsl:copy>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

View File

@ -202,6 +202,12 @@ class Manager(Loggable):
organize. organize.
""" """
store_paths = mmp.expand_storage(store) store_paths = mmp.expand_storage(store)
# First attempt to make sure that all paths exist before adding any
# watches
for path_type, path in store_paths.iteritems():
try: mmp.create_dir(path)
except mmp.FailedToCreateDir as e: self.unexpected_exception(e)
self.set_problem_files_path(store_paths['problem_files']) self.set_problem_files_path(store_paths['problem_files'])
self.set_imported_path(store_paths['imported']) self.set_imported_path(store_paths['imported'])
self.set_recorded_path(store_paths['recorded']) self.set_recorded_path(store_paths['recorded'])

View File

@ -105,6 +105,9 @@ def main(global_config, api_client_config, log_config,
airtime_notifier = AirtimeNotifier(config, airtime_receiver) airtime_notifier = AirtimeNotifier(config, airtime_receiver)
store = apiclient.setup_media_monitor() store = apiclient.setup_media_monitor()
log.info("Initing with the following airtime response:%s" % str(store))
airtime_receiver.change_storage({ 'directory':store[u'stor'] }) airtime_receiver.change_storage({ 'directory':store[u'stor'] })
for watch_dir in store[u'watched_dirs']: for watch_dir in store[u'watched_dirs']:
@ -116,6 +119,7 @@ def main(global_config, api_client_config, log_config,
(given from the database)." % watch_dir) (given from the database)." % watch_dir)
if os.path.exists(watch_dir): if os.path.exists(watch_dir):
airtime_receiver.new_watch({ 'directory':watch_dir }, restart=True) airtime_receiver.new_watch({ 'directory':watch_dir }, restart=True)
else: log.info("Failed to add watch on %s" % str(watch_dir))
bs = Bootstrapper( db=sdb, watch_signal='watch' ) bs = Bootstrapper( db=sdb, watch_signal='watch' )

View File

@ -0,0 +1,34 @@
%ifdef input.gstreamer.video
# Stream from a video4linux 2 input device, such as a webcam.
# @category Source / Input
# @param ~id Force the value of the source ID.
# @param ~clock_safe Force the use of the dedicated v4l clock.
# @param ~device V4L2 device to use.
def input.v4l2(~id="",~clock_safe=true,~device="/dev/video0")
pipeline = "v4l2src device=#{device}"
input.gstreamer.video(id=id, clock_safe=clock_safe, pipeline=pipeline)
end
# Stream from a video4linux 2 input device, such as a webcam.
# @category Source / Input
# @param ~id Force the value of the source ID.
# @param ~clock_safe Force the use of the dedicated v4l clock.
# @param ~device V4L2 device to use.
def input.v4l2_with_audio(~id="",~clock_safe=true,~device="/dev/video0")
audio_pipeline = "autoaudiosrc"
video_pipeline = "v4l2src device=#{device}"
input.gstreamer.audio_video(id=id, clock_safe=clock_safe, audio_pipeline=audio_pipeline, video_pipeline=video_pipeline)
end
def gstreamer.encode_x264_avi(fname, source)
output.gstreamer.video(pipeline="videoconvert ! x264enc ! avimux ! filesink location=\"#{fname}\"", source)
end
def gstreamer.encode_jpeg_avi(fname, source)
output.gstreamer.video(pipeline="videoconvert ! jpegenc ! avimux ! filesink location=\"#{fname}\"", source)
end
def gstreamer.encode_mp3(fname, source)
output.gstreamer.audio(pipeline="audioconvert ! lamemp3enc ! filesink location=\"#{fname}\"", source)
end
%endif

View File

@ -201,9 +201,6 @@ def append_dj_inputs(master_harbor_input_port, master_harbor_input_mount_point,
dj_live = mksafe(audio_to_stereo(input.harbor(id="live_dj_harbor", dj_harbor_input_mount_point, port=dj_harbor_input_port, auth=check_dj_client, dj_live = mksafe(audio_to_stereo(input.harbor(id="live_dj_harbor", dj_harbor_input_mount_point, port=dj_harbor_input_port, auth=check_dj_client,
max=40., on_connect=live_dj_connect, on_disconnect=live_dj_disconnect))) max=40., on_connect=live_dj_connect, on_disconnect=live_dj_disconnect)))
master_dj = rewrite_metadata([("artist","Airtime"), ("title", "Master Dj")],master_dj)
dj_live = rewrite_metadata([("artist","Airtime"), ("title", "Live Dj")],dj_live)
ignore(output.dummy(master_dj, fallible=true)) ignore(output.dummy(master_dj, fallible=true))
ignore(output.dummy(dj_live, fallible=true)) ignore(output.dummy(dj_live, fallible=true))
switch(id="master_dj_switch", track_sensitive=false, transitions=[transition, transition, transition], [({!master_dj_enabled},master_dj), ({!live_dj_enabled},dj_live), ({true}, s)]) switch(id="master_dj_switch", track_sensitive=false, transitions=[transition, transition, transition], [({!master_dj_enabled},master_dj), ({!live_dj_enabled},dj_live), ({true}, s)])
@ -211,14 +208,12 @@ def append_dj_inputs(master_harbor_input_port, master_harbor_input_mount_point,
master_dj = mksafe(audio_to_stereo(input.harbor(id="master_harbor", master_harbor_input_mount_point, port=master_harbor_input_port, auth=check_master_dj_client, master_dj = mksafe(audio_to_stereo(input.harbor(id="master_harbor", master_harbor_input_mount_point, port=master_harbor_input_port, auth=check_master_dj_client,
max=40., on_connect=master_dj_connect, on_disconnect=master_dj_disconnect))) max=40., on_connect=master_dj_connect, on_disconnect=master_dj_disconnect)))
ignore(output.dummy(master_dj, fallible=true)) ignore(output.dummy(master_dj, fallible=true))
master_dj = rewrite_metadata([("artist","Airtime"), ("title", "Master Dj")],master_dj)
switch(id="master_dj_switch", track_sensitive=false, transitions=[transition, transition], [({!master_dj_enabled},master_dj), ({true}, s)]) switch(id="master_dj_switch", track_sensitive=false, transitions=[transition, transition], [({!master_dj_enabled},master_dj), ({true}, s)])
elsif dj_harbor_input_port != 0 and dj_harbor_input_mount_point != "" then elsif dj_harbor_input_port != 0 and dj_harbor_input_mount_point != "" then
dj_live = mksafe(audio_to_stereo(input.harbor(id="live_dj_harbor", dj_harbor_input_mount_point, port=dj_harbor_input_port, auth=check_dj_client, dj_live = mksafe(audio_to_stereo(input.harbor(id="live_dj_harbor", dj_harbor_input_mount_point, port=dj_harbor_input_port, auth=check_dj_client,
max=40., on_connect=live_dj_connect, on_disconnect=live_dj_disconnect))) max=40., on_connect=live_dj_connect, on_disconnect=live_dj_disconnect)))
dj_live = rewrite_metadata([("artist","Airtime"), ("title", "Live Dj")],dj_live)
ignore(output.dummy(dj_live, fallible=true)) ignore(output.dummy(dj_live, fallible=true))
switch(id="live_dj_switch", track_sensitive=false, transitions=[transition, transition], [({!live_dj_enabled},dj_live), ({true}, s)]) switch(id="live_dj_switch", track_sensitive=false, transitions=[transition, transition], [({!live_dj_enabled},dj_live), ({true}, s)])
else else

View File

@ -159,6 +159,7 @@ def WatchAddAction(option, opt, value, parser):
path = currentDir+path path = currentDir+path
path = apc.encode_to(path, 'utf-8') path = apc.encode_to(path, 'utf-8')
if(os.path.isdir(path)): if(os.path.isdir(path)):
os.chmod(path, 0765)
res = api_client.add_watched_dir(path) res = api_client.add_watched_dir(path)
if(res is None): if(res is None):
exit("Unable to connect to the server.") exit("Unable to connect to the server.")

View File

@ -1,213 +1,213 @@
@charset "utf-8"; @charset "utf-8";
/* CSS Document */ /* CSS Document */
#headerLiveHolder { #headerLiveHolder {
overflow: hidden; overflow: hidden;
position:relative; position:relative;
width:300px!important; width:300px!important;
font-family: Arial,Helvetica,sans-serif; font-family: Arial,Helvetica,sans-serif;
font-size: 13px; font-size: 13px;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
#headerLiveHolder * { #headerLiveHolder * {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
#headerLiveHolder ul { #headerLiveHolder ul {
list-style-type:none; list-style-type:none;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
#headerLiveHolder h4 { #headerLiveHolder h4 {
font-size:10px; font-size:10px;
color:#68bd44; color:#68bd44;
text-transform:uppercase; text-transform:uppercase;
font-weight:normal; font-weight:normal;
line-height:12px; line-height:12px;
} }
#headerLiveHolder ul li { #headerLiveHolder ul li {
overflow:hidden; overflow:hidden;
position:relative; position:relative;
height:12px; height:12px;
padding-right:70px; padding-right:70px;
font-size:11px; font-size:11px;
color:#999999; color:#999999;
line-height:11px; line-height:11px;
} }
#headerLiveHolder ul li.current { #headerLiveHolder ul li.current {
font-weight:bold; font-weight:bold;
color:#666666; color:#666666;
} }
#headerLiveHolder ul li span { #headerLiveHolder ul li span {
position:absolute; position:absolute;
right:0px; right:0px;
top:0px; top:0px;
} }
#headerLiveHolder ul li span#time-elapsed { #headerLiveHolder ul li span#time-elapsed {
right: 50px; right: 50px;
} }
#headerLiveHolder ul li span#time-elapsed:before { #headerLiveHolder ul li span#time-elapsed:before {
content: "e."; content: "e.";
} }
#headerLiveHolder ul li span#time-remaining:before { #headerLiveHolder ul li span#time-remaining:before {
content: "r."; content: "r.";
} }
#onAirToday { #onAirToday {
width:300px; width:300px;
margin-bottom:15px; margin-bottom:15px;
border:1px solid #999999; border:1px solid #999999;
font-family: Arial,Helvetica,sans-serif; font-family: Arial,Helvetica,sans-serif;
} }
#onAirToday h3 { #onAirToday h3 {
margin:0; margin:0;
padding:0 10px; padding:0 10px;
font-size:13px; font-size:13px;
color:#ffffff; color:#ffffff;
line-height:28px; line-height:28px;
background: #999999; background: #999999;
} }
#onAirToday table { #onAirToday table {
border-collapse: collapse; border-collapse: collapse;
clear: both; clear: both;
padding: 0; padding: 0;
} }
#onAirToday table tbody { #onAirToday table tbody {
color: #000; color: #000;
font-size:12px; font-size:12px;
} }
#onAirToday table tbody tr { #onAirToday table tbody tr {
height: 30px; height: 30px;
} }
#onAirToday table tbody tr td { #onAirToday table tbody tr td {
border-bottom: 1px dotted #d9d9d9; border-bottom: 1px dotted #d9d9d9;
height: 30px; height: 30px;
padding-left: 10px; padding-left: 10px;
font-weight:bold; font-weight:bold;
} }
#onAirToday table tbody tr td a { #onAirToday table tbody tr td a {
text-decoration:none; text-decoration:none;
} }
#onAirToday table tbody tr td a:hover { #onAirToday table tbody tr td a:hover {
text-decoration:underline; text-decoration:underline;
} }
#onAirToday table tbody tr:last-child td { #onAirToday table tbody tr:last-child td {
border-bottom: none; border-bottom: none;
} }
#onAirToday table tbody tr td.time { #onAirToday table tbody tr td.time {
font-weight:normal; font-weight:normal;
color: #666666; color: #666666;
} }
/* = PROGRAM SCHEDULE ---------------- */ /* = PROGRAM SCHEDULE ---------------- */
/* /*
+ Center Column */ + Center Column */
#scheduleTabs { #scheduleTabs {
font-family: Arial,Helvetica,sans-serif; font-family: Arial,Helvetica,sans-serif;
} }
#scheduleTabs ul { #scheduleTabs ul {
overflow:hidden; overflow:hidden;
height:28px; height:28px;
background: url( widget-img/schedule-tabs-list-bgr.png) repeat-x left bottom; background: url( widget-img/schedule-tabs-list-bgr.png) repeat-x left bottom;
list-style-type:none; list-style-type:none;
margin:0; margin:0;
padding:0; padding:0;
} }
#scheduleTabs ul li { #scheduleTabs ul li {
float:left; float:left;
height:28px; height:28px;
margin:0; margin:0;
padding:0; padding:0;
} }
#scheduleTabs ul li a { #scheduleTabs ul li a {
display:block; display:block;
float:left; float:left;
height:25px; height:25px;
padding:0 10px; padding:0 10px;
margin-top:3px; margin-top:3px;
font-size:12px; font-size:12px;
font-weight:bold; font-weight:bold;
color:#666; color:#666;
line-height:25px; line-height:25px;
border-right:1px solid #dbdbdb; border-right:1px solid #dbdbdb;
border-left:1px solid #f4f4f4; border-left:1px solid #f4f4f4;
text-decoration:none; text-decoration:none;
} }
#scheduleTabs ul li a:hover { #scheduleTabs ul li a:hover {
color:#000; color:#000;
text-decoration:none; text-decoration:none;
} }
#scheduleTabs ul li.ui-tabs-selected a { #scheduleTabs ul li.ui-tabs-selected a {
height:27px; height:27px;
margin-top:0px; margin-top:0px;
line-height:27px; line-height:27px;
color:#333333; color:#333333;
background:#ffffff; background:#ffffff;
border:1px solid #cac9c9; border-bottom:none; border:1px solid #cac9c9; border-bottom:none;
} }
#scheduleTabs table { #scheduleTabs table {
clear:both; clear:both;
padding:0px; padding:0px;
border-collapse:collapse; border-collapse:collapse;
width:100%; width:100%;
} }
#scheduleTabs table thead { #scheduleTabs table thead {
height:35px; height:35px;
font-size:12px; color:#333333; line-height:35px; font-size:12px; color:#333333; line-height:35px;
background-color: #fff; background-color: #fff;
background: -moz-linear-gradient(top, #ffffff 10%, #f4f4f4 100%); background: -moz-linear-gradient(top, #ffffff 10%, #f4f4f4 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(10%, #ffffff), color-stop(100%, #f4f4f4)); background: -webkit-gradient(linear, left top, left bottom, color-stop(10%, #ffffff), color-stop(100%, #f4f4f4));
border-bottom:1px solid #d4d4d4; border-bottom:1px solid #d4d4d4;
} }
#scheduleTabs table thead tr { #scheduleTabs table thead tr {
height:35px; height:35px;
} }
#scheduleTabs table thead tr td { #scheduleTabs table thead tr td {
padding-left:10px; padding-left:10px;
font-size:11px; color:#999999; text-transform:uppercase; font-size:11px; color:#999999; text-transform:uppercase;
} }
#scheduleTabs table tfoot { #scheduleTabs table tfoot {
} }
#scheduleTabs table tbody { #scheduleTabs table tbody {
font-size:13px; color:#666666; font-weight:bold; font-size:13px; color:#666666; font-weight:bold;
} }
#scheduleTabs table tbody tr { #scheduleTabs table tbody tr {
height:30px; height:30px;
} }
#scheduleTabs table tbody tr td { #scheduleTabs table tbody tr td {
height:30px; height:30px;
padding-left:10px; padding-left:10px;
border-bottom:1px dotted #b3b3b3; border-bottom:1px dotted #b3b3b3;
} }
#scheduleTabs table tbody tr td h4 { #scheduleTabs table tbody tr td h4 {
color:#333333; font-size:12px; color:#333333; font-size:12px;
margin:0; margin:0;
padding:0; padding:0;
} }
#scheduleTabs table tbody tr td ul { #scheduleTabs table tbody tr td ul {
background:none !important; background:none !important;
list-style-type:none; list-style-type:none;
} }
#scheduleTabs table tbody tr td ul li { #scheduleTabs table tbody tr td ul li {
float:left; float:left;
height:30px !important; height:30px !important;
padding:0 2px; padding:0 2px;
font-size:12px; color:#cc0000; font-weight:normal; line-height:30px !important; font-size:12px; color:#cc0000; font-weight:normal; line-height:30px !important;
} }
#scheduleTabs table tbody tr td ul li a { #scheduleTabs table tbody tr td ul li a {
height:30px !important; height:30px !important;
margin:0px !important; padding:0px !important; margin:0px !important; padding:0px !important;
font-size:12px; color:#68BD44 !important; font-weight:normal !important; text-transform:uppercase; line-height:30px !important; font-size:12px; color:#68BD44 !important; font-weight:normal !important; text-transform:uppercase; line-height:30px !important;
background:none !important; background:none !important;
border:none !important; border:none !important;
} }
#scheduleTabs table tbody tr td ul li a:hover { #scheduleTabs table tbody tr td ul li a:hover {
text-decoration:underline; text-decoration:underline;
} }
#scheduleTabs.ui-tabs .ui-tabs-hide { #scheduleTabs.ui-tabs .ui-tabs-hide {
display: none; display: none;
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,51 +1,51 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Airtime widgets</title> <title>Airtime widgets</title>
<link href="css/airtime-widgets.css" rel="stylesheet" type="text/css" /> <link href="css/airtime-widgets.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
<div id="headerLiveHolder"> <div id="headerLiveHolder">
<h4>On air now &gt;&gt;</h4> <h4>On air now &gt;&gt;</h4>
<ul class="widget now-playing-bar"> <ul class="widget now-playing-bar">
<li class="current">Current: Réseau jeunesse<span class="time-elapsed" id="time-elapsed">02:22</span><span class="time-remaining" id="time-remaining">27:37</span></li> <li class="current">Current: Réseau jeunesse<span class="time-elapsed" id="time-elapsed">02:22</span><span class="time-remaining" id="time-remaining">27:37</span></li>
<li class="next">Next: Mano River Press (EN)<span>07:00 - 07:30</span></li> <li class="next">Next: Mano River Press (EN)<span>07:00 - 07:30</span></li>
</ul> </ul>
</div> </div>
<br /> <br />
<br /> <br />
<div id="onAirToday"> <div id="onAirToday">
<h3>On air today</h3> <h3>On air today</h3>
<table cellspacing="0" cellpadding="0" border="0" width="100%" class="widget widget now-playing-list small"> <table cellspacing="0" cellpadding="0" border="0" width="100%" class="widget widget now-playing-list small">
<tbody> <tbody>
<tr> <tr>
<td class="time">04:30 - 05:00</td> <td class="time">04:30 - 05:00</td>
<td><a href="http://www.wadr.org/fr/site/reseau_jeunesse/">Réseau jeunesse</a></td> <td><a href="http://www.wadr.org/fr/site/reseau_jeunesse/">Réseau jeunesse</a></td>
</tr> </tr>
<tr> <tr>
<td class="time">07:00 - 07:30</td> <td class="time">07:00 - 07:30</td>
<td><a href="http://www.wadr.org/en/site/mano_river_press/">Mano River Press (EN)</a></td> <td><a href="http://www.wadr.org/en/site/mano_river_press/">Mano River Press (EN)</a></td>
</tr> </tr>
<tr> <tr>
<td class="time">07:30 - 08:00</td> <td class="time">07:30 - 08:00</td>
<td><a href="http://www.wadr.org/en/site/mano_river_press/">Weekend Review (EN)</a></td> <td><a href="http://www.wadr.org/en/site/mano_river_press/">Weekend Review (EN)</a></td>
</tr> </tr>
<tr> <tr>
<td class="time">08:30 - 09:00</td> <td class="time">08:30 - 09:00</td>
<td><a href="http://wadr.org/fr/site/focus/">Focus (FR)</a></td> <td><a href="http://wadr.org/fr/site/focus/">Focus (FR)</a></td>
</tr> </tr>
<tr> <tr>
<td class="time">09:15 - 09:30</td> <td class="time">09:15 - 09:30</td>
<td><a href="http://wadr.org/en/site/thestadium/">The Stadium (EN)</a></td> <td><a href="http://wadr.org/en/site/thestadium/">The Stadium (EN)</a></td>
</tr> </tr>
<tr> <tr>
<td class="time">09:30 - 10:00</td> <td class="time">09:30 - 10:00</td>
<td>Echoes of Charles Taylor Trial</td> <td>Echoes of Charles Taylor Trial</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</body> </body>
</html> </html>