我正在使用Confluence 5.10.8。在一些页面上,我有几个文本片段需要读者复制到剪贴板。对于这些文本片段中的每一个,我希望能够添加一个不可编辑的文本字段和一个按钮,以便在单击时将文本复制到剪贴板,可能像这样:
我希望您能提供一些视觉反馈来指示文本已被复制。
我认为 user macro 是正确的选择,对吗?类似于(尚未复制):
我认为 user macro 是正确的选择,对吗?类似于(尚未复制):
## @param Text:title=Text|type=string|required=true|desc=The text to be displayed and copied
<!-- font-awesome contains the clipboard icon -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<span style="white-space: nowrap">
<input type="text" value="$paramText" size="$paramText.length()" readonly>
<button class="fa fa-clipboard" title="click to copy">
</span>