-implemented UI changes for library page
This commit is contained in:
parent
f581b0536e
commit
c7f4ede766
|
@ -771,9 +771,9 @@ SQL;
|
|||
$row['image'] = '<img title="Playlist preview" src="/css/images/icon_playlist.png">';
|
||||
} elseif ($type == "st") {
|
||||
$row['audioFile'] = $row['id'];
|
||||
$row['image'] = '<img title="Webstream preview" src="/css/images/record_icon.png">';
|
||||
$row['image'] = '<img title="Webstream preview" src="/css/images/icon_webstream.png">';
|
||||
} elseif ($type == "bl") {
|
||||
$row['image'] = '<img title="Smart Block" src="/css/images/delete.png">';
|
||||
$row['image'] = '<img title="Smart Block" src="/css/images/icon_smart-block.png">';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@ var AIRTIME = (function(AIRTIME) {
|
|||
}
|
||||
|
||||
if (check === true) {
|
||||
AIRTIME.button.enableButton("lib-button-add");
|
||||
AIRTIME.button.enableButton("icon-plus", true);
|
||||
} else {
|
||||
AIRTIME.button.disableButton("lib-button-add");
|
||||
AIRTIME.button.disableButton("icon-plus", true);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -99,22 +99,17 @@ var AIRTIME = (function(AIRTIME) {
|
|||
mod.setupLibraryToolbar = function() {
|
||||
var $toolbar = $(".lib-content .fg-toolbar:first");
|
||||
|
||||
$toolbar
|
||||
.append("<ul />")
|
||||
.find('ul')
|
||||
.append(
|
||||
'<li class="ui-state-default lib-button-select" title="Select"><span class="ui-icon ui-icon-document-b"></span></li>')
|
||||
.append(
|
||||
'<li class="ui-state-default ui-state-disabled lib-button-add" title="Add selected library items to the current 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 library items"><span class="ui-icon ui-icon-trash"></span></li>');
|
||||
mod.createToolbarButtons();
|
||||
|
||||
$toolbar.append($menu);
|
||||
|
||||
|
||||
// add to playlist button
|
||||
$toolbar
|
||||
.find('.lib-button-add')
|
||||
.find('.icon-plus').parent()
|
||||
.click(function() {
|
||||
|
||||
if (AIRTIME.button.isDisabled('lib-button-add') === true) {
|
||||
if (AIRTIME.button.isDisabled('icon-plus') === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -144,9 +139,9 @@ var AIRTIME = (function(AIRTIME) {
|
|||
});
|
||||
|
||||
// delete from library.
|
||||
$toolbar.find('.lib-button-delete').click(function() {
|
||||
$toolbar.find('.icon-trash').parent().click(function() {
|
||||
|
||||
if (AIRTIME.button.isDisabled('lib-button-delete') === true) {
|
||||
if (AIRTIME.button.isDisabled('icon-trash') === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@ var AIRTIME = (function(AIRTIME) {
|
|||
}
|
||||
|
||||
if (check === true) {
|
||||
AIRTIME.button.enableButton("lib-button-add");
|
||||
AIRTIME.button.enableButton("icon-plus", true);
|
||||
} else {
|
||||
AIRTIME.button.disableButton("lib-button-add");
|
||||
AIRTIME.button.disableButton("icon-plus", true);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -112,23 +112,16 @@ var AIRTIME = (function(AIRTIME) {
|
|||
mod.setupLibraryToolbar = function() {
|
||||
var $toolbar = $(".lib-content .fg-toolbar:first");
|
||||
|
||||
$toolbar
|
||||
.append("<ul />")
|
||||
.find('ul')
|
||||
.append(
|
||||
'<li class="ui-state-default lib-button-select" title="Select"><span class="ui-icon ui-icon-document-b"></span></li>')
|
||||
.append(
|
||||
'<li class="ui-state-default ui-state-disabled lib-button-add" title="Add library items after selected cursors in the timeline"><span class="ui-icon ui-icon-plusthick"></span></li>')
|
||||
.append(
|
||||
'<li class="ui-state-default ui-state-disabled lib-button-delete" title="Delete selected library items"><span class="ui-icon ui-icon-trash"></span></li>');
|
||||
|
||||
mod.createToolbarButtons();
|
||||
|
||||
$toolbar.append($menu);
|
||||
// add to timeline button
|
||||
$toolbar
|
||||
.find('.lib-button-add')
|
||||
.find('.icon-plus').parent()
|
||||
.click(
|
||||
function() {
|
||||
|
||||
if (AIRTIME.button.isDisabled('lib-button-add') === true) {
|
||||
if (AIRTIME.button.isDisabled('icon-plus') === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -163,9 +156,9 @@ var AIRTIME = (function(AIRTIME) {
|
|||
});
|
||||
|
||||
// delete from library.
|
||||
$toolbar.find('.lib-button-delete').click(function() {
|
||||
$toolbar.find('.icon-trash').parent().click(function() {
|
||||
|
||||
if (AIRTIME.button.isDisabled('lib-button-delete') === true) {
|
||||
if (AIRTIME.button.isDisabled('icon-trash') === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -96,18 +96,35 @@ var AIRTIME = (function(AIRTIME) {
|
|||
return count;
|
||||
};
|
||||
|
||||
mod.createToolbarButtons = function() {
|
||||
$menu = $("<div class='btn-toolbar' />");
|
||||
$menu
|
||||
.append("<div class='btn-group'>" +
|
||||
"<button class='btn btn-small dropdown-toggle' data-toggle='dropdown'>" +
|
||||
"Select <span class='caret'></span>" +
|
||||
"</button>" +
|
||||
"<ul class='dropdown-menu'>" +
|
||||
"<li id='sb-select-page'><a href='#'>Select this page</a></li>" +
|
||||
"<li id='sb-dselect-page'><a href='#'>Deselect this page</a></li>" +
|
||||
"<li id='sb-dselect-all'><a href='#'>Deselect all</a></li>" +
|
||||
"</ul>" +
|
||||
"</div>")
|
||||
.append("<div class='btn-group'>" +
|
||||
"<button class='btn btn-small'>" +
|
||||
"<i class='icon-white icon-plus'></i> Add to current playlist" +
|
||||
"</button>" +
|
||||
"</div>")
|
||||
.append("<div class='btn-group'>" +
|
||||
"<button class='btn btn-small' id='sb-trash'>" +
|
||||
"<i class='icon-white icon-trash'></i>" +
|
||||
"</button>" +
|
||||
"</div>");
|
||||
}
|
||||
|
||||
mod.createToolbarDropDown = function() {
|
||||
|
||||
$.contextMenu({
|
||||
selector: '#library_content .ui-icon-document-b',
|
||||
trigger: "left",
|
||||
ignoreRightClick: true,
|
||||
items: {
|
||||
"sp": {name: "Select This Page", callback: mod.selectCurrentPage},
|
||||
"dp": {name: "Deselect This Page", callback: mod.deselectCurrentPage},
|
||||
"sn": {name: "Deselect All", callback: mod.selectNone}
|
||||
}
|
||||
});
|
||||
$('#sb-select-page').click(function(){mod.selectCurrentPage();});
|
||||
$('#sb-dselect-page').click(function(){mod.deselectCurrentPage();});
|
||||
$('#sb-dselect-all').click(function(){mod.selectNone();});
|
||||
};
|
||||
|
||||
mod.checkDeleteButton = function() {
|
||||
|
@ -119,10 +136,10 @@ var AIRTIME = (function(AIRTIME) {
|
|||
}
|
||||
|
||||
if (check === true) {
|
||||
AIRTIME.button.enableButton("lib-button-delete");
|
||||
AIRTIME.button.enableButton("btn-group #sb-trash", true);
|
||||
}
|
||||
else {
|
||||
AIRTIME.button.disableButton("lib-button-delete");
|
||||
AIRTIME.button.disableButton("btn-group #sb-trash", true);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue