1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-10-01 16:30:46 +00:00

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Bram Chen 2014-10-09 09:27:50 +08:00
commit b486846a74
27 changed files with 454 additions and 24 deletions

View File

@ -0,0 +1,9 @@
title: $:/core/images/new-here-button
tags: $:/tags/Image
<svg class="tc-image-new-here-button tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<path d="M64,128 C99.346224,128 128,99.346224 128,64 C128,28.653776 99.346224,0 64,0 C28.653776,0 0,28.653776 0,64 C0,99.346224 28.653776,128 64,128 Z M64,118 C93.8233765,118 118,93.8233765 118,64 C118,34.1766235 93.8233765,10 64,10 C34.1766235,10 10,34.1766235 10,64 C10,93.8233765 34.1766235,118 64,118 Z M64,108 C88.300529,108 108,88.300529 108,64 C108,39.699471 88.300529,20 64,20 C39.699471,20 20,39.699471 20,64 C20,88.300529 39.699471,108 64,108 Z M64,98 C82.7776815,98 98,82.7776815 98,64 C98,45.2223185 82.7776815,30 64,30 C45.2223185,30 30,45.2223185 30,64 C30,82.7776815 45.2223185,98 64,98 Z"></path>
<path d="M56.9090909,72.4545455 L56.9090909,87.9090909 L56.9090909,87.9090909 L56.9090909,87.9090909 C56.9090909,89.6161485 58.3200768,91 60.0606061,91 L67.9393939,91 C69.6799232,91 71.0909091,89.6161485 71.0909091,87.9090909 L71.0909091,72.4545455 L86.8484848,72.4545455 C88.5890141,72.4545455 90,71.0707455 90,69.3636364 L90,61.6363636 C90,59.9292545 88.5890141,58.5454545 86.8484848,58.5454545 L71.0909091,58.5454545 L71.0909091,43.0909091 C71.0909091,41.3838 69.6799232,40 67.9393939,40 L60.0606061,40 L60.0606061,40 C58.3200768,40 56.9090909,41.3838 56.9090909,43.0909091 L56.9090909,58.5454545 L41.1515152,58.5454545 L41.1515152,58.5454545 C39.4109817,58.5454545 38,59.9292545 38,61.6363636 L38,69.3636364 L38,69.3636364 L38,69.3636364 C38,71.0707455 39.4109817,72.4545455 41.1515152,72.4545455 L56.9090909,72.4545455 Z"></path>
</g>
</svg>

View File

