User:Edoderoo/vector.js

//------------------------------------------------------------------------------------
// Script plaatst interwiki's naar grotere Wikipedia's indien aanwezig bovenaan
// (Duits, Engels, Frans, Italiaans, Portugees, Spaans, Fins, Noors, Pools en Zweeds)
// Tevens enkele aan het Nederlands verwante talen
// (Afrikaans, Fries, Limburgs, Nedersaksisch, West-Vlaams en Zeeuws)
//
// Based on script found on [[:nn:MediaWiki/monobook.js]]
// Maintainers: [[:no:User:Jeblad]], fix voor nl: [[nl:User:Zanaq]]
//
// Indien andere talen gewenst het script kopiëren en de talen achter prefs= aanpassen
// Voeg de code importScript('Gebruiker:Troefkaart/interwiki.js'); toe aan monobook.js
// Vervang Troefkaart door eigen naam bij kopiëren gehele code
//
// Door bv li.interwiki-de, li.interwiki-en { font-weight: bold; } in het monobook.css 
// te plaatsen worden interwiki's naar aangegeven talen vet gemaakt.
// Werkt ook zonder dit script
//------------------------------------------------------------------------------------ 
 
  addOnloadHook( function () {
 
      //if (!prefs) return;
      prefs=["nl", "de", "en", "fr", "it", "pl", "pt", "sv", "es"]
 
      var iwlinks = [];
      for (i=0;i<prefs.length;i++) {
          iwlinks["interwiki-" + prefs[i]] = 1;
      }
      var container = document.getElementById("p-lang");
 
      if (!container) return;
 
      var keeps = Array();
      var ul = container.getElementsByTagName("ul");
      if (!ul) return;
      if (ul.length != 1) return;
      ul = ul[0];
      var childs = container.getElementsByTagName("li");
      for (i=0;i<childs.length;i++) {
          // the following test fails if there are several classes for the actual child
	  if ( iwlinks[ childs[i].getAttribute( 'class' ) ] ) {
	      keeps.push(childs[i]);
          }
      }
      var n = childs.length;
      for (i=childs.length-1;i>=0;i--) {
	  if ( !iwlinks[ childs[i].getAttribute( 'class' ) ] ) {
	      keeps[--n] = childs[i];
          }
          else {
              childs[i].setAttribute( 'class', childs[i].getAttribute( 'class' ) + ' iw-focus' );
          }
      }
 
      var child;
      while (child = ul.firstChild) {
          ul.removeChild(child);
      }
      for (i=0;i<keeps.length;i++) {
          ul.appendChild(keeps[i]);
      }
  });

importScript(':nl:Gebruiker:Michielderoo/interwiki-translate-nl.js');
importScript(':nl:Gebruiker:Edoderoo/interwiki.js');

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.