diff --git a/src/scripts/controllers/settings-ariang.js b/src/scripts/controllers/settings-ariang.js index 85dd036..b2ee8f5 100644 --- a/src/scripts/controllers/settings-ariang.js +++ b/src/scripts/controllers/settings-ariang.js @@ -99,6 +99,11 @@ } }; + $scope.isSupportNotification = function () { + return ariaNgNotificationService.isSupportBrowserNotification() && + ariaNgSettingService.isCurrentRpcUseWebSocket($scope.context.settings.protocol); + }; + $scope.setLanguage = function (value) { if (ariaNgSettingService.setLanguage(value)) { ariaNgLocalizationService.applyLanguage(value); @@ -107,19 +112,6 @@ $scope.updateTitlePreview(); }; - $scope.setRPCListDisplayOrder = function (value) { - setNeedRefreshPage(); - ariaNgSettingService.setRPCListDisplayOrder(value); - }; - - $scope.setAfterCreatingNewTask = function (value) { - ariaNgSettingService.setAfterCreatingNewTask(value); - }; - - $scope.setRemoveOldTaskAfterRestarting = function (value) { - ariaNgSettingService.setRemoveOldTaskAfterRestarting(value); - }; - $scope.setDebugMode = function (value) { ariaNgSettingService.setDebugMode(value); }; @@ -128,16 +120,6 @@ ariaNgSettingService.setTitle(value); }; - $scope.setTitleRefreshInterval = function (value) { - setNeedRefreshPage(); - ariaNgSettingService.setTitleRefreshInterval(value); - }; - - $scope.isSupportNotification = function () { - return ariaNgNotificationService.isSupportBrowserNotification() && - ariaNgSettingService.isCurrentRpcUseWebSocket($scope.context.settings.protocol); - }; - $scope.setEnableBrowserNotification = function (value) { ariaNgSettingService.setBrowserNotification(value); @@ -151,6 +133,11 @@ } }; + $scope.setTitleRefreshInterval = function (value) { + setNeedRefreshPage(); + ariaNgSettingService.setTitleRefreshInterval(value); + }; + $scope.setGlobalStatRefreshInterval = function (value) { setNeedRefreshPage(); ariaNgSettingService.setGlobalStatRefreshInterval(value); @@ -161,6 +148,19 @@ ariaNgSettingService.setDownloadTaskRefreshInterval(value); }; + $scope.setRPCListDisplayOrder = function (value) { + setNeedRefreshPage(); + ariaNgSettingService.setRPCListDisplayOrder(value); + }; + + $scope.setAfterCreatingNewTask = function (value) { + ariaNgSettingService.setAfterCreatingNewTask(value); + }; + + $scope.setRemoveOldTaskAfterRestarting = function (value) { + ariaNgSettingService.setRemoveOldTaskAfterRestarting(value); + }; + $scope.addNewRpcSetting = function () { setNeedRefreshPage(); diff --git a/src/scripts/services/ariaNgSettingService.js b/src/scripts/services/ariaNgSettingService.js index 96208bb..3eb1069 100644 --- a/src/scripts/services/ariaNgSettingService.js +++ b/src/scripts/services/ariaNgSettingService.js @@ -287,12 +287,30 @@ setTitle: function (value) { setOption('title', value); }, + getBrowserNotification: function () { + return getOption('browserNotification'); + }, + setBrowserNotification: function (value) { + setOption('browserNotification', value); + }, getTitleRefreshInterval: function () { return getOption('titleRefreshInterval'); }, setTitleRefreshInterval: function (value) { setOption('titleRefreshInterval', Math.max(parseInt(value), 0)); }, + getGlobalStatRefreshInterval: function () { + return getOption('globalStatRefreshInterval'); + }, + setGlobalStatRefreshInterval: function (value) { + setOption('globalStatRefreshInterval', Math.max(parseInt(value), 0)); + }, + getDownloadTaskRefreshInterval: function () { + return getOption('downloadTaskRefreshInterval'); + }, + setDownloadTaskRefreshInterval: function (value) { + setOption('downloadTaskRefreshInterval', Math.max(parseInt(value), 0)); + }, getRPCListDisplayOrder: function () { return getOption('rpcListDisplayOrder'); }, @@ -311,12 +329,6 @@ setRemoveOldTaskAfterRestarting: function (value) { setOption('removeOldTaskAfterRestarting', value); }, - getBrowserNotification: function () { - return getOption('browserNotification'); - }, - setBrowserNotification: function (value) { - setOption('browserNotification', value); - }, getCurrentRpcDisplayName: function () { var options = getOptions(); @@ -503,18 +515,6 @@ return true; }, - getGlobalStatRefreshInterval: function () { - return getOption('globalStatRefreshInterval'); - }, - setGlobalStatRefreshInterval: function (value) { - setOption('globalStatRefreshInterval', Math.max(parseInt(value), 0)); - }, - getDownloadTaskRefreshInterval: function () { - return getOption('downloadTaskRefreshInterval'); - }, - setDownloadTaskRefreshInterval: function (value) { - setOption('downloadTaskRefreshInterval', Math.max(parseInt(value), 0)); - }, getDisplayOrder: function () { var value = getOption('displayOrder'); diff --git a/src/views/settings-ariang.html b/src/views/settings-ariang.html index 39ae6ac..11f9043 100644 --- a/src/views/settings-ariang.html +++ b/src/views/settings-ariang.html @@ -64,6 +64,18 @@ [Preview] +
+
+ Enable Browser Notification +
+
+ +
+
Page Title Refresh Interval @@ -77,18 +89,6 @@
-
-
- Enable Browser Notification -
-
- -
-
Global Stat Refresh Interval