257 lines
8.6 KiB
Plaintext
257 lines
8.6 KiB
Plaintext
@page
|
|
@model IndexModel
|
|
@{
|
|
Layout = null;
|
|
}
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="@Model.HtmlLanguage" dir="rtl">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title>
|
|
@Html.Raw(ViewData["Title"])
|
|
</title>
|
|
<link href="/css/p8.css?version=44" rel="stylesheet" type="text/css" />
|
|
<link href="/css/fab.css" rel="stylesheet" type="text/css" />
|
|
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
|
|
<link rel="search" type="application/opensearchdescription+xml" title="گنجور" href="https://ganjoor.net/search.xml" />
|
|
<script src="/lib/jquery/dist/jquery.min.js"></script>
|
|
<script>
|
|
var playerScrollLock = false;
|
|
</script>
|
|
<script src="/js/bk.js?version=29"></script>
|
|
|
|
@if(Model.GanjoorPage != null && Model.GanjoorPage.NoIndex)
|
|
{
|
|
<meta name="robots" content="noindex, nofollow" />
|
|
}
|
|
|
|
@if (Model.IsHomePage)
|
|
{
|
|
<meta name="description" content="جستجو در شعر فارسی" />
|
|
}
|
|
else
|
|
{
|
|
<link rel="canonical" href="@Model.CanonicalUrl" />
|
|
if (Model.IsPoemPage)
|
|
{
|
|
<script>
|
|
$(document).ready(function () {
|
|
checkWebShareSupport();
|
|
btshmr(@Model.GanjoorPage.Id);
|
|
checkIfBookmarked(@Model.GanjoorPage.Id);
|
|
});
|
|
</script>
|
|
|
|
}
|
|
<script type="application/ld+json">
|
|
{
|
|
@Html.Raw(@ViewData["BrearCrumpList"])
|
|
}
|
|
</script>
|
|
}
|
|
|
|
</head>
|
|
<body>
|
|
<script src="/js/vaabd.js?version=2"></script>
|
|
|
|
@if (Model.IsPoemPage)
|
|
{
|
|
if (Model.GanjoorPage != null && Model.GanjoorPage.Poem.Recitations.Length > 0)
|
|
{
|
|
<script>
|
|
var currentAudio = null;
|
|
var verseStart = [];
|
|
var verseEnd = [];
|
|
var verseIndex = [];
|
|
var nLastHighlight = -1;
|
|
var vCount = 0;
|
|
|
|
var _setXml = function (xmlUrl) {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: xmlUrl,
|
|
dataType: "xml",
|
|
success: function (xml) {
|
|
var nOneSecondBugFix = 2000;
|
|
$(xml).find('OneSecondBugFix').each(function () {
|
|
nOneSecondBugFix = parseInt($(xml).find('OneSecondBugFix').text());
|
|
});
|
|
var v = 0;
|
|
$(xml).find('SyncInfo').each(function () {
|
|
verseStart[v] = parseInt($(this).find('AudioMiliseconds').text()) / nOneSecondBugFix;
|
|
verseIndex[v] = parseInt($(this).find('VerseOrder').text());
|
|
if (v > 0)
|
|
verseEnd[v - 1] = verseStart[v];
|
|
v++;
|
|
});
|
|
v--;
|
|
if (v > 1)
|
|
verseEnd[v] = verseStart[v] + 2 * (verseEnd[v - 1] - verseStart[v - 1]);
|
|
vCount = v;
|
|
}
|
|
});
|
|
}
|
|
|
|
var _trackTimeChanged = function (audio) {
|
|
var currentTime = audio.currentTime;
|
|
|
|
if (currentTime > 0) {
|
|
for (var i = 0; i <= vCount; i++) {
|
|
if (currentTime >= verseStart[i] && currentTime <= verseEnd[i]) {
|
|
hilightverse(verseIndex[i], "red", true, playerScrollLock);
|
|
|
|
if (nLastHighlight != verseIndex[i] && nLastHighlight != -1)
|
|
hilightverse(nLastHighlight, "black", false, false);
|
|
nLastHighlight = verseIndex[i];
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<script>
|
|
var narrators = [];
|
|
var audioxmlfiles = [];
|
|
@foreach (var recitation in Model.GanjoorPage.Poem.Recitations)
|
|
{
|
|
<text>
|
|
narrators.push('@Html.Raw(recitation.AudioArtist)');
|
|
audioxmlfiles.push('@($"{GanjooRazor.APIRoot.InternetUrl}/api/audio/file/{recitation.Id}.xml")');
|
|
</text>
|
|
}
|
|
</script>
|
|
}
|
|
}
|
|
|
|
@if (Model.IsHomePage)
|
|
{
|
|
@if (!string.IsNullOrEmpty(Model.LastError))
|
|
{
|
|
<div class="poem">
|
|
@Model.LastError
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<partial name="_HomePagePartial" model="Model" />
|
|
}
|
|
}
|
|
else
|
|
{
|
|
<partial name="_GanjoorPagePartial" model="Model" />
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@{
|
|
if (!string.IsNullOrEmpty(Model.PinterestUrl))
|
|
{
|
|
<script>
|
|
$(function () {
|
|
$("a").attr('href', function (i, h) {
|
|
if (h != null) {
|
|
return h + (h.indexOf('?') != -1 ? "&pinterest_url=@Html.Raw(Model.PinterestUrl)" : "?pinterest_url=@Html.Raw(Model.PinterestUrl)");
|
|
}
|
|
return h;
|
|
});
|
|
});
|
|
</script>
|
|
}
|
|
}
|
|
|
|
@if (Model.IsPoemPage)
|
|
{
|
|
<script src="/lib/tinymce/tinymce.min.js"></script>
|
|
<script>
|
|
var userNotifiedOnEditInsteadOfComment = false;
|
|
|
|
function createInformationNotification() {
|
|
tinymce.activeEditor.notificationManager.open({
|
|
text: 'تمنا میکنیم که به جای گوشزد کردن خطاهای املایی و تایپی در حاشیهها از دکمهٔ «ویرایش» استفاده کنید و خطا را تصحیح کنید.',
|
|
type: 'info'
|
|
});
|
|
}
|
|
|
|
tinymce.init({
|
|
selector: 'textarea.editor',
|
|
language: 'fa_IR',
|
|
menubar: false,
|
|
plugins: 'link paste image',
|
|
toolbar: 'undo redo | alignleft aligncenter alignright alignjustify | link',
|
|
paste_auto_cleanup_on_paste: true,
|
|
paste_remove_styles: true,
|
|
paste_remove_styles_if_webkit: true,
|
|
paste_strip_class_attributes: true,
|
|
a11y_advanced_options: true,
|
|
setup: function(editor) {
|
|
editor.on('tap', function(e) {
|
|
if(userNotifiedOnEditInsteadOfComment == false){
|
|
userNotifiedOnEditInsteadOfComment = true;
|
|
createInformationNotification();
|
|
}
|
|
},
|
|
);
|
|
editor.on('click', function(e) {
|
|
if(userNotifiedOnEditInsteadOfComment == false){
|
|
userNotifiedOnEditInsteadOfComment = true;
|
|
createInformationNotification();
|
|
}
|
|
},
|
|
);
|
|
},
|
|
});
|
|
</script>
|
|
}
|
|
@if (!string.IsNullOrEmpty(ViewData["GoogleAnalyticsCode"].ToString()))
|
|
{
|
|
<script>
|
|
(function (i, s, o, g, r, a, m) {
|
|
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
|
|
(i[r].q = i[r].q || []).push(arguments)
|
|
}, i[r].l = 1 * new Date(); a = s.createElement(o),
|
|
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
|
|
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
|
|
|
|
ga('create', '@ViewData["GoogleAnalyticsCode"]', 'auto');
|
|
ga('send', 'pageview');
|
|
|
|
</script>
|
|
}
|
|
|
|
@if (Model.LoggedIn)
|
|
{
|
|
if (Model.IsPoemPage)
|
|
{
|
|
if (Model.GanjoorPage.Poem.Recitations.Length > 0)
|
|
{
|
|
<script>
|
|
MarkUserUpvotedRecitations(@Model.GanjoorPage.Id);
|
|
</script>
|
|
}
|
|
|
|
if (Model.KeepHistory)
|
|
{
|
|
<script>
|
|
AddToMyHistory(@Model.GanjoorPage.Id);
|
|
</script>
|
|
}
|
|
}
|
|
|
|
if (Model.IsHomePage)
|
|
{
|
|
<script>
|
|
CheckIfHasNotificationsForHomePage();
|
|
</script>
|
|
}
|
|
}
|
|
|
|
</body>
|
|
</html>
|
|
|
|
|