From 424c6f019307bd687e0ac0ab1b134527f1a11fd2 Mon Sep 17 00:00:00 2001 From: Naomi Date: Tue, 8 Feb 2011 15:06:31 -0500 Subject: [PATCH 1/5] CC-1887 shows are now resized properly with delta day. schedule dialog includes end day since shows can be longer than 1 day now, playlist search must look for an interval given the time increase. --- application/controllers/ScheduleController.php | 12 ++++++++---- application/models/Shows.php | 2 +- application/models/StoredFile.php | 2 +- .../scripts/schedule/schedule-show-dialog.phtml | 5 ++++- public/css/styles.css | 5 +++-- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/application/controllers/ScheduleController.php b/application/controllers/ScheduleController.php index 37f5ac8a6..a59c00fad 100644 --- a/application/controllers/ScheduleController.php +++ b/application/controllers/ScheduleController.php @@ -306,7 +306,8 @@ class ScheduleController extends Zend_Controller_Action $end = explode(" ", $end_timestamp); $startTime = explode(":", $start[1]); $endTime = explode(":", $end[1]); - $dateInfo = getDate(strtotime($start_timestamp)); + $dateInfo_s = getDate(strtotime($start_timestamp)); + $dateInfo_e = getDate(strtotime($end_timestamp)); $this->view->showContent = $show->getShowContent(); $this->view->timeFilled = $show->getTimeScheduled(); @@ -314,9 +315,12 @@ class ScheduleController extends Zend_Controller_Action $this->view->showLength = $show->getShowLength(); $this->view->percentFilled = $show->getPercentScheduledInRange(); - $this->view->wday = $dateInfo['weekday']; - $this->view->month = $dateInfo['month']; - $this->view->day = $dateInfo['mday']; + $this->view->s_wday = $dateInfo_s['weekday']; + $this->view->s_month = $dateInfo_s['month']; + $this->view->s_day = $dateInfo_s['mday']; + $this->view->e_wday = $dateInfo_e['weekday']; + $this->view->e_month = $dateInfo_e['month']; + $this->view->e_day = $dateInfo_e['mday']; $this->view->startTime = sprintf("%d:%02d", $startTime[0], $startTime[1]); $this->view->endTime = sprintf("%d:%02d", $endTime[0], $endTime[1]); diff --git a/application/models/Shows.php b/application/models/Shows.php index 19e021dc4..b0ebbfe29 100644 --- a/application/models/Shows.php +++ b/application/models/Shows.php @@ -441,7 +441,7 @@ class ShowInstance { $starts = $this->getShowStart(); $ends = $this->getShowEnd(); - $sql = "SELECT timestamp '{$ends}' + interval '{$hours}:{$mins}'"; + $sql = "SELECT timestamp '{$ends}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'"; $new_ends = $CC_DBC->GetOne($sql); //only need to check overlap if show increased in size. diff --git a/application/models/StoredFile.php b/application/models/StoredFile.php index a5c730b88..3e8149d90 100644 --- a/application/models/StoredFile.php +++ b/application/models/StoredFile.php @@ -1791,7 +1791,7 @@ class StoredFile { $fromTable = "cc_playlist AS pl LEFT JOIN cc_playlisttimes AS plt USING(id) LEFT JOIN cc_subjs AS sub ON pl.editedby = sub.id"; - $datatables["optWhere"][] = "plt.length <= '{$p_length}'"; + $datatables["optWhere"][] = "plt.length <= INTERVAL '{$p_length}'"; return StoredFile::searchFiles($fromTable, $datatables); diff --git a/application/views/scripts/schedule/schedule-show-dialog.phtml b/application/views/scripts/schedule/schedule-show-dialog.phtml index 80962ce76..c10038bfd 100644 --- a/application/views/scripts/schedule/schedule-show-dialog.phtml +++ b/application/views/scripts/schedule/schedule-show-dialog.phtml @@ -1,5 +1,8 @@
-

showName; ?>: wday." ".$this->month." ".$this->day.", ".$this->startTime." - ".$this->endTime; ?>

+

+ showName; ?>: s_wday." ".$this->s_month." ".$this->s_day." ".$this->startTime. + " - ".$this->e_wday." ".$this->e_month." ".$this->e_day." ".$this->endTime; ?> +

diff --git a/public/css/styles.css b/public/css/styles.css index 919b3621e..cfc4d9399 100644 --- a/public/css/styles.css +++ b/public/css/styles.css @@ -848,6 +848,7 @@ div.ui-datepicker { margin-right:22px; } + #schedule_playlist_chosen li > div > div > span { float: right; margin-right:46px; @@ -912,7 +913,7 @@ h2#scheduled_playlist_name span { } .time { - width: 80px; + width: 100px; margin: 5px; text-align: left; } @@ -1119,4 +1120,4 @@ button, input { } -#ui-datepicker-div { z-index: 10 !important } \ No newline at end of file +#ui-datepicker-div { z-index: 10 !important } From bdad3b34e0e7e0bf2b1209657e85ca73015a24ba Mon Sep 17 00:00:00 2001 From: Naomi Date: Tue, 8 Feb 2011 16:10:48 -0500 Subject: [PATCH 2/5] CC-1862 playlist builder playlist fadein/out --- .zfproject.xml | 4 + .../controllers/PlaylistController.php | 90 ++++++++++++------- application/models/Playlist.php | 12 +++ .../views/scripts/playlist/index.phtml | 15 ++++ public/js/airtime/library/spl.js | 84 +++++++++++++++-- 5 files changed, 165 insertions(+), 40 deletions(-) diff --git a/.zfproject.xml b/.zfproject.xml index c93acc463..66290e350 100644 --- a/.zfproject.xml +++ b/.zfproject.xml @@ -28,6 +28,7 @@ + @@ -287,6 +288,9 @@ + + + diff --git a/application/controllers/PlaylistController.php b/application/controllers/PlaylistController.php index 19f36a9e2..11de58a57 100644 --- a/application/controllers/PlaylistController.php +++ b/application/controllers/PlaylistController.php @@ -19,15 +19,16 @@ class PlaylistController extends Zend_Controller_Action ->addActionContext('edit', 'json') ->addActionContext('delete-active', 'json') ->addActionContext('delete', 'json') + ->addActionContext('set-playlist-fades', 'json') ->initContext(); $this->pl_sess = new Zend_Session_Namespace(UI_PLAYLIST_SESSNAME); } - private function getPlaylist() - { - $pl_sess = $this->pl_sess; - + private function getPlaylist() + { + $pl_sess = $this->pl_sess; + if(isset($pl_sess->id)) { $pl = Playlist::Recall($pl_sess->id); @@ -36,13 +37,13 @@ class PlaylistController extends Zend_Controller_Action return; } return $pl; - } - } - - private function changePlaylist($pl_id){ - - $pl_sess = $this->pl_sess; + } + } + private function changePlaylist($pl_id) + { + $pl_sess = $this->pl_sess; + if(isset($pl_sess->id)) { $pl = Playlist::Recall($pl_sess->id); @@ -58,10 +59,10 @@ class PlaylistController extends Zend_Controller_Action return FALSE; } $pl->lock($userInfo->id); - $pl_sess->id = $pl_id; - } + $pl_sess->id = $pl_id; + } - private function closePlaylist($pl) + private function closePlaylist($pl) { $userInfo = Zend_Auth::getInstance()->getStorage()->read(); $res = $pl->unlock($userInfo->id); @@ -78,9 +79,6 @@ class PlaylistController extends Zend_Controller_Action $this->view->headLink()->appendStylesheet('/css/playlist_builder.css'); $this->_helper->viewRenderer->setResponseSegment('spl'); - - $pl_sess = $this->pl_sess; - $this->view->pl = $this->getPlaylist(); } @@ -94,14 +92,12 @@ class PlaylistController extends Zend_Controller_Action $pl->setPLMetaData('dc:creator', $userInfo->login); $this->changePlaylist($pl_id); - $form = new Application_Form_PlaylistMetadata(); - $this->view->form = $form->__toString(); } public function metadataAction() - { + { $request = $this->getRequest(); $form = new Application_Form_PlaylistMetadata(); @@ -141,8 +137,8 @@ class PlaylistController extends Zend_Controller_Action public function editAction() { - $pl_id = $this->_getParam('id', null); - + $pl_id = $this->_getParam('id', null); + if(!is_null($pl_id)) { $this->changePlaylist($pl_id); } @@ -155,8 +151,8 @@ class PlaylistController extends Zend_Controller_Action } public function addItemAction() - { - $id = $this->_getParam('id'); + { + $id = $this->_getParam('id'); $pos = $this->_getParam('pos', null); if (!is_null($id)) { @@ -181,7 +177,7 @@ class PlaylistController extends Zend_Controller_Action public function moveItemAction() { - $oldPos = $this->_getParam('oldPos'); + $oldPos = $this->_getParam('oldPos'); $newPos = $this->_getParam('newPos'); $pl = $this->getPlaylist(); @@ -198,8 +194,8 @@ class PlaylistController extends Zend_Controller_Action public function deleteItemAction() { - $positions = $this->_getParam('pos', array()); - + $positions = $this->_getParam('pos', array()); + if (!is_array($positions)) $positions = array($positions); @@ -218,12 +214,12 @@ class PlaylistController extends Zend_Controller_Action $this->view->name = $pl->getName(); $this->view->length = $pl->getLength(); - unset($this->view->pl); + unset($this->view->pl); } public function setCueAction() { - $request = $this->getRequest(); + $request = $this->getRequest(); $pos = $this->_getParam('pos'); $pl = $this->getPlaylist(); @@ -248,7 +244,7 @@ class PlaylistController extends Zend_Controller_Action public function setFadeAction() { - $request = $this->getRequest(); + $request = $this->getRequest(); $pos = $this->_getParam('pos'); $pl = $this->getPlaylist(); @@ -292,8 +288,8 @@ class PlaylistController extends Zend_Controller_Action } public function deleteActiveAction() - { - $pl = $this->getPlaylist(); + { + $pl = $this->getPlaylist(); Playlist::Delete($pl->getId()); $pl_sess = $this->pl_sess; @@ -304,12 +300,38 @@ class PlaylistController extends Zend_Controller_Action public function closeAction() { - $pl = $this->getPlaylist(); + $pl = $this->getPlaylist(); $this->closePlaylist($pl); - $this->view->html = $this->view->render('playlist/index.phtml'); + $this->view->html = $this->view->render('playlist/index.phtml'); } + public function setPlaylistFadesAction() + { + $request = $this->getRequest(); + $pl = $this->getPlaylist(); + + if($request->isPost()) { + $fadeIn = $this->_getParam('fadeIn', null); + $fadeOut = $this->_getParam('fadeOut', null); + + if($fadeIn) + $response = $pl->changeFadeInfo(0, $fadeIn, $fadeOut); + else if($fadeOut) + $response = $pl->changeFadeInfo($pl->getSize(), $fadeIn, $fadeOut); + + $this->view->response = $response; + return; + } + + $fades = $pl->getFadeInfo(0); + $this->view->fadeIn = $fades[0]; + + $fades = $pl->getFadeInfo($pl->getSize()); + $this->view->fadeOut = $fades[1]; + } + + } @@ -331,6 +353,8 @@ class PlaylistController extends Zend_Controller_Action + + diff --git a/application/models/Playlist.php b/application/models/Playlist.php index a92e28fbd..6db198122 100644 --- a/application/models/Playlist.php +++ b/application/models/Playlist.php @@ -355,6 +355,18 @@ class Playlist { return $res + 1; } + public function getSize() { + + $res = CcPlaylistQuery::create() + ->findPK($this->id) + ->computeLastPosition(); + + if(is_null($res)) + return 0; + + return $res; + } + /** * Get the entire playlist as a two dimentional array, sorted in order of play. * @return array diff --git a/application/views/scripts/playlist/index.phtml b/application/views/scripts/playlist/index.phtml index 140271b26..194636a8c 100644 --- a/application/views/scripts/playlist/index.phtml +++ b/application/views/scripts/playlist/index.phtml @@ -1,6 +1,9 @@ pl)) : ?> + + Playlist crossfade + @@ -8,6 +11,18 @@

pl->getName(); ?>

pl->getLength(); ?>

+ +
    diff --git a/public/js/airtime/library/spl.js b/public/js/airtime/library/spl.js index 7dac496dc..e6db5a7ff 100644 --- a/public/js/airtime/library/spl.js +++ b/public/js/airtime/library/spl.js @@ -392,13 +392,83 @@ function setUpSPL() { .button() .click(closeSPL); - $("#spl_main_crossfade") - .button({ - icons: { - primary: "crossfade-main-icon" - }, - text: false - }); + $("#spl_crossfade").click(function(){ + + if($(this).hasClass("ui-state-active")) { + $(this).removeClass("ui-state-active"); + $("#crossfade_main").hide(); + } + else { + $(this).addClass("ui-state-active"); + + var url = '/Playlist/set-playlist-fades'; + + $.get(url, {format: "json"}, function(json){ + $("#spl_fade_in_main").find("span") + .empty() + .append(json.fadeIn); + $("#spl_fade_out_main").find("span") + .empty() + .append(json.fadeOut); + + $("#crossfade_main").show(); + }); + } + }); + + $("#spl_fade_in_main span:first").blur(function(event){ + event.stopPropagation(); + + var url, fadeIn, span; + + span = $(this); + url = "/Playlist/set-playlist-fades"; + fadeIn = span.text().trim(); + + if(!isTimeValid(fadeIn)){ + showError(span, "please put in a time '00:00:00 (.000000)'"); + return; + } + + $.post(url, {format: "json", fadeIn: fadeIn}, function(json){ + if(json.response.error) { + return; + } + + hideError(span); + }); + }); + + $("#spl_fade_out_main span:first").blur(function(event){ + event.stopPropagation(); + + var url, fadeIn, span; + + span = $(this); + url = "/Playlist/set-playlist-fades"; + fadeOut = span.text().trim(); + + if(!isTimeValid(fadeOut)){ + showError(span, "please put in a time '00:00:00 (.000000)'"); + return; + } + + $.post(url, {format: "json", fadeOut: fadeOut}, function(json){ + if(json.response.error) { + return; + } + + hideError(span); + }); + }); + + $("#spl_fade_in_main span:first, #spl_fade_out_main span:first") + .keydown(submitOnEnter); + + $("#crossfade_main > .ui-icon-closethick").click(function(){ + $("#spl_crossfade").removeClass("ui-state-active"); + $("#crossfade_main").hide(); + }); $("#spl_delete") .button() From 3d3515812a8ec2d5ae31cc0735fd81b490a87178 Mon Sep 17 00:00:00 2001 From: Naomi Date: Tue, 8 Feb 2011 18:22:51 -0500 Subject: [PATCH 3/5] added monthly show option, bit more javascript to show/hide info when not needed in add show tabs. --- application/configs/airtime-conf.php | 2 +- application/forms/AddShowRepeats.php | 21 +-- application/models/Shows.php | 130 ++++++++++++------ .../models/airtime/map/CcShowDaysTableMap.php | 2 +- build/build.properties | 2 +- build/schema.xml | 2 +- build/sql/schema.sql | 2 +- public/js/airtime/schedule/add-show.js | 14 ++ 8 files changed, 118 insertions(+), 57 deletions(-) diff --git a/application/configs/airtime-conf.php b/application/configs/airtime-conf.php index 1fe0ecb7e..144676b10 100644 --- a/application/configs/airtime-conf.php +++ b/application/configs/airtime-conf.php @@ -1,6 +1,6 @@ array ( diff --git a/application/forms/AddShowRepeats.php b/application/forms/AddShowRepeats.php index 5d9c1af03..7744b35e9 100644 --- a/application/forms/AddShowRepeats.php +++ b/application/forms/AddShowRepeats.php @@ -5,6 +5,17 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm public function init() { + //Add type select + $this->addElement('select', 'add_show_repeat_type', array( + 'required' => true, + 'label' => 'Repeat Type:', + 'multiOptions' => array( + "0" => "weekly", + "1" => "bi-weekly", + "2" => "monthly" + ), + )); + // Add days checkboxes $this->addElement( 'multiCheckbox', @@ -29,16 +40,6 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm 'viewScript' => 'form/add-show-checkbox.phtml' )))); - //Add type select - $this->addElement('select', 'add_show_repeat_type', array( - 'required' => true, - 'label' => 'Repeat Type:', - 'multiOptions' => array( - "0" => "weekly", - "1" => "bi-weekly" - ), - )); - // Add end date element $this->addElement('text', 'add_show_end_date', array( 'label' => 'Date End:', diff --git a/application/models/Shows.php b/application/models/Shows.php index b0ebbfe29..6d6ee9356 100644 --- a/application/models/Shows.php +++ b/application/models/Shows.php @@ -71,37 +71,52 @@ class Show { $showId = $show->getDbId(); - foreach ($data['add_show_day_check'] as $day) { + //don't set day for monthly repeat type, it's invalid. + if($data['add_show_repeats'] && $data["add_show_repeat_type"] == 2) { + $showDay = new CcShowDays(); + $showDay->setDbFirstShow($data['add_show_start_date']); + $showDay->setDbLastShow($endDate); + $showDay->setDbStartTime($data['add_show_start_time']); + $showDay->setDbDuration($data['add_show_duration']); + $showDay->setDbRepeatType($repeat_type); + $showDay->setDbShowId($showId); + $showDay->save(); + } + else { - if($startDow !== $day){ + foreach ($data['add_show_day_check'] as $day) { + + if($startDow !== $day){ - if($startDow > $day) - $daysAdd = 6 - $startDow + 1 + $day; - else - $daysAdd = $day - $startDow; + if($startDow > $day) + $daysAdd = 6 - $startDow + 1 + $day; + else + $daysAdd = $day - $startDow; - $sql = "SELECT date '{$data['add_show_start_date']}' + INTERVAL '{$daysAdd} day' "; - $r = $con->query($sql); - $start = $r->fetchColumn(0); - } - else { - $start = $data['add_show_start_date']; - } + $sql = "SELECT date '{$data['add_show_start_date']}' + INTERVAL '{$daysAdd} day' "; + $r = $con->query($sql); + $start = $r->fetchColumn(0); + } + else { + $start = $data['add_show_start_date']; + } - if(strtotime($start) < strtotime($endDate) || is_null($endDate)) { + if(strtotime($start) < strtotime($endDate) || is_null($endDate)) { - $showDay = new CcShowDays(); - $showDay->setDbFirstShow($start); - $showDay->setDbLastShow($endDate); - $showDay->setDbStartTime($data['add_show_start_time']); - $showDay->setDbDuration($data['add_show_duration']); - $showDay->setDbDay($day); - $showDay->setDbRepeatType($repeat_type); - $showDay->setDbShowId($showId); - $showDay->save(); - } - } + $showDay = new CcShowDays(); + $showDay->setDbFirstShow($start); + $showDay->setDbLastShow($endDate); + $showDay->setDbStartTime($data['add_show_start_time']); + $showDay->setDbDuration($data['add_show_duration']); + $showDay->setDbDay($day); + $showDay->setDbRepeatType($repeat_type); + $showDay->setDbShowId($showId); + $showDay->save(); + } + } + } + //add selected hosts to cc_show_hosts table. foreach ($data['add_show_hosts'] as $host) { $showHost = new CcShowHosts(); $showHost->setDbShow($showId); @@ -158,6 +173,19 @@ class Show { } } + private static function setNextPop($next_date, $show_id, $day) { + + $nextInfo = explode(" ", $next_date); + + $repeatInfo = CcShowDaysQuery::create() + ->filterByDbShowId($show_id) + ->filterByDbDay($day) + ->findOne(); + + $repeatInfo->setDbNextPopDate($nextInfo[0]) + ->save(); + } + //for a show with repeat_type == 0 private static function populateWeeklyShow($show_id, $next_pop_date, $first_show, $last_show, $start_time, $duration, $day, $end_timestamp) { global $CC_DBC; @@ -186,15 +214,7 @@ class Show { $next_date = $CC_DBC->GetOne($sql); } - $nextInfo = explode(" ", $next_date); - - $repeatInfo = CcShowDaysQuery::create() - ->filterByDbShowId($show_id) - ->filterByDbDay($day) - ->findOne(); - - $repeatInfo->setDbNextPopDate($nextInfo[0]) - ->save(); + Show::setNextPop($next_date, $show_id, $day); } //for a show with repeat_type == 1 @@ -225,15 +245,38 @@ class Show { $next_date = $CC_DBC->GetOne($sql); } - $nextInfo = explode(" ", $next_date); + Show::setNextPop($next_date, $show_id, $day); + } - $repeatInfo = CcShowDaysQuery::create() - ->filterByDbShowId($show_id) - ->filterByDbDay($day) - ->findOne(); + //for a show with repeat_type == 2 + private static function populateMonthlyShow($show_id, $next_pop_date, $first_show, $last_show, $start_time, $duration, $day, $end_timestamp) { + global $CC_DBC; - $repeatInfo->setDbNextPopDate($nextInfo[0]) - ->save(); + if(isset($next_pop_date)) { + $next_date = $next_pop_date." ".$start_time; + } + else { + $next_date = $first_show." ".$start_time; + } + + while(strtotime($next_date) < strtotime($end_timestamp) && (strtotime($last_show) > strtotime($next_date) || is_null($last_show))) { + + $start = $next_date; + + $sql = "SELECT timestamp '{$start}' + interval '{$duration}'"; + $end = $CC_DBC->GetOne($sql); + + $newShow = new CcShowInstances(); + $newShow->setDbShowId($show_id); + $newShow->setDbStarts($start); + $newShow->setDbEnds($end); + $newShow->save(); + + $sql = "SELECT timestamp '{$start}' + interval '1 month'"; + $next_date = $CC_DBC->GetOne($sql); + } + + Show::setNextPop($next_date, $show_id, $day); } private static function populateShow($repeat_type, $show_id, $next_pop_date, $first_show, $last_show, $start_time, $duration, $day, $end_timestamp) { @@ -247,6 +290,9 @@ class Show { else if($repeat_type == 1) { Show::populateBiWeeklyShow($show_id, $next_pop_date, $first_show, $last_show, $start_time, $duration, $day, $end_timestamp); } + else if($repeat_type == 2) { + Show::populateMonthlyShow($show_id, $next_pop_date, $first_show, $last_show, $start_time, $duration, $day, $end_timestamp); + } } //used to catch up a newly added show @@ -459,7 +505,7 @@ class ShowInstance { $scheduledContentFits = $CC_DBC->GetOne($sql); if($scheduledContentFits != "t") { - return "Must removed some scheduled content."; + return "Must remove some scheduled content."; } } diff --git a/application/models/airtime/map/CcShowDaysTableMap.php b/application/models/airtime/map/CcShowDaysTableMap.php index de6a621bf..3a8535635 100644 --- a/application/models/airtime/map/CcShowDaysTableMap.php +++ b/application/models/airtime/map/CcShowDaysTableMap.php @@ -43,7 +43,7 @@ class CcShowDaysTableMap extends TableMap { $this->addColumn('LAST_SHOW', 'DbLastShow', 'DATE', false, null, null); $this->addColumn('START_TIME', 'DbStartTime', 'TIME', true, null, null); $this->addColumn('DURATION', 'DbDuration', 'TIME', true, null, null); - $this->addColumn('DAY', 'DbDay', 'TINYINT', true, null, null); + $this->addColumn('DAY', 'DbDay', 'TINYINT', false, null, null); $this->addColumn('REPEAT_TYPE', 'DbRepeatType', 'TINYINT', true, null, null); $this->addColumn('NEXT_POP_DATE', 'DbNextPopDate', 'DATE', false, null, null); $this->addForeignKey('SHOW_ID', 'DbShowId', 'INTEGER', 'cc_show', 'ID', true, null, null); diff --git a/build/build.properties b/build/build.properties index 75a77da70..cd25e41b3 100644 --- a/build/build.properties +++ b/build/build.properties @@ -1,6 +1,6 @@ #Note: project.home is automatically generated by the propel-install script. #Any manual changes to this value will be overwritten. -project.home = /home/naomiaro/dev-campcaster/campcaster +project.home = /home/naomi/dev-campcaster/campcaster project.build = ${project.home}/build #Database driver diff --git a/build/schema.xml b/build/schema.xml index 5b0bbd1b4..5757c7996 100644 --- a/build/schema.xml +++ b/build/schema.xml @@ -143,7 +143,7 @@ - + diff --git a/build/sql/schema.sql b/build/sql/schema.sql index 26942a8be..a1ed0f9ca 100644 --- a/build/sql/schema.sql +++ b/build/sql/schema.sql @@ -206,7 +206,7 @@ CREATE TABLE "cc_show_days" "last_show" DATE, "start_time" TIME NOT NULL, "duration" TIME NOT NULL, - "day" INT2 NOT NULL, + "day" INT2, "repeat_type" INT2 NOT NULL, "next_pop_date" DATE, "show_id" INTEGER NOT NULL, diff --git a/public/js/airtime/schedule/add-show.js b/public/js/airtime/schedule/add-show.js index 2a86084c1..e06090265 100644 --- a/public/js/airtime/schedule/add-show.js +++ b/public/js/airtime/schedule/add-show.js @@ -70,6 +70,20 @@ function setAddShowEvents() { $("#schedule-show-when > fieldset:last").toggle(); }); + $("#add_show_repeat_type").change(function(){ + var x = $(this).val(); + if($(this).val() == 2) { + $("#add_show_day_check-label, #add_show_day_check-element").hide(); + } + else { + $("#add_show_day_check-label, #add_show_day_check-element").show(); + } + }); + + $("#add_show_no_end").click(function(){ + $("#add_show_end_date").toggle(); + }); + start = $("#add_show_start_date"); end = $("#add_show_end_date"); From 918f4ec96d5aa8ab1f23e93107b048d68b36a3af Mon Sep 17 00:00:00 2001 From: Naomi Date: Tue, 8 Feb 2011 18:47:04 -0500 Subject: [PATCH 4/5] forogt to check a view in, not used though. --- application/views/scripts/playlist/set-playlist-fades.phtml | 1 + 1 file changed, 1 insertion(+) create mode 100644 application/views/scripts/playlist/set-playlist-fades.phtml diff --git a/application/views/scripts/playlist/set-playlist-fades.phtml b/application/views/scripts/playlist/set-playlist-fades.phtml new file mode 100644 index 000000000..e6112eb51 --- /dev/null +++ b/application/views/scripts/playlist/set-playlist-fades.phtml @@ -0,0 +1 @@ +

    View script for controller Playlist and script/action name setPlaylistFades
    \ No newline at end of file From 036adf17e3a0d75bfe1c43f4071041932359f8d8 Mon Sep 17 00:00:00 2001 From: Naomi Date: Wed, 9 Feb 2011 11:55:05 -0500 Subject: [PATCH 5/5] problems with events if items jump around scroll bar. --- public/css/playlist_builder.css | 2 +- public/js/airtime/library/spl.js | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/public/css/playlist_builder.css b/public/css/playlist_builder.css index 9a6edccf5..dd1ad24b1 100644 --- a/public/css/playlist_builder.css +++ b/public/css/playlist_builder.css @@ -36,7 +36,7 @@ list-style: none; padding:0; height: 400px; - overflow: auto; + overflow-y: scroll; width:100%; margin-top:0; } diff --git a/public/js/airtime/library/spl.js b/public/js/airtime/library/spl.js index e6db5a7ff..b10ec1642 100644 --- a/public/js/airtime/library/spl.js +++ b/public/js/airtime/library/spl.js @@ -146,21 +146,21 @@ function submitOnEnter(event) { } } -function setCueEvents() { +function setCueEvents(el) { - $(".spl_cue_in span:last").blur(changeCueIn); - $(".spl_cue_out span:last").blur(changeCueOut); + $(el).find(".spl_cue_in span:last").blur(changeCueIn); + $(el).find(".spl_cue_out span:last").blur(changeCueOut); - $(".spl_cue_in span:first, .spl_cue_out span:first") + $(el).find(".spl_cue_in span:first, .spl_cue_out span:first") .keydown(submitOnEnter); } -function setFadeEvents() { +function setFadeEvents(el) { - $(".spl_fade_in span:first").blur(changeFadeIn); - $(".spl_fade_out span:first").blur(changeFadeOut); + $(el).find(".spl_fade_in span:first").blur(changeFadeIn); + $(el).find(".spl_fade_out span:first").blur(changeFadeOut); - $(".spl_fade_in span:first, .spl_fade_out span:first") + $(el).find(".spl_fade_in span:first, .spl_fade_out span:first") .keydown(submitOnEnter); } @@ -198,7 +198,7 @@ function openFadeEditor(event) { .append(json.html) .show(); - setFadeEvents(); + setFadeEvents(li); }); } @@ -231,7 +231,7 @@ function openCueEditor(event) { .append(json.html) .show(); - setCueEvents(); + setCueEvents(li); }); }