mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-03 08:10:58 -05:00
Desktop client: Support Ctrl+F/Cmd+F
This is very basic support just so people have a find command at all.
This commit is contained in:
16
js/client.js
16
js/client.js
@@ -514,7 +514,23 @@
|
||||
|
||||
// keypress happened in an empty textarea or a button
|
||||
var safeLocation = ((tagName === 'TEXTAREA' && !el.value.length) || tagName === 'BUTTON');
|
||||
var isMac = (navigator.userAgent.indexOf("Mac") !== -1);
|
||||
|
||||
if (e.keyCode === 70 && window.nodewebkit && (isMac ? e.metaKey : e.ctrlKey)) {
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
var query = window.getSelection().toString();
|
||||
query = window.prompt("find?", query);
|
||||
if (query) window.find(query);
|
||||
return;
|
||||
}
|
||||
if (e.keyCode === 71 && window.nodewebkit && (isMac ? e.metaKey : e.ctrlKey)) {
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
var query = window.getSelection().toString();
|
||||
if (query) window.find(query);
|
||||
return;
|
||||
}
|
||||
if (app.curSideRoom && $(e.target).closest(app.curSideRoom.$el).length) {
|
||||
// keypress happened in sideroom
|
||||
if (e.shiftKey && e.keyCode === 37 && safeLocation) {
|
||||
|
||||
Reference in New Issue
Block a user