diff --git a/airtime_mvc/application/controllers/ShowBuilderController.php b/airtime_mvc/application/controllers/ShowBuilderController.php index 1c16e762d..71afc2eb7 100644 --- a/airtime_mvc/application/controllers/ShowBuilderController.php +++ b/airtime_mvc/application/controllers/ShowBuilderController.php @@ -35,7 +35,6 @@ class ShowBuilderController extends Zend_Controller_Action { // PLUPLOAD $this->view->headScript()->appendFile($baseUrl.'js/libs/dropzone.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); - $this->view->headLink()->appendStylesheet($baseUrl.'css/dropzone/dropzone.min.css?'.$CC_CONFIG['airtime_version']); $this->view->headScript()->appendFile($baseUrl.'js/timepicker/jquery.ui.timepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/_builder.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); diff --git a/airtime_mvc/application/forms/EditAudioMD.php b/airtime_mvc/application/forms/EditAudioMD.php index 7fe13b39d..b58d56201 100644 --- a/airtime_mvc/application/forms/EditAudioMD.php +++ b/airtime_mvc/application/forms/EditAudioMD.php @@ -15,6 +15,7 @@ class Application_Form_EditAudioMD extends Zend_Form $file_id->setValue($p_id); $file_id->addDecorator('HtmlTag', array('tag' => 'div', 'style' => 'display:none')); $file_id->removeDecorator('Label'); + $file_id->setAttrib('class', 'obj_id'); $this->addElement($file_id); // Add title field diff --git a/airtime_mvc/application/layouts/scripts/layout.phtml b/airtime_mvc/application/layouts/scripts/layout.phtml index 71c974024..263d794ba 100644 --- a/airtime_mvc/application/layouts/scripts/layout.phtml +++ b/airtime_mvc/application/layouts/scripts/layout.phtml @@ -81,7 +81,30 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
>
-
+
+
+ + +
+
+
+
+
+
+ +
layout()->content ?>
diff --git a/airtime_mvc/application/views/scripts/playlist/_playlist.phtml b/airtime_mvc/application/views/scripts/playlist/_playlist.phtml index 086cf1c17..92937300d 100644 --- a/airtime_mvc/application/views/scripts/playlist/_playlist.phtml +++ b/airtime_mvc/application/views/scripts/playlist/_playlist.phtml @@ -6,15 +6,15 @@ if (isset($this->obj)) { ?> obj)) : ?> -
- - - +
+ + + @@ -25,23 +25,18 @@ if (isset($this->obj)) { -
- obj)) : ?> -
- -
-
- -
-
- -
-
- "> - - -
- +
+
+ +
+
+ +
+
+ "> + + +
form; ?> @@ -62,6 +57,11 @@ if (isset($this->obj)) { contents = $contents; echo $this->render('playlist/update.phtml') ?> +
+
+ +
+
diff --git a/airtime_mvc/application/views/scripts/playlist/_smart-block.phtml b/airtime_mvc/application/views/scripts/playlist/_smart-block.phtml index 63aa24155..f9b6e267d 100644 --- a/airtime_mvc/application/views/scripts/playlist/_smart-block.phtml +++ b/airtime_mvc/application/views/scripts/playlist/_smart-block.phtml @@ -4,41 +4,25 @@ if (isset($this->obj)) { $count = count($contents); } ?> -
-obj)) : ?> -
- -
-
- -
-
- "> - - -
- -
obj)) : ?> - - - - - +
+ + + + + -
-
@@ -48,28 +32,39 @@ if (isset($this->obj)) {
-
- - form; ?> - - -
-
-
    - contents = $contents; - echo $this->render('playlist/update.phtml') ?> -
+
    + contents = $contents; + echo $this->render('playlist/update.phtml') ?> +
+
+
+ +
diff --git a/airtime_mvc/application/views/scripts/playlist/playlist.phtml b/airtime_mvc/application/views/scripts/playlist/playlist.phtml index 4970d6f13..8d8d0be4f 100644 --- a/airtime_mvc/application/views/scripts/playlist/playlist.phtml +++ b/airtime_mvc/application/views/scripts/playlist/playlist.phtml @@ -42,10 +42,10 @@ if (isset($this->obj)) { diff --git a/airtime_mvc/application/views/scripts/playlist/smart-block.phtml b/airtime_mvc/application/views/scripts/playlist/smart-block.phtml index b97f5cf55..9ad40d990 100644 --- a/airtime_mvc/application/views/scripts/playlist/smart-block.phtml +++ b/airtime_mvc/application/views/scripts/playlist/smart-block.phtml @@ -39,7 +39,7 @@ if (isset($this->obj)) { diff --git a/airtime_mvc/application/views/scripts/playlist/update.phtml b/airtime_mvc/application/views/scripts/playlist/update.phtml index 0171efafa..c774f2efc 100644 --- a/airtime_mvc/application/views/scripts/playlist/update.phtml +++ b/airtime_mvc/application/views/scripts/playlist/update.phtml @@ -13,13 +13,13 @@ if ($item['type'] == 2) { else if ($item['type'] == 1) { $fileUrl = null; } -else if ($item['type'] == 0) { - $audiofile = Application_Model_StoredFile::RecallById($item['item_id']); - $fileUrl = $audiofile->getFileUrl(); +else if ($item['type'] == 0) { + $audiofile = Application_Model_StoredFile::RecallById($item['item_id']); + $fileUrl = $audiofile->getFileUrl(); } if (($i < count($items) -1) && ($items[$i+1]['type'] == 0)) { - $nextAudiofile = Application_Model_StoredFile::RecallById($items[$i+1]['item_id']); + $nextAudiofile = Application_Model_StoredFile::RecallById($items[$i+1]['item_id']); $nextFileUrl = $nextAudiofile->getFileUrl(); } ?> @@ -79,7 +79,7 @@ if (($i < count($items) -1) && ($items[$i+1]['type'] == 0)) { 'id' => $item["id"], 'cueIn' => $item['cuein'], 'cueOut' => $item['cueout'], - 'cueInSec' => $item['cueInSec'], + 'cueInSec' => $item['cueInSec'], 'cueOutSec' => $item['cueOutSec'], 'uri' => $fileUrl, 'origLength' => $item['orig_length'])); ?> @@ -99,18 +99,18 @@ if (($i < count($items) -1) && ($items[$i+1]['type'] == 0)) { 'fadeOut' => $items[$i]['fadeout'], 'fadeIn' => $items[$i+1]['fadein'], 'item1Type' => $items[$i]['type'], - 'cueIn1' => $items[$i]['cueInSec'], + 'cueIn1' => $items[$i]['cueInSec'], 'cueOut1' => $items[$i]['cueOutSec'], 'item1Url' => $fileUrl ); - $item2 = array( + $item2 = array( 'item2Url' => $nextFileUrl, - 'item2' => $items[$i+1]['id'], - 'item2Type' => $items[$i+1]['type'], - 'offset' => $items[$i]['trackSec'] - $items[$i+1]['trackoffset'], - 'cueIn2' => $items[$i+1]['cueInSec'], - 'cueOut2' => $items[$i+1]['cueOutSec'] + 'item2' => $items[$i+1]['id'], + 'item2Type' => $items[$i+1]['type'], + 'offset' => $items[$i]['trackSec'] - $items[$i+1]['trackoffset'], + 'cueIn2' => $items[$i+1]['cueInSec'], + 'cueOut2' => $items[$i+1]['cueOutSec'] ); if (isset($nextFileUrl)) { @@ -129,13 +129,10 @@ if (($i < count($items) -1) && ($items[$i+1]['type'] == 0)) { -
  • +
    obj instanceof Application_Model_Block) { - echo _("Empty smart block"); - } else { - echo _("Empty playlist"); - } + echo _("Drag tracks here from your library to add them to the " + . ($this->obj instanceof Application_Model_Block ? "smart block" : "playlist")); ?> -
  • +
    diff --git a/airtime_mvc/application/views/scripts/show-builder/index.phtml b/airtime_mvc/application/views/scripts/show-builder/index.phtml index a50a7c2d7..a9f051926 100644 --- a/airtime_mvc/application/views/scripts/show-builder/index.phtml +++ b/airtime_mvc/application/views/scripts/show-builder/index.phtml @@ -5,37 +5,32 @@ -
    -
    - - -
    -
    -
    -
    -
    -
    + + + + + + + + + + + + + + + + + + + + + + +csrf ?>
    - - - - - -
    -
    -
    - -
    - -
    - obj)) : ?> obj->getLastModified('U'); ?>"/> @@ -18,10 +6,10 @@
    -

    - escape($this->obj->getName()); ?> +

    + escape($this->obj->getName()); ?>

    -

    obj->getDefaultLength(); ?>

    +

    obj->getDefaultLength(); ?>

    @@ -29,7 +17,6 @@
    -
    @@ -46,6 +33,12 @@
    +
    +
    + +
    +
    +
    diff --git a/airtime_mvc/application/views/scripts/webstream/webstream.phtml b/airtime_mvc/application/views/scripts/webstream/webstream.phtml index 09cfc5863..484a8a638 100644 --- a/airtime_mvc/application/views/scripts/webstream/webstream.phtml +++ b/airtime_mvc/application/views/scripts/webstream/webstream.phtml @@ -13,7 +13,7 @@ obj)) : ?>
    - +
    @@ -29,10 +29,10 @@
    -

    - escape($this->obj->getName()); ?> +

    + escape($this->obj->getName()); ?>

    -

    obj->getDefaultLength(); ?>

    +

    obj->getDefaultLength(); ?>

    diff --git a/airtime_mvc/public/css/_showbuilder.css b/airtime_mvc/public/css/_showbuilder.css index e7e9a0efd..0bdd54c3e 100644 --- a/airtime_mvc/public/css/_showbuilder.css +++ b/airtime_mvc/public/css/_showbuilder.css @@ -11,10 +11,13 @@ div.ColVis_collectionBackground { .wrapper { /*background: #242424;*/ background: #111; - left: 0; + top: 139px; + left: 130px; right: 0; bottom: 0; - padding: 10px; + padding: 10px 10px 40px; + /*padding: 0;*/ + border: none; display: -webkit-box; display: -moz-box; @@ -120,40 +123,39 @@ div.ColVis_collectionBackground { flex: 8 100%; min-height: 50%; } - #media_type_nav { - display: -webkit-box; - display: -moz-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - -webkit-flex-flow: row; - flex-flow: row; + /*#media_type_nav {*/ + /*display: -webkit-box;*/ + /*display: -moz-box;*/ + /*display: -ms-flexbox;*/ + /*display: -webkit-flex;*/ + /*display: flex;*/ + /*-webkit-flex-flow: row;*/ + /*flex-flow: row;*/ - -webkit-align-items: center; - align-items: center; - -webkit-justify-content: center; - justify-content: center; - } - #media_type_nav .btn-group { - flex: 1 100%; - } - #media_type_nav .dropdown-menu { - width: 100%; - } - #media_type_nav .media_type_selector { - flex: 1 100%; - margin-top: 3px; - } + /*-webkit-align-items: center;*/ + /*align-items: center;*/ + /*-webkit-justify-content: center;*/ + /*justify-content: center;*/ + /*}*/ + /*#media_type_nav .btn-group {*/ + /*flex: 1 100%;*/ + /*}*/ + /*#media_type_nav .dropdown-menu {*/ + /*width: 100%;*/ + /*}*/ + /*#media_type_nav .media_type_selector {*/ + /*flex: 1 100%;*/ + /*margin-top: 3px;*/ + /*}*/ } @media screen and (max-width: 780px) { .wrapper { - /*height: 100% !important; /!* Correct for margins *!/*/ - padding: 4px !important; - } - #media_type_nav { - min-width: 555px; + padding: 4px 4px 40px !important; } + /*#media_type_nav {*/ + /*min-width: 555px;*/ + /*}*/ } @media screen and (max-width: 555px) { @@ -395,8 +397,10 @@ div.ColVis_collectionBackground { cursor: default; } -.nav-tabs .close-round { - margin: 1px 0 0 10px; +.lib_pl_close { + cursor: pointer; + margin-left: 10px; + z-index: 1; } /* Media editors */ @@ -442,10 +446,6 @@ textarea { /* Playlist/Block/Webstream Editors */ -.inner_playlist_wrapper { - flex: 1 100%; -} - .side_playlist { position: relative; width: 100%; /* Override because we're using flexbox */ @@ -487,13 +487,19 @@ textarea { .spl-no-margin { margin: 0; - padding-bottom: 4px; +} + +.spl-no-margin > div:last-child { + margin-left: 0 !important; } .spl_sortable { position: relative; + min-height: 0; overflow: auto; flex: 1 100%; + + margin: 4px 0; padding: 0; } @@ -501,12 +507,71 @@ textarea { cursor: move; } +.spl_empty { + width: 100%; + + color: white; + text-align: center; + vertical-align: middle; + + font-size: 20px; +} + +.crossfade-main { + float: left; + width: 100%; + margin: 0; + padding: 0; +} + +.crossfade-main > dl { + padding: 4px; +} + +#save_button, #webstream_save { + background: #ff5d1a; + color: #fff; + border-radius: 4px; + font-size: 16px; + height: 38px; + width: 120px; +} + +#save_button:active, #webstream_save { + color: #fff !important; +} + +#save_button:focus, #webstream_save { + outline-width: 0; +} + /* Media type selector */ #media_type_nav { + position: relative; + top: 139px; + + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + + height: 100%; + width: 130px; + flex: 1 auto; - margin-right: 10px; - text-align: center; + padding: 4px; + /*margin-right: 10px;*/ + /*text-align: center;*/ + + background: #353535; + border: 1px solid #242424; + border-top: 1px solid #7e7e7e; + /* border: 1px solid #242424; */ + -moz-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); + + z-index: 100; } #media_type_nav div { @@ -619,3 +684,7 @@ textarea { margin-top: 10px; } + +.dropzone .dz-message { + margin: 0; +} \ No newline at end of file diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index 1974c6d22..b38b445c7 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -341,10 +341,6 @@ fieldset { } } @media screen and (max-width: 970px) { - #nav { - height: inherit; - overflow-y: visible; - } #nav .responsive-menu { position: absolute; left: 0; @@ -393,7 +389,6 @@ fieldset { } @media screen and (max-width: 1100px) { #nav { - height: inherit; overflow-y: visible; } } diff --git a/airtime_mvc/public/js/airtime/library/_library.js b/airtime_mvc/public/js/airtime/library/_library.js index 94f26f6d3..3d80e4fcc 100644 --- a/airtime_mvc/public/js/airtime/library/_library.js +++ b/airtime_mvc/public/js/airtime/library/_library.js @@ -529,7 +529,7 @@ var AIRTIME = (function(AIRTIME) { // https://wiki.sourcefabric.org/display/CC/Adding+a+new+library+datatable+column "aoColumns": [ /* ftype */ { "sTitle" : "" , "mDataProp" : "ftype" , "bSearchable" : false , "bVisible" : false } , - /* Checkbox */ { "sTitle" : "" , "mDataProp" : "checkbox" , "bSortable" : false , "bSearchable" : false , "sWidth" : "10px" , "sClass" : "library_checkbox" } , + /* Checkbox */ { "sTitle" : "" , "mDataProp" : "checkbox" , "bSortable" : false , "bSearchable" : false , "sWidth" : "16px" , "sClass" : "library_checkbox" } , /* Type */ { "sTitle" : "" , "mDataProp" : "image" , "bSearchable" : false , "sWidth" : "16px" , "sClass" : "library_type" , "iDataSort" : 0 } , /* Is Scheduled */ { "sTitle" : $.i18n._("Scheduled") , "mDataProp" : "is_scheduled" , "bVisible" : false , "bSearchable" : false , "sWidth" : "90px" , "sClass" : "library_is_scheduled"} , ///* Is Playlist */ { "sTitle" : $.i18n._("Playlist / Block") , "mDataProp" : "is_playlist" , "bSearchable" : false , "sWidth" : "110px" , "sClass" : "library_is_playlist"} , diff --git a/airtime_mvc/public/js/airtime/library/_spl.js b/airtime_mvc/public/js/airtime/library/_spl.js index a0fc5d132..61140f5d1 100644 --- a/airtime_mvc/public/js/airtime/library/_spl.js +++ b/airtime_mvc/public/js/airtime/library/_spl.js @@ -362,7 +362,7 @@ var AIRTIME = (function(AIRTIME){ //remove any newlines if user somehow snuck them in (easy to do if dragging/dropping text) nameElement.text(nameElement.text().replace("\n", "")); - var name = $pl.find("#playlist_name_display").text(); + var name = $pl.find(".playlist_name_display").text(); $(".nav.nav-tabs .active a > span.tab-name").text(name); } @@ -379,7 +379,7 @@ var AIRTIME = (function(AIRTIME){ $('#spl_name > a') .empty() .append(json.name); - $('#obj_length') + $pl.find('.obj_length') .empty() .append(json.length); $('#fieldset-metadate_change textarea') @@ -448,11 +448,11 @@ var AIRTIME = (function(AIRTIME){ pane = $(".editor_pane_wrapper:last"), name = json.type == "md" ? // file pane.append(json.html).find("#track_title").val() + $.i18n._(" - Metadata Editor") - : pane.append(json.html).find("#playlist_name_display").text(), + : pane.append(json.html).find(".playlist_name_display").text(), tab = "", tabs = $(".nav.nav-tabs"); @@ -482,6 +482,7 @@ var AIRTIME = (function(AIRTIME){ newTab.wrapper.find(".md-cancel").on("click", function() { closeTab(); }); + initialEvents(); } function openPlaylist(json) { @@ -517,8 +518,9 @@ var AIRTIME = (function(AIRTIME){ var pane = $(".active-tab"), tab = $(".nav.nav-tabs .active"), toPane = pane.next().length > 0 ? pane.next() : pane.prev(), - toTab = tab.next().length > 0 ? tab.next() : tab.prev(); - delete $openTabs[tab.attr("tab-type") + pane.find(".obj_id").val()]; + toTab = tab.next().length > 0 ? tab.next() : tab.prev(), + objId = pane.find(".obj_id").val(); + delete $openTabs[tab.attr("tab-type") + objId]; tab.remove(); $pl.remove(); AIRTIME.showbuilder.switchTab(toPane, toTab); @@ -799,8 +801,8 @@ var AIRTIME = (function(AIRTIME){ //end main playlist fades. //edit playlist name event - $pl.on("keydown", "#playlist_name_display", submitOnEnter); - $pl.on("blur", "#playlist_name_display", editName); + $pl.on("keydown", ".playlist_name_display", submitOnEnter); + $pl.on("blur", ".playlist_name_display", editName); //edit playlist description events $pl.on("click", "legend", function(){ @@ -845,7 +847,7 @@ var AIRTIME = (function(AIRTIME){ var description = $pl.find("#description").val(); var streamurl = $pl.find("#streamurl-element input").val(); var length = $pl.find("#streamlength-element input").val(); - var name = $pl.find("#playlist_name_display").text(); + var name = $pl.find(".playlist_name_display").text(); //hide any previous errors (if any) $(".side_playlist.active-tab .errors").empty().hide(); @@ -876,7 +878,7 @@ var AIRTIME = (function(AIRTIME){ $ws_id.show(); - var length = $(".side_playlist.active-tab #ws_length"); + var length = $(".side_playlist.active-tab .ws_length"); length.text(json.length); //redraw the library to show the new webstream @@ -903,7 +905,13 @@ var AIRTIME = (function(AIRTIME){ }); }); - $(".lib_pl_close").unbind().click(function() { + // Unbind so each tab is only handled by its own close button + $(".lib_pl_close").unbind().click(function(e) { + e.preventDefault(); + e.stopPropagation(); + + $(this).unbind("click"); // Prevent repeated clicks in quick succession from closing multiple tabs + var tabId = $(this).closest("li").attr("tab-id"); AIRTIME.showbuilder.switchTab($("#pl-tab-content-" + tabId), $("#pl-tab-" + tabId)); @@ -913,7 +921,7 @@ var AIRTIME = (function(AIRTIME){ // We also need to run the draw callback to update how dragged items are drawn AIRTIME.library.fnDrawCallback(); - var name = $pl.find('#playlist_name_display').text().trim(); + var name = $pl.find('.playlist_name_display').text().trim(); if ((name == "Untitled Playlist" || name == "Untitled Smart Block") @@ -941,7 +949,7 @@ var AIRTIME = (function(AIRTIME){ * Playlists: get name, description */ var criteria = $pl.find('form').serializeArray(), - block_name = $pl.find('#playlist_name_display').text(), + block_name = $pl.find('.playlist_name_display').text(), block_desc = $pl.find('textarea[name="description"]').val(), save_action = baseUrl+'new-playlist/save', obj_id = $pl.find(".obj_id").val(), diff --git a/airtime_mvc/public/js/airtime/library/events/_library_showbuilder.js b/airtime_mvc/public/js/airtime/library/events/_library_showbuilder.js index 7d3bffbe8..173299c8f 100644 --- a/airtime_mvc/public/js/airtime/library/events/_library_showbuilder.js +++ b/airtime_mvc/public/js/airtime/library/events/_library_showbuilder.js @@ -187,8 +187,8 @@ var AIRTIME = (function(AIRTIME) { aMediaIds.push(new Array(data.id, data.ftype)); // check if a playlist/block is open before adding items - if ($('input[id="obj_type"]').val() == 'playlist' - || $('input[id="obj_type"]').val() == 'block') { + if ($('.active-tab .obj_type').val() == 'playlist' + || $('.active-tab .obj_type').val() == 'block') { AIRTIME.playlist.fnAddItems(aMediaIds, undefined, 'after'); } } @@ -196,7 +196,7 @@ var AIRTIME = (function(AIRTIME) { function addToCurrentOrNext(arr) { var el; - // Add to the end of the current show by getting the footer + // Add to the end of the current or next show by getting the footer el = $(".sb-footer.sb-future:first"); var data = el.prev().data("aData"); @@ -236,39 +236,53 @@ var AIRTIME = (function(AIRTIME) { if (AIRTIME.button.isDisabled('btn-group #library-plus') === true) { return; } - - var selected = AIRTIME.library.getSelectedData(), data, i, length, temp, aMediaIds = [], aSchedIds = [], aData = []; - - // process selected files/playlists. - for (i = 0, length = selected.length; i < length; i++) { - data = selected[i]; - aMediaIds.push( { - "id" : data.id, - "type" : data.ftype - }); - } - - $("#show_builder_table tr.sb-selected") - .each(function(i, el) { - aData.push($(el).data("aData")); - }); - - // process selected schedule rows to add media - // after. - for (i = 0, length = aData.length; i < length; i++) { - temp = aData[i]; - aSchedIds.push( { - "id" : temp.id, - "instance" : temp.instance, - "timestamp" : temp.timestamp - }); - } - if (aSchedIds.length == 0) { - addToCurrentOrNext(aSchedIds); + var selected = AIRTIME.library.getSelectedData(), data, i, length, temp, aMediaIds = [], aSchedIds = [], aData = []; + + if ($("#show_builder_table").is(":visible")) { + for (i = 0, length = selected.length; i < length; i++) { + data = selected[i]; + aMediaIds.push( { + "id" : data.id, + "type" : data.ftype + }); + } + + // process selected files/playlists. + $("#show_builder_table tr.sb-selected").each(function(i, el) { + aData.push($(el).data("aData")); + }); + + // process selected schedule rows to add media + // after. + for (i = 0, length = aData.length; i < length; i++) { + temp = aData[i]; + aSchedIds.push( { + "id" : temp.id, + "instance" : temp.instance, + "timestamp" : temp.timestamp + }); + } + + if (aSchedIds.length == 0) { + if (!addToCurrentOrNext(aSchedIds)) { + return; + } + } + + AIRTIME.showbuilder.fnAdd(aMediaIds, aSchedIds); + } else { + for (i = 0, length = selected.length; i < length; i++) { + data = selected[i]; + aMediaIds.push([data.id, data.ftype]); + } + + // check if a playlist/block is open before adding items + if ($('.active-tab .obj_type').val() == 'playlist' + || $('.active-tab .obj_type').val() == 'block') { + AIRTIME.playlist.fnAddItems(aMediaIds, undefined, 'after'); + } } - - AIRTIME.showbuilder.fnAdd(aMediaIds, aSchedIds); }); // delete from library. diff --git a/airtime_mvc/public/js/airtime/library/spl.js b/airtime_mvc/public/js/airtime/library/spl.js index 89acabb1e..f312fd43b 100644 --- a/airtime_mvc/public/js/airtime/library/spl.js +++ b/airtime_mvc/public/js/airtime/library/spl.js @@ -394,7 +394,7 @@ var AIRTIME = (function(AIRTIME){ $('#spl_name > a') .empty() .append(json.name); - $('#obj_length') + $('.obj_length') .empty() .append(json.length); $('#fieldset-metadate_change textarea') @@ -746,8 +746,8 @@ var AIRTIME = (function(AIRTIME){ //end main playlist fades. //edit playlist name event - $pl.on("keydown", "#playlist_name_display", submitOnEnter); - $pl.on("blur", "#playlist_name_display", editName); + $pl.on("keydown", ".playlist_name_display", submitOnEnter); + $pl.on("blur", ".playlist_name_display", editName); //edit playlist description events $pl.on("click", "legend", function(){ @@ -792,7 +792,7 @@ var AIRTIME = (function(AIRTIME){ var description = $pl.find("#description").val(); var streamurl = $pl.find("#streamurl-element input").val(); var length = $pl.find("#streamlength-element input").val(); - var name = $pl.find("#playlist_name_display").text(); + var name = $pl.find(".playlist_name_display").text(); //hide any previous errors (if any) $(".side_playlist .errors").empty().hide(); @@ -823,7 +823,7 @@ var AIRTIME = (function(AIRTIME){ $ws_id.show(); - var length = $(".side_playlist #ws_length"); + var length = $(".side_playlist .ws_length"); length.text(json.length); //redraw the library to show the new webstream @@ -873,7 +873,7 @@ var AIRTIME = (function(AIRTIME){ * Playlists: get name, description */ var criteria = $('form').serializeArray(), - block_name = $('#playlist_name_display').text(), + block_name = $('.playlist_name_display').text(), block_desc = $('textarea[name="description"]').val(), save_action = baseUrl+'Playlist/save', obj_id = $('input[id="obj_id"]').val(), diff --git a/airtime_mvc/public/js/airtime/showbuilder/_builder.js b/airtime_mvc/public/js/airtime/showbuilder/_builder.js index 54f36e54d..0bca1ea2e 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/_builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/_builder.js @@ -14,7 +14,8 @@ var AIRTIME = (function(AIRTIME){ headerFooter = [], DISABLED_CLASS = 'ui-state-disabled', selected, - $previouslySelected; + $previouslySelected, + flagForDeselection; if (AIRTIME.showbuilder === undefined) { AIRTIME.showbuilder = {}; @@ -244,15 +245,16 @@ var AIRTIME = (function(AIRTIME){ mod.selectAll = function () { var $trs = $sbTable.find("tr.lib-audio").not(".sb-past, .sb-empty"); - $trs.addClass(SB_SELECTED_CLASS); + $trs.addClass(SB_SELECTED_CLASS).find(".sb-checkbox > input").prop('checked', true); mod.checkToolBarIcons(); }; mod.selectNone = function () { var $trs = $sbTable.find("tr.lib-audio"); - $trs.removeClass(SB_SELECTED_CLASS); + $trs.removeClass(SB_SELECTED_CLASS).find(".sb-checkbox > input").prop('checked', false); $previouslySelected = undefined; + selected = undefined; mod.checkToolBarIcons(); }; @@ -422,6 +424,7 @@ var AIRTIME = (function(AIRTIME){ oSchedTable = $sbTable.dataTable( { "aoColumns": [ + /* checkbox */ {"mDataProp": "allowed", "sTitle": "", "sWidth": "16px", "sClass": "sb-checkbox"}, /* Type */ {"mDataProp": "image", "sTitle": "", "sClass": "library_image sb-image", "sWidth": "16px"}, /* starts */ {"mDataProp": "starts", "sTitle": $.i18n._("Start"), "sClass": "sb-starts", "sWidth": "60px"}, /* ends */ {"mDataProp": "ends", "sTitle": $.i18n._("End"), "sClass": "sb-ends", "sWidth": "60px"}, @@ -629,6 +632,14 @@ var AIRTIME = (function(AIRTIME){ hide: 'mouseout' }); } + + $node = $(nRow.children[0]); + if (aData.allowed === true && aData.scheduled >= 1 && aData.linked_allowed) { + $node.html(''); + } + else { + $node.empty(); + } } //add the show colour to the leftmost td @@ -764,48 +775,93 @@ var AIRTIME = (function(AIRTIME){ "bScrollCollapseY": false }); - $sbTable.find("tbody").on("mousedown", "tr:not(.sb-past, .sb-empty)", function(ev) { + //$sbTable.find("tbody").on("mousedown", "tr:not(.sb-past, .sb-empty)", function(ev) { + // + // var $tr = $(this), + // // Get the ID of the selected row + // $rowId = $tr.attr("id"); + // + // if (ev.shiftKey && $previouslySelected !== undefined) { + // if ($previouslySelected.attr("id") == $rowId) { + // return; + // } + // + // // If the selected row comes before the previously selected row, + // // we want to select previous rows, otherwise we select next + // if ($previouslySelected.prevAll("#"+$rowId).length !== 0) { + // $previouslySelected.prevUntil($tr).each(function(i, el){ + // $(el).addClass(SB_SELECTED_CLASS); + // }); + // } else { + // $previouslySelected.nextUntil($tr).each(function(i, el){ + // $(el).addClass(SB_SELECTED_CLASS); + // }); + // } + // $tr.addClass(SB_SELECTED_CLASS); + // } else if (ev.ctrlKey && $previouslySelected !== undefined) { + // $tr.addClass(SB_SELECTED_CLASS); + // } else { + // if (!$tr.hasClass(SB_SELECTED_CLASS)) { + // $("."+SB_SELECTED_CLASS).removeClass(SB_SELECTED_CLASS); + // } + // $tr.addClass(SB_SELECTED_CLASS); + // } + // + // // Remember this row so we can properly multiselect + // $previouslySelected = $tr; + // + // mod.checkToolBarIcons(); + //}); + // + //$sbTable.find("tbody").on("click", "tr:not(.sb-past, .sb-empty)", function(ev) { + // if (!ev.ctrlKey && !ev.shiftKey) { + // $("."+SB_SELECTED_CLASS).removeClass(SB_SELECTED_CLASS); + // $(this).addClass(SB_SELECTED_CLASS); + // } + //}); + $sbTable.find("tbody").on("mousedown", "tr:not(.sb-past, .sb-empty)", function(ev) { var $tr = $(this), // Get the ID of the selected row $rowId = $tr.attr("id"); - if (ev.shiftKey && $previouslySelected !== undefined) { - if ($previouslySelected.attr("id") == $rowId) { - return; - } + if (!$tr.hasClass(SB_SELECTED_CLASS)) { + if (ev.shiftKey && $previouslySelected !== undefined) { + if ($previouslySelected.attr("id") == $rowId) { + return; + } - // If the selected row comes before the previously selected row, - // we want to select previous rows, otherwise we select next - if ($previouslySelected.prevAll("#"+$rowId).length !== 0) { - $previouslySelected.prevUntil($tr).each(function(i, el){ - $(el).addClass(SB_SELECTED_CLASS); - }); - } else { - $previouslySelected.nextUntil($tr).each(function(i, el){ - $(el).addClass(SB_SELECTED_CLASS); - }); + // If the selected row comes before the previously selected row, + // we want to select previous rows, otherwise we select next + if ($previouslySelected.prevAll("#" + $rowId).length !== 0) { + $previouslySelected.prevUntil($tr).each(function (i, el) { + $(el).addClass(SB_SELECTED_CLASS); + $(el).find(".sb-checkbox > input").prop('checked', true); + }); + } else { + $previouslySelected.nextUntil($tr).each(function (i, el) { + $(el).addClass(SB_SELECTED_CLASS); + $(el).find(".sb-checkbox > input").prop('checked', true); + }); + } } $tr.addClass(SB_SELECTED_CLASS); - } else if (ev.ctrlKey && $previouslySelected !== undefined) { - $tr.addClass(SB_SELECTED_CLASS); + $tr.find(".sb-checkbox > input").prop('checked', true); } else { - if (!$tr.hasClass(SB_SELECTED_CLASS)) { - $("."+SB_SELECTED_CLASS).removeClass(SB_SELECTED_CLASS); - } - $tr.addClass(SB_SELECTED_CLASS); + flagForDeselection = true; } // Remember this row so we can properly multiselect $previouslySelected = $tr; - - mod.checkToolBarIcons(); }); $sbTable.find("tbody").on("click", "tr:not(.sb-past, .sb-empty)", function(ev) { - if (!ev.ctrlKey && !ev.shiftKey) { - $("."+SB_SELECTED_CLASS).removeClass(SB_SELECTED_CLASS); - $(this).addClass(SB_SELECTED_CLASS); + if (flagForDeselection) { + flagForDeselection = false; + $(this).removeClass(SB_SELECTED_CLASS); + $(this).find(".sb-checkbox > input").prop('checked', false); + } else { + $(this).find(".sb-checkbox > input").prop('checked', true); } }); diff --git a/airtime_mvc/public/js/airtime/showbuilder/_main_builder.js b/airtime_mvc/public/js/airtime/showbuilder/_main_builder.js index 19c022966..65b4cf323 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/_main_builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/_main_builder.js @@ -146,13 +146,18 @@ AIRTIME = (function(AIRTIME) { mod.onReady = function() { // Normally we would just use audio/*, but it includes file types that we can't handle (like .m4a) // We initialize the acceptedMimeTypes variable in Bootstrap so we don't have to duplicate the list - Dropzone.options.uploadForm = { + Dropzone.options.content = { + url:'/rest/media', + clickable: false, acceptedFiles: acceptedMimeTypes.join(), init: function () { this.on("sending", function (file, xhr, data) { data.append("csrf_token", $("#csrf").val()); }); - } + }, + dictDefaultMessage: '', + createImageThumbnails: false, + previewTemplate : '
    ' }; // define module vars.