Common.js

From TrainzOnline
Revision as of 20:11, 16 July 2013 by Fabartus (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

/*global mw, JSconfig, importScript, jsMsg, importStylesheet */ /*jshint forin:false, strict:false, onecase:true, laxbreak:true, browser:true, jquery:true */

// Overwriting deprecated functions that have a follower that (also) accepts the same syntax: window.addPortletLink = mw.util.addPortletLink; window.getParamValue = mw.util.getParamValue; window.appendCSS = mw.util.addCSS;

// A callback object holding callbacks executed when new DOM-content was inserted window.newContentLoaded = $.Callbacks();

/**

* Prepend server (if not already).
* @example '/something' to 'http://commons.wikimedia.org/something'
* @example don't touch 'https://commons.wikimedia.org/foo'
* @example don't touch '//commons.wikimedia.org/bar'
* @param url {String}
* @return {String}
*/

mw.util.expandUrl = function ( url ) { if ( url.substr( 0, 1 ) === '/' && url.substr( 0, 2 ) !== '//' ) { return mw.config.get( 'wgServer' ) + url; } else { return url; } };

/**

* Expand protocol-relative urls.
* @param method {String} CURRENT, RELATIVE, HTTP, HTTPS
* @return {String}
*/

mw.util.expandProtocol = function ( url, method ) {

 // Not relative right now, return right away
 if ( url.substr( 0, 2 ) !== '//' ) {
   return url;
 }
 method = method || 'CURRENT';
 switch ( method ) {
   case 'CURRENT':
     url = window.location.protocol + url;
     break;
   case 'RELATIVE':
     break;
   case 'HTTP':
     url = 'http:' + url;
     break;
   case 'HTTPS':
     url = 'https:' + url;
     break;
 }
 return url;

};

// Creates action=raw links for JS or CSS gadgets // Useful for mw.loader.load, which doesn't accept page titles function rawPageLink( pageName ) {

 return mw.config.get( 'wgServer' ) + mw.config.get( 'wgScript' ) + '?title=' + mw.util.wikiUrlencode(pageName) + '&action=raw&ctype=text/javascript';

}

// Overwriting deprecated functions that don't have an exact followup but can be easily mapped: window.importScriptURI = function ( uri ) {

 return mw.loader.load( mw.util.expandUrl( uri ) );

}; window.importScript = function ( page ) {

 if ( typeof page === 'string' && page.length ) {
   mw.loader.load( rawPageLink( page ) );
 }

};

//Set global error handler. //Puts occuring JS error on the page if the user is a sysop (non-webkit browser or new webkit-browser) //So we don't load when sysop has an older webkit browser //Errors catched with try catch are not affected var client = $.client.profile(); if ( $.inArray( 'sysop', mw.config.get( 'wgUserGroups' ) ) !== -1 && (client.layout !== 'webkit' || (client.layout === 'webkit' && client.layoutVersion >= 533)) ) {

 window.onerror = function (error, url, line) {
var msg = '

Error: '; if (url !== ) { msg += url + ' at line ' + line + ': '; } msg += error + '

';
   jsMsgAppend(msg);
 };
 //unbind on leaving the page
 $(window).unload( function () {
   window.onerror = null;
 } );

}

// Enhanced version of jsMsg from wikibits.js. jsMsg can display only one message, subsequent // calls overwrite any previous message. This version appends new messages after already // existing ones. Soon to be replaced by mw.util version function jsMsgAppend( msg, className ) {

 if ( $('#mw-js-message').is(':empty') ) {
   jsMsg(msg, className);
 } else {
   // Append it
   $('#mw-js-message').show().append(msg);
 }

}


/**

* JSconfig
*
* If you are a gadget author, you may use 
* MediaWiki:Gadget-SettingsManager.js or jquery.jStorage or jquery.cookie
* and MediaWiki:Gadget-SettingsUI.js to provide an easy interface.
* 
*
* Global configuration options to enable/disable and configure
* specific script features from MediaWiki:Common.js and MediaWiki:Monobook.js
* This framework adds config options (saved as cookies) to Special:Preferences
* (Site script does not run at Special:Preferences any more so this functionality has been removed)
*
* For a more permanent change you can override the default settings in your
* Special:Mypage/monobook.js
* for Example: JSconfig.keys[loadAutoInformationTemplate] = false;
*
* Maintainer: User:Dschwen
*/

window.JSconfig = {

prefix: 'jsconfig_',
keys: {},
meta: {},
// Register a new configuration item
//  * name      : String, internal name
//  * default_value : String or Boolean (type determines configuration widget)
//  * description  : String, text appearing next to the widget in the preferences, or an hash-object
//    containing translations of the description indexed by the language code
//
// Access keys through JSconfig.keys[name]
registerKey: function (name, default_value, description, prefpage) {
 if (JSconfig.keys[name] === undefined) {
  JSconfig.keys[name] = default_value;
 } else {
  // all cookies are read as strings,
  // convert to the type of the default value
  switch (typeof default_value) {
  case 'boolean':
   JSconfig.keys[name] = (JSconfig.keys[name] === 'true');
   break;
  case 'number':
   JSconfig.keys[name] = JSconfig.keys[name] / 1;
   break;
  }
 }
 JSconfig.meta[name] = {
  'description': description[mw.config.get( 'wgUserLanguage' )] || description.en || (typeof description === 'string' && description) || 'en translation missing',
  'page': prefpage || 0,
  'default_value': default_value
 };
},
readCookies: function () {
 var cookies = document.cookie.split('; ');
 var p = JSconfig.prefix.length;
 var i;
 for (var key = 0; cookies && key < cookies.length; key++) {
  if (cookies[key].substring(0, p) === JSconfig.prefix) {
   i = cookies[key].indexOf('=');
   //alert( cookies[key] + ',' + key + ',' + cookies[key].substring(p,i) );
   JSconfig.keys[cookies[key].substring(p, i)] = cookies[key].substring(i + 1);
  }
 }
},
writeCookies: function () {
 var expdate = new Date();
 expdate.setTime(expdate.getTime() + 1000 * 60 * 60 * 24 * 3650); // expires in 3560 days
 for (var key in JSconfig.keys) {
  document.cookie = JSconfig.prefix + key + '=' + JSconfig.keys[key] + '; path=/; expires=' + expdate.toUTCString();
 }
}

}; JSconfig.readCookies();


/**

* withJS
*
* Allow to load custom scripts from the MediaWiki namespace without
* editing Special:Mypage/common.js
*
* Maintainer: User:Platonides, User:Lupo
*/

var extraJS = mw.util.getParamValue('withJS'); // Leave here for backwards compatibility (function (extraJS) {

if (!extraJS) {
 return;
}
if (extraJS.match(/^MediaWiki:[^&<>=%#]*\.js$/)) {
 // Disallow some characters in file name
 importScript(extraJS);
} else {
 // Dont use alert but the jsMsg system. Run jsMsg only once the DOM is ready.
 $(function () {
  jsMsgAppend(extraJS + ' javascript not allowed to be loaded.', 'error');
 });
}

})(extraJS);


/**

* withCSS
*
* Allow to load custom styles from the MediaWiki namespace without
* editing Special:Mypage/common.css
*
* Maintainer: User:Krinkle
*/

var extraCSS = mw.util.getParamValue('withCSS'); if ( extraCSS ) {

 // Disallow some characters in file name
 if (extraCSS.match(/^MediaWiki:[^&<>=%#]*\.css$/)) {
   importStylesheet(extraCSS);
 // Dont use alert but the jsMsg system. Run jsMsg only once the DOM is ready.
 } else {
   $(function() {
     jsMsgAppend(extraCSS + ' stylesheet not allowed to be loaded.', 'error');
   });
 }

}

/**

* Attach (or remove) an Event to a specific object
* Local Maintainer: User:Dschwen
*
* @deprecated: Use jQuery binding instead for more browser compatibility and fewer code
*/

function addEvent() {

// Deprecated, TODO: Remove entirely in 2013

} function removeEvent() {

// Deprecated, TODO: Remove entirely in 2013

}


/**

* Edittools
*
* Formatting buttons for special characters below the edit field
* Also enables these buttons on any textarea or input field on the page.
*
* Maintainer: User:Lupo, User:DieBuche
*/

if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit' , 'submit' ]) > -1 || mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Upload' ) {

importScript('MediaWiki:Edittools.js');

}

// Old version mw.loader.load( rawPageLink( 'MediaWiki:CollapsibleTemplates.js' ) );


/**

* ImageAnnotator
* Globally enabled per
* http://commons.wikimedia.org/?title=Commons:Village_pump&oldid=26818359#New_interface_feature
* Maintainer: User:Lupo
*/

// Not on Special pages, and only if viewing the page if (mw.config.get( 'wgNamespaceNumber' ) !== -1 && $.inArray(mw.config.get('wgAction'), ['view', 'purge']) !== -1 ) {

if (typeof ImageAnnotator_disable === 'undefined' || !ImageAnnotator_disable) {
 // Don't even import it if it's disabled.
 importScript('MediaWiki:Gadget-ImageAnnotator.js');
}

}

/**

* QICSigs
*
* Fix for the broken signatures in gallery tags
* Helper script to make voting on QIC easier
* needed for COM:QIC
*
* Maintainers: User:Dschwen
*/

if (mw.config.get( 'wgPageName' ) === 'Commons:Quality_images_candidates/candidate_list' && mw.config.get( 'wgAction' ) === 'edit') {

importScript('MediaWiki:QICSigs.js');
importScript('MediaWiki:QIvoter.js');

}


/**

* VICValidate
*
* Some basic form validation for creating new Valued image nominations
* needed for COM:VIC
*
* Maintainers: User:Dschwen
*/

if (mw.config.get( 'wgPageName' ) === 'Commons:Valued_image_candidates' && mw.config.get( 'wgAction' ) === 'view') {

importScript('MediaWiki:VICValidate.js');

}


/**

* subPagesLink
*
* Adds a link to subpages of current page
*
* Maintainers: he:משתמש:ערן, User:Dschwen
*
* JSconfig items: bool JSconfig.subPagesLink(true=enabled (default), false=disabled)
*/

var subPagesLink = {

// Translations of the menu item
i18n: {
 'be-tarask': 'Падстаронкі',
 'be-x-old': 'Падстаронкі',
 'bg': 'Подстраници',
 'ca': 'Subpàgines',
 'cs': 'Podstránky',
 'cy': 'Isdudalennau',
 'de': 'Unterseiten',
 'en': 'Subpages', // default
 'et': 'Alamlehed',
 'eo': 'Subpaĝoj',
 'eu': 'Azpiorrialdeak',
 'es': 'Subpáginas',
 'fa': 'زیرصفحه‌ها',
 'fi': 'Alasivut',
 'fr': 'Sous-pages',
 'gl': 'Subpáxinas',
 'he': 'דפי משנה',
 'hr': 'Podstranice',
 'id': 'Sub halaman',
 'it': 'Sottopagine',
 'is': 'Undirsíður',
 'ko': '하위 문서 목록',
 'min': 'Sublaman',
 'mk': 'Потстраници',
 'ml': 'ഉപതാളുകൾ',
 'nl': "Subpagina's",
 'no': 'Undersider',
 'pl': 'Podstrony',
 'pt': 'Subpáginas',
 'pt-br': 'Subpáginas',
 'ru': 'Подстраницы',
 'sl': 'Podstrani',
 'sv': 'Undersidor',
 'uk': 'Підсторінки',
 'zh-hans': '子页面',
 'zh-hant': '子頁面',
},
install: function () {
 // honor user configuration
 if (!JSconfig.keys.subPagesLink) {
  return;
 }
 if (document.getElementById('t-whatlinkshere')
 && $.inArray ( mw.config.get( 'wgNamespaceNumber' ), [ -1/* Special */, 6 /* File */, 14 /* Category */] ) === -1
 ) {
  var subpagesText = subPagesLink.i18n[mw.config.get( 'wgUserLanguage' )] || subPagesLink.i18n.en;
  var subpagesLink = mw.util.wikiGetlink('Special:Prefixindex/' + mw.config.get( 'wgPageName' ) + '/');
  mw.util.addPortletLink('p-tb', subpagesLink, subpagesText, 't-subpages');
 }
}

}; JSconfig.registerKey('subPagesLink', true, {

'be-tarask': 'Паказваць спасылку на падстаронкі ў панэлі інструмэнтаў',
'be-x-old': 'Паказваць спасылку на падстаронкі ў панэлі інструмэнтаў',
'bg': 'Показване на връзката Подстраници в менюто с инструменти',
'cs': 'Zobrazovat v panelu nástrojů odkaz Podstránky',
'en': 'Show a Subpages link in the toolbox', // default
'fa': 'نمایش زیرصفجه‌ها در جعبه ابزار',
'id': 'Tampilkan Sub halaman di kotak perkakas',
'min': 'Tunjuakan Sublaman pado kotak pakakeh',
'mk': 'Покажи врска до потстраниците во алатникот',
'ml': 'പണിസഞ്ചിയിൽ ഉപതാളുകൾക്കുള്ള കണ്ണി പ്രദർശിപ്പിക്കുക',
'nl': "Een link Subpagina's weergeven bij de hulpmiddelen",
'pl': 'Pokaż w panelu bocznym link do podstron',
'pt': 'Exibir um link para as subpáginas no menu de ferramentas',
'pt-br': 'Exibir um link para as subpáginas no menu de ferramentas',
'ru': 'Показывать ссылку на подстраницы в меню инструментов',
'sl': 'Med pripomočki prikaži povezavo na podstrani',
'sv': 'Visa en länk för undersidor i verktygslådan',
'zh-hans': '在工具箱显示一个子页面的链接',
'zh-hant': '在工具箱顯示壹個子頁面的鏈接',

}, 7); $(subPagesLink.install);


