Help talk:UTC clock

From Homestar Runner Wiki

Revision as of 22:21, 20 September 2007 by Super Martyo Brother (Talk | contribs)
Jump to: navigation, search

Suuuuuuure, now I find this page! Anyway, when I hacked Mathwiz2020's code to get it to work here, I figured out that the reason it doesn't work elsewhere isn't necessarily because the Monobook skin is different, but because Wikimedia's Wikibits file is is insanely huge and has way more hooks than ours (if we even have one I assume it's still set at the MediaWiki default) does. The code in its present form has some weird parameter that sets every possible modifications of the gsTimeInsertBefore variable to a numeric value so there's less chance of error when you sset where you want it to go. I can't for the life of me figure out how that's working, as it doesn't look logical, but the old version that both Joey and I modified to work herereally just needs the following to be put at the beginning of your monobook.js for you to be able to use it without any modifications:

var doneOnloadHook;

if (!window.onloadFuncts)
	var onloadFuncts = [];

function addOnloadHook(hookFunct) {
	// Allows add-on scripts to add onload functions
	onloadFuncts[onloadFuncts.length] = hookFunct;
}

function runOnloadHook() {
	// don't run anything below this for non-dom browsers
	if (doneOnloadHook || !(document.getElementById && document.getElementsByTagName))
		return;

	histrowinit();
	unhidetzbutton();
	tabbedprefs();
	akeytt();
	scrollEditBox();
	setupCheckboxShiftClick();

	// Run any added-on functions
	for (var i = 0; i < onloadFuncts.length; i++)
		onloadFuncts[i]();

	doneOnloadHook = true;
}

function hookEvent(hookName, hookFunct) {
	if (window.addEventListener)
		addEventListener(hookName, hookFunct, false);
	else if (window.attachEvent)
		attachEvent("on" + hookName, hookFunct);
}

hookEvent("load", runOnloadHook);

— User:ACupOfCoffee@ 16:25, 28 April 2006 (UTC)

Is there a way to modify this script for specific timezones? --Mario2.PNG Super Martyo boing! 22:21, 20 September 2007 (UTC)

Personal tools