Usuario:Ggenellina/configurar-popups.js

Nota: Después de guardar, debes refrescar la caché de tu navegador para ver los cambios. Internet Explorer: mantén presionada Ctrl mientras pulsas Actualizar. Firefox: mientras presionas Mayús pulsas el botón Actualizar, (o presiona Ctrl-Shift-R). Los usuarios de Google Chrome y Safari pueden simplemente pulsar el botón Recargar. Para más detalles e instrucciones acerca de otros exploradores, véase Ayuda:Cómo limpiar la caché.

// Usuario:Ggenellina/configurar-popups.js

// Gadget: Navigation popups
// Normally features are enabled
var toFix = true;
 
// In special pages, histories and previews disable them
if (wgCanonicalNamespace == "Special" || /*
    */ location.href.indexOf('&action=history') != -1 || /*
    */ location.href.indexOf('&action=submit') != -1)
  toFix = false;
 
// opciones
window.popupRedlinkRemoval = toFix;
window.popupFixRedirs = toFix;
window.popupFixDabs = toFix;
window.popupContribsPreviewLimit = 25;
window.popupOnEditSelection = true;
window.popupRedlinkRemoval = true;
window.popupFixDabs = true;
window.popupFixRedirs = true;
//window.popupInitialWidth = false;
//window.popupMaxWidth = false;
window.popupOnlyArticleLinks = false;
window.popupStructure = 'menus'

/*
// initialize the array - only do this once
window.extraPopupFilters = [];
 
// define the function
function popupDemo(wikiText) {
  return '<table>';
};
 
// add the function to the array (you can repeat this for lots of functions)
extraPopupFilters.push(popupDemo);

var popupShowBackLinks = {

    titles: [],
    
    filter: function(data) {
        console.log('filter');
        console.log(data);
        var api = new mw.Api();
        api.get({
            action: 'query',
            list: 'backlinks',
            blnamespace: 0,
            bllimit: 10, 
            blredirect: 1,
            bltitle: 'Latinoamerica'}, 
            {async: false})
            .done(popupShowBackLinks.process);
        console.log('volvio de api.get');
        return popupShowBackLinks.titles.join(', ');    
    },
        
    process: function(data) {
        console.log('process');
        console.log(data);
        popupShowBackLinks.titles = [];
        for (var name in data.query.backlinks) {
            if ((undefined===name) || (null===name))
                continue;
            var page = data.query.backlinks[name];
            if (page && page.title)
                popupShowBackLinks.titles.push(page.title);
        }
        if (data['query-continue'])
            popupShowBackLinks.titles.push('...');
        console.log('sale de process');
        console.log(popupShowBackLinks.titles);
    }
};

// add sthe function to the array (you can repeat this for lots of functions)
window.extraPopupFilters.push(popupShowBackLinks.Filter);

console.log('window.extraPopupFilters.push')
*/