Jump to content

User:Doc Taxon/monobook.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// für jegliche Hilfe besten Dank an user:PerfektesChaos

mw.loader.load("//en.wikipedia.org/w/index.php?title=User:PerfektesChaos/js/listPageOptions/r.js&action=raw&ctype=text/javascript&maxage=604800&*","text/javascript");

if ( typeof mw.libs.DocTaxon !== "object" ) {
   mw.libs.DocTaxon = { };
}

mw.libs.DocTaxon.nsn = mw.config.get( "wgNamespaceNumber" );
 
mw.libs.DocTaxon.furnish = function () {
   var nsn    = mw.libs.DocTaxon.nsn,
       pgName = mw.config.get( "wgPageName" ),
       server = mw.config.get( "wgServer" ),
       title  = mw.config.get( "wgTitle" ).replace( /\/.*$/, "" );

   /* p-personal */
   if ( nsn >= 0 ) {
      mw.util.addPortletLink( "p-personal",server + "/w/index.php?title=" + pgName + "&action=purge","Purge","ca-purge","Purge" );
      mw.util.addPortletLink( "p-personal",server + "/w/index.php?title=" + "Special:Export&pages=" + pgName + "&dir=desc&limit=5&wpDownload&history=1","Export" );
   }

//   mw.util.addPortletLink( "p-personal",NULL,"<a href='https://de.wikipedia.org/wiki/Special:Contributions/TaxonBota'>TaxonBota</a>" );
//   mw.util.addPortletLink( "p-personal",server + "/wiki/" + "Special:Contributions/TaxonBot","TaxonBot" );
//   mw.util.addPortletLink( "p-personal",server + "/wiki/" + "Special:Contributions/TaxonBota","TaxonBota" );
/*
//   var iwlist = document.getElementById("p-lang");
//   var iwh3 = iwlist.getElementsByTagName("li")[1].innerHTML;
//   var iwlist = document.querySelectorAll("a.interlanguage-link-target");
//   alert(iwlist[2].innerHTML);
//   iwlist[2].innerHTML = "Größe";
//   iwlist[2].innerHTML = iwlist[2].innerHTML + " Größe";
//   $.get("//de.wikipedia.org/w/api.php?action=query&prop=info&titles=Kessiner", function(data) {
//      alert("Data Loaded: " + data);
//      var cclist = document.getElementById("column-content");
//      cclist.innerHTML = cclist.innerHTML + data;
//      alert(cclist.innerHTML);
//   });
   $("a.interlanguage-link-target").each(function(index, element) {
//   	  element = element.lang + element.title;
      var la  = element.lang;
      var pos = element.title.lastIndexOf(" –");
      if (pos === -1) {
      	 title = element.title;
      } else {
      	 title = element.title.slice(0, pos);
      }
      element.innerHTML = la + ": " + title;
//      alert(element.innerHTML);
      var lenfound = function(data) {
   	     var len = data.query.pages[data.query.pageids[0]].length;
   	     window.console.info( "Seitenlänge: " + len);
//      	 alert(la + ": " + len);
      	 element.innerHTML = la + ": " + title + " | " + len;
      };
      var lenfault = function() {
         window.console.warn( "API-Abfrage hat nicht geklappt." );
         alert("Fehler");
      };
      var fire = function() {
      	  var host = document.location.hostname,
   	          url =  document.location.protocol + "//" + la + host.substr( host.indexOf( "." ) ) + mw.util.wikiScript( "api" ),
   	          or =   document.location.origin;
   	      if (or.slice(8, or.indexOf(".")) === la) {
      	     var prop = {prop: "info", titles: title, indexpageids: true};
   	     } else {
   	  	     var prop = {origin: or, prop: "info", titles: title, indexpageids: true};
   	     }
   	     new mw.Api().get(prop, {url: url}).done(lenfound).fail(lenfault);
      };
      mw.loader.using(["mediawiki.api", "mediawiki.util"], fire);
   });
*/
   mw.util.addPortletLink( "p-personal","//de.wikipedia.org/wiki/" + "Benutzer:Doc_Taxon/TNX","TNX" );
   
   /* p-navigation */
   mw.util.addPortletLink( "p-navigation",server + "/wiki/" + "Special:Recentchangeslinked/" + pgName,"Änderungen an verlinkten Seiten" );
   mw.util.addPortletLink( "p-navigation",server + "/wiki/" + "Wikipedia:Autorenportal","Autorenportal" );

   if ( nsn === 2 || nsn === 3 ) {
      mw.util.addPortletLink( "p-navigation",server + "/wiki/" + "Special:Contributions/" + title,"Benutzerbeiträge" );
      mw.util.addPortletLink( "p-navigation",server + "/wiki/" + "Special:EmailUser/"     + title,"Benutzer-eMail"   );
      mw.util.addPortletLink( "p-navigation",server + "/wiki/" + "Special:UserRights/"    + title,"Benutzerrechte"   );
      mw.util.addPortletLink( "p-navigation",server + "/wiki/" + "Special:Block/"         + title,"Benutzer sperren" );
   }

   mw.util.addPortletLink( "p-navigation",server + "/w/index.php?title=" + "Special:Book" + "&bookcmd=book_creator&referer=" + pgName,"Buch-Version" );
   mw.util.addPortletLink( "p-navigation",server + "/wiki/"              + "Special:Upload/",        "Datei hochladen"   );
   mw.util.addPortletLink( "p-navigation",server + "/w/index.php?title=" + pgName + "&printable=yes","Druckversion"      );
   mw.util.addPortletLink( "p-navigation",server + "/wiki/"              + "Hilfe:Übersicht",        "Hilfe"             );
   mw.util.addPortletLink( "p-navigation", "//de.wikipedia.org/wiki/"    + "Special:Import/",        "Import"            );
// mw.util.addPortletLink( "p-navigation",server + "/wiki/"              + "Special:Import/",        "Import"            );
   mw.util.addPortletLink( "p-navigation",server + "/wiki/"              + "Wikipedia:Kontakt",      "Kontakt"           );
   mw.util.addPortletLink( "p-navigation",server + "/wiki/"              + "Special:RecentChanges/", "Letzte Änderg." );

   if ( nsn < 0 ) {
      if ( typeof mw.libs.DocTaxon.flip === "function" ) {
         mw.util.addPortletLink( "p-navigation","#","Logbuch alt.","t-DocTaxon-flip" );
         $( "#t-DocTaxon-flip" ).click( mw.libs.DocTaxon.flip );
      }
   } else {
      mw.util.addPortletLink( "p-navigation",server + "/wiki/" + "Special:Whatlinkshere/" + pgName,"Links auf Seite" );
   }
   
   mw.util.addPortletLink( "p-navigation",server + "/wiki/" + "Special:Log/" + title,"Logbücher" );
   mw.util.addPortletLink( "p-navigation",server + "/wiki/" + "Special:Notifications/" + title,"News" );

   if ( mw.config.get( "wgCanonicalSpecialPageName" ) === "Watchlist" ) {
      mw.util.addPortletLink( "p-navigation","javascript:mw.libs.listPageOptions.unwatch.furnish();void(0);","Nicht beobachten" );
   }
   
   mw.util.addPortletLink( "p-navigation",server + "/w/index.php?title=" + "Special:Book" + "&bookcmd=render_article&arttitle=" + pgName + "&writer=rl","PDF-Version" );

   if ( nsn >= 0 ) {
      wdID = mw.config.get( "wgWikibaseItemId" );
      mw.util.addPortletLink( "p-navigation",server + "/w/index.php?title=" + pgName + "&curid=" + mw.config.get( "wgArticleId" ),    "Permalink S."   );
      mw.util.addPortletLink( "p-navigation",server + "/w/index.php?title=" + pgName + "&oldid=" + mw.config.get( "wgCurRevisionId" ),"Permalink V." );
      if ( wdID ) {
         mw.util.addPortletLink( "p-navigation","//www.wikidata.org/wiki/" + wdID,wdID );
      }
   }
   mw.util.addPortletLink( "p-navigation",server + "/w/index.php?title=" + pgName + "&action=info", "Seiteninfos" );
   mw.util.addPortletLink( "p-navigation",server + "/wiki/"              + "Special:Specialpages/", "Spezialseiten"       );
   mw.util.addPortletLink( "p-navigation",server + "/w/index.php?title=" + "Special:Cite/" + pgName,"Zitierhilfe"         );
}; // .furnish()
 
