docs: #339 adding a cookie for lineNumbers

This commit is contained in:
Hamid Reza Mohammadi 2022-07-04 19:57:41 +04:30
parent 3f04a56f51
commit dd3311b2a4
2 changed files with 9 additions and 2 deletions

View File

@ -23,6 +23,9 @@
cookieValue = getCookie("stickyEnabled");
var stickyEnabled = cookieValue != "false";
cookieValue = getCookie("lineNumbers");
var lineNumbers = cookieValue != "false";
</script>
@if (Model.GanjoorPage != null && Model.GanjoorPage.NoIndex)
@ -42,7 +45,9 @@
<script>
$(document).ready(function() {
checkWebShareSupport();
btshmr(@Model.GanjoorPage.Id);
if (lineNumbers) {
btshmr(@Model.GanjoorPage.Id);
}
checkIfBookmarked(@Model.GanjoorPage.Id);
});
</script>
@ -244,7 +249,7 @@
}
}
}

View File

@ -92,6 +92,7 @@ function btshmr_internal(poemId) {
bnumdiv[i].remove();
}
document.getElementById("bnum-button").innerHTML = 'شماره‌گذاری<i class="info-buttons" id="format_list_numbered_rtl">format_list_numbered_rtl</i>';
setCookie("lineNumbers", "false", 365);
return true;
}
document.getElementById("bnum-button").innerHTML = 'حذف شماره‌ها<i class="info-buttons" id="format_list_numbered_rtl">format_list_numbered_rtl</i>';
@ -118,6 +119,7 @@ function btshmr_internal(poemId) {
j = 0;
}
}
setCookie("lineNumbers", "true", 365);
return true;
}