Skip to content

Commit

Permalink
Web archive: Copy permalink of the message to clipboard.
Browse files Browse the repository at this point in the history
Note: Rebuilding archives is needed to activate this in the past archives.
  • Loading branch information
ikedas committed Jul 14, 2022
1 parent f71f5ce commit 9b08300
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
12 changes: 11 additions & 1 deletion default/mhonarc_rc.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,17 @@ MSGPGEND

<TOPLINKS>
<div id="ActionHeader">
<div class="text_center"><h2><% subtitle %></h2></div><br />
<div class="text_center">
<h2>
<% subtitle %>
<a class="copyLinkOnClick" tabindex="0" style="cursor:pointer;"
title="<% 'Copy permalink' | loc %>"
href="<%'arcsearch_id'|url_abs([list,archive_name,'$MSGID$'])%>"
aria-label="<% 'Copy permalink' | loc %>">
<i class="fa fa-link"></i>
</a>
</h2>
</div>
<span class="search_form">
<a class="ArcMenuLinksSortInactive" href="$IDXFNAME$#$MSGNUM$">
<%|loc%>Chronological<% END %>
Expand Down
13 changes: 13 additions & 0 deletions www/js/sympa.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,16 @@ $(function() {
});
});

/* Copy link on click. */
$(function(){
$('.copyLinkOnClick').on('click', function(){
var ta = $('<textarea></textarea>');
ta.text($(this).attr('href'));
$(this).append(ta);
ta.select();
document.execCommand('copy');
ta.remove();
return false;
});
});

0 comments on commit 9b08300

Please sign in to comment.