/**

* gallery shuffle
*
* Maintainers: User:Dschwen, User:Krinkle
*/

function gallery_dshuf($c) {

   $('div.dshuf', $c).children('ul.gallery').each( function (i, ul) {
       var $ul = $(ul),
           $lis = $ul.children('li.gallerybox');
       // assign random keys
       $lis
         .each( function (i, li) {
           $.data(li, 'dshufkey', Math.random());
         } )
         // sort according to key
         .sort( function (a, b) {
             var A = $.data(a, 'dshufkey'),
                 B = $.data(b, 'dshufkey');
             if (A < B) {
               return -1;
             } else if (A > B) {
               return 1;
             } else {
               return 0;
             }
         })
         // append in random order
         .each( function (i, li) {
           $ul.append(li);
         } );
   });

} newContentLoaded.add( gallery_dshuf );


/**

* dshuf
*
* shuffles div elements with the class dshuf and
* common class dshufsetX (X being an integer)
* taken from http://commons.wikimedia.org/?title=MediaWiki:Common.js&oldid=7380543
*
* Maintainers: User:Gmaxwell, User:Dschwen
*/

function dshuf($c) {

var shufsets = {};
var rx = new RegExp('dshuf' + '\\s+(dshufset\\d+)', 'i');
var divs = document.getElementsByTagName('div');
var i = divs.length;
while (i--) {
 if (rx.test(divs[i].className)) {
  if (typeof shufsets[RegExp.$1] === 'undefined') {
   shufsets[RegExp.$1] = {};
   shufsets[RegExp.$1].inner = [];
   shufsets[RegExp.$1].member = [];
  }
  shufsets[RegExp.$1].inner.push({
   key: Math.random(),
   html: divs[i].innerHTML
  });
  shufsets[RegExp.$1].member.push(divs[i]);
 }
}
for (var shufset in shufsets) {
 shufsets[shufset].inner.sort(function (a, b) {
  return a.key - b.key;
 });
 i = shufsets[shufset].member.length;
 while (i--) {
  shufsets[shufset].member[i].innerHTML = shufsets[shufset].inner[i].html;
  shufsets[shufset].member[i].style.display = 'block';
 }
}

} newContentLoaded.add( dshuf );


/**

* localizeSignature: localizes the signature on Commons with the string in the user's preferred language
*
* Maintainer: User:Slomox
*/

function localizeSignature($c) {

var talkTextLocalization = {
 'be-tarask': 'Абмеркаваньне',
 'be-x-old': 'Абмеркаваньне',
 'ca': 'Discussió',
 'cs': 'diskuse',
 'de': 'Diskussion',
 'fa': 'بحث',
 'fr': 'd',
 'id': 'bicara',
 'min': 'maota',
 'mk': 'Разговор',
 'ml': 'സംവാദം',
 'nl': 'Overleg',
 'pt': 'Discussão',
 'pt-br': 'Discussão',
 'nds': 'Diskuschoon',
 'sl': 'Pogovor',
 'sv': 'Diskussion',
 'zh-hans': '留言',
 'zh-hant': '留言',
};
var talkText = talkTextLocalization[mw.config.get( 'wgUserLanguage' )];
if (!talkText) {
 return;
}
$('.signature-talk', $c).text(talkText);

} newContentLoaded.add(localizeSignature);


/**

* Ajax Translation of /lang links, see MediaWiki:AjaxTranslation.js
* Maintainer: User:ערן, User:DieBuche
*/

if (!window.disableAjaxTranslation) {

   importScript('MediaWiki:AjaxTranslation.js');

}


/**

* SVG images: adds links to rendered PNG images in different resolutions
*
* Maintainer:´ ?
* @deprecated in 1.18
*/

