Created
August 29, 2011 22:56
-
-
Save fbettag/1179643 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Clock extends CometActor { | |
override def defaultPrefix = Full("clk") | |
// schedule a ping every 10 seconds so we redraw | |
ActorPing.schedule(this, Tick, 10 seconds) | |
def render = csssel | |
def csssel = "#time *" #> timeNow.toString | |
override def lowPriority = { | |
case Tick => | |
partialUpdate(SetHtml("theclock", csssel.apply(defaultHtml))) | |
ActorPing.schedule(this, Tick, 10 seconds) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span id="theclock" lift="comet?type=Clock"> | |
<span id="time"></span> | |
</span> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment