US Update

By jerone Last update Jan 10, 2009 — Installed 5,017 times.

Archived Comments (locked)

in
Subscribe to Archived Comments 3 posts, 2 voices



Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
jerone Script's Author

The last update I made included an option to add a custom loader instead of the normal loader.
So to make an example I wrote a little function that can be used as the custom loader.
Just add the following code to the addon customLoader in every script you want:

eval(US_functions.prototype({Number:[],String:[],Array:['find'],Object:[]}));

var language=new US_language({langMod:"browser",
	locals:{
		en:{
			'customLoader':{
				'checkUpdate':'Checking for update for @title@ ...',
		}	},
		nl:{
			'customLoader':{
				'checkUpdate':'Controleren op update voor @title@ ...',
}	}	}	});

new US_update({
	// normal settings...
	addon:{
		customLoader:	function(o,USU){
			if(!window.CLscripts){window.CLscripts=[];}
			if(!USU.CLbeenHere||USU.CLbeenHere===null){USU.CLbeenHere=false;}
			var CLscripts=window.CLscripts;
			if(o.readyState==1 && USU.CLbeenHere===false){  // loading...
				CLscripts.push(USU.title);
				if(!$gi('CLoverlay')){
					var CLoverlay=$sa($ce("DIV"),"id","CLoverlay");
					$sa(CLoverlay,"style",$setReturnOpacity(100)+" position:fixed; height:25px; bottom:0px; right:0px; color:gray; z-index:9998; border:solid black; border-width:3px 0 0 3px; -moz-border-radius:1em 0 0 0;");
					$addEvent(CLoverlay,"dblclick",function(){$re($gi("CLoverlay"));});
					$ac($d.body,CLoverlay);
					var CLwrapper=$sa($ce("DIV"),"style",$setReturnOpacity(70)+" background-color:black; width:100%; height:100%; font-size:10px; -moz-border-radius:1em 0 0 0");
					$ac(CLoverlay,CLwrapper);
					var CLspan=$sa($ce("span"),"id","CLspan");
					$sa(CLspan,"style",$setReturnOpacity(100)+" padding:6px 6px 6px 0; font:10px; color:gray; z-index:9999; white-space:nowrap; float:right;");
					$ac(CLspan,$ct(language.localise(['customLoader','checkUpdate'],{"title":CLscripts.join(" & ")})));
					$ac(CLwrapper,CLspan);
					var CLimg=$sa($ce("IMG"),"src",USU.loadingImage);
					$sa(CLimg,"style",$setReturnOpacity(100)+" margin:4px; z-index:9999; float:left;");
					$ac(CLwrapper,CLimg);
				}
				else{
					$ih($gi('CLspan'),language.localise(['customLoader','checkUpdate'],{"title":CLscripts.join(" & ")}));
				}
				USU.CLbeenHere=true;
			}
			else if(o.readyState==4){
				CLscripts.splice(CLscripts.find(USU.title),1);
				if(CLscripts.length>=1){
					if($gi('CLspan')){
						$ih($gi('CLspan'),language.localise(['customLoader','checkUpdate'],{"title":CLscripts.join(" & ")}));
				}	}
				else if($gi('CLoverlay')){
					$re($gi("CLoverlay"));  // cleanup
				}
				USU.CLbeenHere=null;
}	}	}	});
Another good suggestion would be to use the window title or status bar.

 
jerone Script's Author

If you're planning of using this script, please note your findings here and I'll add you to the 'use' list.

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel