|
@@ -4,15 +4,14 @@ document.onkeyup = function(e) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
document.onkeypress = function(e) {
|
|
document.onkeypress = function(e) {
|
|
|
- let doc_shortcut = /^\/(w|history)\//i;
|
|
|
|
|
-
|
|
|
|
|
- shortcut_key_list[e.key] = 1;
|
|
|
|
|
|
|
+ let shortcut_check = event.target.tagName.toLowerCase();
|
|
|
if(
|
|
if(
|
|
|
- window.location.pathname.match(doc_shortcut) ||
|
|
|
|
|
- window.location.pathname === '/recent_change' ||
|
|
|
|
|
- window.location.pathname === '/recent_changes' ||
|
|
|
|
|
- window.location.pathname === '/recent_discuss'
|
|
|
|
|
|
|
+ shortcut_check !== 'input' &&
|
|
|
|
|
+ shortcut_check !== 'textarea'
|
|
|
) {
|
|
) {
|
|
|
|
|
+ let doc_shortcut = /^\/(w|history|edit|acl|topic|xref)\//i;
|
|
|
|
|
+
|
|
|
|
|
+ shortcut_key_list[e.key] = 1;
|
|
|
if(shortcut_key_list['f'] === 1) {
|
|
if(shortcut_key_list['f'] === 1) {
|
|
|
window.location.href = '/';
|
|
window.location.href = '/';
|
|
|
} else if(shortcut_key_list['c'] === 1) {
|
|
} else if(shortcut_key_list['c'] === 1) {
|
|
@@ -22,15 +21,15 @@ document.onkeypress = function(e) {
|
|
|
} else if(shortcut_key_list['a'] === 1) {
|
|
} else if(shortcut_key_list['a'] === 1) {
|
|
|
window.location.href = '/random';
|
|
window.location.href = '/random';
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if(window.location.pathname.match(doc_shortcut)) {
|
|
|
|
|
- if(shortcut_key_list['w'] === 1) {
|
|
|
|
|
- window.location.pathname = window.location.pathname.replace(doc_shortcut, '/w/');
|
|
|
|
|
- } else if(shortcut_key_list['e'] === 1) {
|
|
|
|
|
- window.location.pathname = window.location.pathname.replace(doc_shortcut, '/edit/');
|
|
|
|
|
- } else if(shortcut_key_list['h'] === 1) {
|
|
|
|
|
- window.location.pathname = window.location.pathname.replace(doc_shortcut, '/history/');
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if(window.location.pathname.match(doc_shortcut)) {
|
|
|
|
|
+ if(shortcut_key_list['w'] === 1) {
|
|
|
|
|
+ window.location.pathname = window.location.pathname.replace(doc_shortcut, '/w/');
|
|
|
|
|
+ } else if(shortcut_key_list['e'] === 1) {
|
|
|
|
|
+ window.location.pathname = window.location.pathname.replace(doc_shortcut, '/edit/');
|
|
|
|
|
+ } else if(shortcut_key_list['h'] === 1) {
|
|
|
|
|
+ window.location.pathname = window.location.pathname.replace(doc_shortcut, '/history/');
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|