{"id":8114,"date":"2026-01-06T01:44:34","date_gmt":"2026-01-05T22:44:34","guid":{"rendered":"https:\/\/1.cbm.ua\/?p=8114"},"modified":"2026-01-07T19:01:17","modified_gmt":"2026-01-07T16:01:17","slug":"%f0%9f%93%9cjs-%d1%81%d0%ba%d1%80%d0%b8%d0%bf%d1%82-%d0%b4%d0%bb%d1%8f-%d0%b1%d1%8b%d1%81%d1%82%d1%80%d0%be%d0%b3%d0%be-%d1%81%d0%b2%d0%b0%d1%80%d0%b0%d1%87%d0%b8%d0%b2%d0%b0%d0%bd%d0%b8%d1%8f-%d0%b8","status":"publish","type":"post","link":"https:\/\/1.cbm.ua\/?p=8114","title":{"rendered":"\ud83d\udcdcJS \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0441\u0432\u0430\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u043d\u0435\u043a\u0438\u043c\u0438 \u0431\u043b\u043e\u043a\u0430\u043c\u0438."},"content":{"rendered":"\n<p>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u0432\u0430\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u21161<\/p>\n\n\n\n<script>\n\/\/ \u0421\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432\ndocument.addEventListener('DOMContentLoaded', function() {\n    \/\/ ====== \u041d\u0410\u0421\u0422\u0420\u041e\u0419\u041a\u0418 \u0422\u0415\u041a\u0421\u0422\u0410 ======\n    const TEXT_EXPAND = '\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u044c \u0434\u0435\u0442\u0430\u043b\u0438';\n    const TEXT_COLLAPSE = '\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0447\u0442\u043e\u0431\u044b \u0441\u0432\u0435\u0440\u043d\u0443\u0442\u044c';\n    const TEXT_ERROR = '\u26a0\ufe0f \u041e\u0428\u0418\u0411\u041a\u0410: \u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0431\u043b\u043e\u043a details-end';\n    const ARROW_COLLAPSED = '\u25b6';\n    const ARROW_EXPANDED = '\u25bc';\n    \n    \/\/ ====== \u041d\u0410\u0421\u0422\u0420\u041e\u0419\u041a\u0418 \u0421\u0422\u0418\u041b\u0415\u0419 ======\n    const STYLE_BUTTON_BG = '#f0f0f0';\n    const STYLE_BUTTON_BORDER = '#ccc';\n    const STYLE_BUTTON_PADDING = '10px';\n    const STYLE_CONTENT_BORDER = '#ddd';\n    const STYLE_CONTENT_PADDING = '10px';\n    const STYLE_ERROR_COLOR = 'red';\n    \n    \/\/ ====== \u041e\u0421\u041d\u041e\u0412\u041d\u041e\u0419 \u041a\u041e\u0414 ======\n    \/\/ \u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0432\u0441\u0435 \u0431\u043b\u043e\u043a\u0438 \u043d\u0430\u0447\u0430\u043b\u0430\n    const detailsStarts = document.querySelectorAll('.details-start');\n    \n    detailsStarts.forEach(startBlock => {\n        \/\/ \u0418\u0449\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0431\u043b\u043e\u043a \u043a\u043e\u043d\u0446\u0430\n        let currentElement = startBlock.nextElementSibling;\n        let contentElements = [];\n        let endBlock = null;\n        \n        \/\/ \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0435\u0436\u0434\u0443 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u0438 \u043a\u043e\u043d\u0446\u043e\u043c\n        while (currentElement) {\n            if (currentElement.classList.contains('details-end')) {\n                endBlock = currentElement;\n                break;\n            }\n            if (!currentElement.classList.contains('details-start')) {\n                contentElements.push(currentElement);\n            }\n            currentElement = currentElement.nextElementSibling;\n        }\n        \n        \/\/ \u0415\u0441\u043b\u0438 \u043d\u0435\u0442 \u043a\u043e\u043d\u0446\u0430 \u0431\u043b\u043e\u043a\u0430 - \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443\n        if (!endBlock) {\n            startBlock.style.display = 'block';\n            startBlock.style.color = STYLE_ERROR_COLOR;\n            startBlock.style.fontWeight = 'bold';\n            startBlock.textContent = TEXT_ERROR;\n            return;\n        }\n        \n        \/\/ \u0421\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043c\u0430\u0440\u043a\u0435\u0440\u044b \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043a\u043e\u043d\u0446\u0430\n        startBlock.style.display = 'none';\n        endBlock.style.display = 'none';\n        \n        \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043b\u044f \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e\n        const wrapper = document.createElement('div');\n        wrapper.className = 'details-wrapper';\n        \n        \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a\n        const toggleButton = document.createElement('div');\n        toggleButton.className = 'details-toggle';\n        toggleButton.innerHTML = `<span class=\"details-arrow\">${ARROW_COLLAPSED}<\/span> <span class=\"details-title\">${TEXT_EXPAND}<\/span>`;\n        toggleButton.style.cursor = 'pointer';\n        toggleButton.style.padding = STYLE_BUTTON_PADDING;\n        toggleButton.style.backgroundColor = STYLE_BUTTON_BG;\n        toggleButton.style.border = `1px solid ${STYLE_BUTTON_BORDER}`;\n        toggleButton.style.borderRadius = '4px';\n        toggleButton.style.marginBottom = '5px';\n        toggleButton.style.userSelect = 'none';\n        \n        \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043b\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e\n        const contentContainer = document.createElement('div');\n        contentContainer.className = 'details-content';\n        contentContainer.style.display = 'none';\n        contentContainer.style.padding = STYLE_CONTENT_PADDING;\n        contentContainer.style.border = `1px solid ${STYLE_CONTENT_BORDER}`;\n        contentContainer.style.borderTop = 'none';\n        contentContainer.style.borderRadius = '0 0 4px 4px';\n        contentContainer.style.marginBottom = '10px';\n        \n        \/\/ \u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\n        contentElements.forEach(element => {\n            contentContainer.appendChild(element);\n        });\n        \n        \/\/ \u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c wrapper \u043f\u0435\u0440\u0435\u0434 startBlock\n        startBlock.parentNode.insertBefore(wrapper, startBlock);\n        wrapper.appendChild(toggleButton);\n        wrapper.appendChild(contentContainer);\n        \n        \/\/ \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043a\u043b\u0438\u043a\u0430 \u0434\u043b\u044f \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f\/\u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f\n        toggleButton.addEventListener('click', function() {\n            const isHidden = contentContainer.style.display === 'none';\n            const arrow = toggleButton.querySelector('.details-arrow');\n            const title = toggleButton.querySelector('.details-title');\n            \n            if (isHidden) {\n                contentContainer.style.display = 'block';\n                arrow.textContent = ARROW_EXPANDED;\n                title.textContent = TEXT_COLLAPSE;\n            } else {\n                contentContainer.style.display = 'none';\n                arrow.textContent = ARROW_COLLAPSED;\n                title.textContent = TEXT_EXPAND;\n            }\n        });\n    });\n});\n<\/script>\n\n\n\n<!-- \u041d\u0430\u0447\u0430\u043b\u043e \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 -->\n    <div class=\"details-start\"><\/div>\n\n\n\n<p>\u0422\u0443\u0442 \u0431\u043b\u043e\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u0432\u0430\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n\n\n\n<!-- \u041a\u043e\u043d\u0435\u0446 \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 -->\n    <div class=\"details-end\"><\/div>\n\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u0432\u0430\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u21162 &#8212; \u043d\u0435 \u0434\u043e\u0434\u0435\u043b\u0430\u043b.<\/p>\n\n\n\n\n\n<p>!&#8212; li \u041d\u0430\u0447\u0430\u043b\u043e \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 &#8212;!<\/p>\n\n\n\n<p>\u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u044c\u0441\u044f.<\/p>\n\n\n\n<p>!&#8212; li \u041a\u043e\u043d\u0435\u0446 \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 &#8212;!<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u0432\u0430\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u21161 \u0422\u0443\u0442 \u0431\u043b\u043e\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u0432\u0430\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u0412\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u0432\u0430\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u21162 &#8212; \u043d\u0435 \u0434\u043e\u0434\u0435\u043b\u0430\u043b. !&#8212; li \u041d\u0430\u0447\u0430\u043b\u043e \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 &#8212;! \u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u044c\u0441\u044f. !&#8212; li \u041a\u043e\u043d\u0435\u0446 \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 &#8212;!<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[184],"tags":[],"class_list":["post-8114","post","type-post","status-publish","format-standard","hentry","category--script"],"_links":{"self":[{"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/posts\/8114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8114"}],"version-history":[{"count":9,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/posts\/8114\/revisions"}],"predecessor-version":[{"id":8192,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/posts\/8114\/revisions\/8192"}],"wp:attachment":[{"href":"https:\/\/1.cbm.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}