PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 4.2.24
Adminify – White Label, Admin Menu Editor, Login Customizer v4.2.24
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-addons.js

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

32 lines 7.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 /******/ var __webpack_modules__ = ({
11
12 /***/ "./dev/admin/addons.js":
13 /*!*****************************!*\
14 !*** ./dev/admin/addons.js ***!
15 \*****************************/
16 /***/ (() => {
17
18 eval("(function ($) {\n // Install WP Adminify Plugin\n // $('body').on('click', '.wp-adminify-addons-download', function (e) {\n // e.preventDefault();\n // if (!$(this).hasClass(\"updating-message\")) {\n // let plugin = $(this).attr(\"data-plugin\");\n // installAdminifyPlugin($(this), plugin);\n // }\n // });\n\n function installAdminifyPlugin(element, plugin) {\n element.addClass(\"updating-message\");\n element.text(\"Installing...\");\n jQuery.ajax({\n url: PXLBSADMINIFY_CORE.admin_ajax,\n type: \"POST\",\n data: {\n action: \"pxlbsadminify_addons_install_active\",\n type: \"install\",\n plugin: plugin,\n nonce: PXLBSADMINIFY_CORE.addons_nonce\n },\n success: function success(response) {\n setTimeout(function () {\n element.removeClass(\"updating-message\");\n element.text(\"Activated\");\n }, 1000);\n }\n });\n }\n\n // Recommended Plugins\n // Install\n $(\"body\").on(\"click\", \".wp-adminify-addons-wrapper .plugin-action-buttons .install-now\", function (e) {\n e.preventDefault();\n if (!$(this).hasClass(\"updating-message\")) {\n var plugin = $(this).attr(\"data-install-url\");\n installPlugin($(this), plugin);\n }\n });\n\n // Active\n $(\"body\").on(\"click\", \".wp-adminify-addons-wrapper .plugin-action-buttons .activate-now\", function () {\n var file = $(this).attr(\"data-plugin-file\");\n activatePlugin($(this), file);\n });\n\n // Update\n $(\"body\").on(\"click\", \".wp-adminify-addons-wrapper .plugin-action-buttons .update-now\", function () {\n if (!$(this).hasClass(\"updating-message\")) {\n var plugin = $(this).attr(\"data-plugin\");\n updatePlugin($(this), plugin);\n }\n });\n\n // Tab\n $(\".wp-adminify-addons-wrapper .filter-links\").on(\"click\", \"a\", function (e) {\n e.preventDefault();\n var cls = $(this).data(\"type\");\n $(this).addClass(\"current\").parent().siblings().find(\"a\").removeClass(\"current\");\n $(\".wp-adminify-addons-wrapper #the-list .plugin-card\").each(function (i, el) {\n if (cls == \"all\") {\n $(this).removeClass(\"hide\");\n } else {\n if ($(this).hasClass(cls)) {\n $(this).removeClass(\"hide\");\n } else {\n $(this).addClass(\"hide\");\n }\n }\n });\n });\n\n // Search\n $(\".wp-adminify-search-plugins #search-plugins\").on(\"keyup\", function () {\n var value = $(this).val();\n var srch = new RegExp(value, \"i\");\n $(\".wp-adminify-addons-wrapper #the-list .plugin-card\").each(function () {\n var $this = $(this);\n if (!($this.find(\".name h3 a, .desc p\").text().search(srch) >= 0)) {\n $this.addClass(\"hide\");\n }\n if ($this.find(\".name h3 a, .desc p\").text().search(srch) >= 0) {\n $this.removeClass(\"hide\");\n }\n });\n });\n})(jQuery);\nfunction activatePlugin(element, plugin) {\n element.addClass(\"button-disabled\");\n element.attr(\"disabled\", \"disabled\");\n element.text(\"Processing...\");\n jQuery.ajax({\n url: PXLBSADMINIFY_CORE.admin_ajax,\n type: \"POST\",\n data: {\n action: \"pxlbsadminify_addons_activate_plugin\",\n plugin: plugin,\n nonce: PXLBSADMINIFY_CORE.addons_nonce\n },\n success: function success(response) {\n if (response.success === true) {\n var pluginStatus = jQuery(\".plugin-status .plugin-status-inactive[data-plugin-file='\" + plugin + \"']\");\n pluginStatus.text(\"Active\");\n pluginStatus.addClass(\"plugin-status-active\");\n pluginStatus.removeClass(\"plugin-status-inactive\");\n element.removeClass(\"active-now\");\n element.text(\"Activated\");\n } else {\n element.removeClass(\"button-disabled\");\n element.prop(\"disabled\", false);\n element.text(\"Activated\");\n }\n }\n });\n}\nfunction installPlugin(element, plugin) {\n element.removeClass(\"button-primary\");\n element.addClass(\"updating-message\");\n element.text(\"Installing...\");\n jQuery.ajax({\n url: PXLBSADMINIFY_CORE.admin_ajax,\n type: \"POST\",\n data: {\n action: \"pxlbsadminify_addons_upgrade_plugin\",\n type: \"install\",\n plugin: plugin,\n nonce: PXLBSADMINIFY_CORE.addons_nonce\n },\n success: function success(response) {\n if (response.success === true) {\n element.removeClass(\"updating-message\");\n element.addClass(\"updated-message installed button-disabled\");\n element.attr(\"disabled\", \"disabled\");\n element.removeAttr(\"data-install-url\");\n element.text(\"Installed!\");\n setTimeout(function () {\n var pluginStatus = jQuery(\".plugin-status .plugin-status-not-install[data-plugin-url='\" + plugin + \"']\");\n pluginStatus.text(\"Active\");\n pluginStatus.addClass(\"plugin-status-active\");\n pluginStatus.removeClass(\"plugin-status-not-install\");\n pluginStatus.removeAttr(\"data-install-url\");\n element.removeClass(\"install-now updated-message installed\");\n element.text(\"Activated\");\n element.removeAttr(\"aria-label\");\n }, 500);\n } else {\n element.removeClass(\"updating-message\");\n element.addClass(\"button-primary\");\n element.text(\"Install Now\");\n }\n }\n });\n}\nfunction updatePlugin(element, plugin) {\n element.addClass(\"updating-message\");\n element.text(\"Updating...\");\n jQuery.ajax({\n url: PXLBSADMINIFY_CORE.admin_ajax,\n type: \"POST\",\n data: {\n action: PXLBSADMINIFY_CORE.plugin_key + \"_addons_upgrade_plugin\",\n type: \"update\",\n plugin: plugin,\n nonce: PXLBSADMINIFY_CORE.addons_nonce\n },\n success: function success(response) {\n if (response.success === true) {\n element.removeClass(\"updating-message\");\n element.addClass(\"updated-message button-disabled\");\n element.attr(\"disabled\", \"disabled\");\n element.text(\"Updated!\");\n if (response.data.active === false) {\n var pluginStatus = jQuery(\".plugin-status .plugin-status-inactive[data-plugin-file='\" + plugin + \"']\");\n pluginStatus.text(\"Active\");\n pluginStatus.addClass(\"plugin-status-active\");\n pluginStatus.removeClass(\"plugin-status-inactive\");\n pluginStatus.removeAttr(\"data-plugin-file\");\n }\n } else {\n element.removeClass(\"updating-message\");\n element.text(\"Update Now\");\n }\n }\n });\n}\n\n//# sourceURL=webpack://adminify/./dev/admin/addons.js?");
19
20 /***/ })
21
22 /******/ });
23 /************************************************************************/
24 /******/
25 /******/ // startup
26 /******/ // Load entry module and return exports
27 /******/ // This entry module can't be inlined because the eval devtool is used.
28 /******/ var __webpack_exports__ = {};
29 /******/ __webpack_modules__["./dev/admin/addons.js"]();
30 /******/
31 /******/ })()
32 ;