MediaWiki:Common.js: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
if (mw.config.get("wgAction") == "edit") { | if (mw.config.get("wgAction") == "edit") { | ||
mw.loader.load( 'https://codemirror.net/3/addon/comment/comment.js' ); | mw.loader.load( 'https://codemirror.net/3/addon/comment/comment.js' ); | ||
const customKeyMap = { | const customKeyMap = { | ||
"Ctrl-/": "toggleComment" | "Ctrl-/": "toggleComment" | ||
}; | }; | ||
CodeMirror.keyMap.pcDefault[ 'Ctrl-/' ] = "toggleComment"; | |||
} | } |
Revision as of 19:25, 16 April 2020
/* Any JavaScript here will be loaded for all users on every page load. */
if (mw.config.get("wgAction") == "edit") {
mw.loader.load( 'https://codemirror.net/3/addon/comment/comment.js' );
const customKeyMap = {
"Ctrl-/": "toggleComment"
};
CodeMirror.keyMap.pcDefault[ 'Ctrl-/' ] = "toggleComment";
}