Merge branch 'CC-3174' into devel
This commit is contained in:
commit
3ab8c3d57b
|
@ -27,8 +27,8 @@
|
|||
|
||||
<div class="wrapper">
|
||||
<!--Set to z-index 254 to make it lower than the top-panel and the ZFDebug info bar, but higher than the side-playlist-->
|
||||
<div id="library_content" class="ui-widget ui-widget-content block-shadow alpha-block padded" style="z-index:254"><?php echo $this->layout()->library ?></div>
|
||||
<div id="side_playlist" class="ui-widget ui-widget-content block-shadow omega-block padded"><?php echo $this->layout()->spl ?></div>
|
||||
<div id="library_content" class="lib-content ui-widget ui-widget-content block-shadow alpha-block padded" style="z-index:254"><?php echo $this->layout()->library ?></div>
|
||||
<div id="side_playlist" class="pl-content ui-widget ui-widget-content block-shadow omega-block padded"><?php echo $this->layout()->spl ?></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,3 +1,17 @@
|
|||
.lib-content .fg-toolbar ul {
|
||||
float: left;
|
||||
padding: 0;
|
||||
margin: 0.5em 0 0 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.lib-content .fg-toolbar ul li {
|
||||
list-style-type: none;
|
||||
float: left;
|
||||
padding: 1px 2px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
#library_content {
|
||||
float: left;
|
||||
width: 50%;
|
||||
|
@ -32,12 +46,12 @@
|
|||
padding-top:16px;
|
||||
}
|
||||
|
||||
#library_display th.ui-state-default {
|
||||
border: 1px solid #8f8f8f;
|
||||
background-color: #a2a2a2;
|
||||
.lib-content table th.ui-state-default {
|
||||
background: -moz-linear-gradient(top, #b2b2b2 0, #a2a2a2 100%);
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #b2b2b2), color-stop(100%, #a2a2a2));
|
||||
color: #363636;
|
||||
background: linear-gradient(top, #b2b2b2 0, #a2a2a2 100%);
|
||||
border: 1px solid #8F8F8F;
|
||||
color: #363636;
|
||||
}
|
||||
|
||||
.paginationControl {
|
||||
|
|
|
@ -12,6 +12,20 @@
|
|||
margin-left: -16px;
|
||||
}
|
||||
|
||||
.sb-content .fg-toolbar ul {
|
||||
float: left;
|
||||
padding: 0;
|
||||
margin: 0.5em 0 0 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.sb-content .fg-toolbar ul li {
|
||||
list-style-type: none;
|
||||
float: left;
|
||||
padding: 1px 2px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.sb-padded {
|
||||
/*
|
||||
the padding is needed here so that the cursor arrows with a negative margin are displayable.
|
||||
|
@ -39,6 +53,10 @@
|
|||
top: 3px;
|
||||
}
|
||||
|
||||
.sb-content fieldset {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.sb-content fieldset.closed {
|
||||
border-width: 1px 0 0;
|
||||
margin-bottom: -16px;
|
||||
|
@ -89,6 +107,11 @@ tr.cursor-selected-row .marker {
|
|||
opacity: .6;
|
||||
}
|
||||
|
||||
.sb-placeholder {
|
||||
height: 35px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.sb-boundry td.sb-image,
|
||||
.sb-boundry td.sb-starts,
|
||||
.sb-boundry td.sb-ends,
|
||||
|
@ -204,8 +227,4 @@ table.datatable tr.sb-header.odd:hover td, table.datatable tr.sb-header.even:hov
|
|||
|
||||
.ui-dialog .sb_content .padded {
|
||||
padding: 5px 10px 5px 16px;
|
||||
}
|
||||
|
||||
.ui-dialog .ui-buttonset {
|
||||
margin-right: 0 !important;
|
||||
}
|
|
@ -637,10 +637,6 @@ dl.inline-list dd {
|
|||
background-color:#c7c7c7;
|
||||
}
|
||||
|
||||
.datatable .show-builder-placeholder {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.datatable tr.even.selected td {
|
||||
background-color: #abcfe2;
|
||||
}
|
||||
|
@ -698,15 +694,30 @@ dl.inline-list dd {
|
|||
line-height:22px;
|
||||
}
|
||||
.dataTables_filter {
|
||||
margin:0 0 0 8px;
|
||||
margin:0 0 8px 8px;
|
||||
}
|
||||
.dataTables_filter .auto-search {
|
||||
width:55%;
|
||||
}
|
||||
.dt-process-rel {
|
||||
position: relative;
|
||||
}
|
||||
.dataTables_processing {
|
||||
font-size:11px;
|
||||
font-weight:normal;
|
||||
margin:2px 0 3px 8px;
|
||||
opacity: 1 !important;
|
||||
position: absolute;
|
||||
top: 100px;
|
||||
left: 10%;
|
||||
width: 80%;
|
||||
height: 50px;
|
||||
text-align: center;
|
||||
font-size:14px;
|
||||
font-weight:bold;
|
||||
padding-top: 40px;
|
||||
background: -moz-linear-gradient(top, #b2b2b2 0, #a2a2a2 100%);
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #b2b2b2), color-stop(100%, #a2a2a2));
|
||||
background: linear-gradient(top, #b2b2b2 0, #a2a2a2 100%);
|
||||
border: 1px solid #8F8F8F;
|
||||
color: #ffffff;
|
||||
}
|
||||
#library_display_wrapper .ui-widget-header:first-child {
|
||||
background:none;
|
||||
|
@ -742,7 +753,7 @@ dl.inline-list dd {
|
|||
}
|
||||
.dataTables_filter input {
|
||||
background: url("images/search_auto_bg.png") no-repeat scroll 0 0 #DDDDDD;
|
||||
width: 55%;
|
||||
width: 50%;
|
||||
border: 1px solid #5B5B5B;
|
||||
margin-left: -8px;
|
||||
padding: 5px 3px 4px 25px;
|
||||
|
@ -765,7 +776,6 @@ dl.inline-list dd {
|
|||
#library_display thead th.library_title {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.ColVis.TableTools .ui-button {
|
||||
height: 21px;
|
||||
}
|
||||
|
@ -779,7 +789,7 @@ button.ColVis_Button.ColVis_ShowAll {
|
|||
font-size:12px;
|
||||
font-weight:normal;
|
||||
padding: 0.2em 1em;
|
||||
margin: 0.5em 0.2em -0.5em 0.2em;
|
||||
margin: 0.5em 7px -0.5em -2px;
|
||||
}
|
||||
|
||||
.library_length {
|
||||
|
|
|
@ -8,8 +8,18 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
mod = AIRTIME.button;
|
||||
|
||||
mod.isDisabled = function(c) {
|
||||
var button = $("."+c);
|
||||
|
||||
if (button.hasClass(DISABLED_CLASS)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
mod.enableButton = function(c) {
|
||||
var button = $("."+c).find("button");
|
||||
var button = $("."+c);
|
||||
|
||||
if (button.hasClass(DISABLED_CLASS)) {
|
||||
button.removeClass(DISABLED_CLASS);
|
||||
|
@ -17,7 +27,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
};
|
||||
|
||||
mod.disableButton = function(c) {
|
||||
var button = $("."+c).find("button");
|
||||
var button = $("."+c);
|
||||
|
||||
if (!button.hasClass(DISABLED_CLASS)) {
|
||||
button.addClass(DISABLED_CLASS);
|
||||
|
|
|
@ -19,10 +19,10 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
if (check === true) {
|
||||
AIRTIME.button.enableButton("library_group_add");
|
||||
AIRTIME.button.enableButton("lib-button-add");
|
||||
}
|
||||
else {
|
||||
AIRTIME.button.disableButton("library_group_add");
|
||||
AIRTIME.button.disableButton("lib-button-add");
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -76,43 +76,53 @@ var AIRTIME = (function(AIRTIME){
|
|||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* @param oTable the datatables instance for the library.
|
||||
*/
|
||||
mod.setupLibraryToolbar = function( oLibTable ) {
|
||||
var aButtons,
|
||||
fnAddSelectedItems;
|
||||
mod.setupLibraryToolbar = function() {
|
||||
var $toolbar = $(".lib-content .fg-toolbar:first");
|
||||
|
||||
fnAddSelectedItems = function() {
|
||||
var oLibTT = TableTools.fnGetInstance('library_display'),
|
||||
aData = oLibTT.fnGetSelectedData(),
|
||||
i,
|
||||
temp,
|
||||
length,
|
||||
aMediaIds = [];
|
||||
|
||||
//process selected files/playlists.
|
||||
for (i = 0, length = aData.length; i < length; i++) {
|
||||
temp = aData[i];
|
||||
if (temp.ftype === "audioclip") {
|
||||
aMediaIds.push(temp.id);
|
||||
$toolbar
|
||||
.append("<ul />")
|
||||
.find('ul')
|
||||
.append('<li class="ui-state-default ui-state-disabled lib-button-add" title="add selected items to playlist"><span class="ui-icon ui-icon-plusthick"></span></li>')
|
||||
.append('<li class="ui-state-default ui-state-disabled lib-button-delete" title="delete selected items"><span class="ui-icon ui-icon-trash"></span></li>');
|
||||
|
||||
//add to playlist button
|
||||
$toolbar.find('.lib-button-add')
|
||||
.click(function() {
|
||||
|
||||
if (AIRTIME.button.isDisabled('lib-button-add') === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
var oLibTT = TableTools.fnGetInstance('library_display'),
|
||||
aData = oLibTT.fnGetSelectedData(),
|
||||
i,
|
||||
temp,
|
||||
length,
|
||||
aMediaIds = [];
|
||||
|
||||
//process selected files/playlists.
|
||||
for (i = 0, length = aData.length; i < length; i++) {
|
||||
temp = aData[i];
|
||||
if (temp.ftype === "audioclip") {
|
||||
aMediaIds.push(temp.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AIRTIME.playlist.fnAddItems(aMediaIds, undefined, 'after');
|
||||
};
|
||||
|
||||
//[0] = button text
|
||||
//[1] = id
|
||||
//[2] = enabled
|
||||
//[3] = click event
|
||||
aButtons = [["Delete", "library_group_delete", false, AIRTIME.library.fnDeleteSelectedItems],
|
||||
["Add", "library_group_add", false, fnAddSelectedItems]];
|
||||
AIRTIME.playlist.fnAddItems(aMediaIds, undefined, 'after');
|
||||
});
|
||||
|
||||
addToolBarButtonsLibrary(aButtons);
|
||||
//delete from library.
|
||||
$toolbar.find('.lib-button-delete')
|
||||
.click(function() {
|
||||
|
||||
if (AIRTIME.button.isDisabled('lib-button-delete') === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
AIRTIME.library.fnDeleteSelectedItems();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
return AIRTIME;
|
||||
|
||||
}(AIRTIME || {}));
|
||||
|
|
|
@ -19,10 +19,10 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
if (check === true) {
|
||||
AIRTIME.button.enableButton("library_group_add");
|
||||
AIRTIME.button.enableButton("lib-button-add");
|
||||
}
|
||||
else {
|
||||
AIRTIME.button.disableButton("library_group_add");
|
||||
AIRTIME.button.disableButton("lib-button-add");
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -76,47 +76,61 @@ var AIRTIME = (function(AIRTIME){
|
|||
});
|
||||
};
|
||||
|
||||
mod.setupLibraryToolbar = function(oLibTable) {
|
||||
var aButtons,
|
||||
fnAddSelectedItems,
|
||||
mod.setupLibraryToolbar = function() {
|
||||
var $toolbar = $(".lib-content .fg-toolbar:first");
|
||||
|
||||
fnAddSelectedItems = function() {
|
||||
var oLibTT = TableTools.fnGetInstance('library_display'),
|
||||
aData = oLibTT.fnGetSelectedData(),
|
||||
i,
|
||||
length,
|
||||
temp,
|
||||
aMediaIds = [],
|
||||
aSchedIds = [];
|
||||
$toolbar
|
||||
.append("<ul />")
|
||||
.find('ul')
|
||||
.append('<li class="ui-state-default ui-state-disabled lib-button-add" title="add selected items to playlist"><span class="ui-icon ui-icon-plusthick"></span></li>')
|
||||
.append('<li class="ui-state-default ui-state-disabled lib-button-delete" title="delete selected items"><span class="ui-icon ui-icon-trash"></span></li>');
|
||||
|
||||
//add to timeline button
|
||||
$toolbar.find('.lib-button-add')
|
||||
.click(function() {
|
||||
|
||||
if (AIRTIME.button.isDisabled('lib-button-add') === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
var oLibTT = TableTools.fnGetInstance('library_display'),
|
||||
aData = oLibTT.fnGetSelectedData(),
|
||||
i,
|
||||
length,
|
||||
temp,
|
||||
aMediaIds = [],
|
||||
aSchedIds = [];
|
||||
|
||||
//process selected files/playlists.
|
||||
for (i = 0, length = aData.length; i < length; i++) {
|
||||
temp = aData[i];
|
||||
aMediaIds.push({"id": temp.id, "type": temp.ftype});
|
||||
}
|
||||
|
||||
aData = [];
|
||||
$("#show_builder_table tr.cursor-selected-row").each(function(i, el){
|
||||
aData.push($(el).data("aData"));
|
||||
});
|
||||
|
||||
//process selected files/playlists.
|
||||
for (i = 0, length = aData.length; i < length; i++) {
|
||||
temp = aData[i];
|
||||
aMediaIds.push({"id": temp.id, "type": temp.ftype});
|
||||
}
|
||||
|
||||
aData = [];
|
||||
$("#show_builder_table tr.cursor-selected-row").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});
|
||||
}
|
||||
|
||||
AIRTIME.showbuilder.fnAdd(aMediaIds, aSchedIds);
|
||||
});
|
||||
|
||||
//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});
|
||||
}
|
||||
|
||||
AIRTIME.showbuilder.fnAdd(aMediaIds, aSchedIds);
|
||||
};
|
||||
|
||||
//[0] = button text
|
||||
//[1] = id
|
||||
//[2] = enabled
|
||||
//[3] = click event
|
||||
aButtons = [["Delete", "library_group_delete", false, AIRTIME.library.fnDeleteSelectedItems],
|
||||
["Add", "library_group_add", false, fnAddSelectedItems]];
|
||||
|
||||
addToolBarButtonsLibrary(aButtons);
|
||||
//delete from library.
|
||||
$toolbar.find('.lib-button-delete')
|
||||
.click(function() {
|
||||
|
||||
if (AIRTIME.button.isDisabled('lib-button-delete') === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
AIRTIME.library.fnDeleteSelectedItems();
|
||||
});
|
||||
};
|
||||
|
||||
return AIRTIME;
|
||||
|
|
|
@ -43,8 +43,11 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
libraryInit = function() {
|
||||
var oTable,
|
||||
libContentDiv = $("#library_content");
|
||||
tableHeight = libContentDiv.height() - 140;
|
||||
libContentDiv = $("#library_content"),
|
||||
tableHeight = libContentDiv.height() - 130,
|
||||
libLength,
|
||||
libType,
|
||||
libFilter;
|
||||
|
||||
oTable = $('#library_display').dataTable( {
|
||||
|
||||
|
@ -247,7 +250,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
},
|
||||
|
||||
// R = ColReorder, C = ColVis, T = TableTools
|
||||
"sDom": 'Rl<"#library_display_type">fr<"H"T<"library_toolbar"C>><"dataTables_scrolling"t><"F"ip>',
|
||||
"sDom": 'Rl<"#library_display_type">f<"dt-process-rel"r><"H"T<"library_toolbar"C>><"dataTables_scrolling"t><"F"ip>',
|
||||
|
||||
"oTableTools": {
|
||||
"sRowSelect": "multi",
|
||||
|
@ -266,7 +269,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
}
|
||||
|
||||
//checking to enable buttons
|
||||
AIRTIME.button.enableButton("library_group_delete");
|
||||
AIRTIME.button.enableButton("lib-button-delete");
|
||||
AIRTIME.library.events.enableAddButtonCheck();
|
||||
},
|
||||
"fnRowDeselected": function ( node ) {
|
||||
|
@ -284,14 +287,13 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
//checking to disable buttons
|
||||
if (selected.length === 0) {
|
||||
AIRTIME.button.disableButton("library_group_delete");
|
||||
AIRTIME.button.disableButton("lib-button-delete");
|
||||
}
|
||||
AIRTIME.library.events.enableAddButtonCheck();
|
||||
}
|
||||
},
|
||||
|
||||
"oColVis": {
|
||||
"buttonText": "Show/Hide Columns",
|
||||
"sAlign": "right",
|
||||
"aiExclude": [0, 1, 2],
|
||||
"sSize": "css"
|
||||
|
@ -331,6 +333,12 @@ var AIRTIME = (function(AIRTIME) {
|
|||
}
|
||||
});
|
||||
|
||||
//calculate dynamically width for the library search input.
|
||||
//libLength = libContentDiv.find("#library_display_length");
|
||||
//libType = libContentDiv.find("#library_display_type");
|
||||
//libFilter = libContentDiv.find("#library_display_filter");
|
||||
//libFilter.find("input").width(libFilter.width() - libType.width() - libLength.width() - 80);
|
||||
|
||||
checkImportStatus();
|
||||
setInterval( checkImportStatus, 5000 );
|
||||
setInterval( checkSCUploadStatus, 5000 );
|
||||
|
@ -488,48 +496,6 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
}(AIRTIME || {}));
|
||||
|
||||
function addToolBarButtonsLibrary(aButtons) {
|
||||
var i,
|
||||
length = aButtons.length,
|
||||
libToolBar = $(".library_toolbar"),
|
||||
html,
|
||||
buttonClass = '',
|
||||
DEFAULT_CLASS = 'ui-button ui-state-default',
|
||||
DISABLED_CLASS = 'ui-state-disabled',
|
||||
fn;
|
||||
|
||||
for ( i = 0; i < length; i += 1 ) {
|
||||
buttonClass = '';
|
||||
|
||||
//add disabled class if not enabled.
|
||||
if (aButtons[i][2] === false) {
|
||||
buttonClass += DISABLED_CLASS;
|
||||
}
|
||||
|
||||
html = '<div class="ColVis TableTools '+aButtons[i][1]+'"><button class="'+DEFAULT_CLASS+' '+buttonClass+'"><span>'+aButtons[i][0]+'</span></button></div>';
|
||||
libToolBar.append(html);
|
||||
|
||||
//create a closure to preserve the state of i.
|
||||
(function(index){
|
||||
|
||||
libToolBar.find("."+aButtons[index][1]).click(function(){
|
||||
fn = function() {
|
||||
var $button = $(this).find("button");
|
||||
|
||||
//only call the passed function if the button is enabled.
|
||||
if (!$button.hasClass(DISABLED_CLASS)) {
|
||||
aButtons[index][3]();
|
||||
}
|
||||
};
|
||||
|
||||
fn.call(this);
|
||||
});
|
||||
|
||||
}(i));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function checkImportStatus(){
|
||||
$.getJSON('/Preference/is-import-in-progress', function(data){
|
||||
var div = $('#import_status');
|
||||
|
|
|
@ -106,10 +106,7 @@ function buildScheduleDialog (json) {
|
|||
//subtract padding in pixels
|
||||
widgetWidth = width - 60,
|
||||
libWidth = Math.floor(widgetWidth * 0.5),
|
||||
builderWidth = Math.floor(widgetWidth * 0.5),
|
||||
libLength,
|
||||
libType,
|
||||
libFilter;
|
||||
builderWidth = Math.floor(widgetWidth * 0.5);
|
||||
|
||||
dialog.find("#library_content")
|
||||
.height(height - 115)
|
||||
|
@ -143,19 +140,12 @@ function buildScheduleDialog (json) {
|
|||
|
||||
//set max heights of datatables.
|
||||
dialog.find(".lib-content .dataTables_scrolling")
|
||||
.css("max-height", height - 110 - 155);
|
||||
.css("max-height", height - 90 - 155);
|
||||
|
||||
dialog.find(".sb-content .dataTables_scrolling")
|
||||
.css("max-height", height - 110 - 60);
|
||||
.css("max-height", height - 90 - 60);
|
||||
|
||||
dialog.dialog('open');
|
||||
|
||||
//calculate dynamically width for the library search input.
|
||||
libLength = dialog.find("#library_display_length");
|
||||
libType = dialog.find("#library_display_type");
|
||||
libFilter = dialog.find("#library_display_filter");
|
||||
|
||||
libFilter.find("input").width(libFilter.width() - libType.width() - libLength.width() - 80);
|
||||
}
|
||||
|
||||
function buildContentDialog (json){
|
||||
|
|
|
@ -105,10 +105,12 @@ var AIRTIME = (function(AIRTIME){
|
|||
mod.fnServerData = fnServerData;
|
||||
|
||||
mod.builderDataTable = function() {
|
||||
var tableDiv = $('#show_builder_table'),
|
||||
var $sbContent = $('#show_builder'),
|
||||
$sbTable = $sbContent.find('table'),
|
||||
oTable,
|
||||
fnRemoveSelectedItems,
|
||||
tableHeight;
|
||||
tableHeight,
|
||||
$toolbar;
|
||||
|
||||
fnRemoveSelectedItems = function() {
|
||||
var oTT = TableTools.fnGetInstance('show_builder_table'),
|
||||
|
@ -126,7 +128,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
AIRTIME.showbuilder.fnRemove(aItems);
|
||||
};
|
||||
|
||||
oTable = tableDiv.dataTable( {
|
||||
oTable = $sbTable.dataTable( {
|
||||
"aoColumns": [
|
||||
/* checkbox */ {"mDataProp": "allowed", "sTitle": "<input type='checkbox' name='sb_cb_all'>", "sWidth": "15px", "sClass": "sb-checkbox"},
|
||||
/* Type */ {"mDataProp": "image", "sTitle": "", "sClass": "library_image sb-image", "sWidth": "25px", "bVisible": true},
|
||||
|
@ -235,6 +237,9 @@ var AIRTIME = (function(AIRTIME){
|
|||
else if (aData.scheduled === 0) {
|
||||
$(nRow).addClass("sb-past");
|
||||
}
|
||||
else {
|
||||
$(nRow).addClass("sb-future");
|
||||
}
|
||||
|
||||
if (aData.allowed !== true) {
|
||||
$(nRow).addClass("sb-not-allowed");
|
||||
|
@ -362,7 +367,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
if ($lib.length > 0 && $lib.filter(":visible").length > 0) {
|
||||
|
||||
//create cursor arrows.
|
||||
tableDiv.find("tr.sb-now-playing, tr:not(:first, .sb-footer, .sb-empty, .sb-not-allowed)").each(function(i, el) {
|
||||
$sbTable.find("tr.sb-now-playing, tr:not(:first, .sb-footer, .sb-empty, .sb-not-allowed)").each(function(i, el) {
|
||||
td = $(el).find("td:first");
|
||||
if (td.hasClass("dataTables_empty")) {
|
||||
return false;
|
||||
|
@ -383,19 +388,25 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
//if the now playing song is visible set a timeout to redraw the table at the start of the next song.
|
||||
tr = tableDiv.find("tr.sb-now-playing");
|
||||
tr = $sbTable.find("tr.sb-now-playing");
|
||||
|
||||
if (tr.length > 0) {
|
||||
//enable jump to current button.
|
||||
AIRTIME.button.enableButton("sb-button-current");
|
||||
|
||||
aData = tr.data("aData");
|
||||
|
||||
setTimeout(function(){
|
||||
AIRTIME.showbuilder.resetTimestamp();
|
||||
oTable.fnDraw();
|
||||
}, aData.refresh * 1000); //need refresh in milliseconds
|
||||
|
||||
//scroll now playing item to top.
|
||||
$sbContent.find(".sb-button-current").click();
|
||||
}
|
||||
//current song is not set, set a timeout to refresh when the first item on the timeline starts.
|
||||
else {
|
||||
tr = tableDiv.find("tbody tr.sb-allowed.sb-header:first");
|
||||
tr = $sbTable.find("tbody tr.sb-allowed.sb-header:first");
|
||||
|
||||
if (tr.length > 0) {
|
||||
aData = tr.data("aData");
|
||||
|
@ -406,6 +417,14 @@ var AIRTIME = (function(AIRTIME){
|
|||
}, aData.timeUntil * 1000); //need refresh in milliseconds
|
||||
}
|
||||
}
|
||||
|
||||
//check if there are any overbooked tracks on screen to enable the trim button.
|
||||
tr = $sbTable.find("tr.sb-over");
|
||||
|
||||
if (tr.length > 0) {
|
||||
//enable deleting of overbooked tracks.
|
||||
AIRTIME.button.enableButton("sb-button-trim");
|
||||
}
|
||||
},
|
||||
"fnHeaderCallback": function(nHead) {
|
||||
$(nHead).find("input[type=checkbox]").attr("checked", false);
|
||||
|
@ -416,6 +435,11 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
oTT = TableTools.fnGetInstance('show_builder_table');
|
||||
oTT.fnSelectNone();
|
||||
|
||||
//disable jump to current button.
|
||||
AIRTIME.button.disableButton("sb-button-current");
|
||||
//disable deleting of overbooked tracks.
|
||||
AIRTIME.button.disableButton("sb-button-trim");
|
||||
},
|
||||
|
||||
"oColVis": {
|
||||
|
@ -451,30 +475,30 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
//checking to enable buttons
|
||||
AIRTIME.button.enableButton("sb_delete");
|
||||
AIRTIME.button.enableButton("sb-button-delete");
|
||||
},
|
||||
"fnRowDeselected": function ( node ) {
|
||||
var selected;
|
||||
|
||||
//seems to happen if everything is deselected
|
||||
if ( node === null) {
|
||||
tableDiv.find("input[type=checkbox]").attr("checked", false);
|
||||
$sbTable.find("input[type=checkbox]").attr("checked", false);
|
||||
selected = [];
|
||||
}
|
||||
else {
|
||||
$(node).find("input[type=checkbox]").attr("checked", false);
|
||||
selected = tableDiv.find("input[type=checkbox]").filter(":checked");
|
||||
selected = $sbTable.find("input[type=checkbox]").filter(":checked");
|
||||
}
|
||||
|
||||
//checking to disable buttons
|
||||
if (selected.length === 0) {
|
||||
AIRTIME.button.disableButton("sb_delete");
|
||||
AIRTIME.button.disableButton("sb-button-delete");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// R = ColReorderResize, C = ColVis, T = TableTools
|
||||
"sDom": 'Rr<"sb-padded"<"H"CT>><"dataTables_scrolling sb-padded"t>',
|
||||
"sDom": 'R<"dt-process-rel"r><"sb-padded"<"H"CT>><"dataTables_scrolling sb-padded"t>',
|
||||
|
||||
"sAjaxDataProp": "schedule",
|
||||
"sAjaxSource": "/showbuilder/builder-feed"
|
||||
|
@ -572,7 +596,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
//item was dragged in
|
||||
if (origTrs !== undefined) {
|
||||
|
||||
tableDiv.find("tr.ui-draggable")
|
||||
$sbTable.find("tr.ui-draggable")
|
||||
.empty()
|
||||
.after(html);
|
||||
|
||||
|
@ -593,12 +617,13 @@ var AIRTIME = (function(AIRTIME){
|
|||
};
|
||||
|
||||
return {
|
||||
placeholder: "placeholder show-builder-placeholder ui-state-highlight",
|
||||
placeholder: "sb-placeholder ui-state-highlight",
|
||||
forcePlaceholderSize: true,
|
||||
distance: 10,
|
||||
helper: function(event, item) {
|
||||
var oTT = TableTools.fnGetInstance('show_builder_table'),
|
||||
selected = oTT.fnGetSelectedData(),
|
||||
elements = tableDiv.find('tr:not(:first) input:checked').parents('tr'),
|
||||
elements = $sbTable.find('tr:not(:first) input:checked').parents('tr'),
|
||||
thead = $("#show_builder_table thead"),
|
||||
colspan = thead.find("th").length,
|
||||
trfirst = thead.find("tr:first"),
|
||||
|
@ -639,24 +664,78 @@ var AIRTIME = (function(AIRTIME){
|
|||
receive: fnReceive,
|
||||
update: fnUpdate,
|
||||
start: function(event, ui) {
|
||||
var elements = tableDiv.find('tr:not(:first) input:checked').parents('tr');
|
||||
var elements = $sbTable.find('tr:not(:first) input:checked').parents('tr');
|
||||
|
||||
elements.hide();
|
||||
}
|
||||
};
|
||||
}());
|
||||
|
||||
tableDiv.sortable(sortableConf);
|
||||
$sbTable.sortable(sortableConf);
|
||||
|
||||
$("#show_builder .fg-toolbar")
|
||||
.append('<div class="ColVis TableTools sb_delete"><button class="ui-button ui-state-default ui-state-disabled"><span>Delete</span></button></div>')
|
||||
.click(fnRemoveSelectedItems);
|
||||
//start setup of the builder toolbar.
|
||||
$toolbar = $(".sb-content .fg-toolbar");
|
||||
|
||||
$toolbar
|
||||
.append("<ul />")
|
||||
.find('ul')
|
||||
.append('<li class="ui-state-default ui-state-disabled sb-button-current" title="jump to current item"><span class="ui-icon ui-icon-arrowstop-1-s"></span></li>')
|
||||
.append('<li class="ui-state-default ui-state-disabled sb-button-trim" title="delete all overbooked tracks"><span class="ui-icon ui-icon-scissors"></span></li>')
|
||||
.append('<li class="ui-state-default ui-state-disabled sb-button-delete" title="delete selected items"><span class="ui-icon ui-icon-trash"></span></li>');
|
||||
|
||||
//jump to current
|
||||
$toolbar.find('.sb-button-current')
|
||||
.click(function() {
|
||||
|
||||
if (AIRTIME.button.isDisabled('sb-button-current') === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $scroll = $sbContent.find(".dataTables_scrolling"),
|
||||
scrolled = $scroll.scrollTop(),
|
||||
scrollingTop = $scroll.offset().top,
|
||||
current = $sbTable.find(".sb-now-playing"),
|
||||
currentTop = current.offset().top;
|
||||
|
||||
$scroll.scrollTop(currentTop - scrollingTop + scrolled);
|
||||
});
|
||||
|
||||
//delete overbooked tracks.
|
||||
$toolbar.find('.sb-button-trim')
|
||||
.click(function() {
|
||||
|
||||
if (AIRTIME.button.isDisabled('sb-button-trim') === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
var temp,
|
||||
aItems = [],
|
||||
trs = $sbTable.find(".sb-over.sb-future");
|
||||
|
||||
trs.each(function(){
|
||||
temp = $(this).data("aData");
|
||||
aItems.push({"id": temp.id, "instance": temp.instance, "timestamp": temp.timestamp});
|
||||
});
|
||||
|
||||
AIRTIME.showbuilder.fnRemove(aItems);
|
||||
});
|
||||
|
||||
//delete selected tracks
|
||||
$toolbar.find('.sb-button-delete')
|
||||
.click(function() {
|
||||
|
||||
if (AIRTIME.button.isDisabled('sb-button-delete') === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
fnRemoveSelectedItems();
|
||||
});
|
||||
|
||||
//set things like a reference to the table.
|
||||
AIRTIME.showbuilder.init(oTable);
|
||||
|
||||
//add event to cursors.
|
||||
tableDiv.find("tbody").on("click", "div.marker", function(event){
|
||||
$sbTable.find("tbody").on("click", "div.marker", function(event){
|
||||
var tr = $(this).parents("tr"),
|
||||
cursorSelClass = "cursor-selected-row";
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ $(document).ready(function(){
|
|||
$lib = $("#library_content"),
|
||||
$libWrapper,
|
||||
$builder = $("#show_builder"),
|
||||
widgetHeight = viewport.height - 185,
|
||||
widgetHeight = viewport.height - 180,
|
||||
screenWidth = Math.floor(viewport.width - 120),
|
||||
oBaseDatePickerSettings,
|
||||
oBaseTimePickerSettings,
|
||||
|
@ -62,7 +62,7 @@ $(document).ready(function(){
|
|||
$libWrapper = $lib.find("#library_display_wrapper");
|
||||
$libWrapper.prepend($libClose);
|
||||
|
||||
$builder.find('.dataTables_scrolling').css("max-height", widgetHeight - 110);
|
||||
$builder.find('.dataTables_scrolling').css("max-height", widgetHeight - 95);
|
||||
|
||||
$builder.on("click", "#sb_submit", function(ev){
|
||||
var fn,
|
||||
|
|
Loading…
Reference in New Issue