[tw] Re: TW5 Clarification on events

2017-07-12 Thread mystikite
My use case is 'locking' one or more tiddlers based on 
  1: whether your username == currentTiddler!!creator
  2: whether the tiddler has a 'Locked' tag set.

I was going to try to end run around the encoded tags issue by
  1: adding a new UUID field to tiddlers, and having it added as a tag 
(since having the tiddler title as a tag woudl be a nightmare.)
  2: keeping the 'Locked' tag as a single word.

Since the CSS spec says you can chain two attributes more or less the same 
as you chain 2 classes,  this could definitely be the answer.


On Wednesday, July 12, 2017 at 2:36:43 AM UTC-5, PMario wrote:
>
> On Wednesday, July 12, 2017 at 6:36:47 AM UTC+2, myst...@gmail.com wrote:
>>
>> Bonus question: is there a way to add a class tag to the ViewTemplate w/o 
>> modifying the actual ViewTemplate?
>>
>
> There is a standing pull-request at github, that tries to add more 
> flexibility to single tiddler styling. see: 
> https://github.com/Jermolene/TiddlyWiki5/pull/2737 
>
> But these 2 posts let me rethink the implementation again: 
> https://groups.google.com/forum/#!topic/tiddlywiki/J0MjGWFiPNU and 
> https://groups.google.com/forum/#!msg/tiddlywiki/BN2lJiDKSNE/AVrsbrHkCgAJ
>
> We need to be more generic, so we can cover more use-cases. ... 
>
> If you can describe your idea / needs, we may be able to cover them all :)
>
> -mario
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/da8b8e14-63d2-4298-83d4-e59996d6ecec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: TW5 Clarification on events

2017-07-12 Thread Mat

>
> I believe i can create a widget that will intercept various messages 
> heading to the navigatorWidget and fieldManglerWidgets
> before they receive them.
>


Might this enable tiddler-internal links? I.e the long standing request to 
be able to jump to a specific section in a tiddler without changing the url 
in the browser? (Here 's a hack experiment 
on this.)

<:-)

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/93b273c6-9552-4ece-9e6c-c089ab9ff789%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: TW5 Clarification on events

2017-07-12 Thread PMario
On Wednesday, July 12, 2017 at 6:36:47 AM UTC+2, myst...@gmail.com wrote:
>
> I believe i can create a widget that will intercept various messages 
> heading to the navigatorWidget and fieldManglerWidgets
> before they receive them. 
>

right
 

> If i read the code right, the message can be stopped from arriving by just 
> not re-inserting it, 
>

right, If the return value is an event. ... 
other "hooks" have different return values. .. So you need to be sure, what 
to return. .. If the return value is a tiddler object. Returning an empty 
object {} may corrupt the TW data. .. So be careful!
 

> or it can be modified  and then re-inserted to let the previously 
> mentioned widgets do their jobs.
> (examples: adding a field to new tiddlers, preventing the edit-tiddler or 
> delete-tiddler from getting through)
>

right
 

> Since this is a plugin, and i don't really want to modify core code, is 
> there a specific tag or tags 
> i need to have in the tiddler that calls this widget to ensure it 
> intercepts at the right places?
>

Help text: http://tiddlywiki.com/dev/index.html#:[search:title[hook]]

plugins, that use the mechanism:

 - th-importing-tiddler ... does only one thing, so the plugin is 
relatively simple:  
https://github.com/wikilabs/plugins/blob/master/wikilabs/bundler/tiddlers/bundles-import.js
 

 - savetrail core plugin.  does hook into several actions .. so it's 
much more complicated: 
https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/savetrail/savetrail.js

but both should give you an example, ho to deal with hooks. 

have fun!
mario

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/48691def-762d-47c9-b772-0d688d9c0672%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: TW5 Clarification on events

2017-07-12 Thread PMario
On Wednesday, July 12, 2017 at 6:36:47 AM UTC+2, myst...@gmail.com wrote:
>
> Bonus question: is there a way to add a class tag to the ViewTemplate w/o 
> modifying the actual ViewTemplate?
>

There is a standing pull-request at github, that tries to add more 
flexibility to single tiddler styling. see: 
https://github.com/Jermolene/TiddlyWiki5/pull/2737 

But these 2 posts let me rethink the implementation again: 
https://groups.google.com/forum/#!topic/tiddlywiki/J0MjGWFiPNU and 
https://groups.google.com/forum/#!msg/tiddlywiki/BN2lJiDKSNE/AVrsbrHkCgAJ

We need to be more generic, so we can cover more use-cases. ... 

If you can describe your idea / needs, we may be able to cover them all :)

-mario

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/6bb2aed0-582b-4ef5-b8f5-5f28ea83bc9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.