User:Zabshk/heading-icons.js: Difference between revisions
m
Zabshk moved page User:Zabshk/vector.js to User:Zabshk/heading-icons.js without leaving a redirect: Move to script page
No edit summary |
m (Zabshk moved page User:Zabshk/vector.js to User:Zabshk/heading-icons.js without leaving a redirect: Move to script page) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 17:
'msg-semi-protection': 'Only autoconfirmed users can edit this page (semi protection).',
'msg-full-protection': 'Only administrators users can edit this page (full protection).',
'msg-other-protection': 'This page is protected on non-standard protection level.',
} );
Line 63 ⟶ 64:
/**
* Shows padlock in the right corner
* when page is protected
*/
headingIconGadget.padlockIcon = function() {
//
if ( mw.config.get( 'wgTitle' ) == mw.config.get( 'wgMainPageTitle' ) ) {
return;
}
//
var wgRestrictionEdit = mw.config.get( 'wgRestrictionEdit' );
if ( wgRestrictionEdit == null || wgRestrictionEdit.length < 1 || wgRestrictionEdit[0] == "" ) {
Line 78 ⟶ 79:
}
//
if ( mw.util.getParamValue( 'printable' ) == 'yes' ) {
return;
Line 86 ⟶ 87:
if ( wgRestrictionEdit[0] == "autoconfirmed" ) {
img.src = "//upload.wikimedia.org/wikipedia/commons/thumb/8/8a/Padlock-green.svg/22px-Padlock-green.svg.png";
img.title = mw.msg( 'msg-
img.src = "//upload.wikimedia.org/wikipedia/commons/thumb/e/e0/Padlock-gold.svg/22px-Padlock-gold.svg.png";▼
img.title = mw.msg( 'msg-medium-protection' );▼
} else if ( wgRestrictionEdit[0] == "sysop" ) {
img.src = "//upload.wikimedia.org/wikipedia/commons/thumb/4/48/Padlock-red.svg/22px-Padlock-red.svg.png";
img.title = mw.msg( 'msg-
} else {
▲
}
img.alt = "padlock";
|