if(typeof u == 'undefined') { console.error('!!! You forgot to install NPM packages !!!') } function expand_comment_textarea(id) { var el = document.getElementById('commentTextArea'+id); var wi = document.getElementById('wall-post-input'+id); el.style.display = "block"; wi.focus(); } function hidePanel(panel, count = 0) { $(panel).toggleClass("content_title_expanded content_title_unexpanded"); $(panel).next('div').slideToggle(300); if(count != 0){ if($(panel).hasClass("content_title_expanded")) $(panel).html($(panel).html().replaceAll(" ("+count+")", "")); else $(panel).html($(panel).html() + " ("+count+")"); } } function parseAjaxResponse(responseString) { try { const response = JSON.parse(responseString); if(response.flash) NewNotification(response.flash.title, response.flash.message || "", null); return response.success || false; } catch(error) { if(responseString === "Хакеры? Интересно...") { location.reload(); return false; } else { throw error; } } } function setClubAdminComment(clubId, adminId, hash) { MessageBox("Изменить комментарий к администратору", `
`, [tr('edit_action'), tr('cancel')], [ () => { if (document.querySelector(`#uClubAdminCommentTextArea_${clubId}_${adminId}`).value === "") { document.querySelector(`#uClubAdminCommentRemoveCommentInput_${clubId}_${adminId}`).value = "1"; } document.querySelector(`#uClubAdminCommentForm_${clubId}_${adminId}`).submit(); }, Function.noop ]); } function showCoinsTransferDialog(coinsCount, hash) { MessageBox(tr("transfer_poins"), ` `, [tr("transfer_poins_button"), tr("cancel")], [ () => { document.querySelector("#coins_transfer_form").submit(); }, Function.noop ]); } function autoTab(original, next, previous) { if(original.getAttribute && original.value.length == original.getAttribute("maxlength") && next !== undefined) next.focus(); else if(original.value.length == 0 && previous !== undefined) previous.focus(); } function showSupportFastAnswerDialog(answers) { let html = ""; for(const [index, answer] of Object.entries(answers)) { html += `