#216 copy link to current couplet
This commit is contained in:
parent
9f2a7e4f22
commit
504d551e0b
@ -11,6 +11,7 @@
|
||||
</script>
|
||||
|
||||
<div style="width: 100%; clear: both; background-color: #300;">
|
||||
<a role="button" class="w3tooltip" id="copylink-@Model.CoupletIndex" style="cursor: pointer;" onclick="copyCoupletUrl(@Model.CoupletIndex)"><i class="material-icons" style="color:white;">link</i><span class="w3tooltiptext" id="copylink-tooltip-@Model.CoupletIndex">رونوشت نشانی</span></a>
|
||||
<a role="button" id="share-@Model.CoupletIndex" style="cursor: pointer;" onclick="webShareCouplet(@Model.CoupletIndex)" title="همرسانی"><i class="material-icons" style="color:white;">share</i></a>
|
||||
@if (Model.LoggedIn)
|
||||
{
|
||||
|
||||
@ -350,9 +350,8 @@
|
||||
{
|
||||
<text> | <small>منبع اولیه: <a href="@Html.Raw($"/sources/{Model.GanjoorPage.Poem.SourceUrlSlug}/")">@Html.Raw(Model.GanjoorPage.Poem.SourceName)</a></small></text>
|
||||
}
|
||||
<span id="copylink_span" class="w3tooltip"> | <a role="button" id="copylink" style="cursor: pointer;" onclick="copyPoemLink()"><i class="pageicons" id="copylink-icon">link</i></a><span class="w3tooltiptext" id="copylink-tooltip">رونوشت نشانی</span></span>
|
||||
<span id="share_span"> | <a role="button" id="share" style="cursor: pointer;" onclick="webSharePoem()" title="همرسانی"><i class="pageicons" id="share-icon">share</i></a></span>
|
||||
| <span id="copylink_span" class="w3tooltip"><a role="button" id="copylink" style="cursor: pointer;" onclick="copyPoemLink()"><i class="pageicons" id="copylink-icon">link</i></a><span class="w3tooltiptext" id="copylink-tooltip">رونوشت نشانی</span></span>
|
||||
|
||||
|
||||
@if (Model.LoggedIn)
|
||||
{
|
||||
|
||||
@ -563,11 +563,25 @@ async function webSharePoem() {
|
||||
|
||||
function copyPoemLink() {
|
||||
var url = window.location.href;
|
||||
if (url.indexOf('#') != -1) {
|
||||
url = url.substring(0, url.indexOf('#'));
|
||||
}
|
||||
navigator.clipboard.writeText(url);
|
||||
var tooltip = document.getElementById("copylink-tooltip");
|
||||
tooltip.innerHTML = "نشانی در حافظه رونوشت شد: " + url;
|
||||
}
|
||||
|
||||
function copyCoupletUrl(coupletIndex) {
|
||||
var url = window.location.href;
|
||||
if (url.indexOf('#') != -1) {
|
||||
url = url.substring(0, url.indexOf('#'));
|
||||
}
|
||||
url += ( '#bn' + String(coupletIndex + 1));
|
||||
navigator.clipboard.writeText(url);
|
||||
var tooltip = document.getElementById("copylink-tooltip-" + String(coupletIndex));
|
||||
tooltip.innerHTML = "نشانی در حافظه رونوشت شد: " + url;
|
||||
}
|
||||
|
||||
async function webShareCouplet(coupletIndex) {
|
||||
var all = $('#bn' + String(coupletIndex + 1)).children();
|
||||
var text = '';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user