Diferència entre revisions de la pàgina «MediaWiki:Gadget-DocTabs.js»

deprecated: wgPageName, wgScriptPath, wgArticlePath, wgCanonicalNamespace
(canvi de funcions obsoletes (mw:ResourceLoader/JavaScript Deprecations))
(deprecated: wgPageName, wgScriptPath, wgArticlePath, wgCanonicalNamespace)
function add_namespace_tab(page, id) {
var insert = get_insert_position(id);
addPortletLink(insert[0], mw.config.get("wgArticlePath").replace("$1", page), texts[id][0], id, texts[id][1], texts[id][2], insert[1]);
if (page == mw.config.get("wgPageName")) { // Can by-pass lookup
var tab = document.getElementById(id);
tab.className = 'selected';
ct.parentNode.removeChild(ct);
// Add new tab.
add_namespace_tab(mw.config.get("wgPageName"), new_id);
 
// Change destination of talk tab.
var dt = document.getElementById('ca-talk');
var a = dt.getElementsByTagName('a')[0]
a.setAttribute('href', mw.config.get("wgArticlePath").replace("$1", talk_page));
lookup[talk_page] = dt;
if(dt.className) dt.className = dt.className.replace('new','');
}
if( mw.config.get("wgCanonicalNamespace") == 'Template' && /\/ús$/.test(wgTitle) ){
var baseTitle = wgTitle.replace(/\/ús$/, "");
change_main_tabs('ca-nstab-template', 'ca-nstab-documentation', 'Plantilla Discussió:' + baseTitle);
add_namespace_tab('Plantilla:' + baseTitle, 'ca-nstab-template');
 
}else if( mw.config.get("wgCanonicalNamespace") == 'Template' || mw.config.get("wgCanonicalNamespace") == 'Template_talk' ){
add_namespace_tab('Plantilla:'+wgTitle+'/ús', 'ca-nstab-documentation');
 
if(! ajaxer) return false;
var url = mw.config.get("wgScriptPath") + '/api.php?format=json&action=query&prop=info&titles=';
var spl = '';
for(var page in lookup){
14.850

modificacions