Skip to content

Commit 89ec302

Browse files
committed
code refactor
1 parent 7c6b28c commit 89ec302

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/scripts/config/aria2Options.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
// [readonly: true|false,] //default: false
1010
// [defaultValue: '',]
1111
// [required: true|false,] //default: false
12-
// [split: '',] //SUPPORT 'text' type
12+
// [separator: '',] //SUPPORT 'text' type
1313
// [overrideMode: 'override|append',] //default: override
14-
// [submitFormat: 'string|array'] //default: string, parameter 'split' is required
15-
// [showCount: true|false,] //SUPPORT 'text' type, parameter 'split' is required, default: false
16-
// [trimCount: true|false,] //SUPPORT 'text' type, parameter 'split', 'showCount' is required, default: false
14+
// [submitFormat: 'string|array',] //default: string, parameter 'separator' is required
15+
// [showCount: true|false,] //SUPPORT 'text' type, parameter 'separator' is required, default: false
16+
// [trimCount: true|false,] //SUPPORT 'text' type, parameter 'separator', 'showCount' is required, default: false
1717
// [options: [],] //SUPPORT 'option' type
1818
// [min: 0,] //SUPPORT 'integer', 'float' type
1919
// [max: 0,] //SUPPORT 'integer', 'float' type
@@ -117,7 +117,7 @@
117117
},
118118
'no-proxy': {
119119
type: 'text',
120-
split: ',',
120+
separator: ',',
121121
showCount: true
122122
},
123123
'out': {
@@ -241,7 +241,7 @@
241241
},
242242
'header': {
243243
type: 'text',
244-
split: '\n',
244+
separator: '\n',
245245
overrideMode: 'append',
246246
submitFormat: 'array',
247247
showCount: true,
@@ -317,7 +317,7 @@
317317
},
318318
'bt-exclude-tracker': {
319319
type: 'text',
320-
split: ',',
320+
separator: ',',
321321
showCount: true
322322
},
323323
'bt-external-ip': {
@@ -401,7 +401,7 @@
401401
},
402402
'bt-tracker': {
403403
type: 'text',
404-
split: ',',
404+
separator: ',',
405405
showCount: true
406406
},
407407
'bt-tracker-connect-timeout': {

src/scripts/directives/setting.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@
177177
})();
178178

179179
scope.getTotalCount = function () {
180-
var fixedValueCount = getTotalCount(scope.fixedValue, scope.option.split, scope.option.trimCount);
181-
var inputValueCount = getTotalCount(scope.optionValue, scope.option.split, scope.option.trimCount);
180+
var fixedValueCount = getTotalCount(scope.fixedValue, scope.option.separator, scope.option.trimCount);
181+
var inputValueCount = getTotalCount(scope.optionValue, scope.option.separator, scope.option.trimCount);
182182

183183
return fixedValueCount + inputValueCount;
184184
};

src/scripts/services/aria2RpcService.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@
255255
};
256256

257257
var buildArrayOption = function (option, optionSetting) {
258-
var items = option.split(optionSetting.split);
258+
var items = option.split(optionSetting.separator);
259259
var result = [];
260260

261261
for (var i = 0; i < items.length; i++) {

src/views/setting.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<em ng-bind="'(' + option.key + ')'"></em>
55
<i class="icon-primary fa fa-question-circle" ng-if="(option.descriptionKey | translate) !== ''"
66
data-toggle="popover" data-trigger="hover" data-placement="auto top" data-container="body" data-content="{{option.descriptionKey | translate}}"></i>
7-
<span class="description" ng-if="option.showCount && option.split && (optionValue || fixedValue)"
7+
<span class="description" ng-if="option.showCount && option.separator && (optionValue || fixedValue)"
88
ng-bind="'format.settings.total-count' | translate: {count: getTotalCount()}"></span>
99
<i class="icon-primary fa fa-info-circle" ng-if="(option.since && option.since !== '')" ng-tooltip="{{('format.requires.aria2-version' | translate: {version: option.since})}}" ng-tooltip-container="body" ng-tooltip-placement="right"></i>
1010
</div>

0 commit comments

Comments
 (0)