User:SWFlash/monobook.js

function show{ shoe=['welcome','niwa','shroom','maintain','footer','p-Browse','p-community'] for(i=0;i<shoe.length;i++){$(shoe[i]).style.display='table'} $('announce').innerHTML=backup_announce $('announce').style.padding='0px 2px' $('ca-watch').style.display='none'}

function is_gif_image(i){return /^(?!data:).*\.gif/i.test(i.src)} function freeze_gif(i){ c=document.createElement('canvas') w=c.width=i.width h=c.height=i.height c.getContext('2d').drawImage(i,0,0,w,h) try{i.src=c.toDataURL("image/gif")} catch(e){for(j=0,a;a=i.attributes[j];j++) c.setAttribute(a.name,a.value) i.parentNode.replaceChild(c,i)}}

function $(a){return document.getElementById(a)}

function editer{editlead=$('firstHeading');if(editlead){ editlead.innerHTML+=' [править] '}}

function altload{if(!$('wpLicense').value){ alert('Вы должны выбрать лицензию!') }else{ uplo.type='submit' uplo.setAttribute('onclick','') uplo.click}}

function unserc(val){ tmp=[];tmp2=[];get=[] url=location.search if(url){ tmp=url.substr(1).split('&') for(i=0;i<tmp.length;i++){ tmp2=tmp[i].split('=') get[tmp2[0]]=tmp2[1]} return get[val]}}

onload=function{

if(!$('filetoc')){[].slice.apply(document.images).filter(is_gif_image).map(freeze_gif)}

if(wgPageName=='Special:Upload'&&unserc('wpForReUpload')!='1'){ uplo=document.getElementsByName('wpUpload')[0] uplo.type='button' uplo.setAttribute('onclick','altload')}

document.title=document.title.replace(' — Super Mario Wiki','')

editab=$('ca-edit') editab=editab?editab.getElementsByTagName('a')[0].innerHTML:'';if(editab=='Править'){ if(wgIsArticle){rig=wgRestrictionEdit;gir=wgUserGroups;if(rig.length==0){editer }else{for(i=0;iПодпись' $('pt-preferences').innerHTML+=' JS CSS'

if($('bodyContent').innerHTML.indexOf('Очистить кеш этой страницы?')>0) {$('bodyContent').getElementsByTagName('form')[0].getElementsByTagName('input')[0].click}

if(wgPageName=='User:SWFlash/Sig'){$('pt-mytalk').getElementsByClassName('spe')[0].getElementsByTagName('a')[0].style.fontWeight='bold'} if(wgPageName=='User:SWFlash/monobook.js'){$('pt-preferences').getElementsByClassName('spe')[0].getElementsByTagName('a')[0].style.fontWeight='bold'} if(wgPageName=='User:SWFlash/monobook.css'){$('pt-preferences').getElementsByClassName('spe')[1].getElementsByTagName('a')[0].style.fontWeight='bold'}

$('mw-searchButton').setAttribute('accesskey','f')

if(wgTitle=='Main Page'){ $('ca-nstab-main').getElementsByTagName('a')[0].innerHTML='Заглавная'}

if(wgPageName=='Main_Page'){

announce=$('announce');if(announce){ backup_announce=announce.innerHTML announce.innerHTML=' Super Mario Wiki   Ссылки: Чат, Список наблюдения, Предложения</a>, JS</a>, CSS</a>. ' announce.style.padding='15px'}

proposal=document.getElementsByClassName('MainPageProposalBox')[0];if(proposal){ proposal.innerHTML=' [править</a>] '+proposal.innerHTML}

pds=document.getElementsByClassName('pds-links')[0] if(pds){location=pds.getElementsByTagName('a')[0].href}

$('ca-watch').getElementsByTagName('a')[0].style.display='none' reset=document.createElement('a') reset.href='javascript:show' $('ca-watch').appendChild(reset)

$('searchInput').focus }}