DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:clock

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:clock [2012-01-20 21:09] – answer to question ryan.chappelleplugin:clock [2024-01-22 03:39] (current) – 1.99 update in preparation for 2.0 ryan-chappelle
Line 1: Line 1:
-====== clock plugin ======+====== clock Plugin ======
  
 ---- plugin ---- ---- plugin ----
 description: Display a clock in DokuWiki description: Display a clock in DokuWiki
 author     : Luis Machuca Bezzaza author     : Luis Machuca Bezzaza
-email      : luis.machuca[at]gulix.cl+email      : lambalicious [at] tuta [dot] io
 type       : syntax type       : syntax
-lastupdate : 2010-10-15 +lastupdate : 2024-01-21 
-compatible : +compatible : Weatherwax, Adora Belle, Angua, Rincewind, Anteater, Igor
 depends    :  depends    : 
 conflicts  conflicts 
Line 13: Line 13:
 tags       : time tags       : time
  
-downloadurl: http://ryan.gulix.cl/dw/_media/desarrollo/dokuwiki/dw-plugin-clock-latest.zip +downloadurl: https://chiselapp.com/user/lmachucab/repository/dokuwiki-plugin-clock/zip/trunk/clock.zip 
-bugtracker : # eg. http://github.com/ryan.chappelle/dokuwiki-plugin-noiewarning/issues +bugtracker : # eg. https://github.com/ryan.chappelle/dokuwiki-plugin-noiewarning/issues 
-sourcerepo : # eg. http://github.com/ryan.chappelle/dokuwiki-plugin-noiewarning+sourcerepo : https://chiselapp.com/user/lmachucab/repository/dokuwiki-plugin-clock/index 
-donationurl: +donationurl: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=T44AQDXJQJTJQ&source=url
 ---- ----
  
Line 24: Line 24:
  
 ^ Quick Questions:\\ So you want to...   ^^ ^ Quick Questions:\\ So you want to...   ^^
