diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 058d383b17..2116665a0a 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -963,7 +963,14 @@ return "Yesterday"; } - return weekday[date.getDay()] + " " + date.toLocaleDateString(); + var day = weekday[date.getDay()]; + date = date.toLocaleDateString(); + + if (date.toLowerCase().indexOf(day.toLowerCase()) == -1) { + return day + " " + date; + } + + return date; }, getPremiereDateText: function (item, date) { diff --git a/dashboard-ui/scripts/medialibrarypage.js b/dashboard-ui/scripts/medialibrarypage.js index a0b65489fa..4324be0123 100644 --- a/dashboard-ui/scripts/medialibrarypage.js +++ b/dashboard-ui/scripts/medialibrarypage.js @@ -116,8 +116,10 @@ changeCollectionType: function () { - Dashboard.alert("To change the collection type, please remove and rebuild the collection with the new type."); - + Dashboard.alert({ + message: "To change the collection type, please remove and rebuild the collection with the new type.", + title: "Change Collection Type" + }); }, getVirtualFolderHtml: function (virtualFolder, isCollapsed, index) { diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 0d338ea22d..630957eadc 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -128,18 +128,27 @@ var Dashboard = { }, 2000); }, - alert: function (message) { + alert: function (options) { - $.mobile.loading('show', { - theme: "b", - text: message, - textonly: true, - textVisible: true - }); + if (typeof options == "string") { - setTimeout(function () { - $.mobile.loading('hide'); - }, 4000); + var message = options; + + $.mobile.loading('show', { + theme: "b", + text: message, + textonly: true, + textVisible: true + }); + + setTimeout(function () { + $.mobile.loading('hide'); + }, 4000); + + return; + } + + Dashboard.confirmInternal(options.message, options.title || 'Alert', false, options.callback); }, updateSystemInfo: function (info) { @@ -372,7 +381,7 @@ var Dashboard = { Dashboard.alert("Settings saved."); }, - confirm: function (message, title, callback) { + confirmInternal: function (message, title, showCancel, callback) { $('#confirmFlyout').popup("close").remove(); @@ -389,7 +398,11 @@ var Dashboard = { html += ''; html += '

'; - html += '

'; + + if (showCancel) { + html += '

'; + } + html += ''; html += ''; @@ -406,6 +419,10 @@ var Dashboard = { }); }, + confirm: function (message, title, callback) { + Dashboard.confirmInternal(message, title, true, callback); + }, + refreshSystemInfoFromServer: function () { ApiClient.getSystemInfo().done(function (info) { @@ -633,7 +650,7 @@ var Dashboard = { for (var i = 0, length = links.length; i < length; i++) { var link = links[i]; - + if (link.divider) { html += "
"; } @@ -1157,7 +1174,10 @@ var Dashboard = { dialog.close(); ApiClient.createPackageReview(review).done(function () { - Dashboard.alert("Thank you for your review"); + Dashboard.alert({ + message: "Thank you for your review", + title: "Thank You" + }); }); } }); diff --git a/dashboard-ui/scripts/userpassword.js b/dashboard-ui/scripts/userpassword.js index 61a1c5a5a4..01e5a32427 100644 --- a/dashboard-ui/scripts/userpassword.js +++ b/dashboard-ui/scripts/userpassword.js @@ -82,7 +82,12 @@ ApiClient.resetUserPassword(userId).done(function () { Dashboard.hideLoadingMsg(); - Dashboard.alert("The password has been reset."); + + Dashboard.alert({ + message: "The password has been reset.", + title: "Password Reset" + }); + loadUser(page); });