Hi Andrew
At least one problem is the line:
var Widget = require("$:/core/modules/widgets/clock.js").widget;
It should be:
var Widget = require("$:/core/modules/widgets/widget.js").widget;
There is also a deeper problem with the way that you're updating the DOM.
In TW5 the DOM is only updated in response to changes in the state of
tiddlers in the store that trigger a refresh cycle. Using DOM IDs in the
way that you've done would fail if there were multiple instances of the
widget on screen at once, for instance.
An alternative way of thinking about your requirements might be to
implement a plugin containing a browser-startup module that sets up a timer
to update a system tiddler $:/CurrentTime with the current time every
second. You can then transclude that tiddler whereever you need to display
the current time.
Best wishes
Jeremy
On Tue, Jan 7, 2014 at 6:48 AM, Stephan Hradek <[email protected]>wrote:
>
>
> Am Dienstag, 7. Januar 2014 07:01:45 UTC+1 schrieb infernoape:
>
>> I am still trying to make my first widget, which is still a clock button
>> for my top menu. So here is what I have so far. I put the following in a
>> tiddler with title: $:/core/modules/widgets/clock.js, Type:
>> application/javascript and added a filed module-type: widget. In another
>> tiddler I put <$clock> but all still get Undefined widget 'clock'. What am
>> I missing?
>>
>> I did not check your code, but:
>
> 1. Did you save and reload? Widgetcode can only be activated when the
> wiki is loaded.
> 2. Additionally you need to put <$clock*/*> or <$clock>*</$clock>*
>
> --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWikiDev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/tiddlywikidev.
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
Jeremy Ruston
mailto:[email protected]
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/groups/opt_out.