My favorites | Sign in
Logo
             
Search
for
Updated Jul 03, 2009 by aavindraa
Labels: Release
0988  

0.98.8

Accidentally busted playlisting in previous version. Working again.

Changed array notation to faster one

E.g.,

	usecolor : ["Enable colors", GM_getValue("usecolor", true), "Choose this option if you want to use colors at all."],

to:

	usecolor : new Array("Enable colors", GM_getValue("usecolor", true), "Choose this option if you want to use colors at all."),

Incorporated a "create" function to massively reduce code

function create(A, B, C) {
	A = document.createElement(A);
	if(B) for(var b in B) {
		var cur=B[b];
		if(b.indexOf("on")==0)
			A.addEventListener(b.substring(2), cur, false);
		else if(b=="style")
			for(var s in cur)
				A.style[s] = cur[s];
		else
			A[b]=B[b];
	}
	if(C) for(var i=0; i<C.length; ++i) A.appendChild(C[i]);
	return A;
}

Added links to the option dialog

optionBox.appendChild(create("span",
	{
		id : "myLinks"
	}, new Array(
		document.createTextNode("Script links: "),
		create("a",  {
			href : "http://userscripts.org/scripts/show/31864",
			textContent : "homepage"
		}),
		document.createTextNode(" | "),
		create("a",  {
			href : "http://userscripts.org/users/avindra",
			textContent : "author"
		}),
		document.createTextNode(" | "),
		create("a",  {
			href : "http://userscripts.org/scripts/discuss/31864",
			textContent : "forums"
		}),
		document.createTextNode(" | "),
		create("a", {
			href : "#",
			textContent : "check for update",
			onclick : function(e) {
				e.preventDefault();
				update(true);
			}
		})
	)
));

Sign in to add a comment
Hosted by Google Code