MediaWiki:Common.js: Difference between revisions
From Trickster Development Wiki
changed the code command mabye |
mNo edit summary |
||
| Line 2: | Line 2: | ||
$(document).keydown(function (e) { | $(document).keydown(function (e) { | ||
// Ctrl+Shift+C | // Ctrl+Shift+C | ||
if (e.ctrlKey && e.shiftKey && e.key.toLowerCase() === ' | if (e.ctrlKey && e.shiftKey && e.key.toLowerCase() === 'd') { | ||
// Prevent default browser behavior if any | // Prevent default browser behavior if any | ||
e.preventDefault(); | e.preventDefault(); | ||
| Line 13: | Line 13: | ||
} | } | ||
}); | }); | ||
/*That's to change the shitty Code command */ | /*That's to change the shitty Code command to Ctrl+Shift+D*/ | ||
Revision as of 19:47, 18 April 2026
/* Any JavaScript here will be loaded for all users on every page load. */
$(document).keydown(function (e) {
// Ctrl+Shift+C
if (e.ctrlKey && e.shiftKey && e.key.toLowerCase() === 'd') {
// Prevent default browser behavior if any
e.preventDefault();
// Trigger "Computer code" button
$('#wpTextbox1').textSelection(
'encapsulateSelection',
{ pre: '<code>', post: '</code>' }
);
}
});
/*That's to change the shitty Code command to Ctrl+Shift+D*/