I have done the same as Thomas for a search feature for TW system icons-- 
first one copies the icon tiddler title, the second copies the tiddler 
content. Below them is notes on the variations of the copy to clipboard 
feature. Everything is also included in tid files that can be imported into 
a TW to experiment with or use as reference.

Search for system icons, copy of title:<br/>
<$edit-text tiddler='$:/temp/sysiconssearch' field='searchterm' 
placeholder='search term' tag='input' type='text'/><$button 
class="tc-btn-rounded"  style="margin-left:10px;">
<$action-setfield $tiddler="$:/temp/sysiconssearch" searchterm="" />
{{$:/core/images/close-button}}
</$button><br/>
<$reveal type='nomatch' state='$:/temp/sysiconssearch!!searchterm' text=''>
<$set name='searchterm' value={{$:/temp/sysiconssearch!!searchterm}}>
<ol>
<$list 
filter="[all[tiddlers+shadows]tag[$:/tags/Image]prefix[$:/core]search:title<searchterm>]">
<li><div style="margin-bottom:5px; padding:5px 10px; border:solid 
1px;"><$transclude/> &nbsp; ^^---^^ <$link><$view field="title"/></$link> 
&nbsp; <$macrocall $name="copy-to-clipboard" 
src=<<currentTiddler>>/></div></li>
</$list></ol>
</$set>
</$reveal>

Search for system icons, copy of tiddler content:<br/>
<$edit-text tiddler='$:/temp/sysiconssearch' field='searchterm' 
placeholder='search term' tag='input' type='text'/><$button 
class="tc-btn-rounded"  style="margin-left:10px;">
<$action-setfield $tiddler="$:/temp/sysiconssearch" searchterm="" />
{{$:/core/images/close-button}}
</$button><br/>
<$reveal type='nomatch' state='$:/temp/sysiconssearch!!searchterm' text=''>
<$set name='searchterm' value={{$:/temp/sysiconssearch!!searchterm}}>
<ol>
<$list 
filter="[all[tiddlers+shadows]tag[$:/tags/Image]prefix[$:/core]search:title<searchterm>]">
<li><div style="margin-bottom:5px; padding:5px 10px; border:solid 
1px;"><$transclude/> &nbsp; ^^---^^ <$link><$view field="title"/></$link> 
&nbsp; <$macrocall $name="copy-to-clipboard" src={{!!text}}/></div></li>
</$list></ol>
</$set>
</$reveal>

Copy to clipboard variantations

// copy-to-clipboard cannot handle backticks 
https://groups.google.com/d/topic/tiddlywiki/4EPOIsVDfVY/discussion //

`<<copy-to-clipboard """text to be copied""">>`

&sect; __simple macro__ //( doesn't have closing / )//:
`<<copy-to-clipboard "tlext to be copied">>` -- <<copy-to-clipboard "text 
to be copied" class="tc-btn-boxed">>

&sect; __macrocall (for lists)__:

* copies title:
`<$macrocall $name="copy-to-clipboard" src=<<currentTiddler>> 
class="tc-btn-rounded"/>` -- <$macrocall $name="copy-to-clipboard" 
src=<<currentTiddler>> class="tc-btn-rounded"/>

* copies text field:
`<$macrocall $name="copy-to-clipboard" src={!!text}} 
class="tc-btn-rounded"/>` -- <$macrocall $name="copy-to-clipboard" 
src={{!!text}} class="tc-btn-rounded"/>

&sect; __button w/ "tm-copy-to-clipboard" action message__:

* w/ macro or custom macro w/ multi-lined text to be copied:
`<$button message="tm-copy-to-clipboard" param=<<now>>>Copy date to 
clipboard</$button>` -- -- <$button message="tm-copy-to-clipboard" 
param=<<now>>>Copy date to clipboard</$button>

* w/ text field copy :
`<$button message="tm-copy-to-clipboard" param={{!!text}}>Copy to 
clipboard</$button>` -- -- <$button message="tm-copy-to-clipboard" 
param={{!!text}}>Copy to clipboard</$button>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/62a9a5a2-8b60-4d4e-8e53-4bf4e75ff95c%40googlegroups.com.

Attachment: copy to clipboard variations.tid
Description: Binary data

Attachment: Search w text copy to clipboard.tid
Description: Binary data

Reply via email to