${escapeHtml(post.message)}
${tplMapIcon}
${escapeHtml(post.geo.name)}
function initGraffiti(event) { let canvas = null; const msgbox = new CMessageBox({ title: tr("draw_graffiti"), body: "
", close_on_buttons: false, warn_on_exit: true, buttons: [tr("save"), tr("cancel")], callbacks: [function() { canvas.getImage({includeWatermark: false}).toBlob(blob => { let fName = "Graffiti-" + Math.ceil(performance.now()).toString() + ".jpeg"; let image = new File([blob], fName, {type: "image/jpeg", lastModified: new Date().getTime()}); __uploadToTextarea(image, u(event.target).closest('#write')) }, "image/jpeg", 0.92); canvas.teardown(); msgbox.close() }, async function() { const res = await msgbox.__showCloseConfirmationDialog() if(res === true) { canvas.teardown() msgbox.close() } }] }) let watermarkImage = new Image(); watermarkImage.src = "/assets/packages/static/openvk/img/logo_watermark.gif"; msgbox.getNode().attr("style", "width: 750px;"); canvas = LC.init(document.querySelector("#ovkDraw"), { backgroundColor: "#fff", imageURLPrefix: "/assets/packages/static/openvk/js/node_modules/literallycanvas/lib/img", watermarkImage: watermarkImage, imageSize: { width: 640, height: 480 } }); } u(document).on('click', '.menu_toggler', (e) => { const post_buttons = $(e.target).closest('.post-buttons') const wall_attachment_menu = post_buttons.find('#wallAttachmentMenu') if(wall_attachment_menu.is('.hidden')) { wall_attachment_menu.css({ opacity: 0 }); wall_attachment_menu.toggleClass('hidden').fadeTo(250, 1); } else { wall_attachment_menu.fadeTo(250, 0, function () { $(this).toggleClass('hidden'); }); } }) u(document).on("click", ".post-like-button", function(e) { e.preventDefault(); e.stopPropagation() var thisBtn = u(this).first(); var link = u(this).attr("href"); var heart = u(".heart", thisBtn); var counter = u(".likeCnt", thisBtn); var likes = counter.text() === "" ? 0 : counter.text(); var isLiked = heart.attr("id") === 'liked'; ky.post(link) heart.attr("id", isLiked ? '' : 'liked'); counter.text(parseInt(likes) + (isLiked ? -1 : 1)); if (counter.text() === "0") { counter.text(""); } return false; }); u(document).on("input", "textarea", function(e) { var boost = 5; var textArea = e.target; textArea.style.height = "5px"; var newHeight = textArea.scrollHeight; textArea.style.height = newHeight + boost + "px"; return; // revert to original size if it is larger (possibly changed by user) // textArea.style.height = (newHeight > originalHeight ? (newHeight + boost) : originalHeight) + "px"; }); async function OpenMiniature(e, photo, post, photo_id, type = "post") { /* костыли но смешные однако */ e.preventDefault(); e.stopPropagation() // Значения для переключения фоток const albums_per_page = 20 let json; let offset = type == 'album' ? (Number((new URL(location.href)).searchParams.get('p') ?? 1) - 1) * albums_per_page : 0 let shown_offset = 0 let imagesCount = 0; let currentImageid = '0_0'; const photo_viewer = new CMessageBox({ title: '', custom_template: u(` `) }) photo_viewer.getNode().find("#ovk-photo-close").on("click", function(e) { photo_viewer.close() }); function __getIndex(photo_id = null) { return Object.keys(json.body).findIndex(item => item == (photo_id ?? currentImageid)) + 1 } function __getByIndex(id) { const ids = Object.keys(json.body) const _id = ids[id - 1] return json.body[_id] } function __reloadTitleBar() { photo_viewer.getNode().find("#photo_com_title_photos").last().innerHTML = imagesCount > 1 ? tr("photo_x_from_y", shown_offset, imagesCount) : tr("photo"); } async function __loadDetails(photo_id) { if(json.body[photo_id].cached == null) { photo_viewer.getNode().find(".ovk-photo-details").last().innerHTML = '
|
${tr("learn_more")} |
|
|
${ovk_proc_strtr(escapeHtml(video.title), 50)}
${ovk_proc_strtr(escapeHtml(video.description ?? ""), 140)} ${ovk_proc_strtr(escapeHtml(author_name ?? ""), 100)} |
${!is_attached ? tr("attach") : tr("detach")} |
${tr('info_name')}: | |
${tr('description')}: | |
${tr('video')}: |
${tr('info_name')}: | |
${tr('description')}: | |
${tr('video_link_to_yt')}: |
${isGroup == true ? tr('groups_avatar') : tr('friends_avatar')}
${tr('formats_avatar')}
${tr('troubles_avatar')}
${tr('webcam_avatar')}
${tr("selected_area_rotate")}
|
${escapeHtml(post.message)}
${tplMapIcon}
${escapeHtml(post.geo.name)}
|
${tr("additional_field_name")} | ||
${tr("additional_field_text")} | ||
${tr("additional_field_place")} |