function SVGThumbs() {

var file = document.getElementById('file'); // might fail if MediaWiki can't render the SVG
if (file && mw.config.get( 'wgIsArticle' ) && mw.config.get( 'wgTitle' ).match(/\.svg$/i)) {
 var thumbu = jQuery(file).find('img:first').attr('src');
 if (!thumbu) {
  return;
 }
 function svgAltSize(w, title) {
  var path = thumbu.replace(/\/\d+(px-[^\/]+$)/, '/' + w + '$1');
  var a = document.createElement('A');
  a.setAttribute('href', path);
  a.appendChild(document.createTextNode(title));
  return a;
 }
 var p = document.createElement('p');
 p.className = 'SVGThumbs';
 var i18n = {
  'be-tarask': 'Гэтая выява ў фармаце PNG у іншых памерах: ',
  'be-x-old': 'Гэтая выява ў фармаце PNG у іншых памерах: ',
  en: 'This image rendered as PNG in other widths: ',
  de: 'Dieses Bild im PNG-Format in folgenden Breiten: ',
  cs: 'Tento obrázek jako PNG v jiné velikosti: ',
  fa: 'رندر پی\u200cان\u200cجی این تصویر در اندازه\u200cهای دیگر: ',
  fr: 'Cette image restituée en PNG dans d’autres tailles : ',
  id: 'Gambar ini dijadikan PNG dengan lebar berbeda: ',
  min: 'Gambar ko dijadian PNG jo leba babedo: ',
  ml: 'ഈ ചിത്രം PNG ആയി ലഭ്യമാകുന്ന മറ്റ് വലിപ്പങ്ങൾ: ',
  mk: 'Сликава како PNG во други големини: ',
  nl: 'Deze PNG-afbeelding in andere groottes: ',
  pt: 'Esta imagem renderizada como PNG em outros tamanhos: ',
  'pt-br': 'Esta imagem renderizada como PNG em outros tamanhos: ',
  sl: 'Prikaži to sliko v PNG-zapisu v drugih velikostih: ',
  sv: 'Denna bild i PNG-format i olika storlekar: ',
  'zh-hans': '该图像转换为PNG格式的其他尺寸:',
  'zh-hant': '該圖像轉換為PNG格式的其他尺寸:',
 };
 var ptext = i18n[mw.config.get( 'wgUserLanguage' )] || i18n.en;
 p.appendChild(document.createTextNode(ptext));
 var l = [200, 500, 1000, 2000];
 for (var i = 0; i < l.length; i++) {
  p.appendChild(svgAltSize(l[i], l[i] + 'px'));
  if (i < l.length - 1) {
   p.appendChild(document.createTextNode(', '));
  }
 }
 p.appendChild(document.createTextNode('.'));
 var info = $(file.parentNode).find('div.fullMedia').get(0);
 if (info) {
  info.appendChild(p);
 }
}

} $(SVGThumbs);


// Language specific site-wide JavaScript importScript('MediaWiki:Common.js/' + mw.config.get( 'wgUserLanguage' ));

/**

* Helper function to normalize date used by script (e.g. Flickrreview script)
*
* TODO: Outsource to a gadget for proper minifying and dependencies?
* Maintainer: ???
*/

function getISODate() {

var date = new Date();
// UTC
var dd = date.getUTCDate();
if (dd < 10) {
 dd = '0' + dd.toString();
}
var mm = date.getUTCMonth() + 1;
if (mm < 10) {
 mm = '0' + mm.toString();
}
var YYYY = date.getUTCFullYear();
var ISOdate = YYYY + '-' + mm + '-' + dd;
return ISOdate;

}


/**

* Sitenotice translation for all skins
* Maintainer: Krinkle
*/

$(function () {

if (mw.config.get( 'wgUserLanguage' ) !== 'en') {
 $('#siteNotice #mw-dismissable-notice p').load(
   mw.util.wikiGetlink( 'MediaWiki:Sitenotice-translation' ) + '?action=render&uselang=' + mw.config.get( 'wgUserLanguage' ) + ' p'
 );
}

});


/**

* Main page tab all main pages and instead of the 'Gallery' tab
*/

if ($.inArray( mw.config.get( 'wgNamespaceNumber' ), [ 0 , 1 ]) > -1) {

importScript('MediaWiki:MainPages.js');

}


/**

* Add links to GlobalUsage and the CommonsDelinker log to file deletion log entries.
*
* Maintainer: User:Ilmari Karonen
*/

mw.hook( 'wikipage.content' ).add(function($c) {

var $deletions = $c.find('li.mw-logline-delete');
if (!$deletions.length) {
  return;
}

// create the links in advance so we can cloneNode() them quickly in the loop
var guLink = $('<a>', {
  'class' : 'delinker-log-globalusage'
}).append('global usage');
var cdLink = $('<a>', {
  'class' : 'delinker-log-link extiw'
}).append('delinker log');

var span = $('', {
   'class' : 'delinker-log-links'
}).append(' (').append(guLink).append('; ')
  .append(cdLink).append(')');

$deletions.each (function() {
  var $match = $( this ).find('a[title^="File:"]');
  if ( $match.length ) {
    var filename = $match.text().substring(5).replace(/ /g,'_');
    guLink.attr('href', mw.util.wikiGetlink( 'Special:GlobalUsage' ) + '?target=' + filename );
    guLink.attr('title', 'Current usage of ' + filename + ' on all Wikimedia projects');
    cdLink.attr('href', '//toolserver.org/~delinker/index.php?image=' + filename);
    cdLink.attr('title', 'CommonsDelinker log for ' + filename);
    $( this ).append( span.clone() );
  }
});

});


/*

* Stay on the secure server as much as possible
* Maintainer: User:TheDJ
*/

if( document.location && document.location.protocol && document.location.protocol === 'https:' ) {

 /* New secure servers */
 importScript('MediaWiki:Common.js/secure new.js');

}

// Workaround for bugzilla:708 via Template:InterProject importScript('MediaWiki:InterProject.js');


/**

* {{LargeImage}} linkswap
*
* Swaps the 'full resolution' link with the 'interactive zoomviewer' links for large images.
* Avoids people crashing their browser by accidentally attempting to view a 200MP image
*
* Maintainer: User:Dschwen
*/

if (mw.config.get( 'wgAction' ) === 'view' && mw.config.get( 'wgNamespaceNumber' ) === 6) {

$(function () {
 var $viewerLinks = $('#LargeImage_viewer_links'),
     $fullResLink = $('#file>a[href^="//upload.wikimedia.org/wikipedia/commons/"]:not(:has(img))'),
     $copy_to = $fullResLink.clone(true),
     $copy_from = $viewerLinks.clone(true);
 if ($viewerLinks.length === 1 && $fullResLink.length === 1) {
  $fullResLink.replaceWith($copy_from);
  $viewerLinks.replaceWith($copy_to);
 }
});

}


