From de4bebf9ce1e9dbf2a1323c983666656bb618f8d Mon Sep 17 00:00:00 2001 From: MaysWind Date: Thu, 23 Jun 2016 22:40:53 +0800 Subject: [PATCH] support add magnet link --- src/scripts/controllers/new.js | 6 +++++- src/views/new.html | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/scripts/controllers/new.js b/src/scripts/controllers/new.js index 8ac5fac..08bacac 100644 --- a/src/scripts/controllers/new.js +++ b/src/scripts/controllers/new.js @@ -64,6 +64,10 @@ var tasks = []; for (var i = 0; i < urls.length; i++) { + if (urls[i] == '' || urls[i].trim() == '') { + continue; + } + tasks.push({ urls: [urls[i].trim()], options: options @@ -92,7 +96,7 @@ optionStatus.setReady(); }; - + $rootScope.loadPromise = $timeout(function () { ;//Do Nothing }, 100); diff --git a/src/views/new.html b/src/views/new.html index f561ccb..702b2ea 100644 --- a/src/views/new.html +++ b/src/views/new.html @@ -19,7 +19,7 @@
+ ng-pattern="/^(\n?(((http|https|ftp|ssh):\/\/.+)|(magnet:\?.+)))*$/i">