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","*":"Project","subpages":"","canonical":"Project"},"5":{"id":5,"case":"first-letter","*":"Project 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","subpages":"","canonical":"Category"},"15":{"id":15,"case":"first-letter","*":"Category talk","canonical":"Category talk"},"90":{"id":90,"case":"first-letter","*":"Thread","canonical":"Thread"},"91":{"id":91,"case":"first-letter","*":"Thread talk","canonical":"Thread talk"},"92":{"id":92,"case":"first-letter","*":"Summary","canonical":"Summary"},"93":{"id":93,"case":"first-letter","*":"Summary talk","canonical":"Summary talk"},"100":{"id":100,"case":"first-letter","*":"Manual","subpages":"","canonical":"Manual","content":""},"101":{"id":101,"case":"first-letter","*":"Manual talk","subpages":"","canonical":"Manual talk"},"102":{"id":102,"case":"first-letter","*":"Extension","subpages":"","canonical":"Extension","content":""},"103":{"id":103,"case":"first-letter","*":"Extension talk","subpages":"","canonical":"Extension talk"},"104":{"id":104,"case":"first-letter","*":"API","subpages":"","canonical":"API"},"105":{"id":105,"case":"first-letter","*":"API talk","subpages":"","canonical":"API talk"},"106":{"id":106,"case":"first-letter","*":"Skin","canonical":"Skin"},"107":{"id":107,"case":"first-letter","*":"Skin talk","canonical":"Skin talk"},"828":{"id":828,"case":"first-letter","*":"Module","canonical":"Module"},"829":{"id":829,"case":"first-letter","*":"Module talk","canonical":"Module talk"},"1198":{"id":1198,"case":"first-letter","*":"Translations","subpages":"","canonical":"Translations"},"1199":{"id":1199,"case":"first-letter","*":"Translations talk","subpages":"","canonical":"Translations talk"},"2500":{"id":2500,"case":"first-letter","*":"VisualEditor","canonical":"VisualEditor","content":""},"2501":{"id":2501,"case":"first-letter","*":"VisualEditor talk","canonical":"VisualEditor talk","content":""}}}} };

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'); } });