//Update from https://toolserver.org/~krinkle/wpAvailableLanguages.js.php - Last update: Wed, 03 Apr 2013 09:10:29 +0000 window.wpAvailableLanguages={"aa":"Qaf\u00e1r af","ab":"\u0410\u04a7\u0441\u0448\u04d9\u0430","ace":"Ac\u00e8h","af":"Afrikaans","ak":"Akan","aln":"Geg\u00eb","als":"Alemannisch","am":"\u12a0\u121b\u122d\u129b","an":"aragon\u00e9s","ang":"\u00c6nglisc","anp":"\u0905\u0919\u094d\u0917\u093f\u0915\u093e","ar":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","arc":"\u0710\u072a\u0721\u071d\u0710","arn":"mapudungun","ary":"Ma\u0121ribi","arz":"\u0645\u0635\u0631\u0649","as":"\u0985\u09b8\u09ae\u09c0\u09af\u09bc\u09be","ast":"asturianu","av":"\u0430\u0432\u0430\u0440","avk":"Kotava","ay":"Aymar aru","az":"az\u0259rbaycanca","azb":"\u062a\u0648\u0631\u06a9\u062c\u0647","ba":"\u0431\u0430\u0448\u04a1\u043e\u0440\u0442\u0441\u0430","bar":"Boarisch","bat-smg":"\u017eemait\u0117\u0161ka","bcc":"\u0628\u0644\u0648\u0686\u06cc \u0645\u06a9\u0631\u0627\u0646\u06cc","bcl":"Bikol Central","be":"\u0431\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f","be-tarask":"\u0431\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f (\u0442\u0430\u0440\u0430\u0448\u043a\u0435\u0432\u0456\u0446\u0430)\u200e","be-x-old":"\u0431\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f (\u0442\u0430\u0440\u0430\u0448\u043a\u0435\u0432\u0456\u0446\u0430)\u200e","bg":"\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438","bh":"\u092d\u094b\u091c\u092a\u0941\u0930\u0940","bho":"\u092d\u094b\u091c\u092a\u0941\u0930\u0940","bi":"Bislama","bjn":"Bahasa Banjar","bm":"bamanankan","bn":"\u09ac\u09be\u0982\u09b2\u09be","bo":"\u0f56\u0f7c\u0f51\u0f0b\u0f61\u0f72\u0f42","bpy":"\u09ac\u09bf\u09b7\u09cd\u09a3\u09c1\u09aa\u09cd\u09b0\u09bf\u09af\u09bc\u09be \u09ae\u09a3\u09bf\u09aa\u09c1\u09b0\u09c0","bqi":"\u0628\u062e\u062a\u064a\u0627\u0631\u064a","br":"brezhoneg","brh":"Br\u00e1hu\u00ed","bs":"bosanski","bug":"\u1a05\u1a14 \u1a15\u1a18\u1a01\u1a17","bxr":"\u0431\u0443\u0440\u044f\u0430\u0434","ca":"catal\u00e0","cbk-zam":"Chavacano de Zamboanga","cdo":"M\u00ecng-d\u0115\u0324ng-ng\u1e73\u0304","ce":"\u043d\u043e\u0445\u0447\u0438\u0439\u043d","ceb":"Cebuano","ch":"Chamoru","cho":"Choctaw","chr":"\u13e3\u13b3\u13a9","chy":"Tsets\u00eahest\u00e2hese","ckb":"\u06a9\u0648\u0631\u062f\u06cc","co":"corsu","cps":"Capice\u00f1o","cr":"N\u0113hiyaw\u0113win \/ \u14c0\u1426\u1403\u152d\u140d\u140f\u1423","crh":"q\u0131r\u0131mtatarca","crh-latn":"q\u0131r\u0131mtatarca (Latin)\u200e","crh-cyrl":"\u043a\u044a\u044b\u0440\u044b\u043c\u0442\u0430\u0442\u0430\u0440\u0434\u0436\u0430 (\u041a\u0438\u0440\u0438\u043b\u043b)\u200e","cs":"\u010desky","csb":"kasz\u00ebbsczi","cu":"\u0441\u043b\u043e\u0432\u0463\u0301\u043d\u044c\u0441\u043a\u044a \/ \u2c14\u2c0e\u2c11\u2c02\u2c21\u2c10\u2c20\u2c14\u2c0d\u2c1f","cv":"\u0427\u04d1\u0432\u0430\u0448\u043b\u0430","cy":"Cymraeg","da":"dansk","de":"Deutsch","de-at":"\u00d6sterreichisches Deutsch","de-ch":"Schweizer Hochdeutsch","de-formal":"Deutsch (Sie-Form)\u200e","diq":"Zazaki","dsb":"dolnoserbski","dtp":"Dusun Bundu-liwan","dv":"\u078b\u07a8\u0788\u07ac\u0780\u07a8\u0784\u07a6\u0790\u07b0","dz":"\u0f47\u0f7c\u0f44\u0f0b\u0f41","ee":"e\u028begbe","egl":"Emili\u00e0n","el":"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac","eml":"emili\u00e0n e rumagn\u00f2l","en":"English","en-ca":"Canadian English","en-gb":"British English","eo":"Esperanto","es":"espa\u00f1ol","et":"eesti","eu":"euskara","ext":"estreme\u00f1u","fa":"\u0641\u0627\u0631\u0633\u06cc","ff":"Fulfulde","fi":"suomi","fit":"me\u00e4nkieli","fiu-vro":"V\u00f5ro","fj":"Na Vosa Vakaviti","fo":"f\u00f8royskt","fr":"fran\u00e7ais","frc":"fran\u00e7ais cadien","frp":"arpetan","frr":"Nordfriisk","fur":"furlan","fy":"Frysk","ga":"Gaeilge","gag":"Gagauz","gan":"\u8d1b\u8a9e","gan-hans":"\u8d63\u8bed\uff08\u7b80\u4f53\uff09\u200e","gan-hant":"\u8d1b\u8a9e\uff08\u7e41\u9ad4\uff09\u200e","gd":"G\u00e0idhlig","gl":"galego","glk":"\u06af\u06cc\u0644\u06a9\u06cc","gn":"Ava\u00f1e'\u1ebd","got":"\ud800\udf32\ud800\udf3f\ud800\udf44\ud800\udf39\ud800\udf43\ud800\udf3a","grc":"\u1f08\u03c1\u03c7\u03b1\u03af\u03b1 \u1f11\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u1f74","gsw":"Alemannisch","gu":"\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0","gv":"Gaelg","ha":"Hausa","hak":"Hak-k\u00e2-fa","haw":"Hawai`i","he":"\u05e2\u05d1\u05e8\u05d9\u05ea","hi":"\u0939\u093f\u0928\u094d\u0926\u0940","hif":"Fiji Hindi","hif-latn":"Fiji Hindi","hil":"Ilonggo","ho":"Hiri Motu","hr":"hrvatski","hsb":"hornjoserbsce","ht":"Krey\u00f2l ayisyen","hu":"magyar","hy":"\u0540\u0561\u0575\u0565\u0580\u0565\u0576","hz":"Otsiherero","ia":"interlingua","id":"Bahasa Indonesia","ie":"Interlingue","ig":"Igbo","ii":"\ua187\ua259","ik":"I\u00f1upiak","ike-cans":"\u1403\u14c4\u1483\u144e\u1450\u1466","ike-latn":"inuktitut","ilo":"Ilokano","inh":"\u0413\u04c0\u0430\u043b\u0433\u04c0\u0430\u0439","io":"Ido","is":"\u00edslenska","it":"italiano","iu":"\u1403\u14c4\u1483\u144e\u1450\u1466\/inuktitut","ja":"\u65e5\u672c\u8a9e","jam":"Patois","jbo":"Lojban","jut":"jysk","jv":"Basa Jawa","ka":"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8","kaa":"Qaraqalpaqsha","kab":"Taqbaylit","kbd":"\u0410\u0434\u044b\u0433\u044d\u0431\u0437\u044d","kbd-cyrl":"\u0410\u0434\u044b\u0433\u044d\u0431\u0437\u044d","kg":"Kongo","khw":"\u06a9\u06be\u0648\u0627\u0631","ki":"G\u0129k\u0169y\u0169","kiu":"K\u0131rmancki","kj":"Kwanyama","kk":"\u049b\u0430\u0437\u0430\u049b\u0448\u0430","kk-arab":"\u0642\u0627\u0632\u0627\u0642\u0634\u0627 (\u062a\u0674\u0648\u062a\u06d5)\u200f","kk-cyrl":"\u049b\u0430\u0437\u0430\u049b\u0448\u0430 (\u043a\u0438\u0440\u0438\u043b)\u200e","kk-latn":"qazaq\u015fa (lat\u0131n)\u200e","kk-cn":"\u0642\u0627\u0632\u0627\u0642\u0634\u0627 (\u062c\u06c7\u0646\u06af\u0648)\u200f","kk-kz":"\u049b\u0430\u0437\u0430\u049b\u0448\u0430 (\u049a\u0430\u0437\u0430\u049b\u0441\u0442\u0430\u043d)\u200e","kk-tr":"qazaq\u015fa (T\u00fcrk\u00efya)\u200e","kl":"kalaallisut","km":"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a","kn":"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1","ko":"\ud55c\uad6d\uc5b4","ko-kp":"\ud55c\uad6d\uc5b4 (\uc870\uc120)","koi":"\u041f\u0435\u0440\u0435\u043c \u041a\u043e\u043c\u0438","kr":"Kanuri","krc":"\u043a\u044a\u0430\u0440\u0430\u0447\u0430\u0439-\u043c\u0430\u043b\u043a\u044a\u0430\u0440","kri":"Krio","krj":"Kinaray-a","ks":"\u0915\u0949\u0936\u0941\u0930 \/ \u06a9\u0672\u0634\u064f\u0631","ks-arab":"\u06a9\u0672\u0634\u064f\u0631","ks-deva":"\u0915\u0949\u0936\u0941\u0930","ksh":"Ripoarisch","ku":"Kurd\u00ee","ku-latn":"Kurd\u00ee (lat\u00een\u00ee)\u200e","ku-arab":"\u0643\u0648\u0631\u062f\u064a (\u0639\u06d5\u0631\u06d5\u0628\u06cc)\u200f","kv":"\u043a\u043e\u043c\u0438","kw":"kernowek","ky":"\u041a\u044b\u0440\u0433\u044b\u0437\u0447\u0430","la":"Latina","lad":"Ladino","lb":"L\u00ebtzebuergesch","lbe":"\u043b\u0430\u043a\u043a\u0443","lez":"\u043b\u0435\u0437\u0433\u0438","lfn":"Lingua Franca Nova","lg":"Luganda","li":"Limburgs","lij":"Ligure","liv":"L\u012bv\u00f5 k\u0113\u013c","lmo":"lumbaart","ln":"ling\u00e1la","lo":"\u0ea5\u0eb2\u0ea7","loz":"Silozi","lt":"lietuvi\u0173","ltg":"latga\u013cu","lus":"Mizo \u0163awng","lv":"latvie\u0161u","lzh":"\u6587\u8a00","lzz":"Lazuri","mai":"\u092e\u0948\u0925\u093f\u0932\u0940","map-bms":"Basa Banyumasan","mdf":"\u043c\u043e\u043a\u0448\u0435\u043d\u044c","mg":"Malagasy","mh":"Ebon","mhr":"\u043e\u043b\u044b\u043a \u043c\u0430\u0440\u0438\u0439","mi":"M\u0101ori","min":"Baso Minangkabau","mk":"\u043c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438","ml":"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02","mn":"\u043c\u043e\u043d\u0433\u043e\u043b","mo":"\u043c\u043e\u043b\u0434\u043e\u0432\u0435\u043d\u044f\u0441\u043a\u044d","mr":"\u092e\u0930\u093e\u0920\u0940","mrj":"\u043a\u044b\u0440\u044b\u043a \u043c\u0430\u0440\u044b","ms":"Bahasa Melayu","mt":"Malti","mus":"Mvskoke","mwl":"Mirand\u00e9s","my":"\u1019\u103c\u1014\u103a\u1019\u102c\u1018\u102c\u101e\u102c","myv":"\u044d\u0440\u0437\u044f\u043d\u044c","mzn":"\u0645\u0627\u0632\u0650\u0631\u0648\u0646\u06cc","na":"Dorerin Naoero","nah":"N\u0101huatl","nan":"B\u00e2n-l\u00e2m-g\u00fa","nap":"Nnapulitano","nb":"norsk bokm\u00e5l","nds":"Plattd\u00fc\u00fctsch","nds-nl":"Nedersaksies","ne":"\u0928\u0947\u092a\u093e\u0932\u0940","new":"\u0928\u0947\u092a\u093e\u0932 \u092d\u093e\u0937\u093e","ng":"Oshiwambo","niu":"Niu\u0113","nl":"Nederlands","nl-informal":"Nederlands (informeel)\u200e","nn":"norsk nynorsk","no":"norsk bokm\u00e5l","nov":"Novial","nrm":"Nouormand","nso":"Sesotho sa Leboa","nv":"Din\u00e9 bizaad","ny":"Chi-Chewa","oc":"occitan","om":"Oromoo","or":"\u0b13\u0b21\u0b3c\u0b3f\u0b06","os":"\u0418\u0440\u043e\u043d","pa":"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40","pag":"Pangasinan","pam":"Kapampangan","pap":"Papiamentu","pcd":"Picard","pdc":"Deitsch","pdt":"Plautdietsch","pfl":"P\u00e4lzisch","pi":"\u092a\u093e\u0932\u093f","pih":"Norfuk \/ Pitkern","pl":"polski","pms":"Piemont\u00e8is","pnb":"\u067e\u0646\u062c\u0627\u0628\u06cc","pnt":"\u03a0\u03bf\u03bd\u03c4\u03b9\u03b1\u03ba\u03ac","prg":"Pr\u016bsiskan","ps":"\u067e\u069a\u062a\u0648","pt":"portugu\u00eas","pt-br":"portugu\u00eas do Brasil","qu":"Runa Simi","qug":"Runa shimi","rgn":"Rumagn\u00f4l","rif":"Tarifit","rm":"rumantsch","rmy":"Romani","rn":"Kirundi","ro":"rom\u00e2n\u0103","roa-rup":"Arm\u00e3neashce","roa-tara":"tarand\u00edne","ru":"\u0440\u0443\u0441\u0441\u043a\u0438\u0439","rue":"\u0440\u0443\u0441\u0438\u043d\u044c\u0441\u043a\u044b\u0439","rup":"Arm\u00e3neashce","ruq":"Vl\u0103he\u015fte","ruq-cyrl":"\u0412\u043b\u0430\u0445\u0435\u0441\u0442\u0435","ruq-latn":"Vl\u0103he\u015fte","rw":"Kinyarwanda","sa":"\u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d","sah":"\u0441\u0430\u0445\u0430 \u0442\u044b\u043b\u0430","sat":"Santali","sc":"sardu","scn":"sicilianu","sco":"Scots","sd":"\u0633\u0646\u068c\u064a","sdc":"Sassaresu","se":"s\u00e1megiella","sei":"Cmique Itom","sg":"S\u00e4ng\u00f6","sgs":"\u017eemait\u0117\u0161ka","sh":"srpskohrvatski \/ \u0441\u0440\u043f\u0441\u043a\u043e\u0445\u0440\u0432\u0430\u0442\u0441\u043a\u0438","shi":"Ta\u0161l\u1e25iyt\/\u2d5c\u2d30\u2d5b\u2d4d\u2d43\u2d49\u2d5c","shi-tfng":"\u2d5c\u2d30\u2d5b\u2d4d\u2d43\u2d49\u2d5c","shi-latn":"Ta\u0161l\u1e25iyt","si":"\u0dc3\u0dd2\u0d82\u0dc4\u0dbd","simple":"Simple English","sk":"sloven\u010dina","sl":"sloven\u0161\u010dina","sli":"Schl\u00e4sch","sm":"Gagana Samoa","sma":"\u00c5arjelsaemien","sn":"chiShona","so":"Soomaaliga","sq":"shqip","sr":"\u0441\u0440\u043f\u0441\u043a\u0438 \/ srpski","sr-ec":"\u0441\u0440\u043f\u0441\u043a\u0438 (\u045b\u0438\u0440\u0438\u043b\u0438\u0446\u0430)\u200e","sr-el":"srpski (latinica)\u200e","srn":"Sranantongo","ss":"SiSwati","st":"Sesotho","stq":"Seeltersk","su":"Basa Sunda","sv":"svenska","sw":"Kiswahili","szl":"\u015bl\u016fnski","ta":"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd","tcy":"\u0ca4\u0cc1\u0cb3\u0cc1","te":"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41","tet":"tetun","tg":"\u0442\u043e\u04b7\u0438\u043a\u04e3","tg-cyrl":"\u0442\u043e\u04b7\u0438\u043a\u04e3","tg-latn":"tojik\u012b","th":"\u0e44\u0e17\u0e22","ti":"\u1275\u130d\u122d\u129b","tk":"T\u00fcrkmen\u00e7e","tl":"Tagalog","tly":"\u0442\u043e\u043b\u044b\u0448\u04d9 \u0437\u044b\u0432\u043e\u043d","tn":"Setswana","to":"lea faka-Tonga","tokipona":"Toki Pona","tpi":"Tok Pisin","tr":"T\u00fcrk\u00e7e","tru":"\u1e6auroyo","ts":"Xitsonga","tt":"\u0442\u0430\u0442\u0430\u0440\u0447\u0430\/tatar\u00e7a","tt-cyrl":"\u0442\u0430\u0442\u0430\u0440\u0447\u0430","tt-latn":"tatar\u00e7a","tum":"chiTumbuka","tw":"Twi","ty":"Reo M\u0101`ohi","tyv":"\u0442\u044b\u0432\u0430 \u0434\u044b\u043b","udm":"\u0443\u0434\u043c\u0443\u0440\u0442","ug":"\u0626\u06c7\u064a\u063a\u06c7\u0631\u0686\u06d5 \/ Uyghurche","ug-arab":"\u0626\u06c7\u064a\u063a\u06c7\u0631\u0686\u06d5","ug-latn":"Uyghurche","uk":"\u0443\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430","ur":"\u0627\u0631\u062f\u0648","uz":"o\u02bbzbekcha","ve":"Tshivenda","vec":"v\u00e8neto","vep":"veps\u00e4n kel\u2019","vi":"Ti\u1ebfng Vi\u1ec7t","vls":"West-Vlams","vmf":"Mainfr\u00e4nkisch","vo":"Volap\u00fck","vot":"Va\u010f\u010fa","vro":"V\u00f5ro","wa":"walon","war":"Winaray","wo":"Wolof","wuu":"\u5434\u8bed","xal":"\u0445\u0430\u043b\u044c\u043c\u0433","xh":"isiXhosa","xmf":"\u10db\u10d0\u10e0\u10d2\u10d0\u10da\u10e3\u10e0\u10d8","yi":"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9","yo":"Yor\u00f9b\u00e1","yue":"\u7cb5\u8a9e","za":"Vahcuengh","zea":"Ze\u00eauws","zh":"\u4e2d\u6587","zh-classical":"\u6587\u8a00","zh-cn":"\u4e2d\u6587\uff08\u4e2d\u56fd\u5927\u9646\uff09\u200e","zh-hans":"\u4e2d\u6587\uff08\u7b80\u4f53\uff09\u200e","zh-hant":"\u4e2d\u6587\uff08\u7e41\u9ad4\uff09\u200e","zh-hk":"\u4e2d\u6587\uff08\u9999\u6e2f\uff09\u200e","zh-min-nan":"B\u00e2n-l\u00e2m-g\u00fa","zh-mo":"\u4e2d\u6587\uff08\u6fb3\u9580\uff09\u200e","zh-my":"\u4e2d\u6587\uff08\u9a6c\u6765\u897f\u4e9a\uff09\u200e","zh-sg":"\u4e2d\u6587\uff08\u65b0\u52a0\u5761\uff09\u200e","zh-tw":"\u4e2d\u6587\uff08\u53f0\u7063\uff09\u200e","zh-yue":"\u7cb5\u8a9e","zu":"isiZulu"};