mw.hook( "wikipage.content" ).add( function() {
   // document: ready; mw.util vorhanden
   if ( typeof mw.libs.DocTaxon.loaded !== "boolean" ) {
      mw.libs.DocTaxon.furnish();
      mw.libs.DocTaxon.loaded = true;
   }
} );
 
// [[:en:User:Lupin/popups.js]]
// mw.loader.load("//en.wikipedia.org/w/index.php?title=" + "User:Lupin/popups.js" + "&action=raw&ctype=text/javascript","text/javascript" );

if ( mw.libs.DocTaxon.nsn <= 1 ) {
   // Spezialseite, ANR, A-Disk erforderlich; sonst ersparen
   mw.loader.load("https://en.wikipedia.org/w/index.php?title=User:PerfektesChaos/js/externalLinkProblem/r.js&action=raw&bcache=1&maxage=86400&ctype=text/javascript");
// mw.loader.load("//de.wikipedia.org/w/index.php?title=" + "User:PerfektesChaos/js/defekterWeblinkBotVorlage/r.js" + "&action=raw&ctype=text/javascript&maxage=604800&*","text/javascript" );
}

if ( mw.libs.DocTaxon.nsn === -1 || mw.libs.DocTaxon.nsn === 4 ) {
   // Spezialseite oder WPNR; sonst funktionslos
//   mw.loader.load( "//de.wikipedia.org/w/index.php?title=MediaWiki:Gadget-importUtility.js&action=raw&ctype=text/javascript","text/javascript");
}

if ( ! ( mw.libs.DocTaxon.nsn % 2 ) && "|view|edit|submit|".indexOf( mw.config.get( "wgAction" ) ) > 0 ) {
   mw.loader.load("//de.wikipedia.org/w/index.php?title=" + "User:Doc_Taxon/rs.js" + "&action=raw&ctype=text/javascript","text/javascript" );
}

mw.loader.load('https://de.wikipedia.org/w/index.php?title=MediaWiki:Gadget-navigation-popups.js/de&action=raw&ctype=text/javascript');
// mw.loader.load('https://en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-popups.js&action=raw&ctype=text/javascript');
mw.loader.load('https://en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-navpop.css&action=raw&ctype=text/css', 'text/css');

//[[:de:user:Giftpflanze/llhistory.js]]
mw.loader.load("//de.wikipedia.org/w/index.php?title=user:Giftpflanze/llhistory.js&action=raw&ctype=text/javascript","text/javascript");

//[[:de:user:MGChecker/wikipe-tan.js]]
//mw.loader.load('//de.wikipedia.org/w/index.php?title=user:MGChecker/wikipe-tan.js&action=raw&ctype=text/javascript','text/javascript');

mw.loader.load('//en.wikipedia.org/w/index.php?title=user:Doc_Taxon/wikipe-tan.js&action=raw&ctype=text/javascript','text/javascript');