"मिडियाविकी:Common.js" च्या विविध आवृत्यांमधील फरक

Content deleted Content added
← Migration: [[RL/MGU#ImportScript|Removing importScript* (is part of software now, continues to work the same way); -en.wikipedia copy/paste mainpage script (didn't work, mr.wikipedia has no wgTitle of 'Main Page')
छो ← Migration: <pre> tags are redundant ; -pgcount (doesn't work, copied from en.wikipedia, and pgcount.wikimedia is closed down); -MainPageDeletedImage (never worked here, English only)
ओळ ३४४:
}
/** pageview counter ***********************************************************
*
* Description: Please talk to de:User:LeonWeber before changing anything or
* if there are any issues with that.
* Maintainers: [[:de:User:LeonWeber]]?
*/
// this should be adjusted to a good value.
// BE CAREFUL, you will break zedler if it's too low!
// And then DaB. will kill Leon :-(
var disable_counter = 0;
var counter_factor = 6000;
function pgcounter_setup()
{
if(disable_counter == 0)
{
var url = window.location.href;
if(Math.floor(Math.random()*counter_factor)==42) // the probability thing
{
if(wgIsArticle==true || wgArticleId==0) // do not count history pages etc.
{
var pgcountNs = wgCanonicalNamespace;
if(wgCanonicalNamespace=="")
{
pgcountNs = "0";
}
var cnt_url = "http://pgcount.wikimedia.de/index.png?ns=" + pgcountNs + "&title=" + encodeURI(wgTitle) + "&factor=" + counter_factor +"&wiki=enwiki";
var img = new Image();
img.src = cnt_url;
}
}
}
}
// Do not use aOnloadFunctions[aOnloadFunctions.length] = pgcounter_setup;, some browsers don't like that.
pgcounter_setup();
/** "Technical restrictions" title fix *****************************************
Line ५३० ⟶ ४९४:
return (isNaN(num) ? 0 : num);
}
/** Main Page deletion image *******************************************************
*
* Description: If the Main Page does not exist (i.e., it's been deleted) then insert an image
* instead of showing the "page does not exist" text.
* Created by: [[User:Mark]], with invaluable help from [[User:Pathoschild]]
*/
function MainPageDeletedImage() {
try {
//If the article does not exist and it is the Main Page, proceed
if ( document.getElementById( "noarticletext" ) && wgTitle == 'Main Page' ) {
// Insert a protected commons image at the end of the document explaining it.
var contentbox = document.getElementById('content');
var newimg = document.createElement('img');
newimg.setAttribute('src','http://upload.wikimedia.org/wikipedia/commons/9/99/WikipediaTechnical.png');
contentbox.appendChild(newimg);
// Hide the article-does-not-exist text
var NoArticleMessage = document.getElementById('noarticletext');
NoArticleMessage.style.display="none";
// Hide the edit button
var EditThisPageButton = document.getElementById('ca-edit');
EditThisPageButton.style.display="none";
}
} catch(e) {
// In case it does not work, do nothing
return;
}
}
addOnloadHook( MainPageDeletedImage );
/**
Line ५७० ⟶ ४९९:
* disponibles dans une boîte déroulante.
* Auteurs : Jakob Voss, Guillaume, importé depuis la Wiki allemande
* <pre><nowiki>
*/
 
Line ७८८ ⟶ ७१६:
*/
function PngFix(){
{
if (document.body.filters && !window.PngFixDisabled)
{