MediaWiki:Common.js
Appearance
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios en cada carga de página */
/*function waitForMathJax($content) {
if (typeof MathJax === 'undefined') {
setTimeout(function () { waitForMathJax($content); }, 1000);
} else {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, $content[0]]).execute();
}
}
mw.hook('wikipage.content').add(waitForMathJax);
*/
var currentPageName = mw.config.get('wgPageName');
var userGroups = mw.config.get('wgUserGroups');
var requiredGroups = ['sysop', 'patroller'];
var groupAddReviewLink = false;
var appliesAddReviewLink = $('a[title="glossaLAB:In review"]').length > 0;
for (var i = 0; i < requiredGroups.length; i++) {
if (userGroups.includes(requiredGroups[i])) {
groupAddReviewLink = true;
break;
}
}
if (groupAddReviewLink && appliesAddReviewLink) {
mw.util.addPortletLink(
'p-views',
'/wiki/Special:FormEdit/Individual_rev?source=' + currentPageName,
'Add review',
'ca-add-review',
'Add new revision page to the article',
'd',
'#ca-history'
);
}