new task page supports "url" parameter
This commit is contained in:
parent
ce176af552
commit
6ea534e6d6
|
@ -1,8 +1,9 @@
|
||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'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 tabOrders = ['links', 'options'];
|
||||||
|
var parameters = $location.search();
|
||||||
|
|
||||||
var downloadByLinks = function (pauseOnAdded, responseCallback) {
|
var downloadByLinks = function (pauseOnAdded, responseCallback) {
|
||||||
var urls = ariaNgCommonService.parseUrlsFromOriginInput($scope.context.urls);
|
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) {
|
$scope.changeTab = function (tabName) {
|
||||||
if (tabName === 'options') {
|
if (tabName === 'options') {
|
||||||
$scope.loadDefaultOption();
|
$scope.loadDefaultOption();
|
||||||
|
|
Reference in a new issue