diff --git a/VKAPI/Handlers/Notes.php b/VKAPI/Handlers/Notes.php index ef8cd071..9f0e6eab 100644 --- a/VKAPI/Handlers/Notes.php +++ b/VKAPI/Handlers/Notes.php @@ -118,21 +118,6 @@ final class Notes extends VKAPIRequestHandler return 1; } - function deleteComment(int $comment_id, int $owner_id = 0) - { - $this->requireUser(); - $this->willExecuteWriteAction(); - - $comment = (new CommentsRepo)->get($comment_id); - - if(!$comment || !$comment->canBeDeletedBy($this->getUser())) - $this->fail(403, "Access to comment denied"); - - $comment->delete(); - - return 1; - } - function edit(string $note_id, string $title = "", string $text = "", int $privacy = 0, int $comment_privacy = 0, string $privacy_view = "", string $privacy_comment = "") { $this->requireUser(); @@ -159,23 +144,6 @@ final class Notes extends VKAPIRequestHandler return 1; } - function editComment(int $comment_id, string $message, int $owner_id = NULL) - { - $this->requireUser(); - $this->willExecuteWriteAction(); - - $comment = (new CommentsRepo)->get($comment_id); - - if($comment->getOwner()->getId() != $this->getUser()->getId()) - $this->fail(15, "Access to comment denied"); - - $comment->setContent($message); - $comment->setEdited(time()); - $comment->save(true); - - return 1; - } - function get(int $user_id, string $note_ids = "", int $offset = 0, int $count = 10, int $sort = 0) { $this->requireUser(); diff --git a/VKAPI/Handlers/Wall.php b/VKAPI/Handlers/Wall.php index 2929beb9..fde87fcb 100644 --- a/VKAPI/Handlers/Wall.php +++ b/VKAPI/Handlers/Wall.php @@ -513,6 +513,8 @@ final class Wall extends VKAPIRequestHandler $this->fail(100, "Poll does not exist"); if($attacc->getOwner()->getId() != $this->getUser()->getId()) $this->fail(43, "You do not have access to this poll"); + + $post->attach($attacc); } elseif($attachmentType == "audio") { $attacc = (new AudiosRepo)->getByOwnerAndVID($attachmentOwner, $attachmentId); if(!$attacc || $attacc->isDeleted()) @@ -864,7 +866,7 @@ final class Wall extends VKAPIRequestHandler $this->fail(158, "Post will have too many attachments"); foreach($attachs as $attach) { - if($attach && !$attach->isDeleted() && $attach->getOwner()->getId() == $this->getUser()->getId()) + if($attach && !$attach->isDeleted()) $post->attach($attach); else $this->fail(52, "One of the attachments is invalid"); @@ -908,7 +910,7 @@ final class Wall extends VKAPIRequestHandler $this->fail(158, "Post will have too many attachments"); foreach($attachs as $attach) { - if($attach && !$attach->isDeleted() && $attach->getOwner()->getId() == $this->getUser()->getId()) + if($attach && !$attach->isDeleted()) $comment->attach($attach); else $this->fail(52, "One of the attachments is invalid"); diff --git a/Web/Presenters/VideosPresenter.php b/Web/Presenters/VideosPresenter.php index 57e73f11..6f92891c 100644 --- a/Web/Presenters/VideosPresenter.php +++ b/Web/Presenters/VideosPresenter.php @@ -151,6 +151,6 @@ final class VideosPresenter extends OpenVKPresenter $video->toggleLike($this->user->identity); } - $this->redirect("$_SERVER[HTTP_REFERER]"); + $this->returnJson(["success" => true]); } } diff --git a/Web/static/css/dialog.css b/Web/static/css/dialog.css index 4e97b411..c264dbb6 100644 --- a/Web/static/css/dialog.css +++ b/Web/static/css/dialog.css @@ -154,12 +154,7 @@ body.dimmed > .dimmer { background: white; padding-right: 6px; max-height: 400px; - overflow-y: scroll; -} - -/* Работает только в хроме, потому что в фурифоксе до сих пор нет кастомных скроллбаров лул */ -.left_block::-webkit-scrollbar { - width: 0; + overflow-y: auto; } .right_block { diff --git a/Web/static/js/al_wall.js b/Web/static/js/al_wall.js index 08a9a733..3fc96ce0 100644 --- a/Web/static/js/al_wall.js +++ b/Web/static/js/al_wall.js @@ -558,7 +558,7 @@ $(document).on("click", "#videoOpen", async (e) => { ` } else { player = ` -
+
` } @@ -586,7 +586,7 @@ $(document).on("click", "#videoOpen", async (e) => {
${escapeHtml(videoObj.title)}
- ${tr("hide_player")} + ${tr("hide_player")} | ${tr("close_player")}
@@ -655,8 +655,6 @@ $(document).on("click", "#videoOpen", async (e) => { let oldPlayer = document.querySelector(".miniplayer-video .fplayer") let newPlayer = document.querySelector(".top-part-player-subdiv") - document.querySelector(".top-part-player-subdiv") - newPlayer.append(oldPlayer) } diff --git a/Web/static/js/messagebox.js b/Web/static/js/messagebox.js index 7697875e..c9fa9c31 100644 --- a/Web/static/js/messagebox.js +++ b/Web/static/js/messagebox.js @@ -1,6 +1,6 @@ Function.noop = () => {}; -function MessageBox(title, body, buttons, callbacks, removeDimmedOnExit = true) { +function MessageBox(title, body, buttons, callbacks) { if(u(".ovk-diag-cont").length > 0) return false; document.querySelector("html").style.overflowY = "hidden" @@ -21,8 +21,9 @@ function MessageBox(title, body, buttons, callbacks, removeDimmedOnExit = true) button.on("click", function(e) { let __closeDialog = () => { - if(removeDimmedOnExit) { + if(document.querySelector(".ovk-photo-view-dimmer") == null && document.querySelector(".ovk-fullscreen-player") == null) { u("body").removeClass("dimmed"); + document.querySelector("html").style.overflowY = "scroll" } u(".ovk-diag-cont").remove(); diff --git a/bootstrap.php b/bootstrap.php index 96136116..1db363b4 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -244,6 +244,8 @@ function parseAttachments(string $attachments) $attachmentType = "video"; elseif(str_contains($attachment, "note")) $attachmentType = "note"; + elseif(str_contains($attachment, "audio")) + $attachmentType = "audio"; $attachmentIds = str_replace($attachmentType, "", $attachment); $attachmentOwner = (int)explode("_", $attachmentIds)[0]; @@ -262,6 +264,10 @@ function parseAttachments(string $attachments) $attachmentObj = (new openvk\Web\Models\Repositories\Notes)->getNoteById($attachmentOwner, $attachmentId); $returnArr[] = $attachmentObj; break; + case "audio": + $attachmentObj = (new openvk\Web\Models\Repositories\Audios)->getByOwnerAndVID($attachmentOwner, $attachmentId); + $returnArr[] = $attachmentObj; + break; } }