Thanks Jeremy, Is there some way to pass a parameter like modified+15 minutes to the view?
Sent from my Samsung Epic™ 4G TouchJeremy Ruston <[email protected]> wrote:Hi Andrew Something very similar to your original request can be achieved without using JavaScript. Put this into a blank tiddler: <$linkcatcher to="mymarker"> <$button to="mark" message="tw-modal" param="DatePopup">Click</$button> </$linkcatcher> And then this into a tiddler called "DatePopup": Time is: <$view tiddler="mymarker" field="modified" format="date"/> The idea is to use a third tiddler "mymarker" that we modify each time that the button is clicked. We also trigger the display of a modal dialogue that views its modified field. Does that help? Best wishes Jeremy. On Sat, May 3, 2014 at 1:21 AM, Andrew <[email protected]> wrote: I appologize that I mentioned this without allowing an example to be somewhere. I have emailed before with the contents of what is in my widget but the actual widget isn't online because I am afraid it might break and I don't have time to support others if it does, but here goes: [[$:/core/modules/widgets/clock.js]] /*\ title: $:/core/modules/widgets/clock.js type: application/javascript module-type: widget A widget to display a clock \*/ (function(){ /*jslint node: true, browser: true */ /*global $tw: false */ "use strict"; var Widget = require("$:/core/modules/widgets/widget.js").widget; var ClockWidget = function(parseTreeNode,options) { this.initialise(parseTreeNode,options); }; /* Inherit from the base widget class */ ClockWidget.prototype = new Widget(); /* Render this widget into the DOM */ ClockWidget.prototype.render = function(parent,nextSibling) { this.parentDomNode = parent; this.computeAttributes(); this.execute(); var domNode = this.document.createElement('p'); domNode.setAttribute("id","tw-clockbutton"); parent.insertBefore(domNode,nextSibling); this.renderChildren(domNode,null); this.domNodes.push(domNode); }; /* Compute the internal state of the widget */ ClockWidget.prototype.execute = function() { var myVar=setInterval(function(){ var d=new Date(); var t=d.toLocaleTimeString(); document.getElementById("tw-clockbutton").innerHTML=t; },1000); }; /* Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering */ ClockWidget.prototype.refresh = function(changedTiddlers) { var changedAttributes = this.computeAttributes(), hasChangedAttributes = $tw.utils.count(changedAttributes) > 0; if(hasChangedAttributes) { // Update our attributes this.assignAttributes(this.domNodes[0]); } return this.refreshChildren(changedTiddlers) || hasChangedAttributes; }; exports.clock = ClockWidget; })(); [[Type:application/javascript]] [[module-type:widget]] I use it as an image for a button by putting it in a tiddler called: [[$:/images/clock-button]] @@.tw-topmenu-clock <$clock/> @@ Note: Surrounded with @@ to apply css formatting My button I am working on still has problems, the clock only ticks in one place if displayed multiple times, and my time stamp funtionality broke when inline javascript was added to the blacklist. Don't think for a moment that I mind because Jeremy is a genious and I want to do everything with his approval. I'm not a very good programmer. So my button so far that I have in my top menu is: [[$:/Top-clock-button]] <span title="Time Stamp"><$button message="tw-home" class="btn-invisible" onclick="alert(new Date().toLocaleTimeString());">{{$:/images/clock-button}} <$set name="tag" value=<<dateTime "0DD-MMM">>> <$newtiddler title=<<dateTime "0hh:0mm:0ss">> skeleton="base_skeleton" edit="yes">New Staff Meeting</$newtiddler> </$set></$button></span> The problem is, that I wanted a popup, and not a journal entry creating button but cant figure out how to get a popup to change the timestamp. Also, this doesn't seem to work right yet either because all I am getting is tiddlers with a title starting with "Draft of 'undefined'". Any suggestions welcome. I just want a timestamp button that displays current, 15 minutes, 30, and 45 minute intervals like I have in TWC. Sent from my Sprint tablet -------- Original message -------- From: Danielo Rodríguez Date:05/02/2014 3:28 PM (GMT-07:00) To: [email protected] Subject: Fwd: [twdev] Re: [TW5] $:/Top-clock-button stopped alerting time when clicked after upgraded to 5.0.10-beta This is the first notice that I have about a time button in TW5. Where can I see an example? -- 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/d/optout. -- 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/d/optout. -- 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/d/optout.
