support add magnet link

This commit is contained in:
MaysWind 2016-06-23 22:40:53 +08:00
parent 0428c1dc82
commit de4bebf9ce
2 changed files with 6 additions and 2 deletions

View file

@ -64,6 +64,10 @@
var tasks = []; var tasks = [];
for (var i = 0; i < urls.length; i++) { for (var i = 0; i < urls.length; i++) {
if (urls[i] == '' || urls[i].trim() == '') {
continue;
}
tasks.push({ tasks.push({
urls: [urls[i].trim()], urls: [urls[i].trim()],
options: options options: options

View file

@ -19,7 +19,7 @@
<div class="form-group has-feedback no-margin" ng-class="{ 'has-error' : newTaskForm.urls.$invalid && newTaskForm.urls.$dirty, 'has-success' : newTaskForm.urls.$valid && newTaskForm.urls.$dirty }"> <div class="form-group has-feedback no-margin" ng-class="{ 'has-error' : newTaskForm.urls.$invalid && newTaskForm.urls.$dirty, 'has-success' : newTaskForm.urls.$valid && newTaskForm.urls.$dirty }">
<textarea name="urls" class="form-control" rows="8" ng-model="context.urls" ng-required="true" <textarea name="urls" class="form-control" rows="8" ng-model="context.urls" ng-required="true"
ng-placeholder="'Support multiple URLs, one URL per line.' | translate" ng-placeholder="'Support multiple URLs, one URL per line.' | translate"
ng-pattern="/^(\n?(http|https|ftp|ssh):\/\/.+)*$/"></textarea> ng-pattern="/^(\n?(((http|https|ftp|ssh):\/\/.+)|(magnet:\?.+)))*$/i"></textarea>
<div class="form-control-icon" ng-if="newTaskForm.urls.$dirty"> <div class="form-control-icon" ng-if="newTaskForm.urls.$dirty">
<i class="fa form-control-feedback" ng-class="{'fa-check':newTaskForm.urls.$valid, 'fa-times':newTaskForm.urls.$invalid}"></i> <i class="fa form-control-feedback" ng-class="{'fa-check':newTaskForm.urls.$valid, 'fa-times':newTaskForm.urls.$invalid}"></i>
</div> </div>