support pressing "ctrl+enter" shortcuts to start download in "new task" page
This commit is contained in:
parent
9d6dae708e
commit
c085dc7a88
|
@ -131,6 +131,12 @@
|
||||||
optionStatus.setReady();
|
optionStatus.setReady();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.urlTextboxKeyDown = function (event) {
|
||||||
|
if (event.keyCode == 13 && event.ctrlKey && $scope.newTaskForm.$valid) {
|
||||||
|
$scope.startDownload();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
$rootScope.loadPromise = $timeout(function () {
|
$rootScope.loadPromise = $timeout(function () {
|
||||||
;//Do Nothing
|
;//Do Nothing
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
|
@ -43,7 +43,8 @@
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<p translate>Download Links:</p>
|
<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 }">
|
<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-placeholder="'Support multiple URLs, one URL per line.' | translate"
|
||||||
ng-pattern="/^(\n?(((http|https|ftp|ssh):\/\/.+)|(magnet:\?.+)))*$/i"></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">
|
||||||
|
|
Reference in a new issue