1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-03-13 15:08:09 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/macros/copy-to-clipboard Macro.tid
Leilei332 67e8670c73
Extend copy to clipborad function to support customized mime types (#8912)
* 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
2025-01-27 16:45:26 +00:00

24 lines
842 B
Plaintext

caption: copy-to-clipboard
created: 20171216104754967
modified: 20250127133558352
tags: Macros [[Core Macros]]
title: copy-to-clipboard Macro
type: text/vnd.tiddlywiki
The <<.def copy-to-clipboard>> [[macro|Macros]] displays a button that copies specified text to the clipboard. A notification is displayed if the operation is successful; some browsers do not permit the operation.
!! Parameters
;src
: The text to be copied to the clipboard
;class
: Optional CSS classes to be assigned to the button (defaults to `tc-btn-invisible`)
;style
: Optional CSS styles to be assigned to the button
;type
: <<.from-version "5.3.7">> MIME type of the text to be copied, defaults to `text/plain`
;plain
: <<.from-version "5.3.7">> Additional plain text to be copied when `type` attribute isn't `text/plain`
<<.macro-examples "copy-to-clipboard">>