Skip to content

Commit

Permalink
Added copy lint name button to lint list
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-nagel committed Feb 25, 2022
1 parent 7b2896a commit a7fc3a3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions util/gh-pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ <h2 class="panel-title">
<div class="panel-title-name">
<span>{{lint.id}}</span>
<a href="#{{lint.id}}" class="anchor label label-default" ng-click="open[lint.id] = true; $event.stopPropagation()">&para;</a>
<a href="" class="anchor label label-default" title="Copy to clipboard" ng-click="copyToClipboard(lint); $event.stopPropagation()">&#128203;</a>
</div>

<div class="panel-title-addons">
Expand Down Expand Up @@ -499,6 +500,11 @@ <h2 class="panel-title">
return true;
}

$scope.copyToClipboard = function (lint) {
navigator.clipboard.writeText(lint.id);
alert('Copied `' + lint.id + '` to clipboard!');
}

// Get data
$scope.open = {};
$scope.loading = true;
Expand Down

0 comments on commit a7fc3a3

Please sign in to comment.