aaad_US_update

Last update on Sep 23, 2008

Part 4 of US_framework; US_update. Updated 23-09-2008 16:00 [v1.7 Beta].


US_update

$1 Intro:

I'm working on a Userscript framework (US_framework), which contains 4 parts:

This script will contain the 4th part for update checking.

News and information you can find on this page, but all explanation about the functions can you find on my personal site.

Please scroll down to $3 Install on how to install this script.

$2 News:

After this install there shouldn't be a reason to every time update this script to the latest versions of the other scripts.

Off course these scripts are in Beta stage and errors/bugs can occur. Please post these a.s.a.p. so I can fix them.

Have fun using it, gr Jerone

$3 Changelog:

[+] = added; [-] = removed; [/] = fixed; [*] = updated;
  • 02-05-2008 15.00 [v1.0 Alpha]:
    [+] Initial release;
  • 03-05-2008 18.00 [v1.1 Beta]:
    [*] cleaned up code;
    [+] added framework check;
    [+] fixed updating install count;
  • 04-05-2008 18.00 [v1.2 Beta]:
    [+] cleaned up code;
    [+] added instructions;
    [+] added option for only userscripts.org script number;
  • 05-05-2008 13.00 [v1.3 Beta]:
    [/] fixed bug in not available US_language;
  • 18-05-2008 20.00 [v1.3.1 Beta]:
    [*] update to latest US_language version;
  • 19-05-2008 14.00 [v1.3.2 Beta]:
    [/] fixed bug with wrong update url;
  • 30-05-2008 18.00 [v1.4 Beta]:
    [/] fixed framework check;
  • 02-06-2008 18.00 [v1.5 Beta]:
    [+] added custom loader;
  • 02-06-2008 19.00 [v1.5.1 Beta]:
    [/] fixed bug for double run of USU.loader when o.readyState==1;
  • 02-06-2008 23.30 [v1.5.2 Beta]:
    [*] cleaned up init;
    [+] added more overrides;
  • 03-06-2008 14.00 [v1.5.3 Beta]:
    [*] cleaned up code;
    [/] changed custom loader for more use;
  • 03-06-2008 14.30 [v1.6 Beta]:
    [+] added function to return all data;
    [+] added function to return all script names;
  • 08-08-2008 16.00 [v1.6.1 Beta]:
    [*] cleaned up code;
  • 10-08-2008 12.45 [v1.6.2 Beta]:
    [*] updated minor function;
  • 16-08-2008 14.30 [v1.6.3 Beta]:
    [*] updated to latest US_functions version;
    [+] added real live US_framework versions;
  • 19-08-2008 16.30 [v1.6.4 Beta]:
    [*] minor changes;
    [*] updated to latest US_framework versions;
  • 23-09-2008 16.00 [v1.7 Beta]:
    [/] fixed reset translation;
    [+] added version comment;
    [/] fixed check with no version number;
    [/] fixed check when version number higher then ten;
    [*] cleaned up code;

$4 Feature's:

- will check for updates when added to another script.

List will be completed soon.

$5 Install:

Follow these instructions:
  • Install this script by clicking the 'Install' button on the top.
  • As soon as you've done that, go to my other 3 scripts and install these also: US_functions, US_language and US_options.
  • Then right-click the GreaseMonkey icon in your statusbar or go to 'Tools' and find 'GreaseMonkey'.
  • A menu will pop-up and choose 'Manage User Scripts...'
  • You'll get a window that displays all scripts. Search my 4 scripts and drag and drop them to the top of the list. Make sure that there's none script above them and that they are in order (see image):
    1. aaaa US_functions
    2. aaab US_language
    3. aaac US_options
    4. aaad US_update

$6 Options:

The following settings are optional and will override all script settings when used.

USUtitleOverRide
[String] UserScript name;
USUcheck4UpdateOverRide
[Boolean] check for updates;
USUupdateTimeOverRide
[Integer MILLISECONDS] time interval between update checks;
USUDoSOverRide
[Integer MILLISECONDS] anti-DoS time;
USUlanguageOverRide
[String LANGUAGE SHORT or "navigator"/"browser"] language;
Read more about it at US_language;
USUheadersOverRide
[Object] use specific HTTP headers;
USUmimeTypeOverRide
[String] override normal MimeType;
USUshowLogOverRide
[Boolean] show log;
USUshowVcommentOverRide
[Boolean] show new versions comment;
USUshowLoaderOverRide
[Boolean] show loader overlay;
USUcustomLoaderOverRide
[Function] override normal loader;
In the comments below is a nice example;

$7 Todo:

  • Internet Explorer (IE7Pro) and Opera (UserJS) compatible.

$8 In Use:

Just leave a comment if you're using this script too and want to be added above.

$9 Notes:

I made this userscript in Dreamweaver 8.
It's tested in Firefox 2.0.0.16 (continuous) and Firefox 3.0.1 (partly) with GreaseMonkey 0.8.
This script is copyrighted and I prefer if you ask if you can 'borrow' parts of this script.
Installing is at own risk and I can't be held responsible if anything goes wrong.
Want to reward me for putting time and sweat into making this free userscript; (thank you).

$10 Comments:




You could comment on this script if you were logged in.

2 comments Feed-icon

1 point
login to vote
jerone script's author
Posted Jun 3, 2008

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.

1 point
login to vote
jerone script's author
Posted May 19, 2008

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