1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-02 14:29:55 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-copy-to-clipboard.tid
Jeremy Ruston 78fb4a2c1d
Custom copy clipboard notifications (#8211)
* Initial Commit

* Improve plugin tests

Fixes #8209

* Fix RSOE

* Fix extraneous copy to clipboard at startup
2024-05-29 15:06:33 +01:00

28 lines
1.2 KiB
Plaintext

caption: tm-copy-to-clipboard
created: 20171215150056004
modified: 20240523174013095
tags: Messages
title: WidgetMessage: tm-copy-to-clipboard
type: text/vnd.tiddlywiki
The "copy to clipboard" message attempts to copy the specified text to the clipboard. If it succeeds, the tiddler [[$:/language/Notifications/CopiedToClipboard/Succeeded]] is displayed as a notification. If the browser doesn't permit the operation, the tiddler [[$:/language/Notifications/CopiedToClipboard/Failed]] is displayed instead.
It requires the following properties on the `event` object:
|!Name |!Description |
|param |Text to be copied to the clipboard |
|successNotification |<<.from-version "5.3.4">> Optional title of tiddler containing notification to be used if the operation succeeds |
|failureNotification |<<.from-version "5.3.4">> Optional title of tiddler containing notification to be used if the operation fails |
This message is usually generated with the ButtonWidget. It is handled by the TiddlyWiki core.
! Example
This example copies the current time to the clipboard:
<$macrocall $name='wikitext-example-without-html'
src='<$button message="tm-copy-to-clipboard" param=<<now>>>
Copy date to clipboard
</$button>'/>