Merge pull request #2667 from alecmerdler/no-flash-clipboard

Copy-to-Clipboard Without Flash
This commit is contained in:
Alec Merdler 2017-05-25 11:57:38 -07:00 committed by GitHub
commit f759784262
13 changed files with 186 additions and 74 deletions

View file

@ -1,6 +1,7 @@
<div class="build-logs-view-element" ng-class="useTimestamps ? 'with-timestamps' : ''">
<span ng-show="logEntries">
<button id="copyButton" class="btn btn-primary copy-button" data-clipboard-text="{{ buildLogsText }}">
<button id="copyButton" class="btn btn-primary copy-button"
clipboard-copy="#{{ ::buildLogsText }}">
<i class="fa fa-clipboard"></i>Copy Logs
</button>
</span>

View file

@ -1,11 +1,12 @@
<div class="copy-box-element" ng-class="disabled ? 'disabled' : ''">
<div class="id-container">
<div class="copy-container">
<input type="text" class="form-control" value="{{ value }}" readonly>
<span class="copy-icon" data-title="Copy to Clipboard"
data-container="body"
data-placement="bottom"
bs-tooltip>
<input id="{{ ::inputId }}" type="text" class="form-control"
value="{{ ::value }}"
readonly>
<span class="copy-icon"
clipboard-copy="#{{ ::inputId }}"
data-title="Copy to Clipboard" data-container="body" data-placement="bottom" bs-tooltip>
<i class="fa fa-clipboard"></i>
</span>
</div>

View file

@ -66,17 +66,15 @@
<div ng-if="getCommand(currentFormat, currentRobot)">
Command:
<pre class="command">{{ getCommand(currentFormat, currentRobot) }}</pre>
<pre id="command-data" class="command">{{ getCommand(currentFormat, currentRobot) }}</pre>
</div>
</div>
<div class="modal-footer">
<div class="clipboard-copied-message" style="display: none">
Copied
</div>
<input type="hidden" name="command-data" id="command-data"
value="{{ getCommand(currentFormat, currentRobot) }}">
<button id="copyClipboard" type="button" class="btn btn-primary"
data-clipboard-target="command-data"
<button type="button" class="btn btn-primary"
clipboard-copy="#command-data"
ng-show="getCommand(currentFormat, currentRobot)">Copy Command</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>