User:Bequw/SubPages.js

//IE <=8 doesn't have array.IndexOf /*if (!Array.indexOf) { Array.prototype.indexOf = function (obj, start) { var len = this.length; var i = (start || 0); if (i < 0) i += len;

for (i < len; i++) { if (this[i] == obj) return i;   } return -1; } }*/

/** subpages **/ $(function {  var NSWithoutSubpages = new Array(-1, 6, 8, 12, 13, 14, 15, 104, 105);  if (document.getElementById('p-tb') && NSWithoutSubpages.indexOf(wgNamespaceNumber) == -1)    {    var linkSubpages = '/wiki/Special:PrefixIndex/' + wgPageName + '/';    mw.util.addPortletLink('p-tb', linkSubpages, 'Subpages', 't-subpages', 'Subpages of this page');    } });