Tiddler in live edit preview mode behaves differently to in view mode

70 views
Skip to first unread message

joearms

unread,
Dec 15, 2018, 4:42:57 AM12/15/18
to TiddlyWikiDev


The code makes two buttons. One to add a tag to the current widget another to remove the tag

Works fine in edit mode with live preview.

Stops working when I save the tiddler.

What's happening here?

Cheers

/Joe



<$button>
<$action-sendmessage $message="tm-add-tag" $param="example"/>
add example tag
</$button>

<$button>
<$action-sendmessage $message="tm-remove-tag" $param="example"/>
remove example tag
</$button>

joearms

unread,
Dec 15, 2018, 5:06:02 AM12/15/18
to TiddlyWikiDev
Solved - but I'm still worried by the fact that live preview and view mode work differently.

Solution:
Wrap the button code in a fieldmanger like this:
ie:

<$fieldmangler>
  <$button ...>   ...  as below
  ...
<$/fieldmangler>

@TiddlyTweeter

unread,
Dec 15, 2018, 5:18:19 AM12/15/18
to TiddlyWikiDev
"Fieldmanger" is great during the Xmas period :-)

More seriously: I like your questions. They bring "us" back to what TW looks like on entry to someone who knows what they are doing. 

J, x

joearms wrote:
Solution:
Wrap the button code in a fieldmanger ... 

joearms

unread,
Dec 15, 2018, 5:44:43 AM12/15/18
to TiddlyWikiDev


On Saturday, 15 December 2018 11:18:19 UTC+1, @TiddlyTweeter wrote:
"Fieldmanger" is great during the Xmas period :-)

More seriously: I like your questions. They bring "us" back to what TW looks like on entry to someone who knows what they are doing. 


Right imagine my joy/horror when I discover that

    <$set name=x value=abc>
         body
    <$/set>

means

    let x = "abc" in
        ...
    end

And part of me cries out 'what's wrong with PHP' ie why can't I write

    <?
       x = "abc";
       ...
    ?>

Or just some inline JS

I'm torn between the joy of what I can create with the TW since I've seen all these amazing examples
and the peculiarities of the syntax.

Cheers

/Joe

Jeremy Ruston

unread,
Dec 15, 2018, 7:13:02 AM12/15/18
to tiddly...@googlegroups.com
Hi Joe

I think the first oddity you're encountering here is due to the fact that when you're editing a tiddler you're actually interacting with a "draft", an entirely separate tiddler that only overwrites the target tiddler when you click the checkmark when you've finished editing.

We use separate draft tiddlers so that we can cancel attempts to edit a tiddler without disturbing the original one.

Right imagine my joy/horror when I discover that

    <$set name=x value=abc>
         body
    <$/set>

means

    let x = "abc" in
        ...
    end

And part of me cries out 'what's wrong with PHP' ie why can't I write

    <?
       x = "abc";
       ...
    ?>

Or just some inline JS

The underlying structure of TiddlyWiki's rendering tree is just a tree; we can compile any syntax into the existing primitives, including that PHP-like syntax.

I reuse the HTML syntax for widgets to simplify things: it's actually the other way around, HTML elements are just special cases of widgets. The design of TW5 tries to use the minimum number of primitives needed to support the required complexity. There's a version of your process of determining that two things are sufficiently similar that they can be merged. It's a deep principle in TW5, we endlessly reuse the same mechanisms for everything.

The main reason that I didn't choose JS or a similar language is because TiddlyWiki isn't for developers. Software developers are already incredibly well catered for by the open source world and I'm more interested in exploring how we can empower civilians...

I'm torn between the joy of what I can create with the TW since I've seen all these amazing examples
and the peculiarities of the syntax.

Yes indeed, although I think the peculiarities stem rather naturally from the principles and context that underpin the design. For example, the filter syntax was devised so that a degenerate filter was just a list of titles with double square bracket quoting. That idea leads pretty directly to the present syntax.

Best wishes

Jeremy



Cheers

/Joe

 
J, x

joearms wrote:
Solution:
Wrap the button code in a fieldmanger ... 

--
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 tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/c9f1ae84-dc4c-43ba-8982-4bc8780894dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

PMario

unread,
Dec 15, 2018, 7:27:57 AM12/15/18
to TiddlyWikiDev
On Saturday, December 15, 2018 at 11:44:43 AM UTC+1, joearms wrote:

Right imagine my joy/horror when I discover that

    <$set name=x value=abc>
         body
    <$/set>

means

    let x = "abc" in
        ...
    end

And part of me cries out 'what's wrong with PHP' ie why can't I write

    <?
       x = "abc";
       ...
    ?>

Or just some inline JS

Security and usability for non programmers. To name just 2 ;)

-m

TonyM

unread,
Dec 15, 2018, 9:51:39 PM12/15/18
to TiddlyWikiDev

<?
x = "abc";
...
?>

Is similer to

<$vars
x = "abc";
...
>

Scope of defined variables

</$vars>

Regards
Tony

coda coder

unread,
Dec 17, 2018, 10:49:32 AM12/17/18
to TiddlyWikiDev
> The design of TW5 tries to use the minimum number of primitives needed to support the required complexity.

Jem Gem.

#justsayin

Reply all
Reply to author
Forward
0 new messages