This commit is contained in:
Hamid Reza Mohammadi 2024-07-16 10:46:15 +03:30
parent a061710dac
commit 39590cef27
6 changed files with 625 additions and 647 deletions

View File

@ -304,45 +304,11 @@
@if ((Model.IsCatPage || Model.IsPoetPage) && Model.CategoryHasRecitations)
{
<script>
loadCatRecitations(@Model.GanjoorPage.PoetOrCat.Cat.Id)
setTimeout(() => {
loadCatRecitations(@Model.GanjoorPage.PoetOrCat.Cat.Id), 5000);
</script>
}
@if(Model.IsCatPage || Model.IsPoetPage)
{
<script>
function asyncStartupLoadWordCounts() {
return new Promise((resolve, reject) => {
// Simulate a long running task
setTimeout(() => {
loadWordCounts(@Model.GanjoorPage.PoetOrCat.Cat.Id, @Model.GanjoorPage.PoetOrCat.Poet.Id, false)
}, 100);
});
}
asyncStartupLoadWordCounts();
</script>
}
@if (Model.GanjoorPage != null && Model.GanjoorPage.Id == 39401)
{
<script>
function asyncStartupLoadWordCounts() {
return new Promise((resolve, reject) => {
// Simulate a long running task
setTimeout(() => {
loadWordCounts(0, 0, false)
}, 100);
});
}
asyncStartupLoadWordCounts();
</script>
}
</body>
</html>

View File

@ -857,11 +857,15 @@ namespace GanjooRazor.Pages
CategoryPoemGeoDateTags = JsonConvert.DeserializeObject<PoemGeoDateTag[]>(await tagsResponse.Content.ReadAsStringAsync());
}
if (IsCatPage || IsPoetPage || (GanjoorPage != null && GanjoorPage.Id == 39401) )
{
CategoryWordsCounts = await _GetCategoryWordCountsAsync(GanjoorPage.PoetOrCat == null ? 0 : GanjoorPage.PoetOrCat.Cat.Id, GanjoorPage.PoetOrCat == null ? 0 : GanjoorPage.PoetOrCat.Poet.Id, false);
}
return Page();
}
public async Task<ActionResult> OnGetBNumPartialAsync(int poemId, int coupletIndex)
{
var responseCoupletComments = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/poem/{poemId}/comments?coupletIndex={coupletIndex}");

View File

@ -54,7 +54,9 @@ namespace GanjooRazor.Pages
public PoemGeoDateTag[] CategoryPoemGeoDateTags { get; set; }
public bool CategoryHasRecitations { get; set; }
public _CategoryWordsCountPartialModel CategoryWordsCounts { get; set; }
/// <summary>
/// logout
/// </summary>

View File

@ -11,7 +11,7 @@
</div>
<div id="wordcounts-section">
<p>
در متن @Model.ThisPart @RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.TotalWordCount) واژه را شمرده‌ایم (در تعریفمان از واژه ایرادات جدی وجود دارد، <a href="https://blog.ganjoor.net/1403/04/06/words-frequency/" target="_blank">اینجا</a> را ببینید). شمار واژگان یاد شده به شکل غیرتکراری برابر با @RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.UniqueWordCount) واژه است.
در متن @Model.ThisPart @RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.TotalWordCount) واژه را شمرده‌ایم (در تعریفمان از <i>واژه</i> ایرادات جدی وجود دارد، <a href="https://blog.ganjoor.net/1403/04/06/words-frequency/" target="_blank">اینجا</a> را ببینید). شمار واژگان یاد شده به شکل غیرتکراری برابر با @RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.UniqueWordCount) واژه است.
</p>
@if(Model.RemStopWords)
{

File diff suppressed because it is too large Load Diff

View File

@ -149,7 +149,7 @@
آمار
</span>
</a>
<a href="#wordcounts-placeholder" role="button" class="w3tooltip cursor-pointer" id="percent-button" style="display:none">
<a href="#wordcounts-placeholder" role="button" class="w3tooltip cursor-pointer" id="percent-button" style="@(Model.CategoryWordsCounts == null ?"display:none" : "")">
<div class="circled-number">
<svg class="noindent-info-button" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#5f6368"><g><rect fill="none" height="24" width="24" /></g><g><g><g><path d="M7.5,4C5.57,4,4,5.57,4,7.5S5.57,11,7.5,11S11,9.43,11,7.5S9.43,4,7.5,4z M7.5,9C6.67,9,6,8.33,6,7.5S6.67,6,7.5,6 S9,6.67,9,7.5S8.33,9,7.5,9z M16.5,13c-1.93,0-3.5,1.57-3.5,3.5s1.57,3.5,3.5,3.5s3.5-1.57,3.5-3.5S18.43,13,16.5,13z M16.5,18 c-0.83,0-1.5-0.67-1.5-1.5s0.67-1.5,1.5-1.5s1.5,0.67,1.5,1.5S17.33,18,16.5,18z M5.41,20L4,18.59L18.59,4L20,5.41L5.41,20z" /></g></g></g></svg>
</div>