Version Description
Download this release
Release Info
Developer | danieliser |
Plugin | Popup Maker – Popup Forms, Optins & More |
Version | 1.1.5 |
Comparing to | |
See all releases |
Code changes from version 1.1.4 to 1.1.5
- assets/scripts/popup-maker-admin.js +1 -28
- assets/scripts/popup-maker-admin.min.js +35 -35
- includes/admin/popups/metabox-targeting-condition-fields.php +49 -1
- includes/admin/popups/metabox.php +4 -0
- includes/popup-functions.php +172 -115
- popup-maker.php +2 -2
- readme.txt +7 -2
assets/scripts/popup-maker-admin.js
CHANGED
@@ -29,7 +29,6 @@ var PopMakeAdmin;
|
|
29 |
}
|
30 |
return true;
|
31 |
});
|
32 |
-
|
33 |
},
|
34 |
initialize_marketing: function () {
|
35 |
jQuery('#menu-posts-popup ul li:eq(-1)').addClass('popmake-menu-highlight');
|
@@ -85,7 +84,6 @@ var PopMakeAdmin;
|
|
85 |
});
|
86 |
},
|
87 |
attachTabsPanelListeners : function () {
|
88 |
-
|
89 |
jQuery('#poststuff').bind('click', function (event) {
|
90 |
var selectAreaMatch, panelId, wrapper, items,
|
91 |
target = jQuery(event.target),
|
@@ -102,23 +100,16 @@ var PopMakeAdmin;
|
|
102 |
|
103 |
|
104 |
if (target.hasClass('nav-tab-link')) {
|
105 |
-
|
106 |
panelId = target.data('type');
|
107 |
-
|
108 |
wrapper = target.parents('.posttypediv, .taxonomydiv').first();
|
109 |
-
|
110 |
// upon changing tabs, we want to uncheck all checkboxes
|
111 |
jQuery('input', wrapper).removeAttr('checked');
|
112 |
-
|
113 |
jQuery('.tabs-panel-active', wrapper).removeClass('tabs-panel-active').addClass('tabs-panel-inactive');
|
114 |
jQuery('#' + panelId, wrapper).removeClass('tabs-panel-inactive').addClass('tabs-panel-active');
|
115 |
-
|
116 |
jQuery('.tabs', wrapper).removeClass('tabs');
|
117 |
target.parent().addClass('tabs');
|
118 |
-
|
119 |
// select the search bar
|
120 |
jQuery('.quick-search', wrapper).focus();
|
121 |
-
|
122 |
event.preventDefault();
|
123 |
} else if (target.hasClass('select-all')) {
|
124 |
selectAreaMatch = /#(.*)$/.exec(event.target.href);
|
@@ -136,24 +127,20 @@ var PopMakeAdmin;
|
|
136 |
$textarea = jQuery('textarea', $parent);
|
137 |
$tag_area = jQuery('.tagchecklist', $parent);
|
138 |
current_ids = $textarea.val().split(',');
|
139 |
-
|
140 |
for (i = 0; i < current_ids.length; i += 1) {
|
141 |
current_ids[i] = parseInt(current_ids[i], 10);
|
142 |
}
|
143 |
-
|
144 |
$items.each(function () {
|
145 |
$item = jQuery(this);
|
146 |
id = parseInt($item.val(), 10);
|
147 |
name = $item.parent('label').siblings('.menu-item-title').val();
|
148 |
-
|
149 |
if (jQuery.inArray(id, current_ids) === -1) {
|
150 |
current_ids.push(id);
|
151 |
}
|
152 |
-
|
153 |
$tag_area.append('<span><a class="ntdelbutton" data-id="' + id + '">X</a> ' + name + '</span>');
|
154 |
});
|
155 |
$textarea.text(current_ids.join(','));
|
156 |
-
|
157 |
} else if (target.hasClass('ntdelbutton')) {
|
158 |
$item = target;
|
159 |
removeItem = parseInt($item.data('id'), 10);
|
@@ -161,33 +148,25 @@ var PopMakeAdmin;
|
|
161 |
$textarea = jQuery('textarea', $parent);
|
162 |
$tag_area = jQuery('.tagchecklist', $parent);
|
163 |
current_ids = $textarea.val().split(',');
|
164 |
-
|
165 |
current_ids = jQuery.grep(current_ids, function (value) {
|
166 |
return parseInt(value, 10) !== parseInt(removeItem, 10);
|
167 |
});
|
168 |
-
|
169 |
$item.parent('span').remove();
|
170 |
$textarea.text(current_ids.join(','));
|
171 |
}
|
172 |
-
|
173 |
});
|
174 |
-
|
175 |
},
|
176 |
attachQuickSearchListeners : function () {
|
177 |
var searchTimer;
|
178 |
-
|
179 |
jQuery('.quick-search').keypress(function (event) {
|
180 |
var t = jQuery(this);
|
181 |
-
|
182 |
if (13 === event.which) {
|
183 |
PopMakeAdmin.updateQuickSearchResults(t);
|
184 |
return false;
|
185 |
}
|
186 |
-
|
187 |
if (searchTimer) {
|
188 |
clearTimeout(searchTimer);
|
189 |
}
|
190 |
-
|
191 |
searchTimer = setTimeout(function () {
|
192 |
PopMakeAdmin.updateQuickSearchResults(t);
|
193 |
}, 400);
|
@@ -197,11 +176,9 @@ var PopMakeAdmin;
|
|
197 |
var panel, params,
|
198 |
minSearchLength = 2,
|
199 |
q = input.val();
|
200 |
-
|
201 |
if (q.length < minSearchLength) {
|
202 |
return;
|
203 |
}
|
204 |
-
|
205 |
panel = input.parents('.tabs-panel');
|
206 |
params = {
|
207 |
'action': 'menu-quick-search',
|
@@ -211,9 +188,7 @@ var PopMakeAdmin;
|
|
211 |
'q': q,
|
212 |
'type': input.attr('name')
|
213 |
};
|
214 |
-
|
215 |
jQuery('.spinner', panel).show();
|
216 |
-
|
217 |
jQuery.post(ajaxurl, params, function (menuMarkup) {
|
218 |
PopMakeAdmin.processQuickSearchQueryResponse(menuMarkup, params, panel);
|
219 |
});
|
@@ -411,7 +386,6 @@ var PopMakeAdmin;
|
|
411 |
}
|
412 |
},
|
413 |
initialize_popup_page: function () {
|
414 |
-
|
415 |
var update_type_options = function ($this) {
|
416 |
var $options = $this.siblings('.options'),
|
417 |
excludes,
|
@@ -419,7 +393,6 @@ var PopMakeAdmin;
|
|
419 |
|
420 |
if ($this.is(':checked')) {
|
421 |
$options.show();
|
422 |
-
|
423 |
if ($this.attr('id') === 'popup_targeting_condition_on_entire_site') {
|
424 |
excludes = $this.parents('#popmake_popup_targeting_condition_fields').find('[id^="targeting_condition-exclude_on_"]');
|
425 |
others = $this.parents('.targeting_condition').siblings('.targeting_condition');
|
29 |
}
|
30 |
return true;
|
31 |
});
|
|
|
32 |
},
|
33 |
initialize_marketing: function () {
|
34 |
jQuery('#menu-posts-popup ul li:eq(-1)').addClass('popmake-menu-highlight');
|
84 |
});
|
85 |
},
|
86 |
attachTabsPanelListeners : function () {
|
|
|
87 |
jQuery('#poststuff').bind('click', function (event) {
|
88 |
var selectAreaMatch, panelId, wrapper, items,
|
89 |
target = jQuery(event.target),
|
100 |
|
101 |
|
102 |
if (target.hasClass('nav-tab-link')) {
|
|
|
103 |
panelId = target.data('type');
|
|
|
104 |
wrapper = target.parents('.posttypediv, .taxonomydiv').first();
|
|
|
105 |
// upon changing tabs, we want to uncheck all checkboxes
|
106 |
jQuery('input', wrapper).removeAttr('checked');
|
|
|
107 |
jQuery('.tabs-panel-active', wrapper).removeClass('tabs-panel-active').addClass('tabs-panel-inactive');
|
108 |
jQuery('#' + panelId, wrapper).removeClass('tabs-panel-inactive').addClass('tabs-panel-active');
|
|
|
109 |
jQuery('.tabs', wrapper).removeClass('tabs');
|
110 |
target.parent().addClass('tabs');
|
|
|
111 |
// select the search bar
|
112 |
jQuery('.quick-search', wrapper).focus();
|
|
|
113 |
event.preventDefault();
|
114 |
} else if (target.hasClass('select-all')) {
|
115 |
selectAreaMatch = /#(.*)$/.exec(event.target.href);
|
127 |
$textarea = jQuery('textarea', $parent);
|
128 |
$tag_area = jQuery('.tagchecklist', $parent);
|
129 |
current_ids = $textarea.val().split(',');
|
|
|
130 |
for (i = 0; i < current_ids.length; i += 1) {
|
131 |
current_ids[i] = parseInt(current_ids[i], 10);
|
132 |
}
|
|
|
133 |
$items.each(function () {
|
134 |
$item = jQuery(this);
|
135 |
id = parseInt($item.val(), 10);
|
136 |
name = $item.parent('label').siblings('.menu-item-title').val();
|
|
|
137 |
if (jQuery.inArray(id, current_ids) === -1) {
|
138 |
current_ids.push(id);
|
139 |
}
|
|
|
140 |
$tag_area.append('<span><a class="ntdelbutton" data-id="' + id + '">X</a> ' + name + '</span>');
|
141 |
});
|
142 |
$textarea.text(current_ids.join(','));
|
143 |
+
event.preventDefault();
|
144 |
} else if (target.hasClass('ntdelbutton')) {
|
145 |
$item = target;
|
146 |
removeItem = parseInt($item.data('id'), 10);
|
148 |
$textarea = jQuery('textarea', $parent);
|
149 |
$tag_area = jQuery('.tagchecklist', $parent);
|
150 |
current_ids = $textarea.val().split(',');
|
|
|
151 |
current_ids = jQuery.grep(current_ids, function (value) {
|
152 |
return parseInt(value, 10) !== parseInt(removeItem, 10);
|
153 |
});
|
|
|
154 |
$item.parent('span').remove();
|
155 |
$textarea.text(current_ids.join(','));
|
156 |
}
|
|
|
157 |
});
|
|
|
158 |
},
|
159 |
attachQuickSearchListeners : function () {
|
160 |
var searchTimer;
|
|
|
161 |
jQuery('.quick-search').keypress(function (event) {
|
162 |
var t = jQuery(this);
|
|
|
163 |
if (13 === event.which) {
|
164 |
PopMakeAdmin.updateQuickSearchResults(t);
|
165 |
return false;
|
166 |
}
|
|
|
167 |
if (searchTimer) {
|
168 |
clearTimeout(searchTimer);
|
169 |
}
|
|
|
170 |
searchTimer = setTimeout(function () {
|
171 |
PopMakeAdmin.updateQuickSearchResults(t);
|
172 |
}, 400);
|
176 |
var panel, params,
|
177 |
minSearchLength = 2,
|
178 |
q = input.val();
|
|
|
179 |
if (q.length < minSearchLength) {
|
180 |
return;
|
181 |
}
|
|
|
182 |
panel = input.parents('.tabs-panel');
|
183 |
params = {
|
184 |
'action': 'menu-quick-search',
|
188 |
'q': q,
|
189 |
'type': input.attr('name')
|
190 |
};
|
|
|
191 |
jQuery('.spinner', panel).show();
|
|
|
192 |
jQuery.post(ajaxurl, params, function (menuMarkup) {
|
193 |
PopMakeAdmin.processQuickSearchQueryResponse(menuMarkup, params, panel);
|
194 |
});
|
386 |
}
|
387 |
},
|
388 |
initialize_popup_page: function () {
|
|
|
389 |
var update_type_options = function ($this) {
|
390 |
var $options = $this.siblings('.options'),
|
391 |
excludes,
|
393 |
|
394 |
if ($this.is(':checked')) {
|
395 |
$options.show();
|
|
|
396 |
if ($this.attr('id') === 'popup_targeting_condition_on_entire_site') {
|
397 |
excludes = $this.parents('#popmake_popup_targeting_condition_fields').find('[id^="targeting_condition-exclude_on_"]');
|
398 |
others = $this.parents('.targeting_condition').siblings('.targeting_condition');
|
assets/scripts/popup-maker-admin.min.js
CHANGED
@@ -6,38 +6,38 @@ var PopMakeAdmin;
|
|
6 |
!a.metaKey?!0:(a.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("#popmake_popup_share").removeClass("postbox");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")):
|
7 |
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(a){var b=jQuery(this);a.preventDefault();jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"popmake_optin",
|
8 |
popmake_nonce:popmake_admin_ajax_nonce,optin_dismiss:!0,optin_name:b.data("optin-name"),optin_type:b.data("optin-type")}}).done(function(a){a.success&&b.parents(".popmake-optin").slideUp(function(){jQuery(this).remove()})})})},attachTabsPanelListeners:function(){jQuery("#poststuff").bind("click",function(a){var b,c,d=jQuery(a.target),e,g,k,h,f,n;if(d.hasClass("nav-tab-link"))b=d.data("type"),c=d.parents(".posttypediv, .taxonomydiv").first(),jQuery("input",c).removeAttr("checked"),jQuery(".tabs-panel-active",
|
9 |
-
c).removeClass("tabs-panel-active").addClass("tabs-panel-inactive"),jQuery("#"+b,c).removeClass("tabs-panel-inactive").addClass("tabs-panel-active"),jQuery(".tabs",c).removeClass("tabs"),d.parent().addClass("tabs"),jQuery(".quick-search",c).focus(),a.preventDefault();else if(d.hasClass("select-all"))(a=/#(.*)$/.exec(a.target.href))&&a[1]&&(a=jQuery("#"+a[1]+" .tabs-panel-active .menu-item-title input"),a.length===a.filter(":checked").length?a.removeAttr("checked"):a.prop("checked",!0));else if(d.hasClass("submit-add-to-menu")){
|
10 |
-
d.parents(".options");
|
11 |
-
10),
|
12 |
-
"off")},updateQuickSearchResults:function(a){var b,c,d=a.val();2>d.length||(b=a.parents(".tabs-panel"),c={action:"menu-quick-search","response-format":"markup",menu:null,"menu-settings-column-nonce":jQuery("#menu-settings-column-nonce").val(),q:d,type:a.attr("name")},jQuery(".spinner",b).show(),jQuery.post(ajaxurl,c,function(a){PopMakeAdmin.processQuickSearchQueryResponse(a,c,b)}))},processQuickSearchQueryResponse:function(a,b,c){var d,e,g=jQuery("form#post"),k={},h=/menu-item[(\[\^]\]*/;
|
13 |
-
var f;a.length?(a.each(function(){f=jQuery(this);if((d=h.exec(f.html()))&&d[1]){for(e=d[1];g.elements["menu-item["+e+"][menu-item-type]"]||k[e];)--e;k[e]=!0;e!==d[1]&&f.html(f.html().replace(new RegExp("menu-item\\["+d[1]+"\\]","g"),"menu-item["+e+"]"))}}),jQuery(".categorychecklist",c).html(a),jQuery(".spinner",c).hide(),jQuery('[name^="menu-item"]').removeAttr("name")):(jQuery(".categorychecklist",c).html("<li><p>noResultsFound</p></li>"),jQuery(".spinner",c).hide())},
|
14 |
-
this;jQuery(".color-picker").wpColorPicker({change:function(b){a.throttle(setTimeout(function(){a.update_theme()},5),250);b=jQuery(b.currentTarget);b.hasClass("background-color")&&b.parents("table").find(".background-opacity").show()},clear:function(b){a.update_theme();b=jQuery(b.currentTarget).prev();b.hasClass("background-color")&&b.parents("table").find(".background-opacity").hide()}})},initialize_range_sliders:function(){var a,b,c,d,e,g=jQuery('<input type="range"/>'),
|
15 |
-
h=jQuery('<button class="popmake-range-minus">-</button>');jQuery(document).on("input",'input[type="range"]',function(){var a=jQuery(this);a.siblings(".popmake-range-manual").val(a.val())});jQuery(".popmake-range-manual").each(function(){var a=jQuery(this),b=a.data("force-minmax"),p=parseInt(a.prop("min"),0),m=parseInt(a.prop("max"),0),q=parseInt(a.prop("step"),0),l=parseInt(a.val(),0);c=g.clone();d=k.clone();e=h.clone();b&&l>m&&(l=m,a.val(l));
|
16 |
-
100,value:l}).on("change input",function(){a.trigger("input")});a.next().after(e,d);a.before(c)});jQuery(document).on("click",".popmake-range-manual",function(){jQuery(this).removeProp("readonly")}).on("focusout",".popmake-range-manual",function(){jQuery(this).prop("readonly",!0)}).on("change",".popmake-range-manual",function(){var a=jQuery(this),b=parseInt(a.prop("max"),0),h=parseInt(a.prop("step"),0),d=a.data("force-minmax"),e=parseInt(a.val(),
|
17 |
-
b&&b>e?b:1.5*e,step:h||1.5*e/100,value:e})}).on("click",".popmake-range-plus",function(a){a.preventDefault();a=jQuery(this).siblings(".popmake-range-manual");var b=parseInt(a.prop("step"),0),b=parseInt(a.val(),0)+b;c=a.prev();a.val(b).trigger("input");c.val(b)}).on("click",".popmake-range-minus",function(a){a.preventDefault();a=jQuery(this).siblings(".popmake-range-manual");var b=parseInt(a.prop("step"),0),b=parseInt(a.val(),0)-b;c=a.prev();a.val(b).trigger("input");
|
18 |
-
a.setAttribute("type","range");"text"===a.type&&jQuery("input[type=range]").each(function(a,h){b=jQuery(h);c=jQuery("<div />").slider({min:parseInt(b.attr("min"),10)||0,max:parseInt(b.attr("max"),10)||100,value:parseInt(b.attr("value"),10)||0,step:parseInt(b.attr("step"),10)||1,slide:function(a,b){jQuery(this).prev("input").val(b.value)}});b.after(c).hide()})},initialize_popup_page:function(){var a=function(a){var b=a.siblings(".options");a.is(":checked")?
|
19 |
-
a.attr("id")?(b=a.parents("#popmake_popup_targeting_condition_fields").find('[id^="targeting_condition-exclude_on_"]'),a=a.parents(".targeting_condition").siblings(".targeting_condition"),a.hide(),jQuery("> *",a).prop("disabled",!0),b.show(),jQuery("> *",b).removeProp("disabled")):jQuery("*",b).removeProp("disabled")):(b.hide(),"popup_targeting_condition_on_entire_site"===a.attr("id")?(b=a.parents("#popmake_popup_targeting_condition_fields").find('[id^="targeting_condition-exclude_on_"]'),
|
20 |
-
a.show(),jQuery("> *",a).removeProp("disabled"),b.hide(),jQuery("> *",b).prop("disabled",!0)):jQuery("*",b).prop("disabled",!0))},b=function(a){var b=a.parent().siblings('input[type="checkbox"]:first'),c=0<=b.attr("name").indexOf("exclude"),d=c?b.attr("name").replace("popup_targeting_condition_exclude_on_specific_",""):b.attr("name").replace("popup_targeting_condition_on_specific_",""),c=c?jQuery("#exclude_on_specific_"+d):jQuery("#on_specific_"+
|
21 |
-
|
22 |
-
jQuery(".responsive-size-only").hide())},d=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()},e=function(){var a=jQuery("#popup_display_location"),b=a.parents("table"),a=a.val();jQuery("tr.top, tr.right, tr.left, tr.bottom",
|
23 |
-
jQuery("tr.left").show();0<=a.indexOf("bottom")&&jQuery("tr.bottom").show();0<=a.indexOf("right")&&jQuery("tr.right").show()},g=function(){jQuery("#popup_auto_open_enabled").is(":checked")?jQuery(".auto-open-enabled").show():jQuery(".auto-open-enabled").hide()},k=function(){jQuery("#popup_auto_open_cookie_key").val((new Date).getTime().toString(16))};jQuery("#popuptitlediv").insertAfter("#titlediv");jQuery('[name^="menu-item"]').removeAttr("name");
|
24 |
-
(a.keyCode||a.which)&&(a.preventDefault(),jQuery("#title").focus())}).on("keydown","#title, #popuptitle",function(a){var b=a.keyCode||a.which;a.shiftKey||9!==b||(a.preventDefault(),a="title"===jQuery(this).attr("id")?"#popuptitle":"#insert-media-button",jQuery(a).focus())}).on("keydown","#popuptitle, #insert-media-button",function(a){var b=a.keyCode||a.which;a.shiftKey&&9===b&&(a.preventDefault(),a="popuptitle"===jQuery(this).attr("id")?
|
25 |
-
function(a){var b=jQuery("#title").val();if(0===b.length||0===b.replace(/\s/g,"").length)a.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("#ajax-loading").hide(),jQuery("#publish").removeClass("button-primary-disabled"),jQuery("#title").prop("required","required")}).on("click","#popup_display_custom_height_auto",
|
26 |
-
function(){g()}).on("click",".popmake-reset-auto-open-cookie-key",function(){k()}).on("change","#popup_display_size",function(){c()}).on("change","#popup_display_animation_type",function(){d()}).on("change","#popup_display_location",function(){e()});jQuery('#popmake_popup_targeting_condition_fields .targeting_condition > input[type="checkbox"]').on("click",function(){a(jQuery(this))}).each(function(){a(jQuery(this))});jQuery('input[type="radio"][id*="popup_targeting_condition_"]').on("click",
|
27 |
-
jQuery(".posttypediv, .taxonomydiv").each(function(){var a=jQuery(this),b=jQuery("> ul li"),a=jQuery(".tabs-panel",a);b.removeClass("tabs");b.eq(0).addClass("tabs");a.removeClass("tabs-panel-active").addClass("tabs-panel-inactive").removeAttr("style");a.eq(0).removeClass("tabs-panel-inactive").addClass("tabs-panel-active")});c();d();e();g();""===jQuery("#popup_auto_open_cookie_key").val()&&k()},theme_page_listeners:function(){var a=this;
|
28 |
-
jQuery(this).parents("table")).removeProp("selected");a.update_font_selectboxes()}).on("change","select.font-weight, select.font-style",function(){a.update_font_selectboxes()}).on("change input focusout","select, input",function(){a.update_theme()}).on("change","select.border-style",function(){var a=jQuery(this);"none"===a.val()?a.parents("table").find(".border-options").hide():
|
29 |
-
c=a.parents("table");jQuery("tr.topleft, tr.topright, tr.bottomleft, tr.bottomright",c).hide();jQuery("tr."+a.val(),c).show()})},update_theme:function(){var a=jQuery("[name^='popup_theme_']").serializeArray(),b={},c;for(c=0;a.length>c;c+=1)0===a[c].name.indexOf("popup_theme_")&&(b[a[c].name.replace("popup_theme_","")]=a[c].value);this.retheme_popup(b)},theme_preview_scroll:function(){var a=
|
30 |
-
b=a.parent(),c=a.offset().top-50;jQuery(window).on("scroll",function(){jQuery("> .postbox:visible",b).index(a)===jQuery("> .postbox:visible",b).length-1&&jQuery(window).scrollTop()>=c?a.css({left:a.offset().left,width:a.width(),height:a.height(),position:"fixed",top:50}):a.removeAttr("style")})},update_font_selectboxes:function(){return jQuery("select.font-family").each(function(){var a=jQuery(this),
|
31 |
-
e=c.find("option");if(void 0!==popmake_google_fonts[a.val()]){if(a=popmake_google_fonts[a.val()],d.hide(),e.hide(),a.variants.length)for(d=0;a.variants.length>d;d+=1)"regular"===a.variants[d]?(jQuery('option[value="normal"]',b).show(),jQuery('option[value="normal"]',c).show()):(0<=a.variants[d].indexOf("italic")&&jQuery('option[value="italic"]',c).show(),jQuery('option[value="'+parseInt(a.variants[d],
|
32 |
-
b.parents("tr:first").hide():b.parents("tr:first").show();c.parents("tr:first").show();1>=c.find("option:visible").length?c.parents("tr:first").hide():c.parents("tr:first").show()})},initialize_theme_page:function(){jQuery("#popuptitlediv").insertAfter("#titlediv");var a=jQuery("#popup_theme_close_location").parents("table");this.update_theme();this.theme_page_listeners();this.theme_preview_scroll();
|
33 |
-
a.val()?a.parents("table").find(".border-options").hide():a.parents("table").find(".border-options").show()});jQuery(".color-picker.background-color").each(function(){var a=jQuery(this);""===a.val()?a.parents("table").find(".background-opacity").hide():a.parents("table").find(".background-opacity").show()});jQuery("tr.topleft, tr.topright, tr.bottomleft, tr.bottomright",a).hide();switch(jQuery("#popup_theme_close_location").val()){case "topleft":jQuery("tr.topleft",
|
34 |
-
a).show();break;case "bottomleft":jQuery("tr.bottomleft",a).show();break;case "bottomright":jQuery("tr.bottomright",a).show()}},retheme_popup:function(a){var b=jQuery(".empreview .example-popup-overlay"),c=jQuery(".empreview .example-popup"),d=jQuery(".title",c),e=jQuery(".content",c),g=jQuery(".close-popup",c),k="yes"===a.container_boxshadow_inset?"inset ":"",h="yes"===a.close_boxshadow_inset?"inset ":"",f;void 0!==popmake_google_fonts[a.title_font_family]&&
|
35 |
-
a.title_font_family,"normal"!==a.title_font_weight&&(f+=":"+a.title_font_weight),"italic"===a.title_font_style&&(-1===f.indexOf(":")&&(f+=":"),f+="italic"),jQuery("body").append('<link href="'+f+'" rel="stylesheet" type="text/css">'));void 0!==popmake_google_fonts[a.content_font_family]&&(f="//fonts.googleapis.com/css?family="+a.content_font_family,"normal"!==a.content_font_weight&&(f+=":"+a.content_font_weight),"italic"===a.content_font_style&&(-1===f.indexOf(":")&&
|
36 |
-
f+'" rel="stylesheet" type="text/css">'));void 0!==popmake_google_fonts[a.close_font_family]&&(f="//fonts.googleapis.com/css?family="+a.close_font_family,"normal"!==a.close_font_weight&&(f+=":"+a.close_font_weight),"italic"===a.close_font_style&&(-1===f.indexOf(":")&&(f+=":"),f+="italic"),jQuery("body").append('<link href="'+f+'" rel="stylesheet" type="text/css">'));b.removeAttr("style").css({backgroundColor:this.convert_hex(a.overlay_background_color,
|
37 |
-
"px",backgroundColor:this.convert_hex(a.container_background_color,a.container_background_opacity),borderStyle:a.container_border_style,borderColor:a.container_border_color,borderWidth:a.container_border_width+"px",borderRadius:a.container_border_radius+"px",boxShadow:k+a.container_boxshadow_horizontal+"px "+a.container_boxshadow_vertical+"px "+a.container_boxshadow_blur+"px "+a.container_boxshadow_spread+"px "+
|
38 |
-
lineHeight:a.title_line_height+"px",fontSize:a.title_font_size+"px",fontFamily:a.title_font_family,fontStyle:a.title_font_style,fontWeight:a.title_font_weight,textAlign:a.title_text_align,textShadow:a.title_textshadow_horizontal+"px "+a.title_textshadow_vertical+"px "+a.title_textshadow_blur+"px "+this.convert_hex(a.title_textshadow_color,a.title_textshadow_opacity)});
|
39 |
-
g.html(a.close_text).removeAttr("style").css({padding:a.close_padding+"px",backgroundColor:this.convert_hex(a.close_background_color,a.close_background_opacity),color:a.close_font_color,lineHeight:a.close_line_height+"px",fontSize:a.close_font_size+"px",fontFamily:a.close_font_family,fontWeight:a.close_font_weight,fontStyle:a.close_font_style,borderStyle:a.close_border_style,
|
40 |
-
a.close_boxshadow_horizontal+"px "+a.close_boxshadow_vertical+"px "+a.close_boxshadow_blur+"px "+a.close_boxshadow_spread+"px "+this.convert_hex(a.close_boxshadow_color,a.close_boxshadow_opacity),textShadow:a.close_textshadow_horizontal+"px "+a.close_textshadow_vertical+"px "+a.close_textshadow_blur+"px "+this.convert_hex(a.close_textshadow_color,a.close_textshadow_opacity)});
|
41 |
-
"px",right:a.close_position_right+"px"});break;case "bottomleft":g.css({bottom:a.close_position_bottom+"px",left:a.close_position_left+"px"});break;case "bottomright":g.css({bottom:a.close_position_bottom+"px",right:a.close_position_right+"px"})}jQuery(document).trigger("popmake-admin-retheme",[a])},serialize_form:function(a){var b={};
|
42 |
-
(e[h]={}),g!==a.length-1?e=e[h]:g===a.length-1&&(e[h]=d)});return b},convert_hex:function(a,b){a=a.replace("#","");var c=parseInt(a.substring(0,2),16),d=parseInt(a.substring(2,4),16),e=parseInt(a.substring(4,6),16);return"rgba("+c+","+d+","+e+","+b/100+")"},debounce:function(a,b){var c;return function(){var d=this,e=arguments;window.clearTimeout(c);
|
43 |
-
c=!0)}}};jQuery(document).ready(function(){PopMakeAdmin.init()})})();
|
6 |
!a.metaKey?!0:(a.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("#popmake_popup_share").removeClass("postbox");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")):
|
7 |
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(a){var b=jQuery(this);a.preventDefault();jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"popmake_optin",
|
8 |
popmake_nonce:popmake_admin_ajax_nonce,optin_dismiss:!0,optin_name:b.data("optin-name"),optin_type:b.data("optin-type")}}).done(function(a){a.success&&b.parents(".popmake-optin").slideUp(function(){jQuery(this).remove()})})})},attachTabsPanelListeners:function(){jQuery("#poststuff").bind("click",function(a){var b,c,d=jQuery(a.target),e,g,k,h,f,n;if(d.hasClass("nav-tab-link"))b=d.data("type"),c=d.parents(".posttypediv, .taxonomydiv").first(),jQuery("input",c).removeAttr("checked"),jQuery(".tabs-panel-active",
|
9 |
+
c).removeClass("tabs-panel-active").addClass("tabs-panel-inactive"),jQuery("#"+b,c).removeClass("tabs-panel-inactive").addClass("tabs-panel-active"),jQuery(".tabs",c).removeClass("tabs"),d.parent().addClass("tabs"),jQuery(".quick-search",c).focus(),a.preventDefault();else if(d.hasClass("select-all"))(a=/#(.*)$/.exec(a.target.href))&&a[1]&&(a=jQuery("#"+a[1]+" .tabs-panel-active .menu-item-title input"),a.length===a.filter(":checked").length?a.removeAttr("checked"):a.prop("checked",!0));else if(d.hasClass("submit-add-to-menu")){d=
|
10 |
+
d.parents(".options");b=jQuery('.tabs-panel-active input[type="checkbox"]:checked',d);c=jQuery("textarea",d);e=jQuery(".tagchecklist",d);g=c.val().split(",");for(d=0;d<g.length;d+=1)g[d]=parseInt(g[d],10);b.each(function(){k=jQuery(this);h=parseInt(k.val(),10);f=k.parent("label").siblings(".menu-item-title").val();-1===jQuery.inArray(h,g)&&g.push(h);e.append('<span><a class="ntdelbutton" data-id="'+h+'">X</a> '+f+"</span>")});c.text(g.join(","));a.preventDefault()}else d.hasClass("ntdelbutton")&&
|
11 |
+
(k=d,n=parseInt(k.data("id"),10),d=d.parents(".options"),c=jQuery("textarea",d),e=jQuery(".tagchecklist",d),g=c.val().split(","),g=jQuery.grep(g,function(a){return parseInt(a,10)!==parseInt(n,10)}),k.parent("span").remove(),c.text(g.join(",")))})},attachQuickSearchListeners:function(){var a;jQuery(".quick-search").keypress(function(b){var c=jQuery(this);if(13===b.which)return PopMakeAdmin.updateQuickSearchResults(c),!1;a&&clearTimeout(a);a=setTimeout(function(){PopMakeAdmin.updateQuickSearchResults(c)},
|
12 |
+
400)}).attr("autocomplete","off")},updateQuickSearchResults:function(a){var b,c,d=a.val();2>d.length||(b=a.parents(".tabs-panel"),c={action:"menu-quick-search","response-format":"markup",menu:null,"menu-settings-column-nonce":jQuery("#menu-settings-column-nonce").val(),q:d,type:a.attr("name")},jQuery(".spinner",b).show(),jQuery.post(ajaxurl,c,function(a){PopMakeAdmin.processQuickSearchQueryResponse(a,c,b)}))},processQuickSearchQueryResponse:function(a,b,c){var d,e,g=jQuery("form#post"),k={},h=/menu-item[(\[\^]\]*/;
|
13 |
+
a=jQuery("<div>").html(a).find("li");var f;a.length?(a.each(function(){f=jQuery(this);if((d=h.exec(f.html()))&&d[1]){for(e=d[1];g.elements["menu-item["+e+"][menu-item-type]"]||k[e];)--e;k[e]=!0;e!==d[1]&&f.html(f.html().replace(new RegExp("menu-item\\["+d[1]+"\\]","g"),"menu-item["+e+"]"))}}),jQuery(".categorychecklist",c).html(a),jQuery(".spinner",c).hide(),jQuery('[name^="menu-item"]').removeAttr("name")):(jQuery(".categorychecklist",c).html("<li><p>noResultsFound</p></li>"),jQuery(".spinner",c).hide())},
|
14 |
+
initialize_color_pickers:function(){var a=this;jQuery(".color-picker").wpColorPicker({change:function(b){a.throttle(setTimeout(function(){a.update_theme()},5),250);b=jQuery(b.currentTarget);b.hasClass("background-color")&&b.parents("table").find(".background-opacity").show()},clear:function(b){a.update_theme();b=jQuery(b.currentTarget).prev();b.hasClass("background-color")&&b.parents("table").find(".background-opacity").hide()}})},initialize_range_sliders:function(){var a,b,c,d,e,g=jQuery('<input type="range"/>'),
|
15 |
+
k=jQuery('<button class="popmake-range-plus">+</button>'),h=jQuery('<button class="popmake-range-minus">-</button>');jQuery(document).on("input",'input[type="range"]',function(){var a=jQuery(this);a.siblings(".popmake-range-manual").val(a.val())});jQuery(".popmake-range-manual").each(function(){var a=jQuery(this),b=a.data("force-minmax"),p=parseInt(a.prop("min"),0),m=parseInt(a.prop("max"),0),q=parseInt(a.prop("step"),0),l=parseInt(a.val(),0);c=g.clone();d=k.clone();e=h.clone();b&&l>m&&(l=m,a.val(l));
|
16 |
+
c.prop({min:p||0,max:b||m&&m>l?m:1.5*l,step:q||1.5*l/100,value:l}).on("change input",function(){a.trigger("input")});a.next().after(e,d);a.before(c)});jQuery(document).on("click",".popmake-range-manual",function(){jQuery(this).removeProp("readonly")}).on("focusout",".popmake-range-manual",function(){jQuery(this).prop("readonly",!0)}).on("change",".popmake-range-manual",function(){var a=jQuery(this),b=parseInt(a.prop("max"),0),h=parseInt(a.prop("step"),0),d=a.data("force-minmax"),e=parseInt(a.val(),
|
17 |
+
0);c=a.prev();d&&e>b&&(e=b,a.val(e));c.prop({max:d||b&&b>e?b:1.5*e,step:h||1.5*e/100,value:e})}).on("click",".popmake-range-plus",function(a){a.preventDefault();a=jQuery(this).siblings(".popmake-range-manual");var b=parseInt(a.prop("step"),0),b=parseInt(a.val(),0)+b;c=a.prev();a.val(b).trigger("input");c.val(b)}).on("click",".popmake-range-minus",function(a){a.preventDefault();a=jQuery(this).siblings(".popmake-range-manual");var b=parseInt(a.prop("step"),0),b=parseInt(a.val(),0)-b;c=a.prev();a.val(b).trigger("input");
|
18 |
+
c.val(b)});a=document.createElement("input");a.setAttribute("type","range");"text"===a.type&&jQuery("input[type=range]").each(function(a,h){b=jQuery(h);c=jQuery("<div />").slider({min:parseInt(b.attr("min"),10)||0,max:parseInt(b.attr("max"),10)||100,value:parseInt(b.attr("value"),10)||0,step:parseInt(b.attr("step"),10)||1,slide:function(a,b){jQuery(this).prev("input").val(b.value)}});b.after(c).hide()})},initialize_popup_page:function(){var a=function(a){var b=a.siblings(".options");a.is(":checked")?
|
19 |
+
(b.show(),"popup_targeting_condition_on_entire_site"===a.attr("id")?(b=a.parents("#popmake_popup_targeting_condition_fields").find('[id^="targeting_condition-exclude_on_"]'),a=a.parents(".targeting_condition").siblings(".targeting_condition"),a.hide(),jQuery("> *",a).prop("disabled",!0),b.show(),jQuery("> *",b).removeProp("disabled")):jQuery("*",b).removeProp("disabled")):(b.hide(),"popup_targeting_condition_on_entire_site"===a.attr("id")?(b=a.parents("#popmake_popup_targeting_condition_fields").find('[id^="targeting_condition-exclude_on_"]'),
|
20 |
+
a=a.parents(".targeting_condition").siblings(".targeting_condition"),a.show(),jQuery("> *",a).removeProp("disabled"),b.hide(),jQuery("> *",b).prop("disabled",!0)):jQuery("*",b).prop("disabled",!0))},b=function(a){var b=a.parent().siblings('input[type="checkbox"]:first'),c=0<=b.attr("name").indexOf("exclude"),d=c?b.attr("name").replace("popup_targeting_condition_exclude_on_specific_",""):b.attr("name").replace("popup_targeting_condition_on_specific_",""),c=c?jQuery("#exclude_on_specific_"+d):jQuery("#on_specific_"+
|
21 |
+
d);a.is(":checked")&&("true"===a.val()?(b.prop("checked",!0),c.show(),jQuery("*",c).removeProp("disabled")):""===a.val()&&(b.removeProp("checked"),c.hide(),jQuery("*",c).prop("disabled",!0)))},c=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(),
|
22 |
+
"auto"!==jQuery("#popup_display_size").val()?jQuery(".responsive-size-only").show():jQuery(".responsive-size-only").hide())},d=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()},e=function(){var a=jQuery("#popup_display_location"),b=a.parents("table"),a=a.val();jQuery("tr.top, tr.right, tr.left, tr.bottom",
|
23 |
+
b).hide();0<=a.indexOf("top")&&jQuery("tr.top").show();0<=a.indexOf("left")&&jQuery("tr.left").show();0<=a.indexOf("bottom")&&jQuery("tr.bottom").show();0<=a.indexOf("right")&&jQuery("tr.right").show()},g=function(){jQuery("#popup_auto_open_enabled").is(":checked")?jQuery(".auto-open-enabled").show():jQuery(".auto-open-enabled").hide()},k=function(){jQuery("#popup_auto_open_cookie_key").val((new Date).getTime().toString(16))};jQuery("#popuptitlediv").insertAfter("#titlediv");jQuery('[name^="menu-item"]').removeAttr("name");
|
24 |
+
jQuery(document).on("keydown","#popuptitle",function(a){9===(a.keyCode||a.which)&&(a.preventDefault(),jQuery("#title").focus())}).on("keydown","#title, #popuptitle",function(a){var b=a.keyCode||a.which;a.shiftKey||9!==b||(a.preventDefault(),a="title"===jQuery(this).attr("id")?"#popuptitle":"#insert-media-button",jQuery(a).focus())}).on("keydown","#popuptitle, #insert-media-button",function(a){var b=a.keyCode||a.which;a.shiftKey&&9===b&&(a.preventDefault(),a="popuptitle"===jQuery(this).attr("id")?
|
25 |
+
"#title":"#popuptitle",jQuery(a).focus())}).on("submit","#post",function(a){var b=jQuery("#title").val();if(0===b.length||0===b.replace(/\s/g,"").length)a.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("#ajax-loading").hide(),jQuery("#publish").removeClass("button-primary-disabled"),jQuery("#title").prop("required","required")}).on("click","#popup_display_custom_height_auto",
|
26 |
+
function(){c()}).on("click","#popup_auto_open_enabled",function(){g()}).on("click",".popmake-reset-auto-open-cookie-key",function(){k()}).on("change","#popup_display_size",function(){c()}).on("change","#popup_display_animation_type",function(){d()}).on("change","#popup_display_location",function(){e()});jQuery('#popmake_popup_targeting_condition_fields .targeting_condition > input[type="checkbox"]').on("click",function(){a(jQuery(this))}).each(function(){a(jQuery(this))});jQuery('input[type="radio"][id*="popup_targeting_condition_"]').on("click",
|
27 |
+
function(){b(jQuery(this))}).each(function(){b(jQuery(this))});jQuery(".posttypediv, .taxonomydiv").each(function(){var a=jQuery(this),b=jQuery("> ul li"),a=jQuery(".tabs-panel",a);b.removeClass("tabs");b.eq(0).addClass("tabs");a.removeClass("tabs-panel-active").addClass("tabs-panel-inactive").removeAttr("style");a.eq(0).removeClass("tabs-panel-inactive").addClass("tabs-panel-active")});c();d();e();g();""===jQuery("#popup_auto_open_cookie_key").val()&&k()},theme_page_listeners:function(){var a=this;
|
28 |
+
jQuery(document).on("change","select.font-family",function(){jQuery("select.font-weight option, select.font-style option",jQuery(this).parents("table")).removeProp("selected");a.update_font_selectboxes()}).on("change","select.font-weight, select.font-style",function(){a.update_font_selectboxes()}).on("change input focusout","select, input",function(){a.update_theme()}).on("change","select.border-style",function(){var a=jQuery(this);"none"===a.val()?a.parents("table").find(".border-options").hide():
|
29 |
+
a.parents("table").find(".border-options").show()}).on("change","#popup_theme_close_location",function(){var a=jQuery(this),c=a.parents("table");jQuery("tr.topleft, tr.topright, tr.bottomleft, tr.bottomright",c).hide();jQuery("tr."+a.val(),c).show()})},update_theme:function(){var a=jQuery("[name^='popup_theme_']").serializeArray(),b={},c;for(c=0;a.length>c;c+=1)0===a[c].name.indexOf("popup_theme_")&&(b[a[c].name.replace("popup_theme_","")]=a[c].value);this.retheme_popup(b)},theme_preview_scroll:function(){var a=
|
30 |
+
jQuery("#popmake-theme-editor .empreview, body.post-type-popup_theme form#post #popmake_popup_theme_preview"),b=a.parent(),c=a.offset().top-50;jQuery(window).on("scroll",function(){jQuery("> .postbox:visible",b).index(a)===jQuery("> .postbox:visible",b).length-1&&jQuery(window).scrollTop()>=c?a.css({left:a.offset().left,width:a.width(),height:a.height(),position:"fixed",top:50}):a.removeAttr("style")})},update_font_selectboxes:function(){return jQuery("select.font-family").each(function(){var a=jQuery(this),
|
31 |
+
b=a.parents("table").find("select.font-weight"),c=a.parents("table").find("select.font-style"),d=b.find("option"),e=c.find("option");if(void 0!==popmake_google_fonts[a.val()]){if(a=popmake_google_fonts[a.val()],d.hide(),e.hide(),a.variants.length)for(d=0;a.variants.length>d;d+=1)"regular"===a.variants[d]?(jQuery('option[value="normal"]',b).show(),jQuery('option[value="normal"]',c).show()):(0<=a.variants[d].indexOf("italic")&&jQuery('option[value="italic"]',c).show(),jQuery('option[value="'+parseInt(a.variants[d],
|
32 |
+
10)+'"]',b).show())}else d.show(),e.show();b.parents("tr:first").show();1>=b.find("option:visible").length?b.parents("tr:first").hide():b.parents("tr:first").show();c.parents("tr:first").show();1>=c.find("option:visible").length?c.parents("tr:first").hide():c.parents("tr:first").show()})},initialize_theme_page:function(){jQuery("#popuptitlediv").insertAfter("#titlediv");var a=jQuery("#popup_theme_close_location").parents("table");this.update_theme();this.theme_page_listeners();this.theme_preview_scroll();
|
33 |
+
this.update_font_selectboxes();jQuery("select.border-style").each(function(){var a=jQuery(this);"none"===a.val()?a.parents("table").find(".border-options").hide():a.parents("table").find(".border-options").show()});jQuery(".color-picker.background-color").each(function(){var a=jQuery(this);""===a.val()?a.parents("table").find(".background-opacity").hide():a.parents("table").find(".background-opacity").show()});jQuery("tr.topleft, tr.topright, tr.bottomleft, tr.bottomright",a).hide();switch(jQuery("#popup_theme_close_location").val()){case "topleft":jQuery("tr.topleft",
|
34 |
+
a).show();break;case "topright":jQuery("tr.topright",a).show();break;case "bottomleft":jQuery("tr.bottomleft",a).show();break;case "bottomright":jQuery("tr.bottomright",a).show()}},retheme_popup:function(a){var b=jQuery(".empreview .example-popup-overlay"),c=jQuery(".empreview .example-popup"),d=jQuery(".title",c),e=jQuery(".content",c),g=jQuery(".close-popup",c),k="yes"===a.container_boxshadow_inset?"inset ":"",h="yes"===a.close_boxshadow_inset?"inset ":"",f;void 0!==popmake_google_fonts[a.title_font_family]&&
|
35 |
+
(f="//fonts.googleapis.com/css?family="+a.title_font_family,"normal"!==a.title_font_weight&&(f+=":"+a.title_font_weight),"italic"===a.title_font_style&&(-1===f.indexOf(":")&&(f+=":"),f+="italic"),jQuery("body").append('<link href="'+f+'" rel="stylesheet" type="text/css">'));void 0!==popmake_google_fonts[a.content_font_family]&&(f="//fonts.googleapis.com/css?family="+a.content_font_family,"normal"!==a.content_font_weight&&(f+=":"+a.content_font_weight),"italic"===a.content_font_style&&(-1===f.indexOf(":")&&
|
36 |
+
(f+=":"),f+="italic"),jQuery("body").append('<link href="'+f+'" rel="stylesheet" type="text/css">'));void 0!==popmake_google_fonts[a.close_font_family]&&(f="//fonts.googleapis.com/css?family="+a.close_font_family,"normal"!==a.close_font_weight&&(f+=":"+a.close_font_weight),"italic"===a.close_font_style&&(-1===f.indexOf(":")&&(f+=":"),f+="italic"),jQuery("body").append('<link href="'+f+'" rel="stylesheet" type="text/css">'));b.removeAttr("style").css({backgroundColor:this.convert_hex(a.overlay_background_color,
|
37 |
+
a.overlay_background_opacity)});c.removeAttr("style").css({padding:a.container_padding+"px",backgroundColor:this.convert_hex(a.container_background_color,a.container_background_opacity),borderStyle:a.container_border_style,borderColor:a.container_border_color,borderWidth:a.container_border_width+"px",borderRadius:a.container_border_radius+"px",boxShadow:k+a.container_boxshadow_horizontal+"px "+a.container_boxshadow_vertical+"px "+a.container_boxshadow_blur+"px "+a.container_boxshadow_spread+"px "+
|
38 |
+
this.convert_hex(a.container_boxshadow_color,a.container_boxshadow_opacity)});d.removeAttr("style").css({color:a.title_font_color,lineHeight:a.title_line_height+"px",fontSize:a.title_font_size+"px",fontFamily:a.title_font_family,fontStyle:a.title_font_style,fontWeight:a.title_font_weight,textAlign:a.title_text_align,textShadow:a.title_textshadow_horizontal+"px "+a.title_textshadow_vertical+"px "+a.title_textshadow_blur+"px "+this.convert_hex(a.title_textshadow_color,a.title_textshadow_opacity)});
|
39 |
+
e.removeAttr("style").css({color:a.content_font_color,fontFamily:a.content_font_family,fontStyle:a.content_font_style,fontWeight:a.content_font_weight});g.html(a.close_text).removeAttr("style").css({padding:a.close_padding+"px",backgroundColor:this.convert_hex(a.close_background_color,a.close_background_opacity),color:a.close_font_color,lineHeight:a.close_line_height+"px",fontSize:a.close_font_size+"px",fontFamily:a.close_font_family,fontWeight:a.close_font_weight,fontStyle:a.close_font_style,borderStyle:a.close_border_style,
|
40 |
+
borderColor:a.close_border_color,borderWidth:a.close_border_width+"px",borderRadius:a.close_border_radius+"px",boxShadow:h+a.close_boxshadow_horizontal+"px "+a.close_boxshadow_vertical+"px "+a.close_boxshadow_blur+"px "+a.close_boxshadow_spread+"px "+this.convert_hex(a.close_boxshadow_color,a.close_boxshadow_opacity),textShadow:a.close_textshadow_horizontal+"px "+a.close_textshadow_vertical+"px "+a.close_textshadow_blur+"px "+this.convert_hex(a.close_textshadow_color,a.close_textshadow_opacity)});
|
41 |
+
switch(a.close_location){case "topleft":g.css({top:a.close_position_top+"px",left:a.close_position_left+"px"});break;case "topright":g.css({top:a.close_position_top+"px",right:a.close_position_right+"px"});break;case "bottomleft":g.css({bottom:a.close_position_bottom+"px",left:a.close_position_left+"px"});break;case "bottomright":g.css({bottom:a.close_position_bottom+"px",right:a.close_position_right+"px"})}jQuery(document).trigger("popmake-admin-retheme",[a])},serialize_form:function(a){var b={};
|
42 |
+
jQuery("[name]",a).each(function(){var a=jQuery(this).attr("name"),d=jQuery(this).val(),a=a.split("["),e=b,g,k=a.length,h;for(g=0;g<k;g+=1)h=a[g].replace("]",""),e[h]||(e[h]={}),g!==a.length-1?e=e[h]:g===a.length-1&&(e[h]=d)});return b},convert_hex:function(a,b){a=a.replace("#","");var c=parseInt(a.substring(0,2),16),d=parseInt(a.substring(2,4),16),e=parseInt(a.substring(4,6),16);return"rgba("+c+","+d+","+e+","+b/100+")"},debounce:function(a,b){var c;return function(){var d=this,e=arguments;window.clearTimeout(c);
|
43 |
+
c=window.setTimeout(function(){a.apply(d,e)},b)}},throttle:function(a,b){var c=!1,d=function(){c=!1};return function(){c||(a(),window.setTimeout(d,b),c=!0)}}};jQuery(document).ready(function(){PopMakeAdmin.init()})})();
|
includes/admin/popups/metabox-targeting-condition-fields.php
CHANGED
@@ -132,5 +132,53 @@ function popmake_popup_targeting_condition_meta_box_fields( $popup_id ) {
|
|
132 |
</div>
|
133 |
</div><?php
|
134 |
}
|
135 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
}
|
132 |
</div>
|
133 |
</div><?php
|
134 |
}
|
135 |
+
}?>
|
136 |
+
<div id="targeting_condition-on_search" class="targeting_condition form-table">
|
137 |
+
<input type="checkbox"
|
138 |
+
id="popup_targeting_condition_on_search"
|
139 |
+
name="popup_targeting_condition_on_search"
|
140 |
+
value="true"
|
141 |
+
<?php if(!empty($targeting_condition['on_search'])) echo 'checked="checked" '; ?>
|
142 |
+
/>
|
143 |
+
<label for="popup_targeting_condition_on_search"><?php _e( 'On Search Pages', 'popup-maker' ); ?></label>
|
144 |
+
<div class="options">
|
145 |
+
<?php do_action("popmake_popup_targeting_condition_on_search_options", $targeting_condition); ?>
|
146 |
+
</div>
|
147 |
+
</div>
|
148 |
+
<div id="targeting_condition-exclude_on_search" class="targeting_condition form-table">
|
149 |
+
<input type="checkbox"
|
150 |
+
id="popup_targeting_condition_exclude_on_search"
|
151 |
+
name="popup_targeting_condition_exclude_on_search"
|
152 |
+
value="true"
|
153 |
+
<?php if(!empty($targeting_condition['exclude_on_search'])) echo 'checked="checked" '; ?>
|
154 |
+
/>
|
155 |
+
<label for="popup_targeting_condition_exclude_on_search"><?php _e( 'Exclude on Search Pages', 'popup-maker' ); ?></label>
|
156 |
+
<div class="options">
|
157 |
+
<?php do_action("popmake_popup_targeting_condition_exclude_on_search_options", $targeting_condition); ?>
|
158 |
+
</div>
|
159 |
+
</div>
|
160 |
+
<div id="targeting_condition-on_404" class="targeting_condition form-table">
|
161 |
+
<input type="checkbox"
|
162 |
+
id="popup_targeting_condition_on_404"
|
163 |
+
name="popup_targeting_condition_on_404"
|
164 |
+
value="true"
|
165 |
+
<?php if(!empty($targeting_condition['on_404'])) echo 'checked="checked" '; ?>
|
166 |
+
/>
|
167 |
+
<label for="popup_targeting_condition_on_404"><?php _e( 'On 404 Pages', 'popup-maker' ); ?></label>
|
168 |
+
<div class="options">
|
169 |
+
<?php do_action("popmake_popup_targeting_condition_on_404_options", $targeting_condition); ?>
|
170 |
+
</div>
|
171 |
+
</div>
|
172 |
+
<div id="targeting_condition-exclude_on_404" class="targeting_condition form-table">
|
173 |
+
<input type="checkbox"
|
174 |
+
id="popup_targeting_condition_exclude_on_404"
|
175 |
+
name="popup_targeting_condition_exclude_on_404"
|
176 |
+
value="true"
|
177 |
+
<?php if(!empty($targeting_condition['exclude_on_404'])) echo 'checked="checked" '; ?>
|
178 |
+
/>
|
179 |
+
<label for="popup_targeting_condition_exclude_on_404"><?php _e( 'Exclude on 404 Pages', 'popup-maker' ); ?></label>
|
180 |
+
<div class="options">
|
181 |
+
<?php do_action("popmake_popup_targeting_condition_exclude_on_404_options", $targeting_condition); ?>
|
182 |
+
</div>
|
183 |
+
</div><?php
|
184 |
}
|
includes/admin/popups/metabox.php
CHANGED
@@ -52,6 +52,10 @@ function popmake_popup_meta_fields() {
|
|
52 |
'popup_targeting_condition_on_entire_site',
|
53 |
'popup_targeting_condition_on_home',
|
54 |
'popup_targeting_condition_exclude_on_home',
|
|
|
|
|
|
|
|
|
55 |
);
|
56 |
foreach(popmake_popup_meta_field_groups() as $group) {
|
57 |
foreach(apply_filters( 'popmake_popup_meta_field_group_' . $group, array()) as $field) {
|
52 |
'popup_targeting_condition_on_entire_site',
|
53 |
'popup_targeting_condition_on_home',
|
54 |
'popup_targeting_condition_exclude_on_home',
|
55 |
+
'popup_targeting_condition_on_search',
|
56 |
+
'popup_targeting_condition_exclude_on_search',
|
57 |
+
'popup_targeting_condition_on_404',
|
58 |
+
'popup_targeting_condition_exclude_on_404',
|
59 |
);
|
60 |
foreach(popmake_popup_meta_field_groups() as $group) {
|
61 |
foreach(apply_filters( 'popmake_popup_meta_field_group_' . $group, array()) as $field) {
|
includes/popup-functions.php
CHANGED
@@ -282,156 +282,213 @@ function popmake_popup_is_loadable( $popup_id ) {
|
|
282 |
global $post, $wp_query;
|
283 |
|
284 |
$conditions = popmake_get_popup_targeting_condition( $popup_id );
|
|
|
|
|
285 |
|
286 |
-
$
|
287 |
-
|
|
|
|
|
288 |
/**
|
289 |
-
*
|
290 |
-
*
|
291 |
-
* on_entire_site
|
292 |
-
*
|
293 |
-
* on_entire_site
|
294 |
-
* exclude_on_home
|
295 |
*/
|
296 |
-
if(
|
297 |
-
$
|
|
|
|
|
|
|
|
|
|
|
298 |
}
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
on_pages
|
304 |
-
on_specific_pages
|
305 |
-
on_page_235
|
306 |
-
|
307 |
-
on_entire_site
|
308 |
-
exclude_on_pages
|
309 |
-
|
310 |
-
on_entire_site
|
311 |
-
exclude_on_pages
|
312 |
-
|
313 |
-
|
314 |
-
on_entire_site
|
315 |
-
exclude_on_specific_pages
|
316 |
-
exclude_on_page_235
|
317 |
-
*/
|
318 |
elseif( is_page() ) {
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
|
|
|
|
|
|
|
|
|
|
323 |
}
|
324 |
-
|
325 |
-
|
326 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
327 |
}
|
328 |
-
|
329 |
-
|
330 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
}
|
332 |
-
|
333 |
-
|
334 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
}
|
336 |
-
|
337 |
}
|
|
|
|
|
|
|
338 |
elseif( is_category() ) {
|
339 |
$category_id = $wp_query->get_queried_object_id();
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
// Load on entire site not excluding all categories.
|
350 |
-
if( array_key_exists('on_entire_site', $conditions) && !array_key_exists('exclude_on_categories', $conditions) ) {
|
351 |
-
$return = true;
|
352 |
}
|
353 |
-
|
354 |
-
|
355 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
356 |
}
|
357 |
-
|
358 |
}
|
|
|
|
|
|
|
359 |
elseif( is_tag() ) {
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
$
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
$
|
368 |
-
|
369 |
-
|
370 |
-
if( array_key_exists('on_entire_site', $conditions) && !array_key_exists('exclude_on_tags', $conditions) ) {
|
371 |
-
$return = true;
|
372 |
}
|
373 |
-
|
374 |
-
|
375 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
}
|
377 |
-
|
378 |
}
|
379 |
-
|
|
|
|
|
|
|
|
|
|
|
380 |
|
381 |
-
|
382 |
-
|
383 |
-
$
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
$
|
388 |
-
|
389 |
-
|
390 |
-
if( array_key_exists('on_entire_site', $conditions) && !array_key_exists('exclude_on_posts', $conditions) ) {
|
391 |
-
$return = true;
|
392 |
}
|
393 |
-
|
394 |
-
|
395 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
396 |
}
|
397 |
-
|
398 |
}
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
405 |
}
|
406 |
-
|
407 |
-
|
408 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
409 |
}
|
410 |
-
|
411 |
-
|
412 |
-
|
|
|
|
|
|
|
|
|
413 |
}
|
414 |
-
|
415 |
-
|
416 |
-
$return = true;
|
417 |
}
|
418 |
-
|
419 |
}
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
|
|
|
|
|
|
|
|
|
|
424 |
}
|
425 |
}
|
426 |
-
|
427 |
// An Archive is a Category, Tag, Author or a Date based pages.
|
428 |
elseif( is_archive() ) {
|
429 |
if( array_key_exists("on_entire_site", $conditions)) {
|
430 |
-
$
|
431 |
}
|
432 |
}
|
433 |
-
|
434 |
-
return apply_filters('popmake_popup_is_loadable', $
|
435 |
}
|
436 |
|
437 |
|
282 |
global $post, $wp_query;
|
283 |
|
284 |
$conditions = popmake_get_popup_targeting_condition( $popup_id );
|
285 |
+
$sitewide = false;
|
286 |
+
$is_loadable = false;
|
287 |
|
288 |
+
if(array_key_exists('on_entire_site', $conditions)) {
|
289 |
+
$sitewide = true;
|
290 |
+
$is_loadable = true;
|
291 |
+
}
|
292 |
/**
|
293 |
+
* Home & Front Page Checks
|
|
|
|
|
|
|
|
|
|
|
294 |
*/
|
295 |
+
if( is_front_page() || is_home() ) {
|
296 |
+
if( !$sitewide && array_key_exists('on_home', $conditions) ) {
|
297 |
+
$is_loadable = true;
|
298 |
+
}
|
299 |
+
elseif( $sitewide && array_key_exists('exclude_on_home', $conditions) ) {
|
300 |
+
$is_loadable = false;
|
301 |
+
}
|
302 |
}
|
303 |
+
/**
|
304 |
+
* Page Checks
|
305 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
306 |
elseif( is_page() ) {
|
307 |
+
if( !$sitewide ) {
|
308 |
+
// Load on all pages
|
309 |
+
if( array_key_exists('on_pages', $conditions) && !array_key_exists('on_specific_pages', $conditions) ) {
|
310 |
+
$is_loadable = true;
|
311 |
+
}
|
312 |
+
// Load on specific pages
|
313 |
+
elseif( array_key_exists('on_specific_pages', $conditions) && array_key_exists('on_page_' . $post->ID, $conditions) ) {
|
314 |
+
$is_loadable = true;
|
315 |
+
}
|
316 |
}
|
317 |
+
else {
|
318 |
+
// Exclude on all pages.
|
319 |
+
if( array_key_exists('exclude_on_pages', $conditions) && !array_key_exists('exclude_on_specific_pages', $conditions) ) {
|
320 |
+
$is_loadable = false;
|
321 |
+
}
|
322 |
+
// Exclude on specific pages.
|
323 |
+
elseif( array_key_exists('exclude_on_specific_pages', $conditions) && array_key_exists('exclude_on_page_' . $post->ID, $conditions) ) {
|
324 |
+
$is_loadable = false;
|
325 |
+
}
|
326 |
}
|
327 |
+
}
|
328 |
+
/**
|
329 |
+
* Post Checks
|
330 |
+
*/
|
331 |
+
elseif( is_single() && $post->post_type == 'post' ) {
|
332 |
+
if( !$sitewide ) {
|
333 |
+
// Load on all posts`1
|
334 |
+
if( array_key_exists('on_posts', $conditions) && !array_key_exists('on_specific_posts', $conditions) ) {
|
335 |
+
$is_loadable = true;
|
336 |
+
}
|
337 |
+
// Load on specific posts
|
338 |
+
elseif( array_key_exists('on_specific_posts', $conditions) && array_key_exists('on_post_' . $post->ID, $conditions) ) {
|
339 |
+
$is_loadable = true;
|
340 |
+
}
|
341 |
}
|
342 |
+
else {
|
343 |
+
// Exclude on all posts.
|
344 |
+
if( array_key_exists('exclude_on_posts', $conditions) && !array_key_exists('exclude_on_specific_posts', $conditions) ) {
|
345 |
+
$is_loadable = false;
|
346 |
+
}
|
347 |
+
// Exclude on specific posts.
|
348 |
+
elseif( array_key_exists('exclude_on_specific_posts', $conditions) && array_key_exists('exclude_on_post_' . $post->ID, $conditions) ) {
|
349 |
+
$is_loadable = false;
|
350 |
+
}
|
351 |
}
|
|
|
352 |
}
|
353 |
+
/**
|
354 |
+
* Category Checks
|
355 |
+
*/
|
356 |
elseif( is_category() ) {
|
357 |
$category_id = $wp_query->get_queried_object_id();
|
358 |
+
if( !$sitewide ) {
|
359 |
+
// Load on all categories
|
360 |
+
if( array_key_exists('on_categories', $conditions) && !array_key_exists('on_specific_categories', $conditions) ) {
|
361 |
+
$is_loadable = true;
|
362 |
+
}
|
363 |
+
// Load on specific categories
|
364 |
+
elseif( array_key_exists('on_specific_categories', $conditions) && array_key_exists('on_category_' . $category_id, $conditions) ) {
|
365 |
+
$is_loadable = true;
|
366 |
+
}
|
|
|
|
|
|
|
367 |
}
|
368 |
+
else {
|
369 |
+
// Exclude on all categories.
|
370 |
+
if( array_key_exists('exclude_on_categories', $conditions) && !array_key_exists('exclude_on_specific_categories', $conditions) ) {
|
371 |
+
$is_loadable = false;
|
372 |
+
}
|
373 |
+
// Exclude on specific categories.
|
374 |
+
elseif( array_key_exists('exclude_on_specific_categories', $conditions) && array_key_exists('exclude_on_category_' . $category_id, $conditions) ) {
|
375 |
+
$is_loadable = false;
|
376 |
+
}
|
377 |
}
|
|
|
378 |
}
|
379 |
+
/**
|
380 |
+
* Tag Checks
|
381 |
+
*/
|
382 |
elseif( is_tag() ) {
|
383 |
+
$tag_id = $wp_query->get_queried_object_id();
|
384 |
+
if( !$sitewide ) {
|
385 |
+
// Load on all tags
|
386 |
+
if( array_key_exists('on_tags', $conditions) && !array_key_exists('on_specific_tags', $conditions) ) {
|
387 |
+
$is_loadable = true;
|
388 |
+
}
|
389 |
+
// Load on specific tags
|
390 |
+
elseif( array_key_exists('on_specific_tags', $conditions) && array_key_exists('on_tag_' . $tag_id, $conditions) ) {
|
391 |
+
$is_loadable = true;
|
392 |
+
}
|
|
|
|
|
393 |
}
|
394 |
+
else {
|
395 |
+
// Exclude on all tags.
|
396 |
+
if( array_key_exists('exclude_on_tags', $conditions) && !array_key_exists('exclude_on_specific_tags', $conditions) ) {
|
397 |
+
$is_loadable = false;
|
398 |
+
}
|
399 |
+
// Exclude on specific tags.
|
400 |
+
elseif( array_key_exists('exclude_on_specific_tags', $conditions) && array_key_exists('exclude_on_tag_' . $tag_id, $conditions) ) {
|
401 |
+
$is_loadable = false;
|
402 |
+
}
|
403 |
}
|
|
|
404 |
}
|
405 |
+
/**
|
406 |
+
* Custom Post Type Checks
|
407 |
+
* Add support for custom post types
|
408 |
+
*/
|
409 |
+
elseif( is_single() && !in_array($post->post_type, array('post','page')) ) {
|
410 |
+
$pt = $post->post_type;
|
411 |
|
412 |
+
if( !$sitewide ) {
|
413 |
+
// Load on all post type items
|
414 |
+
if( array_key_exists("on_{$pt}s", $conditions) && !array_key_exists("on_specific_{$pt}s", $conditions) ) {
|
415 |
+
$is_loadable = true;
|
416 |
+
}
|
417 |
+
// Load on specific post type items
|
418 |
+
elseif( array_key_exists("on_specific_{$pt}s", $conditions) && array_key_exists("on_{$pt}_" . $post->ID, $conditions) ) {
|
419 |
+
$is_loadable = true;
|
420 |
+
}
|
|
|
|
|
421 |
}
|
422 |
+
else {
|
423 |
+
// Exclude on all post type items.
|
424 |
+
if( array_key_exists("exclude_on_{$pt}s", $conditions) && !array_key_exists("exclude_on_specific_{$pt}s", $conditions) ) {
|
425 |
+
$is_loadable = false;
|
426 |
+
}
|
427 |
+
// Exclude on specific post type items.
|
428 |
+
elseif( array_key_exists("exclude_on_specific_{$pt}s", $conditions) && array_key_exists("exclude_on_{$pt}_" . $post->ID, $conditions) ) {
|
429 |
+
$is_loadable = false;
|
430 |
+
}
|
431 |
}
|
|
|
432 |
}
|
433 |
+
/**
|
434 |
+
* Custom Taxonomy Checks
|
435 |
+
* Add support for custom taxonomies
|
436 |
+
*/
|
437 |
+
elseif( is_tax() ) {
|
438 |
+
$term_id = $wp_query->get_queried_object_id();
|
439 |
+
$tax = get_query_var('taxonomy');
|
440 |
+
if( !$sitewide ) {
|
441 |
+
// Load on all custom tax terms.
|
442 |
+
if( array_key_exists("on_{$tax}s", $conditions) && !array_key_exists("on_specific_{$tax}s", $conditions) ) {
|
443 |
+
$is_loadable = true;
|
444 |
+
}
|
445 |
+
// Load on specific custom tax terms.
|
446 |
+
elseif( array_key_exists("on_specific_{$tax}s", $conditions) && array_key_exists("on_{$tax}_" . $term_id, $conditions) ) {
|
447 |
+
$is_loadable = true;
|
448 |
+
}
|
449 |
}
|
450 |
+
else {
|
451 |
+
// Exclude on all custom tax terms.
|
452 |
+
if( array_key_exists("exclude_on_{$tax}s", $conditions) && !array_key_exists("exclude_on_specific_{$tax}s", $conditions) ) {
|
453 |
+
$is_loadable = false;
|
454 |
+
}
|
455 |
+
// Exclude on specific custom tax terms.
|
456 |
+
elseif( array_key_exists("exclude_on_specific_{$tax}s", $conditions) && array_key_exists("exclude_on_{$tax}_" . $term_id, $conditions) ) {
|
457 |
+
$is_loadable = false;
|
458 |
+
}
|
459 |
}
|
460 |
+
}
|
461 |
+
/**
|
462 |
+
* Search Checks
|
463 |
+
*/
|
464 |
+
if( is_search() ) {
|
465 |
+
if( !$sitewide && array_key_exists('on_search', $conditions) ) {
|
466 |
+
$is_loadable = true;
|
467 |
}
|
468 |
+
elseif( $sitewide && array_key_exists('exclude_on_search', $conditions) ) {
|
469 |
+
$is_loadable = false;
|
|
|
470 |
}
|
|
|
471 |
}
|
472 |
+
/**
|
473 |
+
* 404 Page Checks
|
474 |
+
*/
|
475 |
+
if( is_404() ) {
|
476 |
+
if( !$sitewide && array_key_exists('on_404', $conditions) ) {
|
477 |
+
$is_loadable = true;
|
478 |
+
}
|
479 |
+
elseif( $sitewide && array_key_exists('exclude_on_404', $conditions) ) {
|
480 |
+
$is_loadable = false;
|
481 |
}
|
482 |
}
|
483 |
+
/*
|
484 |
// An Archive is a Category, Tag, Author or a Date based pages.
|
485 |
elseif( is_archive() ) {
|
486 |
if( array_key_exists("on_entire_site", $conditions)) {
|
487 |
+
$is_loadable = true;
|
488 |
}
|
489 |
}
|
490 |
+
*/
|
491 |
+
return apply_filters('popmake_popup_is_loadable', $is_loadable, $popup_id);
|
492 |
}
|
493 |
|
494 |
|
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.1.
|
8 |
* Author URI: https://wppopupmaker.com
|
9 |
* Text Domain: popup-maker
|
10 |
*
|
@@ -144,7 +144,7 @@ final class Popup_Maker {
|
|
144 |
}
|
145 |
|
146 |
if ( !defined('POPMAKE_VERSION') ) {
|
147 |
-
define('POPMAKE_VERSION', '1.1.
|
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.1.5
|
8 |
* Author URI: https://wppopupmaker.com
|
9 |
* Text Domain: popup-maker
|
10 |
*
|
144 |
}
|
145 |
|
146 |
if ( !defined('POPMAKE_VERSION') ) {
|
147 |
+
define('POPMAKE_VERSION', '1.1.5' );
|
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: popup,popups,modal,modals,popup form,form modal,conversion,conversions,dialog box,auto open
|
7 |
Requires at least: 3.4
|
8 |
-
Tested up to: 4.
|
9 |
-
Stable tag: 1.1.
|
10 |
|
11 |
License: GNU Version 2 or Any Later Version
|
12 |
Easily turn users into cash using Popup Maker - the most versatile & expansive popup plugin for WordPress!
|
@@ -76,6 +76,11 @@ For more information, visit [Popup Maker](https://wppopupmaker.com?utm_source=Wo
|
|
76 |
|
77 |
== Changelog ==
|
78 |
|
|
|
|
|
|
|
|
|
|
|
79 |
= v1.1.4 =
|
80 |
* Fixed bug in scrollable content styles.
|
81 |
* Fixed bug in admin JS for duplicate input names.
|
5 |
Donate link:
|
6 |
Tags: popup,popups,modal,modals,popup form,form modal,conversion,conversions,dialog box,auto open
|
7 |
Requires at least: 3.4
|
8 |
+
Tested up to: 4.1
|
9 |
+
Stable tag: 1.1.5
|
10 |
|
11 |
License: GNU Version 2 or Any Later Version
|
12 |
Easily turn users into cash using Popup Maker - the most versatile & expansive popup plugin for WordPress!
|
76 |
|
77 |
== Changelog ==
|
78 |
|
79 |
+
= v1.1.5 =
|
80 |
+
* Fixed bug when clicking add selected buttons.
|
81 |
+
* Changed how popmake_popup_is_loadable works. It is now more organized and readable.
|
82 |
+
* Added 2 new Targeting Conditions: Search & 404.
|
83 |
+
|
84 |
= v1.1.4 =
|
85 |
* Fixed bug in scrollable content styles.
|
86 |
* Fixed bug in admin JS for duplicate input names.
|