From 2c29a52afb48c2b597057994dbd9e1c098110c55 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sat, 13 Aug 2016 22:51:42 +0800 Subject: [PATCH] split ariang settings into global and RPC settings --- src/langs/zh_CN.txt | 4 +- src/scripts/config/defaultLanguage.js | 2 + src/scripts/controllers/settings-ariang.js | 30 +++ src/views/settings-ariang.html | 262 ++++++++++++--------- 4 files changed, 182 insertions(+), 116 deletions(-) diff --git a/src/langs/zh_CN.txt b/src/langs/zh_CN.txt index 0340e97..a0aa52a 100644 --- a/src/langs/zh_CN.txt +++ b/src/langs/zh_CN.txt @@ -7,6 +7,8 @@ Confirm=确认 Cancel=取消 True=是 False=否 +Global=全局 +RPC=RPC New=新建 Start=开始下载任务 Pause=暂停下载任务 @@ -499,4 +501,4 @@ socket-recv-buffer-size.description=设置 Socket 接收缓冲区最大的字节 stop.name=自动关闭时间 stop.description=在此选项设置的时间(秒)后关闭应用. 如果设置为 0, 此功能将禁用. truncate-console-readout.name=缩短控制台输出内容 -truncate-console-readout.description=缩短控制台输出的内容在一行中. \ No newline at end of file +truncate-console-readout.description=缩短控制台输出的内容在一行中. diff --git a/src/scripts/config/defaultLanguage.js b/src/scripts/config/defaultLanguage.js index 277fb0e..a6837e0 100644 --- a/src/scripts/config/defaultLanguage.js +++ b/src/scripts/config/defaultLanguage.js @@ -11,6 +11,8 @@ 'Cancel': 'Cancel', 'True': 'True', 'False': 'False', + 'Global': 'Global', + 'RPC': 'RPC', 'New': 'New', 'Start': 'Start', 'Pause': 'Pause', diff --git a/src/scripts/controllers/settings-ariang.js b/src/scripts/controllers/settings-ariang.js index 5ac2388..2df4cac 100644 --- a/src/scripts/controllers/settings-ariang.js +++ b/src/scripts/controllers/settings-ariang.js @@ -2,13 +2,43 @@ 'use strict'; angular.module('ariaNg').controller('AriaNgSettingsController', ['$rootScope', '$scope', '$timeout', 'ariaNgLanguages', 'ariaNgCommonService', 'ariaNgSettingService', 'ariaNgNotificationService', function ($rootScope, $scope, $timeout, ariaNgLanguages, ariaNgCommonService, ariaNgSettingService, ariaNgNotificationService) { + var tabOrders = ['global', 'rpc']; + $scope.context = { + currentTab: 'global', languages: ariaNgLanguages, availableTime: ariaNgCommonService.getTimeOptions([1000, 2000, 3000, 5000, 10000, 30000, 60000], true), trueFalseOptions: [{name: 'True', value: true}, {name: 'False', value: false}], settings: ariaNgSettingService.getAllOptions() }; + + $scope.changeTab = function (tabName) { + $scope.context.currentTab = tabName; + }; + + $rootScope.swipeActions.extentLeftSwipe = function () { + var tabIndex = tabOrders.indexOf($scope.context.currentTab); + + if (tabIndex < tabOrders.length - 1) { + $scope.changeTab(tabOrders[tabIndex + 1]); + return true; + } else { + return false; + } + }; + + $rootScope.swipeActions.extentRightSwipe = function () { + var tabIndex = tabOrders.indexOf($scope.context.currentTab); + + if (tabIndex > 0) { + $scope.changeTab(tabOrders[tabIndex - 1]); + return true; + } else { + return false; + } + }; + $scope.settingService = ariaNgSettingService; $scope.isSupportNotification = function () { diff --git a/src/views/settings-ariang.html b/src/views/settings-ariang.html index 833d89a..3ebd6b5 100644 --- a/src/views/settings-ariang.html +++ b/src/views/settings-ariang.html @@ -1,122 +1,154 @@
-
-
-
- Language +