support pressing "ctrl+enter" shortcuts to start download in "new task" page

master
MaysWind 2016-07-31 22:33:37 +08:00
parent 9d6dae708e
commit c085dc7a88
2 changed files with 8 additions and 1 deletions

View File

@ -131,6 +131,12 @@
optionStatus.setReady();
};
$scope.urlTextboxKeyDown = function (event) {
if (event.keyCode == 13 && event.ctrlKey && $scope.newTaskForm.$valid) {
$scope.startDownload();
}
};
$rootScope.loadPromise = $timeout(function () {
;//Do Nothing
}, 100);

View File

@ -43,7 +43,8 @@
<div class="col-sm-12">
<p translate>Download Links:</p>
<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="10" ng-model="context.urls" ng-required="true"
<textarea name="urls" class="form-control" rows="10"
ng-model="context.urls" ng-required="true" ng-keydown="urlTextboxKeyDown($event)"
ng-placeholder="'Support multiple URLs, one URL per line.' | translate"
ng-pattern="/^(\n?(((http|https|ftp|ssh):\/\/.+)|(magnet:\?.+)))*$/i"></textarea>
<div class="form-control-icon" ng-if="newTaskForm.urls.$dirty">