#415 recitation types in client

This commit is contained in:
Hamid Reza Mohammadi 2023-12-11 16:47:09 +03:30
parent 36c7ebb8dd
commit cbdb8e60c3
30 changed files with 64 additions and 44 deletions

View File

@ -14,7 +14,7 @@
<meta name="robots" content="noindex, nofollow" />
<title>پیشنهاد اضافه شدن مصرع‌های جا افتاده</title>
<script src="/lib/jquery/dist/jquery.min.js"></script>
<link href="/css/p8.css?version=64" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=65" rel="stylesheet" type="text/css" />
<style>
label {
width: 100px;

View File

@ -15,7 +15,7 @@
گنجور » نمایش خوانش
</title>
<link href="~/dist/skin/pink.flag/css/jplayer.pink.flag.min.css" rel="stylesheet" type="text/css" />
<link href="~/css/p8.css?version=64" rel="stylesheet" type="text/css" />
<link href="~/css/p8.css?version=65" 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>
@ -150,7 +150,7 @@
</p>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/js/bk.js?version=44"></script>
<script src="~/js/bk.js?version=45"></script>
<script src="~/js/jplayersupport.js"></script>
<script src="~/js/vaabd.js?version=6"></script>
<script src="~/dist/jplayer/jquery.jplayer.min.js"></script>

View File

@ -16,7 +16,7 @@
<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 src="/js/bk.js?version=44"></script>
<script src="/js/bk.js?version=45"></script>
<script>
var cookieValue = getCookie("playerScrollLock");
var playerScrollLock = cookieValue === "true";

View File

@ -11,7 +11,7 @@
<title>انتخاب قطعهٔ موسیقی مرتبط با شعر از بیپتونز</title>
<meta name="robots" content="noindex, nofollow" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link href="/css/p8.css?version=64" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=65" rel="stylesheet" type="text/css" />
<link href="/css/spotify.css" rel="stylesheet" type="text/css" />
<script src="/lib/jquery/dist/jquery.min.js"></script>

View File

@ -14,7 +14,7 @@
@ViewData["Title"]
</title>
<link href="/css/p8.css?version=64" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=65" 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" />

View File

@ -16,7 +16,7 @@
<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 src="/js/bk.js?version=44"></script>
<script src="/js/bk.js?version=45"></script>
<script>
var cookieValue = getCookie("playerScrollLock");
var playerScrollLock = cookieValue === "true";

View File

@ -10,7 +10,7 @@
<title>انتخاب قطعه‌ای از برنامهٔ گلها مرتبط با این شعر</title>
<meta name="robots" content="noindex, nofollow" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link href="/css/p8.css?version=64" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=65" rel="stylesheet" type="text/css" />
<link href="/css/spotify.css" rel="stylesheet" type="text/css" />
<script src="/lib/jquery/dist/jquery.min.js"></script>
<script src="~/js/golha.js"></script>

View File

@ -18,7 +18,7 @@
<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 src="/js/bk.js?version=44"></script>
<script src="/js/bk.js?version=45"></script>
<script>
var cookieValue = getCookie("playerScrollLock");
var playerScrollLock = cookieValue === "true";

View File

@ -12,11 +12,11 @@
<title>
@Html.Raw(ViewData["Title"])
</title>
<link href="/css/p8.css?version=64" rel="stylesheet" type="text/css">
<link href="/css/p8.css?version=65" 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 src="/js/bk.js?version=44"></script>
<script src="/js/bk.js?version=45"></script>
<script>
var cookieValue = getCookie("playerScrollLock");
var playerScrollLock = cookieValue === "true";

View File

@ -101,7 +101,8 @@ namespace GanjooRazor.Pages
LoggedIn = LoggedIn,
Recitations = recitations.Where(a => a.RecitationType == recitationType).ToArray(),
ShowAllRecitaions = minimumControls ? true : ShowAllRecitaions,
CategoryMode = minimumControls
CategoryMode = minimumControls,
RecitationType = recitationType,
};
}

View File

@ -13,7 +13,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noindex, nofollow" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link href="/css/p8.css?version=64" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=65" rel="stylesheet" type="text/css" />
</head>
<body class="bk-background">
<div id="hdr">