@ -0,0 +1,16 @@
title: $:/core/images/new-journal-button
tags: $:/tags/Image
<svg class="tc-image-new-journal-button tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<path d="M102.545455,112.818182 L102.545455,124.636364 L102.545455,124.636364 L102.545455,124.636364 C102.545455,125.941761 103.630828,127 104.969697,127 L111.030303,127 C112.369172,127 113.454545,125.941761 113.454545,124.636364 L113.454545,112.818182 L125.575758,112.818182 C126.914626,112.818182 128,111.759982 128,110.454545 L128,104.545455 C128,103.240018 126.914626,102.181818 125.575758,102.181818 L113.454545,102.181818 L113.454545,90.3636364 C113.454545,89.0582 112.369172,88 111.030303,88 L104.969697,88 L104.969697,88 C103.630828,88 102.545455,89.0582 102.545455,90.3636364 L102.545455,102.181818 L90.4242424,102.181818 L90.4242424,102.181818 C89.0853705,102.181818 88,103.240018 88,104.545455 L88,110.454545 L88,110.454545 L88,110.454545 C88,111.759982 89.0853705,112.818182 90.4242424,112.818182 L102.545455,112.818182 Z"></path>
<g transform="translate(59.816987, 64.316987) rotate(30.000000) translate(-59.816987, -64.316987) translate(20.316987, 12.816987)">
<g transform="translate(0.000000, 0.000000)">
<path d="M9.99631148,0 C4.4755011,0 -2.27373675e-13,4.48070044 -2.27373675e-13,9.99759461 L-2.27373675e-13,91.6128884 C-2.27373675e-13,97.1344074 4.46966773,101.610483 9.99631148,101.610483 L68.9318917,101.610483 C74.4527021,101.610483 78.9282032,97.1297826 78.9282032,91.6128884 L78.9282032,9.99759461 C78.9282032,4.47607557 74.4585355,0 68.9318917,0 L9.99631148,0 Z M20.8885263,26 C24.2022348,26 26.8885263,23.3137085 26.8885263,20 C26.8885263,16.6862915 24.2022348,14 20.8885263,14 C17.5748178,14 14.8885263,16.6862915 14.8885263,20 C14.8885263,23.3137085 17.5748178,26 20.8885263,26 Z M57.3033321,25.6783342 C60.6170406,25.6783342 63.3033321,22.9920427 63.3033321,19.6783342 C63.3033321,16.3646258 60.6170406,13.6783342 57.3033321,13.6783342 C53.9896236,13.6783342 51.3033321,16.3646258 51.3033321,19.6783342 C51.3033321,22.9920427 53.9896236,25.6783342 57.3033321,25.6783342 Z"></path>
<text font-family="Helvetica" font-size="47.1724138" font-weight="bold" fill="#FFFFFF">
<tspan x="42" y="77.4847912" text-anchor="middle"><<now "DD">></tspan>
</text>
</g>
</g>
</g>
</svg>

View File

@ -34,10 +34,14 @@ Home/Caption: home
Home/Hint: Open the default tiddlers
Language/Caption: language
Language/Hint: Choose the user interface language
NewTiddler/Caption: new tiddler
NewTiddler/Hint: Create a new tiddler
More/Caption: more
More/Hint: More actions
NewHere/Caption: new here
NewHere/Hint: Create a new tiddler tagged with "<$text text=<<currentTiddler>>"
NewJournal/Caption: new journal
NewJournal/Hint: Create a new journal tiddler
NewTiddler/Caption: new tiddler
NewTiddler/Hint: Create a new tiddler
Permalink/Caption: permalink
Permalink/Hint: Set browser address bar to a direct link to this tiddler
Permaview/Caption: permaview

View File

@ -10,6 +10,8 @@ Basics/DefaultTiddlers/BottomHint: Use &#91;&#91;double square brackets&#93;&#93
Basics/DefaultTiddlers/Prompt: Default tiddlers:
Basics/DefaultTiddlers/TopHint: Choose which tiddlers are displayed at startup:
Basics/Language/Prompt: Hello! Current language:
Basics/NewJournal/Title/Prompt: Title of new journal tiddlers
Basics/NewJournal/Tags/Prompt: Tags for new journal tiddlers
Basics/OverriddenShadowTiddlers/Prompt: Number of overridden shadow tiddlers:
Basics/ShadowTiddlers/Prompt: Number of shadow tiddlers:
Basics/Subtitle/Prompt: Subtitle:

View File

@ -8,6 +8,7 @@ ConfirmCancelTiddler: Do you wish to discard changes to the tiddler "<$text text
ConfirmDeleteTiddler: Do you wish to delete the tiddler "<$text text=<<title>>/>"?
ConfirmOverwriteTiddler: Do you wish to overwrite the tiddler "<$text text=<<title>>/>"?
ConfirmEditShadowTiddler: You are about to edit a ShadowTiddler. Any changes will override the default system making future upgrades non-trivial. Are you sure you want to edit "<$text text=<<title>>/>"?
DefaultNewTiddlerTitle: New Tiddler
DropMessage: Drop here (or click escape to cancel)
Encryption/ConfirmClearPassword: Do you wish to clear the password? This will remove the encryption applied when saving this wiki
Encryption/PromptSetPassword: Set a new password for this TiddlyWiki

View File

