Version Description
Download this release
Release Info
Developer | danieliser |
Plugin | Popup Maker – Popup Forms, Optins & More |
Version | 1.3.6 |
Comparing to | |
See all releases |
Code changes from version 1.3.5 to 1.3.6
- assets/scripts/popup-maker-admin.js +5 -2
- assets/scripts/popup-maker-admin.min.js +2 -2
- assets/scripts/popup-maker-site.js +5 -1
- assets/scripts/popup-maker-site.min.js +2 -2
- includes/admin/popups/metabox-display-fields.php +1 -1
- includes/class-popmake-fields.php +6 -4
- includes/scripts.php +2 -0
- includes/theme-functions.php +24 -15
- popup-maker.php +2 -2
- readme.txt +8 -2
assets/scripts/popup-maker-admin.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/**
|
2 |
-
* Popup Maker v1.3.
|
3 |
*/
|
4 |
|
5 |
var PopMakeAdmin;
|
@@ -446,7 +446,7 @@ var PopMakeAdmin;
|
|
446 |
jQuery('.custom-size-only').hide();
|
447 |
if (jQuery("#popup_display_size").val() !== 'auto') {
|
448 |
jQuery('.responsive-size-only').show();
|
449 |
-
jQuery('#
|
450 |
} else {
|
451 |
jQuery('.responsive-size-only').hide();
|
452 |
}
|
@@ -620,6 +620,9 @@ var PopMakeAdmin;
|
|
620 |
auto_open_reset_cookie_key();
|
621 |
})
|
622 |
.on('change', "#popup_display_size", function () {
|
|
|
|
|
|
|
623 |
update_size();
|
624 |
})
|
625 |
.on('change', "#popup_display_animation_type", function () {
|
1 |
/**
|
2 |
+
* Popup Maker v1.3.6
|
3 |
*/
|
4 |
|
5 |
var PopMakeAdmin;
|
446 |
jQuery('.custom-size-only').hide();
|
447 |
if (jQuery("#popup_display_size").val() !== 'auto') {
|
448 |
jQuery('.responsive-size-only').show();
|
449 |
+
jQuery('#popup_display_custom_height_auto').prop('checked', false);
|
450 |
} else {
|
451 |
jQuery('.responsive-size-only').hide();
|
452 |
}
|
620 |
auto_open_reset_cookie_key();
|
621 |
})
|
622 |
.on('change', "#popup_display_size", function () {
|
623 |
+
if (jQuery("#popup_display_size").val() !== 'custom' && jQuery("#popup_display_size").val() !== 'auto') {
|
624 |
+
jQuery('#popup_display_position_fixed, #popup_display_scrollable_content').prop('checked', false);
|
625 |
+
}
|
626 |
update_size();
|
627 |
})
|
628 |
.on('change', "#popup_display_animation_type", function () {
|
assets/scripts/popup-maker-admin.min.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
/**
|
2 |
-
* Popup Maker v1.3.
|
3 |
*/
|
4 |
-
var PopMakeAdmin;!function(){"use strict";PopMakeAdmin={init:function(){jQuery("body.post-type-popup form#post").length&&(PopMakeAdmin.initialize_popup_page(),PopMakeAdmin.attachQuickSearchListeners(),PopMakeAdmin.attachTabsPanelListeners()),jQuery("body.post-type-popup_theme form#post").length&&PopMakeAdmin.initialize_theme_page(),PopMakeAdmin.initialize_color_pickers(),PopMakeAdmin.initialize_range_sliders(),PopMakeAdmin.initialize_marketing(),jQuery(document).keydown(function(e){return"115"!==e.which&&"83"!==e.which||!e.ctrlKey&&!e.metaKey?!0:(e.preventDefault(),jQuery("body.post-type-popup form#post, body.post-type-popup_theme form#post").submit(),!1)})},initialize_marketing:function(){jQuery("#menu-posts-popup ul li:eq(-1)").addClass("popmake-menu-highlight"),jQuery(".popmake-newsletter-optin").show(),jQuery("#posts-filter").length?jQuery("#wpbody-content > .wrap > h2:first").after(jQuery(".popmake-newsletter-optin")):jQuery("#titlediv").length?jQuery("#titlediv").append(jQuery(".popmake-newsletter-optin")):jQuery(".about-text").length&&jQuery(".popmake-badge").length?jQuery(".nav-tab-wrapper").after(jQuery(".popmake-newsletter-optin")):jQuery("#poststuff .tabwrapper").length?jQuery("#poststuff .tabwrapper").prepend(jQuery(".popmake-newsletter-optin")):jQuery("#poststuff").length&&jQuery("#poststuff").prepend(jQuery(".popmake-newsletter-optin")),jQuery(".popmake-optin-dismiss").on("click",function(e){var t=jQuery(this);e.preventDefault(),jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"popmake_optin",popmake_nonce:popmake_admin_ajax_nonce,optin_dismiss:!0,optin_name:t.data("optin-name"),optin_type:t.data("optin-type")}}).done(function(e){e.success&&t.parents(".popmake-optin").slideUp(function(){jQuery(this).remove()})})})},attachTabsPanelListeners:function(){jQuery("#poststuff").bind("click",function(e){var t,o,n,i,r,a,p,s,l,u,c,_,d,h,y=jQuery(e.target);if(y.hasClass("nav-tab-link"))o=y.data("type"),n=y.parents(".posttypediv, .taxonomydiv").first(),jQuery("input",n).removeAttr("checked"),jQuery(".tabs-panel-active",n).removeClass("tabs-panel-active").addClass("tabs-panel-inactive"),jQuery("#"+o,n).removeClass("tabs-panel-inactive").addClass("tabs-panel-active"),jQuery(".tabs",n).removeClass("tabs"),y.parent().addClass("tabs"),jQuery(".quick-search",n).focus(),e.preventDefault();else if(y.hasClass("select-all"))t=/#(.*)$/.exec(e.target.href),t&&t[1]&&(i=jQuery("#"+t[1]+" .tabs-panel-active .menu-item-title input"),i.length===i.filter(":checked").length?i.removeAttr("checked"):i.prop("checked",!0));else if(y.hasClass("submit-add-to-menu")){for(r=y.parents(".options"),a=jQuery('.tabs-panel-active input[type="checkbox"]:checked',r),p=jQuery("textarea",r),s=jQuery(".tagchecklist",r),l=p.val().split(","),u=0;u<l.length;u+=1)l[u]=parseInt(l[u],10);a.each(function(){c=jQuery(this),_=parseInt(c.val(),10),d=c.parent("label").siblings(".menu-item-title").val(),-1===jQuery.inArray(_,l)&&l.push(_),s.append('<span><a class="ntdelbutton" data-id="'+_+'">X</a> '+d+"</span>")}),p.text(l.join(",")),e.preventDefault()}else y.hasClass("ntdelbutton")&&(c=y,h=parseInt(c.data("id"),10),r=y.parents(".options"),p=jQuery("textarea",r),s=jQuery(".tagchecklist",r),l=p.val().split(","),l=jQuery.grep(l,function(e){return parseInt(e,10)!==parseInt(h,10)}),c.parent("span").remove(),p.text(l.join(",")))})},attachQuickSearchListeners:function(){var e;jQuery(".quick-search").keypress(function(t){var o=jQuery(this);return 13===t.which?(PopMakeAdmin.updateQuickSearchResults(o),!1):(e&&clearTimeout(e),void(e=setTimeout(function(){PopMakeAdmin.updateQuickSearchResults(o)},400)))}).attr("autocomplete","off")},updateQuickSearchResults:function(e){var t,o,n=2,i=e.val();i.length<n||(t=e.parents(".tabs-panel"),o={action:"menu-quick-search","response-format":"markup",menu:null,"menu-settings-column-nonce":jQuery("#menu-settings-column-nonce").val(),q:i,type:e.attr("name")},jQuery(".spinner",t).show(),jQuery.post(ajaxurl,o,function(e){PopMakeAdmin.processQuickSearchQueryResponse(e,o,t)}))},processQuickSearchQueryResponse:function(e,t,o){var n,i,r,a=jQuery("form#post"),p={},s=/menu-item[(\[\^]\]*/,l=jQuery("<div>").html(e).find("li");return l.length?(l.each(function(){if(r=jQuery(this),n=s.exec(r.html()),n&&n[1]){for(i=n[1];a.elements["menu-item["+i+"][menu-item-type]"]||p[i];)i-=1;p[i]=!0,i!==n[1]&&r.html(r.html().replace(new RegExp("menu-item\\["+n[1]+"\\]","g"),"menu-item["+i+"]"))}}),jQuery(".categorychecklist",o).html(l),jQuery(".spinner",o).hide(),void jQuery('[name^="menu-item"]').removeAttr("name")):(jQuery(".categorychecklist",o).html("<li><p>noResultsFound</p></li>"),void jQuery(".spinner",o).hide())},initialize_color_pickers:function(){var e=this;jQuery(".color-picker").wpColorPicker({change:function(t){e.throttle(setTimeout(function(){e.update_theme()},5),250);var o=jQuery(t.currentTarget);o.hasClass("background-color")&&o.parents("table").find(".background-opacity").show()},clear:function(t){e.update_theme();var o=jQuery(t.currentTarget).prev();o.hasClass("background-color")&&o.parents("table").find(".background-opacity").hide()}})},initialize_range_sliders:function(){var e,t,o,n,i,r=jQuery('<input type="range"/>'),a=jQuery('<button class="popmake-range-plus">+</button>'),p=jQuery('<button class="popmake-range-minus">-</button>');jQuery(document).on("input",'input[type="range"]',function(){var e=jQuery(this);e.siblings(".popmake-range-manual").val(e.val())}),jQuery(".popmake-range-manual").each(function(){var e=jQuery(this),t=e.data("force-minmax"),s=parseInt(e.prop("min"),0),l=parseInt(e.prop("max"),0),u=parseInt(e.prop("step"),0),c=parseInt(e.val(),0);o=r.clone(),n=a.clone(),i=p.clone(),t&&c>l&&(c=l,e.val(c)),o.prop({min:s||0,max:t||l&&l>c?l:1.5*c,step:u||1.5*c/100,value:c}).on("change input",function(){e.trigger("input")}),e.next().after(i,n),e.before(o)}),jQuery(document).on("click",".popmake-range-manual",function(){var e=jQuery(this);e.prop("readonly",!1)}).on("focusout",".popmake-range-manual",function(){var e=jQuery(this);e.prop("readonly",!0)}).on("change",".popmake-range-manual",function(){var e=jQuery(this),t=parseInt(e.prop("max"),0),n=parseInt(e.prop("step"),0),i=e.data("force-minmax"),r=parseInt(e.val(),0);o=e.prev(),i&&r>t&&(r=t,e.val(r)),o.prop({max:i||t&&t>r?t:1.5*r,step:n||1.5*r/100,value:r})}).on("click",".popmake-range-plus",function(e){e.preventDefault();var t=jQuery(this).siblings(".popmake-range-manual"),n=parseInt(t.prop("step"),0),i=parseInt(t.val(),0),r=i+n;o=t.prev(),t.val(r).trigger("input"),o.val(r)}).on("click",".popmake-range-minus",function(e){e.preventDefault();var t=jQuery(this).siblings(".popmake-range-manual"),n=parseInt(t.prop("step"),0),i=parseInt(t.val(),0),r=i-n;o=t.prev(),t.val(r).trigger("input"),o.val(r)}),e=document.createElement("input"),e.setAttribute("type","range"),"text"===e.type&&jQuery("input[type=range]").each(function(e,n){t=jQuery(n),o=jQuery("<div />").slider({min:parseInt(t.attr("min"),10)||0,max:parseInt(t.attr("max"),10)||100,value:parseInt(t.attr("value"),10)||0,step:parseInt(t.attr("step"),10)||1,slide:function(e,t){jQuery(this).prev("input").val(t.value)}}),t.after(o).hide()})},initialize_popup_page:function(){var e=function(e){var t,o,n=e.siblings(".options");e.is(":checked")?(n.show(),"popup_targeting_condition_on_entire_site"===e.attr("id")?(t=e.parents("#popmake_popup_targeting_condition_fields").find('[id^="targeting_condition-exclude_on_"]'),o=e.parents(".targeting_condition").siblings(".targeting_condition"),o.hide(),jQuery("> *",o).prop("disabled",!0),t.show(),jQuery("> *",t).prop("disabled",!1)):jQuery("*",n).prop("disabled",!1)):(n.hide(),"popup_targeting_condition_on_entire_site"===e.attr("id")?(t=e.parents("#popmake_popup_targeting_condition_fields").find('[id^="targeting_condition-exclude_on_"]'),o=e.parents(".targeting_condition").siblings(".targeting_condition"),o.show(),jQuery("> *",o).prop("disabled",!1),t.hide(),jQuery("> *",t).prop("disabled",!0)):jQuery("*",n).prop("disabled",!0))},t=function(e){var t=e.parents(".options").find('input[type="checkbox"]:eq(0)'),o=t.attr("name").indexOf("exclude")>=0,n=o?t.attr("name").replace("popup_targeting_condition_exclude_on_specific_",""):t.attr("name").replace("popup_targeting_condition_on_specific_",""),i=jQuery(o?"#exclude_on_specific_"+n:"#on_specific_"+n);e.is(":checked")&&("true"===e.val()?(t.prop("checked",!0),i.show(),jQuery("*",i).prop("disabled",!1)):""===e.val()&&(t.prop("checked",!1),i.hide(),jQuery("*",i).prop("disabled",!0)))},o=function(){"custom"===jQuery("#popup_display_size").val()?(jQuery(".custom-size-only").show(),jQuery(".responsive-size-only").hide(),jQuery("#popup_display_custom_height_auto").is(":checked")?jQuery(".custom-size-height-only").hide():jQuery(".custom-size-height-only").show()):(jQuery(".custom-size-only").hide(),"auto"!==jQuery("#popup_display_size").val()?(jQuery(".responsive-size-only").show(),jQuery("#popup_display_position_fixed, #popup_display_custom_height_auto, #popup_display_scrollable_content").prop("checked",!1)):jQuery(".responsive-size-only").hide())},n=function(){jQuery(".animation-speed, .animation-origin").hide(),"fade"===jQuery("#popup_display_animation_type").val()?jQuery(".animation-speed").show():"none"!==jQuery("#popup_display_animation_type").val()&&jQuery(".animation-speed, .animation-origin").show()},i=function(){var e=jQuery("#popup_display_location"),t=e.parents("table"),o=e.val();jQuery("tr.top, tr.right, tr.left, tr.bottom",t).hide(),o.indexOf("top")>=0&&jQuery("tr.top").show(),o.indexOf("left")>=0&&jQuery("tr.left").show(),o.indexOf("bottom")>=0&&jQuery("tr.bottom").show(),o.indexOf("right")>=0&&jQuery("tr.right").show()},r=function(){jQuery("#popup_auto_open_session_cookie").is(":checked")?jQuery(".not-session-cookie").hide():jQuery(".not-session-cookie").show()},a=function(){jQuery("#popup_auto_open_enabled").is(":checked")?(jQuery(".auto-open-enabled").show(),r()):jQuery(".auto-open-enabled").hide()},p=function(){jQuery("#popup_auto_open_cookie_key").val((new Date).getTime().toString(16))},s=function(){""!==jQuery("#popuptitle").val()?jQuery("#popmake-preview .popmake-title").show().html(jQuery("#popuptitle").val()):jQuery("#popmake-preview .popmake-title").hide()},l=function(){var e="";jQuery("#wp-content-wrap").hasClass("tmce-active")?(console.log(1),e=tinyMCE.activeEditor.getContent()):(console.log(2),e=jQuery("#content").val()),jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"popmake_popup_preview_content",popmake_nonce:popmake_admin_ajax_nonce,popup_id:jQuery("#post_ID").val(),popup_content:e}}).done(function(e){e.success&&(jQuery("#popmake-preview .popmake-content").html(e.content),jQuery("#popmake-preview").popmake("open"))})},u=function(){var e,t=jQuery("[name^='popup_display_']").serializeArray(),o=jQuery("#popmake-preview"),n=o.data("popmake");for(e=0;t.length>e;e+=1)0===t[e].name.indexOf("popup_display_")&&(n.meta.display[t[e].name.replace("popup_display_","")]=t[e].value);o.removeClass("theme-"+n.theme_id),n.theme_id=jQuery("#popup_theme").val(),jQuery("#popmake-preview").addClass("theme-"+n.theme_id).data("popmake",n)};jQuery("#popuptitlediv").insertAfter("#titlediv"),jQuery('[name^="menu-item"]').removeAttr("name"),jQuery("#trigger-popmake-preview").on("click",function(e){return e.preventDefault(),e.stopPropagation(),s(),u(),l(),!1}),jQuery(document).on("keydown","#popuptitle",function(e){var t=e.keyCode||e.which;9===t&&(e.preventDefault(),jQuery("#title").focus())}).on("keydown","#title, #popuptitle",function(e){var t,o=e.keyCode||e.which;e.shiftKey||9!==o||(e.preventDefault(),t="title"===jQuery(this).attr("id")?"#popuptitle":"#insert-media-button",jQuery(t).focus())}).on("keydown","#popuptitle, #insert-media-button",function(e){var t,o=e.keyCode||e.which;e.shiftKey&&9===o&&(e.preventDefault(),t="popuptitle"===jQuery(this).attr("id")?"#title":"#popuptitle",jQuery(t).focus())}).on("submit","#post",function(e){var t=jQuery("#title").val();(0===t.length||0===t.replace(/\s/g,"").length)&&(console.log(1),e.preventDefault(),jQuery("div#notice").remove(),jQuery("<div id='notice' class='error below-h2'><p>A name is required for all popups.</p></div>").insertAfter("h2"),jQuery("#title").focus(),jQuery("#publishing-action .spinner").removeClass("is-active"),jQuery("#publish").removeClass("disabled"),jQuery("#title").prop("required","required"))}).on("click","#popup_display_custom_height_auto",function(){o()}).on("click","#popup_auto_open_session_cookie",function(){r()}).on("click","#popup_auto_open_enabled",function(){a()}).on("click",".popmake-reset-auto-open-cookie-key",function(){p()}).on("change","#popup_display_size",function(){o()}).on("change","#popup_display_animation_type",function(){n()}).on("change","#popup_display_location",function(){i()}),jQuery('#popmake_popup_targeting_condition_fields .targeting_condition > input[type="checkbox"]').on("click",function(){e(jQuery(this))}).each(function(){e(jQuery(this))}),jQuery('input[type="radio"][id*="popup_targeting_condition_"]').on("click",function(){t(jQuery(this))}).each(function(){t(jQuery(this))}),jQuery(".posttypediv, .taxonomydiv").each(function(){var e=jQuery(this),t=jQuery("> ul li"),o=jQuery(".tabs-panel",e);t.removeClass("tabs"),t.eq(0).addClass("tabs"),o.removeClass("tabs-panel-active").addClass("tabs-panel-inactive").removeAttr("style"),o.eq(0).removeClass("tabs-panel-inactive").addClass("tabs-panel-active")}),o(),n(),i(),a(),""===jQuery("#popup_auto_open_cookie_key").val()&&p()},theme_page_listeners:function(){var e=this;jQuery(document).on("change","select.font-family",function(){jQuery("select.font-weight option, select.font-style option",jQuery(this).parents("table")).prop("selected",!1),e.update_font_selectboxes()}).on("change","select.font-weight, select.font-style",function(){e.update_font_selectboxes()}).on("change input focusout","select, input",function(){e.update_theme()}).on("change","select.border-style",function(){var e=jQuery(this);"none"===e.val()?e.parents("table").find(".border-options").hide():e.parents("table").find(".border-options").show()}).on("change","#popup_theme_close_location",function(){var e=jQuery(this),t=e.parents("table");jQuery("tr.topleft, tr.topright, tr.bottomleft, tr.bottomright",t).hide(),jQuery("tr."+e.val(),t).show()})},update_theme:function(){var e,t=jQuery("[name^='popup_theme_']").serializeArray(),o={};for(e=0;t.length>e;e+=1)0===t[e].name.indexOf("popup_theme_")&&(o[t[e].name.replace("popup_theme_","")]=t[e].value);this.retheme_popup(o)},theme_preview_scroll:function(){var e=jQuery("#popmake-theme-editor .empreview, body.post-type-popup_theme form#post #popmake_popup_theme_preview"),t=e.parent(),o=e.offset().top-50;jQuery(window).on("scroll",function(){jQuery("> .postbox:visible",t).index(e)===jQuery("> .postbox:visible",t).length-1&&jQuery(window).scrollTop()>=o?e.css({left:e.offset().left,width:e.width(),height:e.height(),position:"fixed",top:50}):e.removeAttr("style")})},update_font_selectboxes:function(){return jQuery("select.font-family").each(function(){var e,t,o=jQuery(this),n=o.parents("table").find("select.font-weight"),i=o.parents("table").find("select.font-style"),r=n.find("option"),a=i.find("option");if(void 0!==popmake_google_fonts[o.val()]){if(e=popmake_google_fonts[o.val()],r.hide(),a.hide(),e.variants.length)for(t=0;e.variants.length>t;t+=1)"regular"===e.variants[t]?(jQuery('option[value="normal"]',n).show(),jQuery('option[value="normal"]',i).show()):(e.variants[t].indexOf("italic")>=0&&jQuery('option[value="italic"]',i).show(),jQuery('option[value="'+parseInt(e.variants[t],10)+'"]',n).show())}else r.show(),a.show();n.parents("tr:first").show(),n.find("option:visible").length<=1?n.parents("tr:first").hide():n.parents("tr:first").show(),i.parents("tr:first").show(),i.find("option:visible").length<=1?i.parents("tr:first").hide():i.parents("tr:first").show()})},convert_theme_for_preview:function(){},convert_meta_to_object:function(e){var t,o,n,i={};for(n in e)e.hasOwnProperty(n)&&(t=n.split(/_(.+)?/)[0],o=n.split(/_(.+)?/)[1],void 0===i[t]&&(i[t]={}),i[t][o]=e[n]);return i},initialize_theme_page:function(){jQuery("#popuptitlediv").insertAfter("#titlediv");var e=this,t=jQuery("#popup_theme_close_location").parents("table");switch(e.update_theme(),e.theme_page_listeners(),e.theme_preview_scroll(),e.update_font_selectboxes(),jQuery(document).on("click",".popmake-preview",function(e){e.preventDefault(),jQuery("#popmake-preview, #popmake-overlay").css({visibility:"visible"}).show()}).on("click",".popmake-close",function(){jQuery("#popmake-preview, #popmake-overlay").hide()}),jQuery("select.border-style").each(function(){var e=jQuery(this);"none"===e.val()?e.parents("table").find(".border-options").hide():e.parents("table").find(".border-options").show()}),jQuery(".color-picker.background-color").each(function(){var e=jQuery(this);""===e.val()?e.parents("table").find(".background-opacity").hide():e.parents("table").find(".background-opacity").show()}),jQuery("tr.topleft, tr.topright, tr.bottomleft, tr.bottomright",t).hide(),jQuery("#popup_theme_close_location").val()){case"topleft":jQuery("tr.topleft",t).show();break;case"topright":jQuery("tr.topright",t).show();break;case"bottomleft":jQuery("tr.bottomleft",t).show();break;case"bottomright":jQuery("tr.bottomright",t).show()}},retheme_popup:function(e){var t,o=jQuery(".empreview .example-popup-overlay, #popmake-overlay"),n=jQuery(".empreview .example-popup, #popmake-preview"),i=jQuery(".title, .popmake-title",n),r=jQuery(".content, .popmake-content",n),a=jQuery(".close-popup, .popmake-close",n),p="yes"===e.container_boxshadow_inset?"inset ":"",s="yes"===e.close_boxshadow_inset?"inset ":"";switch(this.convert_theme_for_preview(e),void 0!==popmake_google_fonts[e.title_font_family]&&(t="//fonts.googleapis.com/css?family="+e.title_font_family,"normal"!==e.title_font_weight&&(t+=":"+e.title_font_weight),"italic"===e.title_font_style&&(-1===t.indexOf(":")&&(t+=":"),t+="italic"),jQuery("body").append('<link href="'+t+'" rel="stylesheet" type="text/css">')),void 0!==popmake_google_fonts[e.content_font_family]&&(t="//fonts.googleapis.com/css?family="+e.content_font_family,"normal"!==e.content_font_weight&&(t+=":"+e.content_font_weight),"italic"===e.content_font_style&&(-1===t.indexOf(":")&&(t+=":"),t+="italic"),jQuery("body").append('<link href="'+t+'" rel="stylesheet" type="text/css">')),void 0!==popmake_google_fonts[e.close_font_family]&&(t="//fonts.googleapis.com/css?family="+e.close_font_family,"normal"!==e.close_font_weight&&(t+=":"+e.close_font_weight),"italic"===e.close_font_style&&(-1===t.indexOf(":")&&(t+=":"),t+="italic"),jQuery("body").append('<link href="'+t+'" rel="stylesheet" type="text/css">')),o.removeAttr("style").css({backgroundColor:this.convert_hex(e.overlay_background_color,e.overlay_background_opacity)}),n.removeAttr("style").css({padding:e.container_padding+"px",backgroundColor:this.convert_hex(e.container_background_color,e.container_background_opacity),borderStyle:e.container_border_style,borderColor:e.container_border_color,borderWidth:e.container_border_width+"px",borderRadius:e.container_border_radius+"px",boxShadow:p+e.container_boxshadow_horizontal+"px "+e.container_boxshadow_vertical+"px "+e.container_boxshadow_blur+"px "+e.container_boxshadow_spread+"px "+this.convert_hex(e.container_boxshadow_color,e.container_boxshadow_opacity)}),i.removeAttr("style").css({color:e.title_font_color,lineHeight:e.title_line_height+"px",fontSize:e.title_font_size+"px",fontFamily:e.title_font_family,fontStyle:e.title_font_style,fontWeight:e.title_font_weight,textAlign:e.title_text_align,textShadow:e.title_textshadow_horizontal+"px "+e.title_textshadow_vertical+"px "+e.title_textshadow_blur+"px "+this.convert_hex(e.title_textshadow_color,e.title_textshadow_opacity)}),r.removeAttr("style").css({color:e.content_font_color,fontFamily:e.content_font_family,fontStyle:e.content_font_style,fontWeight:e.content_font_weight}),a.html(e.close_text).removeAttr("style").css({padding:e.close_padding+"px",height:e.close_height>0?e.close_height+"px":"auto",width:e.close_width>0?e.close_width+"px":"auto",backgroundColor:this.convert_hex(e.close_background_color,e.close_background_opacity),color:e.close_font_color,lineHeight:e.close_line_height+"px",fontSize:e.close_font_size+"px",fontFamily:e.close_font_family,fontWeight:e.close_font_weight,fontStyle:e.close_font_style,borderStyle:e.close_border_style,borderColor:e.close_border_color,borderWidth:e.close_border_width+"px",borderRadius:e.close_border_radius+"px",boxShadow:s+e.close_boxshadow_horizontal+"px "+e.close_boxshadow_vertical+"px "+e.close_boxshadow_blur+"px "+e.close_boxshadow_spread+"px "+this.convert_hex(e.close_boxshadow_color,e.close_boxshadow_opacity),textShadow:e.close_textshadow_horizontal+"px "+e.close_textshadow_vertical+"px "+e.close_textshadow_blur+"px "+this.convert_hex(e.close_textshadow_color,e.close_textshadow_opacity)}),e.close_location){case"topleft":a.css({top:e.close_position_top+"px",left:e.close_position_left+"px"});break;case"topright":a.css({top:e.close_position_top+"px",right:e.close_position_right+"px"});break;case"bottomleft":a.css({bottom:e.close_position_bottom+"px",left:e.close_position_left+"px"});break;case"bottomright":a.css({bottom:e.close_position_bottom+"px",right:e.close_position_right+"px"})}jQuery(document).trigger("popmake-admin-retheme",[e])},serialize_form:function(e){var t={};return jQuery("[name]",e).each(function(){var e,o,n=jQuery(this).attr("name"),i=jQuery(this).val(),r=n.split("["),a=t,p=r.length;for(e=0;p>e;e+=1)o=r[e].replace("]",""),a[o]||(a[o]={}),e!==r.length-1?a=a[o]:e===r.length-1&&(a[o]=i)}),t},convert_hex:function(e,t){e=e.replace("#","");var o=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16),r="rgba("+o+","+n+","+i+","+t/100+")";return r},debounce:function(e,t){var o;return function(){var n=this,i=arguments;window.clearTimeout(o),o=window.setTimeout(function(){e.apply(n,i)},t)}},throttle:function(e,t){var o=!1,n=function(){o=!1};return function(){o||(e(),window.setTimeout(n,t),o=!0)}}},jQuery(document).ready(function(){PopMakeAdmin.init()})}();
|
1 |
/**
|
2 |
+
* Popup Maker v1.3.6
|
3 |
*/
|
4 |
+
var PopMakeAdmin;!function(){"use strict";PopMakeAdmin={init:function(){jQuery("body.post-type-popup form#post").length&&(PopMakeAdmin.initialize_popup_page(),PopMakeAdmin.attachQuickSearchListeners(),PopMakeAdmin.attachTabsPanelListeners()),jQuery("body.post-type-popup_theme form#post").length&&PopMakeAdmin.initialize_theme_page(),PopMakeAdmin.initialize_color_pickers(),PopMakeAdmin.initialize_range_sliders(),PopMakeAdmin.initialize_marketing(),jQuery(document).keydown(function(e){return"115"!==e.which&&"83"!==e.which||!e.ctrlKey&&!e.metaKey?!0:(e.preventDefault(),jQuery("body.post-type-popup form#post, body.post-type-popup_theme form#post").submit(),!1)})},initialize_marketing:function(){jQuery("#menu-posts-popup ul li:eq(-1)").addClass("popmake-menu-highlight"),jQuery(".popmake-newsletter-optin").show(),jQuery("#posts-filter").length?jQuery("#wpbody-content > .wrap > h2:first").after(jQuery(".popmake-newsletter-optin")):jQuery("#titlediv").length?jQuery("#titlediv").append(jQuery(".popmake-newsletter-optin")):jQuery(".about-text").length&&jQuery(".popmake-badge").length?jQuery(".nav-tab-wrapper").after(jQuery(".popmake-newsletter-optin")):jQuery("#poststuff .tabwrapper").length?jQuery("#poststuff .tabwrapper").prepend(jQuery(".popmake-newsletter-optin")):jQuery("#poststuff").length&&jQuery("#poststuff").prepend(jQuery(".popmake-newsletter-optin")),jQuery(".popmake-optin-dismiss").on("click",function(e){var t=jQuery(this);e.preventDefault(),jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"popmake_optin",popmake_nonce:popmake_admin_ajax_nonce,optin_dismiss:!0,optin_name:t.data("optin-name"),optin_type:t.data("optin-type")}}).done(function(e){e.success&&t.parents(".popmake-optin").slideUp(function(){jQuery(this).remove()})})})},attachTabsPanelListeners:function(){jQuery("#poststuff").bind("click",function(e){var t,o,n,i,r,a,p,s,l,u,c,_,d,h,y=jQuery(e.target);if(y.hasClass("nav-tab-link"))o=y.data("type"),n=y.parents(".posttypediv, .taxonomydiv").first(),jQuery("input",n).removeAttr("checked"),jQuery(".tabs-panel-active",n).removeClass("tabs-panel-active").addClass("tabs-panel-inactive"),jQuery("#"+o,n).removeClass("tabs-panel-inactive").addClass("tabs-panel-active"),jQuery(".tabs",n).removeClass("tabs"),y.parent().addClass("tabs"),jQuery(".quick-search",n).focus(),e.preventDefault();else if(y.hasClass("select-all"))t=/#(.*)$/.exec(e.target.href),t&&t[1]&&(i=jQuery("#"+t[1]+" .tabs-panel-active .menu-item-title input"),i.length===i.filter(":checked").length?i.removeAttr("checked"):i.prop("checked",!0));else if(y.hasClass("submit-add-to-menu")){for(r=y.parents(".options"),a=jQuery('.tabs-panel-active input[type="checkbox"]:checked',r),p=jQuery("textarea",r),s=jQuery(".tagchecklist",r),l=p.val().split(","),u=0;u<l.length;u+=1)l[u]=parseInt(l[u],10);a.each(function(){c=jQuery(this),_=parseInt(c.val(),10),d=c.parent("label").siblings(".menu-item-title").val(),-1===jQuery.inArray(_,l)&&l.push(_),s.append('<span><a class="ntdelbutton" data-id="'+_+'">X</a> '+d+"</span>")}),p.text(l.join(",")),e.preventDefault()}else y.hasClass("ntdelbutton")&&(c=y,h=parseInt(c.data("id"),10),r=y.parents(".options"),p=jQuery("textarea",r),s=jQuery(".tagchecklist",r),l=p.val().split(","),l=jQuery.grep(l,function(e){return parseInt(e,10)!==parseInt(h,10)}),c.parent("span").remove(),p.text(l.join(",")))})},attachQuickSearchListeners:function(){var e;jQuery(".quick-search").keypress(function(t){var o=jQuery(this);return 13===t.which?(PopMakeAdmin.updateQuickSearchResults(o),!1):(e&&clearTimeout(e),void(e=setTimeout(function(){PopMakeAdmin.updateQuickSearchResults(o)},400)))}).attr("autocomplete","off")},updateQuickSearchResults:function(e){var t,o,n=2,i=e.val();i.length<n||(t=e.parents(".tabs-panel"),o={action:"menu-quick-search","response-format":"markup",menu:null,"menu-settings-column-nonce":jQuery("#menu-settings-column-nonce").val(),q:i,type:e.attr("name")},jQuery(".spinner",t).show(),jQuery.post(ajaxurl,o,function(e){PopMakeAdmin.processQuickSearchQueryResponse(e,o,t)}))},processQuickSearchQueryResponse:function(e,t,o){var n,i,r,a=jQuery("form#post"),p={},s=/menu-item[(\[\^]\]*/,l=jQuery("<div>").html(e).find("li");return l.length?(l.each(function(){if(r=jQuery(this),n=s.exec(r.html()),n&&n[1]){for(i=n[1];a.elements["menu-item["+i+"][menu-item-type]"]||p[i];)i-=1;p[i]=!0,i!==n[1]&&r.html(r.html().replace(new RegExp("menu-item\\["+n[1]+"\\]","g"),"menu-item["+i+"]"))}}),jQuery(".categorychecklist",o).html(l),jQuery(".spinner",o).hide(),void jQuery('[name^="menu-item"]').removeAttr("name")):(jQuery(".categorychecklist",o).html("<li><p>noResultsFound</p></li>"),void jQuery(".spinner",o).hide())},initialize_color_pickers:function(){var e=this;jQuery(".color-picker").wpColorPicker({change:function(t){e.throttle(setTimeout(function(){e.update_theme()},5),250);var o=jQuery(t.currentTarget);o.hasClass("background-color")&&o.parents("table").find(".background-opacity").show()},clear:function(t){e.update_theme();var o=jQuery(t.currentTarget).prev();o.hasClass("background-color")&&o.parents("table").find(".background-opacity").hide()}})},initialize_range_sliders:function(){var e,t,o,n,i,r=jQuery('<input type="range"/>'),a=jQuery('<button class="popmake-range-plus">+</button>'),p=jQuery('<button class="popmake-range-minus">-</button>');jQuery(document).on("input",'input[type="range"]',function(){var e=jQuery(this);e.siblings(".popmake-range-manual").val(e.val())}),jQuery(".popmake-range-manual").each(function(){var e=jQuery(this),t=e.data("force-minmax"),s=parseInt(e.prop("min"),0),l=parseInt(e.prop("max"),0),u=parseInt(e.prop("step"),0),c=parseInt(e.val(),0);o=r.clone(),n=a.clone(),i=p.clone(),t&&c>l&&(c=l,e.val(c)),o.prop({min:s||0,max:t||l&&l>c?l:1.5*c,step:u||1.5*c/100,value:c}).on("change input",function(){e.trigger("input")}),e.next().after(i,n),e.before(o)}),jQuery(document).on("click",".popmake-range-manual",function(){var e=jQuery(this);e.prop("readonly",!1)}).on("focusout",".popmake-range-manual",function(){var e=jQuery(this);e.prop("readonly",!0)}).on("change",".popmake-range-manual",function(){var e=jQuery(this),t=parseInt(e.prop("max"),0),n=parseInt(e.prop("step"),0),i=e.data("force-minmax"),r=parseInt(e.val(),0);o=e.prev(),i&&r>t&&(r=t,e.val(r)),o.prop({max:i||t&&t>r?t:1.5*r,step:n||1.5*r/100,value:r})}).on("click",".popmake-range-plus",function(e){e.preventDefault();var t=jQuery(this).siblings(".popmake-range-manual"),n=parseInt(t.prop("step"),0),i=parseInt(t.val(),0),r=i+n;o=t.prev(),t.val(r).trigger("input"),o.val(r)}).on("click",".popmake-range-minus",function(e){e.preventDefault();var t=jQuery(this).siblings(".popmake-range-manual"),n=parseInt(t.prop("step"),0),i=parseInt(t.val(),0),r=i-n;o=t.prev(),t.val(r).trigger("input"),o.val(r)}),e=document.createElement("input"),e.setAttribute("type","range"),"text"===e.type&&jQuery("input[type=range]").each(function(e,n){t=jQuery(n),o=jQuery("<div />").slider({min:parseInt(t.attr("min"),10)||0,max:parseInt(t.attr("max"),10)||100,value:parseInt(t.attr("value"),10)||0,step:parseInt(t.attr("step"),10)||1,slide:function(e,t){jQuery(this).prev("input").val(t.value)}}),t.after(o).hide()})},initialize_popup_page:function(){var e=function(e){var t,o,n=e.siblings(".options");e.is(":checked")?(n.show(),"popup_targeting_condition_on_entire_site"===e.attr("id")?(t=e.parents("#popmake_popup_targeting_condition_fields").find('[id^="targeting_condition-exclude_on_"]'),o=e.parents(".targeting_condition").siblings(".targeting_condition"),o.hide(),jQuery("> *",o).prop("disabled",!0),t.show(),jQuery("> *",t).prop("disabled",!1)):jQuery("*",n).prop("disabled",!1)):(n.hide(),"popup_targeting_condition_on_entire_site"===e.attr("id")?(t=e.parents("#popmake_popup_targeting_condition_fields").find('[id^="targeting_condition-exclude_on_"]'),o=e.parents(".targeting_condition").siblings(".targeting_condition"),o.show(),jQuery("> *",o).prop("disabled",!1),t.hide(),jQuery("> *",t).prop("disabled",!0)):jQuery("*",n).prop("disabled",!0))},t=function(e){var t=e.parents(".options").find('input[type="checkbox"]:eq(0)'),o=t.attr("name").indexOf("exclude")>=0,n=o?t.attr("name").replace("popup_targeting_condition_exclude_on_specific_",""):t.attr("name").replace("popup_targeting_condition_on_specific_",""),i=jQuery(o?"#exclude_on_specific_"+n:"#on_specific_"+n);e.is(":checked")&&("true"===e.val()?(t.prop("checked",!0),i.show(),jQuery("*",i).prop("disabled",!1)):""===e.val()&&(t.prop("checked",!1),i.hide(),jQuery("*",i).prop("disabled",!0)))},o=function(){"custom"===jQuery("#popup_display_size").val()?(jQuery(".custom-size-only").show(),jQuery(".responsive-size-only").hide(),jQuery("#popup_display_custom_height_auto").is(":checked")?jQuery(".custom-size-height-only").hide():jQuery(".custom-size-height-only").show()):(jQuery(".custom-size-only").hide(),"auto"!==jQuery("#popup_display_size").val()?(jQuery(".responsive-size-only").show(),jQuery("#popup_display_custom_height_auto").prop("checked",!1)):jQuery(".responsive-size-only").hide())},n=function(){jQuery(".animation-speed, .animation-origin").hide(),"fade"===jQuery("#popup_display_animation_type").val()?jQuery(".animation-speed").show():"none"!==jQuery("#popup_display_animation_type").val()&&jQuery(".animation-speed, .animation-origin").show()},i=function(){var e=jQuery("#popup_display_location"),t=e.parents("table"),o=e.val();jQuery("tr.top, tr.right, tr.left, tr.bottom",t).hide(),o.indexOf("top")>=0&&jQuery("tr.top").show(),o.indexOf("left")>=0&&jQuery("tr.left").show(),o.indexOf("bottom")>=0&&jQuery("tr.bottom").show(),o.indexOf("right")>=0&&jQuery("tr.right").show()},r=function(){jQuery("#popup_auto_open_session_cookie").is(":checked")?jQuery(".not-session-cookie").hide():jQuery(".not-session-cookie").show()},a=function(){jQuery("#popup_auto_open_enabled").is(":checked")?(jQuery(".auto-open-enabled").show(),r()):jQuery(".auto-open-enabled").hide()},p=function(){jQuery("#popup_auto_open_cookie_key").val((new Date).getTime().toString(16))},s=function(){""!==jQuery("#popuptitle").val()?jQuery("#popmake-preview .popmake-title").show().html(jQuery("#popuptitle").val()):jQuery("#popmake-preview .popmake-title").hide()},l=function(){var e="";jQuery("#wp-content-wrap").hasClass("tmce-active")?(console.log(1),e=tinyMCE.activeEditor.getContent()):(console.log(2),e=jQuery("#content").val()),jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"popmake_popup_preview_content",popmake_nonce:popmake_admin_ajax_nonce,popup_id:jQuery("#post_ID").val(),popup_content:e}}).done(function(e){e.success&&(jQuery("#popmake-preview .popmake-content").html(e.content),jQuery("#popmake-preview").popmake("open"))})},u=function(){var e,t=jQuery("[name^='popup_display_']").serializeArray(),o=jQuery("#popmake-preview"),n=o.data("popmake");for(e=0;t.length>e;e+=1)0===t[e].name.indexOf("popup_display_")&&(n.meta.display[t[e].name.replace("popup_display_","")]=t[e].value);o.removeClass("theme-"+n.theme_id),n.theme_id=jQuery("#popup_theme").val(),jQuery("#popmake-preview").addClass("theme-"+n.theme_id).data("popmake",n)};jQuery("#popuptitlediv").insertAfter("#titlediv"),jQuery('[name^="menu-item"]').removeAttr("name"),jQuery("#trigger-popmake-preview").on("click",function(e){return e.preventDefault(),e.stopPropagation(),s(),u(),l(),!1}),jQuery(document).on("keydown","#popuptitle",function(e){var t=e.keyCode||e.which;9===t&&(e.preventDefault(),jQuery("#title").focus())}).on("keydown","#title, #popuptitle",function(e){var t,o=e.keyCode||e.which;e.shiftKey||9!==o||(e.preventDefault(),t="title"===jQuery(this).attr("id")?"#popuptitle":"#insert-media-button",jQuery(t).focus())}).on("keydown","#popuptitle, #insert-media-button",function(e){var t,o=e.keyCode||e.which;e.shiftKey&&9===o&&(e.preventDefault(),t="popuptitle"===jQuery(this).attr("id")?"#title":"#popuptitle",jQuery(t).focus())}).on("submit","#post",function(e){var t=jQuery("#title").val();(0===t.length||0===t.replace(/\s/g,"").length)&&(console.log(1),e.preventDefault(),jQuery("div#notice").remove(),jQuery("<div id='notice' class='error below-h2'><p>A name is required for all popups.</p></div>").insertAfter("h2"),jQuery("#title").focus(),jQuery("#publishing-action .spinner").removeClass("is-active"),jQuery("#publish").removeClass("disabled"),jQuery("#title").prop("required","required"))}).on("click","#popup_display_custom_height_auto",function(){o()}).on("click","#popup_auto_open_session_cookie",function(){r()}).on("click","#popup_auto_open_enabled",function(){a()}).on("click",".popmake-reset-auto-open-cookie-key",function(){p()}).on("change","#popup_display_size",function(){"custom"!==jQuery("#popup_display_size").val()&&"auto"!==jQuery("#popup_display_size").val()&&jQuery("#popup_display_position_fixed, #popup_display_scrollable_content").prop("checked",!1),o()}).on("change","#popup_display_animation_type",function(){n()}).on("change","#popup_display_location",function(){i()}),jQuery('#popmake_popup_targeting_condition_fields .targeting_condition > input[type="checkbox"]').on("click",function(){e(jQuery(this))}).each(function(){e(jQuery(this))}),jQuery('input[type="radio"][id*="popup_targeting_condition_"]').on("click",function(){t(jQuery(this))}).each(function(){t(jQuery(this))}),jQuery(".posttypediv, .taxonomydiv").each(function(){var e=jQuery(this),t=jQuery("> ul li"),o=jQuery(".tabs-panel",e);t.removeClass("tabs"),t.eq(0).addClass("tabs"),o.removeClass("tabs-panel-active").addClass("tabs-panel-inactive").removeAttr("style"),o.eq(0).removeClass("tabs-panel-inactive").addClass("tabs-panel-active")}),o(),n(),i(),a(),""===jQuery("#popup_auto_open_cookie_key").val()&&p()},theme_page_listeners:function(){var e=this;jQuery(document).on("change","select.font-family",function(){jQuery("select.font-weight option, select.font-style option",jQuery(this).parents("table")).prop("selected",!1),e.update_font_selectboxes()}).on("change","select.font-weight, select.font-style",function(){e.update_font_selectboxes()}).on("change input focusout","select, input",function(){e.update_theme()}).on("change","select.border-style",function(){var e=jQuery(this);"none"===e.val()?e.parents("table").find(".border-options").hide():e.parents("table").find(".border-options").show()}).on("change","#popup_theme_close_location",function(){var e=jQuery(this),t=e.parents("table");jQuery("tr.topleft, tr.topright, tr.bottomleft, tr.bottomright",t).hide(),jQuery("tr."+e.val(),t).show()})},update_theme:function(){var e,t=jQuery("[name^='popup_theme_']").serializeArray(),o={};for(e=0;t.length>e;e+=1)0===t[e].name.indexOf("popup_theme_")&&(o[t[e].name.replace("popup_theme_","")]=t[e].value);this.retheme_popup(o)},theme_preview_scroll:function(){var e=jQuery("#popmake-theme-editor .empreview, body.post-type-popup_theme form#post #popmake_popup_theme_preview"),t=e.parent(),o=e.offset().top-50;jQuery(window).on("scroll",function(){jQuery("> .postbox:visible",t).index(e)===jQuery("> .postbox:visible",t).length-1&&jQuery(window).scrollTop()>=o?e.css({left:e.offset().left,width:e.width(),height:e.height(),position:"fixed",top:50}):e.removeAttr("style")})},update_font_selectboxes:function(){return jQuery("select.font-family").each(function(){var e,t,o=jQuery(this),n=o.parents("table").find("select.font-weight"),i=o.parents("table").find("select.font-style"),r=n.find("option"),a=i.find("option");if(void 0!==popmake_google_fonts[o.val()]){if(e=popmake_google_fonts[o.val()],r.hide(),a.hide(),e.variants.length)for(t=0;e.variants.length>t;t+=1)"regular"===e.variants[t]?(jQuery('option[value="normal"]',n).show(),jQuery('option[value="normal"]',i).show()):(e.variants[t].indexOf("italic")>=0&&jQuery('option[value="italic"]',i).show(),jQuery('option[value="'+parseInt(e.variants[t],10)+'"]',n).show())}else r.show(),a.show();n.parents("tr:first").show(),n.find("option:visible").length<=1?n.parents("tr:first").hide():n.parents("tr:first").show(),i.parents("tr:first").show(),i.find("option:visible").length<=1?i.parents("tr:first").hide():i.parents("tr:first").show()})},convert_theme_for_preview:function(){},convert_meta_to_object:function(e){var t,o,n,i={};for(n in e)e.hasOwnProperty(n)&&(t=n.split(/_(.+)?/)[0],o=n.split(/_(.+)?/)[1],void 0===i[t]&&(i[t]={}),i[t][o]=e[n]);return i},initialize_theme_page:function(){jQuery("#popuptitlediv").insertAfter("#titlediv");var e=this,t=jQuery("#popup_theme_close_location").parents("table");switch(e.update_theme(),e.theme_page_listeners(),e.theme_preview_scroll(),e.update_font_selectboxes(),jQuery(document).on("click",".popmake-preview",function(e){e.preventDefault(),jQuery("#popmake-preview, #popmake-overlay").css({visibility:"visible"}).show()}).on("click",".popmake-close",function(){jQuery("#popmake-preview, #popmake-overlay").hide()}),jQuery("select.border-style").each(function(){var e=jQuery(this);"none"===e.val()?e.parents("table").find(".border-options").hide():e.parents("table").find(".border-options").show()}),jQuery(".color-picker.background-color").each(function(){var e=jQuery(this);""===e.val()?e.parents("table").find(".background-opacity").hide():e.parents("table").find(".background-opacity").show()}),jQuery("tr.topleft, tr.topright, tr.bottomleft, tr.bottomright",t).hide(),jQuery("#popup_theme_close_location").val()){case"topleft":jQuery("tr.topleft",t).show();break;case"topright":jQuery("tr.topright",t).show();break;case"bottomleft":jQuery("tr.bottomleft",t).show();break;case"bottomright":jQuery("tr.bottomright",t).show()}},retheme_popup:function(e){var t,o=jQuery(".empreview .example-popup-overlay, #popmake-overlay"),n=jQuery(".empreview .example-popup, #popmake-preview"),i=jQuery(".title, .popmake-title",n),r=jQuery(".content, .popmake-content",n),a=jQuery(".close-popup, .popmake-close",n),p="yes"===e.container_boxshadow_inset?"inset ":"",s="yes"===e.close_boxshadow_inset?"inset ":"";switch(this.convert_theme_for_preview(e),void 0!==popmake_google_fonts[e.title_font_family]&&(t="//fonts.googleapis.com/css?family="+e.title_font_family,"normal"!==e.title_font_weight&&(t+=":"+e.title_font_weight),"italic"===e.title_font_style&&(-1===t.indexOf(":")&&(t+=":"),t+="italic"),jQuery("body").append('<link href="'+t+'" rel="stylesheet" type="text/css">')),void 0!==popmake_google_fonts[e.content_font_family]&&(t="//fonts.googleapis.com/css?family="+e.content_font_family,"normal"!==e.content_font_weight&&(t+=":"+e.content_font_weight),"italic"===e.content_font_style&&(-1===t.indexOf(":")&&(t+=":"),t+="italic"),jQuery("body").append('<link href="'+t+'" rel="stylesheet" type="text/css">')),void 0!==popmake_google_fonts[e.close_font_family]&&(t="//fonts.googleapis.com/css?family="+e.close_font_family,"normal"!==e.close_font_weight&&(t+=":"+e.close_font_weight),"italic"===e.close_font_style&&(-1===t.indexOf(":")&&(t+=":"),t+="italic"),jQuery("body").append('<link href="'+t+'" rel="stylesheet" type="text/css">')),o.removeAttr("style").css({backgroundColor:this.convert_hex(e.overlay_background_color,e.overlay_background_opacity)}),n.removeAttr("style").css({padding:e.container_padding+"px",backgroundColor:this.convert_hex(e.container_background_color,e.container_background_opacity),borderStyle:e.container_border_style,borderColor:e.container_border_color,borderWidth:e.container_border_width+"px",borderRadius:e.container_border_radius+"px",boxShadow:p+e.container_boxshadow_horizontal+"px "+e.container_boxshadow_vertical+"px "+e.container_boxshadow_blur+"px "+e.container_boxshadow_spread+"px "+this.convert_hex(e.container_boxshadow_color,e.container_boxshadow_opacity)}),i.removeAttr("style").css({color:e.title_font_color,lineHeight:e.title_line_height+"px",fontSize:e.title_font_size+"px",fontFamily:e.title_font_family,fontStyle:e.title_font_style,fontWeight:e.title_font_weight,textAlign:e.title_text_align,textShadow:e.title_textshadow_horizontal+"px "+e.title_textshadow_vertical+"px "+e.title_textshadow_blur+"px "+this.convert_hex(e.title_textshadow_color,e.title_textshadow_opacity)}),r.removeAttr("style").css({color:e.content_font_color,fontFamily:e.content_font_family,fontStyle:e.content_font_style,fontWeight:e.content_font_weight}),a.html(e.close_text).removeAttr("style").css({padding:e.close_padding+"px",height:e.close_height>0?e.close_height+"px":"auto",width:e.close_width>0?e.close_width+"px":"auto",backgroundColor:this.convert_hex(e.close_background_color,e.close_background_opacity),color:e.close_font_color,lineHeight:e.close_line_height+"px",fontSize:e.close_font_size+"px",fontFamily:e.close_font_family,fontWeight:e.close_font_weight,fontStyle:e.close_font_style,borderStyle:e.close_border_style,borderColor:e.close_border_color,borderWidth:e.close_border_width+"px",borderRadius:e.close_border_radius+"px",boxShadow:s+e.close_boxshadow_horizontal+"px "+e.close_boxshadow_vertical+"px "+e.close_boxshadow_blur+"px "+e.close_boxshadow_spread+"px "+this.convert_hex(e.close_boxshadow_color,e.close_boxshadow_opacity),textShadow:e.close_textshadow_horizontal+"px "+e.close_textshadow_vertical+"px "+e.close_textshadow_blur+"px "+this.convert_hex(e.close_textshadow_color,e.close_textshadow_opacity)}),e.close_location){case"topleft":a.css({top:e.close_position_top+"px",left:e.close_position_left+"px"});break;case"topright":a.css({top:e.close_position_top+"px",right:e.close_position_right+"px"});break;case"bottomleft":a.css({bottom:e.close_position_bottom+"px",left:e.close_position_left+"px"});break;case"bottomright":a.css({bottom:e.close_position_bottom+"px",right:e.close_position_right+"px"})}jQuery(document).trigger("popmake-admin-retheme",[e])},serialize_form:function(e){var t={};return jQuery("[name]",e).each(function(){var e,o,n=jQuery(this).attr("name"),i=jQuery(this).val(),r=n.split("["),a=t,p=r.length;for(e=0;p>e;e+=1)o=r[e].replace("]",""),a[o]||(a[o]={}),e!==r.length-1?a=a[o]:e===r.length-1&&(a[o]=i)}),t},convert_hex:function(e,t){e=e.replace("#","");var o=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16),r="rgba("+o+","+n+","+i+","+t/100+")";return r},debounce:function(e,t){var o;return function(){var n=this,i=arguments;window.clearTimeout(o),o=window.setTimeout(function(){e.apply(n,i)},t)}},throttle:function(e,t){var o=!1,n=function(){o=!1};return function(){o||(e(),window.setTimeout(n,t),o=!0)}}},jQuery(document).ready(function(){PopMakeAdmin.init()})}();
|
assets/scripts/popup-maker-site.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/**
|
2 |
-
* Popup Maker v1.3.
|
3 |
*/
|
4 |
(function (jQuery) {
|
5 |
"use strict";
|
@@ -46,6 +46,10 @@
|
|
46 |
var $this = jQuery(this),
|
47 |
settings = jQuery.extend(true, {}, jQuery.fn.popmake.defaults, $this.data('popmake'), options);
|
48 |
|
|
|
|
|
|
|
|
|
49 |
if (!jQuery('#' + settings.overlay.attr.id).length) {
|
50 |
jQuery('<div>').attr(settings.overlay.attr).appendTo('body');
|
51 |
}
|
1 |
/**
|
2 |
+
* Popup Maker v1.3.6
|
3 |
*/
|
4 |
(function (jQuery) {
|
5 |
"use strict";
|
46 |
var $this = jQuery(this),
|
47 |
settings = jQuery.extend(true, {}, jQuery.fn.popmake.defaults, $this.data('popmake'), options);
|
48 |
|
49 |
+
if (!(settings.theme_id > 0)) {
|
50 |
+
settings.theme_id = popmake_default_theme;
|
51 |
+
}
|
52 |
+
|
53 |
if (!jQuery('#' + settings.overlay.attr.id).length) {
|
54 |
jQuery('<div>').attr(settings.overlay.attr).appendTo('body');
|
55 |
}
|
assets/scripts/popup-maker-site.min.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
/**
|
2 |
-
* Popup Maker v1.3.
|
3 |
*/
|
4 |
-
!function(e){"use strict";var t=!1;e(window).on("scroll",function(){t=!0}).on("scrollstop",function(){t=!1}),e.isFunction(e.fn.on)||(e.fn.on=function(e,t,o){return this.delegate(t,e,o)},e.fn.off=function(e,t,o){return this.undelegate(t,e,o)}),e.fn.popmake=function(t){return e.fn.popmake.methods[t]?e.fn.popmake.methods[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist on jQuery.fn.popmake"):e.fn.popmake.methods.init.apply(this,arguments)},e.fn.popmake.version=1.3,e.fn.popmake.last_open_popup=null,e.fn.popmake.last_open_trigger=null,e.fn.popmake.last_close_trigger=null,e.fn.popmake.methods={init:function(t){return this.each(function(){var o=e(this),i=e.extend(!0,{},e.fn.popmake.defaults,o.data("popmake"),t);return e("#"+i.overlay.attr.id).length||e("<div>").attr(i.overlay.attr).appendTo("body"),e(window).on("resize",function(){o.hasClass("active")&&e.fn.popmake.utilities.throttle(setTimeout(function(){o.popmake("reposition")},25),500,!1)}),"string"==typeof popmake_powered_by&&""!==popmake_powered_by&&e(".popmake-content",o).append(e(popmake_powered_by)),o.data("popmake",i).trigger("popmakeInit"),this})},setup_close:function(){var t=e(this),o=t.data("popmake"),i=e("#popmake-overlay"),a=e(".popmake-close",t);return a.off("click.popmake").on("click.popmake",function(o){o.preventDefault(),o.stopPropagation(),e.fn.popmake.last_close_trigger="Close Button",t.popmake("close")}),(o.meta.close.esc_press||o.meta.close.f4_press)&&e(window).off("keyup.popmake").on("keyup.popmake",function(i){27===i.keyCode&&o.meta.close.esc_press&&(e.fn.popmake.last_close_trigger="ESC Key",t.popmake("close")),115===i.keyCode&&o.meta.close.f4_press&&(e.fn.popmake.last_close_trigger="F4 Key",t.popmake("close"))}),o.meta.close.overlay_click&&i.off("click.popmake").on("click.popmake",function(o){o.preventDefault(),o.stopPropagation(),e.fn.popmake.last_close_trigger="Overlay Click",t.popmake("close")}),t.trigger("popmakeSetupClose"),this},open:function(t){var o=e(this),i=o.data("popmake");return i.meta.display.stackable||o.popmake("close_all"),o.css({visibility:"visible"}).hide().addClass("active").popmake("setup_close").popmake("reposition").trigger("popmakeBeforeOpen"),i.meta.close.button_delay>0&&o.find(".popmake-content + .popmake-close").fadeOut(0),o.hasClass("preventOpen")?(o.removeClass("preventOpen").removeClass("active"),this):(e("#popmake-overlay").prop("class","popmake-overlay theme-"+i.theme_id).css({"z-index":i.meta.display.overlay_zindex||1999999998}),o.css({"z-index":i.meta.display.zindex||1999999999}).popmake("animate",i.meta.display.animation_type,function(){i.meta.close.button_delay>0&&setTimeout(function(){o.find(".popmake-content + .popmake-close").fadeIn()},i.meta.close.button_delay),o.trigger("popmakeAfterOpen"),e.fn.popmake.last_open_popup=o,void 0!==t&&t()}),this)},close:function(t){return this.each(function(){var o=e(this),i=e("#popmake-overlay"),a=e(".popmake-close",o),n=o.data("popmake");return o.trigger("popmakeBeforeClose").fadeOut(n.close.close_speed,function(){i.length&&i.is(":visible")&&i.fadeOut(n.close.close_speed),e(window).off("keyup.popmake"),i.off("click.popmake"),a.off("click.popmake"),o.removeClass("active").trigger("popmakeAfterClose"),e("iframe",o).filter('[src*="youtube"],[src*="vimeo"]').each(function(){var t=e(this),o=t.attr("src").replace("autoplay=1","1=1");t.attr("src","").attr("src",o)}),e("video",o).each(function(){this.pause()}),void 0!==t&&t()}),this})},close_all:function(){return e(".popmake.active").popmake("close"),this},reposition:function(t){e(this).trigger("popmakeBeforeReposition");var o=e(this),i=o.data("popmake"),a=i.meta.display,n=a.location,s={my:"",at:""},p=!1;return n.indexOf("left")>=0&&(s={my:s.my+" left"+(0!==a.position_left?"+"+a.position_left:""),at:s.at+" left"}),n.indexOf("right")>=0&&(s={my:s.my+" right"+(0!==a.position_right?"-"+a.position_right:""),at:s.at+" right"}),n.indexOf("center")>=0&&(s="center"===n?{my:"center",at:"center"}:{my:s.my+" center",at:s.at+" center"}),n.indexOf("top")>=0&&(s={my:s.my+" top"+(0!==a.position_top?"+"+(e("body").hasClass("admin-bar")?parseInt(a.position_top,10)+32:a.position_top):""),at:s.at+" top"}),n.indexOf("bottom")>=0&&(s={my:s.my+" bottom"+(0!==a.position_bottom?"-"+a.position_bottom:""),at:s.at+" bottom"}),s.my=e.trim(s.my),s.at=e.trim(s.at),s.of=window,s.collision="none",s.using="function"==typeof t?t:e.fn.popmake.callbacks.reposition_using,o.is(":hidden")&&(p=o.css("opacity"),o.css({opacity:0}).show()),o.removeClass("responsive size-nano size-micro size-tiny size-small size-medium size-normal size-large size-xlarge fixed custom-position").addClass("size-"+i.meta.display.size),a.position_fixed&&o.addClass("fixed"),"custom"===i.meta.display.size?o.css({width:i.meta.display.custom_width+i.meta.display.custom_width_unit,height:i.meta.display.custom_height_auto?"auto":i.meta.display.custom_height+i.meta.display.custom_height_unit}):"auto"!==i.meta.display.size&&o.addClass("responsive").css({minWidth:""!==i.meta.display.responsive_min_width?i.meta.display.responsive_min_width+i.meta.display.responsive_min_width_unit:"auto",maxWidth:""!==i.meta.display.responsive_max_width?i.meta.display.responsive_max_width+i.meta.display.responsive_max_width_unit:"auto"}),o.addClass("custom-position").position(s).trigger("popmakeAfterReposition"),p&&o.css({opacity:p}).hide(),this},retheme:function(t){e(this).trigger("popmakeBeforeRetheme");var o,i,a=e(this),n=a.data("popmake"),s=e("#"+n.overlay.attr.id),p=a,r=e("."+n.title.attr["class"],p),c=e("> ."+n.content.attr["class"],p),l=e("> ."+n.close.attr["class"],p);switch(void 0===t&&(t=e.fn.popmake.themes[n.theme_id],void 0===t&&(t=e.fn.popmake.themes[1])),o="yes"===t.container.boxshadow_inset?"inset ":"",i="yes"===t.close.boxshadow_inset?"inset ":"",s.removeAttr("style").css({backgroundColor:e.fn.popmake.utilities.convert_hex(t.overlay.background_color,t.overlay.background_opacity),zIndex:n.meta.display.overlay_zindex||998}),p.css({padding:t.container.padding+"px",backgroundColor:e.fn.popmake.utilities.convert_hex(t.container.background_color,t.container.background_opacity),borderStyle:t.container.border_style,borderColor:t.container.border_color,borderWidth:t.container.border_width+"px",borderRadius:t.container.border_radius+"px",boxShadow:o+t.container.boxshadow_horizontal+"px "+t.container.boxshadow_vertical+"px "+t.container.boxshadow_blur+"px "+t.container.boxshadow_spread+"px "+e.fn.popmake.utilities.convert_hex(t.container.boxshadow_color,t.container.boxshadow_opacity),zIndex:n.meta.display.zindex||999}),r.css({color:t.title.font_color,lineHeight:t.title.line_height+"px",fontSize:t.title.font_size+"px",fontFamily:t.title.font_family,fontWeight:t.title.font_weight,fontStyle:t.title.font_style,textAlign:t.title.text_align,textShadow:t.title.textshadow_horizontal+"px "+t.title.textshadow_vertical+"px "+t.title.textshadow_blur+"px "+e.fn.popmake.utilities.convert_hex(t.title.textshadow_color,t.title.textshadow_opacity)}),c.css({color:t.content.font_color,fontFamily:t.content.font_family,fontWeight:t.content.font_weight,fontStyle:t.content.font_style}),e("p, label",c).css({color:t.content.font_color,fontFamily:t.content.font_family}),l.html(t.close.text).css({padding:t.close.padding+"px",height:t.close.height+"px",width:t.close.width+"px",backgroundColor:e.fn.popmake.utilities.convert_hex(t.close.background_color,t.close.background_opacity),color:t.close.font_color,lineHeight:t.close.line_height+"px",fontSize:t.close.font_size+"px",fontWeight:t.close.font_weight,fontStyle:t.close.font_style,fontFamily:t.close.font_family,borderStyle:t.close.border_style,borderColor:t.close.border_color,borderWidth:t.close.border_width+"px",borderRadius:t.close.border_radius+"px",boxShadow:i+t.close.boxshadow_horizontal+"px "+t.close.boxshadow_vertical+"px "+t.close.boxshadow_blur+"px "+t.close.boxshadow_spread+"px "+e.fn.popmake.utilities.convert_hex(t.close.boxshadow_color,t.close.boxshadow_opacity),textShadow:t.close.textshadow_horizontal+"px "+t.close.textshadow_vertical+"px "+t.close.textshadow_blur+"px "+e.fn.popmake.utilities.convert_hex(t.close.textshadow_color,t.close.textshadow_opacity),left:"auto",right:"auto",bottom:"auto",top:"auto"}),t.close.location){case"topleft":l.css({top:t.close.position_top+"px",left:t.close.position_left+"px"});break;case"topright":l.css({top:t.close.position_top+"px",right:t.close.position_right+"px"});break;case"bottomleft":l.css({bottom:t.close.position_bottom+"px",left:t.close.position_left+"px"});break;case"bottomright":l.css({bottom:t.close.position_bottom+"px",right:t.close.position_right+"px"})}return a.trigger("popmakeAfterRetheme",[t]),this},animate_overlay:function(t,o,i){var a=e(this),n=a.data("popmake");if(n.meta.display.overlay_disabled)i();else{if(e.fn.popmake.overlay_animations[t])return e.fn.popmake.overlay_animations[t].apply(this,Array.prototype.slice.call(arguments,1));e.error("Animation style "+e.fn.popmake.overlay_animations+" does not exist.")}return this},animate:function(t){return e.fn.popmake.animations[t]?e.fn.popmake.animations[t].apply(this,Array.prototype.slice.call(arguments,1)):(e.error("Animation style "+e.fn.popmake.animations+" does not exist."),this)},animation_origin:function(t){var o=e(this),i={my:"",at:""};switch(t){case"top":i={my:"left+"+o.offset().left+" bottom-100",at:"left top"};break;case"bottom":i={my:"left+"+o.offset().left+" top+100",at:"left bottom"};break;case"left":i={my:"right top+"+o.offset().top,at:"left top"};break;case"right":i={my:"left top+"+o.offset().top,at:"right top"};break;default:t.indexOf("left")>=0&&(i={my:i.my+" right",at:i.at+" left"}),t.indexOf("right")>=0&&(i={my:i.my+" left",at:i.at+" right"}),t.indexOf("center")>=0&&(i={my:i.my+" center",at:i.at+" center"}),t.indexOf("top")>=0&&(i={my:i.my+" bottom-100",at:i.at+" top"}),t.indexOf("bottom")>=0&&(i={my:i.my+" top+100",at:i.at+" bottom"}),i.my=e.trim(i.my),i.at=e.trim(i.at)}return i.of=window,i.collision="none",i}},e.fn.popmake.callbacks={reposition_using:function(t){e(this).css(t)}},e.fn.popmake.cookie={defaults:{},raw:!1,json:!0,pluses:/\+/g,encode:function(t){return e.fn.popmake.cookie.raw?t:encodeURIComponent(t)},decode:function(t){return e.fn.popmake.cookie.raw?t:decodeURIComponent(t)},stringifyCookieValue:function(t){return e.fn.popmake.cookie.encode(e.fn.popmake.cookie.json?JSON.stringify(t):String(t))},parseCookieValue:function(t){0===t.indexOf('"')&&(t=t.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return t=decodeURIComponent(t.replace(e.fn.popmake.cookie.pluses," ")),e.fn.popmake.cookie.json?JSON.parse(t):t}catch(o){}},read:function(t,o){var i=e.fn.popmake.cookie.raw?t:e.fn.popmake.cookie.parseCookieValue(t);return e.isFunction(o)?o(i):i},process:function(t,o,i,a){var n,s,p,r,c,l=t?void 0:{},m=new Date,d=document.cookie?document.cookie.split("; "):[];if(void 0!==o&&!e.isFunction(o)){switch(typeof i){case"number":m.setTime(+m+864e5*i),i=m;break;case"string":m.setTime(1e3*e.fn.popmake.utilities.strtotime("+"+i)),i=m}return void(document.cookie=[e.fn.popmake.cookie.encode(t),"=",e.fn.popmake.cookie.stringifyCookieValue(o),i?"; expires="+i.toUTCString():"",a?"; path="+a:""].join(""))}for(r=0,c=d.length;c>r;r+=1){if(n=d[r].split("="),s=e.fn.popmake.cookie.decode(n.shift()),p=n.join("="),t&&t===s){l=e.fn.popmake.cookie.read(p,o);break}p=e.fn.popmake.cookie.read(p),t||void 0===p||(l[s]=p)}return l},remove:function(t){return void 0===e.pm_cookie(t)?!1:(e.pm_cookie(t,"",-1),!e.pm_cookie(t))}},e.pm_cookie=e.fn.popmake.cookie.process,e.pm_remove_cookie=e.fn.popmake.cookie.remove,e.fn.popmake.utilities={convert_hex:function(e,t){e=e.replace("#","");var o=parseInt(e.substring(0,2),16),i=parseInt(e.substring(2,4),16),a=parseInt(e.substring(4,6),16),n="rgba("+o+","+i+","+a+","+t/100+")";return n},debounce:function(e,t){var o;return function(){var i=this,a=arguments;window.clearTimeout(o),o=window.setTimeout(function(){e.apply(i,a)},t)}},throttle:function(e,t){var o=!1,i=function(){o=!1};return function(){o||(e.apply(this,arguments),window.setTimeout(i,t),o=!0)}},getXPath:function(t){var o,i,a,n,s,p=[];return e.each(e(t).parents(),function(t,r){return o=e(r),i=o.attr("id")||"",a=o.attr("class")||"",n=o.get(0).tagName.toLowerCase(),s=o.parent().children(n).index(o),"body"===n?!1:(a.length>0&&(a=a.split(" "),a=a[0]),void p.push(n+(i.length>0?"#"+i:a.length>0?"."+a.split(" ").join("."):":eq("+s+")")))}),p.reverse().join(" > ")},strtotime:function(e,t){function o(e,t,o){var i,a=c[t];void 0!==a&&(i=a-r.getDay(),0===i?i=7*o:i>0&&"last"===e?i-=7:0>i&&"next"===e&&(i+=7),r.setDate(r.getDate()+i))}function i(e){var t=e.split(" "),i=t[0],a=t[1].substring(0,3),n=/\d+/.test(i),s="ago"===t[2],p=("last"===i?-1:1)*(s?-1:1);if(n&&(p*=parseInt(i,10)),l.hasOwnProperty(a)&&!t[1].match(/^mon(day|\.)?$/i))return r["set"+l[a]](r["get"+l[a]]()+p);if("wee"===a)return r.setDate(r.getDate()+7*p);if("next"===i||"last"===i)o(i,a,p);else if(!n)return!1;return!0}var a,n,s,p,r,c,l,m,d,f,u,h=!1;if(!e)return h;if(e=e.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ").replace(/[\t\r\n]/g,"").toLowerCase(),n=e.match(/^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/),n&&n[2]===n[4])if(n[1]>1901)switch(n[2]){case"-":return n[3]>12||n[5]>31?h:new Date(n[1],parseInt(n[3],10)-1,n[5],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3;case".":return h;case"/":return n[3]>12||n[5]>31?h:new Date(n[1],parseInt(n[3],10)-1,n[5],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3}else if(n[5]>1901)switch(n[2]){case"-":return n[3]>12||n[1]>31?h:new Date(n[5],parseInt(n[3],10)-1,n[1],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3;case".":return n[3]>12||n[1]>31?h:new Date(n[5],parseInt(n[3],10)-1,n[1],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3;case"/":return n[1]>12||n[3]>31?h:new Date(n[5],parseInt(n[1],10)-1,n[3],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3}else switch(n[2]){case"-":return n[3]>12||n[5]>31||n[1]<70&&n[1]>38?h:(p=n[1]>=0&&n[1]<=38?+n[1]+2e3:n[1],new Date(p,parseInt(n[3],10)-1,n[5],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3);case".":return n[5]>=70?n[3]>12||n[1]>31?h:new Date(n[5],parseInt(n[3],10)-1,n[1],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3:n[5]<60&&!n[6]?n[1]>23||n[3]>59?h:(s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate(),n[1]||0,n[3]||0,n[5]||0,n[9]||0)/1e3):h;case"/":return n[1]>12||n[3]>31||n[5]<70&&n[5]>38?h:(p=n[5]>=0&&n[5]<=38?+n[5]+2e3:n[5],new Date(p,parseInt(n[1],10)-1,n[3],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3);case":":return n[1]>23||n[3]>59||n[5]>59?h:(s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate(),n[1]||0,n[3]||0,n[5]||0)/1e3)}if("now"===e)return null===t||isNaN(t)?(new Date).getTime()/1e3||0:t||0;if(a=Date.parse(e),!isNaN(a))return a/1e3||0;if(r=t?new Date(1e3*t):new Date,c={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},l={yea:"FullYear",mon:"Month",day:"Date",hou:"Hours",min:"Minutes",sec:"Seconds"},d="(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)",f="([+-]?\\d+\\s"+d+"|(last|next)\\s"+d+")(\\sago)?",n=e.match(new RegExp(f,"gi")),!n)return h;for(u=0,m=n.length;m>u;u+=1)if(!i(n[u]))return h;return r.getTime()/1e3}},e.fn.popmake.utilies=e.fn.popmake.utilities,e.fn.popmake.defaults={meta:{display:{stackable:0,overlay_disabled:0,size:"medium",responsive_max_width:"",responsive_max_width_unit:"%",responsive_min_width:"",responsive_min_width_unit:"%",custom_width:"",custom_width_unit:"%",custom_height:"",custom_height_unit:"em",custom_height_auto:0,location:"center top",position_top:100,position_left:0,position_bottom:0,position_right:0,position_fixed:0,animation_type:"fade",animation_speed:350,animation_origin:"center top"},close:{overlay_click:0,esc_press:0,f4_press:0}},container:{active_class:"active",attr:{"class":"popmake"}},title:{attr:{"class":"popmake-title"}},content:{attr:{"class":"popmake-content"}},close:{close_speed:0,attr:{"class":"popmake-close"}},overlay:{attr:{id:"popmake-overlay","class":"popmake-overlay"}}},e.fn.popmake.overlay_animations={none:function(t,o){e("#popmake-overlay").show(t,o)},fade:function(t,o){e("#popmake-overlay").fadeIn(t,o)},slide:function(t,o){e("#popmake-overlay").slideDown(t,o)}},e.fn.popmake.animations={none:function(t){var o=e(this);return o.popmake("animate_overlay","none",0,function(){o.css({display:"block"}),void 0!==t&&t()}),this},slide:function(o){var i=e(this).show(0).css({opacity:0}),a=i.data("popmake"),n=a.meta.display.animation_speed/2,s=i.popmake("animation_origin",a.meta.display.animation_origin);return a.meta.display.position_fixed||t||e("html").css("overflow-x","hidden"),i.position(s).css({opacity:1}).popmake("animate_overlay","fade",n,function(){i.popmake("reposition",function(t){i.animate(t,n,"swing",function(){a.meta.display.position_fixed||e("html").css("overflow-x","inherit"),void 0!==o&&o()})})}),this},fade:function(t){var o=e(this).show(0).css({opacity:0}),i=o.data("popmake"),a=i.meta.display.animation_speed/2;return o.popmake("animate_overlay","fade",a,function(){o.animate({opacity:1},a,"swing",function(){void 0!==t&&t()})}),this},fadeAndSlide:function(o){var i=e(this).show(0).css({opacity:0}),a=i.data("popmake"),n=a.meta.display.animation_speed/2,s=i.popmake("animation_origin",a.meta.display.animation_origin);return a.meta.display.position_fixed||t||e("html").css("overflow-x","hidden"),i.position(s).popmake("animate_overlay","fade",n,function(){i.popmake("reposition",function(t){t.opacity=1,i.animate(t,n,"swing",function(){a.meta.display.position_fixed||e("html").css("overflow-x","inherit"),void 0!==o&&o()})})}),this},grow:function(o){var i=e(this).show(0).css({opacity:0}),a=i.data("popmake"),n=a.meta.display.animation_speed/2,s=i.popmake("animation_origin",a.meta.display.animation_origin);return a.meta.display.position_fixed||t||e("html").css("overflow-x","hidden"),i.position(s).css({opacity:1}).popmake("animate_overlay","fade",n,function(){i.popmake("reposition",function(t){i.animate(t,n,"swing",function(){a.meta.display.position_fixed||e("html").css("overflow-x","inherit"),void 0!==o&&o()})})}),this},growAndSlide:function(o){var i=e(this).show(0).css({opacity:0}),a=i.data("popmake"),n=a.meta.display.animation_speed/2,s=i.popmake("animation_origin",a.meta.display.animation_origin);return a.meta.display.position_fixed||t||e("html").css("overflow-x","hidden"),i.position(s).css({opacity:1}).popmake("animate_overlay","fade",n,function(){i.popmake("reposition",function(t){i.animate(t,n,"swing",function(){a.meta.display.position_fixed||e("html").css("overflow-x","inherit"),void 0!==o&&o()})})}),this}},e(".popmake").css({visibility:"visible"}).hide(),e(document).ready(function(){e(".popmake").popmake().each(function(){var t,o=e(this),i=o.data("popmake"),a=i.meta.click_open,n=".popmake-"+i.id+", .popmake-"+i.slug,s=i.meta.admin_debug,p=i.meta.auto_open,r="popmake-auto-open-"+i.id;if(void 0!==a&&""!==a.extra_selectors&&(n+=", "+a.extra_selectors),e(n).css({cursor:"pointer"}),e(document).on("click.popmakeOpen",n,function(t){e(t.target).hasClass("do-default")||(t.preventDefault(),t.stopPropagation()),e.fn.popmake.last_open_trigger=this,o.popmake("open")}),void 0!==s&&s.enabled)return void o.popmake("open");if(void 0!==p&&p.enabled){switch(void 0!==p.cookie_key&&""!==p.cookie_key&&(r=r+"-"+p.cookie_key),t=function(){return void 0===e.pm_cookie(r)},o.on("popmakeSetCookie.auto-open",function(){""!==p.cookie_time&&t()&&e.pm_cookie(r,!0,p.session_cookie?null:p.cookie_time,p.cookie_path)}),p.cookie_trigger){case"open":o.on("popmakeAfterOpen",function(){o.trigger("popmakeSetCookie")});break;case"close":o.on("popmakeBeforeClose",function(){o.trigger("popmakeSetCookie")})}setTimeout(function(){t()&&(o.hasClass("active")||(e.fn.popmake.last_open_trigger="Auto Open Popups ID-"+i.id,o.popmake("open")))},p.delay)}})})}(jQuery);
|
1 |
/**
|
2 |
+
* Popup Maker v1.3.6
|
3 |
*/
|
4 |
+
!function(e){"use strict";var t=!1;e(window).on("scroll",function(){t=!0}).on("scrollstop",function(){t=!1}),e.isFunction(e.fn.on)||(e.fn.on=function(e,t,o){return this.delegate(t,e,o)},e.fn.off=function(e,t,o){return this.undelegate(t,e,o)}),e.fn.popmake=function(t){return e.fn.popmake.methods[t]?e.fn.popmake.methods[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist on jQuery.fn.popmake"):e.fn.popmake.methods.init.apply(this,arguments)},e.fn.popmake.version=1.3,e.fn.popmake.last_open_popup=null,e.fn.popmake.last_open_trigger=null,e.fn.popmake.last_close_trigger=null,e.fn.popmake.methods={init:function(t){return this.each(function(){var o=e(this),i=e.extend(!0,{},e.fn.popmake.defaults,o.data("popmake"),t);return i.theme_id>0||(i.theme_id=popmake_default_theme),e("#"+i.overlay.attr.id).length||e("<div>").attr(i.overlay.attr).appendTo("body"),e(window).on("resize",function(){o.hasClass("active")&&e.fn.popmake.utilities.throttle(setTimeout(function(){o.popmake("reposition")},25),500,!1)}),"string"==typeof popmake_powered_by&&""!==popmake_powered_by&&e(".popmake-content",o).append(e(popmake_powered_by)),o.data("popmake",i).trigger("popmakeInit"),this})},setup_close:function(){var t=e(this),o=t.data("popmake"),i=e("#popmake-overlay"),a=e(".popmake-close",t);return a.off("click.popmake").on("click.popmake",function(o){o.preventDefault(),o.stopPropagation(),e.fn.popmake.last_close_trigger="Close Button",t.popmake("close")}),(o.meta.close.esc_press||o.meta.close.f4_press)&&e(window).off("keyup.popmake").on("keyup.popmake",function(i){27===i.keyCode&&o.meta.close.esc_press&&(e.fn.popmake.last_close_trigger="ESC Key",t.popmake("close")),115===i.keyCode&&o.meta.close.f4_press&&(e.fn.popmake.last_close_trigger="F4 Key",t.popmake("close"))}),o.meta.close.overlay_click&&i.off("click.popmake").on("click.popmake",function(o){o.preventDefault(),o.stopPropagation(),e.fn.popmake.last_close_trigger="Overlay Click",t.popmake("close")}),t.trigger("popmakeSetupClose"),this},open:function(t){var o=e(this),i=o.data("popmake");return i.meta.display.stackable||o.popmake("close_all"),o.css({visibility:"visible"}).hide().addClass("active").popmake("setup_close").popmake("reposition").trigger("popmakeBeforeOpen"),i.meta.close.button_delay>0&&o.find(".popmake-content + .popmake-close").fadeOut(0),o.hasClass("preventOpen")?(o.removeClass("preventOpen").removeClass("active"),this):(e("#popmake-overlay").prop("class","popmake-overlay theme-"+i.theme_id).css({"z-index":i.meta.display.overlay_zindex||1999999998}),o.css({"z-index":i.meta.display.zindex||1999999999}).popmake("animate",i.meta.display.animation_type,function(){i.meta.close.button_delay>0&&setTimeout(function(){o.find(".popmake-content + .popmake-close").fadeIn()},i.meta.close.button_delay),o.trigger("popmakeAfterOpen"),e.fn.popmake.last_open_popup=o,void 0!==t&&t()}),this)},close:function(t){return this.each(function(){var o=e(this),i=e("#popmake-overlay"),a=e(".popmake-close",o),n=o.data("popmake");return o.trigger("popmakeBeforeClose").fadeOut(n.close.close_speed,function(){i.length&&i.is(":visible")&&i.fadeOut(n.close.close_speed),e(window).off("keyup.popmake"),i.off("click.popmake"),a.off("click.popmake"),o.removeClass("active").trigger("popmakeAfterClose"),e("iframe",o).filter('[src*="youtube"],[src*="vimeo"]').each(function(){var t=e(this),o=t.attr("src").replace("autoplay=1","1=1");t.attr("src","").attr("src",o)}),e("video",o).each(function(){this.pause()}),void 0!==t&&t()}),this})},close_all:function(){return e(".popmake.active").popmake("close"),this},reposition:function(t){e(this).trigger("popmakeBeforeReposition");var o=e(this),i=o.data("popmake"),a=i.meta.display,n=a.location,s={my:"",at:""},p=!1;return n.indexOf("left")>=0&&(s={my:s.my+" left"+(0!==a.position_left?"+"+a.position_left:""),at:s.at+" left"}),n.indexOf("right")>=0&&(s={my:s.my+" right"+(0!==a.position_right?"-"+a.position_right:""),at:s.at+" right"}),n.indexOf("center")>=0&&(s="center"===n?{my:"center",at:"center"}:{my:s.my+" center",at:s.at+" center"}),n.indexOf("top")>=0&&(s={my:s.my+" top"+(0!==a.position_top?"+"+(e("body").hasClass("admin-bar")?parseInt(a.position_top,10)+32:a.position_top):""),at:s.at+" top"}),n.indexOf("bottom")>=0&&(s={my:s.my+" bottom"+(0!==a.position_bottom?"-"+a.position_bottom:""),at:s.at+" bottom"}),s.my=e.trim(s.my),s.at=e.trim(s.at),s.of=window,s.collision="none",s.using="function"==typeof t?t:e.fn.popmake.callbacks.reposition_using,o.is(":hidden")&&(p=o.css("opacity"),o.css({opacity:0}).show()),o.removeClass("responsive size-nano size-micro size-tiny size-small size-medium size-normal size-large size-xlarge fixed custom-position").addClass("size-"+i.meta.display.size),a.position_fixed&&o.addClass("fixed"),"custom"===i.meta.display.size?o.css({width:i.meta.display.custom_width+i.meta.display.custom_width_unit,height:i.meta.display.custom_height_auto?"auto":i.meta.display.custom_height+i.meta.display.custom_height_unit}):"auto"!==i.meta.display.size&&o.addClass("responsive").css({minWidth:""!==i.meta.display.responsive_min_width?i.meta.display.responsive_min_width+i.meta.display.responsive_min_width_unit:"auto",maxWidth:""!==i.meta.display.responsive_max_width?i.meta.display.responsive_max_width+i.meta.display.responsive_max_width_unit:"auto"}),o.addClass("custom-position").position(s).trigger("popmakeAfterReposition"),p&&o.css({opacity:p}).hide(),this},retheme:function(t){e(this).trigger("popmakeBeforeRetheme");var o,i,a=e(this),n=a.data("popmake"),s=e("#"+n.overlay.attr.id),p=a,r=e("."+n.title.attr["class"],p),c=e("> ."+n.content.attr["class"],p),l=e("> ."+n.close.attr["class"],p);switch(void 0===t&&(t=e.fn.popmake.themes[n.theme_id],void 0===t&&(t=e.fn.popmake.themes[1])),o="yes"===t.container.boxshadow_inset?"inset ":"",i="yes"===t.close.boxshadow_inset?"inset ":"",s.removeAttr("style").css({backgroundColor:e.fn.popmake.utilities.convert_hex(t.overlay.background_color,t.overlay.background_opacity),zIndex:n.meta.display.overlay_zindex||998}),p.css({padding:t.container.padding+"px",backgroundColor:e.fn.popmake.utilities.convert_hex(t.container.background_color,t.container.background_opacity),borderStyle:t.container.border_style,borderColor:t.container.border_color,borderWidth:t.container.border_width+"px",borderRadius:t.container.border_radius+"px",boxShadow:o+t.container.boxshadow_horizontal+"px "+t.container.boxshadow_vertical+"px "+t.container.boxshadow_blur+"px "+t.container.boxshadow_spread+"px "+e.fn.popmake.utilities.convert_hex(t.container.boxshadow_color,t.container.boxshadow_opacity),zIndex:n.meta.display.zindex||999}),r.css({color:t.title.font_color,lineHeight:t.title.line_height+"px",fontSize:t.title.font_size+"px",fontFamily:t.title.font_family,fontWeight:t.title.font_weight,fontStyle:t.title.font_style,textAlign:t.title.text_align,textShadow:t.title.textshadow_horizontal+"px "+t.title.textshadow_vertical+"px "+t.title.textshadow_blur+"px "+e.fn.popmake.utilities.convert_hex(t.title.textshadow_color,t.title.textshadow_opacity)}),c.css({color:t.content.font_color,fontFamily:t.content.font_family,fontWeight:t.content.font_weight,fontStyle:t.content.font_style}),e("p, label",c).css({color:t.content.font_color,fontFamily:t.content.font_family}),l.html(t.close.text).css({padding:t.close.padding+"px",height:t.close.height+"px",width:t.close.width+"px",backgroundColor:e.fn.popmake.utilities.convert_hex(t.close.background_color,t.close.background_opacity),color:t.close.font_color,lineHeight:t.close.line_height+"px",fontSize:t.close.font_size+"px",fontWeight:t.close.font_weight,fontStyle:t.close.font_style,fontFamily:t.close.font_family,borderStyle:t.close.border_style,borderColor:t.close.border_color,borderWidth:t.close.border_width+"px",borderRadius:t.close.border_radius+"px",boxShadow:i+t.close.boxshadow_horizontal+"px "+t.close.boxshadow_vertical+"px "+t.close.boxshadow_blur+"px "+t.close.boxshadow_spread+"px "+e.fn.popmake.utilities.convert_hex(t.close.boxshadow_color,t.close.boxshadow_opacity),textShadow:t.close.textshadow_horizontal+"px "+t.close.textshadow_vertical+"px "+t.close.textshadow_blur+"px "+e.fn.popmake.utilities.convert_hex(t.close.textshadow_color,t.close.textshadow_opacity),left:"auto",right:"auto",bottom:"auto",top:"auto"}),t.close.location){case"topleft":l.css({top:t.close.position_top+"px",left:t.close.position_left+"px"});break;case"topright":l.css({top:t.close.position_top+"px",right:t.close.position_right+"px"});break;case"bottomleft":l.css({bottom:t.close.position_bottom+"px",left:t.close.position_left+"px"});break;case"bottomright":l.css({bottom:t.close.position_bottom+"px",right:t.close.position_right+"px"})}return a.trigger("popmakeAfterRetheme",[t]),this},animate_overlay:function(t,o,i){var a=e(this),n=a.data("popmake");if(n.meta.display.overlay_disabled)i();else{if(e.fn.popmake.overlay_animations[t])return e.fn.popmake.overlay_animations[t].apply(this,Array.prototype.slice.call(arguments,1));e.error("Animation style "+e.fn.popmake.overlay_animations+" does not exist.")}return this},animate:function(t){return e.fn.popmake.animations[t]?e.fn.popmake.animations[t].apply(this,Array.prototype.slice.call(arguments,1)):(e.error("Animation style "+e.fn.popmake.animations+" does not exist."),this)},animation_origin:function(t){var o=e(this),i={my:"",at:""};switch(t){case"top":i={my:"left+"+o.offset().left+" bottom-100",at:"left top"};break;case"bottom":i={my:"left+"+o.offset().left+" top+100",at:"left bottom"};break;case"left":i={my:"right top+"+o.offset().top,at:"left top"};break;case"right":i={my:"left top+"+o.offset().top,at:"right top"};break;default:t.indexOf("left")>=0&&(i={my:i.my+" right",at:i.at+" left"}),t.indexOf("right")>=0&&(i={my:i.my+" left",at:i.at+" right"}),t.indexOf("center")>=0&&(i={my:i.my+" center",at:i.at+" center"}),t.indexOf("top")>=0&&(i={my:i.my+" bottom-100",at:i.at+" top"}),t.indexOf("bottom")>=0&&(i={my:i.my+" top+100",at:i.at+" bottom"}),i.my=e.trim(i.my),i.at=e.trim(i.at)}return i.of=window,i.collision="none",i}},e.fn.popmake.callbacks={reposition_using:function(t){e(this).css(t)}},e.fn.popmake.cookie={defaults:{},raw:!1,json:!0,pluses:/\+/g,encode:function(t){return e.fn.popmake.cookie.raw?t:encodeURIComponent(t)},decode:function(t){return e.fn.popmake.cookie.raw?t:decodeURIComponent(t)},stringifyCookieValue:function(t){return e.fn.popmake.cookie.encode(e.fn.popmake.cookie.json?JSON.stringify(t):String(t))},parseCookieValue:function(t){0===t.indexOf('"')&&(t=t.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return t=decodeURIComponent(t.replace(e.fn.popmake.cookie.pluses," ")),e.fn.popmake.cookie.json?JSON.parse(t):t}catch(o){}},read:function(t,o){var i=e.fn.popmake.cookie.raw?t:e.fn.popmake.cookie.parseCookieValue(t);return e.isFunction(o)?o(i):i},process:function(t,o,i,a){var n,s,p,r,c,l=t?void 0:{},m=new Date,d=document.cookie?document.cookie.split("; "):[];if(void 0!==o&&!e.isFunction(o)){switch(typeof i){case"number":m.setTime(+m+864e5*i),i=m;break;case"string":m.setTime(1e3*e.fn.popmake.utilities.strtotime("+"+i)),i=m}return void(document.cookie=[e.fn.popmake.cookie.encode(t),"=",e.fn.popmake.cookie.stringifyCookieValue(o),i?"; expires="+i.toUTCString():"",a?"; path="+a:""].join(""))}for(r=0,c=d.length;c>r;r+=1){if(n=d[r].split("="),s=e.fn.popmake.cookie.decode(n.shift()),p=n.join("="),t&&t===s){l=e.fn.popmake.cookie.read(p,o);break}p=e.fn.popmake.cookie.read(p),t||void 0===p||(l[s]=p)}return l},remove:function(t){return void 0===e.pm_cookie(t)?!1:(e.pm_cookie(t,"",-1),!e.pm_cookie(t))}},e.pm_cookie=e.fn.popmake.cookie.process,e.pm_remove_cookie=e.fn.popmake.cookie.remove,e.fn.popmake.utilities={convert_hex:function(e,t){e=e.replace("#","");var o=parseInt(e.substring(0,2),16),i=parseInt(e.substring(2,4),16),a=parseInt(e.substring(4,6),16),n="rgba("+o+","+i+","+a+","+t/100+")";return n},debounce:function(e,t){var o;return function(){var i=this,a=arguments;window.clearTimeout(o),o=window.setTimeout(function(){e.apply(i,a)},t)}},throttle:function(e,t){var o=!1,i=function(){o=!1};return function(){o||(e.apply(this,arguments),window.setTimeout(i,t),o=!0)}},getXPath:function(t){var o,i,a,n,s,p=[];return e.each(e(t).parents(),function(t,r){return o=e(r),i=o.attr("id")||"",a=o.attr("class")||"",n=o.get(0).tagName.toLowerCase(),s=o.parent().children(n).index(o),"body"===n?!1:(a.length>0&&(a=a.split(" "),a=a[0]),void p.push(n+(i.length>0?"#"+i:a.length>0?"."+a.split(" ").join("."):":eq("+s+")")))}),p.reverse().join(" > ")},strtotime:function(e,t){function o(e,t,o){var i,a=c[t];void 0!==a&&(i=a-r.getDay(),0===i?i=7*o:i>0&&"last"===e?i-=7:0>i&&"next"===e&&(i+=7),r.setDate(r.getDate()+i))}function i(e){var t=e.split(" "),i=t[0],a=t[1].substring(0,3),n=/\d+/.test(i),s="ago"===t[2],p=("last"===i?-1:1)*(s?-1:1);if(n&&(p*=parseInt(i,10)),l.hasOwnProperty(a)&&!t[1].match(/^mon(day|\.)?$/i))return r["set"+l[a]](r["get"+l[a]]()+p);if("wee"===a)return r.setDate(r.getDate()+7*p);if("next"===i||"last"===i)o(i,a,p);else if(!n)return!1;return!0}var a,n,s,p,r,c,l,m,d,f,u,h=!1;if(!e)return h;if(e=e.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ").replace(/[\t\r\n]/g,"").toLowerCase(),n=e.match(/^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/),n&&n[2]===n[4])if(n[1]>1901)switch(n[2]){case"-":return n[3]>12||n[5]>31?h:new Date(n[1],parseInt(n[3],10)-1,n[5],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3;case".":return h;case"/":return n[3]>12||n[5]>31?h:new Date(n[1],parseInt(n[3],10)-1,n[5],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3}else if(n[5]>1901)switch(n[2]){case"-":return n[3]>12||n[1]>31?h:new Date(n[5],parseInt(n[3],10)-1,n[1],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3;case".":return n[3]>12||n[1]>31?h:new Date(n[5],parseInt(n[3],10)-1,n[1],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3;case"/":return n[1]>12||n[3]>31?h:new Date(n[5],parseInt(n[1],10)-1,n[3],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3}else switch(n[2]){case"-":return n[3]>12||n[5]>31||n[1]<70&&n[1]>38?h:(p=n[1]>=0&&n[1]<=38?+n[1]+2e3:n[1],new Date(p,parseInt(n[3],10)-1,n[5],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3);case".":return n[5]>=70?n[3]>12||n[1]>31?h:new Date(n[5],parseInt(n[3],10)-1,n[1],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3:n[5]<60&&!n[6]?n[1]>23||n[3]>59?h:(s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate(),n[1]||0,n[3]||0,n[5]||0,n[9]||0)/1e3):h;case"/":return n[1]>12||n[3]>31||n[5]<70&&n[5]>38?h:(p=n[5]>=0&&n[5]<=38?+n[5]+2e3:n[5],new Date(p,parseInt(n[1],10)-1,n[3],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3);case":":return n[1]>23||n[3]>59||n[5]>59?h:(s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate(),n[1]||0,n[3]||0,n[5]||0)/1e3)}if("now"===e)return null===t||isNaN(t)?(new Date).getTime()/1e3||0:t||0;if(a=Date.parse(e),!isNaN(a))return a/1e3||0;if(r=t?new Date(1e3*t):new Date,c={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},l={yea:"FullYear",mon:"Month",day:"Date",hou:"Hours",min:"Minutes",sec:"Seconds"},d="(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)",f="([+-]?\\d+\\s"+d+"|(last|next)\\s"+d+")(\\sago)?",n=e.match(new RegExp(f,"gi")),!n)return h;for(u=0,m=n.length;m>u;u+=1)if(!i(n[u]))return h;return r.getTime()/1e3}},e.fn.popmake.utilies=e.fn.popmake.utilities,e.fn.popmake.defaults={meta:{display:{stackable:0,overlay_disabled:0,size:"medium",responsive_max_width:"",responsive_max_width_unit:"%",responsive_min_width:"",responsive_min_width_unit:"%",custom_width:"",custom_width_unit:"%",custom_height:"",custom_height_unit:"em",custom_height_auto:0,location:"center top",position_top:100,position_left:0,position_bottom:0,position_right:0,position_fixed:0,animation_type:"fade",animation_speed:350,animation_origin:"center top"},close:{overlay_click:0,esc_press:0,f4_press:0}},container:{active_class:"active",attr:{"class":"popmake"}},title:{attr:{"class":"popmake-title"}},content:{attr:{"class":"popmake-content"}},close:{close_speed:0,attr:{"class":"popmake-close"}},overlay:{attr:{id:"popmake-overlay","class":"popmake-overlay"}}},e.fn.popmake.overlay_animations={none:function(t,o){e("#popmake-overlay").show(t,o)},fade:function(t,o){e("#popmake-overlay").fadeIn(t,o)},slide:function(t,o){e("#popmake-overlay").slideDown(t,o)}},e.fn.popmake.animations={none:function(t){var o=e(this);return o.popmake("animate_overlay","none",0,function(){o.css({display:"block"}),void 0!==t&&t()}),this},slide:function(o){var i=e(this).show(0).css({opacity:0}),a=i.data("popmake"),n=a.meta.display.animation_speed/2,s=i.popmake("animation_origin",a.meta.display.animation_origin);return a.meta.display.position_fixed||t||e("html").css("overflow-x","hidden"),i.position(s).css({opacity:1}).popmake("animate_overlay","fade",n,function(){i.popmake("reposition",function(t){i.animate(t,n,"swing",function(){a.meta.display.position_fixed||e("html").css("overflow-x","inherit"),void 0!==o&&o()})})}),this},fade:function(t){var o=e(this).show(0).css({opacity:0}),i=o.data("popmake"),a=i.meta.display.animation_speed/2;return o.popmake("animate_overlay","fade",a,function(){o.animate({opacity:1},a,"swing",function(){void 0!==t&&t()})}),this},fadeAndSlide:function(o){var i=e(this).show(0).css({opacity:0}),a=i.data("popmake"),n=a.meta.display.animation_speed/2,s=i.popmake("animation_origin",a.meta.display.animation_origin);return a.meta.display.position_fixed||t||e("html").css("overflow-x","hidden"),i.position(s).popmake("animate_overlay","fade",n,function(){i.popmake("reposition",function(t){t.opacity=1,i.animate(t,n,"swing",function(){a.meta.display.position_fixed||e("html").css("overflow-x","inherit"),void 0!==o&&o()})})}),this},grow:function(o){var i=e(this).show(0).css({opacity:0}),a=i.data("popmake"),n=a.meta.display.animation_speed/2,s=i.popmake("animation_origin",a.meta.display.animation_origin);return a.meta.display.position_fixed||t||e("html").css("overflow-x","hidden"),i.position(s).css({opacity:1}).popmake("animate_overlay","fade",n,function(){i.popmake("reposition",function(t){i.animate(t,n,"swing",function(){a.meta.display.position_fixed||e("html").css("overflow-x","inherit"),void 0!==o&&o()})})}),this},growAndSlide:function(o){var i=e(this).show(0).css({opacity:0}),a=i.data("popmake"),n=a.meta.display.animation_speed/2,s=i.popmake("animation_origin",a.meta.display.animation_origin);return a.meta.display.position_fixed||t||e("html").css("overflow-x","hidden"),i.position(s).css({opacity:1}).popmake("animate_overlay","fade",n,function(){i.popmake("reposition",function(t){i.animate(t,n,"swing",function(){a.meta.display.position_fixed||e("html").css("overflow-x","inherit"),void 0!==o&&o()})})}),this}},e(".popmake").css({visibility:"visible"}).hide(),e(document).ready(function(){e(".popmake").popmake().each(function(){var t,o=e(this),i=o.data("popmake"),a=i.meta.click_open,n=".popmake-"+i.id+", .popmake-"+i.slug,s=i.meta.admin_debug,p=i.meta.auto_open,r="popmake-auto-open-"+i.id;if(void 0!==a&&""!==a.extra_selectors&&(n+=", "+a.extra_selectors),e(n).css({cursor:"pointer"}),e(document).on("click.popmakeOpen",n,function(t){e(t.target).hasClass("do-default")||(t.preventDefault(),t.stopPropagation()),e.fn.popmake.last_open_trigger=this,o.popmake("open")}),void 0!==s&&s.enabled)return void o.popmake("open");if(void 0!==p&&p.enabled){switch(void 0!==p.cookie_key&&""!==p.cookie_key&&(r=r+"-"+p.cookie_key),t=function(){return void 0===e.pm_cookie(r)},o.on("popmakeSetCookie.auto-open",function(){""!==p.cookie_time&&t()&&e.pm_cookie(r,!0,p.session_cookie?null:p.cookie_time,p.cookie_path)}),p.cookie_trigger){case"open":o.on("popmakeAfterOpen",function(){o.trigger("popmakeSetCookie")});break;case"close":o.on("popmakeBeforeClose",function(){o.trigger("popmakeSetCookie")})}setTimeout(function(){t()&&(o.hasClass("active")||(e.fn.popmake.last_open_trigger="Auto Open Popups ID-"+i.id,o.popmake("open")))},p.delay)}})})}(jQuery);
|
includes/admin/popups/metabox-display-fields.php
CHANGED
@@ -263,7 +263,7 @@ function popmake_admin_popup_form_display_tab_settings_position( $popup_id ) {
|
|
263 |
<tr>
|
264 |
<th scope="row"><?php _e( 'Fixed Postioning', 'popup-maker' ); ?></th>
|
265 |
<td>
|
266 |
-
<input type="checkbox" value="true" name="popup_display_position_fixed" id="popup_display_position_fixed" <?php
|
267 |
<label for="popup_display_position_fixed" class="description"><?php _e( 'Checking this sets the positioning of the popup to fixed.', 'popup-maker' ); ?></label>
|
268 |
</td>
|
269 |
</tr>
|
263 |
<tr>
|
264 |
<th scope="row"><?php _e( 'Fixed Postioning', 'popup-maker' ); ?></th>
|
265 |
<td>
|
266 |
+
<input type="checkbox" value="true" name="popup_display_position_fixed" id="popup_display_position_fixed" <?php checked( popmake_get_popup_display( $popup_id, 'position_fixed' ), true ); ?>/>
|
267 |
<label for="popup_display_position_fixed" class="description"><?php _e( 'Checking this sets the positioning of the popup to fixed.', 'popup-maker' ); ?></label>
|
268 |
</td>
|
269 |
</tr>
|
includes/class-popmake-fields.php
CHANGED
@@ -15,16 +15,18 @@ class Popmake_Fields {
|
|
15 |
|
16 |
public $sections = array();
|
17 |
|
18 |
-
private static $
|
19 |
|
20 |
public static function instance() {
|
21 |
$class = get_called_class();
|
22 |
|
23 |
-
|
24 |
-
|
|
|
|
|
25 |
}
|
26 |
|
27 |
-
return self::$
|
28 |
}
|
29 |
|
30 |
public function register_section( $id, $title, $callback = null ) {
|
15 |
|
16 |
public $sections = array();
|
17 |
|
18 |
+
private static $instances = array();
|
19 |
|
20 |
public static function instance() {
|
21 |
$class = get_called_class();
|
22 |
|
23 |
+
$class_key = md5( $class );
|
24 |
+
|
25 |
+
if ( ! isset( self::$instances[ $class_key ] ) || ! self::$instances[ $class_key ] instanceof $class ) {
|
26 |
+
self::$instances[ $class_key ] = new $class;
|
27 |
}
|
28 |
|
29 |
+
return self::$instances[ $class_key ];
|
30 |
}
|
31 |
|
32 |
public function register_section( $id, $title, $callback = null ) {
|
includes/scripts.php
CHANGED
@@ -35,6 +35,7 @@ function popmake_load_site_scripts() {
|
|
35 |
'jquery-ui-position'
|
36 |
), POPMAKE_VERSION, true );
|
37 |
wp_localize_script( 'popup-maker-site', 'ajaxurl', admin_url( 'admin-ajax.php' ) );
|
|
|
38 |
|
39 |
if ( popmake_get_option( 'popmake_powered_by_opt_in', false ) ) {
|
40 |
$size = popmake_get_option( 'popmake_powered_by_size', '' );
|
@@ -146,6 +147,7 @@ function popmake_load_admin_scripts() {
|
|
146 |
'jquery-ui-position'
|
147 |
), POPMAKE_VERSION, true );
|
148 |
wp_localize_script( 'popup-maker-site', 'ajaxurl', admin_url( 'admin-ajax.php' ) );
|
|
|
149 |
}
|
150 |
if ( popmake_is_admin_popup_theme_page() ) {
|
151 |
wp_localize_script( 'popup-maker-admin', 'popmake_google_fonts', popmake_get_google_webfonts_list() );
|
35 |
'jquery-ui-position'
|
36 |
), POPMAKE_VERSION, true );
|
37 |
wp_localize_script( 'popup-maker-site', 'ajaxurl', admin_url( 'admin-ajax.php' ) );
|
38 |
+
wp_localize_script( 'popup-maker-site', 'popmake_default_theme', (string) get_option( 'popmake_default_theme' ) );
|
39 |
|
40 |
if ( popmake_get_option( 'popmake_powered_by_opt_in', false ) ) {
|
41 |
$size = popmake_get_option( 'popmake_powered_by_size', '' );
|
147 |
'jquery-ui-position'
|
148 |
), POPMAKE_VERSION, true );
|
149 |
wp_localize_script( 'popup-maker-site', 'ajaxurl', admin_url( 'admin-ajax.php' ) );
|
150 |
+
wp_localize_script( 'popup-maker-site', 'popmake_default_theme', (string) get_option( 'popmake_default_theme' ) );
|
151 |
}
|
152 |
if ( popmake_is_admin_popup_theme_page() ) {
|
153 |
wp_localize_script( 'popup-maker-admin', 'popmake_google_fonts', popmake_get_google_webfonts_list() );
|
includes/theme-functions.php
CHANGED
@@ -45,7 +45,8 @@ function popmake_get_popup_theme_meta( $group, $popup_theme_id = null, $key = nu
|
|
45 |
$values = get_post_meta( $popup_theme_id, "popup_theme_{$group}", true );
|
46 |
|
47 |
if ( ! $values ) {
|
48 |
-
$
|
|
|
49 |
} else {
|
50 |
$values = array_merge( popmake_get_popup_theme_meta_group( $group, $popup_theme_id ), $values );
|
51 |
}
|
@@ -82,32 +83,40 @@ function popmake_get_popup_theme_meta( $group, $popup_theme_id = null, $key = nu
|
|
82 |
*
|
83 |
* @return mixed array|string of the popup overlay meta
|
84 |
*/
|
85 |
-
function popmake_get_popup_theme_meta_group( $group, $popup_theme_id = null, $key = null ) {
|
86 |
if ( ! $popup_theme_id ) {
|
87 |
$popup_theme_id = get_the_ID();
|
88 |
}
|
89 |
|
90 |
$post_meta = get_post_custom( $popup_theme_id );
|
91 |
-
|
92 |
-
if ( $post_meta ) {
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
}
|
102 |
}
|
103 |
-
|
104 |
}
|
105 |
if ( $key ) {
|
106 |
$key = str_replace( '.', '_', $key );
|
107 |
if ( ! isset( $group_values[ $key ] ) ) {
|
108 |
-
|
|
|
|
|
109 |
}
|
110 |
-
$value = $group_values[ $key ];
|
111 |
|
112 |
return apply_filters( "popmake_get_popup_theme_{$group}_$key", $value, $popup_theme_id );
|
113 |
} else {
|
45 |
$values = get_post_meta( $popup_theme_id, "popup_theme_{$group}", true );
|
46 |
|
47 |
if ( ! $values ) {
|
48 |
+
$defaults = apply_filters( "popmake_popup_theme_{$group}_defaults", array() );
|
49 |
+
$values = array_merge( $defaults, popmake_get_popup_theme_meta_group( $group, $popup_theme_id ) );
|
50 |
} else {
|
51 |
$values = array_merge( popmake_get_popup_theme_meta_group( $group, $popup_theme_id ), $values );
|
52 |
}
|
83 |
*
|
84 |
* @return mixed array|string of the popup overlay meta
|
85 |
*/
|
86 |
+
function popmake_get_popup_theme_meta_group( $group, $popup_theme_id = null, $key = null, $default = null ) {
|
87 |
if ( ! $popup_theme_id ) {
|
88 |
$popup_theme_id = get_the_ID();
|
89 |
}
|
90 |
|
91 |
$post_meta = get_post_custom( $popup_theme_id );
|
92 |
+
|
93 |
+
if ( ! is_array( $post_meta ) ) {
|
94 |
+
$post_meta = array();
|
95 |
+
}
|
96 |
+
|
97 |
+
$default_check_key = 'popup_theme_defaults_set';
|
98 |
+
if ( ! in_array( $group, array( 'overlay', 'close', 'display', 'targeting_condition' ) ) ) {
|
99 |
+
$default_check_key = "popup_{$group}_defaults_set";
|
100 |
+
}
|
101 |
+
|
102 |
+
$group_values = array_key_exists( $default_check_key, $post_meta ) ? array() : apply_filters( "popmake_popup_theme_{$group}_defaults", array() );
|
103 |
+
foreach ( $post_meta as $meta_key => $value ) {
|
104 |
+
if ( strpos( $meta_key, "popup_theme_{$group}_" ) !== false ) {
|
105 |
+
$new_key = str_replace( "popup_theme_{$group}_", '', $meta_key );
|
106 |
+
if ( count( $value ) == 1 ) {
|
107 |
+
$group_values[ $new_key ] = $value[0];
|
108 |
+
} else {
|
109 |
+
$group_values[ $new_key ] = $value;
|
110 |
}
|
111 |
}
|
|
|
112 |
}
|
113 |
if ( $key ) {
|
114 |
$key = str_replace( '.', '_', $key );
|
115 |
if ( ! isset( $group_values[ $key ] ) ) {
|
116 |
+
$value = $default;
|
117 |
+
} else {
|
118 |
+
$value = $group_values[ $key ];
|
119 |
}
|
|
|
120 |
|
121 |
return apply_filters( "popmake_get_popup_theme_{$group}_$key", $value, $popup_theme_id );
|
122 |
} else {
|
popup-maker.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin URI: https://wppopupmaker.com
|
5 |
* Description: Easily create & style popups with any content. Theme editor to quickly style your popups. Add forms, social media boxes, videos & more.
|
6 |
* Author: Daniel Iser
|
7 |
-
* Version: 1.3.
|
8 |
* Author URI: https://wppopupmaker.com
|
9 |
* Text Domain: popup-maker
|
10 |
*
|
@@ -144,7 +144,7 @@ if ( ! class_exists( 'Popup_Maker' ) ) :
|
|
144 |
}
|
145 |
|
146 |
if ( ! defined( 'POPMAKE_VERSION' ) ) {
|
147 |
-
define( 'POPMAKE_VERSION', '1.3.
|
148 |
}
|
149 |
|
150 |
if ( ! defined( 'POPMAKE_DB_VERSION' ) ) {
|
4 |
* Plugin URI: https://wppopupmaker.com
|
5 |
* Description: Easily create & style popups with any content. Theme editor to quickly style your popups. Add forms, social media boxes, videos & more.
|
6 |
* Author: Daniel Iser
|
7 |
+
* Version: 1.3.6
|
8 |
* Author URI: https://wppopupmaker.com
|
9 |
* Text Domain: popup-maker
|
10 |
*
|
144 |
}
|
145 |
|
146 |
if ( ! defined( 'POPMAKE_VERSION' ) ) {
|
147 |
+
define( 'POPMAKE_VERSION', '1.3.6' );
|
148 |
}
|
149 |
|
150 |
if ( ! defined( 'POPMAKE_DB_VERSION' ) ) {
|
readme.txt
CHANGED
@@ -5,8 +5,8 @@ Plugin URI: https://wppopupmaker.com?utm_source=WordPress+Page&utm_medium=Text+L
|
|
5 |
Donate link:
|
6 |
Tags: age restriction, age verification, auto open, automatic popup, conversion, conversions, custom popup, dialog box, exit intent, fancy box, fancy popup, form modal, full page popup, full screen pop, full screen popup, marketing, modal, modals, onclick popup, optin popup, pop-up, pop-ups, popup, popup ads, popup advertising, popup box, popup form, popup message, popup window, popups, unblockable, wordpress popup
|
7 |
Requires at least: 3.4
|
8 |
-
Tested up to: 4.
|
9 |
-
Stable tag: 1.3.
|
10 |
License: GNU Version 2 or Any Later Version
|
11 |
|
12 |
The most versatile popup plugin for WordPress! Grow email subscriber lists, get more FB Likes, create login modals, content restriction & more.
|
@@ -103,6 +103,12 @@ There are several common causes for this which include:
|
|
103 |
|
104 |
== Changelog ==
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
= v1.3.5 - 8/18/2015 =
|
107 |
* Tweak: Corrected missing keys for required script checks.
|
108 |
* Fix: Error message caused by non array value from get_post_custom.
|
5 |
Donate link:
|
6 |
Tags: age restriction, age verification, auto open, automatic popup, conversion, conversions, custom popup, dialog box, exit intent, fancy box, fancy popup, form modal, full page popup, full screen pop, full screen popup, marketing, modal, modals, onclick popup, optin popup, pop-up, pop-ups, popup, popup ads, popup advertising, popup box, popup form, popup message, popup window, popups, unblockable, wordpress popup
|
7 |
Requires at least: 3.4
|
8 |
+
Tested up to: 4.3
|
9 |
+
Stable tag: 1.3.6
|
10 |
License: GNU Version 2 or Any Later Version
|
11 |
|
12 |
The most versatile popup plugin for WordPress! Grow email subscriber lists, get more FB Likes, create login modals, content restriction & more.
|
103 |
|
104 |
== Changelog ==
|
105 |
|
106 |
+
= v1.3.6 - 8/25/2015 =
|
107 |
+
* Confirmed WP v4.3 compatibility.
|
108 |
+
* Tweak: Default theme is automatically used if a popup does not have one assigned.
|
109 |
+
* Fix: UI bug where fixed position checkbox wouldn't stay checked.
|
110 |
+
* Fix: Bug with Theme Default values & v1.2 values not being merged.
|
111 |
+
|
112 |
= v1.3.5 - 8/18/2015 =
|
113 |
* Tweak: Corrected missing keys for required script checks.
|
114 |
* Fix: Error message caused by non array value from get_post_custom.
|