Popups – WordPress Popup - Version 1.0.4

Version Description

  • Fixed bug that cookies where not set when user closes the box by clicking outside or with ESC key
Download this release

Release Info

Developer timersys
Plugin Icon 128x128 Popups – WordPress Popup
Version 1.0.4
Comparing to
See all releases

Code changes from version 1.0.3 to 1.0.4

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: twitter,google+, facebook,Popups, twitter follow, facebook like, google plus,social boost, social splash, popup, facebook popup, scroll popups, popups, wordpress popup, wp popups
5
  Requires at least: 3.6
6
  Tested up to: 3.9.1
7
- Stable tag: 1.0.3
8
  Text Domain: spucpt
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -77,6 +77,10 @@ Enhance your site by letting your users send Social Invitations ([http://wp.time
77
 
78
  == Changelog ==
79
 
 
 
 
 
80
  = 1.0.3 =
81
 
82
  * Fixed bug with popup on mobiles devices
4
  Tags: twitter,google+, facebook,Popups, twitter follow, facebook like, google plus,social boost, social splash, popup, facebook popup, scroll popups, popups, wordpress popup, wp popups
5
  Requires at least: 3.6
6
  Tested up to: 3.9.1
7
+ Stable tag: 1.0.4
8
  Text Domain: spucpt
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
77
 
78
  == Changelog ==
79
 
80
+ = 1.0.4 =
81
+
82
+ * Fixed bug that cookies where not set when user closes the box by clicking outside or with ESC key
83
+
84
  = 1.0.3 =
85
 
86
  * Fixed bug with popup on mobiles devices
popups.php CHANGED
@@ -11,7 +11,7 @@
11
  * @socialpopup
12
  * Plugin Name: Popups
13
  * Plugin URI: http://www.timersys.com/free-plugins/social-popup/
14
- * Version: 1.0.3
15
  * Description: This plugin will display a popup or splash screen when a new user visit your site showing a Google+, twitter and facebook follow links. This will increase you followers ratio in a 40%. Popup will be close depending on your settings. Check readme.txt for full details.
16
  * Author: Damian Logghe
17
  * Author URI: http://wp.timersys.com
11
  * @socialpopup
12
  * Plugin Name: Popups
13
  * Plugin URI: http://www.timersys.com/free-plugins/social-popup/
14
+ * Version: 1.0.4
15
  * Description: This plugin will display a popup or splash screen when a new user visit your site showing a Google+, twitter and facebook follow links. This will increase you followers ratio in a 40%. Popup will be close depending on your settings. Check readme.txt for full details.
16
  * Author: Damian Logghe
17
  * Author URI: http://wp.timersys.com
public/assets/js/min/public-ck.js CHANGED
@@ -1 +1 @@
1
- function createCookie(t,n,e){if(e){var i=new Date;i.setTime(i.getTime()+24*e*60*60*1e3);var o="; expires="+i.toGMTString()}else var o="";document.cookie=t+"="+n+o+"; path=/"}function readCookie(t){for(var n=t+"=",e=document.cookie.split(";"),i=0;i<e.length;i++){for(var o=e[i];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(n))return o.substring(n.length,o.length)}return null}jQuery(window).load(function(){window.SPU=function($){function t(t){var n=o[t],e=$(window).width(),i=$(window).height(),a=n.height(),r=n.width();n.css({position:"fixed",top:i/2-a/2,left:e/2-r/2})}function n(t,n){var e=o[t],i=$("#spu-bg-"+t),a=e.data("bgopa");if(e.is(":animated"))return!1;if(n===!0&&e.is(":visible")||n===!1&&e.is(":hidden"))return!1;var r=e.data("animation");return"fade"===r?e.fadeToggle("slow"):e.slideToggle("slow"),n===!0&&a>0?i.fadeIn():i.fadeOut(),n}var e=$(window).height(),i=spuvar.is_admin,o=[];return $(".spu-content").children().first().css({"margin-top":0,"padding-top":0}).end().last().css({"margin-bottom":0,"padding-bottom":0}),$(".spu-box").each(function(){var a=$(this),r=a.data("trigger"),s=0,d=1===parseInt(a.data("test-mode")),c=a.data("box-id"),u=1===parseInt(a.data("auto-hide")),l=1===parseInt(a.data("advanced-close")),f=parseInt(a.data("seconds-close"));if(l){$(document).keyup(function(t){27==t.keyCode&&n(c,!1)});var h=navigator.userAgent,g=h.match(/iPad/i)||h.match(/iPhone/i)?"touchstart":"click";$("body").on(g,function(t){console.log(g.target),n(c,!1)}),$(".spu-box").on(g,function(t){t.stopPropagation()})}if(a.hide().css("left",""),o[c]=a,"seconds"==r)var w=parseInt(a.data("trigger-number"),10);else var p="percentage"==r?parseInt(a.data("trigger-number"),10)/100:.8,m=p*$(document).height();var v=function(){s&&clearTimeout(s),s=window.setTimeout(function(){var i=$(window).scrollTop(),o=i+e>=m;o?(u||$(window).unbind("scroll",v),a.hasClass("spu-centered")&&t(c),n(c,!0)):n(c,!1)},100)},b=function(){s&&clearTimeout(s),s=window.setTimeout(function(){a.hasClass("spu-centered")&&t(c),n(c,!0)},1e3*w)},k=readCookie("spu_box_"+c);if((void 0==k||i&&d)&&("seconds"==r?b():($(window).bind("scroll",v),v()),window.location.hash&&window.location.hash.length>0)){var T=window.location.hash,x;T.substring(1)===a.attr("id")&&setTimeout(function(){n(c,!0)},100)}a.find(".spu-close").click(function(){n(c,!1),"percentage"==r&&$(window).unbind("scroll",v);var t=parseInt(a.data("cookie"));t>0&&createCookie("spu_box_"+c,!0,t)}),$('a[href="#'+a.attr("id")+'"]').click(function(){return n(c,!0),!1})}),{show:function(t){return n(t,!0)},hide:function(t){return n(t,!1)}}}(window.jQuery)});
1
+ function createCookie(t,n,e){if(e){var i=new Date;i.setTime(i.getTime()+24*e*60*60*1e3);var o="; expires="+i.toGMTString()}else var o="";document.cookie=t+"="+n+o+"; path=/"}function readCookie(t){for(var n=t+"=",e=document.cookie.split(";"),i=0;i<e.length;i++){for(var o=e[i];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(n))return o.substring(n.length,o.length)}return null}jQuery(window).load(function(){window.SPU=function($){function t(t){var n=o[t],e=$(window).width(),i=$(window).height(),a=n.height(),r=n.width();n.css({position:"fixed",top:i/2-a/2,left:e/2-r/2})}function n(t,n){var e=o[t],i=$("#spu-bg-"+t),a=e.data("bgopa");if(e.is(":animated"))return!1;if(n===!0&&e.is(":visible")||n===!1&&e.is(":hidden"))return!1;if(n===!1){var r=parseInt(e.data("cookie"));r>0&&createCookie("spu_box_"+t,!0,r)}var s=e.data("animation");return"fade"===s?e.fadeToggle("slow"):e.slideToggle("slow"),n===!0&&a>0?i.fadeIn():i.fadeOut(),n}var e=$(window).height(),i=spuvar.is_admin,o=[];return $(".spu-content").children().first().css({"margin-top":0,"padding-top":0}).end().last().css({"margin-bottom":0,"padding-bottom":0}),$(".spu-box").each(function(){var a=$(this),r=a.data("trigger"),s=0,d=1===parseInt(a.data("test-mode")),c=a.data("box-id"),u=1===parseInt(a.data("auto-hide")),l=1===parseInt(a.data("advanced-close")),f=parseInt(a.data("seconds-close"));if(l){$(document).keyup(function(t){27==t.keyCode&&n(c,!1)});var h=navigator.userAgent,g=h.match(/iPad/i)||h.match(/iPhone/i)?"touchstart":"click";$("body").on(g,function(t){console.log(g.target),n(c,!1)}),$(".spu-box").on(g,function(t){t.stopPropagation()})}if(a.hide().css("left",""),o[c]=a,"seconds"==r)var w=parseInt(a.data("trigger-number"),10);else var p="percentage"==r?parseInt(a.data("trigger-number"),10)/100:.8,m=p*$(document).height();var v=function(){s&&clearTimeout(s),s=window.setTimeout(function(){var i=$(window).scrollTop(),o=i+e>=m;o?(u||$(window).unbind("scroll",v),a.hasClass("spu-centered")&&t(c),n(c,!0)):n(c,!1)},100)},b=function(){s&&clearTimeout(s),s=window.setTimeout(function(){a.hasClass("spu-centered")&&t(c),n(c,!0)},1e3*w)},k=readCookie("spu_box_"+c);if((void 0==k||i&&d)&&("seconds"==r?b():($(window).bind("scroll",v),v()),window.location.hash&&window.location.hash.length>0)){var T=window.location.hash,x;T.substring(1)===a.attr("id")&&setTimeout(function(){n(c,!0)},100)}a.find(".spu-close").click(function(){n(c,!1),"percentage"==r&&$(window).unbind("scroll",v)}),$('a[href="#'+a.attr("id")+'"]').click(function(){return n(c,!0),!1})}),{show:function(t){return n(t,!0)},hide:function(t){return n(t,!1)}}}(window.jQuery)});
public/assets/js/public.js CHANGED
@@ -156,12 +156,6 @@ jQuery(window).load(function() {
156
  // unbind
157
  $(window).unbind( 'scroll', triggerHeightCheck );
158
  }
159
-
160
- // set cookie
161
- var days = parseInt( $box.data('cookie') );
162
- if( days > 0 ) {
163
- createCookie( 'spu_box_' + id, true, days );
164
- }
165
 
166
  });
167
 
@@ -199,6 +193,15 @@ jQuery(window).load(function() {
199
  return false;
200
  }
201
 
 
 
 
 
 
 
 
 
 
202
  // show box
203
  var animation = $box.data('animation');
204
 
156
  // unbind
157
  $(window).unbind( 'scroll', triggerHeightCheck );
158
  }
 
 
 
 
 
 
159
 
160
  });
161
 
193
  return false;
194
  }
195
 
196
+ //if we are closing , set cookie
197
+ if( show === false) {
198
+ // set cookie
199
+ var days = parseInt( $box.data('cookie') );
200
+ if( days > 0 ) {
201
+ createCookie( 'spu_box_' + id, true, days );
202
+ }
203
+ }
204
+
205
  // show box
206
  var animation = $box.data('animation');
207
 
public/class-social-popup.php CHANGED
@@ -23,7 +23,7 @@ class SocialPopup {
23
  *
24
  * @var string
25
  */
26
- const VERSION = '1.0.3';
27
 
28
  /**
29
  * Popups to use acrros files
23
  *
24
  * @var string
25
  */
26
+ const VERSION = '1.0.4';
27
 
28
  /**
29
  * Popups to use acrros files