diff --git a/dashboard-ui/autoorganizelog.html b/dashboard-ui/autoorganizelog.html index 3c63fdef50..7f5df1d991 100644 --- a/dashboard-ui/autoorganizelog.html +++ b/dashboard-ui/autoorganizelog.html @@ -18,7 +18,13 @@
- + +
+ + +
+
+
@@ -33,12 +39,12 @@

-
-
+
+
${LabelCompleted} -
+
${LabelFailed} -
+
${LabelSkipped}
diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index c9ad731d95..b57cd35017 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -1269,26 +1269,29 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { .listItem a:first-child { margin-right: 0 !important; background-color: transparent !important; +} + +.ui-page-theme-a .listItem a:first-child { border-color: #d8d8d8 !important; } +.ui-page-theme-b .listItem a:first-child { + border-color: #383838 !important; +} + .listItem a + a { background-color: transparent !important; z-index: 1000; } -.listItem:hover a { +.ui-page-theme-a .listItem:hover a { background-color: #eee !important; } -.page[data-theme='b'] .listItem:hover a { +.ui-page-theme-b .listItem:hover a { background-color: #333 !important; } -.page[data-theme='b'] .listItem a:first-child { - border-color: #282828 !important; -} - @media all and (max-width: 600px) { .itemsListview .ui-li-aside { diff --git a/dashboard-ui/edititemmetadata.html b/dashboard-ui/edititemmetadata.html index 8336e5c681..8a807c5b70 100644 --- a/dashboard-ui/edititemmetadata.html +++ b/dashboard-ui/edititemmetadata.html @@ -288,7 +288,7 @@
- +
${ButtonAdd}
@@ -300,7 +300,7 @@
- +
${ButtonAdd}
@@ -321,7 +321,7 @@
@@ -333,7 +333,7 @@
@@ -345,7 +345,7 @@
diff --git a/dashboard-ui/library.html b/dashboard-ui/library.html index 527602a319..c192275882 100644 --- a/dashboard-ui/library.html +++ b/dashboard-ui/library.html @@ -22,7 +22,7 @@

-
+
${LabelLastResult}
diff --git a/dashboard-ui/livetvstatus.html b/dashboard-ui/livetvstatus.html index decfdffa9e..3ddf4c5187 100644 --- a/dashboard-ui/livetvstatus.html +++ b/dashboard-ui/livetvstatus.html @@ -25,7 +25,7 @@

-
+
${LabelLastResult}
diff --git a/dashboard-ui/metadataadvanced.html b/dashboard-ui/metadataadvanced.html index fbeb15344b..2a3c28b736 100644 --- a/dashboard-ui/metadataadvanced.html +++ b/dashboard-ui/metadataadvanced.html @@ -122,7 +122,7 @@
${LabelFanartApiKeyHelp}
- +
  • diff --git a/dashboard-ui/scripts/autoorganizelog.js b/dashboard-ui/scripts/autoorganizelog.js index b74682aeea..5430a1ceca 100644 --- a/dashboard-ui/scripts/autoorganizelog.js +++ b/dashboard-ui/scripts/autoorganizelog.js @@ -329,9 +329,21 @@ reloadItems(page); + // on here + $('.btnOrganize', page).taskButton({ + mode: 'on', + progressElem: $('.organizeProgress', page), + taskKey: 'AutoOrganize' + }); + }).on('pagehide', "#libraryFileOrganizerLogPage", function () { currentResult = null; + + // off here + $('.btnOrganize', page).taskButton({ + mode: 'off' + }); }); window.OrganizerLogPage = { diff --git a/dashboard-ui/scripts/edititemmetadata.js b/dashboard-ui/scripts/edititemmetadata.js index 6ed6ffc3d3..fb6ebde48e 100644 --- a/dashboard-ui/scripts/edititemmetadata.js +++ b/dashboard-ui/scripts/edititemmetadata.js @@ -963,11 +963,13 @@ }; self.addElementToEditableListview = function (source, sortCallback) { - var input = $(source).parent().find('input[type="text"], select'); + + var parent = $(source).parents('*[data-role="editableListviewContainer"]'); + var input = parent.find('.txtEditableListview, select'); var text = input.val(); - input.val(''); + if (text == '') return; - var list = $(source).parents('[data-role="editableListviewContainer"]').find('ul[data-role="listview"]'); + var list = parent.find('ul[data-role="listview"]'); var items = editableListViewValues(list); items.push(text); populateListView(list, items, sortCallback); diff --git a/dashboard-ui/scripts/editorsidebar.js b/dashboard-ui/scripts/editorsidebar.js index 97b149826b..02231e3ae7 100644 --- a/dashboard-ui/scripts/editorsidebar.js +++ b/dashboard-ui/scripts/editorsidebar.js @@ -259,8 +259,6 @@ if (elem) { elem.scrollIntoView(); } - - $(document).scrollTop(0); } function initializeTree(page, currentUser, openItems, selectedId) { diff --git a/dashboard-ui/scripts/livetvstatus.js b/dashboard-ui/scripts/livetvstatus.js index 308e033c6b..135b269a8a 100644 --- a/dashboard-ui/scripts/livetvstatus.js +++ b/dashboard-ui/scripts/livetvstatus.js @@ -161,109 +161,29 @@ }); } - function pollTasks(page) { - - ApiClient.getScheduledTasks().done(function (tasks) { - - updateTasks(page, tasks); - }); - - } - - function updateTasks(page, tasks) { - - $('.refreshGuidePanel', page).removeClass('hide'); - - var task = tasks.filter(function (t) { - - return t.Key == 'RefreshGuide'; - - })[0]; - - $('.btnRefreshGuide', page).buttonEnabled(task.State == 'Idle').attr('data-taskid', task.Id); - - var progress = (task.CurrentProgressPercentage || 0).toFixed(1); - var progressElem = $('.refreshGuideProgress', page).val(progress); - - if (task.State == 'Running') { - progressElem.show(); - } else { - progressElem.hide(); - } - - var lastResult = task.LastExecutionResult ? task.LastExecutionResult.Status : ''; - - if (lastResult == "Failed") { - $('.lastRefreshGuideResult', page).html('' + Globalize.translate('LabelFailed') + ''); - } - else if (lastResult == "Cancelled") { - $('.lastRefreshGuideResult', page).html('' + Globalize.translate('LabelCancelled') + ''); - } - else if (lastResult == "Aborted") { - $('.lastRefreshGuideResult', page).html('' + Globalize.translate('LabelAbortedByServerShutdown') + ''); - } else { - $('.lastRefreshGuideResult', page).html(lastResult); - } - } - - function onWebSocketMessage(e, msg) { - - if (msg.MessageType == "ScheduledTasksInfo") { - - var tasks = msg.Data; - - var page = $.mobile.activePage; - - updateTasks(page, tasks); - } - } - - $(document).on('pageinit', "#liveTvStatusPage", function () { + $(document).on('pageshow', "#liveTvStatusPage", function () { var page = this; - $('.btnRefreshGuide', page).on('click', function () { - - var button = this; - var id = button.getAttribute('data-taskid'); - - ApiClient.startScheduledTask(id).done(function () { - - pollTasks(page); - }); - - }); - - }).on('pageshow', "#liveTvStatusPage", function () { - - var page = this; - - $('.refreshGuidePanel', page).addClass('hide'); - reload(page); - pollTasks(page); - - if (ApiClient.isWebSocketOpen()) { - ApiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000"); - } - - $(ApiClient).on("websocketmessage", onWebSocketMessage).on('websocketopen', function () { - - if (ApiClient.isWebSocketOpen()) { - ApiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000"); - } + // on here + $('.btnRefreshGuide', page).taskButton({ + mode: 'on', + progressElem: $('.refreshGuideProgress', page), + lastResultElem: $('.lastRefreshGuideResult', page), + taskKey: 'RefreshGuide' }); }).on('pagehide', "#liveTvStatusPage", function () { var page = this; - if (ApiClient.isWebSocketOpen()) { - ApiClient.sendWebSocketMessage("ScheduledTasksInfoStop"); - } + // off here + $('.btnRefreshGuide', page).taskButton({ + mode: 'off' + }); - $(ApiClient).off("websocketmessage", onWebSocketMessage); }); })(jQuery, document, window); diff --git a/dashboard-ui/scripts/medialibrarypage.js b/dashboard-ui/scripts/medialibrarypage.js index 76f72ba4e1..576c523527 100644 --- a/dashboard-ui/scripts/medialibrarypage.js +++ b/dashboard-ui/scripts/medialibrarypage.js @@ -371,111 +371,127 @@ var WizardLibraryPage = { (function ($, document, window) { - function pollTasks(page) { - - ApiClient.getScheduledTasks().done(function (tasks) { - - updateTasks(page, tasks); - }); - - } - - function updateTasks(page, tasks) { - - $('.refreshLibraryPanel', page).removeClass('hide'); - - var task = tasks.filter(function (t) { - - return t.Key == 'RefreshLibrary'; - - })[0]; - - $('.btnRefresh', page).buttonEnabled(task.State == 'Idle').attr('data-taskid', task.Id); - - var progress = (task.CurrentProgressPercentage || 0).toFixed(1); - var progressElem = $('.refreshProgress', page).val(progress); - - if (task.State == 'Running') { - progressElem.show(); - } else { - progressElem.hide(); - } - - var lastResult = task.LastExecutionResult ? task.LastExecutionResult.Status : ''; - - if (lastResult == "Failed") { - $('.lastRefreshResult', page).html('' + Globalize.translate('LabelFailed') + ''); - } - else if (lastResult == "Cancelled") { - $('.lastRefreshResult', page).html('' + Globalize.translate('LabelCancelled') + ''); - } - else if (lastResult == "Aborted") { - $('.lastRefreshResult', page).html('' + Globalize.translate('LabelAbortedByServerShutdown') + ''); - } else { - $('.lastRefreshResult', page).html(lastResult); - } - } - - function onWebSocketMessage(e, msg) { - - if (msg.MessageType == "ScheduledTasksInfo") { - - var tasks = msg.Data; - - var page = $.mobile.activePage; - - updateTasks(page, tasks); - } - } - - $(document).on('pageinit', "#mediaLibraryPage", function () { + $(document).on('pageshow', "#mediaLibraryPage", function () { var page = this; - $('.btnRefresh', page).on('click', function () { - - var button = this; - var id = button.getAttribute('data-taskid'); - - ApiClient.startScheduledTask(id).done(function () { - - pollTasks(page); - }); - - }); - - }).on('pageshow', "#mediaLibraryPage", function () { - - var page = this; - - $('.refreshLibraryPanel', page).addClass('hide'); - - pollTasks(page); - - var apiClient = ApiClient; - - if (apiClient.isWebSocketOpen()) { - apiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000"); - } - - $(apiClient).on("websocketmessage", onWebSocketMessage).on('websocketopen', function () { - - if (apiClient.isWebSocketOpen()) { - apiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000"); - } + // on here + $('.btnRefresh', page).taskButton({ + mode: 'on', + progressElem: $('.refreshProgress', page), + lastResultElem: $('.lastRefreshResult', page), + taskKey: 'RefreshLibrary' }); }).on('pagehide', "#mediaLibraryPage", function () { var page = this; - var apiClient = ApiClient; + // off here + $('.btnRefresh', page).taskButton({ + mode: 'off' + }); - if (apiClient.isWebSocketOpen()) { - apiClient.sendWebSocketMessage("ScheduledTasksInfoStop"); - } - - $(apiClient).off("websocketmessage", onWebSocketMessage); }); })(jQuery, document, window); + +$.fn.taskButton = function (options) { + + function pollTasks(button) { + + ApiClient.getScheduledTasks().done(function (tasks) { + + updateTasks(button, tasks); + }); + + } + + function updateTasks(button, tasks) { + + var task = tasks.filter(function (t) { + + return t.Key == options.taskKey; + + })[0]; + + button.buttonEnabled(task.State == 'Idle').attr('data-taskid', task.Id); + + var progress = (task.CurrentProgressPercentage || 0).toFixed(1); + + if (options.progressElem) { + var progressElem = options.progressElem.val(progress); + + if (task.State == 'Running') { + progressElem.show(); + } else { + progressElem.hide(); + } + } + + if (options.lastResultElem) { + var lastResult = task.LastExecutionResult ? task.LastExecutionResult.Status : ''; + + if (lastResult == "Failed") { + options.lastResultElem.html('' + Globalize.translate('LabelFailed') + ''); + } + else if (lastResult == "Cancelled") { + options.lastResultElem.html('' + Globalize.translate('LabelCancelled') + ''); + } + else if (lastResult == "Aborted") { + options.lastResultElem.html('' + Globalize.translate('LabelAbortedByServerShutdown') + ''); + } else { + options.lastResultElem.html(lastResult); + } + } + } + + var self = this; + + if (options.mode == 'off') { + + if (ApiClient.isWebSocketOpen()) { + ApiClient.sendWebSocketMessage("ScheduledTasksInfoStop"); + } + + $(ApiClient).off(".taskbutton"); + + } else { + + this.on('click', function () { + + var button = this; + var id = button.getAttribute('data-taskid'); + + ApiClient.startScheduledTask(id).done(function () { + + pollTasks(self); + }); + + }); + + pollTasks(self); + + if (ApiClient.isWebSocketOpen()) { + ApiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000"); + } + + $(ApiClient).on("websocketmessage.taskbutton", function (e, msg) { + + if (msg.MessageType == "ScheduledTasksInfo") { + + var tasks = msg.Data; + + updateTasks(self, tasks); + } + + }).on('websocketopen.taskbutton', function () { + + if (ApiClient.isWebSocketOpen()) { + ApiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000"); + } + }); + } + + return this; +}; \ No newline at end of file diff --git a/dashboard-ui/scripts/syncactivity.js b/dashboard-ui/scripts/syncactivity.js index 9dab975f4c..ebd348735b 100644 --- a/dashboard-ui/scripts/syncactivity.js +++ b/dashboard-ui/scripts/syncactivity.js @@ -246,6 +246,25 @@ reloadData(page); + // on here + $('.btnSync', page).taskButton({ + mode: 'on', + progressElem: $('.syncProgress', page), + taskKey: 'SyncPrepare' + }); + + + }).on('pagehide', ".syncActivityPage", function () { + + var page = this; + + reloadData(page); + + // off here + $('.btnSync', page).taskButton({ + mode: 'off' + }); + }); })(); \ No newline at end of file diff --git a/dashboard-ui/syncactivity.html b/dashboard-ui/syncactivity.html index 89e5d3f50f..021768ae0a 100644 --- a/dashboard-ui/syncactivity.html +++ b/dashboard-ui/syncactivity.html @@ -14,6 +14,11 @@ ${TabSettings}
  • +
    + + +
    +