PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / trunk
Adminify – White Label, Admin Menu Editor, Login Customizer vtrunk
4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 4.1.17 All 164 releases
adminify / assets / admin / js / wp-adminify.js

wp-adminify.js in Adminify – White Label, Admin Menu Editor, Login Customizer trunk, at assets/admin/js/wp-adminify.js

66 lines 34.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*
2 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
3 * This devtool is neither made for production nor for readable output files.
4 * It uses "eval()" calls to create a separate source file in the browser devtools.
5 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
6 * or disable the default devtool with "devtool: false".
7 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
8 */
9 /******/ (() => { // webpackBootstrap
10 /******/ "use strict";
11 /******/ var __webpack_modules__ = ({
12
13 /***/ "./dev/admin/wp-adminify.js":
14 /*!**********************************!*\
15 !*** ./dev/admin/wp-adminify.js ***!
16 \**********************************/
17 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18
19 eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ waitForElm: () => (/* binding */ waitForElm)\n/* harmony export */ });\n// JS codes by WP Adminify\n\n(function ($) {\n \"use strict\";\n\n // $('.auto-fold .interface-interface-skeleton').css('left', '244px');\n // $('.wp-adminify.block-editor-page .interface-interface-skeleton').css('top', '90px');\n // $('.wp-adminify .editor-document-tools__left button.editor-document-tools__inserter-toggle').css('padding', '0px');\n // $('.wp-adminify.is-fullscreen-mode #wpadminbar').css('display', 'none');\n\n // var $body = $('body'),\n // isFullScreen = $body.hasClass('is-fullscreen-mode');\n // if (isFullScreen) {\n // console.log(\"yes its it\");\n // // $step5.css({\n // // 'top': '93px',\n // // 'left': '0',\n // // });\n // // $step5Arrow.css('left', '91px');\n // }\n\n // $(document).ready(function () {\n // if ($(\"body.js.wp-adminify\").hasClass(\"is-fullscreen-mode\")) {\n // // console.log(\"yes its it\");\n // $(\".wp-adminify.adminify-top_bar\").css('display', 'none');\n // $(\".wp-adminify.block-editor-page .interface-interface-skeleton\").css('left', '0px !important');\n // } else {\n // console.log(\"non ono \");\n // }\n // // console.log(\"ready!\");\n // });\n\n // pro code start\n var isPro = PXLBSADMINIFY_ADMIN.is_pro;\n var isAdminifyUI = PXLBSADMINIFY_ADMIN.settings.adminify_ui;\n\n // pro code end\n\n // adminbar sticky class add/remove\n $(window).scroll(function () {\n var scroll = $(window).scrollTop();\n if (scroll >= 1) {\n $(\".adminify-top_bar\").addClass(\"is-sticky\");\n } else {\n $(\".adminify-top_bar\").removeClass(\"is-sticky\");\n }\n });\n\n // wp adminify adminbar menu displaying issue fixed START\n if (!$(\"#wp-admin-bar-top-secondary\").length) {\n $(\"#wp-toolbar.quicklinks\").append(\" <ul id = \\\"wp-adminify-default-top-secondary\\\" > </ul> \");\n }\n // wp adminify adminbar menu displaying issue fixed END\n\n // Icon Class replaced when adminify_ui is disabled\n $(\"body:not(.adminify-ui) div[class*=' dashicons-adminify']\").each(function () {\n var el_class = $(this).attr(\"class\").replace(\"dashicons-before dashicons-adminify-\", \"adminify-menu-icon \");\n $(this).attr(\"class\", el_class);\n });\n $('body:not(.adminify-ui) #adminmenuwrap #adminmenu a').each(function () {\n $(this).find('img').each(function () {\n var imgSrc = $(this).attr('src');\n // var parent = $(this).parent();\n\n if (imgSrc) {\n // Match FontAwesome (fas fa-)\n var faMatch = imgSrc.match(/http:\\/\\/fas%20fa-([a-zA-Z0-9-]+)/);\n // Match Simple Line Icon (icon-)\n var lineIconMatch = imgSrc.match(/http:\\/\\/icon-([a-zA-Z0-9-]+)/);\n if (faMatch && faMatch[1]) {\n var faClass = 'fas fa-' + faMatch[1];\n $(this).parent().addClass(faClass).removeClass('dashicons-before');\n $(this).remove();\n } else if (lineIconMatch && lineIconMatch[1]) {\n var lineIconClass = 'icon-' + lineIconMatch[1];\n $(this).parent().addClass(lineIconClass).removeClass('dashicons-before');\n $(this).remove();\n } else if ($(this).parent().is('.wp-menu-image.dashicons-before') && $(this).parent().attr('class').split(' ').length === 2) {\n $(this).parent().removeClass('dashicons-before').addClass('custom-icon');\n $(this).css({\n 'width': '20px',\n 'height': '20px',\n 'padding': '0'\n });\n }\n }\n });\n });\n\n // scroll to top class added to body / its currently working for gravity form header\n window.addEventListener(\"scroll\", function (e) {\n var distanceY = window.pageYOffset || document.documentElement.scrollTop,\n scrollTo = 40,\n header = document.querySelector(\"body\");\n if (distanceY > scrollTo) {\n header.classList.add(\"adminify-scrollto-sticky\");\n } else {\n if (header.classList.contains(\"adminify-scrollto-sticky\")) {\n header.classList.remove(\"adminify-scrollto-sticky\");\n }\n }\n });\n\n // Folder div made full width and content placed to bottom\n if (window.matchMedia(\"(max-width: 500px)\").matches) {\n setTimeout(function () {\n var folder_height = $(\".wp-adminify--folder-app\").height();\n $(\"#wpbody-content\").css(\"margin-top\", folder_height + 180);\n }, 1500);\n }\n var adminHeight = $(\".wp-adminify.adminify-top_bar\").height();\n $(\".wp-adminify-admin-bar.position-bottom\").css(\"padding-bottom\", adminHeight * 1.25);\n\n // Widget #dashboard_right_now count style\n\n jQuery(\"#dashboard_right_now li a\").html(function () {\n var text = jQuery(this).text().trim().split(\" \");\n var first = text.shift();\n return (text.length > 0 ? \"<span class='counter'>\" + first + \"</span> \" : first) + text.join(\" \");\n });\n\n // Accordion\n\n jQuery(\".accordion .accordion-body\").css(\"display\", \"none\");\n jQuery(\"body\").on(\"click\", \".accordion-button, .accordion-opener\", function (e // jQuery(\".accordion-button, .accordion-opener\").on('click', function (e)\n ) {\n e.preventDefault();\n jQuery(this).toggleClass(\"show\");\n var jQuerythis = jQuery(this);\n if (jQuerythis.next().hasClass(\"show\")) {\n jQuerythis.next().removeClass(\"show\");\n jQuerythis.next().slideUp(100);\n } else {\n jQuerythis.parent().parent().find(\".accordion-body\").removeClass(\"show\");\n jQuerythis.parent().parent().find(\".accordion-body\").slideUp(100);\n jQuerythis.prev(\".accordion-title\").toggleClass(\"show\");\n jQuerythis.next().toggleClass(\"show\");\n jQuerythis.next().slideToggle(100);\n }\n });\n\n // Admin Columns Accordions\n\n $(\".accordion-opener\").on(\"click\", function (e) {\n e.preventDefault();\n var $this = $(this);\n if ($this.next().hasClass(\"show\")) {\n $this.next().removeClass(\"show\");\n $this.next().slideUp(100);\n } else {\n $this.parent().parent().find(\".accordion-body\").removeClass(\"show\");\n $this.parent().parent().find(\".accordion-body\").slideUp(100);\n $this.prev(\".accordion-title\").toggleClass(\"show\");\n $this.next().toggleClass(\"show\");\n $this.next().slideToggle(100);\n }\n });\n $(window).on(\"load\", function () {\n // WP_Adminify.animateCSS('body.wp-adminify', 'fadeIn');\n // WP_Adminify.animateCSS('.my-element', 'fadeIn').then((message) => {\n // // Do something after the animation\n // });\n\n $(\".wp-adminify-loader\").delay(300).fadeOut(\"slow\");\n\n // Adminbar Loader\n $(\".wp-adminify-topbar-loader\").delay(100).fadeOut(\"fast\");\n setTimeout(function () {\n $(\".wp-adminify.adminify-top_bar\").fadeIn(\"fast\");\n }, 100);\n\n // Menu Editor Preloader\n setTimeout(function () {\n $(\".wp-adminify-menu-editor-loader\").css({\n display: \"none\"\n });\n }, 700);\n setTimeout(function () {\n $(\".wp-adminify--menu--editor--settings\").addClass(\"loaded\");\n }, 700);\n });\n\n // Google page speed origin on / off\n\n jQuery(\".origin-summery-trigger button\").on(\"click\", function () {\n alert(\"clicked!\");\n jQuery(\".result-body\").toggleClass(\"show-origin\");\n });\n\n // Wrap content get extra margin if folder options exist\n jQuery(\"body\").has(\"#wp-adminify--folder-app\").addClass(\"has-folder-options\");\n\n // tippy('[data-tippy-content]');\n\n // Admin Topbar Search\n function admin_top_search_hide_result() {\n $(\"#top-header-search-results\").hide();\n }\n function admin_top_search_show_result() {\n $(\"#top-header-search-results\").show();\n }\n $(\"#top-header-search-input\").on(\"input\", function () {\n var search_val = $(\"#top-header-search-input\").val();\n admin_top_bar_search(search_val);\n if (!search_val.length) {\n admin_top_search_hide_result();\n }\n });\n var cansearch;\n function admin_top_bar_search(searchTerm) {\n // Admin Bar Search\n if (cansearch == false) {\n return;\n }\n if (searchTerm == \"\") {\n return;\n }\n\n // var count_rows = $('#top-header-search-results .top-header-result-table > tbody > tr').length;\n // console.log(count_rows);\n // $(\"#top-header-search-results\").css('display','block');\n\n $.ajax({\n url: PXLBSADMINIFY_ADMINBAR.ajax_url,\n type: \"post\",\n data: {\n action: \"pxlbsadminify_all_search\",\n security: PXLBSADMINIFY_ADMINBAR.security_nonce,\n search: searchTerm\n },\n beforeSend: function beforeSend(xhr) {\n cansearch = false;\n },\n success: function success(response) {\n if (response) {\n var data = JSON.parse(response);\n\n // if (data.error) {\n // Toastr Code here\n // } else {\n admin_top_search_show_result();\n $(\"#top-header-search-results .top-header-results-wrapper\").html(data);\n\n // $(\"#top-header-search-results\").show();\n cansearch = true;\n // }\n }\n }\n });\n }\n var WP_Adminify = {\n // Pro Notice\n ProNotice: function ProNotice() {\n // Notice Hide to Outside overlay\n $(\".wp-adminify-popup-overlay\").on(\"click\", function (evt) {\n evt.preventDefault();\n $(this).closest(\".wp-adminify-upgrade-popup\").fadeOut(200);\n });\n\n // Notice Hide to close button\n $(\"body\").on(\"click\", \".wp-adminify-upgrade-popup .popup-dismiss\", function (evt) {\n evt.preventDefault();\n $(this).closest(\".wp-adminify-upgrade-popup\").fadeOut(200);\n });\n\n // Notice Show\n $(\"body\").on(\"click\", \".adminify-pro-notice\", function (evt) {\n evt.preventDefault();\n $(\".wp-adminify-upgrade-popup\").fadeIn(200);\n });\n\n /**\n * Fields Notice Class Add\n */\n // Checkbox\n var checkboxLabel = $(\".adminify-pro-checkbox\").parent().parent();\n checkboxLabel.addClass(\"adminify-pro-notice\");\n\n // Color Picker\n var colorPickerLabel = $(\".adminify-field-color_group.adminify-pro-fieldset > .adminify-fieldset\");\n colorPickerLabel.addClass(\"adminify-pro-notice\");\n\n // Gradient Color Picker\n var gradientLolorPickerLabel = $(\".adminify-field-background[data-value='gradient|true'].adminify-pro-feature > .adminify-fieldset\");\n gradientLolorPickerLabel.css(\"pointer-events\", \"none\");\n },\n // Pro Notice With Iframe\n ProNoticeWithIframe: function ProNoticeWithIframe(__iFrameDOM) {\n // Notice Hide to Outside overlay\n __iFrameDOM.find(\"body\").on(\"click\", \".wp-adminify-popup-overlay\", function (evt) {\n evt.preventDefault();\n $(this).closest(\".wp-adminify-upgrade-popup\").fadeOut(200);\n });\n\n // Notice Hide to close button\n __iFrameDOM.find(\"body\").on(\"click\", \".wp-adminify-upgrade-popup .popup-dismiss\", function (evt) {\n evt.preventDefault();\n $(this).closest(\".wp-adminify-upgrade-popup\").fadeOut(200);\n });\n\n // Notice Show\n __iFrameDOM.find(\"body\").on(\"click\", \".adminify-pro-notice\", function (evt) {\n evt.preventDefault();\n __iFrameDOM.find(\".wp-adminify-upgrade-popup\").fadeIn(200);\n });\n\n /**\n * Fields Notice Class Add\n */\n // Checkbox\n var checkboxLabel = __iFrameDOM.find(\".adminify-pro-checkbox\").parent().parent();\n checkboxLabel.addClass(\"adminify-pro-notice\");\n\n // Color Picker\n var colorPickerLabel = __iFrameDOM.find(\".adminify-field-color_group.adminify-pro-fieldset > .adminify-fieldset\");\n colorPickerLabel.addClass(\"adminify-pro-notice\");\n\n // Gradient Color Picker\n var gradientLolorPickerLabel = __iFrameDOM.find(\".adminify-field-background[data-value='gradient|true'].adminify-pro-feature > .adminify-fieldset\");\n gradientLolorPickerLabel.css(\"pointer-events\", \"none\");\n },\n // Preset Pro Notice\n PresetProNotice: function PresetProNotice(presets) {\n // Presets\n presets.forEach(function (item) {\n var preset_item = document.querySelector(\".adminify--image-group .adminify--image figure input[value=\\\"\".concat(item, \"\\\"]\"));\n if (!preset_item) return;\n var preset = preset_item.parentNode.parentNode;\n preset.classList.add(\"adminify-pro-notice\");\n var proBatch = document.createElement(\"span\");\n proBatch.classList.add(\"adminify-pro-tag\");\n var proText = document.createTextNode(\"Pro\");\n proBatch.appendChild(proText);\n preset.appendChild(proBatch);\n });\n },\n // Preset Pro Notice With Iframe\n PresetProNoticeWithIframe: function PresetProNoticeWithIframe(__iFrameDOM, presets) {\n // Presets\n presets.forEach(function (item) {\n // With Iframe\n var iframe_preset_item = __iFrameDOM.find(\".adminify--image-group .adminify--image figure input[value=\\\"\".concat(item, \"\\\"]\"));\n var iframe_preset = iframe_preset_item.parent().parent();\n iframe_preset.addClass(\"adminify-pro-notice\");\n var iframe_proBatch = document.createElement(\"span\");\n iframe_proBatch.classList.add(\"adminify-pro-tag\");\n var iframe_proText = document.createTextNode(\"Pro\");\n iframe_proBatch.appendChild(iframe_proText);\n iframe_preset.append(iframe_proBatch);\n });\n },\n ToggleSwitcher: function ToggleSwitcher(key, value) {\n if (key == \"\") {\n return;\n }\n jQuery.ajax({\n url: PXLBSADMINIFY_ADMINBAR.ajax_url,\n type: \"post\",\n data: {\n action: \"pxlbsadminify_color_mode\",\n security: PXLBSADMINIFY_ADMINBAR.security_nonce,\n key: key,\n value: value\n }\n });\n },\n // The dark-mode bundle is only shipped up front to users already in dark\n // mode, so switching to dark from a light page has to fetch it first.\n // window.PXLBSADMINIFYDarkMode (printed by Assets::header_scripts) handles that and\n // is a no-op when the bundle is already loaded.\n EnableDarkMode: function EnableDarkMode() {\n $(\"body\").removeClass(\"adminify-light-mode\").addClass(\"adminify-dark-mode\");\n if (window.PXLBSADMINIFYDarkMode) {\n window.PXLBSADMINIFYDarkMode.enable();\n } else if (window.AdminifyDarkMode) {\n window.AdminifyDarkMode.enable({\n brightness: 120\n });\n }\n },\n DisableDarkMode: function DisableDarkMode() {\n $(\"body\").removeClass(\"adminify-dark-mode\").addClass(\"adminify-light-mode\");\n if (window.PXLBSADMINIFYDarkMode) {\n window.PXLBSADMINIFYDarkMode.disable();\n } else if (window.AdminifyDarkMode) {\n window.AdminifyDarkMode.disable();\n }\n },\n SetColorMode: function SetColorMode(color_mode) {\n WP_Adminify.ToggleSwitcher(\"color_mode\", color_mode);\n if (color_mode === \"dark\") {\n WP_Adminify.EnableDarkMode();\n } else if (color_mode === \"light\") {\n WP_Adminify.DisableDarkMode();\n } else if (color_mode === \"system\") {\n var isDark = window.matchMedia(\"(prefers-color-scheme: dark)\").matches;\n if (!!isDark) {\n WP_Adminify.EnableDarkMode();\n } else {\n WP_Adminify.DisableDarkMode();\n }\n }\n },\n // Light/Dark Mode\n //\n // Scoped to the admin bar node. The React shell topbar renders its own\n // switcher under #adminify-color-mode-wrapper using the very same inner\n // class names, so an unscoped lookup would wire these handlers onto that\n // one as well and fight its state. Absent node - the shell page itself -\n // means nothing to do.\n Color_Mode_Switcher: function Color_Mode_Switcher() {\n var wrapper = document.getElementById(\"wp-adminify-color-mode-wrapper\");\n if (!wrapper) return;\n var lightBtn = wrapper.querySelector(\".light-dark-dropdown .light\");\n var darkBtn = wrapper.querySelector(\".light-dark-dropdown .dark\");\n var systemBtn = wrapper.querySelector(\".light-dark-dropdown .system\");\n var dropdown = wrapper.querySelector(\".light-dark-dropdown\");\n var modeIcon = wrapper.querySelector(\".mode-icon\");\n var lightIcon = wrapper.querySelector(\".mode-icon .lightIcon\");\n var darkIcon = wrapper.querySelector(\".mode-icon .darkIcon\");\n var systemIcon = wrapper.querySelector(\".mode-icon .systemIcon\");\n if (!lightBtn || !darkBtn || !systemBtn || !dropdown || !modeIcon) return;\n document.addEventListener(\"click\", function (event) {\n var isVisible = getComputedStyle(dropdown).visibility === \"visible\";\n if (!dropdown.contains(event.target)) {\n if (!!isVisible) {\n dropdown.removeAttribute(\"style\");\n }\n }\n });\n handleClick(modeIcon, function () {\n setTimeout(function () {\n dropdown.style.visibility = \"visible\";\n dropdown.style.opacity = \"0.9999\";\n dropdown.style.transform = \"none\";\n }, 10);\n });\n handleClick(lightBtn, function () {\n WP_Adminify.SetColorMode(\"light\");\n lightIcon.style.display = \"block\";\n darkIcon.style.display = \"none\";\n systemIcon.style.display = \"none\";\n });\n handleClick(darkBtn, function () {\n WP_Adminify.SetColorMode(\"dark\");\n lightIcon.style.display = \"none\";\n systemIcon.style.display = \"none\";\n darkIcon.style.display = \"block\";\n });\n handleClick(systemBtn, function () {\n WP_Adminify.SetColorMode(\"system\");\n systemIcon.style.display = \"block\";\n lightIcon.style.display = \"none\";\n darkIcon.style.display = \"none\";\n });\n\n /**\n * Handle click\n * @param {css selector} el\n * @param {function} callback\n * @returns\n */\n function handleClick(el, callback) {\n return el.addEventListener(\"click\", callback);\n }\n },\n // Screens Tab\n Screen_Option_Switcher: function Screen_Option_Switcher() {\n $(\"#screen-option-switcher-btn\").on(\"click\", function () {\n var screen_options_tab = $(\"#screen-option-switcher-btn\").is(\":checked\") ? 1 : 0;\n WP_Adminify.ToggleSwitcher(\"screen_options_tab\", screen_options_tab);\n if (screen_options_tab) {\n $(\"#screen-options-link-wrap\").css(\"display\", \"none\");\n }\n });\n },\n // Help Tab\n Help_Tab: function Help_Tab() {\n $(\"#help-option-switcher-btn\").on(\"click\", function () {\n var adminify_help_tab = $(\"#help-option-switcher-btn\").is(\":checked\") ? 1 : 0;\n WP_Adminify.ToggleSwitcher(\"adminify_help_tab\", adminify_help_tab);\n if (adminify_help_tab) {\n $(\"#contextual-help-link-wrap\").css(\"display\", \"none\");\n }\n });\n },\n // Hide WP Links\n Hide_WP_Links: function Hide_WP_Links() {\n $(\"#hide-wp-links-switcher-btn\").on(\"click\", function () {\n var hide_wp_links = $(\"#hide-wp-links-switcher-btn\").is(\":checked\") ? 1 : 0;\n WP_Adminify.ToggleSwitcher(\"hide_wp_links\", hide_wp_links);\n });\n },\n // Copy Active Plugins\n Copy_Active_Plugins: function Copy_Active_Plugins(e) {\n e.preventDefault();\n $(\".adminify-copy-btn\").copyToClipboard({\n parent: \".adminify-server-info\",\n content: \".adminify-active-plugins-data\",\n onSuccess: function onSuccess($element, source, selection) {\n $(\"span\", $element).text($element.attr(\"data-text-copied\"));\n setTimeout(function () {\n $(\"span\", $element).text($element.attr(\"data-text\"));\n }, 200000);\n }\n });\n },\n Dismiss_Notice: function Dismiss_Notice() {\n $(\"div[data-dismissible] .notice-dismiss,div[data-dismissible] .adminify-notice-dismiss, div[data-dismissible] .dismiss-this\").on(\"click\", function (event) {\n event.preventDefault();\n var $this = $(this);\n var attr_value, option_name, dismissible_length, data;\n attr_value = $this.closest(\"div[data-dismissible]\").attr(\"data-dismissible\").split(\"-\");\n\n // remove the dismissible length from the attribute value and rejoin the array.\n dismissible_length = attr_value.pop();\n option_name = attr_value.join(\"-\");\n data = {\n action: \"adminify_dismiss_admin_notice\",\n option_name: option_name,\n dismissible_length: dismissible_length,\n notice_nonce: PXLBSADMINIFY_ADMINBAR.notice_nonce\n };\n\n // We can also pass the url value separately from ajaxurl for front end AJAX implementations\n $.post(PXLBSADMINIFY_ADMINBAR.ajax_url, data);\n $this.closest(\"div[data-dismissible]\").hide(\"slow\");\n });\n },\n animateCSS: function animateCSS(element, animation) {\n var prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : \"animate__\";\n // We create a Promise and return it\n new Promise(function (resolve, reject) {\n var animationName = \"\".concat(prefix).concat(animation);\n var node = document.querySelector(element);\n node.classList.add(\"\".concat(prefix, \"animated\"), animationName);\n\n // When the animation ends, we clean the classes and resolve the Promise\n function handleAnimationEnd(event) {\n event.stopPropagation();\n node.classList.remove(\"\".concat(prefix, \"animated\"), animationName);\n resolve(\"Animation ended\");\n }\n node.addEventListener(\"animationend\", handleAnimationEnd, {\n once: true\n });\n });\n },\n VersionRollback: function VersionRollback() {\n $(\"select.wp-adminify-rollback-select\").on(\"change\", function () {\n var $this = $(this),\n $rollbackButton = $this.next(\".wp-adminify-rollback-button\"),\n placeholderText = $rollbackButton.data(\"placeholder-text\"),\n placeholderUrl = $rollbackButton.data(\"placeholder-url\");\n $rollbackButton.html(placeholderText.replace(\"{VERSION}\", $this.val()));\n $rollbackButton.attr(\"href\", placeholderUrl.replace(\"VERSION\", $this.val()));\n }).trigger(\"change\");\n $(\"body\").removeClass(\"wp-adminify--popup-show\");\n $(\".wp-adminify-rollback-button\").on(\"click\", function (event) {\n event.preventDefault();\n var $this = $(this);\n $(\"body\").addClass(\"wp-adminify--popup-show\");\n $(\".wp-adminify-dialog-ok\").on(\"click\", function (event) {\n event.preventDefault();\n location.href = $this.attr(\"href\");\n });\n });\n }\n };\n\n // Documents Loaded\n $(function () {\n // Extra space appears on Folder Widget in Horizontal Menu mode\n var hmenuHeight = $(\".wp-adminify-horizontal-menu\").height();\n $(\".wp-adminify.horizontal-menu.has-folder-options .wp-adminify--folder-widget\").css(\"top\", hmenuHeight * 1.05);\n function fixClasses() {\n var width = $(window).innerWidth();\n if (width <= 767) {\n if ($(\"body\").hasClass(\"adminify-ui\")) {\n $(\"body\").removeClass(\"folded auto-fold\");\n } else {\n $(\"body\").removeClass(\"folded\");\n }\n }\n if (width <= 1023 && width > 767) {\n $(\"body\").addClass(\"folded\");\n }\n }\n fixClasses();\n $(window).on(\"resize\", function () {\n fixClasses();\n });\n\n // Presets\n var presets = [\"preset3\", \"preset4\", \"preset5\", \"preset6\", \"preset7\", \"preset8\", \"preset9\", \"custom\"];\n\n // Not PRO and With Adminify UI\n if (!isPro && !!isAdminifyUI) {\n waitForElm(\"#frame-adminify-app--iframe\").then(function (elm) {\n elm.contentWindow.onload = function (event) {\n var __iFrameDOM = $(\"#frame-adminify-app--iframe\").contents();\n WP_Adminify.PresetProNoticeWithIframe(__iFrameDOM, presets);\n WP_Adminify.ProNoticeWithIframe(__iFrameDOM);\n };\n });\n }\n\n // Not PRO and Without Adminify UI\n if (!isPro && !isAdminifyUI) {\n WP_Adminify.PresetProNotice(presets);\n WP_Adminify.ProNotice();\n }\n\n // The admin bar switcher renders on every screen that falls back to the\n // plain admin - the site editor, and anything else the frame refuses to\n // embed - so wire it whether or not Adminify UI is on. It no-ops when the\n // node is absent, which is the case on the shell page itself.\n WP_Adminify.Color_Mode_Switcher();\n\n // Menu Search for standard WP admin sidebar (without Adminify UI) - Pro only\n if (isPro && !isAdminifyUI && PXLBSADMINIFY_ADMIN.settings.menu_search) {\n var $adminMenu = $(\"#adminmenu\");\n if ($adminMenu.length) {\n var searchHtml = '<li id=\"adminify-wp-menu-search\" class=\"adminify-wp-menu-search\">' + '<div class=\"adminify-wp-menu-search-wrap\">' + '<input type=\"text\" class=\"adminify-wp-menu-search-input\" placeholder=\"Search tools...\" />' + '<svg class=\"adminify-wp-menu-search-icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"11\" cy=\"11\" r=\"8\"/><line x1=\"21\" y1=\"21\" x2=\"16.65\" y2=\"16.65\"/></svg>' + '</div>' + '</li>';\n $adminMenu.prepend(searchHtml);\n $adminMenu.on(\"input\", \".adminify-wp-menu-search-input\", function () {\n var query = $(this).val().toLowerCase().trim();\n $adminMenu.find(\"> li\").not(\"#adminify-wp-menu-search\").each(function () {\n var $item = $(this);\n if (!query) {\n $item.show();\n return;\n }\n var menuText = $item.find(\".wp-menu-name\").first().text().toLowerCase();\n var submenuMatch = false;\n $item.find(\".wp-submenu li a\").each(function () {\n if ($(this).text().toLowerCase().indexOf(query) !== -1) {\n submenuMatch = true;\n return false;\n }\n });\n if (menuText.indexOf(query) !== -1 || submenuMatch) {\n $item.show();\n } else {\n $item.hide();\n }\n });\n });\n }\n }\n\n // WP_Adminify.ToggleSwitcher();\n\n WP_Adminify.Screen_Option_Switcher();\n WP_Adminify.Help_Tab();\n WP_Adminify.Hide_WP_Links();\n WP_Adminify.Dismiss_Notice();\n WP_Adminify.VersionRollback();\n // WP_Adminify.Copy_Active_Plugins();\n\n // Copy to Clipboard Section\n (function (n) {\n n.fn.copyToClipboard = function (e) {\n var t = n.extend({\n parent: \"body\",\n content: \"\",\n onSuccess: function onSuccess() {},\n onError: function onError() {}\n }, e);\n return this.each(function () {\n var e = n(this);\n e.on(\"click\", function () {\n var n = e.parents(t.parent).find(t.content);\n var o = document.createRange();\n var c = window.getSelection();\n o.selectNodeContents(n[0]);\n c.removeAllRanges();\n c.addRange(o);\n try {\n var r = document.execCommand(\"copy\");\n var a = r ? \"onSuccess\" : \"onError\";\n t[a](e, n, c.toString());\n } catch (i) {}\n c.removeAllRanges();\n });\n });\n };\n })(jQuery);\n\n // $(\".adminify-copy-btn\").on(\"click\", function (e) {\n // e.preventDefault();\n // $(\".adminify-copy-btn\").copyToClipboard({\n // parent: \".adminify-server-info\",\n // content: \".adminify-active-plugins-data\",\n // onSuccess: function ($element, source, selection) {\n // $(\"span\", $element).text($element.attr(\"data-text-copied\"));\n // setTimeout(function () {\n // $(\"span\", $element).text($element.attr(\"data-text\"));\n // }, 2000);\n // },\n // });\n // });\n\n if ($(window).innerWidth() <= 1200) {\n $(\".adminify-search-expand\").on(\"click\", function () {\n $(\".top-header--search--form\").toggleClass(\"adminify-form-expand\");\n });\n }\n if (PXLBSADMINIFY_THIRDPARTY !== undefined || PXLBSADMINIFY_THIRDPARTY != null) {\n // betterlinks menu settings\n if (PXLBSADMINIFY_THIRDPARTY.better_links.active === true) {\n var _PXLBSADMINIFY_THIRDP = PXLBSADMINIFY_THIRDPARTY.better_links,\n menu_name = _PXLBSADMINIFY_THIRDP.menu_name,\n submenu_manage = _PXLBSADMINIFY_THIRDP.submenu_manage,\n submenu_name = _PXLBSADMINIFY_THIRDP.submenu_name,\n submenu_settings = _PXLBSADMINIFY_THIRDP.submenu_settings;\n if ($(\"body\").hasClass(\"toplevel_page_betterlinks\")) {\n if (menu_name) {\n $(\".toplevel_page_betterlinks #toplevel_page_betterlinks .wp-menu-name\").text(menu_name);\n }\n setTimeout(function () {\n if (menu_name) {\n $(\".toplevel_page_betterlinks #toplevel_page_betterlinks .wp-submenu .wp-submenu-head\").text(menu_name);\n }\n if (submenu_manage) {\n $(\".toplevel_page_betterlinks #toplevel_page_betterlinks .wp-submenu li:nth-child(2) a\").text(submenu_manage);\n }\n if (submenu_name) {\n $(\".toplevel_page_betterlinks #toplevel_page_betterlinks .wp-submenu li:nth-child(3) a\").text(submenu_name);\n }\n if (submenu_settings) {\n $(\".toplevel_page_betterlinks #toplevel_page_betterlinks .wp-submenu li:nth-child(4) a\").text(submenu_settings);\n }\n }, 500);\n }\n }\n }\n });\n\n // Click with Reload\n $(\".adminify-toolbar .adminify-top-menu-my-sites a\").on(\"click\", function (event) {\n setTimeout(function () {\n window.location.reload();\n }, 100);\n });\n})(jQuery);\n\n// Pro-locked controls: server-side render handler already strips name=\n// and disables inputs on Pro-only fields. This DOMContentLoaded sweep\n// is defense-in-depth in case a future field type's render path\n// bypasses the PHP filter.\ndocument.addEventListener('DOMContentLoaded', function () {\n var isPro = PXLBSADMINIFY_ADMIN.is_pro;\n if (!isPro) {\n var fieldSelectors = ['.adminify-pro-fieldset', '.adminify-pro-feature', '.adminify-pro-notice', '.adminify-pro-locked'];\n var optionLiSelector = 'li:has(.adminify-pro-checkbox), li:has(.adminify-pro-locked-option)';\n var fieldInputs = document.querySelectorAll(fieldSelectors.map(function (s) {\n return s + ' input, ' + s + ' select, ' + s + ' textarea';\n }).join(', '));\n var optionInputs = [];\n try {\n optionInputs = document.querySelectorAll(optionLiSelector.split(',').map(function (s) {\n return s.trim() + ' input, ' + s.trim() + ' select, ' + s.trim() + ' textarea';\n }).join(', '));\n } catch (e) {\n // Browsers without :has() (Safari < 15.4): server-side handler\n // already enforced the option-level lock.\n optionInputs = [];\n }\n [fieldInputs, optionInputs].forEach(function (list) {\n Array.prototype.forEach.call(list, function (el) {\n el.removeAttribute('name');\n el.disabled = true;\n el.setAttribute('tabindex', '-1');\n });\n });\n }\n});\nfunction waitForElm(selector) {\n return new Promise(function (resolve) {\n if (document.querySelector(selector)) {\n return resolve(document.querySelector(selector));\n }\n var observer = new MutationObserver(function (mutations) {\n if (document.querySelector(selector)) {\n observer.disconnect();\n resolve(document.querySelector(selector));\n }\n });\n\n // If you get \"parameter 1 is not of type 'Node'\" error, see https://stackoverflow.com/a/77855838/492336\n observer.observe(document.body, {\n childList: true,\n subtree: true\n });\n });\n}\n\n//# sourceURL=webpack://adminify/./dev/admin/wp-adminify.js?");
20
21 /***/ })
22
23 /******/ });
24 /************************************************************************/
25 /******/ // The require scope
26 /******/ var __webpack_require__ = {};
27 /******/
28 /************************************************************************/
29 /******/ /* webpack/runtime/define property getters */
30 /******/ (() => {
31 /******/ // define getter functions for harmony exports
32 /******/ __webpack_require__.d = (exports, definition) => {
33 /******/ for(var key in definition) {
34 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
35 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
36 /******/ }
37 /******/ }
38 /******/ };
39 /******/ })();
40 /******/
41 /******/ /* webpack/runtime/hasOwnProperty shorthand */
42 /******/ (() => {
43 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
44 /******/ })();
45 /******/
46 /******/ /* webpack/runtime/make namespace object */
47 /******/ (() => {
48 /******/ // define __esModule on exports
49 /******/ __webpack_require__.r = (exports) => {
50 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
51 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
52 /******/ }
53 /******/ Object.defineProperty(exports, '__esModule', { value: true });
54 /******/ };
55 /******/ })();
56 /******/
57 /************************************************************************/
58 /******/
59 /******/ // startup
60 /******/ // Load entry module and return exports
61 /******/ // This entry module can't be inlined because the eval devtool is used.
62 /******/ var __webpack_exports__ = {};
63 /******/ __webpack_modules__["./dev/admin/wp-adminify.js"](0, __webpack_exports__, __webpack_require__);
64 /******/
65 /******/ })()
66 ;