1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

Message tm-open-window enhancements (#6188)

* Message tm-open-window enhancements

* Add Messages tiddler. Enhance its description.
This commit is contained in:
Marxsal 2021-11-17 04:13:01 -08:00 committed by GitHub
parent 45d469ca5c
commit b6eb6d477b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 6 deletions

View File

@ -1,10 +1,10 @@
created: 20140226083311937
modified: 20140226090209479
modified: 20211117042057208
tags: Concepts Reference
title: Messages
type: text/vnd.tiddlywiki
Widget messages are generated by widgets in response to user actions. They flow up the widget tree until they are handled by an ancestor widget.
Widget ''messages'' are generated by [[Widgets]] in response to user actions. Messages have a <<.param name>>, an optional primary <<.param parameter>>, and one or more optional named parameters. These messages travel up the widget tree where they are handled by ancestor widgets or the core itself.
The following widget messages are implemented by the core:

View File

@ -0,0 +1,10 @@
created: 20211109165213041
modified: 20211109175739768
tags:
title: SampleWindowTemplate
| ''Name:'' |<$edit field=name tag="input" />|
|''Rank:'' |<$edit field=rank tag="input" />|
''Variable 'something' contains:''<<something>>

View File

@ -1,11 +1,11 @@
caption: tm-open-window
created: 20160424181447704
modified: 20190704145627537
modified: 20211117042202771
tags: Messages
title: WidgetMessage: tm-open-window
type: text/vnd.tiddlywiki
The `tm-open-window` message opens a tiddler in a new //browser// window. If no parameters are specified, the current tiddler is opened in a new window. Similiar to `tm-modal` any additional parameters passed via the <<.param "paramObject">> are being provided as variables to the new window.
The `tm-open-window` [[message|Message]] opens a tiddler in a new //browser// window. If no parameters are specified, the current tiddler is opened in a new window. Similiar to `tm-modal` any additional parameters passed via the <<.param "paramObject">> are provided as variables to the new window.
|!Name |!Description |
|param |Title of the tiddler to be opened in a new browser window, defaults to <<.var "currentTiddler">> if empty |
@ -13,7 +13,25 @@ The `tm-open-window` message opens a tiddler in a new //browser// window. If no
|windowTitle |Title string for the opened window |
|width |Width of the new browser window |
|height |Height of the new browser window |
|paramObject |Hashmap of variables that will be provided to the window |
|paramObject |Hashmap of variables to be provided to the modal, contains all extra parameters passed to the widget sending the message. |
The `tm-open-window` message is best generated with the ActionSendMessageWidget, which in turn is triggered by a widget such as the ButtonWidget. It is handled by the core itself.
<<.tip """When used with the ActionSendMessage Widget, <<.param 'param'>> becomes <<.param '$param'>> """>>
<<.tip """Parameters <<.param template>>, <<.param windowTitle>>, <<.param width>>, and <<.param height>> require the ActionSendMessageWidget.""">>
The `tm-open-window` message is usually generated with the ButtonWidget and is handled by the core itself.
<$macrocall $name='wikitext-example-without-html'
src="""
<$button>Open Window
<$action-sendmessage
$message="tm-open-window"
$param="$:/temp/openme"
template="SampleWindowTemplate"
windowTitle="My Window Title"
width="100em"
height="50em"
something="I just in over in a variable, and boy is my Hashmap tired." />
</$button>
""" />