View File

@ -12,7 +12,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="سخنوران و نویسندگان گنجور روی نقشهٔ جغرافیایی" />
<meta charset="utf-8" />
<link href="/css/p8.css?version=64" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=65" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="/css/leaflet.css" />
<style>
.leaflet-container {
@ -23,7 +23,7 @@
font-family: 'Vazir'
}
</style>
<script src="/js/bk.js?version=44"></script>
<script src="/js/bk.js?version=45"></script>
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="~/js/leaflet.js"></script>
<script src="~/js/leaflet-providers.js"></script>

View File

@ -15,7 +15,7 @@
<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 src="/js/bk.js?version=44"></script>
<script src="/js/bk.js?version=45"></script>
<script>
var cookieValue = getCookie("playerScrollLock");
var playerScrollLock = cookieValue === "true";

View File

@ -11,7 +11,7 @@
<title>پیشنهاد شعر مرتبط با تصویر</title>
<meta name="robots" content="noindex, nofollow" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link href="/css/p8.css?version=64" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=65" rel="stylesheet" type="text/css" />
<link href="/css/spotify.css" rel="stylesheet" type="text/css" />
<script src="/lib/jquery/dist//jquery.min.js"></script>

View File

@ -12,7 +12,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noindex, nofollow" />
<title>اطلاعات رتبه‌بندی خوانش‌های شعر</title>
<link href="/css/p8.css?version=64" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=65" rel="stylesheet" type="text/css" />
</head>
<body>

View File

