User:Solitarius/common.js

/** * Sous-pages */

addOnloadHook(function {

var siteinfo = { namespaces: // Update the following line from http://meta.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces&format=json {"query":{"namespaces":{"-2":{"id":-2,"case":"first-letter","*":"Media","canonical":"Media"},"-1":{"id":-1,"case":"first-letter","*":"Special","canonical":"Special"},"0":{"id":0,"case":"first-letter","*":"","subpages":"","content":""},"1":{"id":1,"case":"first-letter","*":"Talk","subpages":"","canonical":"Talk"},"2":{"id":2,"case":"first-letter","*":"User","subpages":"","canonical":"User"},"3":{"id":3,"case":"first-letter","*":"User talk","subpages":"","canonical":"User talk"},"4":{"id":4,"case":"first-letter","*":"Meta","subpages":"","canonical":"Project"},"5":{"id":5,"case":"first-letter","*":"Meta talk","subpages":"","canonical":"Project talk"},"6":{"id":6,"case":"first-letter","*":"File","canonical":"File"},"7":{"id":7,"case":"first-letter","*":"File talk","subpages":"","canonical":"File talk"},"8":{"id":8,"case":"first-letter","*":"MediaWiki","canonical":"MediaWiki"},"9":{"id":9,"case":"first-letter","*":"MediaWiki talk","subpages":"","canonical":"MediaWiki talk"},"10":{"id":10,"case":"first-letter","*":"Template","subpages":"","canonical":"Template"},"11":{"id":11,"case":"first-letter","*":"Template talk","subpages":"","canonical":"Template talk"},"12":{"id":12,"case":"first-letter","*":"Help","subpages":"","canonical":"Help"},"13":{"id":13,"case":"first-letter","*":"Help talk","subpages":"","canonical":"Help talk"},"14":{"id":14,"case":"first-letter","*":"Category","canonical":"Category"},"15":{"id":15,"case":"first-letter","*":"Category talk","canonical":"Category talk"},"100":{"id":100,"case":"first-letter","*":"Hilfe","subpages":"","canonical":"Hilfe"},"101":{"id":101,"case":"first-letter","*":"Hilfe Diskussion","subpages":"","canonical":"Hilfe Diskussion"},"102":{"id":102,"case":"first-letter","*":"Aide","subpages":"","canonical":"Aide"},"103":{"id":103,"case":"first-letter","*":"Discussion Aide","subpages":"","canonical":"Discussion Aide"},"104":{"id":104,"case":"first-letter","*":"Hj\u00e6lp","subpages":"","canonical":"Hj\u00e6lp"},"105":{"id":105,"case":"first-letter","*":"Hj\u00e6lp diskussion","subpages":"","canonical":"Hj\u00e6lp diskussion"},"106":{"id":106,"case":"first-letter","*":"Helpo","subpages":"","canonical":"Helpo"},"107":{"id":107,"case":"first-letter","*":"Helpa diskuto","subpages":"","canonical":"Helpa diskuto"},"108":{"id":108,"case":"first-letter","*":"Hj\u00e4lp","subpages":"","canonical":"Hj\u00e4lp"},"109":{"id":109,"case":"first-letter","*":"Hj\u00e4lp diskussion","subpages":"","canonical":"Hj\u00e4lp diskussion"},"110":{"id":110,"case":"first-letter","*":"Ayuda","subpages":"","canonical":"Ayuda"},"111":{"id":111,"case":"first-letter","*":"Ayuda Discusi\u00f3n","subpages":"","canonical":"Ayuda Discusi\u00f3n"},"112":{"id":112,"case":"first-letter","*":"Aiuto","canonical":"Aiuto"},"113":{"id":113,"case":"first-letter","*":"Discussioni aiuto","canonical":"Discussioni aiuto"},"114":{"id":114,"case":"first-letter","*":"\u30d8\u30eb\u30d7","canonical":"\u30d8\u30eb\u30d7"},"115":{"id":115,"case":"first-letter","*":"\u30d8\u30eb\u30d7\u2010\u30ce\u30fc\u30c8","canonical":"\u30d8\u30eb\u30d7\u2010\u30ce\u30fc\u30c8"},"116":{"id":116,"case":"first-letter","*":"NL Help","canonical":"NL Help"},"117":{"id":117,"case":"first-letter","*":"Overleg help","canonical":"Overleg help"},"118":{"id":118,"case":"first-letter","*":"Pomoc","canonical":"Pomoc"},"119":{"id":119,"case":"first-letter","*":"Dyskusja pomocy","canonical":"Dyskusja pomocy"},"120":{"id":120,"case":"first-letter","*":"Ajuda","canonical":"Ajuda"},"121":{"id":121,"case":"first-letter","*":"Ajuda Discuss\u00e3o","canonical":"Ajuda Discuss\u00e3o"},"122":{"id":122,"case":"first-letter","*":"CA Ajuda","canonical":"CA Ajuda"},"123":{"id":123,"case":"first-letter","*":"CA Ajuda Discussi\u00f3","canonical":"CA Ajuda Discussi\u00f3"},"124":{"id":124,"case":"first-letter","*":"Hjelp","canonical":"Hjelp"},"125":{"id":125,"case":"first-letter","*":"Hjelp diskusjon","canonical":"Hjelp diskusjon"},"126":{"id":126,"case":"first-letter","*":"\u5e2e\u52a9","canonical":"\u5e2e\u52a9"},"127":{"id":127,"case":"first-letter","*":"\u5e2e\u52a9 \u5bf9\u8bdd","canonical":"\u5e2e\u52a9 \u5bf9\u8bdd"},"128":{"id":128,"case":"first-letter","*":"\u041f\u043e\u043c\u043e\u0449\u044c","canonical":"\u041f\u043e\u043c\u043e\u0449\u044c"},"129":{"id":129,"case":"first-letter","*":"\u041f\u043e\u043c\u043e\u0449\u044c \u0414\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u044f","canonical":"\u041f\u043e\u043c\u043e\u0449\u044c \u0414\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u044f"},"130":{"id":130,"case":"first-letter","*":"Pomo\u010d","canonical":"Pomo\u010d"},"131":{"id":131,"case":"first-letter","*":"Pogovor o pomo\u010di","canonical":"Pogovor o pomo\u010di"},"132":{"id":132,"case":"first-letter","*":"\u0645\u0633\u0627\u0639\u062f\u0629","canonical":"\u0645\u0633\u0627\u0639\u062f\u0629"},"133":{"id":133,"case":"first-letter","*":"\u0646\u0642\u0627\u0634 \u0627\u0644\u0645\u0633\u0627\u0639\u062f\u0629","canonical":"\u0646\u0642\u0627\u0634 \u0627\u0644\u0645\u0633\u0627\u0639\u062f\u0629"},"200":{"id":200,"case":"first-letter","*":"Grants","subpages":"","canonical":"Grants"},"201":{"id":201,"case":"first-letter","*":"Grants talk","subpages":"","canonical":"Grants talk"},"202":{"id":202,"case":"first-letter","*":"Research","subpages":"","canonical":"Research"},"203":{"id":203,"case":"first-letter","*":"Research talk","subpages":"","canonical":"Research talk"},"1198":{"id":1198,"case":"first-letter","*":"Translations","subpages":"","canonical":"Translations"},"1199":{"id":1199,"case":"first-letter","*":"Translations talk","subpages":"","canonical":"Translations talk"}}}} };

if(!siteinfo.namespaces.query.namespaces[wgNamespaceNumber].hasOwnProperty("subpages")) { return false; }

if (document.getElementById('p-tb')) { var lienSouspages = '/w/index.php?title=Special%3APrefixIndex&prefix=' + wgTitle + '&namespace=' + wgNamespaceNumber; addPortletLink('p-tb', lienSouspages, 'Sous-pages', 't-subpages', 'Sous-pages de cette page'); } });