mirror of
https://github.com/openvk/openvk
synced 2024-12-22 16:42:32 +03:00
Fix main problems
This commit is contained in:
parent
187250b22f
commit
67bc9c1bcb
22 changed files with 185 additions and 203 deletions
|
@ -63,6 +63,7 @@ final class MessengerPresenter extends OpenVKPresenter
|
|||
$this->flash("err", tr("warning"), tr("user_may_not_reply"));
|
||||
}
|
||||
|
||||
$this->template->disable_ajax = 1;
|
||||
$this->template->selId = $sel;
|
||||
$this->template->correspondent = $correspondent;
|
||||
}
|
||||
|
|
|
@ -30,6 +30,10 @@
|
|||
{script "js/node_modules/@popperjs/core/dist/umd/popper.min.js"}
|
||||
{script "js/node_modules/tippy.js/dist/tippy-bundle.umd.min.js"}
|
||||
{script "js/node_modules/handlebars/dist/handlebars.min.js"}
|
||||
{script "js/node_modules/react/dist/react-with-addons.min.js"}
|
||||
{script "js/node_modules/react-dom/dist/react-dom.min.js"}
|
||||
{script "js/vnd_literallycanvas.js"}
|
||||
{css "js/node_modules/literallycanvas/lib/css/literallycanvas.css"}
|
||||
|
||||
{if $isTimezoned == NULL}
|
||||
{script "js/timezone.js"}
|
||||
|
@ -393,6 +397,7 @@
|
|||
{script "js/al_comments.js"}
|
||||
{script "js/al_music.js"}
|
||||
{script "js/al_despacito_wall.js"}
|
||||
{script "js/al_photos.js"}
|
||||
|
||||
{ifset $thisUser}
|
||||
{script "js/al_notifs.js"}
|
||||
|
|
|
@ -101,12 +101,6 @@
|
|||
</div>
|
||||
|
||||
<script>
|
||||
async function withdraw(id) {
|
||||
let coins = await API.Apps.withdrawFunds(id);
|
||||
if(coins == 0)
|
||||
MessageBox({_app_withdrawal}, {_app_withdrawal_empty}, ["OK"], [Function.noop]);
|
||||
else
|
||||
MessageBox({_app_withdrawal}, {tr("app_withdrawal_created", $coins)}, ["OK"], [Function.noop]);
|
||||
}
|
||||
window.coins = {$coins}
|
||||
</script>
|
||||
{/block}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
{block header}
|
||||
{$name}
|
||||
<a style="float: right;" onClick="reportApp()" n:if="$canReport ?? false">{_report}</a>
|
||||
<a style="float: right;" onClick="reportApp({$id})" n:if="$canReport ?? false">{_report}</a>
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
|
@ -36,29 +36,5 @@
|
|||
window.appOrigin = {$origin};
|
||||
</script>
|
||||
|
||||
<script n:if="$canReport ?? false">
|
||||
function reportApp() {
|
||||
uReportMsgTxt = {_going_to_report_app};
|
||||
uReportMsgTxt += "<br/>"+tr("report_question_text");
|
||||
uReportMsgTxt += "<br/><br/><b>"+tr("report_reason")+"</b>: <input type='text' id='uReportMsgInput' placeholder='" + tr("reason") + "' />"
|
||||
|
||||
MessageBox(tr("report_question"), uReportMsgTxt, [tr("confirm_m"), tr("cancel")], [
|
||||
(function() {
|
||||
res = document.querySelector("#uReportMsgInput").value;
|
||||
xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "/report/" + {$id} + "?reason=" + res + "&type=app", true);
|
||||
xhr.onload = (function() {
|
||||
if(xhr.responseText.indexOf("reason") === -1)
|
||||
MessageBox(tr("error"), tr("error_sending_report"), ["OK"], [Function.noop]);
|
||||
else
|
||||
MessageBox(tr("action_successfully"), tr("will_be_watched"), ["OK"], [Function.noop]);
|
||||
});
|
||||
xhr.send(null);
|
||||
}),
|
||||
Function.noop
|
||||
]);
|
||||
}
|
||||
</script>
|
||||
|
||||
{script "js/al_games.js"}
|
||||
{/block}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
<a n:if="isset($thisUser)" href="/audios/newPlaylist">{_new_playlist}</a>
|
||||
|
||||
{if !$isMy && $mode !== 'popular' && $mode !== 'new'}
|
||||
{if !$isMy && $mode !== 'popular' && $mode !== 'new' && $mode != 'alone_audio'}
|
||||
<hr>
|
||||
|
||||
<a n:if="!$isMy" n:attr="id => $mode === 'list' ? 'used' : 'ki'" href="/audios{$ownerId}">{if $ownerId > 0}{_music_user}{else}{_music_club}{/if}</a>
|
||||
|
|
|
@ -80,29 +80,6 @@
|
|||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script n:if="$club->getOwner()->getId() != $user->getId() && $manager && $thisUser->getId() == $club->getOwner()->getId()">
|
||||
if(typeof changeOwner == 'undefined') {
|
||||
function changeOwner(club, newOwner) {
|
||||
const action = "/groups/" + club + "/setNewOwner/" + newOwner;
|
||||
|
||||
MessageBox({_group_changeowner_modal_title}, `
|
||||
{tr("group_changeowner_modal_text", htmlentities($user->getFullName()))|noescape}
|
||||
<br/><br/>
|
||||
<form id="transfer-owner-permissions-form" method="post">
|
||||
<label for="password">{_password|noescape}</label>
|
||||
<input type="password" id="password" name="password" required />
|
||||
<input type="hidden" name="hash" value={$csrfToken} />
|
||||
</form>
|
||||
`, [{_transfer}, {_cancel}], [
|
||||
() => {
|
||||
$("#transfer-owner-permissions-form").attr("action", action);
|
||||
document.querySelector("#transfer-owner-permissions-form").submit();
|
||||
}, Function.noop
|
||||
]);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
{block actions}
|
||||
|
@ -117,7 +94,7 @@
|
|||
{/if}
|
||||
</a>
|
||||
{if $club->getOwner()->getId() != $user->getId() && $manager && $thisUser->getId() == $club->getOwner()->getId()}
|
||||
<a class="profile_link" href="javascript:changeOwner({$club->getId()}, {$user->getId()})">
|
||||
<a class="profile_link" href="javascript:changeOwner({$club->getId()}, {$user->getId()}, '{$user->getCanonicalName()}')">
|
||||
{_promote_to_owner}
|
||||
</a>
|
||||
{/if}
|
||||
|
|
|
@ -145,7 +145,7 @@
|
|||
<div n:ifset="$thisUser" id="profile_links">
|
||||
{if $club->canBeModifiedBy($thisUser)}
|
||||
<a href="/club{$club->getId()}/edit" id="profile_link">{_edit_group}</a>
|
||||
<a href="/club{$club->getId()}/stats" id="profile_link">{_statistics}</a>
|
||||
<a href="/club{$club->getId()}/stats" rel="nofollow" id="profile_link">{_statistics}</a>
|
||||
{/if}
|
||||
{if $thisUser->getChandlerUser()->can("access")->model("admin")->whichBelongsTo(NULL)}
|
||||
<a href="/admin/clubs/id{$club->getId()}" id="profile_link">{_manage_group_action}</a>
|
||||
|
@ -168,31 +168,7 @@
|
|||
{/if}
|
||||
{var $canReport = $thisUser->getId() != $club->getOwner()->getId()}
|
||||
{if $canReport}
|
||||
<a class="profile_link" style="display:block;" href="javascript:reportClub()">{_report}</a>
|
||||
|
||||
<script>
|
||||
function reportClub() {
|
||||
uReportMsgTxt = tr("going_to_report_club");
|
||||
uReportMsgTxt += "<br/>"+tr("report_question_text");
|
||||
uReportMsgTxt += "<br/><br/><b>"+tr("report_reason")+"</b>: <input type='text' id='uReportMsgInput' placeholder='" + tr("reason") + "' />"
|
||||
|
||||
MessageBox(tr("report_question"), uReportMsgTxt, [tr("confirm_m"), tr("cancel")], [
|
||||
(function() {
|
||||
res = document.querySelector("#uReportMsgInput").value;
|
||||
xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "/report/" + {$club->getId()} + "?reason=" + res + "&type=group", true);
|
||||
xhr.onload = (function() {
|
||||
if(xhr.responseText.indexOf("reason") === -1)
|
||||
MessageBox(tr("error"), tr("error_sending_report"), ["OK"], [Function.noop]);
|
||||
else
|
||||
MessageBox(tr("action_successfully"), tr("will_be_watched"), ["OK"], [Function.noop]);
|
||||
});
|
||||
xhr.send(null);
|
||||
}),
|
||||
Function.noop
|
||||
]);
|
||||
}
|
||||
</script>
|
||||
<a class="profile_link" style="display:block;" href="javascript:reportClub({$club->getId()})">{_report}</a>
|
||||
{/if}
|
||||
<a n:if="!$club->isHideFromGlobalFeedEnabled()" class="profile_link" style="display:block;" id="__ignoreSomeone" data-val='{!$ignore_status ? 1 : 0}' data-id="{$club->getRealId()}">
|
||||
{if !$ignore_status}{_ignore_club}{else}{_unignore_club}{/if}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
{tr("notes_list", $count)}
|
||||
<span n:if="isset($thisUser) && $thisUser->getId() == $owner->getId()">
|
||||
|
|
||||
<a href="/notes/create">{_create_note}</a>
|
||||
<a href="/notes/create" rel='nofollow'>{_create_note}</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -99,7 +99,7 @@
|
|||
<span n:if="isset($thisUser) && $thisUser->getId() === $dat->getOwner()->getId()"> |
|
||||
<a id="_noteDelete" href="/note{$dat->getOwner()->getId()}_{$dat->getId()}/delete">{_delete}</a>
|
||||
|
|
||||
<a href="/note{$dat->getOwner()->getId()}_{$dat->getVirtualId()}/edit">{_edit}</a>
|
||||
<a href="/note{$dat->getOwner()->getId()}_{$dat->getVirtualId()}/edit" rel='nofollow'>{_edit}</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
<span n:if="isset($thisUser) && $thisUser->getId() === $note->getOwner()->getId()"> |
|
||||
<a id="_noteDelete" href="/note{$note->getOwner()->getId()}_{$note->getId()}/delete">{_delete}</a>
|
||||
|
|
||||
<a href="/note{$note->getOwner()->getId()}_{$note->getVirtualId()}/edit">{_edit}</a>
|
||||
<a href="/note{$note->getOwner()->getId()}_{$note->getVirtualId()}/edit" rel='nofollow'>{_edit}</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<input type="file" accept=".jpg,.png,.gif" name="files[]" multiple class="button" id="uploadButton" style="display:none">
|
||||
<input type="file" accept=".jpg,.png,.gif" name="files[]" multiple class="button photo_ajax_upload_button" id="uploadButton" style="display:none">
|
||||
|
||||
<div class="container_gray" style="min-height: 344px;">
|
||||
<div class="container_gray photo_upload_container" style="min-height: 344px;">
|
||||
<div class="insertThere"></div>
|
||||
<div class="whiteBox" style="display: block;">
|
||||
<div class="boxContent">
|
||||
|
@ -62,7 +62,3 @@
|
|||
uploadButton.value = ''
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
{block bodyScripts}
|
||||
{script "js/al_photos.js"}
|
||||
{/block}
|
||||
|
|
|
@ -86,11 +86,4 @@
|
|||
setupWallPostInputHandlers(1);
|
||||
});
|
||||
</script>
|
||||
|
||||
{if $graffiti}
|
||||
{script "js/node_modules/react/dist/react-with-addons.min.js"}
|
||||
{script "js/node_modules/react-dom/dist/react-dom.min.js"}
|
||||
{script "js/vnd_literallycanvas.js"}
|
||||
{css "js/node_modules/literallycanvas/lib/css/literallycanvas.css"}
|
||||
{/if}
|
||||
{/block}
|
||||
|
|
|
@ -179,17 +179,6 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<script>
|
||||
function toggleMaritalStatus(e) {
|
||||
let elem = $("#maritalstatus-user");
|
||||
$("#maritalstatus-user-select").empty();
|
||||
if ([0, 1, 8].includes(Number(e.value))) {
|
||||
elem.hide();
|
||||
} else {
|
||||
elem.show();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</form>
|
||||
|
||||
{elseif $isContacts}
|
||||
|
|
|
@ -492,30 +492,6 @@
|
|||
<input type="hidden" name="hash" value="{$csrfToken}" />
|
||||
<input type="submit" value="{_redeem}" class="button" />
|
||||
</form>
|
||||
<script>
|
||||
u(".vouncher_input").on("paste", function(event) {
|
||||
const vouncher = event.clipboardData.getData("text");
|
||||
|
||||
let segments;
|
||||
if(vouncher.length === 27) {
|
||||
segments = vouncher.split("-");
|
||||
if(segments.length !== 4)
|
||||
segments = undefined;
|
||||
} else if(vouncher.length === 24) {
|
||||
segments = chunkSubstr(vouncher, 6);
|
||||
}
|
||||
|
||||
if(segments !== undefined) {
|
||||
document.vouncher_form.key0.value = segments[0];
|
||||
document.vouncher_form.key1.value = segments[1];
|
||||
document.vouncher_form.key2.value = segments[2];
|
||||
document.vouncher_form.key3.value = segments[3];
|
||||
document.vouncher_form.key3.focus();
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
});
|
||||
</script>
|
||||
|
||||
{elseif $isInterface}
|
||||
|
||||
|
|
|
@ -113,10 +113,10 @@
|
|||
<a href="javascript:warnUser()" class="profile_link" style="width: 194px;">
|
||||
{_warn_user_action}
|
||||
</a>
|
||||
<a href="/admin/user{$user->getId()}/bans" class="profile_link">
|
||||
<a href="/admin/user{$user->getId()}/bans" class="profile_link" rel="nofollow">
|
||||
{_blocks}
|
||||
</a>
|
||||
<a href="/admin/logs?uid={$user->getId()}" class="profile_link" style="width: 194px;">
|
||||
<a href="/admin/logs?uid={$user->getId()}" class="profile_link" style="width: 194px;" rel="nofollow">
|
||||
{_last_actions}
|
||||
</a>
|
||||
{/if}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
style="width: 100%; image-rendering: -webkit-optimize-contrast;" />
|
||||
</div>
|
||||
<div id="profile_links" n:if="isset($thisUser)">
|
||||
<a style="width: 194px;" n:if="$user->getPrivacyPermission('messages.write', $thisUser)" href="/im?sel={$user->getId()}" class="profile_link">{_send_message}</a>
|
||||
<a style="width: 194px;" n:if="$user->getPrivacyPermission('messages.write', $thisUser)" href="/im?sel={$user->getId()}" class="profile_link" rel='nofollow'>{_send_message}</a>
|
||||
{var $subStatus = $user->getSubscriptionStatus($thisUser)}
|
||||
{if $subStatus === 0}
|
||||
<form action="/setSub/user" method="post" class="profile_link_form" id="addToFriends">
|
||||
|
@ -41,30 +41,7 @@
|
|||
<input type="submit" class="profile_link" value="{_friends_reject}" style="width: 194px;" />
|
||||
</form>
|
||||
{/if}
|
||||
<a class="profile_link" style="display:block;width:96%;" href="javascript:reportUser()">{_report}</a>
|
||||
<script>
|
||||
function reportUser() {
|
||||
uReportMsgTxt = "Вы собираетесь пожаловаться на данного пользователя.";
|
||||
uReportMsgTxt += "<br/>Что именно вам кажется недопустимым в этом материале?";
|
||||
uReportMsgTxt += "<br/><br/><b>Причина жалобы</b>: <input type='text' id='uReportMsgInput' placeholder='Причина' />"
|
||||
|
||||
MessageBox("Пожаловаться?", uReportMsgTxt, ["Подтвердить", "Отмена"], [
|
||||
(function() {
|
||||
res = document.querySelector("#uReportMsgInput").value;
|
||||
xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "/report/" + {$user->getId()} + "?reason=" + res + "&type=user", true);
|
||||
xhr.onload = (function() {
|
||||
if(xhr.responseText.indexOf("reason") === -1)
|
||||
MessageBox("Ошибка", "Не удалось подать жалобу...", ["OK"], [Function.noop]);
|
||||
else
|
||||
MessageBox("Операция успешна", "Скоро её рассмотрят модераторы", ["OK"], [Function.noop]);
|
||||
});
|
||||
xhr.send(null);
|
||||
}),
|
||||
Function.noop
|
||||
]);
|
||||
}
|
||||
</script>
|
||||
<a class="profile_link" style="display:block;width:96%;" href="javascript:reportUser({$user->getId()})">{_report}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
{if $thisUser->getId() != $author->getRealId()}
|
||||
|
|
||||
{var $canReport = true}
|
||||
<a href="javascript:reportComment()">{_report}</a>
|
||||
<a href="javascript:reportComment({$comment->getId()})">{_report}</a>
|
||||
{/if}
|
||||
<div style="float: right; font-size: .7rem;">
|
||||
<a class="post-like-button" href="/comment{$comment->getId()}/like?hash={rawurlencode($csrfToken)}" data-likes='{$likesCount}' data-id="1_{$comment->getPrettyId()}" data-type='comment'>
|
||||
|
@ -82,26 +82,3 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<script n:if="$canReport ?? false">
|
||||
function reportComment() {
|
||||
uReportMsgTxt = tr("going_to_report_comment");
|
||||
uReportMsgTxt += "<br/>"+tr("report_question_text");
|
||||
uReportMsgTxt += "<br/><br/><b>"+tr("report_reason")+"</b>: <input type='text' id='uReportMsgInput' placeholder='" + tr("reason") + "' />"
|
||||
|
||||
MessageBox(tr("report_question"), uReportMsgTxt, [tr("confirm_m"), tr("cancel")], [
|
||||
(function() {
|
||||
res = document.querySelector("#uReportMsgInput").value;
|
||||
xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "/report/" + {$comment->getId()} + "?reason=" + res + "&type=comment", true);
|
||||
xhr.onload = (function() {
|
||||
if(xhr.responseText.indexOf("reason") === -1)
|
||||
MessageBox(tr("error"), tr("error_sending_report"), ["OK"], [Function.noop]);
|
||||
else
|
||||
MessageBox(tr("action_successfully"), tr("will_be_watched"), ["OK"], [Function.noop]);
|
||||
});
|
||||
xhr.send(null);
|
||||
}),
|
||||
Function.noop
|
||||
]);
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -104,10 +104,3 @@
|
|||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{if $graffiti}
|
||||
{script "js/node_modules/react/dist/react-with-addons.min.js"}
|
||||
{script "js/node_modules/react-dom/dist/react-dom.min.js"}
|
||||
{script "js/vnd_literallycanvas.js"}
|
||||
{css "js/node_modules/literallycanvas/lib/css/literallycanvas.css"}
|
||||
{/if}
|
||||
|
|
|
@ -731,6 +731,10 @@ u(document).on('click', '.audioEntry .playerButton > .playIcon', async (e) => {
|
|||
return
|
||||
}
|
||||
|
||||
if(window.openvk.current_id == 0) {
|
||||
return
|
||||
}
|
||||
|
||||
if(!window.player.hasTrackWithId(id) && !window.player.isAtAudiosPage()) {
|
||||
let _nodes = null
|
||||
if(u(e.target).closest('.attachments').length > 0) {
|
||||
|
@ -761,6 +765,16 @@ u(document).on('click', '.audioEntry .playerButton > .playIcon', async (e) => {
|
|||
'performer': name[0]
|
||||
})
|
||||
})
|
||||
} else if(window.player.isAtAudiosPage()) {
|
||||
window.player.__renewContext()
|
||||
await window.player.loadContext(window.__current_page_audio_context.page ?? 1)
|
||||
if(!isNaN(parseInt(location.hash.replace('#', '')))) {
|
||||
const adp = parseInt(location.hash.replace('#', ''))
|
||||
await window.player.loadContext(adp)
|
||||
} else if((new URL(location.href)).searchParams.p) {
|
||||
const adp = (new URL(location.href)).searchParams.p
|
||||
await window.player.loadContext(adp)
|
||||
}
|
||||
}
|
||||
|
||||
if(window.player.current_track_id != id) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$(document).on("change", "#uploadButton", (e) => {
|
||||
$(document).on("change", ".photo_ajax_upload_button", (e) => {
|
||||
let iterator = 0
|
||||
|
||||
if(e.currentTarget.files.length > 10) {
|
||||
|
@ -56,7 +56,7 @@ $(document).on("change", "#uploadButton", (e) => {
|
|||
<textarea style="margin-left: 62px; resize: none;" maxlength="255"></textarea>
|
||||
</div>
|
||||
<div class="uploadedImage">
|
||||
<a href="${photo.link}" target="_blank"><img width="125" src="${photo.url}"></a>
|
||||
<a onclick="OpenMiniature(event, '${photo.link}', null, '${photo.pretty_id}', null)"><img width="125" src="${photo.url}"></a>
|
||||
<a class="profile_link" style="width: 125px;" id="deletePhoto" data-id="${photo.vid}" data-owner="${photo.owner}">${tr("delete")}</a>
|
||||
<!--<div class="smallFrame" style="margin-top: 6px;">
|
||||
<div class="smallBtn">${tr("album_poster")}</div>
|
||||
|
@ -76,7 +76,7 @@ $(document).on("change", "#uploadButton", (e) => {
|
|||
xhr.send(photos)
|
||||
})
|
||||
|
||||
$(document).on("click", "#endUploading", (e) => {
|
||||
$(document).on("click", ".photo_upload_container #endUploading", (e) => {
|
||||
let table = document.querySelector("#photos")
|
||||
let data = new FormData()
|
||||
let arr = new Map();
|
||||
|
@ -120,7 +120,7 @@ $(document).on("click", "#endUploading", (e) => {
|
|||
xhr.send(data)
|
||||
})
|
||||
|
||||
$(document).on("click", "#deletePhoto", (e) => {
|
||||
$(document).on("click", ".photo_upload_container #deletePhoto", (e) => {
|
||||
let data = new FormData()
|
||||
data.append("hash", u("meta[name=csrf]").attr("value"))
|
||||
|
||||
|
@ -154,19 +154,19 @@ $(document).on("dragover drop", (e) => {
|
|||
return false;
|
||||
})
|
||||
|
||||
$(".container_gray").on("dragover", (e) => {
|
||||
$(document).on("dragover", ".photo_upload_container", (e) => {
|
||||
e.preventDefault()
|
||||
document.querySelector("#fakeButton").classList.add("dragged")
|
||||
document.querySelector("#fakeButton").value = tr("drag_files_here")
|
||||
})
|
||||
|
||||
$(".container_gray").on("dragleave", (e) => {
|
||||
$(document).on("dragleave", ".photo_upload_container", (e) => {
|
||||
e.preventDefault()
|
||||
document.querySelector("#fakeButton").classList.remove("dragged")
|
||||
document.querySelector("#fakeButton").value = tr("upload_picts")
|
||||
})
|
||||
|
||||
$(".container_gray").on("drop", (e) => {
|
||||
$(document).on("drop", ".photo_upload_container", (e) => {
|
||||
e.originalEvent.dataTransfer.dropEffect = 'move';
|
||||
e.preventDefault()
|
||||
|
||||
|
@ -190,7 +190,7 @@ $(".container_gray").on("drop", (e) => {
|
|||
u("#uploadButton").trigger("change")
|
||||
})
|
||||
|
||||
u(".container_gray").on("paste", (e) => {
|
||||
u(document).on("paste", ".photo_upload_container", (e) => {
|
||||
if(e.clipboardData.files.length > 0 && e.clipboardData.files.length < 10) {
|
||||
document.getElementById("uploadButton").files = e.clipboardData.files;
|
||||
u("#uploadButton").trigger("change")
|
||||
|
|
|
@ -540,6 +540,72 @@ function reportUser(user_id) {
|
|||
]);
|
||||
}
|
||||
|
||||
function reportComment(comment_id) {
|
||||
uReportMsgTxt = tr("going_to_report_comment");
|
||||
uReportMsgTxt += "<br/>"+tr("report_question_text");
|
||||
uReportMsgTxt += "<br/><br/><b>"+tr("report_reason")+"</b>: <input type='text' id='uReportMsgInput' placeholder='" + tr("reason") + "' />"
|
||||
|
||||
MessageBox(tr("report_question"), uReportMsgTxt, [tr("confirm_m"), tr("cancel")], [
|
||||
(function() {
|
||||
res = document.querySelector("#uReportMsgInput").value;
|
||||
xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "/report/" + comment_id + "?reason=" + res + "&type=comment", true);
|
||||
xhr.onload = (function() {
|
||||
if(xhr.responseText.indexOf("reason") === -1)
|
||||
MessageBox(tr("error"), tr("error_sending_report"), ["OK"], [Function.noop]);
|
||||
else
|
||||
MessageBox(tr("action_successfully"), tr("will_be_watched"), ["OK"], [Function.noop]);
|
||||
});
|
||||
xhr.send(null);
|
||||
}),
|
||||
Function.noop
|
||||
]);
|
||||
}
|
||||
|
||||
function reportApp(id) {
|
||||
uReportMsgTxt = tr('going_to_report_app');
|
||||
uReportMsgTxt += "<br/>"+tr("report_question_text");
|
||||
uReportMsgTxt += "<br/><br/><b>"+tr("report_reason")+"</b>: <input type='text' id='uReportMsgInput' placeholder='" + tr("reason") + "' />"
|
||||
|
||||
MessageBox(tr("report_question"), uReportMsgTxt, [tr("confirm_m"), tr("cancel")], [
|
||||
(function() {
|
||||
res = document.querySelector("#uReportMsgInput").value;
|
||||
xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "/report/" + id + "?reason=" + res + "&type=app", true);
|
||||
xhr.onload = (function() {
|
||||
if(xhr.responseText.indexOf("reason") === -1)
|
||||
MessageBox(tr("error"), tr("error_sending_report"), ["OK"], [Function.noop]);
|
||||
else
|
||||
MessageBox(tr("action_successfully"), tr("will_be_watched"), ["OK"], [Function.noop]);
|
||||
});
|
||||
xhr.send(null);
|
||||
}),
|
||||
Function.noop
|
||||
]);
|
||||
}
|
||||
|
||||
function reportClub(club_id) {
|
||||
uReportMsgTxt = tr("going_to_report_club");
|
||||
uReportMsgTxt += "<br/>"+tr("report_question_text");
|
||||
uReportMsgTxt += "<br/><br/><b>"+tr("report_reason")+"</b>: <input type='text' id='uReportMsgInput' placeholder='" + tr("reason") + "' />"
|
||||
|
||||
MessageBox(tr("report_question"), uReportMsgTxt, [tr("confirm_m"), tr("cancel")], [
|
||||
(function() {
|
||||
res = document.querySelector("#uReportMsgInput").value;
|
||||
xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "/report/" + club_id + "?reason=" + res + "&type=group", true);
|
||||
xhr.onload = (function() {
|
||||
if(xhr.responseText.indexOf("reason") === -1)
|
||||
MessageBox(tr("error"), tr("error_sending_report"), ["OK"], [Function.noop]);
|
||||
else
|
||||
MessageBox(tr("action_successfully"), tr("will_be_watched"), ["OK"], [Function.noop]);
|
||||
});
|
||||
xhr.send(null);
|
||||
}),
|
||||
Function.noop
|
||||
]);
|
||||
}
|
||||
|
||||
$(document).on("click", "#_photoDelete, #_videoDelete", function(e) {
|
||||
var formHtml = "<form id='tmpPhDelF' action='" + u(this).attr("href") + "' >";
|
||||
formHtml += "<input type='hidden' name='hash' value='" + u("meta[name=csrf]").attr("value") + "' />";
|
||||
|
@ -664,6 +730,66 @@ u(document).handle("submit", "#_submitUserSubscriptionAction", async function(e)
|
|||
}
|
||||
})
|
||||
|
||||
function changeOwner(club, newOwner, newOwnerName) {
|
||||
const action = "/groups/" + club + "/setNewOwner/" + newOwner;
|
||||
|
||||
MessageBox(tr('group_changeowner_modal_title'), `
|
||||
${tr("group_changeowner_modal_text", escapeHtml(newOwnerName))}
|
||||
<br/><br/>
|
||||
<form id="transfer-owner-permissions-form" method="post">
|
||||
<label for="password">${tr('password')}</label>
|
||||
<input type="password" id="password" name="password" required />
|
||||
<input type="hidden" name="hash" value='${window.router.csrf}' />
|
||||
</form>
|
||||
`, [tr('transfer'), tr('cancel')], [
|
||||
() => {
|
||||
$("#transfer-owner-permissions-form").attr("action", action);
|
||||
document.querySelector("#transfer-owner-permissions-form").submit();
|
||||
}, Function.noop
|
||||
]);
|
||||
}
|
||||
|
||||
async function withdraw(id) {
|
||||
let coins = await API.Apps.withdrawFunds(id);
|
||||
if(coins == 0)
|
||||
MessageBox(tr('app_withdrawal'), tr('app_withdrawal_empty'), ["OK"], [Function.noop]);
|
||||
else
|
||||
MessageBox(tr('app_withdrawal'), tr("app_withdrawal_created", window.coins), ["OK"], [Function.noop]);
|
||||
}
|
||||
|
||||
function toggleMaritalStatus(e) {
|
||||
let elem = $("#maritalstatus-user");
|
||||
$("#maritalstatus-user-select").empty();
|
||||
if ([0, 1, 8].includes(Number(e.value))) {
|
||||
elem.hide();
|
||||
} else {
|
||||
elem.show();
|
||||
}
|
||||
}
|
||||
|
||||
u(document).on("paste", ".vouncher_input", function(event) {
|
||||
const vouncher = event.clipboardData.getData("text");
|
||||
|
||||
let segments;
|
||||
if(vouncher.length === 27) {
|
||||
segments = vouncher.split("-");
|
||||
if(segments.length !== 4)
|
||||
segments = undefined;
|
||||
} else if(vouncher.length === 24) {
|
||||
segments = chunkSubstr(vouncher, 6);
|
||||
}
|
||||
|
||||
if(segments !== undefined) {
|
||||
document.vouncher_form.key0.value = segments[0];
|
||||
document.vouncher_form.key1.value = segments[1];
|
||||
document.vouncher_form.key2.value = segments[2];
|
||||
document.vouncher_form.key3.value = segments[3];
|
||||
document.vouncher_form.key3.focus();
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
// Migrated from inline end
|
||||
|
||||
var tooltipClientTemplate = Handlebars.compile(`
|
||||
|
|
|
@ -186,7 +186,8 @@ window.router = new class {
|
|||
|
||||
const parser = new DOMParser
|
||||
const next_page_request = await fetch(next_page_url, {
|
||||
method: 'GET',
|
||||
method: 'AJAX',
|
||||
referrer: old_url,
|
||||
headers: {
|
||||
'X-OpenVK-Ajax-Query': '1',
|
||||
}
|
||||
|
@ -229,7 +230,7 @@ u(document).on('click', 'a', async (e) => {
|
|||
return false
|
||||
}*/
|
||||
|
||||
if(target.rel == 'nofollow') {
|
||||
if(target.attr('rel') == 'nofollow') {
|
||||
console.log('AJAX | Skipped because its nofollow')
|
||||
return
|
||||
}
|
||||
|
@ -271,6 +272,10 @@ u(document).on('submit', 'form', async (e) => {
|
|||
return false
|
||||
}
|
||||
|
||||
if(window.openvk.disable_ajax == 1) {
|
||||
return false
|
||||
}
|
||||
|
||||
e.preventDefault()
|
||||
u('#ajloader').addClass('shown')
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ function getRemainingTime(fullTime, time) {
|
|||
function serializeForm(form, submitter = null)
|
||||
{
|
||||
const u_ = u(form)
|
||||
const inputs = u_.find('input, textarea, button')
|
||||
const inputs = u_.find('input, textarea, button, select')
|
||||
let fd = new FormData()
|
||||
inputs.nodes.forEach(inp => {
|
||||
if(!inp || !inp.name) {
|
||||
|
@ -203,7 +203,14 @@ function serializeForm(form, submitter = null)
|
|||
case 'text':
|
||||
case 'textarea':
|
||||
case 'select':
|
||||
case 'select-one':
|
||||
case 'submit':
|
||||
case 'email':
|
||||
case 'phone':
|
||||
case 'search':
|
||||
case 'password':
|
||||
case 'date':
|
||||
case 'datetime-local':
|
||||
fd.append(inp.name, inp.value)
|
||||
break
|
||||
case 'checkbox':
|
||||
|
|
Loading…
Reference in a new issue