new task page supports "url" parameter

This commit is contained in:
MaysWind 2017-10-14 19:57:58 +08:00
parent ce176af552
commit 6ea534e6d6

View file

@ -1,8 +1,9 @@
(function () {
'use strict';
angular.module('ariaNg').controller('NewTaskController', ['$rootScope', '$scope', '$location', '$timeout', 'ariaNgCommonService', 'ariaNgSettingService', 'ariaNgFileService', 'aria2SettingService', 'aria2TaskService', function ($rootScope, $scope, $location, $timeout, ariaNgCommonService, ariaNgSettingService, ariaNgFileService, aria2SettingService, aria2TaskService) {
angular.module('ariaNg').controller('NewTaskController', ['$rootScope', '$scope', '$location', '$timeout', 'base64', 'ariaNgCommonService', 'ariaNgLogService', 'ariaNgSettingService', 'ariaNgFileService', 'aria2SettingService', 'aria2TaskService', function ($rootScope, $scope, $location, $timeout, base64, ariaNgCommonService, ariaNgLogService, ariaNgSettingService, ariaNgFileService, aria2SettingService, aria2TaskService) {
var tabOrders = ['links', 'options'];
var parameters = $location.search();
var downloadByLinks = function (pauseOnAdded, responseCallback) {
var urls = ariaNgCommonService.parseUrlsFromOriginInput($scope.context.urls);
@ -62,6 +63,14 @@
}
};
if (parameters.url) {
try {
$scope.context.urls = base64.urldecode(parameters.url);
} catch (ex) {
ariaNgLogService.error('[NewTaskController] base64 decode error, url=' + parameters.url, ex);
}
}
$scope.changeTab = function (tabName) {
if (tabName === 'options') {
$scope.loadDefaultOption();