Файловый менеджер - Редактировать - /home/avadvi5/public_html/wp-content/plugins/wpforms/assets/pro/js/admin/builder/notifications.min.js
Ðазад
var WPForms=window.WPForms||{};WPForms.Admin=WPForms.Admin||{},WPForms.Admin.Builder=WPForms.Admin.Builder||{},WPForms.Admin.Builder.Notifications=WPForms.Admin.Builder.Notifications||(n=>{let l={},s={removeItemButton:!0,shouldSort:!1},c,i=[{toggle:{className:".notifications_enable_file_upload_attachment_toggle",actionElements:["file_upload_attachment_fields"]},choicesJS:{fieldName:"file_upload_attachment_fields",choices:"fileUpload"}},{toggle:{className:".notifications_enable_entry_csv_attachment_toggle",actionElements:["entry_csv_attachment_entry_information","entry_csv_attachment_file_name"]},choicesJS:{fieldName:"entry_csv_attachment_entry_information",choices:"entryInformation"}}],d={init(){(c=Object.assign({},s)).noChoicesText=wpforms_builder.notifications_file_upload.no_choices_text,d.setup(),d.bindEvents()},ready(){},setup(){l={$builder:n("#wpforms-builder")}},initBlock(l,a=!1,r=""){let e=l.data("blockId");"notification"===l.data("blockType")&&e&&i.forEach(function(t){d.initToggle(l,e,t.toggle.className,t.toggle.actionElements);var o,n=l.find("."+t.choicesJS.fieldName).first();if(!(n.length<=0)){let e,i=s;"fileUpload"===t.choicesJS.choices?0===(e=d.choicesJSHelperMethods.fileUploadFields.getAllChoices())[0].choices.length&&(i=c):e=d.choicesJSHelperMethods.entryInformation.getAllChoices(),a&&(o=!r,d.initDynamicallyAddedChoicesJS(l,t.choicesJS.fieldName,o),d.setDynamicallyAddedEntryInformationFileNameFieldValue(l,r)),d.initChoicesJS(n,e,i),"fileUpload"===t.choicesJS.choices&&(d.computeForFileUploadAttachmentSize(n),n.on("change",d.fileUploadFieldChange))}})},initToggle(e,i,t,o){e=e.find(t).first();return!(e.length<=0)&&(e.on("change",function(){var e=n(this),i=d.choicesJSHelperMethods.getFormFields(["file-upload"]);e.trigger("wpformsNotificationsToggleConditionalChange",[i])}),d.setupToggleConditional(e,i,o))},setupToggleConditional(e,i,t){var t=t.map(function(e){return`#wpforms-panel-field-notifications-${i}-${e}-wrap`});return!(t.length<=0||(t=t.join(","),e.conditions([{conditions:{element:e,type:"checked",operator:"is",condition:"1"},actions:{if:{element:t,action:"show"},else:{element:t,action:"hide"}},effect:"appear"}]),0))},initChoicesJS(e,i,t){var o,n;return!!e.attr("name")&&(o=e.val(),void 0!==(n=e.data("choicesjs"))&&n.destroy(),WPForms.Admin.Builder.UndoRedo?.preventRecord(!0),n=new Choices(e[0],t),e.data("choicesjs",n),e.on("change",d.changeChoicesJS),d.choicesJSHelperMethods.populateInstance(n,i,o),WPForms.Admin.Builder.UndoRedo?.preventRecord("continue"),n.passedElement.element.addEventListener("addItem",function(e){l.$builder.trigger("wpformsNotificationFieldAdded",[e.detail.value,e.target])}),n.passedElement.element.addEventListener("removeItem",function(e){l.$builder.trigger("wpformsNotificationFieldRemoved",[e.detail.value,e.target])}),n)},changeChoicesJS(){var e=n(this),i=e.data("choicesjs").getValue(),t=e.attr("name");if(t&&i){t=t+"[hidden]",e=e.closest(".wpforms-panel-field").find(`input[name="${t}"]`);if(!(e.length<=0)){var o=[];for(let e=0;e<i.length;e++)o.push(i[e].value);e.val(JSON.stringify(o))}}},fileUploadFieldChange(){d.computeForFileUploadAttachmentSize(n(this))},computeForFileUploadAttachmentSize(e){var t=e.parents(".wpforms-panel-field").find(".notifications-file-upload-attachment-size");if(!(t.length<=0)){var o=e.data("choicesjs").getValue();if(o.length<=0)t.text(0);else{var n=Number(wpforms_builder.notifications_file_upload.wp_max_upload_size);let i=0;for(let e=0;e<o.length;e++){var l,a=wpf.getField(o[e].value);"file-upload"===a.type&&(l=d.utils.convertToNumber(a.max_size,n),a=d.utils.convertToNumber(a.max_file_number,1),i+=l*a)}t.text(+wpf.numberFormat(i,2,".",",").replace(",",""))}}},initDynamicallyAddedChoicesJS(e,i,t){var o=e.data("blockId"),e=e.find(`#wpforms-panel-field-notifications-${o}-${i}-wrap`);e.length<=0||(o=e.find(".choices")).length<=0||(i=o.find("."+i).first()).length<=0||(i.removeClass("choices__input").removeAttr("hidden").removeAttr("data-choice").removeData("choice").prependTo(e.first()),e.find("label:first").prependTo(e.first()),o.first().remove(),t&&i.val([]))},bindEvents(){l.$builder.on("wpformsSettingsBlockAdded",d.notificationBlockAdded).on("wpformsSettingsBlockCloned",d.notificationsBlockCloned).on("wpformsPanelSwitch",d.panelSwitch).on("wpformsPanelSectionSwitch",d.panelSectionSwitch)},notificationBlockAdded(e,i){d.initBlock(i,!0)},setDynamicallyAddedEntryInformationFileNameFieldValue(e,i){e=e.find(".entry_csv_attachment_file_name");e.length<=0||(i=i?n(`#wpforms-panel-field-notifications-${i}-entry_csv_attachment_file_name`).val():"",e.val(0===i.length?wpforms_builder.entry_information.default_file_name:i))},notificationsBlockCloned(e,i,t){d.initBlock(i,!0,t)},panelSwitch(e,i){"settings"===i&&"notifications"===n("#wpforms-panel-settings .wpforms-panel-sidebar").find(".wpforms-panel-sidebar-section.active").data("section")&&d.loopAllNotificationsBlock(function(e){d.initBlock(e)})},loopAllNotificationsBlock(o){n(".wpforms-notification.wpforms-builder-settings-block").each(function(e,i){var i=n(i),t=i.data("blockId");"notification"===i.data("blockType")&&t&&o(i,t)})},panelSectionSwitch(e,i){"notifications"===i&&d.loopAllNotificationsBlock(function(e){d.initBlock(e)})},maybeSaveFormState(){console.warn('WARNING! Function "WPForms.Admin.Builder.Notifications.maybeSaveFormState()" has been deprecated, please use the new "wpf._getCurrentFormState()" function instead!'),wpf._getCurrentFormState()},choicesJSHelperMethods:{fileUploadFields:{getAllChoices(){return[{label:"hidden",choices:d.choicesJSHelperMethods.getFormFields(["file-upload"])}]}},entryInformation:{getAllChoices(){return[{label:"hidden",choices:[{value:"all_fields",label:wpforms_builder.entry_information.localized.all_fields}]},{label:wpforms_builder.fields_available,choices:d.choicesJSHelperMethods.getFormFields(!1,wpforms_builder.entry_information.excluded_field_types)},{label:wpforms_builder.other,choices:d.choicesJSHelperMethods.entryInformation.getOtherChoices()}]},getOtherChoices(){var e,i,t=[];for(e in wpforms_builder.smart_tags)wpforms_builder.entry_information.excluded_tags.includes(e)||(i=Object.hasOwn(wpforms_builder.entry_information.replacement_tags,e)?wpforms_builder.entry_information.replacement_tags[e]:e,t.push({label:wpf.encodeHTMLEntities(wpforms_builder.smart_tags[e]),value:wpf.sanitizeHTML(i)}));return t}},getFormFields(e,i=[]){var t,o=[],n=wpf.getFields(e,!0,!0);if(!n)return[];for(t in n){var l=n[t];if(void 0!==l.label&&!d.choicesJSHelperMethods.isFieldExcluded(l,i)){var a=d.choicesJSHelperMethods.fieldHasRestrictions(l.id);let e=wpf.encodeHTMLEntities(d.choicesJSHelperMethods.getFieldLabel(l));a&&(e+='<span class="wpforms-notifications-restrictions-enabled">'+wpforms_builder.notifications_file_upload.restrictions_enabled+"</span>"),o.push({label:e,value:wpf.sanitizeHTML(l.id.toString()),disabled:a})}}return o},isFieldExcluded(e,i){return Array.isArray(i)&&0<i.length&&i.includes(e.type)},fieldHasRestrictions(e){return Boolean(n(`#wpforms-field-option-${e}-is_restricted`).prop("checked"))},getFieldLabel(e){return 0===e.label.length?""+wpforms_builder.empty_label_alternative_text+e.id:e.label},populateInstance(i,e,t=[]){i&&(i.clearStore(),i.setChoices(e),Array.isArray(t))&&t.forEach(function(e){i.setChoiceByValue(e)})}},utils:{convertToNumber(e,i){e=Number(e);return e<=0?i:e}}};return d})((document,window,jQuery)),WPForms.Admin.Builder.Notifications.init();
| ver. 1.1 | |
.
| PHP 8.3.30 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка