diff --git a/core/modules/startup/rootwidget.js b/core/modules/startup/rootwidget.js index b00ea741f..1749600e7 100644 --- a/core/modules/startup/rootwidget.js +++ b/core/modules/startup/rootwidget.js @@ -77,7 +77,8 @@ exports.startup = function() { $tw.rootWidget.addEventListener("tm-copy-to-clipboard",function(event) { $tw.utils.copyToClipboard(event.param,{ successNotification: event.paramObject && event.paramObject.successNotification, - failureNotification: event.paramObject && event.paramObject.failureNotification + failureNotification: event.paramObject && event.paramObject.failureNotification, + plainText: event.paramObject && event.paramObject.plain },event.paramObject.type); }); // Install the tm-focus-selector message diff --git a/core/modules/utils/dom/dom.js b/core/modules/utils/dom/dom.js index ad412af71..cb38e1cc8 100644 --- a/core/modules/utils/dom/dom.js +++ b/core/modules/utils/dom/dom.js @@ -289,7 +289,7 @@ exports.copyToClipboard = function(text,options,type) { textArea.setSelectionRange(0,text.length); textArea.addEventListener("copy",function(event) { event.preventDefault(); - event.clipboardData.setData("text/plain",text); + event.clipboardData.setData("text/plain",options.plainText); event.clipboardData.setData(type,text); }); var succeeded = false; diff --git a/core/wiki/macros/copy-to-clipboard.tid b/core/wiki/macros/copy-to-clipboard.tid index 46a73d28e..411fcf067 100644 --- a/core/wiki/macros/copy-to-clipboard.tid +++ b/core/wiki/macros/copy-to-clipboard.tid @@ -3,10 +3,9 @@ tags: $:/tags/Macro \whitespace trim -\procedure copy-to-clipboard(src,class:"tc-btn-invisible",style,type:"text/plain") - +\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=<> type=<>/> +<$action-sendmessage $message="tm-copy-to-clipboard" $param=<> type=<> plain=<>/> \end copy-to-clipboard-actions <$button actions=<> class=<> @@ -23,7 +22,7 @@ tags: $:/tags/Macro \procedure copy-to-clipboard-above-right(src,class:"tc-btn-invisible",style,type:"text/plain")
- <$transclude $variable="copy-to-clipboard" src=<> class=<> style=<