-implemented UI changes for library page

This commit is contained in:
denise 2012-09-14 12:08:51 -04:00
parent f581b0536e
commit c7f4ede766
4 changed files with 51 additions and 46 deletions

View File

@ -771,9 +771,9 @@ SQL;
$row['image'] = '<img title="Playlist preview" src="/css/images/icon_playlist.png">'; $row['image'] = '<img title="Playlist preview" src="/css/images/icon_playlist.png">';
} elseif ($type == "st") { } elseif ($type == "st") {
$row['audioFile'] = $row['id']; $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") { } 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">';
} }
} }

View File

@ -16,9 +16,9 @@ var AIRTIME = (function(AIRTIME) {
} }
if (check === true) { if (check === true) {
AIRTIME.button.enableButton("lib-button-add"); AIRTIME.button.enableButton("icon-plus", true);
} else { } else {
AIRTIME.button.disableButton("lib-button-add"); AIRTIME.button.disableButton("icon-plus", true);
} }
}; };
@ -99,22 +99,17 @@ var AIRTIME = (function(AIRTIME) {
mod.setupLibraryToolbar = function() { mod.setupLibraryToolbar = function() {
var $toolbar = $(".lib-content .fg-toolbar:first"); var $toolbar = $(".lib-content .fg-toolbar:first");
$toolbar mod.createToolbarButtons();
.append("<ul />")
.find('ul') $toolbar.append($menu);
.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>');
// add to playlist button // add to playlist button
$toolbar $toolbar
.find('.lib-button-add') .find('.icon-plus').parent()
.click(function() { .click(function() {
if (AIRTIME.button.isDisabled('lib-button-add') === true) { if (AIRTIME.button.isDisabled('icon-plus') === true) {
return; return;
} }
@ -144,9 +139,9 @@ var AIRTIME = (function(AIRTIME) {
}); });
// delete from library. // 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; return;
} }

View File

@ -16,9 +16,9 @@ var AIRTIME = (function(AIRTIME) {
} }
if (check === true) { if (check === true) {
AIRTIME.button.enableButton("lib-button-add"); AIRTIME.button.enableButton("icon-plus", true);
} else { } else {
AIRTIME.button.disableButton("lib-button-add"); AIRTIME.button.disableButton("icon-plus", true);
} }
}; };
@ -112,23 +112,16 @@ var AIRTIME = (function(AIRTIME) {
mod.setupLibraryToolbar = function() { mod.setupLibraryToolbar = function() {
var $toolbar = $(".lib-content .fg-toolbar:first"); var $toolbar = $(".lib-content .fg-toolbar:first");
$toolbar mod.createToolbarButtons();
.append("<ul />")
.find('ul') $toolbar.append($menu);
.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>');
// add to timeline button // add to timeline button
$toolbar $toolbar
.find('.lib-button-add') .find('.icon-plus').parent()
.click( .click(
function() { function() {
if (AIRTIME.button.isDisabled('lib-button-add') === true) { if (AIRTIME.button.isDisabled('icon-plus') === true) {
return; return;
} }
@ -163,9 +156,9 @@ var AIRTIME = (function(AIRTIME) {
}); });
// delete from library. // 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; return;
} }

View File

@ -96,18 +96,35 @@ var AIRTIME = (function(AIRTIME) {
return count; 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() { mod.createToolbarDropDown = function() {
$('#sb-select-page').click(function(){mod.selectCurrentPage();});
$.contextMenu({ $('#sb-dselect-page').click(function(){mod.deselectCurrentPage();});
selector: '#library_content .ui-icon-document-b', $('#sb-dselect-all').click(function(){mod.selectNone();});
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}
}
});
}; };
mod.checkDeleteButton = function() { mod.checkDeleteButton = function() {
@ -119,10 +136,10 @@ var AIRTIME = (function(AIRTIME) {
} }
if (check === true) { if (check === true) {
AIRTIME.button.enableButton("lib-button-delete"); AIRTIME.button.enableButton("btn-group #sb-trash", true);
} }
else { else {
AIRTIME.button.disableButton("lib-button-delete"); AIRTIME.button.disableButton("btn-group #sb-trash", true);
} }
}; };