@ -0,0 +1,32 @@
/*\
title: $:/core/modules/macros/now.js
type: application/javascript
module-type: macro
Macro to return a formatted version of the current time
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Information about this macro
*/
exports.name = "now";
exports.params = [
{name: "format"}
];
/*
Run the macro
*/
exports.run = function(format) {
return $tw.utils.formatDateString(new Date(),format || "0hh:0mm, DDth MMM YYYY");
};
})();

View File

@ -167,7 +167,7 @@ exports.slowInSlowOut = function(t) {
return (1 - ((Math.cos(t * Math.PI) + 1) / 2));
};
exports.formatDateString = function (date,template) {
exports.formatDateString = function(date,template) {
var t = template.replace(/0hh12/g,$tw.utils.pad($tw.utils.getHours12(date)));
t = t.replace(/hh12/g,$tw.utils.getHours12(date));
t = t.replace(/0hh/g,$tw.utils.pad(date.getHours()));

View File

@ -0,0 +1,79 @@
/*\
title: $:/core/modules/widgets/action-navigate.js
type: application/javascript
module-type: widget
Action widget to navigate to a tiddler
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var NavigateWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};
/*
Inherit from the base widget class
*/
NavigateWidget.prototype = new Widget();
/*
Render this widget into the DOM
*/
NavigateWidget.prototype.render = function(parent,nextSibling) {
this.computeAttributes();
this.execute();
};
/*
Compute the internal state of the widget
*/
NavigateWidget.prototype.execute = function() {
this.actionTo = this.getAttribute("$to");
this.actionScroll = this.getAttribute("$scroll");
};
/*
Refresh the widget by ensuring our attributes are up to date
*/
NavigateWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes["$to"] || changedAttributes["$scroll"]) {
this.refreshSelf();
return true;
}
return this.refreshChildren(changedTiddlers);
};
/*
Invoke the action associated with this widget
*/
NavigateWidget.prototype.invokeAction = function(triggeringWidget,event) {
var bounds = triggeringWidget && triggeringWidget.getBoundingClientRect && triggeringWidget.getBoundingClientRect(),
suppressNavigation = event.metaKey || event.ctrlKey || (event.button === 1);
if(this.actionScroll === "yes") {
suppressNavigation = false;
} else if(this.actionScroll === "no") {
suppressNavigation = true;
}
this.dispatchEvent({
type: "tm-navigate",
navigateTo: this.actionTo === undefined ? this.getVariable("currentTiddler") : this.actionTo,
navigateFromTitle: this.getVariable("storyTiddler"),
navigateFromNode: triggeringWidget,
navigateFromClientRect: bounds && { top: bounds.top, left: bounds.left, width: bounds.width, right: bounds.right, bottom: bounds.bottom, height: bounds.height
},
navigateSuppressNavigation: suppressNavigation
});
return true; // Action was invoked
};
exports["action-navigate"] = NavigateWidget;
})();

View File

@ -0,0 +1,82 @@
/*\
title: $:/core/modules/widgets/action-sendmessage.js
type: application/javascript
module-type: widget
Action widget to send a message
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var SendMessageWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};
/*
Inherit from the base widget class
*/
SendMessageWidget.prototype = new Widget();
/*
Render this widget into the DOM
*/
SendMessageWidget.prototype.render = function(parent,nextSibling) {
this.computeAttributes();
this.execute();
};
/*
Compute the internal state of the widget
*/
SendMessageWidget.prototype.execute = function() {
this.actionMessage = this.getAttribute("$message");
this.actionParam = this.getAttribute("$param");
};
/*
Refresh the widget by ensuring our attributes are up to date
*/
SendMessageWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes["$message"] || changedAttributes["$param"]) {
this.refreshSelf();
return true;
}
return this.refreshChildren(changedTiddlers);
};
/*
Invoke the action associated with this widget
*/
SendMessageWidget.prototype.invokeAction = function(triggeringWidget,event) {
// Get the parameter
var param = this.actionParam;
// If the parameter is missing then we'll assemble the attributes as a hashmap
if(!param) {
param = Object.create(null);
var count = 0;
$tw.utils.each(this.attributes,function(attribute,name) {
if(name.charAt(0) !== "$") {
param[name] = attribute;
count++;
}
});
// Revert to an empty parameter if no values were found
if(!count) {
param = undefined;
}
}
// Dispatch the message
this.dispatchEvent({type: this.actionMessage, param: param, tiddlerTitle: this.getVariable("currentTiddler")});
return true; // Action was invoked
};
exports["action-sendmessage"] = SendMessageWidget;
})();

