Файловый менеджер - Редактировать - /home/harasnat/www/labour/wp-content/plugins/wpforms-lite/assets/js/integrations/elementor/editor-modern.min.js
Назад
var WPFormsElementorModern=window.WPFormsElementorModern||((i,d)=>{let c=wpformsElementorVars.strings,t=wpformsElementorVars.route_namespace,o=wpformsElementorVars.stockPhotos?.urlPath,{isPro:r,isLicenseActive:n}=wpformsElementorVars,s=wpformsElementorVars.stockPhotos?.pictures??[],a="",l={},p=["themes","field_styles","label_styles","button_styles","container_styles","background_styles","other_styles"],u={init(){u.events()},events(){d(i).on("elementor/frontend/init",function(e,o,t){elementor.channels.editor.on("section:activated",u.onSectionActivated),elementor.hooks.addAction("panel/open_editor/widget/wpforms",u.widgetPanelOpen),elementorFrontend.hooks.addAction("frontend/element_ready/wpforms.default",u.widgetReady)})},onSectionActivated(e,o){u.checkForLeadForms(e,o),u.stockPhotos.backgroundUrlEvents(e,o),u.blockProControls(e,o)},blockProControls(e,o){wpformsElementorVars.isPro&&wpformsElementorVars.isLicenseActive||"style"!==o.activeTab||(o.$el.find(".elementor-control-background_styles").addClass("wpforms-elementor-section-disabled").attr("data-wpforms-section","background"),o.$el.find(".elementor-control-container_styles").addClass("wpforms-elementor-section-disabled").attr("data-wpforms-section","container"),"background_styles"!==e&&"container_styles"!==e||o.$el.find(".elementor-control:not(.elementor-control-type-section)").addClass("wpforms-elementor-control-disabled").each(function(){0===d(this).find(".wpforms-disabled-control-overlay").length&&d(this).css("position","relative").append('<div class="wpforms-disabled-control-overlay"></div>')}),o.$el.data("wpforms-overlay-handler-bound"))||(o.$el.on("click",".wpforms-disabled-control-overlay",function(e){e.preventDefault(),e.stopImmediatePropagation();e=d(this).closest(".elementor-control").prevAll(".elementor-control-type-section").first().attr("data-wpforms-section");r?n||u.showLicenseModal(c.pro_sections[e]):u.showProModal(e,c.pro_sections[e])}),o.$el.data("wpforms-overlay-handler-bound",!0))},checkForLeadForms(e,o){var t;p.includes(e)&&"wpforms"===o.model.attributes.widgetType&&(e=o.$childViewContainer[0],t=o.options.editedElementView.$el[0],o=o.model.attributes.settings.attributes.form_id,0!==(t=d(t).find("#wpforms-"+o)).length)&&t.hasClass("wpforms-lead-forms-container")&&(d(e).addClass("wpforms-elementor-disabled"),d(e).find(".wpforms-elementor-lead-forms-notice").css("display","block"))},widgetPanelOpen(e,o,t){o=o.get("settings");o.on("change:copyPasteJsonValue",e=>{u.pasteSettings(e,t)}),o.on("change",e=>{u.changeStyleSettings(e,t),e.changed.copyPasteJsonValue||e.changed.form_id||u.updateCopyPasteContent(e)}),o.on("change:form_id",e=>{e.attributes.copyPasteJsonValue||setTimeout(function(){u.updateCopyPasteContent(e)},0)})},widgetReady(e){var o=e.find(".wpforms-form").data("formid");u.updateAccentColors(e,o),u.loadChoicesJS(e,o),u.initRichTextField(o),u.initRepeaterField(o)},changeStyleSettings(e,o){var t=o.$el.find(".wpforms-container")[0];if(t){var r,n=e.parseGlobalSettings(e);for(r in e.changed)if(u.getStyleAttributesKeys().includes(r)){o.allowRender=!1;var s=["customThemeName","isCustomTheme","wpformsTheme"];if(!s.includes(r)){var a=u.getParsedValue(r,n),l=r.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),a=u.prepareComplexAttrValues(a,r);if("function"==typeof u.getStyleHandlers()[l])u.getStyleHandlers()[l](t,a,n);else switch(l){case"field-size":case"label-size":case"button-size":case"container-shadow-size":for(var i in wpformsElementorVars.sizes[l][a])t.style.setProperty(`--wpforms-${l}-`+i,wpformsElementorVars.sizes[l][a][i]);break;default:t.style.setProperty("--wpforms-"+l,a),"cover"===n.backgroundSize&&t.style.setProperty("--wpforms-background-size","cover")}}}else o.allowRender="copyPasteJsonValue"!==r}},getStyleHandlers(){return{"background-image":u.background.setContainerBackgroundImage,"background-position":u.background.setContainerBackgroundPosition,"background-repeat":u.background.setContainerBackgroundRepeat,"background-color":u.background.setBackgroundColor,"background-url":u.background.setBackgroundUrl,"background-size":u.background.handleSizeFromDimensions,"background-width":u.background.handleSizeFromWidth,"background-height":u.background.handleSizeFromHeight}},prepareComplexAttrValues(o,e){if(!["fieldBorderRadius","fieldBorderSize","buttonBorderRadius","buttonBorderSize","containerPadding","containerBorderWidth","containerBorderRadius","backgroundWidth","backgroundHeight"].includes(e)||"number"!=typeof o&&("string"!=typeof o||o.trim().endsWith("px"))||(o+="px"),"backgroundUrl"===e){let e="object"==typeof o?o?.url:o;o=e="string"!=typeof e||e.trim().startsWith("url(")?e:e?`url( ${e} )`:"url()"}return o},updateCopyPasteContent(e){var o=u.getStyleAttributesKeys();let t={},r=e.parseGlobalSettings(e);o.forEach(function(e){t[e]=u.getParsedValue(e,r)}),e.setExternalChange("copyPasteJsonValue",JSON.stringify(t))},resetGlobalStyleSettings(e,o){e.get("__globals__")&&!e.changed.__globals__&&elementorCommon.api.run("document/globals/settings",{container:o,settings:{},options:{external:!0,render:!1}})},pasteSettings(e,o){var t=e.changed.copyPasteJsonValue,r=u.parseValidateJson(t),o=o.container;r?(u.resetGlobalStyleSettings(e,o),e.set(r)):(t&&elementorCommon.dialogsManager.createWidget("alert",{message:c.copy_paste_error,headerMessage:c.heads_up}).show(),this.updateCopyPasteContent(e))},parseValidateJson(e){if("string"!=typeof e)return!1;let o;try{o=JSON.parse(e)}catch(e){o=!1}return o},getStyleAttributesKeys(){return["containerPadding","containerBorderStyle","containerBorderWidth","containerBorderRadius","containerShadowSize","containerBorderColor","fieldSize","fieldBorderStyle","fieldBorderRadius","fieldBorderSize","fieldBackgroundColor","fieldBorderColor","fieldTextColor","fieldMenuColor","pageBreakColor","labelSize","labelColor","labelSublabelColor","labelErrorColor","buttonSize","buttonBorderStyle","buttonBorderSize","buttonBorderRadius","buttonBackgroundColor","buttonBorderColor","buttonTextColor","backgroundColor","backgroundPosition","backgroundUrl","backgroundRepeat","backgroundSize","backgroundSizeMode","backgroundWidth","backgroundHeight","backgroundImage","customThemeName","isCustomTheme"]},getParsedValue(e,o){o=o[e];let t;return t=void 0!==o&&("object"==typeof o&&Object.prototype.hasOwnProperty.call(o,"value")?o.value:o)},initRichTextField(e){d(`#wpforms-${e} .wp-editor-wrap`).removeClass("html-active").addClass("tmce-active")},updateAccentColors(e,o){e=e.find("#wpforms-"+o),o=i.WPForms.FrontendModern;o.updateGBBlockPageIndicatorColor(e),o.updateGBBlockIconChoicesColor(e),o.updateGBBlockRatingColor(e)},loadChoicesJS(e,o){"function"==typeof i.Choices&&e.find("#wpforms-"+o).find(".choicesjs-select").each(function(e,t){var n=d(t);if("active"!==n.data("choice")){let e=i.wpforms_choicesjs_config||{},o=n.data("search-enabled"),r=n.closest(".wpforms-field");e.searchEnabled=void 0===o||o,e.callbackOnInit=function(){var e=d(this.passedElement.element),o=d(this.input.element),t=e.data("size-class");t&&d(this.containerOuter.element).addClass(t),e.prop("multiple")&&(o.data("placeholder",o.attr("placeholder")),this.getValue(!0).length)&&o.removeAttr("placeholder"),this.disable(),r.find(".is-disabled").removeClass("is-disabled")};try{var s=new Choices(t,e);n.data("choicesjs",s)}catch(e){}}})},initRepeaterField(e){d(`.wpforms-form[data-formid="${e}"] .wpforms-field-repeater > .wpforms-field-repeater-display-rows .wpforms-field-repeater-display-rows-buttons`).each(function(){var e=d(this),o=e.siblings(".wpforms-layout-column").find(".wpforms-field").first().find(".wpforms-field-label"),t=i.getComputedStyle(o.get(0))?.getPropertyValue("--wpforms-field-size-input-spacing")||0,o=(o.outerHeight()||0)+parseInt(t,10)+10;e.css({top:o})}),d(`.wpforms-form[data-formid="${e}"]`).each(function(){var e=d(this).find(".wpforms-field-repeater");e.find(".wpforms-field-repeater-display-rows-buttons").addClass("wpforms-init"),e.find(".wpforms-field-repeater-display-rows:last .wpforms-field-description").addClass("wpforms-init")})},showProModal(e,o){let t="pro",r=i.parent.wpforms_education??[],n=i.parent.WPFormsEducation??{};var s=r.upgrade.pro.message_plural.replace(/%name%/g,o);let a=elementor.getPanelView().$el,l={container:"Upgrade to Pro - Container Styles",background:"Upgrade to Pro - Background Styles",themes:"Upgrade to Pro - Themes"};d.alert({backgroundDismiss:!0,title:o+" "+r.upgrade.pro.title_plural,icon:"fa fa-lock",content:s,boxWidth:"550px",useBootstrap:!1,theme:"modern,wpforms-education",closeIcon:!0,onOpen(){this.$el.on("click",function(e){e.stopPropagation()})},onOpenBefore:function(){this.$btnc.after('<div class="discount-note">'+r.upgrade_bonus+"</div>"),this.$btnc.after(r.upgrade.pro.doc.replace(/%25name%25/g,"AP - "+o).replace("gutenberg","elementor")),this.$body.find(".jconfirm-content").addClass("lite-upgrade"),a.addClass("wpforms-elementor-disabled")},onClose(){a.removeClass("wpforms-elementor-disabled")},buttons:{confirm:{text:c.upgrade_button,btnClass:"btn-confirm",keys:["enter"],action:()=>{i.open(n.core.getUpgradeURL(l[e],t).replace("gutenberg","elementor"),"_blank")}}}})},showLicenseModal(e){let o=elementor.getPanelView().$el;d.alert({title:c.heads_up,content:c.license_message.replace(/%name%/g,`<strong>${e}</strong>`),icon:"fa fa-exclamation-circle",type:"orange",useBootstrap:!1,boxWidth:"400px",theme:"modern",onOpenBefore(){o.addClass("wpforms-elementor-disabled")},onOpen(){this.$el.on("click",function(e){e.stopPropagation()})},onClose(){o.removeClass("wpforms-elementor-disabled")},buttons:{confirm:{text:c.license_button,btnClass:"btn-confirm",keys:["enter"],action(){i.open(c.license_url,"_blank")}},cancel:{text:c.cancel}}})},background:{setContainerBackgroundImage(e,o){"none"===o&&e.style.setProperty("--wpforms-background-url","url()")},setBackgroundUrl(e,o){e.style.setProperty("--wpforms-background-url",o)},setBackgroundColor(e,o){e.style.setProperty("--wpforms-background-color",o)},setContainerBackgroundPosition(e,o){e.style.setProperty("--wpforms-background-position",o)},setContainerBackgroundRepeat(e,o){e.style.setProperty("--wpforms-background-repeat",o)},setContainerBackgroundWidth(e,o){e.style.setProperty("--wpforms-background-width",o)},setContainerBackgroundHeight(e,o){e.style.setProperty("--wpforms-background-height",o)},handleSizeFromDimensions(e,o,t){var r=u.prepareComplexAttrValues(t.backgroundWidth,"backgroundWidth"),t=u.prepareComplexAttrValues(t.backgroundHeight,"backgroundHeight");"cover"===o?(u.background.setContainerBackgroundWidth(e,r),u.background.setContainerBackgroundHeight(e,t),e.style.setProperty("--wpforms-background-size","cover")):e.style.setProperty("--wpforms-background-size",r+" "+t)},handleSizeFromWidth(e,o,t){var r=u.prepareComplexAttrValues(t.backgroundWidth,"backgroundWidth"),n=u.prepareComplexAttrValues(t.backgroundHeight,"backgroundHeight");u.background.setContainerBackgroundWidth(e,r),"cover"!==t.backgroundSize&&e.style.setProperty("--wpforms-background-size",o+" "+n)},handleSizeFromHeight(e,o,t){var r=u.prepareComplexAttrValues(t.backgroundWidth,"backgroundWidth");u.background.setContainerBackgroundHeight(e,o),"cover"!==t.backgroundSize&&e.style.setProperty("--wpforms-background-size",r+" "+o)}},stockPhotos:{openModal(e){u.stockPhotos.isPicturesAvailable()?u.stockPhotos.picturesModal():u.stockPhotos.installModal(e)},installModal(e){var o="themes"===e?c.stockInstallTheme:c.stockInstallBg;let t=elementor.getPanelView().$el;d.confirm({title:c.heads_up,content:o+" "+c.stockInstall,icon:"wpforms-exclamation-circle",type:"orange",theme:"modern",useBootstrap:!1,boxWidth:"400px",onOpen(){this.$el.on("click",function(e){e.stopPropagation()})},onOpenBefore(){t.addClass("wpforms-elementor-disabled")},onClose(){t.removeClass("wpforms-elementor-disabled")},buttons:{continue:{text:c.continue,btnClass:"btn-confirm",keys:["enter"],action(){return this.$$continue.prop("disabled",!0).html('<i class="wpforms-loading-spinner wpforms-loading-white wpforms-loading-inline"></i>'+c.installing),this.$$cancel.prop("disabled",!0),u.stockPhotos.install(this,e),!1}},cancel:{text:c.cancel,keys:["esc"]}}})},errorModal(e){elementorCommon.dialogsManager.createWidget("alert",{message:e,headerMessage:c.heads_up}).show()},picturesModal(){let e=elementor.getPanelView().$el;l.picturesModal=d.alert({title:`${c.picturesTitle}<p>${c.picturesSubTitle}</p>`,content:u.stockPhotos.getPictureMarkup(),type:"picture-selector",useBootstrap:!1,boxWidth:"800px",closeIcon:!0,theme:"modern",buttons:!1,onOpenBefore(){e.addClass("wpforms-elementor-disabled")},onOpen(){this.$el.on("click",function(e){e.stopPropagation()}),this.$content.off("click").on("click",".wpforms-elementor-stock-photos-picture",u.stockPhotos.selectPicture)},onClose(){e.removeClass("wpforms-elementor-disabled")}})},install(e,o){l.isInstalling||(l.isInstalling=!0,wp.apiFetch({path:t+"stock-photos/install/",method:"POST"}).then(e=>{e.result?(s=e.pictures||[],"themes"!==o&&u.stockPhotos.picturesModal()):u.stockPhotos.errorModal(e.error)}).catch(e=>{u.stockPhotos.errorModal(`<p>${c.commonError}</p><p>${e.message||e}</p>`)}).finally(()=>{l.isInstalling=!1,e.close()}))},isPicturesAvailable(){return Boolean(s?.length)},getPictureMarkup(){return u.stockPhotos.isPicturesAvailable()?(""===a&&(s.forEach(e=>{e=o+e;a+=`<div class="wpforms-elementor-stock-photos-picture" data-url="${e}" style="background-image: url( '${e}' )" ></div>`}),a=`<div class="wpforms-elementor-stock-photos-pictures-wrap">${a}</div>`),a):""},selectPicture(){var e=d(this).data("url");elementor.getPanelView().getCurrentPageView().getOption("editedElementView").model.get("settings").setExternalChange({backgroundUrl:{id:"",url:e}}),l.picturesModal?.close()},backgroundUrlEvents(e,o){"background_styles"===e&&"wpforms"===o.model.attributes.widgetType&&(e=o.$childViewContainer[0],d(e).find(".elementor-control-backgroundUrl .elementor-control-preview-area").off("click").on("click",e=>{"stock"!==o.model.attributes.settings.attributes.backgroundImage||d(e.target).closest(".elementor-control-media__content__remove").length||(e.preventDefault(),e.stopPropagation(),u.stockPhotos.openModal("bg-styles"))}))}}};return u})((document,window),jQuery);WPFormsElementorModern.init();
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0.02 |
proxy
|
phpinfo
|
Настройка