MediaWiki:Gadget-ProtectionIndicator.js
Билгалдаккхар: Ӏалашйинчул тӀаьхьа хийцамаш га браузеран кэш цӀанйан йезаш хила мега.
- Firefox / Safari: Shift тӀетаӀийна йитина, гӀирсийн панелан тӀера тӀетаӀайе Карлайаккха йа Ctrl+F5 йа Ctrl+R (⌘+R Mac тӀехь)
- Google Chrome: тӀетаӀайе Ctrl+Shift+R (⌘+Shift+R Mac тӀехь)
- Internet Explorer / Edge: тӀетаӀийна йитина Ctrl, тӀетаӀайе Карлайаккха йа тӀетаӀайе Ctrl+F5
- Opera: тӀетаӀайе Ctrl+F5.
( function ( mw, $ ) {
function setMessages() {
switch ( mw.config.get( 'wgUserLanguage' ) ) {
default:
case 'ce':
mw.messages.set( {
'gadget-protection-autoconfirmed': 'ХӀара агӀо ах ларйина йу',
'gadget-protection-editprotected': 'ХӀара агӀо йуьззина ларйина йу'
} );
break;
case 'ru':
mw.messages.set( {
'gadget-protection-autoconfirmed': 'Эта страница частично защищена',
'gadget-protection-editprotected': 'Эта страница полностью защищена'
} );
break;
}
}
function init() {
if (mw.config.get( 'wgIsMainPage' ))
return;
var restrictions = mw.config.get( 'wgRestrictionEdit' ),
action = mw.config.get( 'wgAction' );
if ( action === 'view' && restrictions !== null && restrictions.length > 0 ) {
var $indicators = $( '.mw-indicators' ).first();
protectLevel = null;
if ( $indicators.find( '#mw-indicator-protected' ).length > 0 ) {
return;
}
setMessages();
if ( restrictions.indexOf( 'sysop' ) !== -1 ) {
protectLevel = 'editprotected';
} else if ( restrictions.indexOf( 'autoconfirmed' ) !== -1 ) {
protectLevel = 'autoconfirmed';
}
var protectText = mw.msg( 'gadget-protection-' + protectLevel );
$( '<div>' )
.addClass( 'mw-indicator mw-indicator-protect' )
.attr( {
id: 'mw-indicator-protect-' + protectLevel,
title: protectText,
alt: protectText
} )
.appendTo( $indicators );
}
}
$( init );
}( mediaWiki, jQuery ) );