[TW5] One click delete tiddlers

已查看 650 次
跳至第一个未读帖子

Bob Flandard

未读,
2016年11月20日 08:00:542016/11/20
收件人 TiddlyWiki
Hi,

Tobias Beer has created this macro to delete tiddlers via a filter list. That's nice, but can it be modified to delete them all will a single mouse click?

Maybe using the checkbox widget with the default being all items in the list are checked and can be individually unchecked if required. If that's too difficult then just a single button next to the filter results list.

Thanks, Bob

https://tobibeer.github.io/tb5/#Deleting%20Tiddlers%20Via%20Lists

<$edit-text tiddler="$:/temp/delete-filter" tag="input" placeholder="enter a filter" default="" size=50/>
<$reveal state="$:/temp/delete-filter" type="nomatch" text="">
<$button class="tc-btn-invisible">
<$action-setfield $tiddler="$:/temp/delete-filter" $field="text" $value=""/>
{{$:/core/images/close-button}}
</$button>
</$reveal>

<$list filter={{$:/temp/delete-filter}}>
<$button message="tm-delete-tiddler" param={{!!title}}>{{$:/core/images/delete-button}}</$button> <$link to={{!!title}}><$view field=title/></$link>
<br>
</$list>



Riz

未读,
2016年11月20日 08:14:012016/11/20
收件人 TiddlyWiki
<$edit-text tiddler="$:/temp/delete-filter" tag="input" placeholder="enter a filter" default="" size=50/>
<$reveal state="$:/temp/delete-filter" type="nomatch" text="">
<$button class="tc-btn-invisible">
<$action-setfield $tiddler="$:/temp/delete-filter" $field="text" $value=""/>
{{$:/core/images/close-button}}
</$button>
</$reveal>

<$button>
<$action-deletetiddler $filter={{$:/temp/delete-filter}}/>
Delete All
</$button><br>

Bob Flandard

未读,
2016年11月20日 08:28:552016/11/20
收件人 TiddlyWiki
Hi Riz,

Wow! you work quickly. Thanks very much, that works like a charm.

Regards, Bob

Riz

未读,
2016年11月20日 09:20:442016/11/20
收件人 TiddlyWiki

Here try this code, this will give you the original functionality you asked for, ie checked checkboxes, and if you want to exclude something, just uncheck it. There is a slight difference in the filter syntax. DO NOT use the outer brackets. ie, if your normal filter is [tag[HelloThere]], just give tag[HelloThere]

\define listflter() [$(basefilter)$]
\define exclude()
[is[tiddler]$(basefilter)$] -[exclusionstatus[exclude]]
\end


<$edit-text tiddler="$:/temp/delete-filter" tag="input" placeholder="enter a filter" default="" size=50/>
<$reveal state="$:/temp/delete-filter" type="nomatch" text="">
<$button class="tc-btn-invisible">
<$action-setfield $tiddler="$:/temp/delete-filter" $field="text" $value=""/>
{{$:/core/images/close-button}}
</$button>
</$reveal>

<$set name="basefilter" value={{$:/temp/delete-filter}}>

<$reveal state="$:/temp/delete-filter" type="nomatch" text="">
<$list filter=<<listflter>>>

<$checkbox field="exclusionstatus" checked="include" unchecked="exclude" default="include">{{!!title}}</$checkbox>
</$list>
</$reveal>

<$button>Delete Selected
<$list filter=<<exclude>>>
<$action-deletetiddler $filter=<<exclude>>/>
</$list>
<$list filter="[has[exclusionstatus]]">
<$action-setfield $field="exclusionstatus"/>
</$list>
</$button>
</$set>

Bob Flandard

未读,
2016年11月20日 09:51:182016/11/20
收件人 TiddlyWiki
Hi Riz,

Thanks again for your excellent code, it's amazing.

Regards, Bob

Rizwan Ishak

未读,
2016年11月20日 10:06:122016/11/20
收件人 tiddl...@googlegroups.com

You are welcome. Post your completed works here and the subreddit if you can.


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@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/dc49da1b-cc66-4517-9816-3995a7f6c618%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bob Flandard

未读,
2016年11月20日 13:34:322016/11/20
收件人 TiddlyWiki
Hi Riz,

Please forgive my dimness, but I had no idea what subreddit was. So I googled it and then googled reddit... and I still have no idea. In my defense I was born in the 60s and I don't do Twitter or Facebook or LinkIn (if they're related). My completed work is all yours, except for a minor edit to the <<now>> format.

Sorry for being such a Luddite, but thanks again for taking the time so solve my problems will such lovely elegant code.

All the best, Bob

Riz

未读,
2016年11月20日 20:28:182016/11/20
收件人 TiddlyWiki


 Hi Bob

Sorry I missed the address. There is a subreddit dedicated to TW5 at https://www.reddit.com/r/TiddlyWiki5/
We are creating a directory of all tiddlywikis posted on the group, to let others know how different people are using TW5. Normally | copy and paste the link from the group, but I would much appreciate it if the original authors posted it themselves. Creating a reddit acc is a matter of 2mins, as it asks for no kind of verification.
回复全部
回复作者
转发
0 个新帖子