SAAS-989 - Move file metadata editor to right-hand showbuilder pane
This commit is contained in:
parent
57c1d74286
commit
33d2fe0900
5 changed files with 124 additions and 50 deletions
|
@ -508,8 +508,8 @@ var AIRTIME = (function(AIRTIME) {
|
|||
"aoColumns": [
|
||||
/* ftype */ { "sTitle" : "" , "mDataProp" : "ftype" , "bSearchable" : false , "bVisible" : false } ,
|
||||
/* 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"} ,
|
||||
///* 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"} ,
|
||||
/* Title */ { "sTitle" : $.i18n._("Title") , "mDataProp" : "track_title" , "sClass" : "library_title" , "sWidth" : "170px" } ,
|
||||
/* Creator */ { "sTitle" : $.i18n._("Creator") , "mDataProp" : "artist_name" , "sClass" : "library_creator" , "sWidth" : "160px" } ,
|
||||
/* Album */ { "sTitle" : $.i18n._("Album") , "mDataProp" : "album_title" , "sClass" : "library_album" , "sWidth" : "150px" } ,
|
||||
|
@ -1203,6 +1203,8 @@ $(document).ready(function() {
|
|||
oTable.fnStandingRedraw();
|
||||
}
|
||||
});
|
||||
|
||||
AIRTIME.playlist.closeTab();
|
||||
});
|
||||
|
||||
$('#editmdcancel').live("click", function() {
|
||||
|
|
|
@ -16,7 +16,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
widgetHeight,
|
||||
resizeTimeout,
|
||||
width,
|
||||
$plCount = 0,
|
||||
$tabCount = 0,
|
||||
$openTabs = {};
|
||||
|
||||
function isTimeValid(time) {
|
||||
|
@ -432,29 +432,63 @@ var AIRTIME = (function(AIRTIME){
|
|||
$pl.find("#obj_lastMod").val(modified);
|
||||
}
|
||||
|
||||
function openPlaylist(json) {
|
||||
$plCount++;
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
|
||||
var wrapper = "<div id='side_playlist' class='pl-content pl-tab-content-" + $plCount + "'><div class='editor_pane_wrapper'></div></div>",
|
||||
t = $("#show_builder").append(wrapper).find(".pl-tab-content-" + $plCount),
|
||||
var wrapper = "<div id='side_playlist' class='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(),
|
||||
tab = "<li id='pl-tab-" + $plCount + "' role='presentation' class='active'><a href='#'>" + name + "</a></li>",
|
||||
name = pane.append(json.dialog).find("#track_title").val() + $.i18n._(" - Metadata Editor"),
|
||||
tab = "<li id='pl-tab-" + $tabCount + "' role='presentation' class='active'><a href='#'>" + name + "</a></li>",
|
||||
tabs = $(".nav.nav-tabs");
|
||||
|
||||
if (json.id) {
|
||||
$openTabs[json.id] = $plCount;
|
||||
$openTabs[json.id] = $tabCount;
|
||||
}
|
||||
|
||||
|
||||
$(".nav.nav-tabs li").removeClass("active");
|
||||
tabs.append(tab);
|
||||
var newTab = $("#pl-tab-" + $plCount);
|
||||
var newTab = $("#pl-tab-" + $tabCount);
|
||||
|
||||
newTab.on("click", function() {
|
||||
AIRTIME.showbuilder.switchTab(t, newTab);
|
||||
});
|
||||
pane.find("#editmdcancel").on("click", function() {
|
||||
closeTab();
|
||||
});
|
||||
AIRTIME.showbuilder.switchTab(t, newTab);
|
||||
}
|
||||
|
||||
function openPlaylist(json) {
|
||||
$tabCount++;
|
||||
var tabId = $openTabs[json.id];
|
||||
if ($openTabs[json.id] !== undefined) {
|
||||
AIRTIME.showbuilder.switchTab($(".pl-tab-content-" + tabId), $("#pl-tab-" + tabId));
|
||||
return;
|
||||
}
|
||||
|
||||
var wrapper = "<div id='side_playlist' class='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(),
|
||||
tab = "<li id='pl-tab-" + $tabCount + "' role='presentation' class='active'><a href='#'>" + name + "</a></li>",
|
||||
tabs = $(".nav.nav-tabs");
|
||||
|
||||
if (json.id) {
|
||||
$openTabs[json.id] = $tabCount;
|
||||
}
|
||||
|
||||
$(".nav.nav-tabs li").removeClass("active");
|
||||
tabs.append(tab);
|
||||
var newTab = $("#pl-tab-" + $tabCount);
|
||||
|
||||
newTab.on("click", function() {
|
||||
AIRTIME.showbuilder.switchTab(t, newTab);
|
||||
|
@ -464,10 +498,6 @@ var AIRTIME = (function(AIRTIME){
|
|||
AIRTIME.showbuilder.switchTab(t, newTab);
|
||||
AIRTIME.playlist.init();
|
||||
|
||||
//setUpPlaylist();
|
||||
//setCueEvents();
|
||||
//setFadeEvents();
|
||||
|
||||
// functions in smart_blockbuilder.js
|
||||
setupUI();
|
||||
appendAddButton();
|
||||
|
@ -492,6 +522,10 @@ var AIRTIME = (function(AIRTIME){
|
|||
AIRTIME.showbuilder.switchTab($("#show_builder .outer-datatable-wrapper"), $("#timeline-tab"));
|
||||
}
|
||||
|
||||
mod.closeTab = function() {
|
||||
closeTab();
|
||||
};
|
||||
|
||||
//Purpose of this function is to iterate over all playlist elements
|
||||
//and verify whether they can be previewed by the browser or not. If not
|
||||
//then the playlist element is greyed out
|
||||
|
@ -1073,6 +1107,10 @@ var AIRTIME = (function(AIRTIME){
|
|||
});
|
||||
};
|
||||
|
||||
mod.fileMdEdit = function(json) {
|
||||
openFileMdEditor(json);
|
||||
};
|
||||
|
||||
mod.fnEdit = function(id, type, url) {
|
||||
//openPlaylistPanel();
|
||||
stopAudioPreview();
|
||||
|
|
|
@ -307,7 +307,8 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
if (data.ftype === "audioclip") {
|
||||
$.get(baseUrl + "library/edit-file-md/id/" + data.id, {format: "json"}, function(json){
|
||||
buildEditMetadataDialog(json);
|
||||
AIRTIME.playlist.fileMdEdit(json);
|
||||
//buildEditMetadataDialog(json);
|
||||
});
|
||||
} else if (data.ftype === "playlist" || data.ftype === "block") {
|
||||
AIRTIME.playlist.fnEdit(data.id, data.ftype, baseUrl+'new-playlist/edit');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue