if(typeof(wfAnchorEncode)!="function"){functionwfAnchorEncode(str){str=encodeURIComponent(str);str=str.replace(/%/g,".");str=str.replace(/\.20/g,"_");str=str.replace(/\.3A/g,":");returnstr;}}functionch(o){for(variino){returno[i]}}varwgPage={'rq':null,'links':0,'author':'','firstedit':'','addAnalyzeTab':function(){if(mw.config.get('wgNamespaceNumber')!=0)return;mw.util.addPortletLink('p-cactions','javascript:wgPage.analyzePage()','Анализировать','ca-summary','Дать сводку по статье');},'onGetLinksData':function(){if(this.readyState!=4)return;if(this.status!=200)return;result=eval('('+this.responseText+')');wgPage.links=result.query.backlinks.length;varuri=mw.config.get('wgServer')+mw.config.get('wgScriptPath')+'/api.php?format=json&action=query&prop=info|revisions&rvlimit=1&rvdir=newer&titles='+encodeURIComponent(mw.config.get('wgPageName'));wgPage.rq=sajax_init_object();wgPage.rq.onreadystatechange=wgPage.onGetHistory;wgPage.rq.open("GET",uri,true);wgPage.rq.send("");},'onGetHistory':function(){if(this.readyState!=4)return;if(this.status!=200)return;result=eval('('+this.responseText+')');wgPage.firstedit=ch(result.query.pages).revisions[0]['timestamp'];wgPage.author=ch(result.query.pages).revisions[0]['user'];jsMsg('Ссылок на статью из других статей: '+wgPage.links+'<br />'+'Автор: <a href="http://ru.wikipedia.org/wiki/User:'+encodeURIComponent(wgPage.author)+'">'+wgPage.author+'</a><br />'+'Дата первой правки: '+wgPage.firstedit);},'analyzePage':function(){varuri=mw.config.get('wgServer')+mw.config.get('wgScriptPath')+'/api.php?format=json&action=query&list=backlinks&bllimit=max&blfilterredir=nonredirects&blnamespace=0&bltitle='+encodeURIComponent(mw.config.get('wgPageName'));this.rq=sajax_init_object();this.rq.onreadystatechange=this.onGetLinksData;this.rq.open("GET",uri,true);this.rq.send("");}}$(wgPage.addAnalyzeTab);