芝麻web文件管理V1.00
编辑当前文件:/var/www/cognitio.in/wp-content/plugins/popup-maker/assets/js/admin-popup-editor.min.js
var cookies;!function(n){"use strict";window.PUM_Admin=window.PUM_Admin||{},window.pum_popup_settings_editor=window.pum_popup_settings_editor||{form_args:{},current_values:{},preview_nonce:null},n(document).on("keydown","#popup-title",function(e){9===(e.keyCode||e.which)&&(e.preventDefault(),n("#title").focus())}).on("keydown","#title, #popup-title",function(e){var t=e.keyCode||e.which;e.shiftKey||9!==t||(e.preventDefault(),e="title"===n(this).attr("id")?"#popup-title":"#insert-media-button",n(e).focus())}).on("keydown","#popup-title, #insert-media-button",function(e){var t=e.keyCode||e.which;e.shiftKey&&9===t&&(e.preventDefault(),e="popup-title"===n(this).attr("id")?"#title":"#popup-title",n(e).focus())}),n(function(){n(this).trigger("pum_init"),n("#title").prop("required",!0);var e=n("#pum-popup-settings-container"),t=pum_popup_settings_editor.form_args||{},i=pum_popup_settings_editor.current_values||{};e.length&&(e.find(".pum-no-js").hide(),PUM_Admin.forms.render(t,i,e)),n("a.page-title-action").clone().attr("target","_blank").attr("href",pum_admin_vars.homeurl+"?popup_preview="+pum_popup_settings_editor.preview_nonce+"&popup="+n("#post_ID").val()).text(pum_admin_vars.I10n.preview_popup).insertAfter("a.page-title-action"),n("#pum-first-condition, #pum-first-trigger, #pum-first-cookie").val(null).trigger("change"),document.querySelector("#pum-popup-settings-container").addEventListener("change",function(e){"open_sound"!==e.target.id||-1===["none","custom"].indexOf(e.target.value)&&((e=new Audio(pum_admin_vars.pm_dir_url+"assets/sounds/"+e.target.value)).addEventListener("canplaythrough",function(){this.play().catch(function(e){console.warn("Sound was not able to play when selected. Reason: "+e)})}),e.addEventListener("error",function(){console.warn("Error occurred when trying to load popup opening sound.")}))}),n(document).on("pum_init",function(){n("#pum-default-click-trigger-class:not(.pum-click-trigger-initialized)").each(function(){n(this).addClass("pum-click-trigger-initialized").text(n("#popup-id").data("popup-id"))})}),document.querySelector("#pum-popup-settings-container").addEventListener("click",function(e){if(Array.from(e.target.classList).includes("popup-type")||Array.from(e.target.parentElement.classList).includes("popup-type")){var t=jQuery("#pum-popup-settings-container");if(1===t.length){var i={"center-popup":{size:"medium",responsive_min_width:"0%",responsive_max_width:"100%",animation_type:"fade",animation_speed:350,location:"center",position_fixed:!1,position_from_trigger:!1,overlay_disabled:!1,stackable:!1,disable_reposition:!1},"left-bottom-notice":{size:"tiny",responsive_min_width:"0%",responsive_max_width:"100%",animation_type:"fade",animation_speed:350,animation_origin:"left bottom",location:"left bottom",position_bottom:10,position_left:10,position_from_trigger:!1,position_fixed:!0,overlay_disabled:!0,stackable:!0,disable_reposition:!1},"top-bar":{size:"custom",custom_width:"100%",custom_height_auto:!0,animation_type:"fadeAndSlide",animation_speed:300,animation_origin:"top",location:"center top",position_top:0,position_from_trigger:!1,position_fixed:!0,overlay_disabled:!0,stackable:!0,disable_reposition:!1},"right-bottom-slidein":{size:"custom",custom_width:"300px",custom_height_auto:!0,animation_type:"slide",animation_speed:350,animation_origin:"bottom",location:"right bottom",position_bottom:10,position_right:10,position_from_trigger:!1,position_fixed:!0,overlay_disabled:!0,stackable:!0,disable_reposition:!1}},n=e.target.dataset.popupType||e.target.parentElement.dataset.popupType||"",o=i.hasOwnProperty(n)?i[n]:{},e=pum_popup_settings_editor.form_args||{},i=pum_popup_settings_editor.current_values||{},r=t.pumSerializeObject();if(r.popup_settings.triggers)for(var s=0;s
t;t++)i.facets[t].index=t,i.facets[t].group=i.index;return PUM_Admin.templates.render("pum-condition-group",i)},facet:function(e){e=s.extend(!0,{},{group:"",index:"",target:"",not_operand:!1,settings:{}},e);return PUM_Admin.templates.render("pum-condition-facet",e)},settings:function(e,i){var n=[],o=s.extend(!0,{},{index:"",group:"",target:null,fields:[]},e);return o.fields.length||void 0===pum_popup_settings_editor.conditions[e.target]||(o.fields=pum_popup_settings_editor.conditions[e.target].fields),void 0===i&&(i={}),_.each(o.fields,function(e,t){"object"!=typeof(e=PUM_Admin.models.field(e)).meta&&(e.meta={}),void 0!==i[t]&&(e.value=i[t]),e.name="popup_settings[conditions]["+o.group+"]["+o.index+"][settings]["+t+"]",""===e.id&&(e.id="popup_settings_conditions_"+o.group+"_"+o.index+"_settings_"+t),n.push(PUM_Admin.templates.field(e))}),PUM_Admin.templates.section({fields:n})},selectbox:function(e){e=s.extend(!0,{},{id:null,name:null,type:"select",group:"",index:"",value:null,select2:!0,classes:[],options:d.get_conditions()},e);return null===e.id&&(e.id="popup_settings_conditions_"+e.group+"_"+e.index+"_target"),null===e.name&&(e.name="popup_settings[conditions]["+e.group+"]["+e.index+"][target]"),PUM_Admin.templates.field(e)}},groups:{add:function(e,t,i){e=s(e),i={index:e.find(".facet-group-wrap").length,facets:[{target:t||null,not_operand:i||!1,settings:{}}]};e.find(".facet-groups").append(d.template.group(i)),e.addClass("has-conditions")},remove:function(e){var t=e.parents(".facet-builder");e.prev(".facet-group-wrap").find(".and .add-facet").removeClass("disabled"),e.remove(),d.renumber(),0===t.find(".facet-group-wrap").length&&(t.removeClass("has-conditions"),s("#pum-first-condition").val(null).trigger("change"))}},facets:{add:function(e,t,i){i={group:e.data("index"),index:e.find(".facet").length,target:t||null,not_operand:i||!1,settings:{}};e.find(".facet-list").append(d.template.facet(i))},remove:function(e){var t=e.parents(".facet-group-wrap");e.remove(),0===t.find(".facet").length?d.groups.remove(t):d.renumber()}},renumber:function(){s(".facet-builder .facet-group-wrap").each(function(){var e=s(this),i=e.parent().children().index(e);e.data("index",i).find(".facet").each(function(){var e=s(this),t=e.parent().children().index(e);e.data("index",t).find("[name]").each(function(){this.name=this.name.replace(/popup_settings\[conditions\]\[\d*?\]\[\d*?\]/,"popup_settings[conditions]["+i+"]["+t+"]"),this.id=this.id.replace(/popup_settings_conditions_\d*?_\d*?_/,"popup_settings_conditions_"+i+"_"+t+"_")})})})}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.conditions=d,s(document).on("pum_init",function(){d.renumber(),d.toggle_not_operand()}).on("select2:select pumselect2:select","#pum-first-condition",function(e){var t=s(this),i=t.parents(".facet-builder").eq(0),n=t.val(),o=i.find("#pum-first-facet-operand"),r=o.is(":checked");d.groups.add(i,n,r),t.val(null).trigger("change"),o.prop("checked",!1).parents(".facet-target").removeClass("not-operand-checked"),s(document).trigger("pum_init")}).on("click",".facet-builder .pum-not-operand",function(){d.not_operand_checkbox(s(this))}).on("change",".facet-builder .facet-target select",function(e){var t=s(this),i=t.parents(".facet"),n=t.val(),t={target:n};""!==n&&n!==i.data("target")&&(i.data("target",n).find(".facet-settings").html(d.template.settings(t)),s(document).trigger("pum_init"))}).on("click",".facet-builder .facet-group-wrap:last-child .and .add-facet",function(){d.groups.add(s(this).parents(".facet-builder").eq(0)),s(document).trigger("pum_init")}).on("click",".facet-builder .add-or .add-facet:not(.disabled)",function(){d.facets.add(s(this).parents(".facet-group-wrap").eq(0)),s(document).trigger("pum_init")}).on("click",".facet-builder .remove-facet",function(){d.facets.remove(s(this).parents(".facet").eq(0)),s(document).trigger("pum_init")})}(jQuery),function(s,e){"use strict";var n,d=pum_admin_vars.I10n,p={get_cookies:function(){return window.pum_popup_settings_editor.cookies},get_cookie:function(e){var t=this.get_cookies(),e="undefined"!==t[e]&&t[e];return!!e&&(e&&"object"==typeof e&&"object"==typeof e.fields&&Object.keys(e.fields).length?this.parseFields(e):e)},getCookieDefaults:function(e){var t,i=p.get_cookie(e),n={};for(t in i.fields)if(i.fields.hasOwnProperty(t))for(var o in i.fields[t])i.fields[t].hasOwnProperty(o)&&(n[o]=i.fields[t][o].std);return n.name="pum-"+s("#post_ID").val(),n},parseFields:function(n){return _.each(n.fields,function(e,i){_.each(e,function(e,t){n.fields[i][t].name="cookie_settings["+t+"]",""===n.fields[i][t].id&&(n.fields[i][t].id="cookie_settings_"+t)})}),n},parseValues:function(e,t){return e},select_list:function(){for(var e=PUM_Admin.utils.object_to_array(p.get_cookies()),t={},i=0;i
span",PUM_Admin.triggers.toggle_click_selector_presets).on("click",".pum-click-selector-presets li",PUM_Admin.triggers.insert_click_selector_preset).on("click",PUM_Admin.triggers.reset_click_selector_presets).on("select2:select pumselect2:select","#pum-first-trigger",function(){var e=d(this),r=e.parents(".pum-popup-trigger-editor"),t=e.val(),i={};PUM_Admin.triggers.current_editor=r,"click_open"!==t&&(i.cookie_name="pum-"+d("#post_ID").val()),c.template.form(t,i,function(e){var t=d(this),i=t.find("input#type").val(),n=t.pumSerializeObject(),o=c.parseValues(n.trigger_settings||{}),t=parseInt(n.index);e.preventDefault(),(!1===t||t<0)&&(t=r.find("tbody tr").length),c.rows.add(r,{index:t,type:i,settings:o}),PUM_Admin.modals.closeAll(),o.cookie_name!==p&&null!==o.cookie_name&&("add_new"===o.cookie_name||0<=o.cookie_name.indexOf("add_new"))&&(PUM_Admin.triggers.new_cookie=n.index,d("#pum-popup-settings-container .pum-popup-cookie-editor button.pum-add-new").trigger("click"))}),e.val(null).trigger("change")}).on("click",".pum-popup-trigger-editor .pum-add-new",function(){PUM_Admin.triggers.current_editor=d(this).parents(".pum-popup-trigger-editor");var e=wp.template("pum-trigger-add-type");PUM_Admin.modals.reload("#pum_trigger_add_type_modal",e({I10n:a}))}).on("click",".pum-popup-trigger-editor .edit",function(e){var t=d(this),r=t.parents(".pum-popup-trigger-editor"),i=t.parents("tr:first"),t=i.find(".popup_triggers_field_type").val(),i=_.extend({},JSON.parse(i.find(".popup_triggers_field_settings:first").val()),{index:i.parent().children().index(i),type:t});e.preventDefault(),c.template.form(t,i,function(e){var t=d(this),i=t.find("input#type").val(),n=t.find("input#index").val(),o=t.pumSerializeObject(),t=c.parseValues(o.trigger_settings||{});PUM_Admin.triggers.current_editor=r,e.preventDefault(),(!1===n||n<0)&&(n=r.find("tbody tr").length),c.rows.add(r,{index:n,type:i,settings:t}),PUM_Admin.modals.closeAll(),t.cookie_name!==p&&null!==t.cookie_name&&("add_new"===t.cookie_name||0<=t.cookie_name.indexOf("add_new"))&&(PUM_Admin.triggers.new_cookie=o.index,d("#pum-popup-settings-container .pum-popup-cookie-editor button.pum-add-new").trigger("click"))})}).on("click",".pum-popup-trigger-editor .remove",function(e){var t=d(this),i=t.parents(".pum-popup-trigger-editor"),t=t.parents("tr:first");PUM_Admin.triggers.current_editor=i,e.preventDefault(),window.confirm(a.confirm_delete_trigger)&&c.rows.remove(t)}).on("submit","#pum_trigger_add_type_modal .pum-form",function(e){var r=PUM_Admin.triggers.current_editor,t=r.parents("#pum-popup-settings-triggers-subtabs_main").find(".pum-field-cookies .pum-popup-cookie-editor"),i=d("#popup_trigger_add_type").val(),n=d("#popup_trigger_add_cookie").is(":checked"),o=d("#popup_trigger_add_cookie_event").val(),s={};e.preventDefault(),n&&(s.cookie_name="pum-"+d("#post_ID").val(),PUM_Admin.cookies.insertCookie(t,{event:o,settings:{time:"1 month",path:"1",name:s.cookie_name}})),c.template.form(i,s,function(e){var t=d(this),i=t.find("input#type").val(),n=t.pumSerializeObject(),o=c.parseValues(n.trigger_settings||{}),t=parseInt(n.index);PUM_Admin.triggers.current_editor=r,e.preventDefault(),(!t||t<0)&&(t=r.find("tbody tr").length),c.rows.add(r,{index:t,type:i,settings:o}),PUM_Admin.modals.closeAll(),o.cookie_name!==p&&null!==o.cookie_name&&("add_new"===o.cookie_name||0<=o.cookie_name.indexOf("add_new"))&&(PUM_Admin.triggers.new_cookie=n.index,d("#pum-popup-settings-container .pum-popup-cookie-editor button.pum-add-new").trigger("click"))})})}(jQuery,document);