@ -11,7 +11,7 @@
<meta name="robots" content="noindex, nofollow" />
<title>درخواست حذف حاشیه</title>
<script src="/lib/jquery/dist/jquery.min.js"></script>
<link href="/css/p8.css?version=64" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=65" rel="stylesheet" type="text/css" />
<style>
label {
width: 100px;

View File

@ -13,7 +13,7 @@
<meta name="robots" content="noindex, nofollow" />
<title>گنجور » گزارش خطا در خوانش</title>
<script src="/lib/jquery/dist/jquery.min.js"></script>
<link href="/css/p8.css?version=64" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=65" rel="stylesheet" type="text/css" />
<link href="~/dist/skin/pink.flag/css/jplayer.pink.flag.min.css" rel="stylesheet" type="text/css" />
<style>
label {
@ -238,7 +238,7 @@
<script src="~/js/bk.js?version=44"></script>
<script src="~/js/bk.js?version=45"></script>
<script src="~/js/jplayersupport.js"></script>
<script src="~/js/vaabd.js?version=6"></script>
<script src="~/dist/jplayer/jquery.jplayer.min.js"></script>

View File

@ -21,7 +21,7 @@
<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 src="/js/bk.js?version=44"></script>
<script src="/js/bk.js?version=45"></script>
<script>
var cookieValue = getCookie("playerScrollLock");
var playerScrollLock = cookieValue === "true";

View File

@ -35,7 +35,7 @@
});
</script>
<script src="/js/bk.js?version=44"></script>
<script src="/js/bk.js?version=45"></script>
<script>
function editBanner(bannerId) {
var url = '?handler=Edit';

View File

@ -32,7 +32,7 @@
});
</script>
<script src="/lib/diff.js"></script>
<script src="/js/bk.js?version=44"></script>
<script src="/js/bk.js?version=45"></script>
<script>
function compareCorrectionBlocks(originalElemenyId, editedElementId, resultElementId) {
var a = document.getElementById(originalElemenyId);

View File

@ -17,7 +17,7 @@
<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 src="/js/bk.js?version=44"></script>
<script src="/js/bk.js?version=45"></script>
<script>
var cookieValue = getCookie("playerScrollLock");
var playerScrollLock = cookieValue === "true";

View File

@ -18,7 +18,7 @@
<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 src="/js/bk.js?version=44"></script>
<script src="/js/bk.js?version=45"></script>
<script>
var cookieValue = getCookie("playerScrollLock");
var playerScrollLock = cookieValue === "true";

View File

@ -9,15 +9,15 @@
{
var recitaion = Model.Recitations[nRecitationIndex];
<div class="@Model.CSSClass(nRecitationIndex)" id="@recitaion.Id">
<audio id="audio-@(nRecitationIndex + 1)" preload="none" controls>
<audio id="audio-@Model.RecitationType-@(nRecitationIndex + 1)" preload="none" controls>
<source src="@recitaion.Mp3Url" title="@($"{recitaion.AudioTitle} به خوانش {recitaion.AudioArtist}")" data-track-number="@(nRecitationIndex + 1)">
مرورگر شما از پخش صدای HTML 5 پشتیبانی نمی‌کند.
</audio>
@if (nRecitationIndex != (Model.Recitations.Length - 1))
{
<script>
document.getElementById('audio-@(nRecitationIndex + 1)').addEventListener("ended", function () {
document.getElementById('audio-@(nRecitationIndex + 2)').play();
document.getElementById('audio-@Model.RecitationType-@(nRecitationIndex + 1)').addEventListener("ended", function () {
document.getElementById('audio-@Model.RecitationType-@(nRecitationIndex + 2)').play();
showAllRecitations();
});
</script>
@ -29,7 +29,7 @@
}
else
{
<a role="button" onclick="document.getElementById('audio-@(nRecitationIndex + 1)').play()" class="actionlink">@recitaion.AudioTitle</a> @Html.Raw(Model.getAudioDesc(recitaion, nRecitationIndex == 0))
<a role="button" onclick="document.getElementById('audio-@Model.RecitationType-@(nRecitationIndex + 1)').play()" class="actionlink">@recitaion.AudioTitle</a> @Html.Raw(Model.getAudioDesc(recitaion, nRecitationIndex == 0))
}
</div>
@ -37,7 +37,7 @@
@if(!Model.CategoryMode)
{
<div class="audio-partial-action-box">
<a role="button" class="w3tooltip cursor-pointer recitation-button" onclick="document.getElementById('audio-@(nRecitationIndex + 1)').play()"><i class="recitation-icons recitation-play"></i><span class="w3tooltiptext">پخش</span></a>
<a role="button" class="w3tooltip cursor-pointer recitation-button" onclick="document.getElementById('audio-@Model.RecitationType-@(nRecitationIndex + 1)').play()"><i class="recitation-icons recitation-play"></i><span class="w3tooltiptext">پخش</span></a>
<a role="button" class="w3tooltip cursor-pointer recitation-button" href="@($"/AudioClip/?a={recitaion.Id}")" onclick="wpopen(this.href); return false"><i class="recitation-icons recitation-download"></i><span class="w3tooltiptext">دریافت خوانش</span></a>
<a role="button" class="w3tooltip cursor-pointer recitation-button" href="@($"/ReportRecitation/?a={recitaion.Id}")" onclick="wpopen(this.href); return false"><i class="recitation-icons recitation-report"></i><span class="w3tooltiptext">گزارش خطا</span></a>
@if (Model.LoggedIn)
@ -71,8 +71,8 @@
</div>
}
<script>
document.getElementById('audio-@(nRecitationIndex + 1)').addEventListener('play', () => {
currentAudio = document.getElementById('audio-@(nRecitationIndex + 1)');
document.getElementById('audio-@Model.RecitationType-@(nRecitationIndex + 1)').addEventListener('play', () => {
currentAudio = document.getElementById('audio-@Model.RecitationType-@(nRecitationIndex + 1)');
var audioList = document.querySelectorAll('audio');
audioList.forEach(function (audioElement) {
if (audioElement != currentAudio) {
@ -83,8 +83,8 @@
_setXml('@($"{GanjooRazor.APIRoot.InternetUrl}/api/audio/file/{recitaion.Id}.xml")');
});
document.getElementById('audio-@(nRecitationIndex + 1)').addEventListener('timeupdate', () => {
_trackTimeChanged(document.getElementById('audio-@(nRecitationIndex + 1)'));
document.getElementById('audio-@Model.RecitationType-@(nRecitationIndex + 1)').addEventListener('timeupdate', () => {
_trackTimeChanged(document.getElementById('audio-@Model.RecitationType-@(nRecitationIndex + 1)'));
});
</script>
}
@ -93,7 +93,7 @@
@if (!Model.ShowAllRecitaions && nRecitationIndex == 4 && Model.Recitations.Length > 5)
{
<a role="button" class="pagebutton" id="load-all-recitations" onclick="showAllRecitations()">همهٔ خوانش‌ها<i class="info-buttons">autorenew</i></a>
<a role="button" class="pagebutton" id="load-all-recitations-@Model.RecitationType" onclick="showAllRecitations('load-all-recitations-@Model.RecitationType')">همهٔ خوانش‌ها<i class="info-buttons">autorenew</i></a>
}
}
<script>

View File

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
using RMuseum.Models.GanjoorAudio;
using RMuseum.Models.GanjoorAudio.ViewModels;
namespace GanjooRazor.Pages
@ -9,6 +10,7 @@ namespace GanjooRazor.Pages
public PublicRecitationViewModel[] Recitations { get; set; }
public bool ShowAllRecitaions { get; set; }
public bool CategoryMode { get; set; }
public RecitationType RecitationType { get; set; }
public string getAudioDesc(PublicRecitationViewModel recitation, bool contributionLink = false)
{

View File

@ -606,11 +606,11 @@
if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any())
{
<div class="related-images-frame" id="commantaries">
<div class="related-images-frame" id="commentaries">
<div class="century">
@(Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Count() > 1 ? "شرح‌‌های صوتی" : "شرح صوتی") <a role="button" class="w3tooltip cursor-pointer" onclick="switch_section('commantaries-section', 'commantaries-collapse-button')"><i class="info-buttons expand_circle_down" id="commantaries-collapse-button"></i><span class="w3tooltiptext">جمع شود / باز شود</span></a>
@(Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Count() > 1 ? "شرح‌‌های صوتی" : "شرح صوتی") <a role="button" class="w3tooltip cursor-pointer" onclick="switch_section('commentaries-section', 'commentaries-collapse-button')"><i class="info-buttons expand_circle_down" id="commentaries-collapse-button"></i><span class="w3tooltiptext">جمع شود / باز شود</span></a>
</div>
<div id="commantaries-section">
<div id="commentaries-section">
<partial name="_AudioPlayerPartial" model=@Model.GetRecitationsModel(Model.GanjoorPage.Poem.Recitations, false, RMuseum.Models.GanjoorAudio.RecitationType.Commentary) />
</div>
</div>

View File

@ -141,7 +141,7 @@
@if
(
(Model.GanjoorPage != null && Model.GanjoorPage.Poem != null && Model.GanjoorPage.Poem.Recitations.Length > 0)
(Model.GanjoorPage != null && Model.GanjoorPage.Poem != null && Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any())
||
(Model.CategoryHasRecitations)
)
@ -154,6 +154,19 @@
</a>
}
@if
(
Model.GanjoorPage != null && Model.GanjoorPage.Poem != null && Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()
)
{
<a href="#commentaries" role="button" class="w3tooltip cursor-pointer">
<div class="circled-number">
<i class="noindent-info-button commentary-listen"></i>
</div>
<span class="w3tooltiptext">شرح‌های صوتی</span>
</a>
}
@if
(
(Model.CategoryPoemGeoDateTags != null && Model.CategoryPoemGeoDateTags.Length > 0)

View File

@ -14,7 +14,7 @@
@ViewData["Title"]
</title>
<link href="/css/p8.css?version=64" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=65" 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" />

View File

@ -15,7 +15,7 @@
@ViewData["Title"]
</title>
<link href="/css/p8.css?version=64" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=65" 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" />

View File

@ -1513,6 +1513,10 @@ audio {
content: 'hearing';
}
.commentary-listen::after {
content: 'spatial_audio_off';
}
.recitation-comments::after {
content: 'question_answer';
}

View File

@ -905,12 +905,12 @@ function loadMoreRelatedFromPoet(poetId, rhythm, rhymeLetters, skipPoemFullUrl1,
});
}
function showAllRecitations() {
function showAllRecitations(buttonId) {
const hiddenRecitations = document.querySelectorAll('.hidden-recitation');
hiddenRecitations.forEach(function (recitation) {
recitation.className = 'audio-player';
});
document.getElementById('load-all-recitations').style.display = 'none';
document.getElementById(buttonId).style.display = 'none';
}
function switch_section(sectionId, buttonId) {