mw.loader.implement("ext.gadget.AjaxQuickDelete",function(){(function($,mw,undefined){'use strict';if(typeof window.AjaxQuickDelete==='object')return;var nsNumber=mw.config.get('wgNamespaceNumber'),pageName=mw.config.get('wgPageName'),canonicalNs=mw.config.get('wgCanonicalNamespace'),AQD;AQD=window.AjaxQuickDelete={install:function(){if(0===mw.config.get('wgArticleId')||nsNumber<0)return;if(mw.config.get('wgRestrictionEdit')&&mw.config.get('wgRestrictionEdit').length){if($.inArray(mw.config.get('wgRestrictionEdit')[0],mw.config.get('wgUserGroups'))===-1){return;}}$(function(){$(document).triggerHandler('scriptLoaded',['AjaxQuickDelete']);if(nsNumber===14){mw.util.addPortletLink('p-tb','javascript:AjaxQuickDelete.discussCategory();',AQD.i18n.toolboxLinkDiscuss,'t-ajaxquickdiscusscat',null);}else{mw.util.addPortletLink('p-tb','javascript:AjaxQuickDelete.nominateForDeletion();',AQD.i18n.toolboxLinkDelete,'t-ajaxquickdelete',null);}if($.inArray('sysop',mw.config.get('wgUserGroups'))!==-1){
AQD.userRights='sysop';}else if($.inArray('filemover',mw.config.get('wgUserGroups'))!==-1){AQD.userRights='filemover';}if((AQD.userRights==='filemover'||AQD.userRights==='sysop')&&nsNumber===6){mw.util.addPortletLink('p-cactions','javascript:AjaxQuickDelete.moveFile("", "");',AQD.i18n.dropdownMove,'ca-quickmove','ca-move');if($('#AjaxRenameLink').length){$('#AjaxRenameLink').append('<a href="javascript:AjaxQuickDelete.moveFile();">'+AQD.i18n.moveAndReplace+'</a>').append('<a href="javascript:AjaxQuickDelete.declineRequest(\'move\');" class="ajaxDeleteDeclineMove"><sup> '+AQD.i18n.anyDecline+'</sup></a>');}$('.ctdr-btn-convert').click(AQD._convertToDR);$('.ctdr-btn-remove').click(AQD._removeAnyTag);$('.convert-to-dr').show();}if(AQD.userRights==='sysop'&&nsNumber===6){if($('#AjaxDupeProcess').length){$('#AjaxDupeProcess').append($('<a>',{href:'javascript:AjaxQuickDelete.processDupes();',text:"Process Duplicates"})).show();}else{var dupeSection=$('.mw-imagepage-duplicates');if(
dupeSection.length){dupeSection.find('li:first').append($('<span>',{style:'display:none',id:'AjaxDupeDestination',text:dupeSection.find('a').attr('title')})).append(' ',$('<sup>').append($('<a>',{href:'javascript:AjaxQuickDelete.processDupes();',text:"[Process Duplicates]",style:'background:#CEEDB4'})));}}}if("1"===mw.user.options.get('gadget-QuickDelete')){mw.loader.using(['ext.gadget.QuickDelete','user'],function(){AQD.doInsertTagButtons();});}});},initialize:function(){pageName=mw.config.get('wgPageName');this.tasks=[];this.destination=undefined;this.details=undefined;},fileExists:function(){this.i18n.moveDestination=this.i18n.moveOtherDestination;this.moveFile();},moveFile:function(){this.initialize();this.showProgress();if($('#AjaxRenameLink').length){this.possibleDestination=this.cleanFileName($('#AjaxRenameDestination').text());this.possibleReason=this.cleanReason($('#AjaxRenameReason').text());}if($('#globalusage').length||!$('#mw-imagepage-nolinkstoimage').length)this.inUse=
true;this.addTask('doesFileExist');this.fileNameExistsCB='fileExists';this.addTask('getMoveToken');this.addTask('movePage');this.addTask('removeTemplate');if(this.inUse)this.addTask('replaceUsage');this.addTask('reloadPage');this.prompt([{message:this.i18n.moveDestination,prefill:(this.possibleDestination||this.cleanFileName(pageName)),returnvalue:'destination',cleanUp:true,noEmpty:true},{message:this.i18n.reasonForMove,prefill:$.trim((this.reason||this.possibleReason||'').replace(/'{2,}/g,'').replace(/\s{2,}/g,'')),returnvalue:'reason',cleanUp:true,noEmpty:false},{message:this.i18n.leaveRedirect,prefill:true,returnvalue:'wpLeaveRedirect',cleanUp:false,noEmpty:false,type:'checkbox'}],this.i18n.movingFile);if(this.inUse||this.userRights==='filemover')$('#AjaxQuestion2').attr('disabled',true);},declineRequest:function(reason){this.initialize();this.addTask('getMoveToken');this.addTask('removeTemplate');this.addTask('reloadPage');switch(reason){case'move':reason=
'No valid reason stated, see the [[COM:MOVE|rename guidelines]]';break;}this.prompt([{message:'',prefill:reason||this.declineReason||'',returnvalue:'declineReason',cleanUp:false,noEmpty:true,byteLimit:250}],this.i18n.declineRequest);},insertTagOnPage:function(tag,img_summary,talk_tag,talk_summary,prompt_text,page){this.initialize();this.pageName=(page===undefined)?pageName.replace(/_/g,' '):page.replace(/_/g,' ');this.tag=tag+'\n';this.img_summary=img_summary;this.addTask('findCreator');this.addTask('prependTemplate');if(talk_tag&&talk_tag!=="undefined"){this.talk_tag=talk_tag.replace('%FILE%',this.pageName);this.talk_summary=talk_summary.replace('%FILE%','[[:'+this.pageName+']]');this.usersNeeded=true;this.addTask('notifyUploaders');}this.addTask('reloadPage');if(tag.indexOf("%PARAMETER%")!==-1){this.prompt([{message:'',prefill:'',returnvalue:'reason',cleanUp:true,noEmpty:true,minLength:1}],prompt_text||this.i18n.reasonForDeletion);}else{this.nextTask();}},discussCategory:function(){
this.initialize();this.pageName=pageName.replace(/_/g,' ');this.startDate=new Date();this.tag='{'+'{subst:cfd}}';this.img_summary='This category needs discussion';this.talk_tag='{'+'{subst:cdw|'+pageName+'}}';this.talk_summary="[[:"+pageName+"]] needs discussion";this.subpage_summary='Starting category discussion';this.requestPage='Commons:Categories for discussion/'+this.formatDate("YYYY/MM/")+pageName;this.dailyLogPage='Commons:Categories for discussion/'+this.formatDate("YYYY/MM");this.addTask('findCreator');this.addTask('notifyUploaders');this.addTask('prependTemplate');this.addTask('createRequestSubpage');this.addTask('listRequestSubpage');this.addTask('reloadPage');var lazyLoadNode=this.createLazyLoadNode(this.i18n.moreInformation,'MediaWiki:Gadget-AjaxQuickDelete.js/DiscussCategoryInfo','#AjaxQuickDeleteCatInfo');this.prompt([{message:'',prefill:'',returnvalue:'reason',cleanUp:true,appendNode:lazyLoadNode,noEmpty:true,parseReason:true}],this.i18n.reasonForDiscussion);},
nominateForDeletion:function(page){var o=this;this.initialize();mw.loader.using(['jquery.byteLength','jquery.ui.dialog'],function(){o.pageName=(page===undefined)?pageName.replace(/_/g,' '):page.replace(/_/g,' ');o.startDate=new Date();var requestPage=o.pageName;while($.byteLength(requestPage)+$.byteLength(o.requestPagePrefix.replace(/^.+?\:/,''))>=255){requestPage=$.trim(requestPage.slice(0,requestPage.length-1));}o.requestPage=o.requestPagePrefix+requestPage;o.dailyLogPage=o.requestPagePrefix+o.formatDate("YYYY/MM/DD");o.tag="{{delete|reason=%PARAMETER%|subpage="+requestPage+o.formatDate("|year=YYYY|month=MON|day=DAY}}\n");switch(nsNumber){case 8:o.tag='/*'+o.tag+'*/';break;case 10:case 100:case 106:o.tag='<noinclude>'+o.tag+'</noinclude>';break;}o.img_summary='Nominating for deletion';o.talk_tag='{'+'{subst:idw|'+requestPage+'}}';o.talk_summary="[[:"+o.pageName+"]] has been nominated for deletion";o.subpage_summary='Starting deletion request';o.addTask('findCreator');o.addTask(
'prependTemplate');o.addTask('createRequestSubpage');o.addTask('listRequestSubpage');o.addTask('notifyUploaders');o.addTask('reloadPage');var lazyLoadNode=o.createLazyLoadNode(o.i18n.moreInformation,'MediaWiki:Gadget-AjaxQuickDelete.js/DeleteInfo','#AjaxQuickDeleteDeleteInfo');o.prevDRNode=$('<ul>').attr('id','AjaxDeletePrevRequests');o.secureCall('checkForFormerDR');var toAppend=$('<div>').append($('<div>').attr('class','ajaxDeleteLazyLoad').css({'max-height':Math.max(Math.round($(window).height()/2)-250,100),'min-height':0,overflow:'auto'}).append(o.prevDRNode),'<br/>',lazyLoadNode);o.prompt([{message:'',prefill:o.reason||'',returnvalue:'reason',cleanUp:true,noEmpty:true,appendNode:toAppend,parseReason:true}],o.i18n.reasonForDeletion);});},checkForFormerDR:function(){if(nsNumber%2===0){this.talkPage=mw.config.get('wgFormattedNamespaces')[nsNumber+1]+':'+this.pageName.replace(canonicalNs+':','');this.queryAPI({action:'query',prop:'templates',titles:this.talkPage,tltemplates:
'Template:Kept',tllimit:1},'formerDRTalk');}this.queryAPI({action:'query',list:'backlinks',bltitle:this.pageName,blnamespace:4,blfilterredir:'nonredirects',bllimit:500},'formerDRRequestpage');},formerDRTalk:function(r){var pgs=r.query.pages;$.each(pgs,function(id,pg){if($.isArray(pg.templates)){$('<li>').append($('<a>',{text:AQD.i18n.keptAfterDR,href:mw.util.wikiGetlink(AQD.talkPage)})).prependTo(AQD.prevDRNode);}else if(undefined===pg.missing){$('<li>').append($('<a>',{text:AQD.i18n.hasTalkpage,href:mw.util.wikiGetlink(AQD.talkPage)})).appendTo(AQD.prevDRNode);}});},formerDRRequestpage:function(r){var bls=r.query.backlinks;var _addItem=function(t,m,bl){$('<li>').append($('<a>',{text:t.replace('%PAGE%',bl.title),href:mw.util.wikiGetlink(bl.title)}))[m](AQD.prevDRNode);};$.each(bls,function(i,bl){if(this.requestPage===bl.title){_addItem(AQD.i18n.mentionedInDR,'prependTo',bl);}else if(/^Commons:Deletion requests\/\D/.test(bl.title)){_addItem(AQD.i18n.mentionedInDR,'appendTo',bl);}else if
(/^Commons:Village pump\//.test(bl.title)){_addItem(AQD.i18n.mentionedInForum,'appendTo',bl);}});},renderNode:function($node,remotecontent,selector){if(selector)selector=' '+selector;$node.load(mw.config.get('wgScript')+'?'+$.param({'action':'render','title':remotecontent,'uselang':mw.config.get('wgUserLanguage')})+(selector||''),function(){$node.find('a').each(function(i,el){var $el=$(el);$el.attr('href',$el.attr('href').replace('MediaWiki:Anoneditwarning',mw.config.get('wgPageName')));});});return $node;},createLazyLoadNode:function(label,page,selector){return $('<div>',{style:'min-height:40px;'}).append($('<a>',{'href':'#','text':label}).click(function(e){e.preventDefault();var $content=$(this).parent().find('.ajaxDeleteLazyLoad');var $contentInner=$content.find('.ajax-quick-delete-loading');if($contentInner.length){AQD.renderNode($content,$contentInner.data('aqdPage'),selector);}$content.toggle('fast');}),$('<div>',{'class':'ajaxDeleteLazyLoad','style':'display:none;'}).append($(
'<span>',{'class':'ajax-quick-delete-loading','text':this.i18n.loading}).data('aqdPage',page)));},extractFromHTML:function(DOMElement){var $el=$(DOMElement);this.templateRegExp=$el.parent().find('.ctdr-regex').text();var m=this.templateRegExp.match(/^\/(.+)\/(i)?$/);if(!m||!m[1]){var err=new Error('The template does not expose a valid regular expression for {{X-To-DR}}. Go the the template and fix it there.');this.fail(err);throw err;}this.templateRegExp=new RegExp(m[1],m[2]);var template=$el.parent().find('.ctdr-template-name').text();this.reason="This file was initially tagged by %USER%"+(template?(" as '''"+template+"'''"):"");this.declineReason=$el.parent().find('.ctdr-template-decline-reason').text();},removeProgress:function(){this.showProgress();return this.nextTask();},_removeAnyTag:function(e){AQD.extractFromHTML(this);AQD.removeAnyTag();return false;},removeAnyTag:function(){this.initialize();this.addTask('declineRequest');this.nextTask();},_convertToDR:function(e){AQD.
extractFromHTML(this);AQD.convertToDR();return false;},convertToDR:function(){this.initialize();this.addTask('findTemplateAdder');this.addTask('getMoveToken');this.addTask('removeTemplate');this.addTask('removeProgress');this.addTask('nominateForDeletion');this.declineReason="This file does not qualify for [[COM:SPEEDY|speedy-deletion]] and a regular deletion request will be started.";$('.convert-to-dr').hide();this.nextTask();},findTemplateAdder:function(){var query={action:'query',prop:'revisions',rvprop:'user|content',titles:pageName.replace(/_/g,' '),rvlimit:50};this.queryAPI(query,'findTemplateAdderCB');},findTemplateAdderCB:function(result){var m,reason,user,template;$.each(result.query.pages,function(id,pg){$.each(pg.revisions,function(iRv,rv){m=rv['*'].match(AQD.templateRegExp);if(m){user=rv.user;if(m.length>1&&!template)template=m[1];if(m.length>2&&!reason)reason=m[2];}else{return false;}});});if(!user)throw new Error(
"Unable to find the person who added the template. This can occur if the template was already removed, the page is deleted or a redirect to the template is used. In this case you must add the redirect to the RegExp of the target template.");this.reason=this.reason.replace('%USER%',"[[User:"+user+"|"+user+"]]");if(template)this.reason+=" ("+template+")";if(reason)this.reason+=" and the most recent rationale was: <tt>"+reason+"</tt>";this.nextTask();},processDupes:function(){this.initialize();if($('#globalusage').length||!$('#mw-imagepage-nolinkstoimage').length)this.inUse=true;this.addTask('getDupeDetails');this.addTask('compareDetails');this.addTask('mergeDescriptions');this.addTask('saveDescription');if(this.inUse)this.addTask('replaceUsage');this.addTask('deletePage');this.addTask('redirectPage');this.addTask('reloadPage');this.destination=$('#AjaxDupeDestination').text();this.nextTask();},getDupeDetails:function(){var query={action:'query',prop:'imageinfo|revisions|info',rvprop:
'content|timestamp',intoken:'edit|delete',iiprop:'size|sha1|url',iiurlwidth:365,titles:pageName.replace(/_/g,' ')+'|'+this.destination};this.queryAPI(query,'getDupeDetailsCB');this.showProgress('Fetching details');},getDupeDetailsCB:function(result){var pages,id,v,ii,n;pages=result.query.pages;this.details=[];for(id in pages){if(pages.hasOwnProperty(id)){v=pages[id];if(!v.imageinfo){this.disableReport=true;if($.trim(v.title)==='{{{1}}}'){throw new Error("Error in the duplicate-template, check your language version! (v.imageinfo is undefined)");}else{throw new Error("Retrieving information about "+v.title+" failed. It is possible that it is deleted, the last revision is corrupt or the file is a redirect. (v.imageinfo is undefined)");}}ii=v.imageinfo[0];n={};this.details.push(n);n.title=v.title;n.size=ii.size;n.width=ii.width;n.height=ii.height;n.thumburl=ii.thumburl;n.thumbwidth=ii.thumbwidth;n.thumbheight=ii.thumbheight;n.descriptionurl=ii.descriptionurl;n.sha1=ii.sha1;n.content=v.
revisions[0]['*'];n.starttimestamp=v.starttimestamp;this.edittoken=v.edittoken;this.deletetoken=v.deletetoken;}}if(this.details[0].title!==pageName.replace(/_/g,' '))this.details.reverse();this.nextTask();},prependTemplate:function(){var page={};page.title=this.pageName;page.text=this.tag;page.editType='prependtext';if(window.AjaxDeleteWatchFile)page.watchlist='watch';this.showProgress(this.i18n.addingAnyTemplate);this.savePage(page,this.img_summary,'nextTask');},createRequestSubpage:function(){this.templateAdded=true;var page={};page.title=this.requestPage;page.text="\n=== [[:"+this.pageName+"]] ===\n"+this.reason+" ~~"+"~~\n";page.watchlist='watch';page.editType='appendtext';this.showProgress(this.i18n.creatingNomination);this.savePage(page,this.subpage_summary,'nextTask');},listRequestSubpage:function(){var page={};page.title=this.dailyLogPage;page.text="\n{{"+this.requestPage+"}}\n";page.watchlist='nochange';page.editType='appendtext';this.showProgress(this.i18n.listingNomination);
this.savePage(page,"Listing [["+this.requestPage+"]]",'nextTask');},notifyUploaders:function(){this.uploadersToNotify=0;for(var user in this.uploaders){if(this.uploaders.hasOwnProperty(user)){if(user===mw.config.get('wgUserName'))continue;var page={};page.title=this.userTalkPrefix+user;page.text="\n"+this.talk_tag+" ~~"+"~~\n";page.editType='appendtext';page.redirect=true;if(window.AjaxDeleteWatchUserTalk)page.watchlist='watch';this.savePage(page,this.talk_summary,'uploaderNotified');this.showProgress(this.i18n.notifyingUploader.replace('%USER%',user));this.uploadersToNotify++;}}if(this.uploadersToNotify===0)this.nextTask();},uploaderNotified:function(){this.uploadersToNotify--;if(this.uploadersToNotify===0)this.nextTask();},findCreator:function(){var query;if(nsNumber===6){query={action:'query',prop:'imageinfo|revisions|info',rvprop:'content|timestamp',intoken:'edit',iiprop:'user|sha1|comment',iilimit:50,titles:this.pageName};}else{query={action:'query',prop:'info|revisions',rvprop:
'user|timestamp',rvlimit:1,rvdir:'newer',intoken:'edit',titles:this.pageName};}this.showProgress(this.i18n.preparingToEdit);this.queryAPI(query,'findCreatorCB');},findCreatorCB:function(result){this.uploaders={};var pages=result.query.pages;for(var id in pages){if(pages.hasOwnProperty(id)){this.edittoken=pages[id].edittoken;if(!pages[id].revisions){this.disableReport=true;throw new Error('The page you are attempting to add a tag to was deleted or moved. Unable to retrieve the content.');}if(nsNumber!==6||!pages[id].imageinfo){this.pageCreator=pages[id].revisions[0].user;this.starttimestamp=pages[id].starttimestamp;this.timestamp=pages[id].revisions[0].timestamp;if(undefined!==this.pageCreator){this.uploaders[this.pageCreator]=true;}}else{var info=pages[id].imageinfo;var content=pages[id].revisions[0]['*'];var seenHashes={};for(var i=info.length-1;i>=0;i--){if(info[i].sha1&&seenHashes[info[i].sha1])continue;seenHashes[info[i].sha1]=true;this.excludedBots=['FlickreviewR','Rotatebot',
'Cropbot','Picasa Review Bot','Reedy RotateBot'];if(-1!==$.inArray(info[i].user,this.excludedBots))continue;var match=mw.libs.commons.getUploadBotUser(info[i].user,content,info[i].comment);if(match){this.uploaders[match]=true;}}}}}this.nextTask();},getMoveToken:function(){var query={action:'query',prop:'info|revisions|imageinfo',rvprop:'content|timestamp',iiprop:'mime',intoken:'edit|move',inprop:'watched',titles:pageName};this.showProgress(this.i18n.preparingToEdit);this.queryAPI(query,'getMoveTokenCB');},getMoveTokenCB:function(result){var pages=result.query.pages;for(var id in pages){if(pages.hasOwnProperty(id)){var pg=pages[id];if(!pg.revisions){this.disableReport=true;throw new Error("The page you are attempting to modify or move is corrupted, was deleted or moved: Unable to retrieve history and contents.");}this.edittoken=pg.edittoken;this.movetoken=pg.movetoken;this.pageContent=pg.revisions[0]['*'];this.starttimestamp=pg.starttimestamp;this.timestamp=pg.revisions[0].timestamp;if(
undefined!==pg.watched){this.pageWasWatched=true;}if(pg.imageinfo&&pg.imageinfo.length&&pg.imageinfo[0].mime){this.fileMime=pg.imageinfo[0].mime.replace('image/jpeg','jpg').replace(/image\/(?:(png)|(gif)|x-(xcf)|vnd\.(djvu)|(svg)\+xml|(tif)f)/,'$1').replace(/application\/(ogg|pdf)/,'$1').replace('audio\/midi','mid');if(this.fileMime.length>5)this.fileMime='';}}}this.nextTask();},doesFileExist:function(){var toCheck=this.cleanFileName(this.destination).replace(/^File:/,'');var query={'action':'query','list':'allpages','apfrom':toCheck,'apto':toCheck,'apnamespace':6};this.showProgress(this.i18n.checkFileExists);this.queryAPI(query,'doesFileExistCB');},doesFileExistCB:function(result){if(!result||!result.query||!result.query.allpages)throw new Error('Checking file name: result.query.allpages is undefined.');if(result.query.allpages[0]){if(this.fileNameExistsCB)this[this.fileNameExistsCB](result.query.allpages[0].title.replace(/^File:/,''));return;}this.nextTask();},removeTemplate:function
(){var page={};this.replaceWith=(this.replaceWith||(this.templateRegExp?'':'$1$2'));page.title=(this.destination||pageName);page.text=$.trim(this.pageContent.replace((this.templateRegExp||/(?:([^\=])\n)?\{\{(?:rename|rename media|move)\|.*?\}\}(?:\n([^\=]))?/i),this.replaceWith))||"{{subst:nld}}";page.editType='text';page.starttimestamp=this.starttimestamp;page.timestamp=this.timestamp;page.watchlist='nochange';this.showProgress(this.i18n.removingTemplate);this.savePage(page,(this.declineReason||"Removing template; rename done"),'nextTask');},replaceUsage:function(){var page={};page.title='User:CommonsDelinker/commands';if(this.userRights==='filemover'){page.title='User:CommonsDelinker/commands/filemovers';this.reason=this.reason.replace(/\{/g,'&#123;').replace(/\}/g,'&#125;').replace(/\=/g,'&#61;');}if(!this.details)this.reason='[[COM:FR|File renamed]]: '+this.reason.replace(/\[\[Commons:File[_ ]renaming[^\[\]]*\]\]:? ?/i,'');page.text='\n{{universal replace|'+pageName.replace('File:'
,'')+'|'+this.destination.replace('File:','')+'|reason='+this.reason+'}}';page.editType='appendtext';page.watchlist='nochange';this.showProgress(this.i18n.replacingUsage);this.savePage(page,'universal replace: [[:'+pageName+']] → [[:'+this.destination+']]','nextTask');},redirectPage:function(){var page={};page.title=pageName;page.text='#REDIRECT [['+this.destination+']]';page.editType='text';this.showProgress(this.i18n.redirectingFile);this.savePage(page,'Redirecting to duplicate file','nextTask');},saveDescription:function(){var page={};page.title=this.destination;page.text=this.newPageText;page.editType='text';this.showProgress(this.i18n.savingDescription);this.savePage(page,'Merging details from duplicate ([['+pageName+']])','nextTask');},prompt:function(questions,title,width){var o=this;var dlgButtons={};dlgButtons[this.i18n.submitButtonLabel]=function(){$.each(questions,function(i,v){var response=$('#AjaxQuestion'+i).val();if(v.type==='checkbox')response=$('#AjaxQuestion'+i).
attr('checked');if(v.cleanUp){if(v.returnvalue==='reason')response=AQD.cleanReason(response);if(v.returnvalue==='destination')response=AQD.cleanFileName(response);}AQD[v.returnvalue]=response;if(v.returnvalue==='reason'&&AQD.tag){AQD.tag=AQD.tag.replace('%PARAMETER%',response);if(AQD.talk_tag)AQD.talk_tag=AQD.talk_tag.replace('%PARAMETER%',response);AQD.img_summary=AQD.img_summary.replace('%PARAMETER%',response);AQD.img_summary=AQD.img_summary.replace('%PARAMETER-LINKED%','[[:'+response+']]');}});$(this).dialog('close');AQD.nextTask();};dlgButtons[this.i18n.cancelButtonLabel]=function(){$(this).dialog('close');};var $submitButton,$cancelButton;var $AjaxDeleteContainer=$('<div>',{id:'AjaxDeleteContainer'});var _convertToTextarea=function(e){var $el=$(this),$input=$el.data('toConvert'),$tarea=$('<textarea>',{id:$input.attr('id'),style:'height:10em; width:98%; display:none;'});$el.unbind();$el.fadeOut();$input.parent().prepend($tarea.data('v',$input.data('v')).data('parserResultNode',
$input.data('parserResultNode')).val($input.val()).keyup(_parseReason).bind('keyup input',_validateInput));$tarea.slideDown();$input.remove();};var _parseReason=function(event){var $el=$(this),$parserResultNode=$el.data('parserResultNode');if(!$parserResultNode)return;$parserResultNode.css('color','#877');var _gotParsedText=function(r){try{$parserResultNode.html(r);$parserResultNode.css('color','#000');}catch(ex){}};mw.loader.using(['ext.gadget.libAPI'],function(){mw.libs.commons.api.parse($el.val(),mw.config.get('wgUserLanguage'),pageName,_gotParsedText);});};var _validateInput=function(event){var $el=$(this),v=$el.data('v');if(v.noEmpty){if($.trim($el.val()).length<(v.minLength||10)){$submitButton.button('option','disabled',true);}else{$submitButton.button('option','disabled',false);}}if(('TEXTAREA'!==$el.prop('nodeName'))&&(event.which===13)&&(v.enterToSubmit!==false)&&!$submitButton.button('option','disabled'))$submitButton.click();};$.each(questions,function(i,v){v.type=(v.type||
'text');if(v.type==='textarea'){$AjaxDeleteContainer.append('<label for="AjaxQuestion'+i+'">'+v.message+'</label>').append('<textarea rows=20 id="AjaxQuestion'+i+'">');}else{$AjaxDeleteContainer.append('<label for="AjaxQuestion'+i+'">'+v.message+'</label>').append('<input type="'+v.type+'" id="AjaxQuestion'+i+'" style="width:97%;">');}var curQuestion=$AjaxDeleteContainer.find('#AjaxQuestion'+i);if(v.parseReason){var $parserResultNode=$('<div>',{id:'AjaxQuestionParse'+i,html:' '});$AjaxDeleteContainer.append('<br><label for="AjaxQuestionParse'+i+'">'+o.i18n.previewLabel+'</label>').append($parserResultNode);curQuestion.data('parserResultNode',$parserResultNode).keyup(_parseReason);}if(v.type!=='textarea')$AjaxDeleteContainer.append('<br><br>');if(v.appendNode){$AjaxDeleteContainer.append(v.appendNode);}if('number'===typeof v.byteLimit){mw.loader.using('jquery.byteLimit',function(){curQuestion.byteLimit(v.byteLimit);});}curQuestion.data('v',v);curQuestion.bind('keyup input',
_validateInput);curQuestion.val(v.prefill);if(v.type==='checkbox')curQuestion.attr('checked',v.prefill).attr('style','margin-left: 5px');});if(mw.user.anonymous()){AQD.renderNode($('<div>',{id:'ajaxDeleteAnonwarning'}),'MediaWiki:Anoneditwarning').appendTo($AjaxDeleteContainer);}var $dialog=$('<div></div>').append($AjaxDeleteContainer).dialog({width:(width||600),modal:true,title:title,dialogClass:"wikiEditor-toolbar-dialog",close:function(){$(this).dialog("destroy");$(this).remove();},buttons:dlgButtons,open:function(){var $buttons=$(this).parent().find('.ui-dialog-buttonpane button');$submitButton=$buttons.eq(0).specialButton('proceed');$cancelButton=$buttons.eq(1).specialButton('cancel');}});$.each(questions,function(i,v){var curQuestion=$AjaxDeleteContainer.find('#AjaxQuestion'+i);curQuestion.keyup();if(v.type==='text'){var $q=curQuestion.wrap('<div style="position:relative;">').parent();var $i=$.createIcon('ui-icon-arrow-4-diag').attr('title','Expand to textarea');$('<span>',{
'class':'ajaxTextareaConverter'}).append($i).appendTo($q).data('toConvert',curQuestion).click(_convertToTextarea);}});$('#AjaxQuestion0').focus().select();},compareDetails:function(){var d=this.details[0],f=this.details[1],$submitButton,$inverseButton,$cancelButton,$swapButton,$overlayButton;this.showProgress();if(d.sha1===f.sha1){this.exactDupes=true;this.nextTask();return;}var $imgD=$('<div>').append($('<img>',{src:d.thumburl,height:d.thumbheight,width:d.thumbwidth}),$('<div>',{id:'AjaxDeleteImgDel',html:Math.round(d.size/1000)+' KiB <br>'+d.width+'×'+d.height+'<br>'}).append($('<a>',{href:d.descriptionurl,text:d.title,target:'_blank'})));var $imgF=$('<div>').append($('<img>',{src:f.thumburl,height:f.thumbheight,width:f.thumbwidth}),$('<div>',{id:'AjaxDeleteImgKeep',html:Math.round(f.size/1000)+' KiB <br>'+f.width+'×'+f.height+'<br>'}).append($('<a>',{href:f.descriptionurl,text:f.title,target:'_blank'})));var dlgButtons={};dlgButtons[this.i18n.submitButtonLabel]=function(){$(this).
dialog("close");AQD.nextTask();};dlgButtons[this.i18n.inverseButtonLabel]=function(){$(this).dialog("close");AQD.destination=pageName.replace(/_/g,' ');pageName=f.title;AQD.details.reverse();setTimeout(function(){AQD.compareDetails();},10);};dlgButtons[this.i18n.swapImagesButtonLabel]=function(){if($imgD[0].nextSibling===$imgF[0]){$imgD.before($imgF);}else{$imgF.before($imgD);}};var $fClone;dlgButtons[this.i18n.overlayButtonLabel]=function(){if($fClone){$fClone.remove();$fClone=0;}else{$fClone=$imgF.clone().appendTo($imgF.parent());$fClone.css('position','absolute');var pos=$imgD.position();$fClone.css('top',pos.top-1);$fClone.css('left',pos.left-1);$fClone.fadeTo(0,0.65);mw.loader.using(['jquery.ui.draggable','jquery.ui.resizable'],function(){$fClone.css('background','rgba(200, 200, 200, 0.5)').css('width','auto').css('border','1px solid #0c9').draggable();$fClone.find('img').resizable();$fClone.children('div').fadeTo(0,0.7);});}};var $AjaxDupeContainer=$('<div>',{id:
'AjaxDupeContainer'}).append($imgD,$imgF);var $dialog=$('<div></div>').append($AjaxDupeContainer).dialog({width:800,modal:true,title:this.i18n.compareDetails,draggable:false,dialogClass:"wikiEditor-toolbar-dialog",close:function(){$(this).dialog("destroy");$(this).remove();},buttons:dlgButtons,open:function(){var $buttons=$(this).parent().find('.ui-dialog-buttonpane button');$submitButton=$buttons.eq(0).specialButton('proceed');$inverseButton=$buttons.eq(1).button({icons:{primary:'ui-icon-refresh'}});$swapButton=$buttons.eq(2).button({icons:{primary:'ui-icon-transfer-e-w'}});$overlayButton=$buttons.eq(3).button({icons:{primary:'ui-icon-newwin'}});$swapButton.css('float',(('left'===$swapButton.css('float'))?'right':'left'));$overlayButton.css('float',(('left'===$overlayButton.css('float'))?'right':'left'));}});},mergeDescriptions:function(){this.prompt([{message:'',prefill:this.details[0].content,returnvalue:'discard',cleanUp:false,noEmpty:false,type:'textarea',enterToSubmit:false},{
message:'',prefill:this.details[1].content,returnvalue:'newPageText',cleanUp:false,noEmpty:false,type:'textarea',enterToSubmit:false}],this.i18n.mergeDescription,800);this.destination=this.details[1].title;this.reason='Exact or scaled-down duplicate: [[:'+this.destination+']]';},cleanFileName:function(uncleanName){uncleanName=uncleanName.replace(/^(?:Image|File):/i,'');uncleanName=uncleanName.replace(/\.\w{3,4}$/,function($e){return $e.toLowerCase();});uncleanName=uncleanName.replace(/\.jpe*g$/,'.jpg');uncleanName=uncleanName.replace(/~{3,}/g,'').replace(/\s+|_/g,' ').replace(/[\x00-\x1f\x7f]/g,'').replace(/%([0-9A-Fa-f]{2})/g,'% $1').replace(/&(([A-Za-z0-9\x80-\xff]+|#[0-9]+|#x[0-9A-Fa-f]+);)/g,'& $1').replace(/[:\/|#]/g,'-').replace(/[\]\}>]/g,')').replace(/[\[\{<]/g,'(');var currentExt=pageName.toLowerCase().replace(/.*?\.(\w{3,4})$/,'$1').replace('jpeg','jpg');if(this.fileMime){currentExt=('ogg'===this.fileMime&&('oga'===currentExt||'ogv'===currentExt))?currentExt:this.fileMime;}
var reCurrentExt=new RegExp('\\.'+currentExt+'$','i');if(!reCurrentExt.test(uncleanName.toLowerCase()))uncleanName+='.'+currentExt;return'File:'+$.ucFirst(uncleanName);},cleanReason:function(uncleanReason){uncleanReason=uncleanReason.replace(/^\s*(.+)\s*$/,'$1');uncleanReason=uncleanReason.replace(/(?:\-\-|–|—)? ?~{3,5}$/,'').replace(/^~{3,5} ?/,'');return uncleanReason;},showProgress:function(message){if(!message){if(this.progressDialog)this.progressDialog.remove();this.progressDialog=0;document.body.style.cursor='default';return;}if($('#feedbackContainer').length){$('#feedbackContainer').html(message);}else{document.body.style.cursor='wait';this.progressDialog=$('<div></div>').html('<div id="feedbackContainer">'+(message||this.i18n.preparingToEdit)+'</div>').dialog({width:450,height:90,minHeight:90,modal:true,resizable:false,draggable:false,closeOnEscape:false,dialogClass:'ajaxDeleteFeedback',open:function(){$(this).parent().find('.ui-dialog-titlebar').hide();},close:function(){$
(this).dialog("destroy");$(this).remove();}});}},savePage:function(page,summary,callback){mw.user.tokens.set('editToken',AQD.edittoken);var edit={cb:function(r){AQD.secureCall(callback,r);},errCb:function(t,r,q){AQD.fail(t);},title:page.title,summary:summary,watchlist:(page.watchlist||'preferences'),editType:page.editType,text:page.text};if(page.redirect)edit.redirect=true;mw.loader.using(['ext.gadget.libAPI'],function(){mw.libs.commons.api.editPage(edit);});},movePage:function(){mw.user.tokens.set('moveToken',AQD.movetoken);if(AQD.cleanFileName(pageName)===AQD.destination)return AQD.nextTask();mw.loader.using(['ext.gadget.libAPI'],function(){var moveArgs={cb:function(){AQD.nextTask();},errCb:function(t,r,q){AQD.fail(t);},from:pageName,to:AQD.destination,reason:AQD.reason,movetalk:true,watchlist:AQD.pageWasWatched?'watch':'nochange'};if(AQD.wpLeaveRedirect===false){moveArgs.noredirect=true;}AQD.showProgress(AQD.i18n.movingFile);mw.libs.commons.api.movePage(moveArgs);});},deletePage:
function(){mw.user.tokens.set('deleteToken',AQD.deletetoken);mw.loader.using(['ext.gadget.libAPI'],function(){AQD.showProgress(AQD.i18n.deletingFile);mw.libs.commons.api.deletePage({cb:function(){AQD.nextTask();},errCb:function(t,r,q){AQD.fail(t);},title:pageName,reason:AQD.reason});});},queryAPI:function(params,callback){mw.loader.using(['ext.gadget.libAPI'],function(){mw.libs.commons.api.query(params,{method:'POST',cache:false,cb:function(r){AQD.secureCall(callback,r);},errCb:function(t,r,q){AQD.fail(t);}});});},secureCall:function(fn){var o=AQD;try{o.currentTask=arguments[0];if($.isFunction(fn)){return fn.apply(o,Array.prototype.slice.call(arguments,1));}else if('string'===typeof fn){return o[fn].apply(o,Array.prototype.slice.call(arguments,1));}else{o.fail('This is not a function!');}}catch(ex){o.fail(ex);}},tasks:[],currentTask:'',addTask:function(task){this.tasks.push(task);},nextTask:function(){this.secureCall(this.tasks.shift());},retryTask:function(){this.secureCall(this.
currentTask);},reloadPage:function(){this.showProgress();if(this.pageName&&this.pageName.replace(/ /g,'_')!==pageName)return;var encTitle=(this.destination||pageName);encTitle=encodeURIComponent(encTitle.replace(/ /g,'_')).replace(/%2F/ig,'/').replace(/%3A/ig,':');location.href=mw.config.get('wgServer')+mw.config.get('wgArticlePath').replace("$1",encTitle);},fail:function(err){var o=this;if(typeof err==='object'){var stErr=err.message+' \n\n '+err.name;if(err.lineNumber)stErr+=' @line'+err.lineNumber;err=stErr;}var msg=this.i18n.taskFailure[this.currentTask]||this.i18n.genericFailure;var fix='';if(this.img_summary==='Nominating for deletion'){fix=(this.templateAdded?this.i18n.completeRequestByHand:this.i18n.addTemplateByHand);}var dlgButtons={};dlgButtons[this.i18n.retryButtonLabel]=function(){$(this).remove();o.retryTask();};if(-1!==$.inArray(o.currentTask,['movePage','deletePage','notifyUploaders'])&&(/code 50\d/.test(err)||/missingtitle/.test(err))){dlgButtons[this.i18n.
ignoreButtonLabel]=function(){$(this).remove();o.nextTask();};}if(!this.disableReport){dlgButtons[this.i18n.reportButtonLabel]=function(){$('#feedbackContainer').contents().remove();$('#feedbackContainer').append($('<img>',{src:'//bits.wikimedia.org/skins-1.5/common/images/ajax-loader.gif'})).css('text-align','center');var randomId=Math.round(Math.random()*1099511627776);var toSend='\n== Autoreport by AjaxQuickDelete '+randomId+' ==\n'+err+'\n++++\n:Task: '+o.currentTask+'\n:NextTask: '+o.tasks[0]+'\n:LastTask: '+o.tasks[o.tasks.length-1]+'\n:Page: '+(o.pageName||pageName)+'\n:Skin: '+mw.user.options.get('skin')+'\n:[{{fullurl:Special:Contributions|target={{subst:urlencode:{{subst:REVISIONUSER}}}}&offset={{subst:REVISIONTIMESTAMP}}}} Contribs before error]';$.post(o.apiURL,{'action':'edit','format':'json','title':'MediaWiki talk:Gadget-AjaxQuickDelete.js/auto-errors','summary':'[[#Autoreport by AjaxQuickDelete '+randomId+'|Reporting an AjaxQuickDelete error.]] Random ID='+randomId,
'appendtext':toSend,'token':(o.edittoken||mw.user.tokens.get('editToken'))},function(){o.reloadPage();});};}dlgButtons[this.i18n.abortButtonLabel]=function(){$(this).remove();};this.disableReport=false;this.showProgress();this.progressDialog=$('<div>').append($('<div>',{id:'feedbackContainer',html:(msg+' '+fix+'<br>'+this.i18n.errorDetails+'<br>'+mw.html.escape(err)+'<br>'+(this.tag?(this.i18n.tagWas+this.tag):'')+'<br><a href="'+mw.util.wikiGetlink('MediaWiki talk:AjaxQuickDelete.js')+'" >'+this.i18n.errorReport+'</a>')})).dialog({width:550,modal:true,closeOnEscape:false,title:this.i18n.errorDlgTitle,dialogClass:"ajaxDeleteError",buttons:dlgButtons,close:function(){$(this).dialog("destroy");$(this).remove();}});},formatDate:function(fmt,date){return mw.libs.commons.formatDate(fmt,date,(mw.libs.commons.api&&mw.libs.commons.api.getCurrentDate()||new Date()));},requestPagePrefix:"Commons:Deletion requests/",userTalkPrefix:mw.config.get('wgFormattedNamespaces')[3]+":",apiURL:mw.util.
wikiScript('api'),apiErrorThreshold:10,i18n:{toolboxLinkDelete:"Nominate for deletion",toolboxLinkDiscuss:"Nominate category for discussion",reasonForDeletion:"Why should this file be deleted?",reasonForDiscussion:"Why does this category need discussion?",moreInformation:"More information",loading:"Loading...",keptAfterDR:"This page was kept after a deletion request. Please contact the administrator who kept it before re-nominating.",hasTalkpage:"There is a talk page. Consider reading it or adding your remarks.",mentionedInDR:"Consider reading the deletion debate –%PAGE%– that links to this page.",mentionedInForum:"On %PAGE%, this page is part of a discussion.",previewLabel:"Preview:",submitButtonLabel:"Proceed",cancelButtonLabel:"Cancel",abortButtonLabel:"Abort",reportButtonLabel:"Report automatically",retryButtonLabel:"Retry",ignoreButtonLabel:"Ignore and continue",inverseButtonLabel:"Inverse. Keep this delete other",swapImagesButtonLabel:"Swap to compare",overlayButtonLabel:
"Overlay to compare",preparingToEdit:"Preparing to edit pages... ",creatingNomination:"Creating nomination page... ",listingNomination:"Adding nomination page to daily list... ",addingAnyTemplate:"Adding template to "+canonicalNs.toLowerCase()+" page... ",notifyingUploader:"Notifying %USER%... ",toolboxLinkSource:"No source",toolboxLinkLicense:"No license",toolboxLinkPermission:"No permission",toolboxLinkCopyvio:"Report copyright violation",reasonForCopyvio:"Why is this file a copyright violation?",notAllowed:"You do not have the neccessary rights to move files",reasonForMove:"Why do you want to move this file?",moveDestination:"What should be the new file name?",moveOtherDestination:"The name you have specified exists. Choose a new name, please.",checkFileExists:"Checking whether file exists",movingFile:"Moving file",replacingUsage:"Ordering CommonsDelinker to replace all usage",dropdownMove:"Move & Replace",leaveRedirect:"Leave a redirect behind:",moveAndReplace:
"Move file and replace all usage",removingTemplate:"Removing template",declineRequest:"Why do you want to decline the request?",anyDecline:"Decline request",deletingFile:"Deleting file",compareDetails:"Please compare the images before merging the descriptions. The image with the bold text will be deleted.",mergeDescription:"Please now merge the file descriptions",redirectingFile:"Redirecting file",savingDescription:"Saving new details",errorDlgTitle:"Error",genericFailure:"An error occurred while trying to do the requested action. ",taskFailure:{listUploaders:"An error occurred while determining the "+(nsNumber===6?" uploader(s) of this file":"creator of this page")+".",loadPages:"An error occurred while preparing to nominate this "+canonicalNs.toLowerCase()+" for deletion.",prependDeletionTemplate:"An error occurred while adding the {{delete}} template to this "+canonicalNs.toLowerCase()+".",createRequestSubpage:"An error occurred while creating the request subpage.",
listRequestSubpage:"An error occurred while adding the deletion request to today's log.",notifyUploaders:"An error occurred while notifying the "+(nsNumber===6?" uploader(s) of this file":"creator of this page")+".",movePage:"Error while moving the page.",deletePage:"Error deleting the page."},addTemplateByHand:"To nominate this "+canonicalNs.toLowerCase()+" for deletion, please edit the page to add the {{delete}} template and follow the instructions shown on it.",completeRequestByHand:"Please follow the instructions on the deletion notice to complete the request.",errorDetails:"A detailed description of the error is shown below:",errorReport:"Manually report the error here or click on <tt>Report automatically</tt> to send an automatic error-report.",tagWas:"The tag to be inserted into this page was "}};if(mw.config.get('wgUserLanguage')!=='en'){$.ajax({url:mw.util.wikiScript(),dataType:'script',data:{title:'MediaWiki:Gadget-AjaxQuickDelete.js/'+mw.config.get('wgUserLanguage')+'.js',
action:'raw',ctype:'text/javascript',maxage:2419200,smaxage:2419200},cache:true,success:AQD.install,error:AQD.install});}else{AQD.install();}}(jQuery,mediaWiki));;},{"":
".ajaxDeleteFeedback{border:1px #A9DE16 solid !important;background:#EAF2CB url(//bits.wikimedia.org/skins-1.5/common/images/ajax-loader.gif) no-repeat 8px 14px !important;padding-left:2.85em !important;padding-top:10px !important;font-size:1.1em !important}.ajaxDeleteError{border:1px #DE1616 solid!important;background:#F2CBCB!important;padding-left:0em}.ajaxDeleteDeclineMove{float:right;background:#F2CBCB;padding:0.3em}.ajaxDeleteLazyLoad{min-height:100px;max-height:450px;border:#ddd solid 1px;overflow:auto}#AjaxDupeContainer{position:relative}#AjaxDupeContainer \x3e div{margin:5px;display:inline-block;vertical-align:top;width:365px}#AjaxDeleteContainer textarea{margin:5px;display:inline-block;width:365px;font-size:0.9em}#AjaxDeleteImgDel{color:red;font-weight:bold}#AjaxDeleteImgKeep{color:green} #AjaxQuestionParse,#AjaxQuestionParse0,div[id^=\"AjaxQuestionParse\"]{min-height:50px;max-height:300px;overflow:auto;color:#000;background:#DDD;border:1px solid #EEE} #AjaxQuestion0,#AjaxQuestion1,div[id^=\"AjaxQuestion\"]{direction:ltr} #AjaxQuestionParse a.new,#AjaxQuestionParse0 a.new,div[id^=\"AjaxQuestionParse\"] a.new{color:#BA0000 !important}.ajaxTextareaConverter{position:absolute;right:0px;top:1px;cursor:pointer}\n\n/* cache key: commonswiki:resourceloader:filter:minify-css:7:4a83d7ca731a662e3487865f25753f6a */\n\n"
},{});mw.loader.implement("ext.gadget.ExtraTabs2",function(){window.load_extratabs=false;(function($,mw){"use strict";var title,username,userLang,project,nsSpecial,nsUser,nsUserTalk,nsFile,nsFileTalk,nsCategory,extraTabs;title=mw.config.get('wgTitle');username=title.split('/')[0];userLang=mw.config.get('wgUserLanguage');project='commons.wikimedia.org';nsSpecial=-1;nsUser=2;nsUserTalk=3;nsFile=6;nsFileTalk=7;nsCategory=14;extraTabs={doInjectGroup:function(group){$.each(group,function(i,l){var msg=mw.message('extratabs-'+l.label+'-label'),tooltip=mw.message('extratabs-'+l.label+'-tooltip');msg=msg.exists()?msg.toString():l.label;tooltip=tooltip.exists()?tooltip.toString():l.tooltip;mw.util.addPortletLink(l.portlet,l.target,msg,l.id,tooltip);});},getLinks:function(key){switch(key){case'file':return[{target:mw.util.wikiGetlink('Special:GlobalUsage/'+title),label:'checkusage',portlet:'p-cactions',id:'ca-checkusage'},{target:'//toolserver.org/~daniel/WikiSense/CommonSense.php?'+$.param({
'go-clean':'yes','i':title}),label:'categorize',portlet:'p-cactions',id:'ca-commonsense'},{target:mw.util.wikiScript()+'?'+$.param({page:'File:'+title,title:'Special:Log'}),label:'log',portlet:'p-cactions',id:'ca-log'},{target:mw.util.wikiScript()+'?'+$.param({title:'File:'+title,action:'purge'}),label:'purge',portlet:'p-cactions',id:'ca-purge'}];case'user':return[{target:mw.util.wikiGetlink('Special:ListFiles/'+username),label:'gallery',portlet:'p-cactions',id:'ca-gallery'},{target:'//toolserver.org/~daniel/WikiSense/OrphanImages.php?'+$.param({wiki:project,img_user_text:username}),label:'orphans',portlet:'p-cactions',id:'ca-orphans'},{target:'//toolserver.org/~daniel/WikiSense/UntaggedImages.php?'+$.param({wiki:project,img_user_text:username}),label:'untagged',portlet:'p-cactions',id:'ca-untagged'},{target:'//toolserver.org/~magnus/glamorous.php?'+$.param({doit:'Do it!',username:username}),label:'GLAMorous',portlet:'p-cactions',id:'ca-glamorous'}];case'category':return[{target:
'//toolserver.org/~daniel/WikiSense/CategoryIntersect.php?'+$.param({wiki:project,basecat:title}),label:'catscan',portlet:'p-cactions',id:'ca-catscan'},{target:'//toolserver.org/~platonides/catdown/catdown.php?'+$.param({cat:title,lang:'commons'}),label:'catdown',portlet:'p-cactions',id:'ca-catdown'},{target:'//toolserver.org/~magnus/glamorous.php?'+$.param({doit:'Do it!',category:title}),label:'GLAMorous',portlet:'p-tb',id:'tb-glamorous'}];default:return[];}},init:function(){mw.messages.set({"extratabs-checkusage-label":"Global usage","extratabs-categorize-label":"Find categories","extratabs-log-label":"Log","extratabs-gallery-label":"Gallery","extratabs-orphans-label":"Orphans","extratabs-untagged-label":"Untagged","extratabs-tree-label":"Tree","extratabs-catscan-label":"CatScan","extratabs-catdown-label":"Download all","extratabs-GLAMorous-label":"Usage of all files","extratabs-GLAMorous-tooltip":"Check usage of files (GLAMorous-Tool) on wikis of the Wikimedia Foundation",
"extratabs-blocklog-label":"Block log","extratabs-purge-label":"Purge","extratabs-thumbPurge-label":"Generate thumbnail","extratabs-wplangcode":"en","extratabs-wppage-label":"$1-wiki"});if(userLang!=='en'){importScript('MediaWiki:Gadget-ExtraTabs2.js/'+userLang);}},startInjection:function(){switch(mw.config.get('wgNamespaceNumber')){case nsSpecial:if(mw.config.get('wgCanonicalSpecialPageName')==='Blockip'){username=$('#mw-bi-target').val();if(username){extraTabs.doInjectGroup([{target:mw.util.wikiScript()+'?'+$.param({title:'Special:Log',type:'block',page:'User:'+username}),label:'blocklog',portlet:'p-cactions',id:'ca-blocklog'}]);}}else if(mw.config.get('wgCanonicalSpecialPageName')==='Contributions'){username=document.getElementsByName('target')[0].value;extraTabs.doInjectGroup(extraTabs.getLinks('user'));}break;case nsUser:case nsUserTalk:extraTabs.doInjectGroup(extraTabs.getLinks('user'));break;case nsFile:case nsFileTalk:extraTabs.doInjectGroup(extraTabs.getLinks('file'));if(title
.match(/^d+px-/)){var baseTitle=title.replace(/^d+px-/,'');extraTabs.doInjectGroup([{target:mw.util.wikiGetlink('File:'+baseTitle),label:'unthumb',portlet:'p-cactions',id:'ca-unthumb'}]);}extraTabs.doInjectGroup([{target:'http://'+mw.msg('extratabs-wplangcode')+'.wikipedia.org/wiki/File:'+title,label:mw.msg('extratabs-wppage-label',mw.msg('extratabs-wplangcode')),portlet:'p-cactions',id:'ca-wppage'}]);break;case nsCategory:extraTabs.doInjectGroup(extraTabs.getLinks('category'));break;}}};extraTabs.init();mw.commonsExtraTabs=extraTabs;$(document).ready(extraTabs.startInjection);}(jQuery,mediaWiki));;},{},{});mw.loader.implement("ext.gadget.Long-Image-Names-in-Categories",function(){if((mw.config.get('wgNamespaceNumber')===14||'Newimages'===mw.config.get('wgCanonicalSpecialPageName'))&&mw.config.get('wgAction')==='view'&&!mw.util.getParamValue('diff')){$(function(){'use strict';$('.gallerytext a[title^="File:"]').each(function(){this.innerHTML=this.title.substring(5,this.title.length);})
;});};},{},{});mw.loader.implement("ext.gadget.Stockphoto",function(){(function($,mw,undefined){"use strict";var stockPhoto,clientProfile=$.client.profile();if(window.stockPhoto===undefined&&(mw.config.get('skin')==='vector'||mw.config.get('skin')==='monobook')&&mw.config.get('wgNamespaceNumber')===6&&$.inArray(mw.config.get('wgAction'),['view','purge'])!==-1&&(('msie'!==clientProfile.name)||(('msie'===clientProfile.name)&&clientProfile.versionNumber>7))&&(('opera'!==clientProfile.name)||(('opera'===clientProfile.name)&&parseFloat(clientProfile.version)>9.27))){stockPhoto={ui_icon_download:'//upload.wikimedia.org/wikipedia/commons/thumb/9/92/Gnome-document-save.svg/50px-Gnome-document-save.svg.png',ui_icon_web:'//upload.wikimedia.org/wikipedia/commons/thumb/c/c0/Gnome-emblem-web.svg/50px-Gnome-emblem-web.svg.png',ui_icon_wiki:'//upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Tango_style_Wikipedia_Icon.svg/50px-Tango_style_Wikipedia_Icon.svg.png',ui_icon_email:
'//upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Gnome-mail-send.svg/50px-Gnome-mail-send.svg.png',ui_icon_help:'//upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Dialog-information_on.svg/50px-Dialog-information_on.svg.png',ui_icon_remove:'//upload.wikimedia.org/wikipedia/commons/thumb/9/9d/Emblem-unreadable.svg/20px-Emblem-unreadable.svg.png',information_template_hints:['fileinfotpl_desc','fileinfotpl_src'],icons_only:['midi','ogg','flac'],horizontal_ui:['midi','ogg','flac','pdf','djvu'],ogg_icon:mw.config.get('stylepath')+'/common/images/icons/fileicon-ogg.png',stockphoto_code1:undefined,stockphoto_author:undefined,stockphoto_license:undefined,nicetitle:undefined,file_icon:undefined,file_url:undefined,backlink_url:undefined,attribution:'',fade_target:'',gfdl_note:false,sbm_counter:1,fromCommons:false,attrRequired:true,init:function(){var $enable,has_information,img_width,img_height,xoff,yoff,horizontal,html;if(window.stockphoto_prevent!==undefined){return;}$("#filetoc").find(
"a[href=#file], a[href=#filehistory], a[href=#filelinks], a[href=#metadata], a[href=#globalusage]").parent().addClass("mw-filetoc-links");if($.cookie('StockPhotoDisabled')){$enable=$('<li class="mw-filetoc-links"><a id="SpEnable" href="#enableStockphoto">'+stockPhoto.i18n.reuse+'</a></li>');$enable.click(function(e){e.preventDefault();$.cookie('StockPhotoDisabled',null,{path:'/'});stockPhoto.init();});$("#filetoc").append($enable);return;}if($('#file').length===0){return;}stockPhoto.small_horizontal_layout=false;if(!mw.user.anonymous()){stockPhoto.small_horizontal_layout=true;}has_information=false;$.each(stockPhoto.information_template_hints,function(k,v){if($('#'+v).length!==0){has_information=true;}});if(!has_information){return;}if($('.nuke').length){return;}$('#stockphoto_base').remove();img_width=$('#file img').width();img_height=$('#file img').height();xoff=img_width+40;yoff=$('#file').position().top+5;if(!horizontal&&img_height<300){stockPhoto.small_horizontal_layout=true;}
horizontal=stockPhoto.small_horizontal_layout;$.each(stockPhoto.horizontal_ui,function(k,v){v=new RegExp('\\.'+v+'$','i');if(mw.config.get('wgTitle').match(v)){horizontal=true;}});if($(window).width()<1030){horizontal=true;}stockPhoto.share_this(-1);html='<div id="stockphoto_base" ';if(horizontal){html+=' class="horizontal">';}else if(!$("body.rtl").length){html+="class='vertical' style='left:"+xoff+"px;top:"+yoff+"px'>";}else{html+="class='vertical' style='left: 0px;top:"+yoff+"px'>";}html+=stockPhoto.add_button_row(stockPhoto.ui_icon_download,"call_download",stockPhoto.i18n.download,stockPhoto.i18n.all_sizes,horizontal);html+=stockPhoto.add_button_row(stockPhoto.ui_icon_web,"call_web",stockPhoto.i18n.use_this_file_web_short,stockPhoto.i18n.on_a_website,horizontal);html+=stockPhoto.add_button_row(stockPhoto.ui_icon_wiki,"call_wiki",stockPhoto.i18n.use_this_file_wiki_short,stockPhoto.i18n.on_a_wiki,horizontal);html+=stockPhoto.add_button_row(stockPhoto.ui_icon_email,"send_email",
stockPhoto.i18n.email_link_short,stockPhoto.i18n.to_this_file,horizontal);html+=stockPhoto.add_button_row(stockPhoto.ui_icon_help,"call_help",stockPhoto.i18n.information,stockPhoto.i18n.about_reusing,horizontal);html+='<a title="'+stockPhoto.i18n.remove_icons+'" id="stockphoto_remove"><img src="'+stockPhoto.ui_icon_remove+'" /></a>';html+="</div>";if(stockPhoto.small_horizontal_layout&&$("#file").length){$(".mw-filetoc-links").hide();$("#filetoc").append(html);}else{$("#filetoc").after(html);}$('#stockphoto_remove').click(function(){$.cookie('StockPhotoDisabled',true,{expires:60,path:'/'});$('#stockphoto_base').remove();$(".mw-filetoc-links").show();});$('#stockphoto_base img').parent().fadeTo(0,0.7);$('#stockphoto_base>span').hover(function(){$(this).find('span:first a').fadeTo('fast',1);},function(){$(this).find('span:first a').fadeTo('fast',0.7);});},add_button_row:function(icon_url,fkt,txt,html,horizontal){var imgid,a,ret;if(stockPhoto.small_horizontal_layout){icon_url=icon_url.
replace('/50px-','/20px-');}imgid='stockphoto_icon_'+fkt;a='<a href="#" title="'+txt+' '+html+'" onclick="stockPhoto.'+fkt+'(); return false;">';ret="<span id='stockphoto_"+fkt+"'>";ret+="<span class='stockphoto_buttonrow_icon'>"+a+"<img id='"+imgid+"' src='"+icon_url+"' /></a></span>";ret+="<span class='stockphoto_buttonrow_text'>"+a;if(stockPhoto.small_horizontal_layout){ret+=txt+"</a>";}else{ret+="<b>"+txt+"</b></a><br/>"+html;}ret+="</span></span>";return ret;},stockphoto_get_thumbnail_url:function(width){var thumb_url,alt_title,last;if(stockPhoto.file_icon!==undefined){return stockPhoto.file_icon;}alt_title=mw.config.get('wgCanonicalNamespace')+':'+mw.config.get('wgTitle');$('#file img').each(function(){if($(this).attr('alt')!==alt_title){return;}thumb_url=$(this).attr('src').split('/');});if(!thumb_url&&$('#mwe_ogg_player_1').length){return $('#mwe_ogg_player_1').find('img').attr('src');}if(!thumb_url||thumb_url.length<1){return;}last=thumb_url.pop().replace(/^\d+px-/,width+'px-'
);thumb_url.push(last);thumb_url=thumb_url.join('/');return thumb_url;},is_audio_video_asset:function(url){var ext=url.substr(-3);if(ext==='ogv'||ext==='ogg'||ext==='oga'){return true;}return false;},make_html_textarea:function(e){var width,type,height,thumb_url,t;if(e){e.preventDefault();}width=$('#stockphoto_html_select').val();type=$('input[name="stockphoto_code_type"]:checked').val();if(stockPhoto.is_audio_video_asset(stockPhoto.backlink_url)&&type==='html'){height=$('#mwe_ogg_player_1').width()?width*$('#mwe_ogg_player_1').height()/$('#mwe_ogg_player_1').width():width*$('#file img,#file video').height()/$('#file img,#file video').width();if(height===0){height=20;}$('#stockphoto_html').text('<iframe src="'+stockPhoto.backlink_url+'?withJS=MediaWiki:MwEmbed.js&embedplayer=yes" width="'+width+'" height="'+height+'" frameborder="0" ></iframe>');return;}thumb_url=stockPhoto.stockphoto_get_thumbnail_url(width);if(type==='html'){t='<a title="'+stockPhoto.escapeAttribute(stockPhoto.
complete_attribution_text)+'" href="'+stockPhoto.backlink_url+'"><img width="'+width+'" alt="'+stockPhoto.escapeAttribute(stockPhoto.nicetitle)+'" src="'+thumb_url+'"/></a>';}else if(type==='bbcode'){t="[url="+stockPhoto.backlink_url+"][img]"+thumb_url+"[/img][/url]\n[url="+stockPhoto.backlink_url+"]"+stockPhoto.nicetitle+"[/url]"+stockPhoto.stockphoto_license+", "+stockPhoto.i18n.by+' '+stockPhoto.stockphoto_author+", "+stockPhoto.i18n.from_wikimedia_commons;}$('#stockphoto_html').text(t);},get_author_attribution:function(use_html){var author_element,source_element,author,source;author_element=$("#fileinfotpl_aut + td");source_element=$("#fileinfotpl_src + td");author=$.trim(author_element.text());source=$.trim(source_element.text());if(author_element.find(".boilerplate").length>0){author='';}if(author.match(/^[Uu]nknown$/)){author='';}author=author.replace(/\s*\(talk\)$/i,'');if(author.indexOf('Original uploader was')!==-1){author=author.replace(/\s*Original uploader was\s*/g,'');
stockPhoto.fromCommons=true;}if(source_element.find(".boilerplate").length>0){source='';}if(author!==''&&$('#own-work').length){source='';stockPhoto.fromCommons=true;}if(author!==''&&source.length>50){source='';}if(author.substr(0,3)==='[&#9660;]'){author=author.substr(3);author=$.trim(author.split('Description').shift());}stockPhoto.attribution='';if(author!==''){stockPhoto.attribution=author;}if(source!==''){if(stockPhoto.attribution!==''){stockPhoto.attribution+=' ('+source+')';}else{stockPhoto.attribution=source;}}stockPhoto.stockphoto_author=stockPhoto.attribution;if(author!==''){stockPhoto.attribution=stockPhoto.i18n.by_u+' '+stockPhoto.attribution;}else{stockPhoto.attribution=stockPhoto.i18n.see_page_for_author;}if($('#creator').length){stockPhoto.attribution=$('#creator').text();}if($('.licensetpl_aut').length){if(use_html){stockPhoto.attribution=$('.licensetpl_aut').eq(0).html();}else{stockPhoto.attribution=$('.licensetpl_aut').eq(0).text();}}if($('.licensetpl_attr').length){
if(use_html){stockPhoto.attribution=$('.licensetpl_attr').eq(0).html();}else{stockPhoto.attribution=$('.licensetpl_attr').eq(0).text();}}if($("#fileinfotpl_credit + td").length){if(use_html){stockPhoto.attribution=$("#fileinfotpl_credit + td").html();}else{stockPhoto.attribution=$("#fileinfotpl_credit + td").text();}}},get_license:function(generate_html){var licenses,$readable,l2,l1;licenses=[];$readable=$('.licensetpl');if(!$readable.length){stockPhoto.stockphoto_license="["+stockPhoto.i18n.see_page_for_license+"]";return;}$readable.each(function(){var cL={link:$(this).find('.licensetpl_link').html(),short:$(this).find('.licensetpl_short').html(),long:$(this).find('.licensetpl_long').html(),attr:$(this).find('.licensetpl_attr').html(),aut:$(this).find('.licensetpl_aut').html(),link_req:$(this).find('.licensetpl_link_req').html(),attr_req:$(this).find('.licensetpl_attr_req').html()};if(cL.short!==null){licenses.push(cL);}});if(licenses.length>0){$.each(licenses,function(k,v){if(v.
attr_req==='false'){stockPhoto.attrRequired=false;}if(v.short.indexOf('GFDL')!==-1){stockPhoto.gfdl_note=true;}if(generate_html&&v.link){licenses[k]='<a href="'+v.link+'">'+v.short+'</a>';}else{if(v.link_req==='true'){licenses[k]=v.short+' ('+v.link+')';}else{licenses[k]=v.short;}}});if(licenses.length>1){l2=licenses.pop();l1=licenses.pop();licenses.push(l1+' '+stockPhoto.i18n.or+' '+l2);}stockPhoto.stockphoto_license=' ['+licenses.join(', ')+']';}else{stockPhoto.stockphoto_license=' ['+stockPhoto.i18n.see_page_for_license+']';}},get_attribution_text:function(){var from,html,text;from=stockPhoto.fromCommons?stockPhoto.i18n.from_wikimedia_commons:stockPhoto.i18n.via_wikimedia_commons;html=!!$('#stockphoto_attribution_html:checked').length;stockPhoto.get_license(html);stockPhoto.get_author_attribution(html);if($('#fileinfotpl_credit + td').length){text=stockPhoto.attribution;}else{text=stockPhoto.attribution+stockPhoto.stockphoto_license;}if(html){text+=', <a href="'+stockPhoto.
escapeAttribute(stockPhoto.backlink_url)+'">'+from+'</a>';}else{text+=', '+from;}return text;},refresh_attribution:function(){$("#stockphoto_attribution").val(stockPhoto.get_attribution_text());},createDialogRow:function(label,prefill,id){var idtext=(id)?'id="'+id+'"':'';return'<div class="stockphoto_dialog_row"><b>'+label+':</b><br><input type="text" readonly '+idtext+' onClick="select()" value="'+prefill+'"/></div>';},share_this:function(ui_mode){var widths,html,dtitle,dl_links,best_fit;stockPhoto.complete_attribution_text=stockPhoto.get_attribution_text();stockPhoto.file_url=$('#file > a').attr('href');if(!stockPhoto.file_url){stockPhoto.file_url=$('#file > div > div > a').attr('href');}if(!stockPhoto.file_url){stockPhoto.file_url=$('div.fullMedia a').attr('href');}if(stockPhoto.file_url){stockPhoto.file_url=location.protocol+stockPhoto.file_url;}stockPhoto.nicetitle=mw.config.get('wgTitle').split('.');stockPhoto.nicetitle.pop();stockPhoto.nicetitle=stockPhoto.nicetitle.join('.');$.
each(stockPhoto.icons_only,function(i,v){var re=new RegExp('\\.'+v+'$','i');if(!mw.config.get('wgPageName').match(re)){return;}stockPhoto.file_icon=stockPhoto.ogg_icon;});stockPhoto.backlink_url=location.protocol+'//commons.wikimedia.org/wiki/'+encodeURIComponent(mw.config.get('wgPageName'));widths=[];try{var pixelStr,widthSearchMatch,imageWidth,power,i;pixelStr=$('.fileInfo').contents().get(0).data;widthSearchMatch=/([0-9 ,.\u00a0]+)\s*×/.exec(pixelStr);imageWidth=parseInt(widthSearchMatch[1].replace(/[ ,.\u00a0]/g,''),10);if(isNaN(imageWidth)){throw new Error('Cannot parse');}power=Math.floor(Math.log(imageWidth)/Math.log(2));for(i=0;i<5;i+=1){widths.push(Math.pow(2,power-i));}widths=widths.reverse();}catch(e){widths=[75,100,120,240,500,640,800,1024];}if(ui_mode===-1){return;}html='';html+=stockPhoto.createDialogRow(stockPhoto.i18n.page_url,stockPhoto.escapeAttribute(stockPhoto.backlink_url));html+=stockPhoto.createDialogRow(stockPhoto.i18n.file_url,stockPhoto.escapeAttribute(
stockPhoto.file_url));html+=stockPhoto.createDialogRow(stockPhoto.i18n.attribution,stockPhoto.escapeAttribute(stockPhoto.complete_attribution_text),'stockphoto_attribution');html+="<input id='stockphoto_attribution_html' onclick='stockPhoto.refresh_attribution()' type='checkbox' /><label for='stockphoto_attribution_html'>"+stockPhoto.i18n.html+"</label>";if(stockPhoto.gfdl_note){html+='<br/><span class="stockphoto_note">'+stockPhoto.i18n.gfdl_warning+'</span>';}if(!stockPhoto.attrRequired){html+='<br/><span class="stockphoto_note">'+stockPhoto.i18n.no_attr+'</span>';}switch(ui_mode){case 1:dtitle=stockPhoto.i18n.download_this_file;if(stockPhoto.file_url!==undefined){html+='<div><b>'+stockPhoto.i18n.download_image_file+':</b><br>';dl_links=[];$.each(widths,function(i,v){if(stockPhoto.file_icon!==undefined){return;}dl_links.push('<a href="'+stockPhoto.stockphoto_get_thumbnail_url(v)+'">'+v+'px</a>');});if(stockPhoto.file_url){dl_links.push('<a href="'+stockPhoto.file_url+'">'+stockPhoto.
i18n.full_resolution+'</a>');}if(dl_links.length){html+=dl_links.join(' | ');}else{html+='<i>'+stockPhoto.i18n.not_available+'</i>';}html+='</div>';}break;case 2:dtitle=stockPhoto.i18n.use_this_file_web;html+="<div class='stockphoto_dialog_row'><div style='float:right'>";html+="<input type='radio' name='stockphoto_code_type' value='html' id='stockphoto_code_type_html' onchange='stockPhoto.make_html_textarea();' checked /><label for='stockphoto_code_type_html'>"+stockPhoto.i18n.html+"</label> ";html+="<input type='radio' name='stockphoto_code_type' value='bbcode' id='stockphoto_code_type_bbcode' onchange='stockPhoto.make_html_textarea();' /><label for='stockphoto_code_type_bbcode'>"+stockPhoto.i18n.bbcode+"</label> ";html+='<select id="stockphoto_html_select" onchange="stockPhoto.make_html_textarea();">';best_fit=75;if(stockPhoto.file_icon!==undefined){best_fit=120;html+="<option value='120'>120"+stockPhoto.i18n.px_wide_icon+"</option>";}else{$.each(widths,function(i,v){if(v<=$(
'#file img').width()){best_fit=v;}html+="<option value='"+v+"'>"+v+stockPhoto.i18n.px_wide+"</option>";});}html+='</select></div>';html+='<b>'+stockPhoto.i18n.html+'/'+stockPhoto.i18n.bbcode+':</b><textarea onClick="select()" id="stockphoto_html" readonly="readonly" style="font-size:9pt">';html+='</textarea></div>';break;case 3:dtitle=stockPhoto.i18n.use_this_file_wiki;html=stockPhoto.createDialogRow(stockPhoto.i18n.thumbnail,stockPhoto.escapeAttribute('[[File:'+mw.config.get('wgTitle')+'|thumb|'+stockPhoto.nicetitle+']]'));html+=stockPhoto.createDialogRow(stockPhoto.i18n.image,stockPhoto.escapeAttribute('[[File:'+mw.config.get('wgTitle')+'|'+stockPhoto.nicetitle+']]'));break;}$('<div style="display: none" id="stockphoto_dialog"></div>').html(html).dialog({modal:true,width:610,height:"auto",title:dtitle,close:function(){$(this).remove();}});$('#stockphoto_html_select').val(best_fit);stockPhoto.make_html_textarea();$('#stockphoto_attribution_html').prev().css('width','90%');},
call_download:function(){stockPhoto.share_this(1);},call_web:function(){stockPhoto.share_this(2);},call_wiki:function(){stockPhoto.share_this(3);},call_help:function(){window.location.href=mw.util.wikiGetlink(stockPhoto.i18n.reusing_content_url);},send_email:function(){var url='mailto:?subject='+encodeURIComponent(stockPhoto.nicetitle)+"&body="+encodeURIComponent(stockPhoto.backlink_url+"\n\n"+stockPhoto.complete_attribution_text+' '+stockPhoto.i18n.from_wikimedia_commons);window.location.href=url;},escapeAttribute:function(s){if(s===undefined){return'';}return s.replace(/\n/g,' ').replace(/\r/g,' ').replace(/"/g,'&quot;').replace(/'/g,'&#039;');},i18n:{reuse:'Reuse this file',download:'Download',download_this_file:'Download this file',use_this_file_web:'Use this file on the web',use_this_file_web_short:'Use this file',use_this_file_wiki:'Use this file on a wiki',use_this_file_wiki_short:'Use this file',email_link_short:'Email a link',information:'Information',remove_icons:
'Remove these icons',all_sizes:'all sizes',on_a_website:'on the web',on_a_wiki:'on a wiki',to_this_file:'to this file',about_reusing:'about reusing',look_what_i_found:'Look what I found on Wikimedia Commons : ',from_wikimedia_commons:'from Wikimedia Commons',via_wikimedia_commons:'via Wikimedia Commons',by:'by',by_u:'By',see_page_for_author:'See page for author',see_page_for_license:'see page for license',page_url:'Page URL',file_url:'File URL',attribution:'Attribution',no_attr:'Attribution not legally required',or:'or',gfdl_warning:'Using this file might require attaching a full copy of the <a href="//en.wikipedia.org/wiki/GNU_Free_Documentation_License">GFDL</a>',download_image_file:'Download image file',full_resolution:'Full resolution',not_available:'not available',share_this_file:'Share this file',html:'HTML',bbcode:'BBCode',px_wide_icon:'px wide (icon)',px_wide:'px wide',wikipedia_instant_commons:'Wikimedia/InstantCommons',thumbnail:'Thumbnail',image:'Image',reusing_content_url:
'Commons:Reusing_content_outside_Wikimedia'}};window.stockPhoto=stockPhoto;if(mw.config.get('wgUserLanguage')!=='en'){$.ajax({url:mw.util.wikiScript(),dataType:'script',data:{title:'MediaWiki:Gadget-Stockphoto.js/'+mw.config.get('wgUserLanguage'),action:'raw',ctype:'text/javascript',maxage:2419200,smaxage:2419200},cache:true,success:stockPhoto.init});}else{$(document).ready(stockPhoto.init);}}}(jQuery,mediaWiki));;},{"":
"div#stockphoto_base.vertical{min-width:160px;position:absolute}a#stockphoto_remove{cursor:pointer;margin-left:10px}.stockphoto_buttonrow_text{vertical-align:middle;display:inline-block;text-align:center}div#stockphoto_base.horizontal #stockphoto_social_bookmarks{text-align:center;width:100%;margin-bottom:10px}div#stockphoto_base.vertical#stockphoto_social_bookmarks{display:inline-block;text-align:center;margin-bottom:10px}span.stockphoto_social_icon{padding-right:2px}div.stockphoto_dialog_row{margin-bottom:5px;width:99%;display:inline-block}div.stockphoto_dialog_row input[type=text]{width:99%}div.stockphoto_dialog_row textarea{width:99%;min-height:80px}span.stockphoto_note{display:block;margin-top:-5px;margin-bottom:15px;font-style:italic;font-size:smaller}.vertical .stockphoto_buttonrow_icon{margin:0 10px 10px;display:inline-block}.horizontal .stockphoto_buttonrow_icon{margin-left:10px}.vertical \x3e span{display:block}\n\n/* cache key: commonswiki:resourceloader:filter:minify-css:7:20c27a330b53aa5353ec79603dcae0e5 */\n\n"
},{});mw.loader.implement("ext.gadget.UploadWizard",function(){(function($,mw){"use strict";var excludedLanguages=['de'];function doReplacement(){if($.inArray(mw.config.get('wgUserLanguage'),excludedLanguages)===-1){$('#n-uploadbtn').find('a').attr('href',mw.util.wikiGetlink('Special:UploadWizard'));}}doReplacement();}(jQuery,mediaWiki));;},{},{});mw.loader.implement("ext.gadget.WikiMiniAtlas",function(){mw.loader.load('//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400');;},{},{});mw.loader.implement("ext.gadget.ZoomViewer",function(){if(mw.config.get('wgNamespaceNumber')===6&&mw.config.get('wgAction')==='view'&&!mw.util.getParamValue('diff')){$(document).ready(function(){'use strict';var m,fileInfo=$(".fileInfo");if(!fileInfo){return;}else{var pixel_filter=/([\d,\.\']+) × ([\d,\.\']+) [Pp][íi](?:[kc]s|x)el[ei]?s?/;if(m=pixel_filter.exec(fileInfo.text())){var p=parseInt(m[1].replace(/[,\.\']/g,''),10)*
parseInt(m[2].replace(/[,\.]/g,''),10);if(p<2*1024*1024)return;}var links=$("<span>",{id:"ZoomViewerLinks",style:"white-space:nowrap; display:inline-block;"});var fileName=mw.config.get('wgPageName').match(/File:(.+\.jpe?g)/i);if(!fileName){return;}var url="//toolserver.org/~dschwen/iip/wip.php?f="+encodeURIComponent(fileName[1]);var link=$("<a>",{href:url,text:"flash"});var linkNoFlash=$("<a>",{href:url+"&flash=no",text:"no flash"});links.append("; ZoomViewer: ",link,"/",linkNoFlash);fileInfo.after(links);}});};},{},{});mw.loader.implement("ext.gadget.libCommons",function(){(function($,mw){"use strict";if(!mw.libs.commons)mw.libs.commons={};var lc=mw.libs.commons;$.extend(mw.libs.commons,{fixDoubleEncoding:function(s){if(!s)return s;var utf8=/[u00C2-u00F4][u0080-u00BF][u0080-u00BF]?[u0080-u00BF]?/g;if(!utf8.test(s))return s;var temp="",curr=0,m,hex_digit="0123456789ABCDEF";var str=s.replace(/%/g,'%25');utf8.lastIndex=0;try{while((m=utf8.exec(str))!==null){temp+=str.substring(curr,m.
index);m=m[0];for(var i=0;i<m.length;i++){temp+='%'+hex_digit.charAt(m.charCodeAt(i)/16)+hex_digit.charAt(m.charCodeAt(i)%16);}curr=utf8.lastIndex;}if(curr<str.length)temp+=str.substring(curr);temp=decodeURIComponent(temp);return temp;}catch(e){}return s;},getUploadBotUser:function(bot,content,comment){var match;switch(bot){case'Upload Bot (Rich Smith)':case'File Upload Bot (Magnus Manske)':match=/^[Tt]ransferr?e?d from .+? by \[\[User:([^\]\|]*)(\|([^\]]*))?\]\] using/.exec(comment);var reOldCH=/transferred to Commons by \[\[User:([^\]\|]+)(?:\|(?:[^\]]*))?\]\] using/;if(!match)match=reOldCH.exec(comment);if(!match)match=reOldCH.exec(content);var oldGeograph=/geograph.org.uk\]; transferr?e?d by \[\[User:([^\]\|]+)(?:\|(?:[^\]]*))?\]\] using/;if(!match)match=oldGeograph.exec(comment);if(!match)match=oldGeograph.exec(content);if(!match)match=/\* Uploaded by \[\[User:([^\]\|]+)\|(?:(?:[^\]]*))?/.exec(comment);if(!match)match=/\* Uploaded by \[\[User:([^\]\|]+)(?:\|(?:[^\]]*))?\]\]/.exec(
content);if(match)match=match[1];match=lc.fixDoubleEncoding(match);break;case'FlickrLickr':match=/\n\|reviewer=\s*(.+)\n/.exec(content);if(match)match=match[1];break;case'Flickr upload bot':match=/\{\{User:Flickr upload bot\/upload(?:-pd)?(?:\|[^\|\}]*)?\|reviewer=([^\}]+)\}\}/.exec(content);if(match)match=match[1];break;default:return bot;}if(match){match=match.replace(/^[\s_]+/,'').replace(/[\s_]+$/,'').replace(/[\s_]+/g,' ');match=match.substr(0,1).toUpperCase()+match.substr(1);bot=match;}return bot;}});}(jQuery,mediaWiki));;},{},{});mw.loader.implement("ext.gadget.libJQuery",function(){(function($,mw){"use strict";$.extend({createIcon:function(iconClass){return $('<span>',{'class':'ui-icon '+iconClass+' jquery-inline-icon',text:' '});},createNotifyArea:function(textNode,icon,state){return $('<div>',{'class':'ui-widget'}).append($('<div>',{'class':state+' ui-corner-all',style:'margin-top:20px; padding:0.7em;'}).append($('<p>').append($.createIcon(icon).css('margin-right','.3em'),
textNode)));}});mw.messages.set({'libjq-cancel-title':"Close this dialog [Esc]",'libjq-proceed-title':"Proceed [Enter] in single-line text fields",'libjq-report-title':"Reporting errors helps improving the application"});var buttonConfig={proceed:{'icon':'ui-icon-circle-check','class':'ui-button-green','title':'libjq-proceed-title'},cancel:{'icon':'ui-icon-circle-close','class':'ui-button-red','title':'libjq-cancel-title'},report:{'icon':'ui-icon-circle-check','class':'','title':'libjq-report-title'}};$.extend($.fn,{specialButton:function(which){return(function($btn,cfg){return $btn.button({icons:{primary:cfg.icon}}).addClass(cfg['class']).attr('title',mw.message(cfg.title).parse());}(this,buttonConfig[which]));}});}(jQuery,mediaWiki));;},{"":".jquery-inline-icon{display:inline-block !important;position:relative;top:2px}\n\n/* cache key: commonswiki:resourceloader:filter:minify-css:7:a2d8dea78e19b5716a53d18ed8097924 */\n\n"},{});mw.loader.implement("ext.gadget.libUtil",function(){(
function($,mw){"use strict";if(!mw.libs.commons)mw.libs.commons={};var lc=mw.libs.commons;$.extend(mw.libs.commons,{guessUser:function(){switch(mw.config.get('wgNamespaceNumber')){case 3:case 2:return mw.config.get('wgPageName').match(/.*?\:(.*?)(\/.*)*$/)[1];case-1:try{switch(mw.config.get('wgCanonicalSpecialPageName')){case'Contributions':case'DeletedContributions':case'Block':case'CentralAuth':if(/Special\:(?:DeletedContributions|Contributions|Block|CentralAuth)\//.test(location.href)){return decodeURI(location.href.match(/Special\:(?:DeletedContributions|Contributions|Block|CentralAuth)\/(.*?)(?:&.*)?$/)[1]);}else if(-1!==location.href.indexOf(mw.config.get('wgScript'))){return mw.util.getParamValue('target');}break;case'Userrights':case'Listfiles':case'Log':if(mw.util.getParamValue('user')){return mw.util.getParamValue('user');}if(mw.util.getParamValue('page')){if(/User:+./.test(mw.util.getParamValue('page'))){return mw.util.getParamValue('page').replace("User:","");}}if(
/Special\:(?:Log|ListFiles|UserRights)\//.test(location.href)){return decodeURI(location.href.match(/Special\:(?:Log|ListFiles|UserRights)\/(.*?)(?:&.*)?$/)[1]);}break;}}catch(ex){}break;}},monthNamesInSiteLang:['January','February','March','April','May','June','July','August','September','October','November','December'],formatDate:function(fmt,date,fallbackDate){var pad0=function(s){s=""+s;return(s.length>1?s:"0"+s);};date=date||fallbackDate||new Date();fmt=fmt.replace(/YYYY/g,date.getUTCFullYear());fmt=fmt.replace(/MM/g,pad0(date.getUTCMonth()+1));fmt=fmt.replace(/DD/g,pad0(date.getUTCDate()));fmt=fmt.replace(/MON/g,lc.monthNamesInSiteLang[date.getUTCMonth()]);fmt=fmt.replace(/DAY/g,date.getUTCDate());return fmt;}});}(jQuery,mediaWiki));;},{},{});mw.loader.implement("jquery.autoEllipsis",function(){(function($){var cache={};var matchTextCache={};$.fn.autoEllipsis=function(options){options=$.extend({position:'center',tooltip:false,restoreText:false,hasSpan:false,matchText:null},
options);$(this).each(function(){var $container,$trimmableText,text,trimmableText,w,pw,l,r,i,side,$el=$(this);if(options.restoreText){if(!$el.data('autoEllipsis.originalText')){$el.data('autoEllipsis.originalText',$el.text());}else{$el.text($el.data('autoEllipsis.originalText'));}}$container=$el;if(options.hasSpan){$trimmableText=$el.children(options.selector);}else{$trimmableText=$('<span>').css('whiteSpace','nowrap').text($el.text());$el.empty().append($trimmableText);}text=$container.text();trimmableText=$trimmableText.text();w=$container.width();pw=0;if(options.matchText){if(!(text in matchTextCache)){matchTextCache[text]={};}if(!(options.matchText in matchTextCache[text])){matchTextCache[text][options.matchText]={};}if(!(w in matchTextCache[text][options.matchText])){matchTextCache[text][options.matchText][w]={};}if(options.position in matchTextCache[text][options.matchText][w]){$container.html(matchTextCache[text][options.matchText][w][options.position]);if(options.tooltip){
$container.attr('title',text);}return;}}else{if(!(text in cache)){cache[text]={};}if(!(w in cache[text])){cache[text][w]={};}if(options.position in cache[text][w]){$container.html(cache[text][w][options.position]);if(options.tooltip){$container.attr('title',text);}return;}}if($trimmableText.width()+pw>w){switch(options.position){case'right':l=0;r=trimmableText.length;do{var m=Math.ceil((l+r)/2);$trimmableText.text(trimmableText.substr(0,m)+'...');if($trimmableText.width()+pw>w){r=m-1;}else{l=m;}}while(l<r);$trimmableText.text(trimmableText.substr(0,l)+'...');break;case'center':i=[Math.round(trimmableText.length/2),Math.round(trimmableText.length/2)];side=1;while($trimmableText.outerWidth()+pw>w&&i[0]>0){$trimmableText.text(trimmableText.substr(0,i[0])+'...'+trimmableText.substr(i[1]));if(side===0){i[0]--;side=1;}else{i[1]++;side=0;}}break;case'left':r=0;while($trimmableText.outerWidth()+pw>w&&r<trimmableText.length){$trimmableText.text('...'+trimmableText.substr(r));r++;}break;}}if(
options.tooltip){$container.attr('title',text);}if(options.matchText){$container.highlightText(options.matchText);matchTextCache[text][options.matchText][w][options.position]=$container.html();}else{cache[text][w][options.position]=$container.html();}});};}(jQuery));;},{},{});mw.loader.implement("jquery.checkboxShiftClick",function(){(function($){$.fn.checkboxShiftClick=function(text){var prevCheckbox=null;var $box=this;$box.click(function(e){if(prevCheckbox!==null&&e.shiftKey){$box.slice(Math.min($box.index(prevCheckbox),$box.index(e.target)),Math.max($box.index(prevCheckbox),$box.index(e.target))+1).prop('checked',e.target.checked?true:false);}prevCheckbox=e.target;});return $box;};}(jQuery));;},{},{});mw.loader.implement("jquery.collapsibleTabs",function(){(function($){$.fn.collapsibleTabs=function(options){if(!this.length){return this;}var $settings=$.extend({},$.collapsibleTabs.defaults,options);this.each(function(){var $el=$(this);$.collapsibleTabs.instances=($.collapsibleTabs.
instances.length===0?$el:$.collapsibleTabs.instances.add($el));$el.data('collapsibleTabsSettings',$settings);$el.children($settings.collapsible).each(function(){$.collapsibleTabs.addData($(this));});});if(!$.collapsibleTabs.boundEvent){$(window).delayedBind('500','resize',function(){$.collapsibleTabs.handleResize();});}$.collapsibleTabs.handleResize();return this;};$.collapsibleTabs={instances:[],boundEvent:null,defaults:{expandedContainer:'#p-views ul',collapsedContainer:'#p-cactions ul',collapsible:'li.collapsible',shifting:false,expandCondition:function(eleWidth){return($('#left-navigation').position().left+$('#left-navigation').width())<($('#right-navigation').position().left-eleWidth);},collapseCondition:function(){return($('#left-navigation').position().left+$('#left-navigation').width())>$('#right-navigation').position().left;}},addData:function($collapsible){var $settings=$collapsible.parent().data('collapsibleTabsSettings');if($settings!==null){$collapsible.data(
'collapsibleTabsSettings',{expandedContainer:$settings.expandedContainer,collapsedContainer:$settings.collapsedContainer,expandedWidth:$collapsible.width(),prevElement:$collapsible.prev()});}},getSettings:function($collapsible){var $settings=$collapsible.data('collapsibleTabsSettings');if($settings===undefined){$.collapsibleTabs.addData($collapsible);$settings=$collapsible.data('collapsibleTabsSettings');}return $settings;},handleResize:function(e){$.collapsibleTabs.instances.each(function(){var $el=$(this),data=$.collapsibleTabs.getSettings($el);if(data.shifting){return;}if($el.children(data.collapsible).length>0&&data.collapseCondition()){$el.trigger('beforeTabCollapse');$.collapsibleTabs.moveToCollapsed($el.children(data.collapsible+':last'));}if($(data.collapsedContainer+' '+data.collapsible).length>0&&data.expandCondition($.collapsibleTabs.getSettings($(data.collapsedContainer).children(data.collapsible+':first')).expandedWidth)){$el.trigger('beforeTabExpand');$.collapsibleTabs.
moveToExpanded(data.collapsedContainer+' '+data.collapsible+':first');}});},moveToCollapsed:function(ele){var $moving=$(ele),data=$.collapsibleTabs.getSettings($moving),dataExp=$.collapsibleTabs.getSettings(data.expandedContainer);dataExp.shifting=true;$moving.detach().prependTo(data.collapsedContainer).data('collapsibleTabsSettings',data);dataExp.shifting=false;$.collapsibleTabs.handleResize();},moveToExpanded:function(ele){var $moving=$(ele),data=$.collapsibleTabs.getSettings($moving),dataExp=$.collapsibleTabs.getSettings(data.expandedContainer);dataExp.shifting=true;$moving.detach().insertAfter(data.prevElement).data('collapsibleTabsSettings',data);dataExp.shifting=false;$.collapsibleTabs.handleResize();}};}(jQuery));;},{},{});mw.loader.implement("jquery.delayedBind",function(){(function($){function encodeEvent(event){return event.replace(/-/g,'--').replace(/ /g,'-');}$.fn.extend({delayedBind:function(timeout,event,data,callback){if(arguments.length===3){callback=data;data=undefined
;}var encEvent=encodeEvent(event);return this.each(function(){var that=this;if(!($(this).data('_delayedBindBound-'+encEvent+'-'+timeout))){$(this).data('_delayedBindBound-'+encEvent+'-'+timeout,true);$(this).bind(event,function(){var timerID=$(this).data('_delayedBindTimerID-'+encEvent+'-'+timeout);if(timerID!==null){clearTimeout(timerID);}timerID=setTimeout(function(){$(that).trigger('_delayedBind-'+encEvent+'-'+timeout);},timeout);$(this).data('_delayedBindTimerID-'+encEvent+'-'+timeout,timerID);});}$(this).bind('_delayedBind-'+encEvent+'-'+timeout,data,callback);});},delayedBindCancel:function(timeout,event){var encEvent=encodeEvent(event);return this.each(function(){var timerID=$(this).data('_delayedBindTimerID-'+encEvent+'-'+timeout);if(timerID!==null){clearTimeout(timerID);}});},delayedBindUnbind:function(timeout,event,callback){var encEvent=encodeEvent(event);return this.each(function(){$(this).unbind('_delayedBind-'+encEvent+'-'+timeout,callback);});}});}(jQuery));;},{},{});mw.
loader.implement("jquery.highlightText",function(){(function($){$.highlightText={splitAndHighlight:function(node,pat){var patArray=pat.split(' ');for(var i=0;i<patArray.length;i++){if(patArray[i].length===0){continue;}$.highlightText.innerHighlight(node,patArray[i]);}return node;},innerHighlight:function(node,pat){if(node.nodeType===3){var match=node.data.match(new RegExp("(^|\\s)"+$.escapeRE(pat),"i"));if(match){var pos=match.index+match[1].length;var spannode=document.createElement('span');spannode.className='highlight';var middlebit=node.splitText(pos);middlebit.splitText(pat.length);var middleclone=middlebit.cloneNode(true);spannode.appendChild(middleclone);middlebit.parentNode.replaceChild(spannode,middlebit);}}else if(node.nodeType===1&&node.childNodes&&!/(script|style)/i.test(node.tagName)&&!(node.tagName.toLowerCase()==='span'&&node.className.match(/\bhighlight/))){for(var i=0;i<node.childNodes.length;++i){$.highlightText.innerHighlight(node.childNodes[i],pat);}}}};$.fn.
highlightText=function(matchString){return $(this).each(function(){var $el=$(this);$el.data('highlightText',{originalText:$el.text()});$.highlightText.splitAndHighlight(this,matchString);});};}(jQuery));;},{},{});mw.loader.implement("jquery.makeCollapsible",function(){(function($,mw){$.fn.makeCollapsible=function(){return this.each(function(){var $toggle,lpx='jquery.makeCollapsible> ',$that=$(this).addClass('mw-collapsible'),that=this,collapsetext=$(this).attr('data-collapsetext'),expandtext=$(this).attr('data-expandtext'),toggleElement=function($collapsible,action,$defaultToggle,instantHide){var $collapsibleContent,$containers;if(!$collapsible.jquery){return;}if(action!=='expand'&&action!=='collapse'){return;}if($defaultToggle===undefined){$defaultToggle=null;}if($defaultToggle!==null&&!($defaultToggle instanceof $)){return;}if(action==='collapse'){if($collapsible.is('table')){$containers=$collapsible.find('>tbody>tr');if($defaultToggle){$containers.not($defaultToggle.closest('tr')).
stop(true,true).fadeOut();}else{if(instantHide){$containers.hide();}else{$containers.stop(true,true).fadeOut();}}}else if($collapsible.is('ul')||$collapsible.is('ol')){$containers=$collapsible.find('> li');if($defaultToggle){$containers.not($defaultToggle.parent()).stop(true,true).slideUp();}else{if(instantHide){$containers.hide();}else{$containers.stop(true,true).slideUp();}}}else{$collapsibleContent=$collapsible.find('> .mw-collapsible-content');if($collapsibleContent.length){if(instantHide){$collapsibleContent.hide();}else{$collapsibleContent.slideUp();}}else{if($collapsible.is('tr')||$collapsible.is('td')||$collapsible.is('th')){$collapsible.fadeOut();}else{$collapsible.slideUp();}}}}else{if($collapsible.is('table')){$containers=$collapsible.find('>tbody>tr');if($defaultToggle){$containers.not($defaultToggle.parent().parent()).stop(true,true).fadeIn();}else{$containers.stop(true,true).fadeIn();}}else if($collapsible.is('ul')||$collapsible.is('ol')){$containers=$collapsible.find(
'> li');if($defaultToggle){$containers.not($defaultToggle.parent()).stop(true,true).slideDown();}else{$containers.stop(true,true).slideDown();}}else{$collapsibleContent=$collapsible.find('> .mw-collapsible-content');if($collapsibleContent.length){$collapsibleContent.slideDown();}else{if($collapsible.is('tr')||$collapsible.is('td')||$collapsible.is('th')){$collapsible.fadeIn();}else{$collapsible.slideDown();}}}}},toggleLinkDefault=function(that,e){var $that=$(that),$collapsible=$that.closest('.mw-collapsible.mw-made-collapsible').toggleClass('mw-collapsed');e.preventDefault();e.stopPropagation();if(!$that.hasClass('mw-collapsible-toggle-collapsed')){$that.removeClass('mw-collapsible-toggle-expanded').addClass('mw-collapsible-toggle-collapsed');if($that.find('> a').length){$that.find('> a').text(expandtext);}else{$that.text(expandtext);}toggleElement($collapsible,'collapse',$that);}else{$that.removeClass('mw-collapsible-toggle-collapsed').addClass('mw-collapsible-toggle-expanded');if(
$that.find('> a').length){$that.find('> a').text(collapsetext);}else{$that.text(collapsetext);}toggleElement($collapsible,'expand',$that);}return;},toggleLinkPremade=function($that,e){var $collapsible=$that.eq(0).closest('.mw-collapsible.mw-made-collapsible').toggleClass('mw-collapsed');if($(e.target).is('a')){return true;}e.preventDefault();e.stopPropagation();if(!$that.hasClass('mw-collapsible-toggle-collapsed')){$that.removeClass('mw-collapsible-toggle-expanded').addClass('mw-collapsible-toggle-collapsed');toggleElement($collapsible,'collapse',$that);}else{$that.removeClass('mw-collapsible-toggle-collapsed').addClass('mw-collapsible-toggle-expanded');toggleElement($collapsible,'expand',$that);}return;},toggleLinkCustom=function($that,e,$collapsible){if(e){e.preventDefault();e.stopPropagation();}var action=$collapsible.hasClass('mw-collapsed')?'expand':'collapse';$collapsible.toggleClass('mw-collapsed');toggleElement($collapsible,action,$that);};if(!collapsetext){collapsetext=mw.msg(
'collapsible-collapse');}if(!expandtext){expandtext=mw.msg('collapsible-expand');}var $toggleLink=$('<a href="#"></a>').text(collapsetext).wrap('<span class="mw-collapsible-toggle"></span>').parent().prepend('&nbsp;[').append(']&nbsp;').on('click.mw-collapse',function(e){toggleLinkDefault(this,e);});if($that.hasClass('mw-made-collapsible')){return;}else{$that.addClass('mw-made-collapsible');}if(($that.attr('id')||'').indexOf('mw-customcollapsible-')===0){var thatId=$that.attr('id'),$customTogglers=$('.'+thatId.replace('mw-customcollapsible','mw-customtoggle'));mw.log(lpx+'Found custom collapsible: #'+thatId);if($customTogglers.length){$customTogglers.on('click.mw-collapse',function(e){toggleLinkCustom($(this),e,$that);});}else{mw.log(lpx+'#'+thatId+': Missing toggler!');}if($that.hasClass('mw-collapsed')){$that.removeClass('mw-collapsed');toggleLinkCustom($customTogglers,null,$that);}}else{if($that.is('table')){var $firstRowCells=$that.find('tr:first th, tr:first td');$toggle=
$firstRowCells.find('> .mw-collapsible-toggle');if(!$toggle.length){$firstRowCells.eq(-1).prepend($toggleLink);}else{$toggleLink=$toggle.off('click.mw-collapse').on('click.mw-collapse',function(e){toggleLinkPremade($toggle,e);});}}else if($that.is('ul')||$that.is('ol')){var $firstItem=$that.find('li:first');$toggle=$firstItem.find('> .mw-collapsible-toggle');if(!$toggle.length){var firstval=$firstItem.attr('value');if(firstval===undefined||!firstval||firstval==='-1'||firstval===-1){$firstItem.attr('value','1');}$that.prepend($toggleLink.wrap('<li class="mw-collapsible-toggle-li"></li>').parent());}else{$toggleLink=$toggle.off('click.mw-collapse').on('click.mw-collapse',function(e){toggleLinkPremade($toggle,e);});}}else{$toggle=$that.find('> .mw-collapsible-toggle');if(!$that.find('> .mw-collapsible-content').length){$that.wrapInner('<div class="mw-collapsible-content"></div>');}if(!$toggle.length){$that.prepend($toggleLink);}else{$toggleLink=$toggle.off('click.mw-collapse').on(
'click.mw-collapse',function(e){toggleLinkPremade($toggle,e);});}}}if($that.hasClass('mw-collapsed')&&($that.attr('id')||'').indexOf('mw-customcollapsible-')!==0){$that.removeClass('mw-collapsed');toggleElement($that,'collapse',$toggleLink.eq(0),true);$toggleLink.eq(0).click();}});};}(jQuery,mediaWiki));;},{"":".mw-collapsible-toggle{float:right} li .mw-collapsible-toggle{float:none} .mw-collapsible-toggle-li{list-style:none}\n\n/* cache key: commonswiki:resourceloader:filter:minify-css:7:4250852ed2349a0d4d0fc6509a3e7d4c */\n\n"},{"collapsible-expand":"Expand","collapsible-collapse":"Collapse"});mw.loader.implement("jquery.mw-jump",function(){jQuery(function($){$('.mw-jump').delegate('a','focus blur',function(e){if(e.type==="blur"||e.type==="focusout"){$(this).closest('.mw-jump').css({height:'0'});}else{$(this).closest('.mw-jump').css({height:'auto'});}});});;},{},{});mw.loader.implement("jquery.placeholder",function(){(function($){$.fn.placeholder=function(){return this.each(function(
){if(this.placeholder&&'placeholder'in document.createElement(this.tagName)){return;}var placeholder=this.getAttribute('placeholder');var $input=$(this);if(this.value===''||this.value===placeholder){$input.addClass('placeholder').val(placeholder);}$input.blur(function(){if(this.value===''){this.value=placeholder;$input.addClass('placeholder');}}).on('focus drop keydown paste',function(e){if($input.hasClass('placeholder')){if(e.type==='drop'&&e.originalEvent.dataTransfer){try{this.value=e.originalEvent.dataTransfer.getData('text/plain');}catch(exception){this.value=e.originalEvent.dataTransfer.getData('text');}e.preventDefault();}else{this.value='';}$input.removeClass('placeholder');}});if(this.form){$(this.form).submit(function(){if($input.hasClass('placeholder')){$input.val('').removeClass('placeholder');}});}});};}(jQuery));;},{},{});mw.loader.implement("jquery.suggestions",function(){(function($){$.suggestions={cancel:function(context){if(context.data.timerID!==null){clearTimeout(
context.data.timerID);}if($.isFunction(context.config.cancel)){context.config.cancel.call(context.data.$textbox);}},restore:function(context){context.data.$textbox.val(context.data.prevText);},update:function(context,delayed){function maybeFetch(){if(context.data.$textbox.val().length===0){context.data.$container.hide();context.data.prevText='';}else if(context.data.$textbox.val()!==context.data.prevText){if(typeof context.config.fetch==='function'){context.data.prevText=context.data.$textbox.val();context.config.fetch.call(context.data.$textbox,context.data.$textbox.val());}}}if(context.data.timerID!==null){clearTimeout(context.data.timerID);}if(delayed){context.data.timerID=setTimeout(maybeFetch,context.config.delay);}else{maybeFetch();}$.suggestions.special(context);},special:function(context){if(typeof context.config.special.render==='function'){setTimeout(function(){var $special=context.data.$container.find('.suggestions-special');context.config.special.render.call($special,
context.data.$textbox.val());},1);}},configure:function(context,property,value){switch(property){case'fetch':case'cancel':case'special':case'result':case'$region':context.config[property]=value;break;case'suggestions':context.config[property]=value;if(context.data!==undefined){if(context.data.$textbox.val().length===0){context.data.$container.hide();}else{context.data.$container.show();var newCSS={top:context.config.$region.offset().top+context.config.$region.outerHeight(),bottom:'auto',width:context.config.$region.outerWidth(),height:'auto'};if(context.config.positionFromLeft){newCSS.left=context.config.$region.offset().left;newCSS.right='auto';}else{newCSS.left='auto';newCSS.right=$('body').width()-(context.config.$region.offset().left+context.config.$region.outerWidth());}context.data.$container.css(newCSS);var $results=context.data.$container.children('.suggestions-results');$results.empty();var expWidth=-1;var $autoEllipseMe=$([]);var matchedText=null;for(var i=0;i<context.config.
suggestions.length;i++){var text=context.config.suggestions[i];var $result=$('<div>').addClass('suggestions-result').attr('rel',i).data('text',context.config.suggestions[i]).mousemove(function(e){context.data.selectedWithMouse=true;$.suggestions.highlight(context,$(this).closest('.suggestions-results div'),false);}).appendTo($results);if(typeof context.config.result.render==='function'){context.config.result.render.call($result,context.config.suggestions[i]);}else{if(context.config.highlightInput){matchedText=context.data.prevText;}$result.append($('<span>').css('whiteSpace','nowrap').text(text));var $span=$result.children('span');if($span.outerWidth()>$result.width()&&$span.outerWidth()>expWidth){expWidth=$span.outerWidth()+(context.data.$container.width()-$span.parent().width());}$autoEllipseMe=$autoEllipseMe.add($result);}}if(expWidth>context.data.$container.width()){var maxWidth=context.config.maxExpandFactor*context.data.$textbox.width();context.data.$container.width(Math.min(
expWidth,maxWidth));}$autoEllipseMe.autoEllipsis({hasSpan:true,tooltip:true,matchText:matchedText});}}break;case'maxRows':context.config[property]=Math.max(1,Math.min(100,value));break;case'delay':context.config[property]=Math.max(0,Math.min(1200,value));break;case'maxExpandFactor':context.config[property]=Math.max(1,value);break;case'submitOnClick':case'positionFromLeft':case'highlightInput':context.config[property]=value?true:false;break;}},highlight:function(context,result,updateTextbox){var selected=context.data.$container.find('.suggestions-result-current');if(!result.get||selected.get(0)!==result.get(0)){if(result==='prev'){if(selected.is('.suggestions-special')){result=context.data.$container.find('.suggestions-result:last');}else{result=selected.prev();if(selected.length===0){if(context.data.$container.find('.suggestions-special').html()!==''){result=context.data.$container.find('.suggestions-special');}else{result=context.data.$container.find('.suggestions-results div:last');}
}}}else if(result==='next'){if(selected.length===0){result=context.data.$container.find('.suggestions-results div:first');if(result.length===0&&context.data.$container.find('.suggestions-special').html()!==''){result=context.data.$container.find('.suggestions-special');}}else{result=selected.next();if(selected.is('.suggestions-special')){result=$([]);}else if(result.length===0&&context.data.$container.find('.suggestions-special').html()!==''){result=context.data.$container.find('.suggestions-special');}}}selected.removeClass('suggestions-result-current');result.addClass('suggestions-result-current');}if(updateTextbox){if(result.length===0||result.is('.suggestions-special')){$.suggestions.restore(context);}else{context.data.$textbox.val(result.data('text'));context.data.$textbox.change();}context.data.$textbox.trigger('change');}},keypress:function(e,context,key){var wasVisible=context.data.$container.is(':visible'),preventDefault=false;switch(key){case 40:if(wasVisible){$.suggestions.
highlight(context,'next',true);context.data.selectedWithMouse=false;}else{$.suggestions.update(context,false);}preventDefault=true;break;case 38:if(wasVisible){$.suggestions.highlight(context,'prev',true);context.data.selectedWithMouse=false;}preventDefault=wasVisible;break;case 27:context.data.$container.hide();$.suggestions.restore(context);$.suggestions.cancel(context);context.data.$textbox.trigger('change');preventDefault=wasVisible;break;case 13:context.data.$container.hide();preventDefault=wasVisible;var selected=context.data.$container.find('.suggestions-result-current');if(selected.length===0||context.data.selectedWithMouse){$.suggestions.cancel(context);context.config.$region.closest('form').submit();}else if(selected.is('.suggestions-special')){if(typeof context.config.special.select==='function'){context.config.special.select.call(selected,context.data.$textbox);}}else{if(typeof context.config.result.select==='function'){$.suggestions.highlight(context,selected,true);context
.config.result.select.call(selected,context.data.$textbox);}else{$.suggestions.highlight(context,selected,true);}}break;default:$.suggestions.update(context,true);break;}if(preventDefault){e.preventDefault();e.stopImmediatePropagation();}}};$.fn.suggestions=function(){var returnValue;var args=arguments;$(this).each(function(){var context=$(this).data('suggestions-context');if(context===undefined||context===null){context={config:{'fetch':function(){},'cancel':function(){},'special':{},'result':{},'$region':$(this),'suggestions':[],'maxRows':7,'delay':120,'submitOnClick':false,'maxExpandFactor':3,'positionFromLeft':true,'highlightInput':false}};}if(args.length>0){if(typeof args[0]==='object'){for(var key in args[0]){$.suggestions.configure(context,key,args[0][key]);}}else if(typeof args[0]==='string'){if(args.length>1){$.suggestions.configure(context,args[0],args[1]);}else if(returnValue===null||returnValue===undefined){returnValue=(args[0]in context.config?undefined:context.config[args[
0]]);}}}if(context.data===undefined){context.data={timerID:null,prevText:null,visibleResults:0,mouseDownOn:$([]),$textbox:$(this),selectedWithMouse:false};var newCSS={top:Math.round(context.data.$textbox.offset().top+context.data.$textbox.outerHeight()),width:context.data.$textbox.outerWidth(),display:'none'};if(context.config.positionFromLeft){newCSS.left=context.config.$region.offset().left;newCSS.right='auto';}else{newCSS.left='auto';newCSS.right=$('body').width()-(context.config.$region.offset().left+context.config.$region.outerWidth());}context.data.$container=$('<div>').css(newCSS).addClass('suggestions').append($('<div>').addClass('suggestions-results').mousedown(function(e){context.data.mouseDownOn=$(e.target).closest('.suggestions-results div');}).mouseup(function(e){var $result=$(e.target).closest('.suggestions-results div');var $other=context.data.mouseDownOn;context.data.mouseDownOn=$([]);if($result.get(0)!==$other.get(0)){return;}$.suggestions.highlight(context,$result,
true);context.data.$container.hide();if(typeof context.config.result.select==='function'){context.config.result.select.call($result,context.data.$textbox);}context.data.$textbox.focus();})).append($('<div>').addClass('suggestions-special').mousedown(function(e){context.data.mouseDownOn=$(e.target).closest('.suggestions-special');}).mouseup(function(e){var $special=$(e.target).closest('.suggestions-special');var $other=context.data.mouseDownOn;context.data.mouseDownOn=$([]);if($special.get(0)!==$other.get(0)){return;}context.data.$container.hide();if(typeof context.config.special.select==='function'){context.config.special.select.call($special,context.data.$textbox);}context.data.$textbox.focus();}).mousemove(function(e){context.data.selectedWithMouse=true;$.suggestions.highlight(context,$(e.target).closest('.suggestions-special'),false);})).appendTo($('body'));$(this).attr('autocomplete','off').keydown(function(e){context.data.keypressed=e.which;context.data.keypressedCount=0;switch(
context.data.keypressed){case 40:e.preventDefault();e.stopImmediatePropagation();break;case 38:case 27:case 13:if(context.data.$container.is(':visible')){e.preventDefault();e.stopImmediatePropagation();}}}).keypress(function(e){context.data.keypressedCount++;$.suggestions.keypress(e,context,context.data.keypressed);}).keyup(function(e){if(context.data.keypressedCount===0){$.suggestions.keypress(e,context,context.data.keypressed);}}).blur(function(){if(context.data.mouseDownOn.length>0){return;}context.data.$container.hide();$.suggestions.cancel(context);});}$(this).data('suggestions-context',context);});return returnValue!==undefined?returnValue:$(this);};}(jQuery));;},{"":
".suggestions{overflow:hidden;position:absolute;top:0;left:0;width:0;border:none;z-index:1099;padding:0;margin:-1px -1px 0 0} html \x3e body .suggestions{margin:-1px 0 0 0}.suggestions-special{position:relative;background-color:white;font-size:0.8em;cursor:pointer;border:solid 1px #aaaaaa;padding:0;margin:0;margin-top:-2px;display:none;padding:0.25em 0.25em;line-height:1.25em}.suggestions-results{background-color:white;font-size:0.8em;cursor:pointer;border:solid 1px #aaaaaa;padding:0;margin:0}.suggestions-result{color:black;margin:0;line-height:1.5em;padding:0.01em 0.25em;text-align:left}.suggestions-result-current{background-color:#4C59A6;color:white}.suggestions-special .special-label{font-size:0.8em;color:gray;text-align:left}.suggestions-special .special-query{color:black;font-style:italic;text-align:left}.suggestions-special .special-hover{background-color:silver}.suggestions-result-current .special-label,.suggestions-result-current .special-query{color:white}.autoellipsis-matched,.highlight{font-weight:bold}\n\n/* cache key: commonswiki:resourceloader:filter:minify-css:7:d3d0fccf9f8cf3b31866dd3fd3326a6a */\n\n"
},{});mw.loader.implement("jquery.tabIndex",function(){(function($){$.fn.firstTabIndex=function(){var minTabIndex=null;$(this).find('[tabindex]').each(function(){var tabIndex=parseInt($(this).prop('tabindex'),10);if(tabIndex>0&&!isNaN(tabIndex)){if(minTabIndex===null){minTabIndex=tabIndex;}else if(tabIndex<minTabIndex){minTabIndex=tabIndex;}}});return minTabIndex;};$.fn.lastTabIndex=function(){var maxTabIndex=null;$(this).find('[tabindex]').each(function(){var tabIndex=parseInt($(this).prop('tabindex'),10);if(tabIndex>0&&!isNaN(tabIndex)){if(maxTabIndex===null){maxTabIndex=tabIndex;}else if(tabIndex>maxTabIndex){maxTabIndex=tabIndex;}}});return maxTabIndex;};}(jQuery));;},{},{});mw.loader.implement("mediawiki.action.view.metadata",function(){(function(mw,$){$(function(){var $row,$col,$link,showText=mw.msg('metadata-expand'),hideText=mw.msg('metadata-collapse'),$table=$('#mw_metadata'),$tbody=$table.find('tbody');if(!$tbody.length){return;}$row=$(
'<tr class="mw-metadata-show-hide-extended"></tr>');$col=$('<td colspan="2"></td>');$link=$('<a>',{text:showText,href:'#'}).click(function(){if($table.hasClass('collapsed')){$(this).text(hideText);}else{$(this).text(showText);}$table.toggleClass('expanded collapsed');return false;});$col.append($link);$row.append($col);$tbody.append($row);$table.addClass('collapsed');});}(mediaWiki,jQuery));;},{},{"metadata-expand":"Show extended details","metadata-collapse":"Hide extended details"});mw.loader.implement("mediawiki.api",function(){(function($,mw,undefined){var defaultOptions={parameters:{action:'query',format:'json'},ajax:{url:mw.util.wikiScript('api'),timeout:30*1000,dataType:'json'}};mw.Api=function(options){if(options===undefined){options={};}if(options.ajax&&options.ajax.url!==undefined){options.ajax.url=String(options.ajax.url);}options.parameters=$.extend({},defaultOptions.parameters,options.parameters);options.ajax=$.extend({},defaultOptions.ajax,options.ajax);this.defaults=
options;};mw.Api.prototype={normalizeAjaxOptions:function(arg){var opts=arg||{};if(typeof arg==='function'){opts={ok:arg};}return opts;},get:function(parameters,ajaxOptions){ajaxOptions=this.normalizeAjaxOptions(ajaxOptions);ajaxOptions.type='GET';return this.ajax(parameters,ajaxOptions);},post:function(parameters,ajaxOptions){ajaxOptions=this.normalizeAjaxOptions(ajaxOptions);ajaxOptions.type='POST';return this.ajax(parameters,ajaxOptions);},ajax:function(parameters,ajaxOptions){var token,apiDeferred=$.Deferred();parameters=$.extend({},this.defaults.parameters,parameters);ajaxOptions=$.extend({},this.defaults.ajax,ajaxOptions);if(parameters.token){token=parameters.token;delete parameters.token;}ajaxOptions.data=$.param(parameters).replace(/\./g,'%2E');if(token){ajaxOptions.data+='&token='+encodeURIComponent(token);}if(ajaxOptions.ok){apiDeferred.done(ajaxOptions.ok);delete ajaxOptions.ok;}if(ajaxOptions.err){apiDeferred.fail(ajaxOptions.err);delete ajaxOptions.err;}$.ajax(ajaxOptions)
.fail(function(xhr,textStatus,exception){apiDeferred.reject('http',{xhr:xhr,textStatus:textStatus,exception:exception});}).done(function(result){if(result===undefined||result===null||result===''){apiDeferred.reject('ok-but-empty','OK response but empty result (check HTTP headers?)');}else if(result.error){var code=result.error.code===undefined?'unknown':result.error.code;apiDeferred.reject(code,result);}else{apiDeferred.resolve(result);}});return apiDeferred.promise().fail(function(code,details){mw.log('mw.Api error: ',code,details);});}};mw.Api.errors=['ok-but-empty','timeout','duplicate','duplicate-archive','noimageinfo','uploaddisabled','nomodule','mustbeposted','badaccess-groups','stashfailed','missingresult','missingparam','invalid-file-key','copyuploaddisabled','mustbeloggedin','empty-file','file-too-large','filetype-missing','filetype-banned','filetype-banned-type','filename-tooshort','illegal-filename','verification-error','hookaborted','unknown-error','internal-error',
'overwrite','badtoken','fetchfileerror','fileexists-shared-forbidden','invalidtitle','notloggedin'];mw.Api.warnings=['duplicate','exists'];})(jQuery,mediaWiki);;},{},{});mw.loader.implement("mediawiki.user",function(){(function(mw,$){function User(options,tokens){var that=this;var callbacks={};function getUserInfo(info,callback){var api;if(callbacks[info]){callbacks[info].add(callback);return;}callbacks.rights=$.Callbacks('once memory');callbacks.groups=$.Callbacks('once memory');callbacks[info].add(callback);api=new mw.Api();api.get({action:'query',meta:'userinfo',uiprop:'rights|groups'}).always(function(data){var rights,groups;if(data.query&&data.query.userinfo){rights=data.query.userinfo.rights;groups=data.query.userinfo.groups;}callbacks.rights.fire(rights||[]);callbacks.groups.fire(groups||[]);});}this.options=options||new mw.Map();this.tokens=tokens||new mw.Map();function generateId(){var id='';var seed='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';for(var i=0,
r;i<32;i++){r=Math.floor(Math.random()*seed.length);id+=seed.substring(r,r+1);}return id;}this.getName=function(){return mw.config.get('wgUserName');};this.name=function(){return this.getName();};this.isAnon=function(){return that.getName()===null;};this.anonymous=function(){return that.isAnon();};this.sessionId=function(){var sessionId=$.cookie('mediaWiki.user.sessionId');if(typeof sessionId==='undefined'||sessionId===null){sessionId=generateId();$.cookie('mediaWiki.user.sessionId',sessionId,{'expires':null,'path':'/'});}return sessionId;};this.id=function(){var name=that.getName();if(name){return name;}var id=$.cookie('mediaWiki.user.id');if(typeof id==='undefined'||id===null){id=generateId();}$.cookie('mediaWiki.user.id',id,{expires:365,path:'/'});return id;};this.bucket=function(key,options){options=$.extend({'buckets':{},'version':0,'tracked':false,'expires':30},options||{});var cookie=$.cookie('mediaWiki.user.bucket:'+key);var bucket=null;var version=0;if(typeof cookie==='string'
&&cookie.length>2&&cookie.indexOf(':')>0){var parts=cookie.split(':');if(parts.length>1&&Number(parts[0])===options.version){version=Number(parts[0]);bucket=String(parts[1]);}}if(bucket===null){if(!$.isPlainObject(options.buckets)){throw'Invalid buckets error. Object expected for options.buckets.';}version=Number(options.version);var range=0,k;for(k in options.buckets){range+=options.buckets[k];}var rand=Math.random()*range;var total=0;for(k in options.buckets){bucket=k;total+=options.buckets[k];if(total>=rand){break;}}if(options.tracked){mw.loader.using('jquery.clickTracking',function(){$.trackAction('mediaWiki.user.bucket:'+key+'@'+version+':'+bucket);});}$.cookie('mediaWiki.user.bucket:'+key,version+':'+bucket,{'path':'/','expires':Number(options.expires)});}return bucket;};this.getGroups=function(callback){getUserInfo('groups',callback);};this.getRights=function(callback){getUserInfo('rights',callback);};}mw.user=new User(mw.user.options,mw.user.tokens);}(mediaWiki,jQuery));;},{},{
});mw.loader.implement("mediawiki.legacy.mwsuggest",function(){if(!mw.config.exists('wgMWSuggestTemplate')){mw.config.set('wgMWSuggestTemplate',mw.config.get('wgServer')+mw.config.get('wgScriptPath')+"/api.php?action=opensearch\x26search={searchTerms}\x26namespace={namespaces}\x26suggest");}window.os_map={};window.os_cache={};window.os_cur_keypressed=0;window.os_keypressed_count=0;window.os_timer=null;window.os_mouse_pressed=false;window.os_mouse_num=-1;window.os_mouse_moved=false;window.os_search_timeout=250;window.os_autoload_inputs=['searchInput','searchInput2','powerSearchText','searchText'];window.os_autoload_forms=['searchform','searchform2','powersearch','search'];window.os_is_stopped=false;window.os_max_lines_per_suggest=7;window.os_animation_steps=6;window.os_animation_min_step=2;window.os_animation_delay=30;window.os_container_max_width=2;window.os_animation_timer=null;window.os_enabled=true;window.os_use_datalist=false;window.os_Timer=function(id,r,query){this.id=id;this.r=r
;this.query=query;};window.os_Results=function(name,formname){this.searchform=formname;this.searchbox=name;this.container=name+'Suggest';this.resultTable=name+'Result';this.resultText=name+'ResultText';this.toggle=name+'Toggle';this.query=null;this.results=null;this.resultCount=0;this.original=null;this.selected=-1;this.containerCount=0;this.containerRow=0;this.containerTotal=0;this.visible=false;this.stayHidden=false;};window.os_AnimationTimer=function(r,target){this.r=r;var current=document.getElementById(r.container).offsetWidth;this.inc=Math.round((target-current)/os_animation_steps);if(this.inc<os_animation_min_step&&this.inc>=0){this.inc=os_animation_min_step;}if(this.inc>-os_animation_min_step&&this.inc<0){this.inc=-os_animation_min_step;}this.target=target;};window.os_MWSuggestInit=function(){if(!window.os_enabled){return;}for(var i=0;i<os_autoload_inputs.length;i++){var id=os_autoload_inputs[i];var form=os_autoload_forms[i];element=document.getElementById(id);if(element!=null)
{os_initHandlers(id,form,element);}}};window.os_MWSuggestTeardown=function(){for(var i=0;i<os_autoload_inputs.length;i++){var id=os_autoload_inputs[i];var form=os_autoload_forms[i];element=document.getElementById(id);if(element!=null){os_teardownHandlers(id,form,element);}}};window.os_MWSuggestDisable=function(){window.os_MWSuggestTeardown();window.os_enabled=false;}
window.os_initHandlers=function(name,formname,element){var r=new os_Results(name,formname);var formElement=document.getElementById(formname);if(!formElement){return;}os_hookEvent(element,'keyup',os_eventKeyup);os_hookEvent(element,'keydown',os_eventKeydown);os_hookEvent(element,'keypress',os_eventKeypress);if(!os_use_datalist){os_hookEvent(element,'blur',os_eventBlur);os_hookEvent(element,'focus',os_eventFocus);element.setAttribute('autocomplete','off');}os_hookEvent(formElement,'submit',os_eventOnsubmit);os_map[name]=r;if(document.getElementById(r.toggle)==null){}};window.os_teardownHandlers=function(name,formname,element){var formElement=document.getElementById(formname);if(!formElement){return;}os_unhookEvent(element,'keyup',os_eventKeyup);os_unhookEvent(element,'keydown',os_eventKeydown);os_unhookEvent(element,'keypress',os_eventKeypress);if(!os_use_datalist){os_unhookEvent(element,'blur',os_eventBlur);os_unhookEvent(element,'focus',os_eventFocus);element.removeAttribute(
'autocomplete');}os_unhookEvent(formElement,'submit',os_eventOnsubmit);};window.os_hookEvent=function(element,hookName,hookFunct){if(element.addEventListener){element.addEventListener(hookName,hookFunct,false);}else if(window.attachEvent){element.attachEvent('on'+hookName,hookFunct);}};window.os_unhookEvent=function(element,hookName,hookFunct){if(element.removeEventListener){element.removeEventListener(hookName,hookFunct,false);}else if(element.detachEvent){element.detachEvent('on'+hookName,hookFunct);}}
window.os_eventKeyup=function(e){var targ=os_getTarget(e);var r=os_map[targ.id];if(r==null){return;}if(os_keypressed_count==0){os_processKey(r,os_cur_keypressed,targ);}var query=targ.value;os_fetchResults(r,query,os_search_timeout);};window.os_processKey=function(r,keypressed,targ){if(keypressed==40&&!r.visible&&os_timer==null){r.query='';os_fetchResults(r,targ.value,0);}if(os_use_datalist){return;}if(keypressed==40){if(r.visible){os_changeHighlight(r,r.selected,r.selected+1,true);}}else if(keypressed==38){if(r.visible){os_changeHighlight(r,r.selected,r.selected-1,true);}}else if(keypressed==27){document.getElementById(r.searchbox).value=r.original;r.query=r.original;os_hideResults(r);}else if(r.query!=document.getElementById(r.searchbox).value){}};window.os_eventKeypress=function(e){var targ=os_getTarget(e);var r=os_map[targ.id];if(r==null){return;}var keypressed=os_cur_keypressed;os_keypressed_count++;os_processKey(r,keypressed,targ);};window.os_eventKeydown=function(e){if(!e){e=
window.event;}var targ=os_getTarget(e);var r=os_map[targ.id];if(r==null){return;}os_mouse_moved=false;os_cur_keypressed=(e.keyCode==undefined)?e.which:e.keyCode;os_keypressed_count=0;};window.os_eventOnsubmit=function(e){var targ=os_getTarget(e);os_is_stopped=true;if(os_timer!=null&&os_timer.id!=null){clearTimeout(os_timer.id);os_timer=null;}for(i=0;i<os_autoload_inputs.length;i++){var r=os_map[os_autoload_inputs[i]];if(r!=null){var b=document.getElementById(r.searchform);if(b!=null&&b==targ){r.query=document.getElementById(r.searchbox).value;}os_hideResults(r);}}return true;};window.os_hideResults=function(r){if(os_use_datalist){document.getElementById(r.searchbox).setAttribute('list','');}else{var c=document.getElementById(r.container);if(c!=null){c.style.visibility='hidden';}}r.visible=false;r.selected=-1;};window.os_decodeValue=function(value){if(decodeURIComponent){return decodeURIComponent(value);}if(unescape){return unescape(value);}return null;};window.os_encodeQuery=function(
value){if(encodeURIComponent){return encodeURIComponent(value);}if(escape){return escape(value);}return null;};window.os_updateResults=function(r,query,text,cacheKey){os_cache[cacheKey]=text;r.query=query;r.original=query;if(text==''){r.results=null;r.resultCount=0;os_hideResults(r);}else{try{var p=eval('('+text+')');if(p.length<2||p[1].length==0){r.results=null;r.resultCount=0;os_hideResults(r);return;}if(os_use_datalist){os_setupDatalist(r,p[1]);}else{os_setupDiv(r,p[1]);}}catch(e){os_hideResults(r);os_cache[cacheKey]=null;}}};window.os_setupDatalist=function(r,results){var s=document.getElementById(r.searchbox);var c=document.getElementById(r.container);if(c==null){c=document.createElement('datalist');c.setAttribute('id',r.container);document.body.appendChild(c);}else{c.innerHTML='';}s.setAttribute('list',r.container);r.results=[];r.resultCount=results.length;r.visible=true;for(i=0;i<results.length;i++){var title=os_decodeValue(results[i]);var opt=document.createElement('option');
opt.value=title;r.results[i]=title;c.appendChild(opt);}};window.os_getNamespaces=function(r){var namespaces='';var elements=document.forms[r.searchform].elements;for(i=0;i<elements.length;i++){var name=elements[i].name;if(typeof name!='undefined'&&name.length>2&&name[0]=='n'&&name[1]=='s'&&((elements[i].type=='checkbox'&&elements[i].checked)||(elements[i].type=='hidden'&&elements[i].value=='1'))){if(namespaces!=''){namespaces+='|';}namespaces+=name.substring(2);}}if(namespaces==''){namespaces=mw.config.get('wgSearchNamespaces').join('|');}return namespaces;};window.os_updateIfRelevant=function(r,query,text,cacheKey){var t=document.getElementById(r.searchbox);if(t!=null&&t.value==query){os_updateResults(r,query,text,cacheKey);}r.query=query;};window.os_delayedFetch=function(){if(os_timer==null){return;}var r=os_timer.r;var query=os_timer.query;os_timer=null;var path=mw.config.get('wgMWSuggestTemplate').replace("{namespaces}",os_getNamespaces(r)).replace("{dbname}",mw.config.get(
'wgDBname')).replace("{searchTerms}",os_encodeQuery(query));var cached=os_cache[path];if(cached!=null&&cached!=undefined){os_updateIfRelevant(r,query,cached,path);}else{var xmlhttp=sajax_init_object();if(xmlhttp){try{xmlhttp.open('GET',path,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&typeof os_updateIfRelevant=='function'){os_updateIfRelevant(r,query,xmlhttp.responseText,path);}};xmlhttp.send(null);}catch(e){if(window.location.hostname=='localhost'){alert("Your browser blocks XMLHttpRequest to 'localhost', try using a real hostname for development/testing.");}throw e;}}}};window.os_fetchResults=function(r,query,timeout){if(query==''){r.query='';os_hideResults(r);return;}else if(query==r.query){return;}os_is_stopped=false;if(os_timer!=null&&os_timer.id!=null){clearTimeout(os_timer.id);}if(timeout!=0){os_timer=new os_Timer(setTimeout("os_delayedFetch()",timeout),r,query);}else{os_timer=new os_Timer(null,r,query);os_delayedFetch();}};window.os_getTarget=function(
e){if(!e){e=window.event;}if(e.target){return e.target;}else if(e.srcElement){return e.srcElement;}else{return null;}};window.os_isNumber=function(x){if(x==''||isNaN(x)){return false;}for(var i=0;i<x.length;i++){var c=x.charAt(i);if(!(c>='0'&&c<='9')){return false;}}return true;};window.os_enableSuggestionsOn=function(inputId,formName){os_initHandlers(inputId,formName,document.getElementById(inputId));};window.os_disableSuggestionsOn=function(inputId){r=os_map[inputId];if(r!=null){os_timer=null;os_hideResults(r);document.getElementById(inputId).setAttribute('autocomplete','on');os_map[inputId]=null;}var index=os_autoload_inputs.indexOf(inputId);if(index>=0){os_autoload_inputs[index]=os_autoload_forms[index]='';}};window.os_eventBlur=function(e){var targ=os_getTarget(e);var r=os_map[targ.id];if(r==null){return;}if(!os_mouse_pressed){os_hideResults(r);r.stayHidden=true;if(os_timer!=null&&os_timer.id!=null){clearTimeout(os_timer.id);}os_timer=null;}};window.os_eventFocus=function(e){var
targ=os_getTarget(e);var r=os_map[targ.id];if(r==null){return;}r.stayHidden=false;};window.os_setupDiv=function(r,results){var c=document.getElementById(r.container);if(c==null){c=os_createContainer(r);}c.innerHTML=os_createResultTable(r,results);var t=document.getElementById(r.resultTable);r.containerTotal=t.offsetHeight;r.containerRow=t.offsetHeight/r.resultCount;os_fitContainer(r);os_trimResultText(r);os_showResults(r);};window.os_createResultTable=function(r,results){var c=document.getElementById(r.container);var width=c.offsetWidth-os_operaWidthFix(c.offsetWidth);var html='<table class="os-suggest-results" id="'+r.resultTable+'" style="width: '+width+'px;">';r.results=[];r.resultCount=results.length;for(i=0;i<results.length;i++){var title=os_decodeValue(results[i]);r.results[i]=title;html+='<tr><td class="os-suggest-result" id="'+r.resultTable+i+'"><span id="'+r.resultText+i+'">'+title+'</span></td></tr>';}html+='</table>';return html;};window.os_showResults=function(r){if(
os_is_stopped){return;}if(r.stayHidden){return;}os_fitContainer(r);var c=document.getElementById(r.container);r.selected=-1;if(c!=null){c.scrollTop=0;c.style.visibility='visible';r.visible=true;}};window.os_operaWidthFix=function(x){if(typeof document.body.style.overflowX!='string'){return 30;}return 0;};window.f_clientWidth=function(){return f_filterResults(window.innerWidth?window.innerWidth:0,document.documentElement?document.documentElement.clientWidth:0,document.body?document.body.clientWidth:0);};window.f_clientHeight=function(){return f_filterResults(window.innerHeight?window.innerHeight:0,document.documentElement?document.documentElement.clientHeight:0,document.body?document.body.clientHeight:0);};window.f_scrollLeft=function(){return f_filterResults(window.pageXOffset?window.pageXOffset:0,document.documentElement?document.documentElement.scrollLeft:0,document.body?document.body.scrollLeft:0);};window.f_scrollTop=function(){return f_filterResults(window.pageYOffset?window.
pageYOffset:0,document.documentElement?document.documentElement.scrollTop:0,document.body?document.body.scrollTop:0);};window.f_filterResults=function(n_win,n_docel,n_body){var n_result=n_win?n_win:0;if(n_docel&&(!n_result||(n_result>n_docel))){n_result=n_docel;}return n_body&&(!n_result||(n_result>n_body))?n_body:n_result;};window.os_availableHeight=function(r){var absTop=document.getElementById(r.container).style.top;var px=absTop.lastIndexOf('px');if(px>0){absTop=absTop.substring(0,px);}return f_clientHeight()-(absTop-f_scrollTop());};window.os_getElementPosition=function(elemID){var offsetTrail=document.getElementById(elemID);var offsetLeft=0;var offsetTop=0;while(offsetTrail){offsetLeft+=offsetTrail.offsetLeft;offsetTop+=offsetTrail.offsetTop;offsetTrail=offsetTrail.offsetParent;}if(navigator.userAgent.indexOf('Mac')!=-1&&typeof document.body.leftMargin!='undefined'){offsetLeft+=document.body.leftMargin;offsetTop+=document.body.topMargin;}return{left:offsetLeft,top:offsetTop};};
window.os_createContainer=function(r){var c=document.createElement('div');var s=document.getElementById(r.searchbox);var pos=os_getElementPosition(r.searchbox);var left=pos.left;var top=pos.top+s.offsetHeight;c.className='os-suggest';c.setAttribute('id',r.container);document.body.appendChild(c);c=document.getElementById(r.container);c.style.top=top+'px';c.style.left=left+'px';c.style.width=s.offsetWidth+'px';c.onmouseover=function(event){os_eventMouseover(r.searchbox,event);};c.onmousemove=function(event){os_eventMousemove(r.searchbox,event);};c.onmousedown=function(event){return os_eventMousedown(r.searchbox,event);};c.onmouseup=function(event){os_eventMouseup(r.searchbox,event);};return c;};window.os_fitContainer=function(r){var c=document.getElementById(r.container);var h=os_availableHeight(r)-20;var inc=r.containerRow;h=parseInt(h/inc)*inc;if(h<(2*inc)&&r.resultCount>1){h=2*inc;}if((h/inc)>os_max_lines_per_suggest){h=inc*os_max_lines_per_suggest;}if(h<r.containerTotal){c.style.
height=h+'px';r.containerCount=parseInt(Math.round(h/inc));}else{c.style.height=r.containerTotal+'px';r.containerCount=r.resultCount;}};window.os_trimResultText=function(r){var maxW=0;for(var i=0;i<r.resultCount;i++){var e=document.getElementById(r.resultText+i);if(e.offsetWidth>maxW){maxW=e.offsetWidth;}}var w=document.getElementById(r.container).offsetWidth;var fix=0;if(r.containerCount<r.resultCount){fix=20;}else{fix=os_operaWidthFix(w);}if(fix<4){fix=4;}maxW+=fix;var normW=document.getElementById(r.searchbox).offsetWidth;var prop=maxW/normW;if(prop>os_container_max_width){prop=os_container_max_width;}else if(prop<1){prop=1;}var newW=Math.round(normW*prop);if(w!=newW){w=newW;if(os_animation_timer!=null){clearInterval(os_animation_timer.id);}os_animation_timer=new os_AnimationTimer(r,w);os_animation_timer.id=setInterval("os_animateChangeWidth()",os_animation_delay);w-=fix;}if(w<10){return;}for(var i=0;i<r.resultCount;i++){var e=document.getElementById(r.resultText+i);var replace=1;
var lastW=e.offsetWidth+1;var iteration=0;var changedText=false;while(e.offsetWidth>w&&(e.offsetWidth<lastW||iteration<2)){changedText=true;lastW=e.offsetWidth;var l=e.innerHTML;e.innerHTML=l.substring(0,l.length-replace)+'...';iteration++;replace=4;}if(changedText){document.getElementById(r.resultTable+i).setAttribute('title',r.results[i]);}}};window.os_animateChangeWidth=function(){var r=os_animation_timer.r;var c=document.getElementById(r.container);var w=c.offsetWidth;var normW=document.getElementById(r.searchbox).offsetWidth;var normL=os_getElementPosition(r.searchbox).left;var inc=os_animation_timer.inc;var target=os_animation_timer.target;var nw=w+inc;if((inc>0&&nw>=target)||(inc<=0&&nw<=target)){c.style.width=target+'px';clearInterval(os_animation_timer.id);os_animation_timer=null;}else{c.style.width=nw+'px';if(document.documentElement.dir=='rtl'){c.style.left=(normL+normW+(target-nw)-os_animation_timer.target-1)+'px';}}};window.os_changeHighlight=function(r,cur,next,
updateSearchBox){if(next>=r.resultCount){next=r.resultCount-1;}if(next<-1){next=-1;}r.selected=next;if(cur==next){return;}if(cur>=0){var curRow=document.getElementById(r.resultTable+cur);if(curRow!=null){curRow.className='os-suggest-result';}}var newText;if(next>=0){var nextRow=document.getElementById(r.resultTable+next);if(nextRow!=null){nextRow.className=os_HighlightClass();}newText=r.results[next];}else{newText=r.original;}if(r.containerCount<r.resultCount){var c=document.getElementById(r.container);var vStart=c.scrollTop/r.containerRow;var vEnd=vStart+r.containerCount;if(next<vStart){c.scrollTop=next*r.containerRow;}else if(next>=vEnd){c.scrollTop=(next-r.containerCount+1)*r.containerRow;}}if(updateSearchBox){os_updateSearchQuery(r,newText);}};window.os_HighlightClass=function(){var match=navigator.userAgent.match(/AppleWebKit\/(\d+)/);if(match){var webKitVersion=parseInt(match[1]);if(webKitVersion<523){return'os-suggest-result-hl-webkit';}}return'os-suggest-result-hl';};window.
os_updateSearchQuery=function(r,newText){document.getElementById(r.searchbox).value=newText;r.query=newText;};window.os_eventMouseover=function(srcId,e){var targ=os_getTarget(e);var r=os_map[srcId];if(r==null||!os_mouse_moved){return;}var num=os_getNumberSuffix(targ.id);if(num>=0){os_changeHighlight(r,r.selected,num,false);}};window.os_getNumberSuffix=function(id){var num=id.substring(id.length-2);if(!(num.charAt(0)>='0'&&num.charAt(0)<='9')){num=num.substring(1);}if(os_isNumber(num)){return parseInt(num);}else{return-1;}};window.os_eventMousemove=function(srcId,e){os_mouse_moved=true;};window.os_eventMousedown=function(srcId,e){var targ=os_getTarget(e);var r=os_map[srcId];if(r==null){return;}var num=os_getNumberSuffix(targ.id);os_mouse_pressed=true;if(num>=0){os_mouse_num=num;}document.getElementById(r.searchbox).focus();return false;};window.os_eventMouseup=function(srcId,e){var targ=os_getTarget(e);var r=os_map[srcId];if(r==null){return;}var num=os_getNumberSuffix(targ.id);if(num>=0
&&os_mouse_num==num){os_updateSearchQuery(r,r.results[num]);os_hideResults(r);document.getElementById(r.searchform).submit();}os_mouse_pressed=false;document.getElementById(r.searchbox).focus();};window.os_createToggle=function(r,className){var t=document.createElement('span');t.className=className;t.setAttribute('id',r.toggle);var link=document.createElement('a');link.setAttribute('href','javascript:void(0);');link.onclick=function(){os_toggle(r.searchbox,r.searchform);};var msg=document.createTextNode(wgMWSuggestMessages[0]);link.appendChild(msg);t.appendChild(link);return t;};window.os_toggle=function(inputId,formName){r=os_map[inputId];var msg='';if(r==null){os_enableSuggestionsOn(inputId,formName);r=os_map[inputId];msg=wgMWSuggestMessages[0];}else{os_disableSuggestionsOn(inputId,formName);msg=wgMWSuggestMessages[1];}var link=document.getElementById(r.toggle).firstChild;link.replaceChild(document.createTextNode(msg),link.firstChild);};hookEvent('load',os_MWSuggestInit);;},{},{
"search-mwsuggest-enabled":"with suggestions","search-mwsuggest-disabled":"no suggestions"});mw.loader.implement("mediawiki.page.ready",function(){jQuery(document).ready(function($){if(!('placeholder'in document.createElement('input'))){$('input[placeholder]').placeholder();}$('.mw-collapsible').makeCollapsible();if($('table.sortable').length){mw.loader.using('jquery.tablesorter',function(){$('table.sortable').tablesorter();});}$('input[type=checkbox]:not(.noshiftselect)').checkboxShiftClick();mw.util.updateTooltipAccessKeys();});;},{},{});

/* cache key: commonswiki:resourceloader:filter:minify-js:7:6b48c1e0f8405012e7b9138d338b66b4 */
