Файловый менеджер - Редактировать - /home/elecjxjk/tumaninvestigators.com/wp-content/plugins/wpforms-lite/assets/js/admin/builder/drag-fields.min.js
Назад
var WPForms=window.WPForms||{};WPForms.Admin=WPForms.Admin||{},WPForms.Admin.Builder=WPForms.Admin.Builder||{},WPForms.Admin.Builder.DragFields=WPForms.Admin.Builder.DragFields||function(g){let w={};const c={};let F;const b={init(){g(b.ready)},ready(){b.setup(),b.initSortableFields(),b.events()},setup(){w={$builder:g("#wpforms-builder"),$sortableFieldsWrap:g("#wpforms-panel-fields .wpforms-field-wrap"),$addFieldsButtons:g(".wpforms-add-fields-button").not(".not-draggable").not(".warning-modal").not(".education-modal")}},events(){w.$builder.on("wpformsFieldDragToggle",b.fieldDragToggleEvent)},disableDragAndDrop(){w.$addFieldsButtons.filter(".ui-draggable").draggable("disable"),w.$sortableFieldsWrap.sortable("disable"),w.$sortableFieldsWrap.find(".wpforms-layout-column.ui-sortable").sortable("disable")},enableDragAndDrop(){w.$addFieldsButtons.filter(".ui-draggable").draggable("enable"),w.$sortableFieldsWrap.sortable("enable"),w.$sortableFieldsWrap.find(".wpforms-layout-column.ui-sortable").sortable("enable")},fieldDragDisable(e,i=!0){if(e.hasClass("ui-draggable-disabled"))e.draggable("enable");else{let r;e.draggable({revert:!0,axis:"y",delay:100,opacity:1,cursor:"move",start(e,l){r=l.position.top},drag(e,l){if(15<Math.abs(l.position.top)-Math.abs(r))return i&&b.youCantReorderFieldPopup(),!1}})}},fieldDragEnable(e){e.hasClass("ui-draggable")||e.draggable("disable")},youCantReorderFieldPopup(){g.confirm({title:wpforms_builder.heads_up,content:wpforms_builder.field_cannot_be_reordered,icon:"fa fa-exclamation-circle",type:"red",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"]}}})},fieldDragToggleEvent(e,l){l=g("#wpforms-field-"+l);l.hasClass("wpforms-field-not-draggable")||l.hasClass("wpforms-field-stick")?b.fieldDragDisable(l):b.fieldDragEnable(l)},initSortableFields(){b.initSortableContainer(w.$sortableFieldsWrap),w.$builder.find(".wpforms-layout-column").each(function(){b.initSortableContainer(g(this))}),b.fieldDragDisable(g(".wpforms-field-not-draggable, .wpforms-field-stick")),b.initDraggableFields()},initSortableContainer(o){const d=g("#wpforms-field-options"),a=g("#wpforms-panel-fields .wpforms-panel-content-wrap");let t,s,n,f,m,p,u=!1;o.sortable({items:"> .wpforms-field:not(.wpforms-field-stick):not(.no-fields-preview)",connectWith:".wpforms-field-wrap, .wpforms-layout-column",delay:100,opacity:1,cursor:"move",cancel:".wpforms-field-not-draggable",placeholder:"wpforms-field-drag-placeholder",appendTo:"#wpforms-panel-fields",zindex:1e4,tolerance:"pointer",distance:1,start(e,l){t=l.item.data("field-id"),s=l.item.data("field-type"),n=void 0===t,f=g("#wpforms-field-option-"+t),c.fieldReceived=!1,c.fieldRejected=!1,c.$sortableStart=o,c.startPosition=l.item.first().index(),w.$builder.trigger("wpformsFieldDragStart",[t])},beforeStop(e,l){!c.glitchChange||F.isFieldAllowedInColum(s,l.item.first().parent())||(c.fieldRejected=!0)},stop(e,l){var r,i=l.item.first();l.placeholder.removeClass("wpforms-field-drag-not-allowed"),i.removeClass("wpforms-field-drag-not-allowed"),c.fieldRejected?(r=n?o:i.parent(),b.revertMoveFieldToColumn(i),w.$builder.trigger("wpformsFieldMoveRejected",[i,l,r])):(p=i.prev(".wpforms-field, .wpforms-alert").data("field-id"),0<(m=g("#wpforms-field-option-"+p)).length?m.after(f):d.prepend(f),!n&&i.closest(".wpforms-layout-column").is(o)&&F.positionFieldInColumn(t,i.index()-1,o),r=i.closest(".wpforms-field-layout, .wpforms-field-repeater"),F.fieldOptionsUpdate(null,t),F.reorderLayoutFieldsOptions(r),n||i.removeClass("wpforms-field-dragging").removeClass("wpforms-field-drag-over"),i.attr("style",""),w.$builder.trigger("wpformsFieldMove",l),c.fieldReceived=!1)},over(e,l){var l=l.item.first(),e=g(e.target),r=e.find(".wpforms-field-drag-placeholder"),i=e.hasClass("wpforms-layout-column"),d={width:e.outerWidth(),height:l.outerHeight()};let o=i?" wpforms-field-drag-to-column":"";i&&(a=e.attr("class").match(/wpforms-layout-column-(\d+)/)[1],o+=" wpforms-field-drag-to-column-"+a),t=l.data("field-id"),s=l.data("field-type")||c.fieldType,n=void 0===t,l.addClass("wpforms-field-dragging"+o),i&&F.isLayoutBasedField(s)||l.css({width:i?d.width-5:d.width,height:"auto"});var a=i?90:d.height;r.removeClass("wpforms-field-drag-not-allowed").css({height:n?a+18:d.height}),i&&!F.isFieldAllowedInColum(s,e)&&(r.addClass("wpforms-field-drag-not-allowed"),l.addClass("wpforms-field-drag-not-allowed")),w.$builder.trigger("wpformsFieldDragOver",[t,e]),n&&l.addClass("wpforms-field-drag-over").removeClass("wpforms-field-drag-out")},out(e,l){var r=l.item.first(),i=void 0===r.data("field-id");r.removeClass("wpforms-field-drag-not-allowed").removeClass(function(e,l){return(l.match(/wpforms-field-drag-to-column(-\d+|)/g)||[]).join(" ")}),c.fieldReceived?r.attr("style",""):i?r.addClass("wpforms-field-drag-out").removeClass("wpforms-field-drag-over"):g(l.sender).closest(".wpforms-field-layout, .wpforms-field-repeater").removeClass("wpforms-field-child-hovered")},receive(e,l){var r=g(l.helper||l.item),i=(t=r.data("field-id"),s=r.data("field-type")||c.fieldType,void 0===t),d=o.hasClass("wpforms-layout-column");d&&!F.isFieldAllowedInColum(s,o)?c.fieldRejected=!0:(c.fieldReceived=!0,r.removeClass("wpforms-field-drag-over"),i?(i=o.data("ui-sortable").currentItem.index(),r.addClass("wpforms-field-drag-over wpforms-field-drag-pending").removeClass("wpforms-field-drag-out").append(WPFormsBuilder.settings.spinnerInline).css("width","100%"),w.$builder.find(".no-fields-preview").remove(),WPFormsBuilder.fieldAdd(c.fieldType,{position:d?i-1:i,placeholder:r,$sortable:o}),c.fieldType=void 0):F.receiveFieldToColumn(t,l.item.index()-1,r.parent()))},change(e,l){l=l.placeholder.parent(),e=g(e.target);c.glitchChange=!1,!o.is(l)&&o.hasClass("wpforms-field-wrap")&&l.hasClass("wpforms-layout-column")&&(c.glitchChange=!0),w.$builder.trigger("wpformsFieldDragChange",[t,e])},sort(l){if(!u){var l=l.clientY,r=a.offset(),i=a.height(),d=r.top+i;let e;if(l>r.top&&l<r.top+50)e="-=";else{if(!(d-50<l&&l<d))return;e="+="}u=!0,a.animate({scrollTop:e+i/3+"px"},800,function(){u=!1})}}})},initDraggableFields(){w.$addFieldsButtons.draggable({connectToSortable:".wpforms-field-wrap, .wpforms-layout-column",delay:200,cancel:!1,scroll:!1,opacity:1,appendTo:"#wpforms-panel-fields",zindex:1e4,helper(){var e=g(this),l=g('<div class="wpforms-field-drag-out wpforms-field-drag">');return c.fieldType=e.data("field-type"),l.html(e.html())},start(e,l){if(WPFormsUtils.triggerEvent(w.$builder,"wpformsFieldAddDragStart",[c.fieldType,l]).isDefaultPrevented())return!1},stop(e,l){if(WPFormsUtils.triggerEvent(w.$builder,"wpformsFieldAddDragStop",[c.fieldType,l]).isDefaultPrevented())return!1}})},revertMoveFieldToColumn(e){var l;void 0===e.data("field-id")?e.remove():(e=e.detach(),l=c.$sortableStart.find("> .wpforms-field").eq(c.startPosition),e.removeClass("wpforms-field-dragging").removeClass("wpforms-field-drag-over").attr("style",""),l.length?l.before(e):c.$sortableStart.append(e))}};return F={positionFieldInColumn(e,l,r){WPForms.Admin.Builder.FieldLayout&&WPForms.Admin.Builder.FieldLayout.positionFieldInColumn(e,l,r)},receiveFieldToColumn(e,l,r){WPForms.Admin.Builder.FieldLayout&&WPForms.Admin.Builder.FieldLayout.receiveFieldToColumn(e,l,r)},fieldOptionsUpdate(e,l){WPForms.Admin.Builder.FieldLayout&&WPForms.Admin.Builder.FieldLayout.fieldOptionsUpdate(e,l)},reorderLayoutFieldsOptions(e){WPForms.Admin.Builder.FieldLayout&&WPForms.Admin.Builder.FieldLayout.reorderLayoutFieldsOptions(e)},isFieldAllowedInColum(e,l){var r;return!WPForms.Admin.Builder.FieldLayout||(r=WPForms.Admin.Builder.FieldLayout.isFieldAllowedInColum(e,l),wp.hooks.applyFilters("wpforms.LayoutField.isFieldAllowedDragInColumn",r,e,l))},isLayoutBasedField(e){return!!WPForms.Admin.Builder.FieldLayout&&WPForms.Admin.Builder.FieldLayout.isLayoutBasedField(e)}},b}((document,window,jQuery)),WPForms.Admin.Builder.DragFields.init();
| ver. 1.4 |
Github
|
.
| PHP 8.1.30 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка