Page 1 of 2

Plugin : Time

PostPosted: Sat Jan 21, 2012 3:21 pm
by KAD
This displays the Current Time on Home Page.

I swear it's been done before, but I couldn't find it, so here's my version. It uses the system time, so if NTP is not working the time will not be correct.

Changlog
01/21/2012 version 1.0
*Public Release of Time plugin

downloads
Download from WDTVext menu on screen

Supported Devices
WDTV Live

Requirements
any WDLXTV firmware with base version 1.02.21 or 1.05.04-dev
NTP must be ON

KAD

Re: Plugin : Time

PostPosted: Sun Jan 22, 2012 3:59 am
by avkiev
KAD wrote:I swear it's been done before, but I couldn't find it

Very old version: http://avkiev.kiev.ua/wdtv/WDTVExt/Time/

Re: Plugin : Time

PostPosted: Sun Jan 22, 2012 6:29 am
by dentex
@ KAD: Cool, thanks.

@ avkiev: for me the link is down...

ciao.

Re: Plugin : Time

PostPosted: Mon Jan 23, 2012 3:42 am
by avkiev
dentex wrote:@ avkiev: for me the link is down...

Hmmm... Strange... Ok, try this one: http://avkiev.kiev.ua/wdtv/WDTVExt/Time/Time.plugin.js

Re: Plugin : Time

PostPosted: Mon Jan 23, 2012 3:47 am
by dentex
Both links work now, thanks.

Re: Plugin : Time

PostPosted: Tue Jan 24, 2012 7:15 am
by mad_ady
Cool plugin, but (as usual) I have a few suggestions for improvement:
1. It would be cool to have the clock auto-update every few seconds (e.g. 5 seconds to reduce the load). The way I propose this can be done is by calling a setTimeout() method that keeps calling the time method and redraws the screen. Inside the called function one could always re-call setTimeout() to schedule a new refresh. The diffictulty here is to find out when the user navigated to some page where the timer is no longer visible and stop calling setTimout to break the loop.
2. If 1 is not feasible, then what about fading out/removing the time after a few seconds (again with a setTimeout function). The idea is to display the time when there is user activity and hide it after 5s of inactivity (since the time would stop being accurate).

P.S. Oh, and I reduced the font size to 32. Looks less intrusive on my CRT.

Re: Plugin : Time

PostPosted: Tue Jan 24, 2012 7:27 am
by recliq
JS setTimeout() doesn't work in WDTVExt (or at least I never got it working, if anybody got this working please tell me how!! ;))

btw clock plugin was intergrated in Tools plugin once but I removed it because I suspected it to cause dmaosd crashes...
however you can still find the code in SVN:
https://svn.wdlxtv.com/filedetails.php?repname=wdtvext-plugins&path=%2FTools%2FTools.plugin.js&rev=49

EDIT:
I just saw it was already in the original commit of Tools plugin in wdtvext-plugins repo which was the first plugin in repo:
SVN rev. 1
https://svn.wdlxtv.com/filedetails.php?repname=wdtvext-plugins&path=%2FTools%2FTools.plugin.js&rev=1

I hereby claim to be the inventor and creator of the clock plugin, you will recieve an invoice for dealing with copyright and patent fees shortly.. :lol: :lol:
/jk

Re: Plugin : Time

PostPosted: Tue Jan 24, 2012 7:57 am
by mad_ady
well, if setTimeout doesn't work, then scratch my idea... I thought wonderful things could be done with it...
I wonder if markster uses it in his MovieSheets+ plugin...

Re: Plugin : Time

PostPosted: Tue Jan 24, 2012 8:03 am
by recliq
I doubt that since it was never working in WDTVExt afair.

Re: Plugin : Time

PostPosted: Tue Jan 24, 2012 8:51 am
by KAD
@Mad_ady, you probably noticed, time is updated on key press, but I guess on page timer could be used to update as well

@recliq,

I hereby claim to be the inventor and creator of the clock plugin, you will recieve an invoice for dealing with copyright and patent fees shortly..
/jk
the patent office will decide, you created a clock plugin, I created a time plugin :lol:
do I hear android vs apple in the background
/jk
KAD