MediaWiki:Common.js: Difference between revisions
m Protected "MediaWiki:Common.js" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) |
mNo edit summary Tag: Reverted |
||
| Line 6: | Line 6: | ||
$(this).closest('.dismissible-notice').hide(); | $(this).closest('.dismissible-notice').hide(); | ||
}); | }); | ||
}); | |||
$(function() { | |||
if (mw.config.get('wgCanonicalSpecialPageName') === 'Editcount') { | |||
var $editCountForm = $('form[name="editcount"]'); // Adjust selector if needed | |||
$editCountForm.on('submit', function(e) { | |||
e.preventDefault(); // Prevent the default form submission | |||
var username = $(this).find('input[name="wpUsername"]').val(); | |||
if (username) { | |||
window.location.href = mw.config.get('wgScriptPath') + '/index.php?title=Special:EditCount/' + encodeURIComponent(username); | |||
} | |||
}); | |||
} | |||
}); | }); | ||
Revision as of 22:30, 7 April 2025
/* Any JavaScript here will be loaded for all users on every page load. */
mw.loader.load( 'ext.cite.styles' );
$(document).ready(function() {
$('.dismissible-notice .dismiss-button').click(function() {
$(this).closest('.dismissible-notice').hide();
});
});
$(function() {
if (mw.config.get('wgCanonicalSpecialPageName') === 'Editcount') {
var $editCountForm = $('form[name="editcount"]'); // Adjust selector if needed
$editCountForm.on('submit', function(e) {
e.preventDefault(); // Prevent the default form submission
var username = $(this).find('input[name="wpUsername"]').val();
if (username) {
window.location.href = mw.config.get('wgScriptPath') + '/index.php?title=Special:EditCount/' + encodeURIComponent(username);
}
});
}
});