Showbuilder checkboxes and style fixes
This commit is contained in:
parent
83902ebbbe
commit
cc36fcd37b
21 changed files with 445 additions and 313 deletions
|
@ -82,8 +82,8 @@ function openAudioPreview(p_event) {
|
|||
p_event.stopPropagation();
|
||||
|
||||
var audioFileID = $(this).attr('audioFile');
|
||||
var objId = $('#obj_id:first').attr('value');
|
||||
var objType = $('#obj_type:first').attr('value');
|
||||
var objId = $('.obj_id:first').attr('value');
|
||||
var objType = $('.obj_type:first').attr('value');
|
||||
var playIndex = $(this).parent().parent().attr('id');
|
||||
playIndex = playIndex.substring(4); //remove the spl_
|
||||
|
||||
|
@ -169,19 +169,18 @@ function getUsabilityHint() {
|
|||
var current_hint = $hint_div.html();
|
||||
if (json === "") {
|
||||
// there are no more hints to display to the user
|
||||
$hint_div.hide();
|
||||
$hint_div.hide("slow").addClass("hidden");
|
||||
} else if (current_hint !== json) {
|
||||
// we only change the message if it is new
|
||||
if ($hint_div.is(":visible")) {
|
||||
$hint_div.hide();
|
||||
$hint_div.hide("slow").addClass("hidden");
|
||||
}
|
||||
$hint_div.html(json);
|
||||
$hint_div.show("slow");
|
||||
|
||||
$hint_div.show("slow").removeClass("hidden");
|
||||
} else {
|
||||
// hint is the same before we hid it so we just need to show it
|
||||
if ($hint_div.is(":hidden")) {
|
||||
$hint_div.show();
|
||||
$hint_div.show("slow").removeClass("hidden");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -7,7 +7,8 @@ var AIRTIME = (function(AIRTIME) {
|
|||
LIB_SELECTED_CLASS = "lib-selected",
|
||||
chosenItems = {},
|
||||
visibleChosenItems = {},
|
||||
$previouslySelected;
|
||||
$previouslySelected,
|
||||
flagForDeselection = false;
|
||||
|
||||
|
||||
// we need to know whether the criteria value is string or
|
||||
|
@ -253,6 +254,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
if ($el.length !== 0) {
|
||||
mod.highlightItem($el);
|
||||
mod.checkItem($el);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -279,6 +281,14 @@ var AIRTIME = (function(AIRTIME) {
|
|||
}
|
||||
};
|
||||
|
||||
mod.checkItem = function($el) {
|
||||
$el.find(".library_checkbox > input").prop('checked', true);
|
||||
};
|
||||
|
||||
mod.uncheckItem = function($el) {
|
||||
$el.find(".library_checkbox > input").prop('checked', false);
|
||||
};
|
||||
|
||||
mod.highlightItem = function($el) {
|
||||
$el.addClass(LIB_SELECTED_CLASS);
|
||||
};
|
||||
|
@ -310,11 +320,10 @@ var AIRTIME = (function(AIRTIME) {
|
|||
mod.selectCurrentPage = function() {
|
||||
$.fn.reverse = [].reverse;
|
||||
var $trs = $libTable.find("tbody").find("tr").reverse();
|
||||
$trs.addClass(LIB_SELECTED_CLASS);
|
||||
|
||||
$trs.each(function(i, el){
|
||||
$el = $(this);
|
||||
mod.addToChosen($el);
|
||||
mod.selectItem($(el));
|
||||
mod.checkItem($(el));
|
||||
});
|
||||
|
||||
mod.checkToolBarIcons();
|
||||
|
@ -326,13 +335,11 @@ var AIRTIME = (function(AIRTIME) {
|
|||
* from gmail)
|
||||
*/
|
||||
mod.deselectCurrentPage = function() {
|
||||
var $trs = $libTable.find("tr"), id;
|
||||
$trs.removeClass(LIB_SELECTED_CLASS);
|
||||
var $trs = $libTable.find("tr");
|
||||
|
||||
$trs.each(function(i, el){
|
||||
$el = $(this);
|
||||
id = $el.attr("id");
|
||||
delete chosenItems[id];
|
||||
mod.deselectItem($(el));
|
||||
mod.uncheckItem($(el));
|
||||
});
|
||||
|
||||
mod.checkToolBarIcons();
|
||||
|
@ -340,7 +347,10 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
mod.selectNone = function() {
|
||||
var $trs = $libTable.find("tr");
|
||||
$trs.removeClass(LIB_SELECTED_CLASS);
|
||||
$trs.each(function(i, el){
|
||||
mod.deselectItem($(el));
|
||||
mod.uncheckItem($(el));
|
||||
});
|
||||
$previouslySelected = undefined;
|
||||
|
||||
chosenItems = {};
|
||||
|
@ -349,9 +359,20 @@ var AIRTIME = (function(AIRTIME) {
|
|||
};
|
||||
|
||||
mod.fnDeleteItems = function(aMedia) {
|
||||
|
||||
//Prevent the user from spamming the delete button while the AJAX request is in progress
|
||||
AIRTIME.button.disableButton("btn-group #sb-trash", false);
|
||||
var openTabObjectIds = $(".obj_id"),
|
||||
mediaIds = [];
|
||||
for (var i in aMedia) {
|
||||
mediaIds.push(aMedia[i].id);
|
||||
}
|
||||
openTabObjectIds.each(function(i, el) {
|
||||
var v = $(el).val();
|
||||
if ($.inArray(v, mediaIds)) {
|
||||
AIRTIME.playlist.fnOpenPlaylist({id: v});
|
||||
AIRTIME.playlist.closeTab();
|
||||
}
|
||||
});
|
||||
|
||||
$.post(baseUrl+"library/delete",
|
||||
{"format": "json", "media": aMedia},
|
||||
|
@ -374,8 +395,8 @@ var AIRTIME = (function(AIRTIME) {
|
|||
item,
|
||||
temp,
|
||||
aMedia = [],
|
||||
currentObjId = $("#side_playlist").find("#obj_id").val(),
|
||||
currentObjType = $("#side_playlist").find("#obj_type").val(),
|
||||
currentObjId = $(".side_playlist.active-tab").find(".obj_id").val(),
|
||||
currentObjType = $(".side_playlist.active-tab").find(".obj_type").val(),
|
||||
closeObj = false;
|
||||
|
||||
// process selected files/playlists.
|
||||
|
@ -763,35 +784,6 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
AIRTIME.library.setupLibraryToolbar(oTable);
|
||||
|
||||
$libTable.find("tbody").on("click", ".library_checkbox", function(ev) {
|
||||
var $cb = $(this),
|
||||
$tr = $cb.parents("tr"),
|
||||
// Get the ID of the selected row
|
||||
$rowId = $tr.attr("id");
|
||||
|
||||
if (!$tr.hasClass(LIB_SELECTED_CLASS)) {
|
||||
if (ev.shiftKey && $previouslySelected !== undefined) {
|
||||
// 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) {
|
||||
mod.selectItem($(el));
|
||||
});
|
||||
} else {
|
||||
$previouslySelected.nextUntil($tr).each(function(i, el) {
|
||||
mod.selectItem($(el));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
mod.selectItem($tr);
|
||||
// Remember this row so we can properly multiselect
|
||||
$previouslySelected = $tr;
|
||||
} else {
|
||||
mod.deselectItem($tr);
|
||||
}
|
||||
});
|
||||
|
||||
$libTable.find("tbody").on("dblclick", "tr", function(ev) {
|
||||
var data = $(this).data("aData");
|
||||
AIRTIME.library.dblClickAdd(data, data.ftype);
|
||||
|
@ -802,33 +794,28 @@ var AIRTIME = (function(AIRTIME) {
|
|||
// 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(LIB_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){
|
||||
mod.selectItem($(el));
|
||||
});
|
||||
} else {
|
||||
$previouslySelected.nextUntil($tr).each(function(i, el){
|
||||
mod.selectItem($(el));
|
||||
});
|
||||
// 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) {
|
||||
mod.selectItem($(el));
|
||||
});
|
||||
} else {
|
||||
$previouslySelected.nextUntil($tr).each(function (i, el) {
|
||||
mod.selectItem($(el));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
mod.selectItem($tr);
|
||||
} else if (ev.ctrlKey) {
|
||||
mod.selectItem($tr);
|
||||
mod.checkItem($tr);
|
||||
} else {
|
||||
if (!$tr.hasClass(LIB_SELECTED_CLASS)) {
|
||||
$("." + LIB_SELECTED_CLASS).each(function (i, el) {
|
||||
mod.deselectItem($(el))
|
||||
});
|
||||
}
|
||||
mod.selectItem($tr);
|
||||
flagForDeselection = true;
|
||||
}
|
||||
|
||||
// Remember this row so we can properly multiselect
|
||||
|
@ -836,11 +823,14 @@ var AIRTIME = (function(AIRTIME) {
|
|||
});
|
||||
|
||||
$libTable.find("tbody").on("click", "tr", function(ev) {
|
||||
if (!ev.ctrlKey && !ev.shiftKey) {
|
||||
$("." + LIB_SELECTED_CLASS).each(function (i, el) {
|
||||
mod.deselectItem($(el))
|
||||
});
|
||||
mod.selectItem($(this));
|
||||
//ev.preventDefault();
|
||||
|
||||
if (flagForDeselection) {
|
||||
flagForDeselection = false;
|
||||
mod.deselectItem($(this));
|
||||
mod.uncheckItem($(this));
|
||||
} else {
|
||||
mod.checkItem($(this));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -872,23 +862,20 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
// define an edit callback.
|
||||
if (oItems.edit !== undefined) {
|
||||
|
||||
if (data.ftype === "audioclip") {
|
||||
callback = function() {
|
||||
$.get(oItems.edit.url, {format: "json"}, function(json){
|
||||
buildEditMetadataDialog(json);
|
||||
AIRTIME.playlist.fileMdEdit(json);
|
||||
});
|
||||
};
|
||||
} else if (data.ftype === "playlist" || data.ftype === "block") {
|
||||
callback = function() {
|
||||
var url = baseUrl+'Playlist/edit';
|
||||
AIRTIME.playlist.fnEdit(data.id, data.ftype, url);
|
||||
AIRTIME.playlist.fnEdit(data.id, data.ftype, baseUrl+'new-playlist/edit');
|
||||
AIRTIME.playlist.validatePlaylistElements();
|
||||
};
|
||||
} else if (data.ftype === "stream") {
|
||||
callback = function() {
|
||||
var url = baseUrl+'Webstream/edit';
|
||||
AIRTIME.playlist.fnEdit(data.id, data.ftype, url);
|
||||
AIRTIME.playlist.fnEdit(data.id, data.ftype, baseUrl + 'new-webstream/edit');
|
||||
}
|
||||
} else {
|
||||
throw new Exception($.i18n._("Unknown type: ") + data.ftype);
|
||||
|
|
|
@ -75,7 +75,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
li = span.parents("li"),
|
||||
unqid = li.attr("unqid"),
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
type = $pl.find('.obj_type').val();
|
||||
|
||||
if (!isTimeValid(cueIn)){
|
||||
showError(span, $.i18n._("please put in a time '00:00:00 (.0)'"));
|
||||
|
@ -96,7 +96,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
setPlaylistContent(json);
|
||||
|
||||
li = $('#side_playlist li[unqid='+unqid+']');
|
||||
li = $('.side_playlist.active-tab li[unqid='+unqid+']');
|
||||
li.find(".cue-edit").toggle();
|
||||
highlightActive(li);
|
||||
highlightActive(li.find('.spl_cue'));
|
||||
|
@ -112,7 +112,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
li = span.parents("li"),
|
||||
unqid = li.attr("unqid"),
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
type = $pl.find('.obj_type').val();
|
||||
|
||||
if (!isTimeValid(cueOut)){
|
||||
showError(span, $.i18n._("please put in a time '00:00:00 (.0)'"));
|
||||
|
@ -134,7 +134,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
setPlaylistContent(json);
|
||||
|
||||
li = $('#side_playlist li[unqid='+unqid+']');
|
||||
li = $('.side_playlist.active-tab li[unqid='+unqid+']');
|
||||
li.find(".cue-edit").toggle();
|
||||
highlightActive(li);
|
||||
highlightActive(li.find('.spl_cue'));
|
||||
|
@ -146,7 +146,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
var url = baseUrl+"new-playlist/set-cue",
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val(),
|
||||
type = $pl.find('.obj_type').val(),
|
||||
li,
|
||||
span;
|
||||
|
||||
|
@ -179,7 +179,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
if (json.cue_error !== undefined) {
|
||||
|
||||
li = $('#side_playlist li[unqid='+id+']');
|
||||
li = $('.side_playlist.active-tab li[unqid='+id+']');
|
||||
|
||||
if (json.code === 0) {
|
||||
|
||||
|
@ -204,7 +204,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
setPlaylistContent(json);
|
||||
|
||||
li = $('#side_playlist li[unqid='+id+']');
|
||||
li = $('.side_playlist.active-tab li[unqid='+id+']');
|
||||
li.find(".cue-edit").toggle();
|
||||
highlightActive(li);
|
||||
highlightActive(li.find('.spl_cue'));
|
||||
|
@ -216,7 +216,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
var url = baseUrl+"new-playlist/set-crossfade",
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
type = $pl.find('.obj_type').val();
|
||||
|
||||
$.post(url,
|
||||
{format: "json", fadeIn: fadeIn, fadeOut: fadeOut, id1: id1, id2: id2, offset: offset, modified: lastMod, type: type},
|
||||
|
@ -248,7 +248,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
li = span.parents("li"),
|
||||
unqid = li.attr("unqid"),
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
type = $pl.find('.obj_type').val();
|
||||
|
||||
if (!isFadeValid(fadeIn)){
|
||||
showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
|
||||
|
@ -286,7 +286,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
li = span.parents("li"),
|
||||
unqid = li.attr("unqid"),
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
type = $pl.find('.obj_type').val();
|
||||
|
||||
if (!isFadeValid(fadeOut)){
|
||||
showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
|
||||
|
@ -386,8 +386,8 @@ var AIRTIME = (function(AIRTIME){
|
|||
.empty()
|
||||
.val(json.description);
|
||||
|
||||
$('#spl_sortable').off('focusout keydown');
|
||||
$('#spl_sortable')
|
||||
$pl.find('.spl_sortable').off('focusout keydown');
|
||||
$pl.find('.spl_sortable')
|
||||
.empty()
|
||||
.append($html);
|
||||
setCueEvents();
|
||||
|
@ -398,7 +398,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
function setFadeIcon(){
|
||||
var contents = $pl.find("#spl_sortable");
|
||||
var contents = $pl.find(".spl_sortable");
|
||||
var show = contents.is(":visible");
|
||||
var empty = $pl.find(".spl_empty");
|
||||
|
||||
|
@ -421,29 +421,29 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
function getId() {
|
||||
return parseInt($pl.find("#obj_id").val(), 10);
|
||||
return parseInt($pl.find(".obj_id").val(), 10);
|
||||
}
|
||||
|
||||
function getModified() {
|
||||
return parseInt($pl.find("#obj_lastMod").val(), 10);
|
||||
return parseInt($pl.find(".obj_lastMod").val(), 10);
|
||||
}
|
||||
|
||||
function setModified(modified) {
|
||||
$pl.find("#obj_lastMod").val(modified);
|
||||
$pl.find(".obj_lastMod").val(modified);
|
||||
}
|
||||
|
||||
/*
|
||||
* Should all be moved to builder.js eventually
|
||||
*/
|
||||
function openFileMdEditor(json) {
|
||||
$tabCount++;
|
||||
var tabId = $openTabs[json.id];
|
||||
if ($openTabs[json.id] !== undefined) {
|
||||
AIRTIME.showbuilder.switchTab($(".pl-tab-content-" + tabId), $("#pl-tab-" + tabId));
|
||||
return;
|
||||
}
|
||||
$tabCount++;
|
||||
|
||||
var wrapper = "<div id='side_playlist' class='pl-content pl-tab-content-" + $tabCount + "'><div class='editor_pane_wrapper'></div></div>",
|
||||
var wrapper = "<div class='side_playlist pl-content pl-tab-content-" + $tabCount + "'><div class='editor_pane_wrapper'></div></div>",
|
||||
t = $("#show_builder").append(wrapper).find(".pl-tab-content-" + $tabCount),
|
||||
pane = $(".editor_pane_wrapper:last"),
|
||||
name = pane.append(json.dialog).find("#track_title").val() + $.i18n._(" - Metadata Editor"),
|
||||
|
@ -468,15 +468,14 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
function openPlaylist(json) {
|
||||
$tabCount++;
|
||||
console.log(json);
|
||||
var tabId = $openTabs[json.id];
|
||||
if ($openTabs[json.id] !== undefined) {
|
||||
AIRTIME.showbuilder.switchTab($(".pl-tab-content-" + tabId), $("#pl-tab-" + tabId));
|
||||
return;
|
||||
}
|
||||
$tabCount++;
|
||||
|
||||
var wrapper = "<div id='side_playlist' class='pl-content pl-tab-content-" + $tabCount + "'><div class='editor_pane_wrapper'></div></div>",
|
||||
var wrapper = "<div class='side_playlist pl-content pl-tab-content-" + $tabCount + "'><div class='editor_pane_wrapper'></div></div>",
|
||||
t = $("#show_builder").append(wrapper).find(".pl-tab-content-" + $tabCount),
|
||||
pane = $(".editor_pane_wrapper:last"),
|
||||
name = pane.append(json.html).find("#playlist_name_display").text(),
|
||||
|
@ -494,7 +493,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
newTab.on("click", function() {
|
||||
AIRTIME.showbuilder.switchTab(t, newTab);
|
||||
$.post(baseUrl+'new-playlist/edit',
|
||||
{format: "json", id: t.find("#obj_id").val(), type: t.find("#obj_type").val()});
|
||||
{format: "json", id: t.find(".obj_id").val(), type: t.find(".obj_type").val()});
|
||||
});
|
||||
AIRTIME.showbuilder.switchTab(t, newTab);
|
||||
AIRTIME.playlist.init();
|
||||
|
@ -517,7 +516,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
function closeTab() {
|
||||
delete $openTabs[$(".active-tab").find("#obj_id").val()];
|
||||
delete $openTabs[$(".active-tab").find(".obj_id").val()];
|
||||
$(".nav.nav-tabs .active").remove();
|
||||
$pl.remove();
|
||||
AIRTIME.showbuilder.switchTab($("#show_builder .outer-datatable-wrapper"), $("#timeline-tab"));
|
||||
|
@ -593,7 +592,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
//sets events dynamically for playlist entries (each row in the playlist)
|
||||
function setPlaylistEntryEvents() {
|
||||
$pl.delegate("#spl_sortable .ui-icon-closethick",
|
||||
$pl.delegate(".spl_sortable .ui-icon-closethick",
|
||||
{"click": function(ev){
|
||||
var id;
|
||||
id = parseInt($(this).attr("id").split("_").pop(), 10);
|
||||
|
@ -660,7 +659,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
//sets events dynamically for the cue editor.
|
||||
function setCueEvents() {
|
||||
var temp = $('#spl_sortable');
|
||||
var temp = $('.active-tab .spl_sortable');
|
||||
temp.on("focusout", ".spl_cue_in span", changeCueIn);
|
||||
temp.on("keydown", ".spl_cue_in span", submitOnEnter);
|
||||
|
||||
|
@ -677,7 +676,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
//sets events dynamically for the fade editor.
|
||||
function setFadeEvents() {
|
||||
var temp = $('#spl_sortable');
|
||||
var temp = $('.active-tab .spl_sortable');
|
||||
temp.on("focusout", ".spl_fade_in span", changeFadeIn);
|
||||
temp.on("keydown", ".spl_fade_in span", submitOnEnter);
|
||||
|
||||
|
@ -698,7 +697,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
//main playlist fades events
|
||||
$pl.on("click", "#spl_crossfade", function() {
|
||||
var lastMod = getModified(),
|
||||
type = $pl.find('#obj_type').val();
|
||||
type = $pl.find('.obj_type').val();
|
||||
|
||||
if ($(this).hasClass("ui-state-active")) {
|
||||
$(this).removeClass("ui-state-active");
|
||||
|
@ -748,7 +747,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
span = $(this),
|
||||
fadeIn = $.trim(span.text()),
|
||||
lastMod = getModified(),
|
||||
type = $pl.find('#obj_type').val();
|
||||
type = $pl.find('.obj_type').val();
|
||||
|
||||
if (!isFadeValid(fadeIn)){
|
||||
showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
|
||||
|
@ -772,7 +771,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
span = $(this),
|
||||
fadeOut = $.trim(span.text()),
|
||||
lastMod = getModified(),
|
||||
type = $pl.find('#obj_type').val();
|
||||
type = $pl.find('.obj_type').val();
|
||||
|
||||
if (!isFadeValid(fadeOut)){
|
||||
showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
|
||||
|
@ -816,7 +815,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
|
||||
$pl.on("click", 'button[id="playlist_shuffle_button"]', function(){
|
||||
obj_id = $('input[id="obj_id"]').val();
|
||||
obj_id = $pl.find('.obj_id').val();
|
||||
url = baseUrl+"new-playlist/shuffle";
|
||||
enableLoadingIcon();
|
||||
$.post(url, {format: "json", obj_id: obj_id}, function(json){
|
||||
|
@ -840,14 +839,14 @@ var AIRTIME = (function(AIRTIME){
|
|||
//stream url
|
||||
//default_length
|
||||
//playlist name
|
||||
var id = $pl.find("#obj_id").attr("value");
|
||||
var id = $pl.find(".obj_id").attr("value");
|
||||
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();
|
||||
|
||||
//hide any previous errors (if any)
|
||||
$("#side_playlist .errors").empty().hide();
|
||||
$(".side_playlist.active-tab .errors").empty().hide();
|
||||
|
||||
var url = baseUrl+'new-webstream/save';
|
||||
$.post(url,
|
||||
|
@ -859,23 +858,23 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
if (!field[0]) {
|
||||
var elemId = "#"+s+"-error";
|
||||
var $div = $("#side_playlist " + elemId).text(field[1]).show();
|
||||
var $div = $(".side_playlist.active-tab " + elemId).text(field[1]).show();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var $status = $("#side_playlist .status");
|
||||
var $status = $(".side_playlist.active-tab .status");
|
||||
$status.html(json.statusMessage);
|
||||
$status.show();
|
||||
setTimeout(function(){$status.fadeOut("slow", function(){$status.empty()})}, 5000);
|
||||
|
||||
var $ws_id = $("#obj_id");
|
||||
var $ws_id = $(".active-tab .obj_id");
|
||||
$ws_id.attr("value", json.streamId);
|
||||
|
||||
var $ws_id = $("#ws_delete");
|
||||
$ws_id.show();
|
||||
|
||||
|
||||
var length = $("#side_playlist #ws_length");
|
||||
var length = $(".side_playlist.active-tab #ws_length");
|
||||
length.text(json.length);
|
||||
|
||||
//redraw the library to show the new webstream
|
||||
|
@ -913,7 +912,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
if ((name == "Untitled Playlist"
|
||||
|| name == "Untitled Smart Block")
|
||||
&& $pl.find("#spl_sortable .spl_empty").length == 1) {
|
||||
&& $pl.find(".spl_sortable .spl_empty").length == 1) {
|
||||
mod.fnDelete();
|
||||
} else {
|
||||
closeTab();
|
||||
|
@ -940,8 +939,8 @@ var AIRTIME = (function(AIRTIME){
|
|||
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('input[id="obj_id"]').val(),
|
||||
obj_type = $pl.find('#obj_type').val(),
|
||||
obj_id = $pl.find(".obj_id").val(),
|
||||
obj_type = $pl.find('.obj_type').val(),
|
||||
lastMod = getModified(),
|
||||
dt = $('table[id="library_display"]').dataTable();
|
||||
enableLoadingIcon();
|
||||
|
@ -1064,7 +1063,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
};
|
||||
}());
|
||||
|
||||
$pl.find("#spl_sortable").sortable(sortableConf);
|
||||
$pl.find(".spl_sortable").sortable(sortableConf);
|
||||
AIRTIME.playlist.validatePlaylistElements();
|
||||
}
|
||||
|
||||
|
@ -1131,7 +1130,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
stopAudioPreview();
|
||||
id = (plid === undefined) ? getId() : plid;
|
||||
lastMod = getModified();
|
||||
type = $pl.find('#obj_type').val();
|
||||
type = $pl.find('.obj_type').val();
|
||||
url = baseUrl+'new-playlist/delete';
|
||||
|
||||
$.post(url,
|
||||
|
@ -1149,7 +1148,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
stopAudioPreview();
|
||||
id = (wsid === undefined) ? getId() : wsid;
|
||||
lastMod = getModified();
|
||||
type = $pl.find('#obj_type').val();
|
||||
type = $pl.find('.obj_type').val();
|
||||
url = baseUrl+'new-webstream/delete';
|
||||
|
||||
$.post(url,
|
||||
|
@ -1200,7 +1199,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
function playlistRequest(sUrl, oData) {
|
||||
var lastMod,
|
||||
obj_type = $pl.find('#obj_type').val();
|
||||
obj_type = $pl.find('.obj_type').val();
|
||||
|
||||
mod.disableUI();
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
btnText = $.i18n._('Add to current show');
|
||||
}
|
||||
} else {
|
||||
var objType = $('#obj_type').val();
|
||||
var objType = $('.active-tab .obj_type').val();
|
||||
if (objType === 'block') {
|
||||
btnText = ' ' + $.i18n._('Add to current smart block');
|
||||
} else {
|
||||
|
@ -115,7 +115,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
helper: function () {
|
||||
|
||||
var $el = $(this), selected = mod
|
||||
.getChosenAudioFilesLength(), container, message, li = $("#side_playlist ul[id='spl_sortable'] li:first"),
|
||||
.getChosenAudioFilesLength(), container, message, li = $(".side_playlist.active-tab ul.spl_sortable li:first"),
|
||||
width = li.width(), height = 55;
|
||||
if (width > 798) width = 798;
|
||||
|
||||
|
@ -146,7 +146,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
top: 30,
|
||||
left: 100
|
||||
},
|
||||
connectToSortable: '#spl_sortable'
|
||||
connectToSortable: '.active-tab .spl_sortable'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
@ -10,7 +10,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
mod.checkAddButton = function() {
|
||||
|
||||
var selected = mod.getChosenItemsLength(),
|
||||
sortable = $('#spl_sortable:visible'),
|
||||
sortable = $('.spl_sortable:visible'),
|
||||
check = false,
|
||||
blockType = $('input[name=sp_type]:checked', '#smart-block-form').val();
|
||||
|
||||
|
@ -27,7 +27,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
AIRTIME.button.disableButton("btn-group #library-plus", false);
|
||||
}
|
||||
|
||||
var objType = $('#obj_type').val(),
|
||||
var objType = $('.obj_type').val(),
|
||||
btnText;
|
||||
if (objType === 'playlist') {
|
||||
btnText = ' '+$.i18n._('Add to current playlist');
|
||||
|
@ -75,7 +75,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
helper : function() {
|
||||
|
||||
var $el = $(this), selected = mod
|
||||
.getChosenAudioFilesLength(), container, message, li = $("#side_playlist ul[id='spl_sortable'] li:first"),
|
||||
.getChosenAudioFilesLength(), container, message, li = $(".side_playlist ul[id='spl_sortable'] li:first"),
|
||||
width = li.width(), height = 55;
|
||||
if (width > 798) width = 798;
|
||||
|
||||
|
@ -106,7 +106,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
top: 30,
|
||||
left: 100
|
||||
},
|
||||
connectToSortable : '#spl_sortable'
|
||||
connectToSortable : '.spl_sortable'
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -148,7 +148,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
if (temp.ftype === "audioclip"
|
||||
|| temp.ftype === "block"
|
||||
|| (temp.ftype === "stream" && $(
|
||||
"#obj_type").val() === "playlist")) {
|
||||
".obj_type").val() === "playlist")) {
|
||||
aMediaIds.push(new Array(temp.id,
|
||||
temp.ftype));
|
||||
}
|
||||
|
@ -157,9 +157,9 @@ var AIRTIME = (function(AIRTIME) {
|
|||
AIRTIME.playlist.fnAddItems(aMediaIds,
|
||||
undefined, 'after');
|
||||
} else {
|
||||
if ($('#obj_type').val() == 'block') {
|
||||
if ($('.obj_type').val() == 'block') {
|
||||
alert($.i18n._('You can only add tracks to smart blocks.'));
|
||||
} else if ($('#obj_type').val() == 'playlist') {
|
||||
} else if ($('.obj_type').val() == 'playlist') {
|
||||
alert($.i18n._('You can only add tracks, smart blocks, and webstreams to playlists.'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -345,8 +345,8 @@ var AIRTIME = (function(AIRTIME) {
|
|||
item,
|
||||
temp,
|
||||
aMedia = [],
|
||||
currentObjId = $("#side_playlist").find("#obj_id").val(),
|
||||
currentObjType = $("#side_playlist").find("#obj_type").val(),
|
||||
currentObjId = $(".side_playlist").find(".obj_id").val(),
|
||||
currentObjType = $(".side_playlist").find(".obj_type").val(),
|
||||
closeObj = false;
|
||||
|
||||
// process selected files/playlists.
|
||||
|
@ -370,7 +370,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
$.post(baseUrl+"playlist/close-playlist",
|
||||
{"format": "json", "type": currentObjType},
|
||||
function(json) {
|
||||
$("#side_playlist").empty().append(json.html);
|
||||
$(".side_playlist").empty().append(json.html);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
li = span.parents("li"),
|
||||
unqid = li.attr("unqid"),
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
type = $('.obj_type').val();
|
||||
|
||||
if (!isTimeValid(cueIn)){
|
||||
showError(span, $.i18n._("please put in a time '00:00:00 (.0)'"));
|
||||
|
@ -93,7 +93,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
setPlaylistContent(json);
|
||||
|
||||
li = $('#side_playlist li[unqid='+unqid+']');
|
||||
li = $('.side_playlist li[unqid='+unqid+']');
|
||||
li.find(".cue-edit").toggle();
|
||||
highlightActive(li);
|
||||
highlightActive(li.find('.spl_cue'));
|
||||
|
@ -109,7 +109,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
li = span.parents("li"),
|
||||
unqid = li.attr("unqid"),
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
type = $('.obj_type').val();
|
||||
|
||||
if (!isTimeValid(cueOut)){
|
||||
showError(span, $.i18n._("please put in a time '00:00:00 (.0)'"));
|
||||
|
@ -131,7 +131,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
setPlaylistContent(json);
|
||||
|
||||
li = $('#side_playlist li[unqid='+unqid+']');
|
||||
li = $('.side_playlist li[unqid='+unqid+']');
|
||||
li.find(".cue-edit").toggle();
|
||||
highlightActive(li);
|
||||
highlightActive(li.find('.spl_cue'));
|
||||
|
@ -143,7 +143,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
var url = baseUrl+"Playlist/set-cue",
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val(),
|
||||
type = $('.obj_type').val(),
|
||||
li,
|
||||
span;
|
||||
|
||||
|
@ -176,7 +176,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
if (json.cue_error !== undefined) {
|
||||
|
||||
li = $('#side_playlist li[unqid='+id+']');
|
||||
li = $('.side_playlist li[unqid='+id+']');
|
||||
|
||||
if (json.code === 0) {
|
||||
|
||||
|
@ -201,7 +201,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
setPlaylistContent(json);
|
||||
|
||||
li = $('#side_playlist li[unqid='+id+']');
|
||||
li = $('.side_playlist li[unqid='+id+']');
|
||||
li.find(".cue-edit").toggle();
|
||||
highlightActive(li);
|
||||
highlightActive(li.find('.spl_cue'));
|
||||
|
@ -213,7 +213,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
var url = baseUrl+"Playlist/set-crossfade",
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
type = $('.obj_type').val();
|
||||
|
||||
$.post(url,
|
||||
{format: "json", fadeIn: fadeIn, fadeOut: fadeOut, id1: id1, id2: id2, offset: offset, modified: lastMod, type: type},
|
||||
|
@ -229,7 +229,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
setPlaylistContent(json);
|
||||
|
||||
$li = $('#side_playlist li[unqid='+id+']');
|
||||
$li = $('.side_playlist li[unqid='+id+']');
|
||||
$li.find('.crossfade').toggle();
|
||||
highlightActive($li.find('.spl_fade_control'));
|
||||
});
|
||||
|
@ -245,7 +245,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
li = span.parents("li"),
|
||||
unqid = li.attr("unqid"),
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
type = $('.obj_type').val();
|
||||
|
||||
if (!isFadeValid(fadeIn)){
|
||||
showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
|
||||
|
@ -267,7 +267,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
setPlaylistContent(json);
|
||||
|
||||
li = $('#side_playlist li[unqid='+unqid+']');
|
||||
li = $('.side_playlist li[unqid='+unqid+']');
|
||||
li.find('.crossfade').toggle();
|
||||
highlightActive(li.find('.spl_fade_control'));
|
||||
});
|
||||
|
@ -283,7 +283,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
li = span.parents("li"),
|
||||
unqid = li.attr("unqid"),
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
type = $('.obj_type').val();
|
||||
|
||||
if (!isFadeValid(fadeOut)){
|
||||
showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
|
||||
|
@ -305,7 +305,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
setPlaylistContent(json);
|
||||
|
||||
li = $('#side_playlist li[unqid='+unqid+']');
|
||||
li = $('.side_playlist li[unqid='+unqid+']');
|
||||
li.find('.crossfade').toggle();
|
||||
highlightActive(li.find('.spl_fade_control'));
|
||||
});
|
||||
|
@ -357,7 +357,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
function editName() {
|
||||
var nameElement = $(this),
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
type = $('.obj_type').val();
|
||||
//remove any newlines if user somehow snuck them in (easy to do if dragging/dropping text)
|
||||
nameElement.text(nameElement.text().replace("\n", ""));
|
||||
|
||||
|
@ -401,8 +401,8 @@ var AIRTIME = (function(AIRTIME){
|
|||
.empty()
|
||||
.val(json.description);
|
||||
|
||||
$('#spl_sortable').off('focusout keydown');
|
||||
$('#spl_sortable')
|
||||
$('.spl_sortable').off('focusout keydown');
|
||||
$('.spl_sortable')
|
||||
.empty()
|
||||
.append($html);
|
||||
setCueEvents();
|
||||
|
@ -413,7 +413,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
function setFadeIcon(){
|
||||
var contents = $("#spl_sortable");
|
||||
var contents = $(".spl_sortable");
|
||||
var show = contents.is(":visible");
|
||||
var empty = $(".spl_empty");
|
||||
|
||||
|
@ -436,19 +436,19 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
function getId() {
|
||||
return parseInt($("#obj_id").val(), 10);
|
||||
return parseInt($(".obj_id").val(), 10);
|
||||
}
|
||||
|
||||
function getModified() {
|
||||
return parseInt($("#obj_lastMod").val(), 10);
|
||||
return parseInt($(".obj_lastMod").val(), 10);
|
||||
}
|
||||
|
||||
function setModified(modified) {
|
||||
$("#obj_lastMod").val(modified);
|
||||
$(".obj_lastMod").val(modified);
|
||||
}
|
||||
|
||||
function openPlaylist(json) {
|
||||
$("#side_playlist")
|
||||
$(".side_playlist")
|
||||
.empty()
|
||||
.append(json.html);
|
||||
|
||||
|
@ -541,7 +541,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
//sets events dynamically for playlist entries (each row in the playlist)
|
||||
function setPlaylistEntryEvents() {
|
||||
|
||||
$pl.delegate("#spl_sortable .ui-icon-closethick",
|
||||
$pl.delegate(".spl_sortable .ui-icon-closethick",
|
||||
{"click": function(ev){
|
||||
var id;
|
||||
id = parseInt($(this).attr("id").split("_").pop(), 10);
|
||||
|
@ -608,7 +608,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
//sets events dynamically for the cue editor.
|
||||
function setCueEvents() {
|
||||
var temp = $('#spl_sortable');
|
||||
var temp = $('.spl_sortable');
|
||||
temp.on("focusout", ".spl_cue_in span", changeCueIn);
|
||||
temp.on("keydown", ".spl_cue_in span", submitOnEnter);
|
||||
|
||||
|
@ -625,7 +625,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
//sets events dynamically for the fade editor.
|
||||
function setFadeEvents() {
|
||||
var temp = $('#spl_sortable');
|
||||
var temp = $('.spl_sortable');
|
||||
temp.on("focusout", ".spl_fade_in span", changeFadeIn);
|
||||
temp.on("keydown", ".spl_fade_in span", submitOnEnter);
|
||||
|
||||
|
@ -646,7 +646,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
//main playlist fades events
|
||||
$pl.on("click", "#spl_crossfade", function() {
|
||||
var lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
type = $('.obj_type').val();
|
||||
|
||||
if ($(this).hasClass("ui-state-active")) {
|
||||
$(this).removeClass("ui-state-active");
|
||||
|
@ -696,7 +696,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
span = $(this),
|
||||
fadeIn = $.trim(span.text()),
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
type = $('.obj_type').val();
|
||||
|
||||
if (!isFadeValid(fadeIn)){
|
||||
showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
|
||||
|
@ -720,7 +720,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
span = $(this),
|
||||
fadeOut = $.trim(span.text()),
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
type = $('.obj_type').val();
|
||||
|
||||
if (!isFadeValid(fadeOut)){
|
||||
showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
|
||||
|
@ -788,14 +788,14 @@ var AIRTIME = (function(AIRTIME){
|
|||
//stream url
|
||||
//default_length
|
||||
//playlist name
|
||||
var id = $pl.find("#obj_id").attr("value");
|
||||
var id = $pl.find(".obj_id").attr("value");
|
||||
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();
|
||||
|
||||
//hide any previous errors (if any)
|
||||
$("#side_playlist .errors").empty().hide();
|
||||
$(".side_playlist .errors").empty().hide();
|
||||
|
||||
var url = baseUrl+'Webstream/save';
|
||||
$.post(url,
|
||||
|
@ -807,23 +807,23 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
if (!field[0]) {
|
||||
var elemId = "#"+s+"-error";
|
||||
var $div = $("#side_playlist " + elemId).text(field[1]).show();
|
||||
var $div = $(".side_playlist " + elemId).text(field[1]).show();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var $status = $("#side_playlist .status");
|
||||
var $status = $(".side_playlist .status");
|
||||
$status.html(json.statusMessage);
|
||||
$status.show();
|
||||
setTimeout(function(){$status.fadeOut("slow", function(){$status.empty()})}, 5000);
|
||||
|
||||
var $ws_id = $("#obj_id");
|
||||
var $ws_id = $(".obj_id");
|
||||
$ws_id.attr("value", json.streamId);
|
||||
|
||||
var $ws_id = $("#ws_delete");
|
||||
$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
|
||||
|
@ -877,7 +877,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
block_desc = $('textarea[name="description"]').val(),
|
||||
save_action = baseUrl+'Playlist/save',
|
||||
obj_id = $('input[id="obj_id"]').val(),
|
||||
obj_type = $('#obj_type').val(),
|
||||
obj_type = $('.obj_type').val(),
|
||||
lastMod = getModified(),
|
||||
dt = $('table[id="library_display"]').dataTable();
|
||||
enableLoadingIcon();
|
||||
|
@ -1000,7 +1000,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
};
|
||||
}());
|
||||
|
||||
$pl.find("#spl_sortable").sortable(sortableConf);
|
||||
$pl.find(".spl_sortable").sortable(sortableConf);
|
||||
AIRTIME.playlist.validatePlaylistElements();
|
||||
}
|
||||
|
||||
|
@ -1064,7 +1064,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
stopAudioPreview();
|
||||
id = (plid === undefined) ? getId() : plid;
|
||||
lastMod = getModified();
|
||||
type = $('#obj_type').val();
|
||||
type = $('.obj_type').val();
|
||||
url = baseUrl+'Playlist/delete';
|
||||
|
||||
$.post(url,
|
||||
|
@ -1081,7 +1081,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
stopAudioPreview();
|
||||
id = (wsid === undefined) ? getId() : wsid;
|
||||
lastMod = getModified();
|
||||
type = $('#obj_type').val();
|
||||
type = $('.obj_type').val();
|
||||
url = baseUrl+'Webstream/delete';
|
||||
|
||||
$.post(url,
|
||||
|
@ -1137,7 +1137,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
function playlistRequest(sUrl, oData) {
|
||||
var lastMod,
|
||||
obj_type = $('#obj_type').val();
|
||||
obj_type = $('.obj_type').val();
|
||||
|
||||
mod.disableUI();
|
||||
|
||||
|
@ -1473,7 +1473,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
mod.onReady = function() {
|
||||
$lib = $("#library_content");
|
||||
$pl = $("#side_playlist");
|
||||
$pl = $(".side_playlist");
|
||||
|
||||
setWidgetSize();
|
||||
|
||||
|
|
|
@ -350,7 +350,7 @@ function setupUI() {
|
|||
/* Activate or Deactivate shuffle button
|
||||
* It is only active if playlist is not empty
|
||||
*/
|
||||
var plContents = $('#spl_sortable').children();
|
||||
var plContents = $('.spl_sortable').children();
|
||||
var shuffleButton = $('button[id="shuffle_button"], button[id="playlist_shuffle_button"], button[id="pl-bl-clear-content"]');
|
||||
|
||||
if (!plContents.hasClass('spl_empty')) {
|
||||
|
@ -364,15 +364,15 @@ function setupUI() {
|
|||
}
|
||||
|
||||
var dynamic_length = target_length;
|
||||
if ($('#obj_type').val() == 'block') {
|
||||
if ($('.obj_type').val() == 'block') {
|
||||
if (playlist_type == "0") {
|
||||
$('button[id="generate_button"]').show();
|
||||
$('button[id="shuffle_button"]').show();
|
||||
$('#spl_sortable').show();
|
||||
$('.spl_sortable').show();
|
||||
} else {
|
||||
$('button[id="generate_button"]').hide();
|
||||
$('button[id="shuffle_button"]').hide();
|
||||
$('#spl_sortable').hide();
|
||||
$('.spl_sortable').hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -548,7 +548,7 @@ function removeButtonCheck() {
|
|||
}
|
||||
|
||||
function enableLoadingIcon() {
|
||||
$("#side_playlist").block({
|
||||
$(".side_playlist").block({
|
||||
message: $.i18n._("Processing..."),
|
||||
theme: true,
|
||||
allowBodyStretch: true,
|
||||
|
@ -557,7 +557,7 @@ function enableLoadingIcon() {
|
|||
}
|
||||
|
||||
function disableLoadingIcon() {
|
||||
$("#side_playlist").unblock()
|
||||
$(".side_playlist").unblock()
|
||||
}
|
||||
// We need to know if the criteria value will be a string
|
||||
// or numeric value in order to populate the modifier
|
||||
|
|
|
@ -809,6 +809,104 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
});
|
||||
|
||||
//begin context menu initialization.
|
||||
$.contextMenu({
|
||||
selector: '#show_builder tr.lib-audio:not(.sb-past)',
|
||||
trigger: "right",
|
||||
|
||||
build: function($el, e) {
|
||||
var items,
|
||||
$tr = $el,
|
||||
data = $tr.data("aData"),
|
||||
cursorClass = "cursor-selected-row",
|
||||
callback;
|
||||
|
||||
function processMenuItems(oItems) {
|
||||
|
||||
//define a preview callback.
|
||||
if (oItems.preview !== undefined) {
|
||||
|
||||
callback = function() {
|
||||
open_show_preview(data.instance, data.pos);
|
||||
};
|
||||
|
||||
oItems.preview.callback = callback;
|
||||
}
|
||||
|
||||
//define a select cursor callback.
|
||||
if (oItems.selCurs !== undefined) {
|
||||
|
||||
callback = function() {
|
||||
var $tr = $(this).parents('tr').next();
|
||||
|
||||
mod.selectCursor($tr);
|
||||
};
|
||||
|
||||
oItems.selCurs.callback = callback;
|
||||
}
|
||||
|
||||
//define a remove cursor callback.
|
||||
if (oItems.delCurs !== undefined) {
|
||||
|
||||
callback = function() {
|
||||
var $tr = $(this).parents('tr').next();
|
||||
|
||||
mod.removeCursor($tr);
|
||||
};
|
||||
|
||||
oItems.delCurs.callback = callback;
|
||||
}
|
||||
|
||||
//define a delete callback.
|
||||
if (oItems.del !== undefined) {
|
||||
|
||||
callback = function() {
|
||||
AIRTIME.showbuilder.fnRemove([{
|
||||
id: data.id,
|
||||
timestamp: data.timestamp,
|
||||
instance: data.instance
|
||||
}]);
|
||||
};
|
||||
|
||||
oItems.del.callback = callback;
|
||||
}
|
||||
|
||||
//only show the cursor selecting options if the library is visible on the page.
|
||||
if ($tr.next().find('.marker').length === 0) {
|
||||
delete oItems.selCurs;
|
||||
delete oItems.delCurs;
|
||||
}
|
||||
//check to include either select or remove cursor.
|
||||
else {
|
||||
if ($tr.next().hasClass(cursorClass)) {
|
||||
delete oItems.selCurs;
|
||||
}
|
||||
else {
|
||||
delete oItems.delCurs;
|
||||
}
|
||||
}
|
||||
|
||||
items = oItems;
|
||||
}
|
||||
|
||||
request = $.ajax({
|
||||
url: baseUrl+"showbuilder/context-menu",
|
||||
type: "GET",
|
||||
data: {id : data.id, format: "json"},
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json){
|
||||
processMenuItems(json.items);
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
items: items
|
||||
};
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
var sortableConf = (function(){
|
||||
var origTrs,
|
||||
aItemData = [],
|
||||
|
@ -973,7 +1071,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
$toolbar = $(".sb-content .fg-toolbar:first");
|
||||
var footer = $(".sb-content .fg-toolbar:last"),
|
||||
timerange = $(".sb-timerange");
|
||||
footer.append(timerange);
|
||||
$toolbar.append(timerange);
|
||||
|
||||
$menu = $("<div class='btn-toolbar'/>");
|
||||
$menu.append("<div class='btn-group'>" +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue