Showbuilder checkboxes and style fixes
This commit is contained in:
parent
83902ebbbe
commit
cc36fcd37b
21 changed files with 445 additions and 313 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue