Hilf mit!
Lustenauer Wiki ist 15 Jahre alt, vielleicht schaffen wir es ja dieser Seite nochmal etwas leben einzuhauchen ...
MediaWiki:Common.js: Unterschied zwischen den Versionen
Aus Lustenauer Wiki
(Eine dazwischenliegende Version von einem anderen Benutzer wird nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
− | + | /* Jedes JavaScript hier wird für alle Benutzer für jede Seite geladen. */ | |
− | + | ||
− | + | /** | |
− | + | * Sortierung von Umlauten und ß auch ohne [[Vorlage:SortKey]] ermöglichen | |
− | + | * For jquery.tablesorter.js | |
− | + | */ | |
− | + | mw.config.set( 'tableSorterCollation', {'Ä':'A', 'Ö':'O', 'Ü':'U', 'ä':'a', 'ö':'o', 'ü':'u', 'ß':'ss'} ); | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | /** | |
− | + | * Stay on the same server as much as possible (secure or relative) | |
− | + | * Load page: [[MediaWiki:Common.js/secure.js]] or [[MediaWiki:Common.js/relative.js]] | |
− | + | */ | |
− | + | if( mw.config.get( 'wgNamespaceNumber' ) > 0 ) { //not in main space and special pages | |
− | + | mw.loader.using( [ 'user', 'mediawiki.user', 'user.options' ], function() { //wait for overrides in user.js | |
+ | if( mw.config.get( 'wgServer' ) === 'https://secure.wikimedia.org' ) { | ||
+ | if( !mw.user.options.get( 'disableSecureLinks', false ) ) { //disable in user.js, if not needed | ||
+ | mw.loader.load( 'https://secure.wikimedia.org/wikipedia/de/w/index.php?title=MediaWiki:Common.js/secure.js' | ||
+ | + '&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400' ); | ||
+ | } | ||
+ | } else if( mw.user.options.get( 'relativeProtocols', true ) ) { //disable in user.js, if not needed | ||
+ | mw.loader.load( '//de.wikipedia.org/w/index.php?title=MediaWiki:Common.js/relative.js' | ||
+ | + '&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400' ); | ||
+ | } | ||
+ | }); | ||
+ | } | ||
− | + | // ===================================================================================================== | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | /** | |
+ | * load the Edittools on [[Special:Upload]] and prefill the summary textarea | ||
+ | * Load pages: [[MediaWiki:Onlyifuploading.js]], [[MediaWiki:Onlyifediting.js]] | ||
+ | */ | ||
+ | if (mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Upload') { | ||
+ | importScript("MediaWiki:Onlyifuploading.js"); | ||
+ | importScript("MediaWiki:Onlyifediting.js"); | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * load the Edittools ([[MediaWiki:Edittools]], the part under the edit form) | ||
+ | * Load page: [[MediaWiki:Onlyifediting.js]] | ||
+ | */ | ||
+ | if ( mw.config.get( 'wgAction' ) === 'edit' || mw.config.get( 'wgAction' ) === 'submit' ) { | ||
+ | importScript("MediaWiki:Onlyifediting.js"); | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Nachrichten aus [[MediaWiki:watchlist-summary]] auf der Beobachtungliste ausblenden | ||
+ | * Load page: [[MediaWiki:Common.js/watchlist.js]] | ||
+ | */ | ||
+ | if (mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Watchlist') { | ||
+ | importScript("MediaWiki:Common.js/watchlist.js"); | ||
+ | } |
Aktuelle Version vom 4. Oktober 2012, 05:30 Uhr
/* Jedes JavaScript hier wird für alle Benutzer für jede Seite geladen. */ /** * Sortierung von Umlauten und ß auch ohne [[Vorlage:SortKey]] ermöglichen * For jquery.tablesorter.js */ mw.config.set( 'tableSorterCollation', {'Ä':'A', 'Ö':'O', 'Ü':'U', 'ä':'a', 'ö':'o', 'ü':'u', 'ß':'ss'} ); /** * Stay on the same server as much as possible (secure or relative) * Load page: [[MediaWiki:Common.js/secure.js]] or [[MediaWiki:Common.js/relative.js]] */ if( mw.config.get( 'wgNamespaceNumber' ) > 0 ) { //not in main space and special pages mw.loader.using( [ 'user', 'mediawiki.user', 'user.options' ], function() { //wait for overrides in user.js if( mw.config.get( 'wgServer' ) === 'https://secure.wikimedia.org' ) { if( !mw.user.options.get( 'disableSecureLinks', false ) ) { //disable in user.js, if not needed mw.loader.load( 'https://secure.wikimedia.org/wikipedia/de/w/index.php?title=MediaWiki:Common.js/secure.js' + '&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400' ); } } else if( mw.user.options.get( 'relativeProtocols', true ) ) { //disable in user.js, if not needed mw.loader.load( '//de.wikipedia.org/w/index.php?title=MediaWiki:Common.js/relative.js' + '&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400' ); } }); } // ===================================================================================================== /** * load the Edittools on [[Special:Upload]] and prefill the summary textarea * Load pages: [[MediaWiki:Onlyifuploading.js]], [[MediaWiki:Onlyifediting.js]] */ if (mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Upload') { importScript("MediaWiki:Onlyifuploading.js"); importScript("MediaWiki:Onlyifediting.js"); } /** * load the Edittools ([[MediaWiki:Edittools]], the part under the edit form) * Load page: [[MediaWiki:Onlyifediting.js]] */ if ( mw.config.get( 'wgAction' ) === 'edit' || mw.config.get( 'wgAction' ) === 'submit' ) { importScript("MediaWiki:Onlyifediting.js"); } /** * Nachrichten aus [[MediaWiki:watchlist-summary]] auf der Beobachtungliste ausblenden * Load page: [[MediaWiki:Common.js/watchlist.js]] */ if (mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Watchlist') { importScript("MediaWiki:Common.js/watchlist.js"); }