MediaWiki:Gadget-global-constants.js: Unterschied zwischen den Versionen
Aus Stupidedia, der sinnfreien Enzyklopädie!
Uebel (Diskussion | Beiträge) (Änderung 2445608 von Uebel (Diskussion) rückgängig gemacht.) |
Uebel (Diskussion | Beiträge) |
||
Zeile 13: | Zeile 13: | ||
global.pageExists = ( mw.config.get( 'wgArticleId' ) !== 0 ); | global.pageExists = ( mw.config.get( 'wgArticleId' ) !== 0 ); | ||
− | global.protection = new Object(); | + | // global.protection = new Object(); |
− | $.each( ['award', 'create', 'edit', 'move', 'upload'], function() { | + | // $.each( ['award', 'create', 'edit', 'move', 'upload'], function() { |
− | global.protection[this] = '*'; | + | // global.protection[this] = '*'; |
− | if ( mw.config.get( 'wgRestriction' + $.ucFirst( this ) ) !== null ) { | + | // if ( mw.config.get( 'wgRestriction' + $.ucFirst( this ) ) !== null ) { |
− | if ( mw.config.get( 'wgRestriction' + $.ucFirst( this ) ).length !== 0 ) { | + | // if ( mw.config.get( 'wgRestriction' + $.ucFirst( this ) ).length !== 0 ) { |
− | global.protection[this] = mw.config.get( 'wgRestriction' + $.ucFirst( this ) )[0]; | + | // global.protection[this] = mw.config.get( 'wgRestriction' + $.ucFirst( this ) )[0]; |
− | } | + | // } |
− | } | + | // } |
− | } ); | + | // } ); |
// Textfeld und Zusammenfassung | // Textfeld und Zusammenfassung |
Aktuelle Version vom 8. März 2018, 18:59 Uhr
/**
* Globale „Konstanten“ und sowas
*
* <nowiki>
*/
// Seitenstatus
global.isEditing = ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 && mw.config.get( 'wgNamespaceNumber' ) !== -1 ); // Sind wir am Bearbeiten?
global.isArticle = ( $.inArray( mw.config.get( 'wgNamespaceNumber' ), [0, 102, 104, 106] ) !== -1 ); // Handelt es sich um einen Artikel?
global.isTalkpage = ( mw.config.get( 'wgNamespaceNumber' ) % 2 === 1 && mw.config.get( 'wgNamespaceNumber' ) !== -1 ); // Oder um eine Diskussionsseite?
global.isSubjectpage = !global.isTalkpage;
global.isSpecialpage = ( mw.config.get( 'wgNamespaceNumber' ) === -1 );
global.pageExists = ( mw.config.get( 'wgArticleId' ) !== 0 );
// global.protection = new Object();
// $.each( ['award', 'create', 'edit', 'move', 'upload'], function() {
// global.protection[this] = '*';
// if ( mw.config.get( 'wgRestriction' + $.ucFirst( this ) ) !== null ) {
// if ( mw.config.get( 'wgRestriction' + $.ucFirst( this ) ).length !== 0 ) {
// global.protection[this] = mw.config.get( 'wgRestriction' + $.ucFirst( this ) )[0];
// }
// }
// } );
// Textfeld und Zusammenfassung
global.textbox = document.getElementById( 'wpTextbox1' );
global.summary = document.getElementById( 'wpSummary' );
// Benutzergruppen
global.groups = new Object();
global.groups.all = mw.config.get( 'wgUserGroups' );
global.groups.names = {
'*': 'Alle',
user: 'Benutzer',
autoconfirmed: 'Automatisch bestätigte Benutzer',
hda: 'Helden der Arbeit',
f: 'Funktionäre',
sysop: 'Diktatoren',
checkuser: 'Checker',
bureaucrat: 'Bürokraten',
bot: 'Bots',
developer: 'Systemadministratoren'
};
$.each( ['*', 'user', 'autoconfirmed', 'hda', 'f', 'sysop', 'checkuser', 'bureaucrat', 'bot', 'developer'], function() {
global.groups[this] = ( $.inArray( this.toString(), global.groups.all ) !== -1 );
} );
// Tokens
global.editToken = mw.user.tokens.get( 'editToken' );
global.watchToken = mw.user.tokens.get( 'watchToken' );
// Dateipfade
global.fileSources = {};
// Titelobjekte
global.titleObjects = {};
// Signaturcode
global.signature = $.parseJSON( mw.user.options.get( 'userjs-signature' ) ) || '— [[Benutzer:Uebel|Uebel]] ([[Benutzer Diskussion:Uebel|Diskussion]]) 17:56, 8. Mär. 2018 (CET)';