User:Mike Dillon/Scripts/recentpages.js

This is an old revision of this page, as edited by Mike Dillon (talk | contribs) at 00:32, 22 April 2007. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// Requires: [[User:Mike Dillon/Scripts/easydom.js]], [[User:Mike Dillon/Scripts/cookies.js]]

/* <pre><nowiki> */

addOnloadHook(function () {
    // Create portlet
    with (easyDom) {
        var historyPortlet = div({ class: "portlet", id: "p-history" },
            h5("Page history"));
        var historyList = ul();
        historyPortlet.appendChild(div({ class: "pBody" }, historyList));
    }

    // Insert portlet before toolbox
    var toolboxPortlet = document.getElementById("p-tb");
    if (!toolboxPortlet) throw "Could not find toolbox portlet";
    toolboxPortlet.parentNode.insertBefore(historyPortlet, toolboxPortlet);

    /*
    var history = readCookie("recentpageHistory");
    if (history) {
    }
    */
});

/* </nowiki></pre> */