View File

@ -59,6 +59,9 @@ ButtonWidget.prototype.render = function(parent,nextSibling) {
// Add a click event handler
domNode.addEventListener("click",function (event) {
var handled = false;
if(self.invokeActions(event)) {
handled = true;
}
if(self.to) {
self.navigateTo(event);
handled = true;
@ -87,6 +90,10 @@ ButtonWidget.prototype.render = function(parent,nextSibling) {
this.domNodes.push(domNode);
};
ButtonWidget.prototype.getBoundingClientRect = function() {
return this.domNodes[0].getBoundingClientRect();
}
ButtonWidget.prototype.isSelected = function() {
var tiddler = this.wiki.getTiddler(this.set);
return tiddler ? tiddler.fields.text === this.setTo : this.defaultSetValue === this.setTo;
@ -99,7 +106,7 @@ ButtonWidget.prototype.isPoppedUp = function() {
};
ButtonWidget.prototype.navigateTo = function(event) {
var bounds = this.domNodes[0].getBoundingClientRect();
var bounds = this.getBoundingClientRect();
this.dispatchEvent({
type: "tm-navigate",
navigateTo: this.to,

View File

@ -374,11 +374,19 @@ NavigatorWidget.prototype.handleCancelTiddlerEvent = function(event) {
// Create a new draft tiddler
NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) {
// Get the story details
var storyList = this.getStoryList();
// Get the template tiddler if there is one
var templateTiddler = this.wiki.getTiddler(event.param);
var storyList = this.getStoryList(),
templateTiddler,originalTitle;
// Get the template
if(typeof event.param === "object") {
templateTiddler = event.param;
originalTitle = templateTiddler.title;
} else {
templateTiddler = this.wiki.getTiddler(event.param);
originalTitle = templateTiddler && templateTiddler.fields.title;
}
originalTitle = originalTitle || $tw.language.getString("DefaultNewTiddlerTitle");
// Title the new tiddler
var title = this.wiki.generateNewTitle((templateTiddler && templateTiddler.fields.title) || "New Tiddler");
var title = this.wiki.generateNewTitle(originalTitle);
// Create the draft tiddler
var draftTitle = this.generateDraftTitle(title),
draftTiddler = new $tw.Tiddler({

View File

@ -475,6 +475,20 @@ Widget.prototype.removeChildDomNodes = function() {
}
};
/*
Invoke any action widgets that are immediate children of this widget
*/
Widget.prototype.invokeActions = function(event) {
var handled = false;
for(var t=0; t<this.children.length; t++) {
var child = this.children[t];
if(child.invokeAction && child.invokeAction(this,event)) {
handled = true;
}
}
return handled;
};
exports.widget = Widget;
})();

View File

@ -9,6 +9,8 @@ caption: {{$:/language/ControlPanel/Basics/Caption}}
|<$link to="$:/status/UserName"><<lingo Username/Prompt>></$link> |<$edit-text tiddler="$:/status/UserName" default="" tag="input"/> |
|<$link to="$:/config/AnimationDuration"><<lingo AnimDuration/Prompt>></$link> |<$edit-text tiddler="$:/config/AnimationDuration" default="" tag="input"/> |
|<$link to="$:/DefaultTiddlers"><<lingo DefaultTiddlers/Prompt>></$link> |<<lingo DefaultTiddlers/TopHint>><br> <$edit-text tag="textarea" tiddler="$:/DefaultTiddlers"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |
|<$link to="$:/config/NewJournal/Title"><<lingo NewJournal/Title/Prompt>></$link> |<$edit-text tiddler="$:/config/NewJournal/Title" default="" tag="input"/> |
|<$link to="$:/config/NewJournal/Tags"><<lingo NewJournal/Tags/Prompt>></$link> |<$edit-text tiddler="$:/config/NewJournal/Tags" default="" tag="input"/> |
|<<lingo Language/Prompt>> |{{$:/snippets/minilanguageswitcher}} |
|<<lingo Tiddlers/Prompt>> |''<$count filter="[!is[system]]"/>'' |
|<<lingo Tags/Prompt>> |''<$count filter="[tags[]]"/>'' |

View File

@ -0,0 +1,19 @@
title: $:/core/ui/Buttons/new-journal
tags: $:/tags/PageControls
caption: {{$:/core/images/new-journal-button}} {{$:/language/Buttons/NewJournal/Caption}}
description: {{$:/language/Buttons/NewJournal/Hint}}
\define journalButton()
<$button tooltip={{$:/language/Buttons/NewJournal/Hint}} aria-label={{$:/language/Buttons/NewJournal/Caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-new-tiddler" title=<<now "$(journalTitleTemplate)$">> tags={{$:/config/NewJournal/Tags}}/>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/new-journal-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<$text text={{$:/language/Buttons/NewJournal/Caption}}/>
</$list>
</$button>
\end
<$set name="journalTitleTemplate" value={{$:/config/NewJournal/Title}}>
<<journalButton>>
</$set>

View File

@ -0,0 +1,14 @@
title: $:/core/ui/Buttons/new-here
tags: $:/tags/ViewToolbar
caption: {{$:/core/images/new-here-button}} {{$:/language/Buttons/NewHere/Caption}}
description: {{$:/language/Buttons/NewHere/Hint}}
<$button tooltip={{$:/language/Buttons/NewHere/Hint}} aria-label={{$:/language/Buttons/NewHere/Caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-new-tiddler" tags=<<currentTiddler>>/>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/new-here-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<$text text={{$:/language/Buttons/NewHere/Caption}}/>
</$list>
</$button>

View File

@ -0,0 +1,4 @@
title: $:/config/NewJournal/
Title: DDth MMM YYYY
Tags: Journal

View File

@ -9,6 +9,7 @@ core/ui/Buttons/import: hide
core/ui/Buttons/language: hide
core/ui/Buttons/tag-manager: hide
core/ui/Buttons/more-page-actions: hide
core/ui/Buttons/new-journal: hide
core/ui/Buttons/permaview: hide
core/ui/Buttons/storyview: hide
core/ui/Buttons/theme: hide

View File

@ -3,5 +3,6 @@ title: $:/config/ViewToolbarButtons/Visibility/$:/
core/ui/Buttons/clone: hide
core/ui/Buttons/close-others: hide
core/ui/Buttons/more-tiddler-actions: hide
core/ui/Buttons/new-here: hide
core/ui/Buttons/permalink: hide
core/ui/Buttons/permaview: hide

View File

@ -1,2 +1,2 @@
title: $:/tags/PageControls
list: [[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/tag-manager]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/theme]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/refresh]] [[$:/core/ui/Buttons/more-page-actions]]
list: [[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/new-journal]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/tag-manager]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/theme]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/refresh]] [[$:/core/ui/Buttons/more-page-actions]]

View File

@ -1,2 +1,2 @@
title: $:/tags/ViewToolbar
list: [[$:/core/ui/Buttons/more-tiddler-actions]] [[$:/core/ui/Buttons/info]] [[$:/core/ui/Buttons/clone]] [[$:/core/ui/Buttons/edit]] [[$:/core/ui/Buttons/permalink]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/close-others]] [[$:/core/ui/Buttons/close]]
list: [[$:/core/ui/Buttons/more-tiddler-actions]] [[$:/core/ui/Buttons/info]] [[$:/core/ui/Buttons/new-here]] [[$:/core/ui/Buttons/clone]] [[$:/core/ui/Buttons/edit]] [[$:/core/ui/Buttons/permalink]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/close-others]] [[$:/core/ui/Buttons/close]]

View File

@ -0,0 +1,36 @@
caption: action-navigate
created: 20141008163514491
modified: 20141008164303144
tags: Widgets ActionWidgets
title: ActionNavigateWidget
type: text/vnd.tiddlywiki
! Introduction
The ''action-navigate'' widget is an [[action widget|ActionWidgets]] that sends a [[tm-navigate|WidgetMessage: tm-navigate]] message back up the widget tree. ActionWidgets are used within triggering widgets such as the ButtonWidget.
! Content and Attributes
The ''action-navigate'' widget is invisible. Any content within it is ignored.
|!Attribute |!Description |
|$to |The title of the target tiddler for the navigation (if not provided defaults to the [[WidgetVariable: currentTiddler]] |
|$scroll |Optional parameter determining whether the navigation will also cause a scroll to the target tiddler (see below) |
!! Scroll handling
The optional `$scroll` attribute can be set to "yes" to force scrolling to occur to bring the target tiddler into view. If set to "no" then scrolling does not occur. If the `$scroll` attribute is omitted then scrolling occurs unless either:
* the control key is pressed
* the action was initiated with the middle mouse button (if available)
! Examples
Here is an example of button that navigates to two different tiddlers at once:
<$macrocall $name='wikitext-example-without-html'
src='<$button>
<$action-navigate $to="ButtonWidget" $scroll="no"/>
<$action-navigate $to="ActionWidgets"/>
Click me!
</$button>'/>

View File

@ -0,0 +1,31 @@
caption: action-sendmessage
created: 20141008134309742
modified: 20141008162952455
tags: Widgets ActionWidgets
title: ActionSendMessageWidget
type: text/vnd.tiddlywiki
! Introduction
The ''action-sendmessage'' widget is an [[action widget|ActionWidgets]] that sends a [[message|WidgetMessages]] back up the widget tree. ActionWidgets are used within triggering widgets such as the ButtonWidget.
! Content and Attributes
The ''action-sendmessage'' widget is invisible. Any content within it is ignored.
|!Attribute |!Description |
|$message |The message to send (eg, [[WidgetMessage: tm-new-tiddler]]) |
|$param |Optional parameter string whose meaning is dependent on the message being sent |
|//{any attributes not starting with $}// |Multiple parameters that are attached to the message if the `$param$` attribute is not provided |
! Examples
Here is an example of button that displays both a notification and a wizard, and creates a new tiddler with tags and text:
<$macrocall $name='wikitext-example-without-html'
src='<$button>
<$action-sendmessage $message="tm-modal" $param="SampleWizard"/>
<$action-sendmessage $message="tm-notify" $param="SampleNotification"/>
<$action-sendmessage $message="tm-new-tiddler" title="This is newly created tiddler" tags="OneTag [[Another Tag]]" text=<<now "Today is DDth, MMM YYYY">>/>
Click me!
</$button>'/>

View File

@ -0,0 +1,23 @@
created: 20141008134425548
modified: 20141008144957192
tags: Widgets
title: ActionWidgets
type: text/vnd.tiddlywiki
Action widgets are a special type of widget that perform an action such as sending a message, navigating to a tiddler, or changing the value of a tiddler. They are used in association with other widgets that trigger those actions (for example, the ButtonWidget).
Action widgets are invisible. They must be the immediate children of their parent triggering widget. The actions are performed in sequence. For example, here is a button that triggers two actions of sending different messages:
```
<$button>
<$action-sendmessage $message="tm-home"/>
<$action-sendmessage $message="tm-full-screen"/>
Click me!
</$button>
```
Take care not to accidentally introduce an extra line break after the opening tag of the button widget. Doing so will trigger the WikiText parser to wrap the action widgets in a paragraph element. This means that the action widgets will not be triggered as they are no longer immediate children of the triggering widget.
The following action widgets are provided:
<<list-links "[tag[ActionWidgets]]">>

View File

@ -0,0 +1,28 @@
caption: qualify
created: 20141008141616791
modified: 20141008142012309
tags: Macros
title: NowMacro
type: text/vnd.tiddlywiki
The 'now' macro returns the current date and time, formatted with an optional format string.
! Parameters
|!Position |!Name |!Description |!Default |
|1st |format |DateFormat string specifying the format for the date/time |`0hh:0mm, DDth MMM YYYY` |
! Examples
For example:
```
* <<now>>
* <<now "DDth MMM YYYY">>
```
Returns:
* <<now>>
* <<now "DDth MMM YYYY">>

View File

@ -1,12 +1,24 @@
created: 20140410101941871
modified: 20140919160749349
modified: 20141008180223576
tags: Learning
title: Introduction to Filters
type: text/vnd.tiddlywiki
A step by step introduction to how [[Filters]] are used.
You can experiment with tiddler filters by typing them into the "Filter" tab of the [[advanced search panel|$:/AdvancedSearch]].
! Using Filters
Filters are a special language within WikiText for expressing lists of tiddlers.
Filters are used in the ListMacro, TabsMacro, ListWidget, CountWidget, and many other areas of TiddlyWiki.
For example, this is how the ListMacro would be used to display the first example below:
```
<<list-links "HelloThere Introduction [[Title with Spaces]]">>
```
The easiest way to experiment with tiddler filters is by typing them into the "Filter" tab of the [[advanced search panel|$:/AdvancedSearch]].
! Simple Filters

View File

@ -1,17 +1,17 @@
caption: tm-new-tiddler
created: 20140226194405353
modified: 20140724194729158
modified: 20141008142952355
tags: Messages navigator-message
title: WidgetMessage: tm-new-tiddler
type: text/vnd.tiddlywiki
caption: tm-new-tiddler
The new tiddler message creates a new draft tiddler and adds it to the current story. It requires the following properties on the `event` object:
|!Name |!Description |
|param |Optional title of a tiddler to use as a template for the new tiddler |
|param |Either the title of a tiddler to use as a template for the new tiddler or a hashmap of tiddler fields |
|navigateFromTitle |Title of the tiddler from which the navigation to the new tiddler was initiated |
The new tiddler message is usually generated with the LinkWidget or the ButtonWidget and is handled by the NavigatorWidget.
The new tiddler message is usually generated with the LinkWidget, ButtonWidget or ActionSendMessageWidget and is handled by the NavigatorWidget.
! Example

View File

@ -1,17 +1,22 @@
title: ButtonWidget
created: 201310241419
modified: 201406170837
tags: Widgets
caption: button
created: 20131024141900000
modified: 20141008145311298
tags: Widgets
title: ButtonWidget
type: text/vnd.tiddlywiki
! Introduction
The button widget displays an HTML `<button>` element that can perform a combination of optional actions when clicked:
* Navigate to a specified tiddler
* Dispatch a user defined [[widget message|Messages]]
* Trigger a user defined [[popup|PopupMechanism]]
* Assign new text to a specified tiddler
* Executing any ActionWidgets that are immediate children of the button widget
* Execute any integrated actions:
** Navigate to a specified tiddler
** Dispatch a user defined [[widget message|Messages]]
** Trigger a user defined [[popup|PopupMechanism]]
** Assign new text to a specified tiddler
The integrated actions are provided as a shortcut for invoking common actions. The same functionality is available via ActionWidgets, with the exception of the support for highlighting selected popups.
! Content and Attributes