Ability to 'Share' a watch by a generated link, this will include all filters and triggers - see Wiki (#563)

This commit is contained in:
dgtlmoon
2022-04-26 10:52:08 +02:00
committed by GitHub
parent b3a115dd4a
commit 06517bfd22
11 changed files with 311 additions and 26 deletions

View File

@@ -3,4 +3,22 @@ $(function () {
$('.diff-link').click(function () {
$(this).closest('.unviewed').removeClass('unviewed');
});
$('.with-share-link > *').click(function () {
$("#copied-clipboard").remove();
var range = document.createRange();
var n=$("#share-link")[0];
range.selectNode(n);
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);
document.execCommand("copy");
window.getSelection().removeAllRanges();
$('.with-share-link').append('<span style="font-size: 80%; color: #fff;" id="copied-clipboard">Copied to clipboard</span>');
$("#copied-clipboard").fadeOut(2500, function() {
$(this).remove();
});
});
});