From 3f50f97f0d23a2b27a3311f11e72a2a00f6986a6 Mon Sep 17 00:00:00 2001 From: lalka2016 <99399973+lalka2016@users.noreply.github.com> Date: Sun, 21 May 2023 16:30:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D1=84=D0=B8=D0=BA=D1=81=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=82=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20(=D0=B2=D0=BE=D0=B7=D0=BC?= =?UTF-8?q?=D0=BE=D0=B6=D0=BD=D0=BE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Web/static/js/openvk.cls.js | 38 +++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/Web/static/js/openvk.cls.js b/Web/static/js/openvk.cls.js index 1d02351a..9de43c31 100644 --- a/Web/static/js/openvk.cls.js +++ b/Web/static/js/openvk.cls.js @@ -1,3 +1,4 @@ + function expand_wall_textarea(id) { var el = document.getElementById('post-buttons'+id); var wi = document.getElementById('wall-post-input'+id); @@ -169,7 +170,7 @@ document.addEventListener("DOMContentLoaded", function() { //BEGIN }); //END ONREADY DECLS async function repostPost(id, hash) { - uRepostMsgTxt = ` + uRepostMsgTxt = ` ${tr('auditory')}:
${tr("in_wall")}
${tr("in_group")}
@@ -186,9 +187,9 @@ async function repostPost(id, hash) { repostsCount = document.getElementById("repostsCount"+id) prevVal = repostsCount != null ? Number(repostsCount.innerHTML) : 0; - MessageBox(tr('share'), uRepostMsgTxt, [tr('send'), tr('cancel')], [ - (function() { - text = document.querySelector("#uRepostMsgInput_"+id).value; + MessageBox(tr('share'), uRepostMsgTxt, [tr('send'), tr('cancel')], [ + (function() { + text = document.querySelector("#uRepostMsgInput_"+id).value; type = "user"; radios = document.querySelectorAll('input[name="type"]') for(const r of radios) @@ -202,26 +203,27 @@ async function repostPost(id, hash) { groupId = document.querySelector("#groupId").value; asGroup = asgroup.checked == true ? 1 : 0; signed = signed.checked == true ? 1 : 0; - hash = encodeURIComponent(hash); - xhr = new XMLHttpRequest(); - xhr.open("POST", "/wall"+id+"/repost?hash="+hash, true); - xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); - xhr.onload = (function() { + hash = encodeURIComponent(hash); + + xhr = new XMLHttpRequest(); + xhr.open("POST", "/wall"+id+"/repost?hash="+hash, true); + xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); + xhr.onload = (function() { if(xhr.responseText.indexOf("wall_owner") === -1) - MessageBox(tr('error'), tr('error_repost_fail'), [tr('ok')], [Function.noop]); - else { - let jsonR = JSON.parse(xhr.responseText); + MessageBox(tr('error'), tr('error_repost_fail'), [tr('ok')], [Function.noop]); + else { + let jsonR = JSON.parse(xhr.responseText); NewNotification(tr('information_-1'), tr('shared_succ'), null, () => {window.location.href = "/wall" + jsonR.wall_owner}); repostsCount != null ? repostsCount.innerHTML = prevVal+1 : document.getElementById("reposts"+id).insertAdjacentHTML("beforeend", "(1)") //для старого вида постов } - }); - xhr.send('text='+encodeURI(text) + '&type='+type + '&groupId='+groupId + "&asGroup="+asGroup + "&signed="+signed); - }), - Function.noop - ]); - + }); + xhr.send('text='+encodeURI(text) + '&type='+type + '&groupId='+groupId + "&asGroup="+asGroup + "&signed="+signed); + }), + Function.noop + ]); + try { clubs = await API.Groups.getWriteableClubs();