/**

* AnonymousI18N (internationalisation for anonymous users)
* - This creates the "Language select" menu in the sidebar which sets &uselang= and saves choise in a cookie
* - It appends uselang to the next page you visit
* - It makes suggestions on urls without &uselang
* Maintainer: Krinkle
*/

mw.loader.using( 'mediawiki.user', function () {

if ( mw.user.anonymous() ) {
 importScript('MediaWiki:AnonymousI18N.js');
}

});

/**

* Special:Upload enhancements
*
* Moved to MediaWiki:Upload.js, MediaWiki:Gadget-ImprovedUploadForm.js
*
* Maintainer: User:Lupo
*
*/

if (mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Upload') {

importScript('MediaWiki:Upload.js');

}

/**

* Pending fix for bug 29277
*
* If we're on file pages and the filepage module isn't being loaded
* or already loaded, load it.
* Calls to mw.log are file, mw.log is no-op function in production mode,
* and with debug=true it's linked to console.
*/

if ( mw.config.get( 'wgCanonicalNamespace' ) === 'File' && $.inArray( mw.loader.getState( 'filepage' ), ['loading', 'loaded', 'ready'] ) === -1 ) {

 mw.log( 'site js> filepage module should be loaded but is not. loading now..' );
 mw.loader.using( 'filepage', function () {
   mw.log( 'site js> filepage module ' + mw.loader.getState( 'filepage' ) );
 } );

}