-| ...install this plugin?     | → [[#Download and Installation|Instructions]] +| ...install this plugin?       | → [[#Download and Installation|Instructions]] 
-| ...configure this plugin?   | → [[#Configuration]] +| ...configure this plugin?     | → [[#Configuration]] 
-| ...see the plugin in action?  | →[[#Demo]] +| ...see the plugin in action?  | → [[#Demo]] 
-| ...read a legal disclaimer?  | → [[#Legalese]]  +| ...read a legal disclaimer?   | → [[#Legalese]]  |
-| ...read about the author?    | →[[#The Author]]   |+
 ^  No longer under //experimental//  ^^ ^  No longer under //experimental//  ^^
  
-=====Usage=====+===== Download and Installation =====
  
-====Download and Installation====+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
-Download and install the plugin using the [[plugin:plugin|Plugin Manager]] using the URL given above. Refer to [[:Plugins]] on how to install plugins manually. +===== Usage =====
- +
-The link above will always point to the latest version. Should you need a previous version, check the [[#Demo]] section for more information. +
- +
-It is recommended that you clean your DW cache immediately after installing or upgrading this plugin. +
- +
-====Syntax====+
  
 Just write __in a line of its own__: Just write __in a line of its own__:
Line 52: Line 45:
   * Configuration is available via the **Configuration Manager**.   * Configuration is available via the **Configuration Manager**.
  
-====Demo====+==== Demo ====
  
 **Want to see the plugin in action?** **Want to see the plugin in action?**
Line 59: Line 52:
  
 Note language is **Spanish** but online translators shall do a good job with it. Note language is **Spanish** but online translators shall do a good job with it.
- 
->Another demo site: http://ryan.gulix.cl/tests/doku.php/clock 
  
 **Snapshots**: **Snapshots**:
Line 67: Line 58:
 |    An example visualization of the ''clock'' plugin\\ (using a custom CSS style to match [[wp>24 (TV series)|"24"]]'s digital clock) | |    An example visualization of the ''clock'' plugin\\ (using a custom CSS style to match [[wp>24 (TV series)|"24"]]'s digital clock) |
  
-===Styles===+=== Styles === 
 | {{http://ryan.gulix.cl/archivos/dokuwiki/scr-plugin-clock-d_default.png}} |Plugin, with default style.  | {{http://ryan.gulix.cl/archivos/dokuwiki/scr-plugin-clock-d_default.png}} |Plugin, with default style. 
 | {{http://ryan.gulix.cl/archivos/dokuwiki/scr-plugin-clock-d_aradio.png}} |Plugin, with the "aradio" style.\\ See [[#Manual Styling]], however.  | | {{http://ryan.gulix.cl/archivos/dokuwiki/scr-plugin-clock-d_aradio.png}} |Plugin, with the "aradio" style.\\ See [[#Manual Styling]], however.  |
Line 73: Line 65:
 | {{http://ryan.gulix.cl/archivos/dokuwiki/scr-plugin-clock-d_bluebox.png}} |Plugin, with the "bluebox" style.  | | {{http://ryan.gulix.cl/archivos/dokuwiki/scr-plugin-clock-d_bluebox.png}} |Plugin, with the "bluebox" style.  |
  
 +=== Sneak Peek ===
  
-===Sneak Peek=== +| {{http://ryan.gulix.cl/archivos/dokuwiki/scr-plugin-clock-analog_demo.png?nolink}}  
-| {{http://ryan.gulix.cl/archivos/dokuwiki/scr-plugin-clock-analog_demo.png?nolink}} | +|  Analog clocks...\\ the possible future of the clock plugin?                        |
-|  Analog clocks...\\ the possible future of the clock plugin?  |+
  
-====Configuration====+===== Configuration =====
  
-The configuration options are reachable via the **Configuration Manager**. Here is a quick run through the most important options:+The plugin is configured via the **Configuration Manager**. Here is a quick run through the most important options:
  
-  * ''helpbar'': if this option is enabled, [[#The Helpbar]] is displayed alongside / below the plugin. By default the helpbar contains a link to the page specified by the ''infopage'' option, or to the official plugin page (ie.: this one ;) ), but it can be changed to almost anything. +  * ''clock_type'': This option sets what kind of clock is used. Currently only the option ''text'' is supported. 
-  * ''infopage'': this option specifies the location ([[:pagename]]) of a wikipage containing information for this plugin. By default it points to '':wiki:clock'' and thus you must create that pagebut you can leave it empty to point to this very page. +    * ''text'': A normal text clock. 
-  * ''nojs_fallback'': this options specifies what to do if JavaScript is not enabled in the client: then the clock shows either the time as seen by the server, or a standard message with the name of the plugin, both static (ie.: non-animated). +    * ''binary'': A binary clock. :!: Currently unimplemented. 
-  * ''font_fallback'': this options sets the fallback CSS family for the font style in case you have specified a font-family in your CSS configuration and the clients can't find it. It can be set to any of the standard CSS families+  * ''clock_style'': This option is set to a class name used to style the plugin. Check [[#Styles|style]] for examples. 
-  * ''clock_style'': this option specifies the actual [[#Styles|style]] used by the plugin, and may require a cache refresh by the client.+  * ''helpbar'': If this option is enabled, [[#The Helpbar]] is displayed alongside / below the plugin. By default the helpbar contains a link to the page specified by the ''infopage'' option, or to the official plugin page (ie.: this one ;) ), but it can be changed to almost anything. 
 +  * ''infopage'': this option specifies the location ([[:pagename]]) of a wikipage containing information for this plugin.  
 +    * By default it points to '':wiki:clock'', which must be created by the admin. 
 +    * Setting it to an empty string points the info link to this very page. 
 +  * ''nojs_fallback'': This options specifies what to do if JavaScript is not enabled in the client: then the clock shows either the time as seen by the server, or a standard message with the name of the plugin, both static (ie.: non-animated). 
 +  * ''font_fallback'': This options sets the fallback CSS family for the font style in case you have specified a font-family in your CSS configuration and the clients can't find it. It can be set to any of the standard CSS families.
  
 :!: To configure the clock styles or add new ones, check the section on [[#Customization]]. :!: To configure the clock styles or add new ones, check the section on [[#Customization]].
  
 +===== Other Details =====
  
-=====Other Details===== +==== The Helpbar ====
-====The Helpbar====+
  
 This version of the plugin implements a __help bar__ that displays the wiki link selected in the Plugin Configuration options (under ''infopage''), or a link to this very page if that variable is left empty. If you want to remove the help bar, just disable it via the Configuration Manager. This version of the plugin implements a __help bar__ that displays the wiki link selected in the Plugin Configuration options (under ''infopage''), or a link to this very page if that variable is left empty. If you want to remove the help bar, just disable it via the Configuration Manager.
  
-====Customization====+==== Customization ====
  
-The //aradio// and //tv24// styles require not only adequate CSS3 typeface support, but also that the client has installed or can access the requires typefaces (fonts). To see why the typefaces are not provided herecheck the [[#Questions]].+The //aradio// and //tv24// styles require not only adequate CSS3 typeface support, but also that the client has installed or can access the requires typefaces (fonts). The typefaces are not provided directly to avoid problems with licensingnetworking and privacy when installing the plugin by default
  
-To create your own clock style, the quick&dirty way is to pick one of the default styles (the actual ''default'' one, even), copy it to your ''$DOKU_CONF/userstyle.css'' and modify as needed. You need to modify the ''.default'' classname to one of your liking, which you can then set as the style used from the COnfiguration Manager.+To create your own clock style, the quick&dirty way is to pick one of the default styles (the actual ''default'' one, even), copy it to your ''$DOKU_CONF/userstyle.css'' and modify as needed. You need to modify the ''.default'' classname to one of your liking, which you can then set as the style used from the Configuration Manager.
  
-This is the overall styling model from which you can work on. Substitute ''YOURSTYLE'' for the class name: +==== Known Issues ====
- +
-<code css clock_style.css> +
-#dw_clock_object > #clock_face.YOURSTYLE .face { +
-  font-family: monospace; +
-  font-size: 1.5em; +
-  text-align: center; +
-  color: __text__; +
-  border: 4px inset __text_alt__; +
-  background-color: __background_alt__; +
-  } +
-</code> +
- +
-To modify the styling or layout of the helpbar, when available, you can use this as a base: +
- +
-<code css> +
-#dw_clock_object > p.helpbar { +
-  } +
-</code> +
- +
-What you are actually styling is the clock's face (a visual container inside the clock itself). Apply the new style by changing the "style" option under the Configuration Manager. Flushing the cache may or may not be necessary, depending on the CSS attributes you use and some cache options. +
- +
-====Internationalization==== +
- +
-As of version 1.4, internationalized strings for descriptions and configurations are provided. However as my knowledge of languages is limited, right now the plugin provides only English, Spanish and Esperanto. if you want to collaborate with string for your language, just let me know. +
- +
-====Known Issues====+
  
 Only **one instance of the clock** is allowed to exist in a DokuWiki page. This is by design. If the syntax mode (''<nowiki>{{clock}}</nowiki>'') is used again in a page, an anchor-link to the location of the existing clock will be shown instead. Only **one instance of the clock** is allowed to exist in a DokuWiki page. This is by design. If the syntax mode (''<nowiki>{{clock}}</nowiki>'') is used again in a page, an anchor-link to the location of the existing clock will be shown instead.
- 
-The newest version of the plugin, ''v1.5'', has a clean JavaScript code that works on all decent browsers like [[http://www.opera.com/|Opera]] and [[http://www.getfirefox.com/|Firefox]] without much trouble. Webkit-based browsers like Safari are reported to work, but I haven't tested them myself. That said, any browser that implements CSS and JavaScript decently and according to standards should be able to display the clock without non-minor issues. 
- 
-Note that **JavaScript support is required** for the plugin to work. If you're using Firefox plugins such as "NoScript" in its highest security setting you'll see no clock, instead a tag only. Make sure to at least "//allow scripts from the same site//" for the clock to work. If JavaScript is not enabled, the fallback message method specified with the ''nojs_fallback'' option will take place. 
- 
-Opera 9.5 beta versions have a JS issue where ''getSeconds()'' is not correctly implemented, causing the clock to display either "''-1''" or "''  ''" (//empty//) seconds. It doesn't matter, really: at this point you should be using the 10.60 release.  
  
 The plugin does not support simultaneous loads (like from a page and a sidebar). This won't affect normal rendering unless the two pages are displayed at once, in which case only the first invocation loaded (usually the normal page) will be rendered correctly, and the other (usually a sidebar) will be left an empty space. The plugin does not support simultaneous loads (like from a page and a sidebar). This won't affect normal rendering unless the two pages are displayed at once, in which case only the first invocation loaded (usually the normal page) will be rendered correctly, and the other (usually a sidebar) will be left an empty space.
  
-====Questions====+==== Questions ====
  
 :?: How do I add my own style? :?: How do I add my own style?
Line 163: Line 128:
 By this point, visitors should be able to view the plugin's effect at its full potential if they are using a web browser that follows standards. If for some reason the user can't load the fonts (maybe he is using IE?) the plugin will still render with acceptable defaults. By this point, visitors should be able to view the plugin's effect at its full potential if they are using a web browser that follows standards. If for some reason the user can't load the fonts (maybe he is using IE?) the plugin will still render with acceptable defaults.
  
-:?: Can you provide the typefaces?+===== Afterwords =====
  
-:!: **No, because of license issues.** These fonts are not mine, in the sense that I have no copyright over them. I have acquired them for personal use as their licenses establish, but these licenses don't allow for me to directly give them away. I can only suggest you to use either them or similar ones, which is why I provide the family names ("lcdd", "digitalbreakout" and "atomicclockradio", the last two are offered as Freeware fonts in some collection sites). You can acquire or design a typeface yourself and serve it to your clients with the procedure above. Also see the ''style.css'' file headers for details. +==== Legalese ====
- +
-=====Afterwords===== +
- +
-====The Author==== +
- +
-Luis Machuca Bezzaza((yes, that's my name, and I'm going to talk in third person now)) is a Chilean Developer who has released plugins for DokuWiki ever since 2008. He takes somewhat-active participation in the [[http://forum.dokuwiki.org/|DokuWiki User Forums]], where he moderates the somewhat-active-as-well Spanish Discussion. He can be sometimes found at the DokuWiki IRC channel as well, shamelessly promoting his plugins. In his spare time he functions as the Secretary (S) of his city's [[wp>LUG]], [[http://www.gulix.cl/|Gulix]] as well as trying to contribute to the overall internet culture. +
- +
-^    Other DokuWiki Plugins by\\ [[user>ryan.chappelle|Luis Machuca Bezzaza (a.k.a ryan.chappelle@DW Forums)]]   ^^ +
-| [[plugin:progrecss]]      | display progress bars alongside text  | +
-| [[plugin:tooltip]]        | add tooltips (info balloons) to text or special words   | +
-| [[plugin:clock]]          | ...you are here now LOL      | +
-| [[plugin:countdown]]      | show the remaining time to an event       | +
-| [[plugin:divalign2]]      | align your paragraphs for better reading    | +
-| [[plugin:gil]]            | display currency conversions from Yahoo services         | +
-| [[plugin:hide]]           | hide text from immediate view   | +
-| [[plugin:noiewarning]]    | warn users that they are using the shitty IE browser   | +
-| //coming soon//                | control the formatting and properties of external links  | +
-| //coming soon//                | use Mediawiki-style template substitution in wiki pages  | +
- +
-==== Source Code ==== +
- +
-Unzipping the file from the download link above will give you the source code. It is free, in the GPL definition of the word. +
- +
-====The Next Release==== +
- +
-The following are improvements in the latest version (''v1.5''): +
- +
-  * Support for i18n-ed descriptions, but only English is provided right now. If you want to provide the texts in your language, just let me know. +
-  * A fix has been made for a leak that caused errors when the edit form was loaded and this plugin was installed. +
- +
-The following improvements are planned for the major release (''v.2.0''): +
- +
-  * Localization((right now only English and Spanish are available)). +
-  * AM/PM format option. +
-  * Better ''@font-face'' support. +
-  * An analog visualization mode (using SVG + CSS, maybe?). +
-  * A sort of print-version rendering. +
- +
-When will the major be released? Whenever it's ready. +
- +
-====Legalese====+
  
 This plugin ("clock") © [[#The Author]].  This plugin ("clock") © [[#The Author]]. 
  
 "clock" is developed part-for-fun, part-for-learning, of The Author's free will and during his spare time. It is released "as-is" under the terms of the GPL 2 License. The Author is not affiliated to the core DokuWiki staff, he just knows the guys and likes them (er... their work). The Author takes no responsibility for damages caused by inadequate use of "clock", but tries to stay available for a nice chat if particular issues related to "clock"'s domain are presented. Insert standard lorem-ipsum like legal disclaimer and/or waiver of warranties here and you know the drill.  "clock" is developed part-for-fun, part-for-learning, of The Author's free will and during his spare time. It is released "as-is" under the terms of the GPL 2 License. The Author is not affiliated to the core DokuWiki staff, he just knows the guys and likes them (er... their work). The Author takes no responsibility for damages caused by inadequate use of "clock", but tries to stay available for a nice chat if particular issues related to "clock"'s domain are presented. Insert standard lorem-ipsum like legal disclaimer and/or waiver of warranties here and you know the drill. 
- 
  
 ---- ----
  
-=====Discussion=====+===== Discussion =====
  
 Do you have a question? Using Mosaic? Does the clock //actually work// in Links? Have an urge to beat me to a pulp unless I release the release?  Do you have a question? Using Mosaic? Does the clock //actually work// in Links? Have an urge to beat me to a pulp unless I release the release? 
Line 222: Line 145:
  
 ----- -----
 +
 I attempted to disable the info link after the clock without success. Exactly what **file** and **syntax** needs to be used?  I attempted to disable the info link after the clock without success. Exactly what **file** and **syntax** needs to be used? 
 \\ I tried things in **<root>\conf\local.php** like $conf['helpbar'] = 0;, $helpbar = 0;, etc.  \\ I tried things in **<root>\conf\local.php** like $conf['helpbar'] = 0;, $helpbar = 0;, etc. 
Line 228: Line 152:
  
 ----- -----
 +
 \\Work on 2010-11-07 "Anteater" --- //[[|vinnie]] 2011/01/13 1:25// \\Work on 2010-11-07 "Anteater" --- //[[|vinnie]] 2011/01/13 1:25//
  
plugin/clock.1327090196.txt.gz · Last modified: 2012-01-20 21:09 by ryan.chappelle

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki