Diferencia entre revisiones de «MediaWiki:Common.js»

De CNB
Ir a la navegación Ir a la búsqueda
Busca en cnbGuatemala con Google

Línea 22: Línea 22:
 
/* Activa instrumento para definir coordenadas de imágenes como vínculos bajo ImageMap
 
/* Activa instrumento para definir coordenadas de imágenes como vínculos bajo ImageMap
 
/*importScriptURI('//tools.wmflabs.org/imagemapedit/ime.js');*/
 
/*importScriptURI('//tools.wmflabs.org/imagemapedit/ime.js');*/
 +
 +
function resize_iframe()
 +
{
 +
    var height=window.innerWidth;//Firefox
 +
    if (document.body.clientHeight)
 +
    {
 +
        height=document.body.clientHeight;//IE
 +
    }
 +
    //resize the iframe according to the size of the
 +
    //window (all these should be on the same line)
 +
    document.getElementById("quiz").style.height=
 +
        parseInt(height - document.getElementById("quiz").offsetTop-8)+"px";
 +
}
 +
 +
// this will resize the iframe every
 +
// time you change the size of the window.
 +
window.onresize=resize_iframe;

Revisión del 00:28 8 jul 2016

/*
var conf = mw.config.get([
    'wgNamespaceNumber',
    'wgTitle',
    'wgPageName'
]);
// Only do the following on the Project:Sandbox page.
if ( conf.wgNamespaceNumber === 0  ) {
    // Add a link to the actions menu to Special:Log for this page.
    mw.loader.using( 'mediawiki.util', function () {
        mw.util.addPortletLink(
            'p-cactions',
            mw.util.getUrl( 'Special:Log', { page : conf.wgPageName } ),
            'Logs'
        );
    } );
}
*/

/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios en cada carga de página */

/* Activa instrumento para definir coordenadas de imágenes como vínculos bajo ImageMap
/*importScriptURI('//tools.wmflabs.org/imagemapedit/ime.js');*/

function resize_iframe()
{
    var height=window.innerWidth;//Firefox
    if (document.body.clientHeight)
    {
        height=document.body.clientHeight;//IE
    }
    //resize the iframe according to the size of the
    //window (all these should be on the same line)
    document.getElementById("quiz").style.height=
        parseInt(height - document.getElementById("quiz").offsetTop-8)+"px";
}

// this will resize the iframe every
// time you change the size of the window.
window.onresize=resize_iframe;