×
Create or edit a page
Write your page title here:
There are currently 17 pages on the wiki. Enter a name above to create a page, or check out the list of broken links.
Warning: Users creating spam pages will be blocked and have their pages moved to the trash.



    Pi Server Wiki

    Common.js

    MediaWiki page
    Note: After saving, changes may not occur immediately. Click here to learn how to bypass your browser's cache.
    • Mozilla / Firefox / Safari: hold down Shift while clicking Reload, or press Ctrl-Shift-R (Cmd-Shift-R on Apple Mac);
    • Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5;
    • Konqueror: simply click the Reload button, or press F5;
    • Opera users may need to completely clear their cache in Tools→Preferences.
    /* Any JavaScript here will be loaded for all users on every page load. */
    window.clockInt = 0;
        
    window.startClock = function() {
        if (!window.clockInt) {
        	window.clockInt = setInterval(window.setClock, 250);
      	}
    };
    
    window.setClock = function() {
        var d = new Date();
        window.userLink.textContent = d.toLocaleTimeString();
    };
        
    window.stopClock = function() {
    	if (window.clockInt) {
    	    clearInterval(window.clockInt);
    		window.clockInt = 0;
    	}
    };
        
    jQuery(document).ready(function($) {
    	window.userLink = document.getElementById("pt-userpage-2") || document.getElementById("pt-userpage") || document.getElementById("pt-anonuserpage");
        if (window.userLink) {
        	window.userLink.classList.add("clock");
            window.startClock();
        }
    });