MediaWiki razgovor:Common.js

message: /**
 * Skripta za mijenjanje dvaju zemljovida
 */
addOnloadHook(function(){ 
  var cont;
  if(!(wgAction=="view")) return
 
  cont=getElementsByClass('img_toogle', document.getElementById('bodyContent'), 'div');
  if(cont.length==0) return
 
  for (var i = 0; i < cont.length ; i++) {
    cont.box = getElementsByClass('geobox',cont[i]);
    cont.box[0].style.display='none';
    cont.box[1].style.borderTop='0';
    var toogle = document.createElement('a');
    toogle.appendChild(document.createTextNode(cont.box[0].getElementsByTagName('img')[0].alt));
    toogle.href='#';
    toogle.className='a_toogle';
    toogle.status = 1;
    toogle.onclick = function() {
      this.removeChild(this.firstChild);
      div0 = getElementsByClass('geobox',this.parentNode)[0];
      div1 = getElementsByClass('geobox',this.parentNode)[1];
      alt0 = div0.getElementsByTagName('img')[0].alt;
      alt1 = div1.getElementsByTagName('img')[0].alt;
      if(this.status==0) {
        div0.style.display='none';
        div1.style.display=;
        this.status=1;
        this.appendChild(document.createTextNode(alt0));
      } else {
        div0.style.display=;
        div1.style.display='none';
        this.status=0;
        this.appendChild(document.createTextNode(alt1));
      }
      return false;
    }
  cont[i].insertBefore(toogle, cont.box[1].nextSibling);
  }
});

message: Hello, I propose to enable the tool created by Magnus Manske (creator of MediaWiki) to provide results from other languages and Commons (via Wikidata) when a page doesn't exist here: links are added to Special:Search and noarticletext. This helps to encourage translation and to make readers use your wiki more, because they can be sure to find something even if it's not local (rather than searching directly on the biggest wiki). The Italian and Polish Wikipedias, among others already enabled it by default.
Examples:   . More information: Magnus blog.
How to: just add the following line at the end of Common.js.
// Results from Wikidata
// [[File:Wdsearch_script_screenshot.png]]
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Search' ||  ( mw.config.get( 'wgArticleId' ) === 0 && mw.config.get( 'wgCanonicalSpecialPageName' ) === false ) ) {
	importScriptURI("//en.wikipedia.org/w/index.php?title=MediaWiki:Wdsearch.js&action=raw&ctype=text/javascript");
}
--[[m:User:Nemo_bis|Nemo]] ~~~~~ ([[w:en:MediaWiki talk:Wdsearch.js|comments, translations and last instructions]])
</div>
<!-- EdwardsBot 0661 -->
thread_title:  Give search results even when page doesn't exist 

message: Hi! I want to let you know that in near future badges will be deployed on Wikidata and the Wikipedias. They help us with displaying the good and featured article icons next to the sitelinks and will replace the javascript hack which is used at the moment together with the Link GA and Link FA templates. To avoid an overlap where the current system and the new feature conflict, I will add a minor fix to your Common.js which adds the class names to the interwiki links. This is part of my task as a global edit interface editor for the Wikidata team. Thanks, Bene* (razgovor) 22:26, 18. kolovoza 2014. (CEST)
thread_title:  Announced JavaScript change for badges implementation