diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index 493bd7673..3c2fc7117 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -4139,6 +4139,11 @@ li .ui-state-hover { /* Publishing Dialog */ +.icon-soundcloud-white { + background: url(images/icon_soundcloud_cm_white.png) 0 0 no-repeat; + width: 24px; +} + .source-name { text-align: left !important; } diff --git a/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js b/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js index a2938d0ef..c0bb6bfd3 100644 --- a/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js +++ b/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js @@ -314,9 +314,22 @@ var AIRTIME = (function(AIRTIME) { } }); + $toolbar.find('#publish-btn').click(function () { + if (AIRTIME.button.isDisabled('btn-group #publish-btn') === true) { + return; + } + + var selected = $(".lib-selected"); + + selected.each(function (i, el) { + var data = $(el).data("aData"); + AIRTIME.publish.openPublishDialog(data.id); + }); + }); + // delete from library. - $toolbar.find('.icon-trash').parent().click(function () { - if (AIRTIME.button.isDisabled('icon-trash') === true) { + $toolbar.find('#sb-delete').click(function () { + if (AIRTIME.button.isDisabled('btn-group #sb-delete') === true) { return; } diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index 9b0d75c94..ae36d6677 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -229,12 +229,23 @@ var AIRTIME = (function(AIRTIME) { "" ).append( "
" + - "" + "
" ); + + if (onDashboard) { + $menu.append( + "
" + + "" + + "
" + ); + } }; mod.createToolbarDropDown = function() { @@ -252,10 +263,10 @@ var AIRTIME = (function(AIRTIME) { } if (check === true) { - AIRTIME.button.enableButton("btn-group #sb-trash", false); + AIRTIME.button.enableButton("btn-group #sb-delete", false); } else { - AIRTIME.button.disableButton("btn-group #sb-trash", false); + AIRTIME.button.disableButton("btn-group #sb-delete", false); } }; @@ -291,11 +302,28 @@ var AIRTIME = (function(AIRTIME) { } }; + mod.checkPublishButton = function() { + var selected = mod.getChosenItemsLength(), + mediaType = $(".media_type_selector.selected").data("selection-id"), + check = false; + + if (mediaType == AIRTIME.library.MediaTypeIntegerEnum.FILE && selected > 0) { + check = true; + } + + if (check === true) { + AIRTIME.button.enableButton("btn-group #publish-btn", false); + } else { + AIRTIME.button.disableButton("btn-group #publish-btn", false); + } + }; + mod.checkToolBarIcons = function() { AIRTIME.library.checkAddButton(); AIRTIME.library.checkDeleteButton(); AIRTIME.library.checkEditButton(); AIRTIME.library.checkNewButton(); + AIRTIME.library.checkPublishButton(); }; mod.getSelectedData = function() { @@ -454,7 +482,7 @@ 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); + AIRTIME.button.disableButton("btn-group #sb-delete", false); var openTabObjectIds = $(".obj_id"), mediaIds = []; for (var i in aMedia) { @@ -483,7 +511,7 @@ var AIRTIME = (function(AIRTIME) { } //Re-enable the delete button - AIRTIME.button.enableButton("btn-group #sb-trash", false); + AIRTIME.button.enableButton("btn-group #sb-delete", false); }); mod.selectNone(); };