Melding:InterProject.js

Úr Wikiorðabók, frjálsu orðabókinni

Athugaðu: Eftir útgáfu kann að vera að þú þurfir að komast hjá skyndiminni vafrans þíns til að sjá breytingarnar.

  • Firefox / Safari: Haltu Shift samtímis og þú smellir á Endurhlaða (Reload), eða ýttu á annaðhvort Ctrl-F5 eða Ctrl-R (⌘-R á Mac)
  • Google Chrome: Ýttu á Ctrl-Shift-R (⌘-Shift-R á Mac)
  • Internet Explorer / Edge: Haltu Ctrl samtímis og þú smellir á Endurnýja (Refresh), eða ýttu á Ctrl-F5
  • Opera: Farðu í Verkfæri (Tools) → Stillingar (Preferences) og svo Friðhelgi og öryggi (Privacy & security) → Hreinsa vafragögn (Clear browsing data) → Myndir og skrár í skyndiminni (Chached images and files)
/**
 * Workaround for [[bugzilla:708]] via [[Template:InterProject]].
 * Originally based on code from [[wikt:de:MediaWiki:Common.js]] by [[wikt:de:User:Melancholie]],
 * cleaned up and modified for compatibility with the Vector skin by [[commons:User:Ilmari Karonen]]
 */
$( function () {
    if ( document.getElementById('p-interproject') ) return;  // avoid double inclusion
 
    var interPr = document.getElementById('interProject');
    var sisterPr = document.getElementById('sisterProjects');
    if (!interPr) return;
 
    var toolBox = document.getElementById('p-tb');
    var panel;
    if (toolBox) {
        panel = toolBox.parentNode;
    } else {
        // stupid incompatible skins...
        var panelIds = ['panel', 'column-one', 'mw_portlets', 'mw-panel'];
        for (var i = 0; !panel && i < panelIds.length; i++) {
             panel = document.getElementById(panelIds[i]);
        }
        // can't find a place for the portlet, try to undo hiding
        if (!panel) {
            mw.util.addCSS( '#interProject, #sisterProjects { display: block; }' );
            return;
        }
    }
 
    var interProject = document.createElement("div");
    interProject.id = "p-interproject";
    interProject.className = (mw.config.get('skin') == "vector" ? "portal" : "portlet");
 
    interProject.innerHTML =
        '<h5><a href="/wiki/Wikiorðabók:Systurverkefni">' +
        (sisterPr && sisterPr.firstChild ? sisterPr.firstChild.innerHTML : "Systurverkefni") +
        '<\/a><\/h5><div class="' + (mw.config.get('skin') == "vector" ? "body" : "pBody") +'">' +
        interPr.innerHTML + '<\/div>';
 
    if (toolBox && toolBox.nextSibling) {
        panel.insertBefore(interProject, toolBox.nextSibling);
    } else {
        panel.appendChild(interProject);
    }
} );
mw.util.addCSS( '#interProject, #sisterProjects { display: none; }' );