View source for MediaWiki:Common.js
Jump to navigation
Jump to search
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
// Add navigational keybinds
mw.hook('wikipage.content').add(function(){
var config = mw.config.get(['wgAction']);
var actions = {
e: 'edit',
h: 'history',
m: 'move',
d: 'delete',
};
if (config.wgAction=='view') {
var newUrl = new URL(document.location.href);
$(document).on('keydown', function(e) {
var key = e.key.toLocaleLowerCase();
if (actions[key]) {
newUrl.searchParams.set('action', actions[key]);
document.location.href=newUrl.href;
}
});
}
});
000
1:0
Return to MediaWiki:Common.js.