/**

* ImageStacks
* Maintainer: Hellerhoff, DieBuche
*/

//Only load if page contains template newContentLoaded.add( function($c) {

   if ( $( 'div.ImageStack', $c ).length ) {
       mw.loader.load( 'ext.gadget.ImageStack' );
   }

} );


// MediaWiki doesn't support <noscript> // Hide with CSS by JavaScript the other way arround by using class="noscript" mw.util.addCSS( '.noscript { display: none; }' );


// Catfood - tweaked version of MediaWiki:Catfood.js // Add a link to a RSS feed for each category page, in the toolbox. // If i18n is required, create a gadget, please and use MW-messages if (mw.config.get('wgNamespaceNumber') === 14) $(document).ready(function () {

  var p = mw.util.addPortletLink('p-tb', '//tools.wmflabs.org/catfood/catfood.php?category=' + encodeURIComponent(mw.config.get('wgTitle').split(' ').join('_')), 'RSS feed', 't-catfood', 'Category feed: The images are ordered based on the time of the addition of the image to the category, latest additions first');
  if (!p) return;
  var $p = $(p);
  var $a = $p.find('a');
  if ($a.length) {
     $a.addClass('feedlink');
  } else {
     $p.addClass('feedlink');
  }

});

/* POTY2012 voting script

* Maintainer: user:Rillke
*/

