From b06588fbe2f0a011639dabc833d17246cf0c937b Mon Sep 17 00:00:00 2001 From: Pantelis Panayiotou
| `CoolClock` | Required | @@ -69,32 +74,57 @@ The colon delimited fields after CoolClock in the class control the appearance o|
| `Skin` | Optional. Default is "swissRail" | -Specifies which skin to use. CoolClock currently includes seven skins, -"swissRail", "chunkySwiss", "fancy", "machine", "classic", "modern" and -"simple". (The last three were created by Bonstio for use with his Google -Gadget). It's easy to create your own additional skins | Specifies which skin to use for rendering the clock face. Four skins are +defined in coolclock.js: swissRail, chunkySwiss, chunkySwissOnBlack and +miliUbuntu. A lot more can be found in moreskins.js. | + +
| `textSkin` | Optional. Default is "std" | + +Specifies which skin to use for rendering the title and the digital clock. +Three such skins are defined for you: std, stdOnBlack and +miliUbuntu. |
| `Radius` | Optional. Default is 85 | -Specifies the radius in pixels of the clock | Specifies the radius in pixels of the clock. |
| `noSeconds` | Optional | -If you include "noSeconds" as the last field then the clock will have no -second hand. Use if your CPU usage is too high | If you include "noSeconds" here then the clock will have no second hand. +Use if your CPU usage is too high. | + +
| `gmtOffset` | Optional | + +If you don't specify anything you get local time (or server time, if your +clocks are sync'ed with the web server). If you specify a value here (in hours) +it will be used as an offset from GMT (UTC). Eg, put -5 to indicate 5 hours +behind GMT. You can specify fractions of hours, eg +2.5 |
| `showDigital` | Optional | + +If you put "showDigital" here then a digital clock will be rendered on top +of the clock face |
| `GMTOffset` | Optional | +|
| `clockTitle` | Optional | -If you don't specify anything you get local time. If you specify a value -here (in hours) it will be used as an offset from GMT (UTC). Eg, put -5 to -indicate 5 hours behind GMT. You can specify fractions of hours, eg -+2.5 | Add some text here and it will be rendered on top of the clock face, as a +title to the clock. Leave it empty if you don't want a title. Due to the nature +of the class property, if you need spaces in titles, you must substitute them +with underscores. For example: "New_York". | + +
| `logClock` | Optional | + +Put "logClock" here, and you'll get a logarithmic clock. |
| `logClockRev` | Optional | + +Similarly, put "logClockRev" to get a reverse logarithmic clock. |
| `CoolClock` | Required | +|
| class | Required | -Without that your canvas will be left alone | Must be set to CoolClock. Otherwise, your canvas will be left alone. | -
| `Skin` | Optional. Default is "swissRail" | +|
| `_skinId` | Optional. Default is "swissRail" | Specifies which skin to use for rendering the clock face. Four skins are defined in coolclock.js: swissRail, chunkySwiss, chunkySwissOnBlack and miliUbuntu. A lot more can be found in moreskins.js. |
| `textSkin` | Optional. Default is "std" | +|
| `_textSkinId` | Optional. Default is "std" | Specifies which skin to use for rendering the title and the digital clock. Three such skins are defined for you: std, stdOnBlack and miliUbuntu. |
| `Radius` | Optional. Default is 85 | +|
| `_displayRadius` | Optional. Default is 85 | Specifies the radius in pixels of the clock. |
| `noSeconds` | Optional | +|
| `_renderRadius` | Optional. Default is 100 | -If you include "noSeconds" here then the clock will have no second hand. -Use if your CPU usage is too high. | Specifies canvas size in pixels. | -
| `gmtOffset` | Optional | +|
| `_secondHand` | Optional. Default is "tick" | + +Set this to "none" if you want a clock with no second hand. Set it to +"tick" to have a second hand that ticks every second. Or to "smooth" for a one +that rotates continuously. It should be noted that "smooth" consumes a lot of +CPU time. |
| `_gmtOffset` | Optional | If you don't specify anything you get local time (or server time, if your -clocks are sync'ed with the web server). If you specify a value here (in hours) +clocks are sync'ed with the web server). If you specify a value (in hours) it will be used as an offset from GMT (UTC). Eg, put -5 to indicate 5 hours behind GMT. You can specify fractions of hours, eg +2.5 |
| `showDigital` | Optional | +|
| `_showDigital` | Optional | -If you put "showDigital" here then a digital clock will be rendered on top -of the clock face | If you define this tag then a digital clock will be rendered on top of the +clock face | -
| `clockTitle` | Optional | +|
| `_clockTitle` | Optional | Add some text here and it will be rendered on top of the clock face, as a -title to the clock. Leave it empty if you don't want a title. Due to the nature -of the class property, if you need spaces in titles, you must substitute them -with underscores. For example: "New_York". |
| `logClock` | Optional | -Put "logClock" here, and you'll get a logarithmic clock. |
| `logClockRev` | Optional | - -Similarly, put "logClockRev" to get a reverse logarithmic clock. | Set this to "normal" to get a logarithmic clock, or to "reverse" to get a +reverse logarithmic clock. (By default, of course, the clock is +linear.) |
| class | Required | -Must be set to CoolClock. Otherwise, your canvas will be left alone. | Must be set to "CoolClock". Otherwise, your canvas will be left +alone. |
| `_skinId` | Optional. Default is "swissRail" | @@ -97,7 +98,7 @@ miliUbuntu.|
| `_secondHand` | Optional. Default is "tick" | Set this to "none" if you want a clock with no second hand. Set it to -"tick" to have a second hand that ticks every second. Or to "smooth" for a one +"tick" to have a second hand that ticks every second. Or to "smooth" for one that rotates continuously. It should be noted that "smooth" consumes a lot of CPU time. | If you don't specify anything you get local time (or server time, if your clocks are sync'ed with the web server). If you specify a value (in hours) it will be used as an offset from GMT (UTC). Eg, put -5 to indicate 5 hours -behind GMT. You can specify fractions of hours, eg +2.5 | +behind GMT. You can specify fractions of hours, eg +2.5.
| `_showDigital` | Optional | If you define this tag then a digital clock will be rendered on top of the -clock face |
| `_clockTitle` | Optional | diff --git a/coolclock.js b/coolclock.js index 2e0b7bf..eb908b4 100644 --- a/coolclock.js +++ b/coolclock.js @@ -120,7 +120,7 @@ CoolClock.prototype = { this.displayRadius = options.displayRadius ? parseInt(options.displayRadius) : CoolClock.config.defaultDisplayRadius; this.renderRadius = options.renderRadius ? parseInt(options.renderRadius) : CoolClock.config.defaultRenderRadius; this.secondHand = options.secondHand || CoolClock.config.defaultSecondHand; - this.gmtOffset = options.gmtOffset ? parseInt(options.gmtOffset) : null; + this.gmtOffset = options.gmtOffset ? parseFloat(options.gmtOffset) : null; this.showDigital = (options.showDigital != null) || false; this.clockTitle = options.clockTitle || CoolClock.config.defaultClockTitle; this.logClock = options.logClock || CoolClock.config.defaultLogClock; From b7df4b2dbcfe64b4d48777effd1db67404584ac7 Mon Sep 17 00:00:00 2001 From: Pantelis Panayiotou