mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-12 09:00:04 +00:00
![Leilei332](/assets/img/avatar_default.png)
* Extend copy to clipborad function to support customized mime types * Remove function default parameter syntax * Add plainText option * Use plainText name * Set "text/plain" data only when it exists * Docs update * Docs update
29 lines
989 B
Plaintext
29 lines
989 B
Plaintext
title: $:/core/macros/copy-to-clipboard
|
|
tags: $:/tags/Macro
|
|
|
|
\whitespace trim
|
|
|
|
\procedure copy-to-clipboard(src,class:"tc-btn-invisible",style,type:"text/plain",plain)
|
|
\procedure copy-to-clipboard-actions()
|
|
<$action-sendmessage $message="tm-copy-to-clipboard" $param=<<src>> type=<<type>> plainText=<<plain>>/>
|
|
\end copy-to-clipboard-actions
|
|
<$button actions=<<copy-to-clipboard-actions>>
|
|
class=<<class>>
|
|
style=<<style>>
|
|
tooltip={{$:/language/Buttons/CopyToClipboard/Hint}}
|
|
>
|
|
{{$:/core/images/copy-clipboard}}
|
|
<span class="tc-tiny-gap-left">
|
|
<$text text={{$:/language/Buttons/CopyToClipboard/Caption}}/>
|
|
</span>
|
|
</$button>
|
|
\end copy-to-clipboard
|
|
|
|
\procedure copy-to-clipboard-above-right(src,class:"tc-btn-invisible",style,type:"text/plain")
|
|
<div style.position="relative">
|
|
<div style.position="absolute" style.bottom="0" style.right="0">
|
|
<$transclude $variable="copy-to-clipboard" src=<<src>> class=<<class>> style=<<style>> type=<<type>> plain=<<plain>>/>
|
|
</div>
|
|
</div>
|
|
\end
|