showClock

By janp Last update Jul 8, 2008 — Installed 1,782 times.

Archived Comments (locked)

in
Subscribe to Archived Comments 21 posts, 6 voices



Jesse Andrews Admin

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

 
janp Script's Author

hi simon!

ok, i see the problem - i will have a look

 
janp Script's Author

i made some overdue changes.
print bug: clock will now not be printed
thanks to jerome the clock now won't appear in iframes
automatic check for update now disabled by default (did you mean that, simon! ?)

 
simon! Scriptwright

You really MUST to fix this script!

see this page, the clock spreads all over.

 
jerone Scriptwright

Maybe people find the following code handy when they don't want to add clocks into iframes within pages:

if(top.location != location){  // anti-frame
    return
};

 
jerone Scriptwright

I'm having some problems with changing page's so i added a little extra controle.
In the function showClock() change it to:

if (document.getElementById("clockDiv")) document.getElementById("clockDiv").innerHTML = zeit;
if (document.getElementById("dateDiv")) document.getElementById("dateDiv").innerHTML = datum;

 
janp Script's Author

Tieso, I re-applied the simple styled clock.

 
Tieso Scriptwright

What´s up Jan! Your script r terrific! But I remember the first version. In that version the text color it depended of the backgroud of the web page.

I miss that.

 
janp Script's Author

V5.1: now checks just once a day for an update.
also set text color to black, and reorganisation of code.

 
janp Script's Author

V5.0: update function included -> script informs you when a new version of the script is available

 
janp Script's Author

V4.0 date included

 
janp Script's Author

Thanks for the proposals for my script, Daniel. I did not know that there is that possibility with the Greasemonkey menu. I have now used it, quite handy :)

Since I haven’t thought of the different media types (screen and printing), the script now distinguish by itself, and there is no clock on printouts any longer.

Actually, I have just seen pages with z-index: 100 (haven’t really looked so far), but (e.g.) there is the header layer “spiegel online” on http://www.spiegel.de/ --it’s in front of the clock div, for whatever reason.

 
Daniel Dawson Scriptwright

I just noticed this after you updated it. I won't be using it, as I wouldn't find it useful myself. But I had some thoughts just from reading about it:

First, CSS 2 introduced media-specific style rules, so you could set 'display:fixed' (or 'display:absolute', or however you're doing it) for screen and 'display:none' for others. That way, it simply won't show up on printout. (Then again, maybe someone would want it on printout?)

Related to this, instead of making your users modify the source, GM provides for adding menu commands for your script (GM_registerMenuCommand) and functions to get and set preferences (GM_getValue and GM_setValue). Consider using them. Take a look at http://wiki.greasespot.net/Code_snippets#Make_m... for a relevant way to use these. If you do this, you'll find your commands under Tools > Greasemonkey > User Script Commands (unless there's a platform-specific difference there).

Hmm. You say some pages will have layers in front of the clock. I see you set the z-index to 1000. Have you actually seen pages with higher layers than that?

 
janp Script's Author

now its possible to display a non running clock to see at what time a webpage was loaded:
var runningClock = false;

 
janp Script's Author

You can now hide the clock by clicking on it (e.g. for printing reasons).

 
janp Script's Author

You can now place the clock in each corner you like to.

var horizontal = "right"; //"right" or "left"
var vertical = "bottom"; //"bottom" or "top"

Some pages have layers that will be in front of the clock.

 
janp Script's Author

if (jetzt.getSeconds() < 10) zeit = zeit + '0';
works--I just forgot it in the function updating the clock

 
Tieso Scriptwright

Thanks Jan Parchmann, but I think this instrucction doesn't work:

if (jetzt.getSeconds() < 10) zeit = zeit + '0';

Screenshot:
http://img252.imageshack.us/img252/4238/timege9...

 
jerone Scriptwright

Maybe you can make it an option to choose were you want to position the clock: left-top / left-bottom / right-top / right-bottom.
This because every site has its own layout.

 
janp Script's Author

You can now display seconds by changing line 10:
var showSeconds = true;

 
Tieso Scriptwright

Very funtional. Can u show the seconds?

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