Skip to content

Commit a7fc3a3

Browse files
committed
Added copy lint name button to lint list
Fixes rust-lang#7959
1 parent 7b2896a commit a7fc3a3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

util/gh-pages/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ <h2 class="panel-title">
322322
<div class="panel-title-name">
323323
<span>{{lint.id}}</span>
324324
<a href="#{{lint.id}}" class="anchor label label-default" ng-click="open[lint.id] = true; $event.stopPropagation()">&para;</a>
325+
<a href="" class="anchor label label-default" title="Copy to clipboard" ng-click="copyToClipboard(lint); $event.stopPropagation()">&#128203;</a>
325326
</div>
326327

327328
<div class="panel-title-addons">
@@ -499,6 +500,11 @@ <h2 class="panel-title">
499500
return true;
500501
}
501502

503+
$scope.copyToClipboard = function (lint) {
504+
navigator.clipboard.writeText(lint.id);
505+
alert('Copied `' + lint.id + '` to clipboard!');
506+
}
507+
502508
// Get data
503509
$scope.open = {};
504510
$scope.loading = true;

0 commit comments

Comments
 (0)