Skip to content

Commit

Permalink
new task page supports "url" parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
mayswind committed Oct 14, 2017
1 parent ce176af commit 6ea534e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/scripts/controllers/new.js
Original file line number Diff line number Diff line change
@@ -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);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 6ea534e

Please sign in to comment.