mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-28 23:44:32 +00:00
Add Web UI support for escape key
This commit is contained in:
parent
7e98035df5
commit
74a772aafb
@ -11,16 +11,23 @@
|
||||
'use strict';
|
||||
|
||||
window.addEvent('domready', function() {
|
||||
var setLocationKeyboardEvents = new Keyboard({
|
||||
new Keyboard({
|
||||
defaultEventType: 'keydown',
|
||||
events: {
|
||||
'enter': function(event) {
|
||||
$('addTrackersButton').click();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Escape': function(event) {
|
||||
window.parent.closeWindows();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Esc': function(event) {
|
||||
window.parent.closeWindows();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
setLocationKeyboardEvents.activate();
|
||||
}).activate();
|
||||
|
||||
$('trackersUrls').focus();
|
||||
$('addTrackersButton').addEvent('click', function(e) {
|
||||
|
@ -55,10 +55,30 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<input type="button" value="QBT_TR(Apply)QBT_TR[CONTEXT=HttpServer]" onclick="setDlLimit()" />
|
||||
<input type="button" id="applyButton" value="QBT_TR(Apply)QBT_TR[CONTEXT=HttpServer]" onclick="setDlLimit()" />
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Keyboard({
|
||||
defaultEventType: 'keydown',
|
||||
events: {
|
||||
'enter': function(event) {
|
||||
$('applyButton').click();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Escape': function(event) {
|
||||
window.parent.closeWindows();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Esc': function(event) {
|
||||
window.parent.closeWindows();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
}).activate();
|
||||
|
||||
$('dllimitUpdatevalue').focus();
|
||||
|
||||
MochaUI.addDlLimitSlider(hashes);
|
||||
</script>
|
||||
|
||||
|
@ -11,16 +11,23 @@
|
||||
'use strict';
|
||||
|
||||
window.addEvent('domready', function() {
|
||||
var setLocationKeyboardEvents = new Keyboard({
|
||||
new Keyboard({
|
||||
defaultEventType: 'keydown',
|
||||
events: {
|
||||
'enter': function(event) {
|
||||
$('editTrackerButton').click();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Escape': function(event) {
|
||||
window.parent.closeWindows();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Esc': function(event) {
|
||||
window.parent.closeWindows();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
setLocationKeyboardEvents.activate();
|
||||
}).activate();
|
||||
|
||||
var currentUrl = new URI().getData('url');
|
||||
if (!currentUrl)
|
||||
|
@ -30,7 +30,7 @@
|
||||
'use strict';
|
||||
|
||||
var initInstallSearchPlugin = function() {
|
||||
var installSearchPluginKeyboardEvents = new Keyboard({
|
||||
new Keyboard({
|
||||
defaultEventType: 'keydown',
|
||||
events: {
|
||||
'enter': function(e) {
|
||||
@ -44,8 +44,7 @@
|
||||
closeSearchWindow('installSearchPlugin');
|
||||
}
|
||||
}
|
||||
});
|
||||
installSearchPluginKeyboardEvents.activate();
|
||||
}).activate();
|
||||
|
||||
$('newPluginPath').select();
|
||||
};
|
||||
|
@ -11,16 +11,23 @@
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
var newCategoryKeyboardEvents = new Keyboard({
|
||||
new Keyboard({
|
||||
defaultEventType: 'keydown',
|
||||
events: {
|
||||
'enter': function(event) {
|
||||
$('categoryNameButton').click();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Escape': function(event) {
|
||||
window.parent.closeWindows();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Esc': function(event) {
|
||||
window.parent.closeWindows();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
newCategoryKeyboardEvents.activate();
|
||||
}).activate();
|
||||
|
||||
window.addEvent('domready', function() {
|
||||
var uriAction = safeTrim(new URI().getData('action'));
|
||||
|
@ -11,16 +11,23 @@
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
var renameKeyboardEvents = new Keyboard({
|
||||
new Keyboard({
|
||||
defaultEventType: 'keydown',
|
||||
events: {
|
||||
'enter': function(event) {
|
||||
$('renameButton').click();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Escape': function(event) {
|
||||
window.parent.closeWindows();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Esc': function(event) {
|
||||
window.parent.closeWindows();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
renameKeyboardEvents.activate();
|
||||
}).activate();
|
||||
|
||||
window.addEvent('domready', function() {
|
||||
var name = new URI().getData('name');
|
||||
|
@ -824,7 +824,7 @@ function setupCopyEventHandler() {
|
||||
});
|
||||
}
|
||||
|
||||
var keyboardEvents = new Keyboard({
|
||||
new Keyboard({
|
||||
defaultEventType: 'keydown',
|
||||
events: {
|
||||
'ctrl+a': function(event) {
|
||||
@ -836,6 +836,4 @@ var keyboardEvents = new Keyboard({
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
keyboardEvents.activate();
|
||||
}).activate();
|
||||
|
@ -199,7 +199,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
var searchKeyboardEvents = new Keyboard({
|
||||
new Keyboard({
|
||||
defaultEventType: 'keydown',
|
||||
events: {
|
||||
'enter': function(e) {
|
||||
@ -228,8 +228,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
searchKeyboardEvents.activate();
|
||||
}).activate();
|
||||
};
|
||||
|
||||
var startSearch = function(pattern, category, plugins) {
|
||||
|
@ -11,16 +11,23 @@
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
var setLocationKeyboardEvents = new Keyboard({
|
||||
new Keyboard({
|
||||
defaultEventType: 'keydown',
|
||||
events: {
|
||||
'enter': function(event) {
|
||||
$('setLocationButton').click();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Escape': function(event) {
|
||||
window.parent.closeWindows();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Esc': function(event) {
|
||||
window.parent.closeWindows();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
setLocationKeyboardEvents.activate();
|
||||
}).activate();
|
||||
|
||||
window.addEvent('domready', function() {
|
||||
var path = new URI().getData('path');
|
||||
|
@ -14,16 +14,23 @@
|
||||
var UseGlobalLimit = -2;
|
||||
var NoLimit = -1;
|
||||
|
||||
var keyboardEvents = new Keyboard({
|
||||
new Keyboard({
|
||||
defaultEventType: 'keydown',
|
||||
events: {
|
||||
'enter': function(event) {
|
||||
$('save').click();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Escape': function(event) {
|
||||
window.parent.closeWindows();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Esc': function(event) {
|
||||
window.parent.closeWindows();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
keyboardEvents.activate();
|
||||
}).activate();
|
||||
|
||||
window.addEvent('domready', function() {
|
||||
var hashesList = new URI().getData('hashes').split('|');
|
||||
|
@ -55,10 +55,30 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<input type="button" value="QBT_TR(Apply)QBT_TR[CONTEXT=HttpServer]" onclick="setUpLimit()" />
|
||||
<input type="button" id="applyButton" value="QBT_TR(Apply)QBT_TR[CONTEXT=HttpServer]" onclick="setUpLimit()" />
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Keyboard({
|
||||
defaultEventType: 'keydown',
|
||||
events: {
|
||||
'enter': function(event) {
|
||||
$('applyButton').click();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Escape': function(event) {
|
||||
window.parent.closeWindows();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Esc': function(event) {
|
||||
window.parent.closeWindows();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
}).activate();
|
||||
|
||||
$('uplimitUpdatevalue').focus();
|
||||
|
||||
MochaUI.addUpLimitSlider(hashes);
|
||||
</script>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user