From 67bc9c1bcbe81ccf25bfdd7ddf58a4b116406388 Mon Sep 17 00:00:00 2001 From: mrilyew <99399973+mrilyew@users.noreply.github.com> Date: Sun, 1 Dec 2024 21:53:15 +0300 Subject: [PATCH] Fix main problems --- Web/Presenters/MessengerPresenter.php | 1 + Web/Presenters/templates/@layout.xml | 5 + Web/Presenters/templates/Apps/Edit.xml | 8 +- Web/Presenters/templates/Apps/Play.xml | 26 +--- Web/Presenters/templates/Audio/tabs.xml | 2 +- Web/Presenters/templates/Group/Followers.xml | 25 +--- Web/Presenters/templates/Group/View.xml | 28 +--- Web/Presenters/templates/Notes/List.xml | 4 +- Web/Presenters/templates/Notes/View.xml | 2 +- .../templates/Photos/UploadPhoto.xml | 8 +- Web/Presenters/templates/Topics/Create.xml | 7 - Web/Presenters/templates/User/Edit.xml | 11 -- Web/Presenters/templates/User/Settings.xml | 24 ---- Web/Presenters/templates/User/View.xml | 4 +- Web/Presenters/templates/User/private.xml | 27 +--- .../templates/components/comment.xml | 25 +--- .../templates/components/textArea.xml | 7 - Web/static/js/al_music.js | 14 ++ Web/static/js/al_photos.js | 16 +-- Web/static/js/al_wall.js | 126 ++++++++++++++++++ Web/static/js/router.js | 9 +- Web/static/js/utils.js | 9 +- 22 files changed, 185 insertions(+), 203 deletions(-) diff --git a/Web/Presenters/MessengerPresenter.php b/Web/Presenters/MessengerPresenter.php index e04e1adc..cec99cff 100644 --- a/Web/Presenters/MessengerPresenter.php +++ b/Web/Presenters/MessengerPresenter.php @@ -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; } diff --git a/Web/Presenters/templates/@layout.xml b/Web/Presenters/templates/@layout.xml index 5406bf8a..b7d84b96 100644 --- a/Web/Presenters/templates/@layout.xml +++ b/Web/Presenters/templates/@layout.xml @@ -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"} diff --git a/Web/Presenters/templates/Apps/Edit.xml b/Web/Presenters/templates/Apps/Edit.xml index b8d9c8b0..8ae61396 100644 --- a/Web/Presenters/templates/Apps/Edit.xml +++ b/Web/Presenters/templates/Apps/Edit.xml @@ -101,12 +101,6 @@ {/block} diff --git a/Web/Presenters/templates/Apps/Play.xml b/Web/Presenters/templates/Apps/Play.xml index 32e50f26..53aabc8c 100644 --- a/Web/Presenters/templates/Apps/Play.xml +++ b/Web/Presenters/templates/Apps/Play.xml @@ -7,7 +7,7 @@ {block header} {$name} - {_report} + {_report} {/block} {block content} @@ -36,29 +36,5 @@ window.appOrigin = {$origin}; - - {script "js/al_games.js"} {/block} diff --git a/Web/Presenters/templates/Audio/tabs.xml b/Web/Presenters/templates/Audio/tabs.xml index 8252678e..8ff7bb1b 100644 --- a/Web/Presenters/templates/Audio/tabs.xml +++ b/Web/Presenters/templates/Audio/tabs.xml @@ -13,7 +13,7 @@ {_new_playlist} - {if !$isMy && $mode !== 'popular' && $mode !== 'new'} + {if !$isMy && $mode !== 'popular' && $mode !== 'new' && $mode != 'alone_audio'}
{if $ownerId > 0}{_music_user}{else}{_music_club}{/if} diff --git a/Web/Presenters/templates/Group/Followers.xml b/Web/Presenters/templates/Group/Followers.xml index 6ddece4f..e81120fe 100644 --- a/Web/Presenters/templates/Group/Followers.xml +++ b/Web/Presenters/templates/Group/Followers.xml @@ -80,29 +80,6 @@ - - {/block} {block actions} @@ -117,7 +94,7 @@ {/if} {if $club->getOwner()->getId() != $user->getId() && $manager && $thisUser->getId() == $club->getOwner()->getId()} - + {_promote_to_owner} {/if} diff --git a/Web/Presenters/templates/Group/View.xml b/Web/Presenters/templates/Group/View.xml index 327dd2f5..915f96b3 100644 --- a/Web/Presenters/templates/Group/View.xml +++ b/Web/Presenters/templates/Group/View.xml @@ -145,7 +145,7 @@ @@ -99,7 +99,7 @@  |  {_delete}  |  - {_edit} + {_edit} diff --git a/Web/Presenters/templates/Notes/View.xml b/Web/Presenters/templates/Notes/View.xml index e168c237..4aa0627b 100644 --- a/Web/Presenters/templates/Notes/View.xml +++ b/Web/Presenters/templates/Notes/View.xml @@ -66,7 +66,7 @@  |  {_delete}  |  - {_edit} + {_edit} diff --git a/Web/Presenters/templates/Photos/UploadPhoto.xml b/Web/Presenters/templates/Photos/UploadPhoto.xml index 4f5f8e70..1854dded 100644 --- a/Web/Presenters/templates/Photos/UploadPhoto.xml +++ b/Web/Presenters/templates/Photos/UploadPhoto.xml @@ -25,9 +25,9 @@ - + -
+
@@ -62,7 +62,3 @@ uploadButton.value = '' {/block} - -{block bodyScripts} - {script "js/al_photos.js"} -{/block} diff --git a/Web/Presenters/templates/Topics/Create.xml b/Web/Presenters/templates/Topics/Create.xml index e018b26b..659a50d4 100644 --- a/Web/Presenters/templates/Topics/Create.xml +++ b/Web/Presenters/templates/Topics/Create.xml @@ -86,11 +86,4 @@ setupWallPostInputHandlers(1); }); - - {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} diff --git a/Web/Presenters/templates/User/Edit.xml b/Web/Presenters/templates/User/Edit.xml index 1ee3471a..8bea7f0c 100644 --- a/Web/Presenters/templates/User/Edit.xml +++ b/Web/Presenters/templates/User/Edit.xml @@ -179,17 +179,6 @@ - {elseif $isContacts} diff --git a/Web/Presenters/templates/User/Settings.xml b/Web/Presenters/templates/User/Settings.xml index 244c52c4..c08c9d2c 100644 --- a/Web/Presenters/templates/User/Settings.xml +++ b/Web/Presenters/templates/User/Settings.xml @@ -492,30 +492,6 @@ - {elseif $isInterface} diff --git a/Web/Presenters/templates/User/View.xml b/Web/Presenters/templates/User/View.xml index 44c7a6ce..f3eca4ce 100644 --- a/Web/Presenters/templates/User/View.xml +++ b/Web/Presenters/templates/User/View.xml @@ -113,10 +113,10 @@ {_warn_user_action} - + {_blocks} - + {_last_actions} {/if} diff --git a/Web/Presenters/templates/User/private.xml b/Web/Presenters/templates/User/private.xml index a2520a07..5338cbcc 100644 --- a/Web/Presenters/templates/User/private.xml +++ b/Web/Presenters/templates/User/private.xml @@ -17,7 +17,7 @@ style="width: 100%; image-rendering: -webkit-optimize-contrast;" />
diff --git a/Web/Presenters/templates/components/comment.xml b/Web/Presenters/templates/components/comment.xml index ab465023..f9bdee6c 100644 --- a/Web/Presenters/templates/components/comment.xml +++ b/Web/Presenters/templates/components/comment.xml @@ -57,7 +57,7 @@ {if $thisUser->getId() != $author->getRealId()} | {var $canReport = true} - {_report} + {_report} {/if}
@@ -82,26 +82,3 @@ - diff --git a/Web/Presenters/templates/components/textArea.xml b/Web/Presenters/templates/components/textArea.xml index a992e88b..bab0f831 100644 --- a/Web/Presenters/templates/components/textArea.xml +++ b/Web/Presenters/templates/components/textArea.xml @@ -104,10 +104,3 @@
- -{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} diff --git a/Web/static/js/al_music.js b/Web/static/js/al_music.js index 8e87e4cc..f5ba2361 100644 --- a/Web/static/js/al_music.js +++ b/Web/static/js/al_music.js @@ -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) { diff --git a/Web/static/js/al_photos.js b/Web/static/js/al_photos.js index e8b0d8ef..4d0599aa 100644 --- a/Web/static/js/al_photos.js +++ b/Web/static/js/al_photos.js @@ -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) => {
- + ${tr("delete")}