Файловый менеджер - Редактировать - /home/elecjxjk/tumaninvestigators.com/wp-content/plugins/wpforms-lite/assets/js/admin/builder/form-templates.min.js
Назад
var WPFormsFormTemplates=window.WPFormsFormTemplates||function(e,t,w){const v={},_={init(){w(_.ready),w(t).on("load",function(){"function"==typeof w.ready.then?w.ready.then(_.load):_.load()})},ready(){_.events()},load(){_.showUpgradeBanner()},setup(){WPFormsUtils.triggerEvent(w(e),"wpformsSetupPanelBeforeInitTemplatesList"),v.templateList=new List("wpforms-setup-templates-list",{valueNames:["wpforms-template-name","wpforms-template-desc",{name:"fields",attr:"data-fields"},{name:"slug",attr:"data-slug"},{name:"categories",attr:"data-categories"},{name:"subcategories",attr:"data-subcategories"},{name:"has-access",attr:"data-has-access"},{name:"favorite",attr:"data-favorite"}]})},events(){w(e).on("click","#wpforms-setup-templates-list .wpforms-template-favorite i",_.selectFavorite).on("click","#wpforms-setup-templates-list .wpforms-template-remove i",_.removeTemplate)},selectFavorite(){const e=w(this),t=e.hasClass("fa-heart-o"),a=e.closest(".wpforms-template-favorite"),s=e.closest(".wpforms-template"),o=s.find(".wpforms-template-name"),r=s.find(".wpforms-template-select").data("slug"),l=w(".wpforms-setup-templates-categories").find("[data-category='favorites']"),n=l.find("span"),m={action:"wpforms_templates_favorite",slug:r,favorite:t,nonce:wpforms_form_templates.nonce};let p=parseInt(n.html(),10);function i(){d.favorite=!1,p-=1,f.values(d),u(),o.data("data-favorite",0),n.html(p),_.maybeHideFavoritesCategory()}function c(){d.favorite=!0,p+=1,f.values(d),u(),o.data("data-favorite",1),n.html(p),_.maybeHideFavoritesCategory()}const f=v.templateList.get("slug",r)[0],d=f.values(),u=function(){a.find(".fa-heart-o").toggleClass("wpforms-hidden",d.favorite),a.find(".fa-heart").toggleClass("wpforms-hidden",!d.favorite)};w.post(wpforms_form_templates.ajaxurl,m,function(e){e.success||(t?i:c)()}),(t?c:i)()},removeTemplate(){const e=w(this),t=e.closest(".wpforms-template-remove"),a=t.data("template");w.alert({title:wpforms_form_templates.delete_template_title,content:wpforms_form_templates.delete_template_content,icon:"fa fa-exclamation-circle",type:"red",buttons:{confirm:{text:wpforms_form_templates.delete_template,btnClass:"btn-confirm",keys:["enter"],action(){_.removeUserTemplate(a)}},cancel:{text:wpforms_form_templates.cancel}}})},removeUserTemplate(t){v.templateList.remove("slug","wpforms-user-template-"+t),w.post(wpforms_form_templates.ajaxurl,{action:"wpforms_user_template_remove",template:t,nonce:wpforms_form_templates.nonce},function(e){e.success&&(w("#wpforms-template-wpforms-user-template-"+t).remove(),_.updateCategoryCount("all"),_.updateCategoryCount("user"))})},updateCategoryCount(e){var t=w(".wpforms-setup-templates-categories").find(`[data-category='${e}']`),a=t.find("span"),s=parseInt(a.html(),10);a.html(s-1),t.data("count",s-1),s-1==0&&"user"===e&&t.hasClass("active")&&w(".wpforms-user-templates-empty-state").removeClass("wpforms-hidden")},maybeHideFavoritesCategory(){var e=w(".wpforms-setup-templates-categories"),t=e.find("[data-category='favorites']"),a=parseInt(t.find("span").html(),10);t.toggleClass("wpforms-hidden",!a),t.hasClass("active")&&(a?t:e.find("[data-category='all']")).trigger("click")},searchTemplate(){_.performSearch(w(this).val()),_.showUpgradeBanner()},performSearch(e){e=v.templateList.search(e,["name"],function(a){for(let e=0,t=v.templateList.items.length;e<t;e++){var s=v.templateList.items[e].values(),o=s["wpforms-template-name"].toLowerCase(),r=s["wpforms-template-desc"].toLowerCase(),s=s.fields.toLowerCase(),l=new RegExp(a);v.templateList.items[e].found=l.test(o)||l.test(r)||l.test(s)}});w(".wpforms-templates-no-results").toggle(!e.length)},selectSubCategory(e){e.preventDefault();var e=w(this),t=e.parent("ul").parent("li").parent("ul").children("li.active"),a=w(".wpforms-setup-templates-subcategories li.active");const s=e.data("subcategory"),o=e.parents("li").data("category");var r=w("#wpforms-setup-template-search").val();a.removeClass("active"),t.removeClass("active"),e.parents("li").addClass("active"),e.addClass("active"),v.templateList.filter(function(e){return"all"===o||-1<e.values().categories.split(",").indexOf(o)&&-1<e.values().subcategories.split(",").indexOf(s)}),""!==r&&_.performSearch(r),_.showUpgradeBanner()},selectCategory(e){e.preventDefault();const t=w(this).parent(),a=t.closest("ul").find(".active"),s=t.data("category"),o=t.data("count"),r=w("#wpforms-setup-template-search").val();a.removeClass("active"),t.addClass("active opened"),v.templateList.filter(function(e){return"available"===s?e.values()["has-access"]:"favorites"===s?e.values().favorite:"all"===s||-1<e.values().categories.split(",").indexOf(s)}),w(".wpforms-user-templates-empty-state").toggleClass("wpforms-hidden","user"!==s||0!==o),""!==r&&_.performSearch(r),_.showUpgradeBanner()},toggleSubcategoriesList(e){e.stopPropagation(),w(this).parent().parent().toggleClass("opened")},selectTemplateCancel(){var e=w("#wpforms-setup-templates-list").find(".wpforms-template.active"),t=e.find(".wpforms-template-select");e.removeClass("active"),t.html(t.data("labelOriginal"))},showUpgradeBanner(){var e,t;w("#tmpl-wpforms-templates-upgrade-banner").length&&(e=wp.template("wpforms-templates-upgrade-banner"))&&(5<(t=w("#wpforms-setup-templates-list .wpforms-template")).length?t.eq(5):t.last()).after(e())},selectTemplateProcess(e,t,a,s){a.data("addons")?_.addonsModal(e,t,a,s):s(e,t)},addonsModal(e,t,a,s){var o=a.data("template-name-raw"),r=a.data("addons-names"),l=a.data("addons"),a=a.data("installed"),l=l.split(",");let n;switch(_.action(l,a)){case"multiple":n=wpforms_form_templates.template_addons_prompt;break;case"activate":n=wpforms_form_templates.template_addon_activate;break;case"install":n=wpforms_form_templates.template_addon_prompt;break;default:n=wpforms_form_templates.template_addons_prompt}n=n.replace(/%template%/g,o).replace(/%addons%/g,r),l.length&&(wpforms_form_templates.can_install_addons?_.userCanInstallAddonsModal(e,t,l,n,s,a):_.userCannotInstallAddonsModal(n))},userCanInstallAddonsModal(e,t,a,s,o,r=""){let l;switch(_.action(a,r)){case"multiple":case"install":l=wpforms_form_templates.install_confirm;break;case"activate":l=wpforms_form_templates.activate_confirm;break;default:l=wpforms_form_templates.install_confirm}w.confirm({title:wpforms_form_templates.heads_up,content:s,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:l,btnClass:"btn-confirm",keys:["enter"],action(){return this.$$confirm.prop("disabled",!0).html('<i class="wpforms-loading-spinner wpforms-loading-white wpforms-loading-inline"></i>'+wpforms_form_templates.activating),this.$$cancel.prop("disabled",!0),_.installActivateAddons(a,this,e,t,o),!1}},cancel:{text:wpforms_form_templates.cancel,action(){WPFormsFormTemplates.selectTemplateCancel()}}}})},action(e,t=""){return 1<e.length?"multiple":-1<t.split(",").indexOf(e[0])?"activate":"install"},userCannotInstallAddonsModal(e){w.alert({title:wpforms_form_templates.heads_up,content:e,icon:"fa fa-exclamation-circle",type:"orange",buttons:{ok:{text:wpforms_form_templates.ok,btnClass:"btn-confirm",keys:["enter"],action(){WPFormsFormTemplates.selectTemplateCancel()}}}})},installActivateAddons(e,t,a,s,o){const r=[],l=[];let n=!1;e.forEach(function(t){n="function"!=typeof n.done?_.installActivateAddonAjax(t):n.done(function(e){return r.push(e),_.installActivateAddonAjax(t)}).fail(function(e){l.push(e)})}),n.done(function(e){r.push(e)}).fail(function(e){l.push(e)}).always(function(){t.close(),0<r.length&&wpf.listPluck(r,"success").every(Boolean)&&0===l.length?o(a,s):_.installActivateAddonsError(a,s,o)})},installActivateAddonsError(e,t,a){w.confirm({title:wpforms_form_templates.heads_up,content:wpforms_form_templates.template_addons_error,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_form_templates.use_template,btnClass:"btn-confirm",keys:["enter"],action(){a(e,t)}},cancel:{text:wpforms_form_templates.cancel,action(){_.selectTemplateCancel()}}}})},installActivateAddonAjax(e){var t=wpforms_addons[e],a=new w.Deferred;return!t||["activate","install"].indexOf(t.action)<0?(a.resolve(!1),a.promise()):w.post(wpforms_form_templates.ajaxurl,{action:"wpforms_"+t.action+"_addon",nonce:wpforms_form_templates.admin_nonce,plugin:"activate"===t.action?e+"/"+e+".php":t.url})}};return _}(document,window,jQuery);WPFormsFormTemplates.init();
| ver. 1.4 |
Github
|
.
| PHP 8.1.30 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка