[tw5] Re: copying a tiddler content to the clipboard

2020-04-19 Thread A Gloom
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:
<$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}}

<$reveal type='nomatch' state='$:/temp/sysiconssearch!!searchterm' text=''>
<$set name='searchterm' value={{$:/temp/sysiconssearch!!searchterm}}>

<$list 
filter="[all[tiddlers+shadows]tag[$:/tags/Image]prefix[$:/core]search:title]">
<$transclude/>  ^^---^^ <$link><$view field="title"/> 
 <$macrocall $name="copy-to-clipboard" 
src=<>/>




Search for system icons, copy of tiddler content:
<$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}}

<$reveal type='nomatch' state='$:/temp/sysiconssearch!!searchterm' text=''>
<$set name='searchterm' value={{$:/temp/sysiconssearch!!searchterm}}>

<$list 
filter="[all[tiddlers+shadows]tag[$:/tags/Image]prefix[$:/core]search:title]">
<$transclude/>  ^^---^^ <$link><$view field="title"/> 
 <$macrocall $name="copy-to-clipboard" src={{!!text}}/>




Copy to clipboard variantations

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

`<>`

 __simple macro__ //( doesn't have closing / )//:
`<>` -- <>

 __macrocall (for lists)__:

* copies title:
`<$macrocall $name="copy-to-clipboard" src=<> 
class="tc-btn-rounded"/>` -- <$macrocall $name="copy-to-clipboard" 
src=<> 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"/>

 __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=<>>Copy date to 
clipboard` -- -- <$button message="tm-copy-to-clipboard" 
param=<>>Copy date to clipboard

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

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


copy to clipboard variations.tid
Description: Binary data


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


[tw5] Re: copying a tiddler content to the clipboard

2020-04-17 Thread Thomas Elmiger
Uuups, you will probably also not need my other condition: 

[all[current]field:type[image/svg+xml]]

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/fbffb071-5646-40c2-a06f-dfa027a21b16%40googlegroups.com.


[tw5] Re: copying a tiddler content to the clipboard

2020-04-17 Thread Thomas Elmiger
Hi Tiziano

I made a custom button for someting like that recently. It is called a 
conditionals view template. View template means, something is shown while 
viewing a tiddler. And conditional means, when some conditions are met. 

My case: I want to copy the code of image tiddlers only (not all tiddlers). 
So the condition is: If the tiddler has a tag $:/tags/Image – you see that 
in the first filter below and you might want to delete the part 
tag[$:/tags/Image]

My solution: 
https://tid.li/tw5/apps/svg.html#%24%3A%2F_telmiger%2Fui%2FViewTemplate%2Fcopy-image-code

Code: 

<$list filter="[all[current]tag[$:/tags/Image]] 
[all[current]field:type[image/svg+xml]]">

<$button class="te-copy-code" message="tm-copy-to-clipboard" 
param={{!!text}} tooltip={{$:/language/Buttons/CopyToClipboard/Hint}} >
{{$:/core/images/copy-clipboard}} 
Copy image code to clipboard
 

''Hint: ''Remember to delete the tags `` and `` manually 
after pasting into the editor.

@@width:100%;
---
@@




You might also want to delete the Hint and the horizontal ruler below that 
(I need it for my own design).

Don’t forget to tag your template tiddler with $:/tags/ViewTemplate

Good luck! 
Thomas


Am Freitag, 17. April 2020 22:58:29 UTC+2 schrieb Tiziano Solignani:
>
> Thank you. But that would make a copy of the tiddler while I meant to copy 
> the tiddler content to the system clipboard, to paste elsewhere later.
>
> Thank you. 
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/b64ab494-4685-4e02-9d21-5db437afe9e1%40googlegroups.com.


[tw5] Re: copying a tiddler content to the clipboard

2020-04-17 Thread Eric Shulman
On Friday, April 17, 2020 at 1:58:29 PM UTC-7, Tiziano Solignani wrote:
>
> I meant to copy the tiddler content to the system clipboard, to paste 
> elsewhere later.


Add this to your "template" tiddler:

<$button message="tm-copy-to-clipboard" param={{!!text}}>
Copy to clipboard
 

enjoy,
-e

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/5bd3afb6-4dc5-41bc-a080-7305da81aafd%40googlegroups.com.


[tw5] Re: copying a tiddler content to the clipboard

2020-04-17 Thread Tiziano Solignani
Thank you. But that would make a copy of the tiddler while I meant to copy the 
tiddler content to the system clipboard, to paste elsewhere later.

Thank you. 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/c4dc4600-d652-4833-86d8-8b7d8b41a6e0%40googlegroups.com.


[tw5] Re: copying a tiddler content to the clipboard

2020-04-16 Thread Mat
Yeah, try the different buttons in the tiddler menu and you'll find the 
"clone" button i.e this makes a copy of the tiddler.

However, if you're talking about some button in *edit view*, then no, 
there's no such button but I think the mechanism for it exists :-)

<:-)

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/27d84b50-4c6e-46f8-9e06-7c99eec1b3a2%40googlegroups.com.