if ( /^Commons:Picture_of_the_Year\/2012\/(?:Galleries\/|R1\/|Finalists)/.test(mw.config.get('wgPageName')) ) {

mw.loader.load('//commons.wikimedia.org/w/index.php?title=MediaWiki:EnhancedPOTY.js'+
               '&action=raw&ctype=text/javascript&smaxage=2160&maxage=8640&x=14');

}

/**

* Helper script for .hlist class in Common.css and other IE specific fixes
* @source mediawiki.org/wiki/Snippets/Horizontal_lists
* @maintainer User:Edokter
*/

if ( $.client.profile().name === 'msie' ) {

 importScript( 'MediaWiki:Common.js/IEFixes.js' );

}

/**

* Commons Dashboard
* a collection of widgets containing real time status displays
* and ways to achieve common tasks with less work
* that seamless integrate into the Wikimedia Commons user interface
* @maintainer User:Rillke
*/

newContentLoaded.add( function($c) {

if ($('.commonsdashboard', $c).length) mw.loader.load('ext.gadget.CommonsDashboard');

} );

/** Wiki Loves Monuments - Odder: "accordion for WLM, will remove it in a while" */ newContentLoaded.add( function($c) {

 var $accordion = $('.accordion', $c);
 if ($accordion.length) {
   mw.loader.using('jquery.ui.accordion', function () {
      $accordion.accordion({ autoHeight: false });
   });
 }

});

// Fix for https://bugzilla.wikimedia.org/show_bug.cgi?id=51038 newContentLoaded.add( function($c) {

if (('.mw-babel-wrapper').length) mw.loader.load('ext.babel');

});

// This must remain as the last entry in the common.js! // Fire events when new portions of the wikipage were loaded // (e.g. using live preview) var onNewContent = function($cont) {

newContentLoaded.fire($cont, 'wikipage.content');

}; mw.hook( 'wikipage.content' ).add(onNewContent); mw.hook( 'wikipage.custom.content' ).add(onNewContent); $( mw ).bind( 'LivePreviewDone', function(e, data) {

if ($.inArray('#wikiPreview', data) < 0) return;
newContentLoaded.fire($('#wikiPreview'), 'LivePreviewDone');

});

Personal tools