Difference between revisions 9958 and 9959 on newikibooks/** * Keep code in MediaWiki:Common.js to a minimum as it is unconditionally * loaded for all users on every wiki page. If possible create a gadget that is * enabled by default instead of adding it here (since gadgets are fully * optimized ResourceLoader modules with possibility to add dependencies etc.) * * Since Common.js isn't a gadget, there is no place to declare its * dependencies, so we have to lazy load them with mw.loader.using on demand and * then execute the rest in the callback. In most cases these dependencies will * be loaded (or loading) already and the callback will not be delayed. In case a * dependency hasn't arrived yet it'll make sure those are loaded before this. */ /*global mw, $, importStylesheet, importScript */ /*jshint curly:false eqnull:true, strict:false, browser:true, */ mw.loader.using( ['mediawiki.util', 'mediawiki.notify', 'jquery.client'], function () { /* Begin of mw.loader.using callback */ /** * Main Page layout fixes * * Description: Adds an additional link to the complete list of languages available. * Maintainers: [[User:AzaToth]], [[User:R. Koot]], [[User:Alex Smotrov]] */ if ( mw.config.get( 'wgPageName' ) === 'Main_Page' || mw.config.get( 'wgPageName' ) === 'Talk:Main_Page' ) { $( document ).ready( function () { mw.util.addPortletLink( 'p-lang', '//meta.wikimedia.org/wiki/List_of_Wikipedias', 'Complete list', 'interwiki-completelist', 'Complete list of Wikipedias' ); } ); } /** * Redirect User:Name/skin.js and skin.css to the current skin's pages (contracted; show full) * The script itself is located on meta because it is used by many projects. * See [[Meta:WikiMiniAtlas]] for more information. * Maintainers: [[User:Dschwen]] */ ( function () { var require_wikiminiatlas = false; var coord_filter = /geohack/; $( document ).ready( function () { $( 'a.external.text' ).each( function( key, link ) { if ( link.href && coord_filter.exec( link.href ) ) { require_wikiminiatlas = true; // break from loop return false; } } ); (contracted; show full) } ); } /** * Description: Stay on the secure server as much as possible * Maintainers: [[User:TheDJ]] */ if ( document.location && document.location.protocol && document.location.protocol === 'https:' ) { /* New secure servers */ importScript( 'MediaWiki:Common.js/secure new.js' ); } /** * Description: Removes ArticleFeedback related cookies from clients. * Can be removed in a couple of weeks to a month or so. * Maintainers: [[User:Reedy]] */ var match, re = /[\S]*articleFeedback[^=]*/g; while ( ( match = re.exec( document.cookie ) ) !== null ) { document.cookie = match + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/;'; } /* End of mw.loader.using callback */ } ); /* DO NOT ADD CODE BELOW THIS LINE */ All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://ne.wikibooks.org/w/index.php?diff=prev&oldid=9959.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|