405 lines
14 KiB
Plaintext
405 lines
14 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="fa-IR" dir="rtl">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title>
|
|
@Html.Raw(ViewData["Title"])
|
|
</title>
|
|
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
|
<link rel="stylesheet" href="~/css/site.css" />
|
|
<link href="/dist/skin/blue.monday/css/jplayer.blue.monday.min.css" rel="stylesheet" type="text/css" />
|
|
<link href="/css/p8.css?version=25" rel="stylesheet" type="text/css" />
|
|
<link href="/css/fab.css" rel="stylesheet" type="text/css" />
|
|
<link rel="shortcut icon" href="/favicon.ico" 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="/lib/tinymce/tinymce.min.js"></script>
|
|
<script>
|
|
tinymce.init({
|
|
selector: 'textarea.editor',
|
|
language: 'fa_IR',
|
|
menubar: false,
|
|
plugins: 'link paste',
|
|
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,
|
|
});
|
|
</script>
|
|
<script src="/lib/diff.js"></script>
|
|
<script>
|
|
function moderateReportedComment(reportId) {
|
|
if (!confirm('آیا از حذف این حاشیه اطمینان دارید؟'))
|
|
return;
|
|
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
url: '?handler=ModerateComment',
|
|
data: {
|
|
id: reportId,
|
|
},
|
|
success: function () {
|
|
var commentBlockId = '#report-' + reportId;
|
|
$(commentBlockId).remove();
|
|
},
|
|
});
|
|
|
|
}
|
|
|
|
function deleteReport(reportId) {
|
|
$.ajax({
|
|
type: "DELETE",
|
|
url: '?handler=Report',
|
|
data: {
|
|
id: reportId
|
|
},
|
|
success: function () {
|
|
var commentBlockId = '#report-' + reportId;
|
|
$(commentBlockId).remove();
|
|
},
|
|
});
|
|
|
|
}
|
|
|
|
function deleteMyComment(commentId) {
|
|
if (!confirm('آیا از حذف این حاشیه اطمینان دارید؟'))
|
|
return;
|
|
|
|
var url = '?handler=MyComment';
|
|
|
|
$.ajax({
|
|
type: "DELETE",
|
|
url: url,
|
|
data: {
|
|
id: commentId
|
|
},
|
|
success: function () {
|
|
var commentBlockId = '#comment-' + commentId;
|
|
$(commentBlockId).remove();
|
|
},
|
|
});
|
|
|
|
}
|
|
|
|
function deleteNotification(notificationId) {
|
|
if (!confirm('آیا از حذف این اعلان اطمینان دارید؟'))
|
|
return;
|
|
|
|
var url = '?handler=Notification';
|
|
|
|
$.ajax({
|
|
type: "DELETE",
|
|
url: url,
|
|
data: {
|
|
id: notificationId
|
|
},
|
|
success: function () {
|
|
var notificationBlockId = '#notification-' + notificationId;
|
|
$(notificationBlockId).remove();
|
|
},
|
|
});
|
|
}
|
|
|
|
function editMyComment(commentId) {
|
|
var commentTextBlockId = '#comment-text-' + commentId;
|
|
tinymce.get('editCommentText').setContent($(commentTextBlockId).html());
|
|
$("#editCommentId").val(commentId);
|
|
document.getElementById('id02').style.display = 'block';
|
|
}
|
|
|
|
function editComment() {
|
|
$("#editcommentform").unbind('submit').bind('submit', function (e) {
|
|
|
|
e.preventDefault(); // avoid to execute the actual submit of the form.
|
|
|
|
var url = '?handler=MyComment';
|
|
|
|
var commentId = $("#editCommentId").val();
|
|
|
|
|
|
$.ajax({
|
|
type: "PUT",
|
|
url: url,
|
|
data: {
|
|
id: commentId,
|
|
comment: $("textarea#editCommentText").val()
|
|
},
|
|
success: function () {
|
|
document.getElementById('id02').style.display = 'none';
|
|
|
|
var commentTextBlockId = '#comment-text-' + commentId;
|
|
|
|
$(commentTextBlockId).html($("textarea#editCommentText").val());
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
}
|
|
|
|
function rebuildMundex() {
|
|
if (!confirm('آیا از بازسازی صفحات نمایهٔ موسیقی اطمینان دارید؟'))
|
|
return;
|
|
|
|
var url = '?handler=RebuildMundex';
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
url: url,
|
|
error: function () {
|
|
alert('خطا رخ داد.')
|
|
},
|
|
success: function () {
|
|
alert('فرایند بازسازی صفحات نمایهٔ موسیقی شروع شد.')
|
|
},
|
|
|
|
});
|
|
}
|
|
|
|
function cleanMundexCache() {
|
|
if (!confirm('آیا از حذف کش صفحات موسیقی اطمینان دارید؟'))
|
|
return;
|
|
|
|
var url = '?handler=CleanMundexCache';
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
url: url,
|
|
error: function () {
|
|
alert('خطا رخ داد.')
|
|
},
|
|
success: function () {
|
|
alert('کش صفخات پاک شد.')
|
|
},
|
|
|
|
});
|
|
}
|
|
|
|
function editorcompare(id) {
|
|
var a = document.getElementById('original-' + id.toString());
|
|
var b = document.getElementById('id-' + id.toString());
|
|
var result = document.getElementById('compare-' + id.toString());
|
|
var diff = JsDiff.diffChars(a.textContent, b.textContent);
|
|
var fragment = document.createDocumentFragment();
|
|
for (var i = 0; i < diff.length; i++) {
|
|
|
|
if (diff[i].added && diff[i + 1] && diff[i + 1].removed) {
|
|
var swap = diff[i];
|
|
diff[i] = diff[i + 1];
|
|
diff[i + 1] = swap;
|
|
}
|
|
|
|
var node;
|
|
if (diff[i].removed) {
|
|
node = document.createElement('del');
|
|
node.style.color = 'red';
|
|
node.appendChild(document.createTextNode(diff[i].value));
|
|
} else if (diff[i].added) {
|
|
node = document.createElement('span');
|
|
node.style.color = 'white';
|
|
node.style.backgroundColor = 'green';
|
|
node.appendChild(document.createTextNode(diff[i].value));
|
|
} else {
|
|
node = document.createTextNode(diff[i].value);
|
|
}
|
|
fragment.appendChild(node);
|
|
}
|
|
|
|
result.textContent = '';
|
|
result.appendChild(fragment);
|
|
}
|
|
|
|
function deletePoemCorrections(id) {
|
|
if (!confirm('آیا از حذف تغییرات پیشنهادی اطمینان دارید؟'))
|
|
return;
|
|
|
|
$('#deletecorrections').hide();
|
|
$('#saving').text('در حال ذخیره ...');
|
|
|
|
var url = '?handler=DeletePoemCorrections';
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
url: url,
|
|
data: {
|
|
poemid: id,
|
|
},
|
|
error: function () {
|
|
alert('خطا رخ داد.')
|
|
},
|
|
success: function () {
|
|
location.reload(true);
|
|
},
|
|
|
|
});
|
|
}
|
|
|
|
function savePoemCorrections(id, verseCount) {
|
|
|
|
var verseOrderText = [];
|
|
for (var i = 0; i <= verseCount; i++) {
|
|
var oldElementName = '#original-' + i.toString();
|
|
var newElementName = '#id-' + i.toString();
|
|
if ($(newElementName).text() != $(oldElementName).text()) {
|
|
verseOrderText.push(i.toString() + 'TextSeparator' + $(newElementName).text());
|
|
}
|
|
}
|
|
|
|
if (verseOrderText.length == 0) {
|
|
if ($('#rhythm-old').text() == $('#rhythm-new').val()) {
|
|
alert('شما هیچ تغییری در متن ندادهاید!');
|
|
return;
|
|
}
|
|
}
|
|
|
|
$('#savecorrections').hide();
|
|
$('#saving').text('در حال ذخیره ...');
|
|
|
|
var rhythm_new = $('#rhythm-new').val();
|
|
if (rhythm_new == $('#rhythm-old').text()) {
|
|
rhythm_new = null;
|
|
}
|
|
|
|
var url = '?handler=SendPoemCorrections';
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
url: url,
|
|
data: {
|
|
poemid: id,
|
|
verseOrderText: verseOrderText,
|
|
rhythm: rhythm_new,
|
|
note: $('#note').val()
|
|
|
|
},
|
|
success: function () {
|
|
location.reload(true);
|
|
},
|
|
error: function (e) {
|
|
if (e.responseText == null)
|
|
alert(e);
|
|
else
|
|
alert(e.responseText);
|
|
$('#savecorrections').show();
|
|
$('#saving').text('');
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
function breakPoem(poemId, vOrder, vText) {
|
|
if (!confirm(vText))
|
|
return;
|
|
$('#breakpoem-' + String(vOrder)).hide();
|
|
|
|
var url = '?handler=BreakPoem';
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
url: url,
|
|
data: {
|
|
poemId: poemId,
|
|
vOrder: vOrder
|
|
},
|
|
success: function (id) {
|
|
location.href = '/?p=' + String(id);
|
|
},
|
|
error: function (e) {
|
|
if (e.responseText == null)
|
|
alert(e);
|
|
else
|
|
alert(e.responseText);
|
|
$('#breakpoem-' + String(vOrder)).show();
|
|
}
|
|
|
|
});
|
|
}
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<header>
|
|
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
|
<div class="container">
|
|
<a class="navbar-brand" asp-area="" asp-page="/Index" title="گنجور"><img src="/image/gmgk.png" alt="گنجور" style="width:auto;margin:auto;" /></a>
|
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
|
aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
|
|
<ul class="navbar-nav flex-grow-1">
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" asp-area="User" asp-page="/Index">خانه</a>
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" asp-area="User" asp-page="/MyComments">حاشیههای من</a>
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" asp-area="User" asp-page="/MyBookmarks">نشانهای من</a>
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" asp-area="User" asp-page="/Notifications">اعلانهای من</a>
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" asp-area="User" asp-page="/Edits">ویرایشهای من</a>
|
|
</li>
|
|
|
|
@if (ViewData.ContainsKey("ganjoor-songrevu"))
|
|
{
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" asp-area="User" asp-page="/ReviewSongs">آهنگها</a>
|
|
</li>
|
|
}
|
|
|
|
@if (ViewData.ContainsKey("ganjoor-moderate"))
|
|
{
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" asp-area="User" asp-page="/ReportedComments">حاشیههای گزارش شده</a>
|
|
</li>
|
|
}
|
|
|
|
@if (ViewData.ContainsKey($"{RMuseum.Models.Auth.Memory.RMuseumSecurableItem.ArtifactEntityShortName}-{RMuseum.Models.Auth.Memory.RMuseumSecurableItem.ReviewGanjoorLinksOperationShortName}"))
|
|
{
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" asp-area="User" asp-page="/FinalizeImages">نهاییسازی تصاویر</a>
|
|
</li>
|
|
}
|
|
|
|
@if (ViewData.ContainsKey($"{RMuseum.Models.Auth.Memory.RMuseumSecurableItem.GanjoorEntityShortName}-{RMuseum.Models.Auth.Memory.RMuseumSecurableItem.ModifyOperationShortName}"))
|
|
{
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" asp-area="Admin" asp-page="/ReviewEdits">مدیریت</a>
|
|
</li>
|
|
}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
<div class="container">
|
|
<main role="main" class="pb-3">
|
|
@RenderBody()
|
|
</main>
|
|
</div>
|
|
|
|
|
|
|
|
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script src="~/js/site.js" asp-append-version="true"></script>
|
|
|
|
@await RenderSectionAsync("Scripts", required: false)
|
|
</body>
|
|
</html>
|