Popups – WordPress Popup - Version 1.4

Version Description

Download this release

Release Info

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

Code changes from version 1.3.3 to 1.4

README.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: timersys
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=K4T6L69EV9G2Q
4
  Tags: popup,twitter,google+, facebook,Popups, twitter follow, facebook like, google plus,social boost, social splash, postmatic, mailpoet, facebook popup, scroll popups, popups, wordpress popup, wp popups, cf7, gf, gravity forms, contact form 7, ifs, infusion soft, subscribe
5
  Requires at least: 3.6
6
- Tested up to: 4.2.2
7
- Stable tag: 1.3.3
8
  Text Domain: spu
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -15,10 +15,11 @@ Most complete free Popups plugin, scroll triggered popups, compatible with socia
15
 
16
  The new Popups plugin can display multiple popups. Is the perfect solution to increase your social followers, add call to actions, increase your mailing lists by adding a form like mailchimp or to display any important message in a simple popup.
17
 
18
- It's compatible with the major form plugins like :
19
  * Gravity Forms
20
  * Ninja Forms
21
  * Contact form 7
 
22
  * Infusion Soft
23
  * Jetpack
24
  * Mailpoet
@@ -83,6 +84,8 @@ Fork me in https://github.com/timersys/popups/
83
  * Serbo-Croatian - Borisa - http://www.webhostinghub.com/
84
  * Spanish - Andrew Kurtis - http://www.webhostinghub.com/
85
 
 
 
86
  = Install Multiple plugins at once with WpFavs =
87
 
88
  Bulk plugin installation tool, import WP favorites and create your own lists ([http://wordpress.org/extend/plugins/wpfavs/](http://wordpress.org/extend/plugins/wpfavs/))
@@ -112,6 +115,25 @@ Enhance your site by letting your users send Social Invitations ([http://wp.time
112
 
113
  == Frequently Asked Questions ==
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  = Can I give other roles permissions to edit popups ? =
116
  You need to add [this code](https://gist.github.com/timersys/03067ac7594fdce288ca) to your functions.php
117
 
@@ -151,6 +173,18 @@ If you have cache be sure to enable AJAX mode in the plugin settings page
151
 
152
  == Changelog ==
153
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  = 1.3.3 =
155
 
156
  * Updated languages and added transifex
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=K4T6L69EV9G2Q
4
  Tags: popup,twitter,google+, facebook,Popups, twitter follow, facebook like, google plus,social boost, social splash, postmatic, mailpoet, facebook popup, scroll popups, popups, wordpress popup, wp popups, cf7, gf, gravity forms, contact form 7, ifs, infusion soft, subscribe
5
  Requires at least: 3.6
6
+ Tested up to: 4.3
7
+ Stable tag: 1.4
8
  Text Domain: spu
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
 
16
  The new Popups plugin can display multiple popups. Is the perfect solution to increase your social followers, add call to actions, increase your mailing lists by adding a form like mailchimp or to display any important message in a simple popup.
17
 
18
+ It's compatible with the major form plugins like (read FAQ):
19
  * Gravity Forms
20
  * Ninja Forms
21
  * Contact form 7
22
+ * USP Forms
23
  * Infusion Soft
24
  * Jetpack
25
  * Mailpoet
84
  * Serbo-Croatian - Borisa - http://www.webhostinghub.com/
85
  * Spanish - Andrew Kurtis - http://www.webhostinghub.com/
86
 
87
+ = Beatiful WordPress Emails =
88
+ Now you can send html email in WordPress with [https://wordpress.org/plugins/email-templates/](https://wordpress.org/plugins/email-templates/)
89
  = Install Multiple plugins at once with WpFavs =
90
 
91
  Bulk plugin installation tool, import WP favorites and create your own lists ([http://wordpress.org/extend/plugins/wpfavs/](http://wordpress.org/extend/plugins/wpfavs/))
115
 
116
  == Frequently Asked Questions ==
117
 
118
+ = Popups plugin is compatible with Gravity Forms ? =
119
+ Yes, you need to configure your form to use ajax when inserting it
120
+
121
+ = Popups plugin is compatible with Ninja Forms ? =
122
+ Yes, you need to configure your form to use ajax. Go to the setting of the created form and enable AJAX. Then you need to disable AJAX on popups settings page.
123
+
124
+ = Mailchimp4wp form it's compatible? =
125
+ Yes, you need to disable AJAX on popups settings page
126
+
127
+ = Jetpack form it's compatible? =
128
+ Yes, you need to disable AJAX on popups settings page
129
+
130
+ = Popups plugin is compatible with USP Forms ? =
131
+ Yes, you need to add to the usp form shortcode the class spu-disable-ajax like : [usp_form class="spu-disable-ajax"]
132
+
133
+ = How can I change other styles of the popup like padding, rounded corners, etc ? =
134
+ You can modify everything with css. If your popup id is 120 you can add some css like for example:
135
+ `#spu-120{ ---your css here--- }`
136
+
137
  = Can I give other roles permissions to edit popups ? =
138
  You need to add [this code](https://gist.github.com/timersys/03067ac7594fdce288ca) to your functions.php
139
 
173
 
174
  == Changelog ==
175
 
176
+ = 1.3.4 =
177
+
178
+ * Added support for usp forms
179
+ * Added option to delete all data after uninstall
180
+ * Now you can target popups by posts tags using taxonomy rule
181
+ * Any link you place inside popup is treatead as conversion when clicked
182
+ * Update popups admin screen
183
+ * Fixed bug with ninja forms
184
+ * Fixed bug with manually triggered popups
185
+ * Fixed several other bugs ( js events, settings not saving, etc)
186
+ * Updated FAQ and readme
187
+
188
  = 1.3.3 =
189
 
190
  * Updated languages and added transifex
admin/assets/js/admin.js CHANGED
@@ -27,7 +27,7 @@ SPU_ADMIN = (function ( $ ) {
27
  });
28
 
29
  function checkTriggerMethod( val ) {
30
- if( val == 'percentage') {
31
  $('tr.auto_hide').fadeIn('fast');
32
  } else {
33
  $('tr.auto_hide').fadeOut('fast');
27
  });
28
 
29
  function checkTriggerMethod( val ) {
30
+ if( val == 'percentage' || val == 'visible') {
31
  $('tr.auto_hide').fadeIn('fast');
32
  } else {
33
  $('tr.auto_hide').fadeOut('fast');
admin/assets/js/min/admin-min.js CHANGED
@@ -1 +1 @@
1
- var spu={rules:null};SPU_ADMIN=function($){function t(t){"percentage"==t?$("tr.auto_hide").fadeIn("fast"):$("tr.auto_hide").fadeOut("fast")}function r(t,r){return t.val()?parseInt(t.val()):void 0!==r?r+"px":0}function e(t,r){return t.val().length>0?t.wpColorPicker("color"):void 0!==r?r:""}function n(){var t=$("#content_ifr").contents().find("html");t.trigger("spu_tinymce_init"),t.css({background:"#9C9B9B;"}),("undefined"==typeof spup_js||""==$("#spu_optin").val())&&(t.find(".spu-fields-container").remove(),t.find("#tinymce").css({padding:"25px","background-color":e($("#spu-background-color")),"border-color":e($("#spu-border-color")),"border-width":r($("#spu-border-width")),"border-style":"solid",width:$("#spu-width").val(),color:e($("#spu-color")),height:"auto","min-width":"200px","max-width":"100%",margin:"8px auto 0;"}))}return $(document).ready(function(){spu.rules.init();var r=$("#spu-options input.spu-color-field");r.length&&r.wpColorPicker({change:n,clear:n}),$("#spu-options :input").not(".spu-color-field").change(n),t($("#spu_trigger").val()),$("#spu_trigger").change(function(){t($(this).val())})}),spu.rules={$el:null,init:function(){var t=this;t.$el=$("#spu-rules"),t.$el.on("click",".rules-add-rule",function(){return t.add_rule($(this).closest("tr")),!1}),t.$el.on("click",".rules-remove-rule",function(){return t.remove_rule($(this).closest("tr")),!1}),t.$el.on("click",".rules-add-group",function(){return t.add_group(),!1}),t.$el.on("change",".param select",function(){var t=$(this).closest("tr"),r=t.attr("data-id"),e=t.closest(".rules-group"),n=e.attr("data-id"),i={action:"spu/field_group/render_rules",nonce:spu_js.nonce,rule_id:r,group_id:n,value:"",param:$(this).val()},a=$('<div class="spu-loading"><img src="'+spu_js.admin_url+'/images/wpspin_light.gif"/> </div>');t.find("td.value").html(a),$.ajax({url:ajaxurl,data:i,type:"post",dataType:"html",success:function(t){a.replaceWith(t)}})})},add_rule:function(t){var r=t.clone(),e=r.attr("data-id"),n="rule_"+(parseInt(e.replace("rule_",""),10)+1);return r.find("[name]").each(function(){$(this).attr("name",$(this).attr("name").replace(e,n)),$(this).attr("id",$(this).attr("id").replace(e,n))}),r.attr("data-id",n),t.after(r),!1},remove_rule:function(t){var r=t.siblings("tr").length;0==r?this.remove_group(t.closest(".rules-group")):t.remove()},add_group:function(){var t=this.$el.find(".rules-group:last"),r=t.clone(),e=r.attr("data-id"),n="group_"+(parseInt(e.replace("group_",""),10)+1);r.find("[name]").each(function(){$(this).attr("name",$(this).attr("name").replace(e,n)),$(this).attr("id",$(this).attr("id").replace(e,n))}),r.attr("data-id",n),r.find("h4").text(spu_js.l10n.or),r.find("tr:not(:first)").remove(),t.after(r)},remove_group:function(t){t.remove()}},{onTinyMceInit:function(){n()}}}(jQuery);
1
+ var spu={rules:null};SPU_ADMIN=function($){function t(t){"percentage"==t||"visible"==t?$("tr.auto_hide").fadeIn("fast"):$("tr.auto_hide").fadeOut("fast")}function r(t,r){return t.val()?parseInt(t.val()):void 0!==r?r+"px":0}function e(t,r){return t.val().length>0?t.wpColorPicker("color"):void 0!==r?r:""}function n(){var t=$("#content_ifr").contents().find("html");t.trigger("spu_tinymce_init"),t.css({background:"#9C9B9B;"}),("undefined"==typeof spup_js||""==$("#spu_optin").val())&&(t.find(".spu-fields-container").remove(),t.find("#tinymce").css({padding:"25px","background-color":e($("#spu-background-color")),"border-color":e($("#spu-border-color")),"border-width":r($("#spu-border-width")),"border-style":"solid",width:$("#spu-width").val(),color:e($("#spu-color")),height:"auto","min-width":"200px","max-width":"100%",margin:"8px auto 0;"}))}return $(document).ready(function(){spu.rules.init();var r=$("#spu-options input.spu-color-field");r.length&&r.wpColorPicker({change:n,clear:n}),$("#spu-options :input").not(".spu-color-field").change(n),t($("#spu_trigger").val()),$("#spu_trigger").change(function(){t($(this).val())})}),spu.rules={$el:null,init:function(){var t=this;t.$el=$("#spu-rules"),t.$el.on("click",".rules-add-rule",function(){return t.add_rule($(this).closest("tr")),!1}),t.$el.on("click",".rules-remove-rule",function(){return t.remove_rule($(this).closest("tr")),!1}),t.$el.on("click",".rules-add-group",function(){return t.add_group(),!1}),t.$el.on("change",".param select",function(){var t=$(this).closest("tr"),r=t.attr("data-id"),e=t.closest(".rules-group"),n=e.attr("data-id"),i={action:"spu/field_group/render_rules",nonce:spu_js.nonce,rule_id:r,group_id:n,value:"",param:$(this).val()},a=$('<div class="spu-loading"><img src="'+spu_js.admin_url+'/images/wpspin_light.gif"/> </div>');t.find("td.value").html(a),$.ajax({url:ajaxurl,data:i,type:"post",dataType:"html",success:function(t){a.replaceWith(t)}})})},add_rule:function(t){var r=t.clone(),e=r.attr("data-id"),n="rule_"+(parseInt(e.replace("rule_",""),10)+1);return r.find("[name]").each(function(){$(this).attr("name",$(this).attr("name").replace(e,n)),$(this).attr("id",$(this).attr("id").replace(e,n))}),r.attr("data-id",n),t.after(r),!1},remove_rule:function(t){var r=t.siblings("tr").length;0==r?this.remove_group(t.closest(".rules-group")):t.remove()},add_group:function(){var t=this.$el.find(".rules-group:last"),r=t.clone(),e=r.attr("data-id"),n="group_"+(parseInt(e.replace("group_",""),10)+1);r.find("[name]").each(function(){$(this).attr("name",$(this).attr("name").replace(e,n)),$(this).attr("id",$(this).attr("id").replace(e,n))}),r.attr("data-id",n),r.find("h4").text(spu_js.l10n.or),r.find("tr:not(:first)").remove(),t.after(r)},remove_group:function(t){t.remove()}},{onTinyMceInit:function(){n()}}}(jQuery);
admin/class-social-popup-admin.php CHANGED
@@ -117,6 +117,10 @@ class SocialPopup_Admin {
117
  add_filter( 'tiny_mce_before_init', array($this, 'tinymce_init') );
118
  add_action( 'admin_init', array( $this, 'editor_styles' ) );
119
 
 
 
 
 
120
  $this->set_rules_fields();
121
  }
122
 
@@ -405,11 +409,17 @@ class SocialPopup_Admin {
405
  * @return mixed
406
  */
407
  public function save_meta_options( $post_id ) {
 
 
 
 
 
 
 
408
  // Verify that the nonce is set and valid.
409
  if ( !isset( $_POST['spu_options_nonce'] ) || ! wp_verify_nonce( $_POST['spu_options_nonce'], 'spu_options' ) ) {
410
  return $post_id;
411
  }
412
-
413
  // If this is an autosave, our form has not been submitted, so we don't want to do anything.
414
  if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
415
  return $post_id;
@@ -500,7 +510,7 @@ class SocialPopup_Admin {
500
  update_post_meta( $post_id, 'spu_rules', apply_filters( 'spu/metaboxes/sanitized_rules', $groups_a ) );
501
  unset( $_POST['spu_rules'] );
502
  }
503
-
504
  }
505
  /**
506
  * Register and enqueue admin-specific style sheet.
@@ -651,8 +661,8 @@ class SocialPopup_Admin {
651
  {
652
  foreach($taxonomies as $taxonomy)
653
  {
654
- if(!is_taxonomy_hierarchical($taxonomy)) continue;
655
- $terms = get_terms($taxonomy, array('hide_empty' => false));
656
  if($terms)
657
  {
658
  foreach($terms as $term)
@@ -769,4 +779,33 @@ class SocialPopup_Admin {
769
  add_action('spu/rules/print_tablets_field', array('Spu_Helper', 'print_select'), 10, 2);
770
  add_action('spu/rules/print_referrer_field', array('Spu_Helper', 'print_textfield'), 10, 1);
771
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
772
  }
117
  add_filter( 'tiny_mce_before_init', array($this, 'tinymce_init') );
118
  add_action( 'admin_init', array( $this, 'editor_styles' ) );
119
 
120
+ //Columns in cpt
121
+ add_filter( 'manage_edit-spucpt_columns' , array( $this, 'set_custom_cpt_columns'), 10, 2 );
122
+ add_action( 'manage_spucpt_posts_custom_column' , array( $this, 'custom_columns'), 10, 2 );
123
+
124
  $this->set_rules_fields();
125
  }
126
 
409
  * @return mixed
410
  */
411
  public function save_meta_options( $post_id ) {
412
+ static $spu_save = 0;
413
+
414
+ // For some reason sometimes this hook run twice, until I can find the reason and reproduce error
415
+ // let's use a static var to prevent this
416
+ if( $spu_save > 0 )
417
+ return $post_id;
418
+
419
  // Verify that the nonce is set and valid.
420
  if ( !isset( $_POST['spu_options_nonce'] ) || ! wp_verify_nonce( $_POST['spu_options_nonce'], 'spu_options' ) ) {
421
  return $post_id;
422
  }
 
423
  // If this is an autosave, our form has not been submitted, so we don't want to do anything.
424
  if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
425
  return $post_id;
510
  update_post_meta( $post_id, 'spu_rules', apply_filters( 'spu/metaboxes/sanitized_rules', $groups_a ) );
511
  unset( $_POST['spu_rules'] );
512
  }
513
+ $spu_save++;
514
  }
515
  /**
516
  * Register and enqueue admin-specific style sheet.
661
  {
662
  foreach($taxonomies as $taxonomy)
663
  {
664
+ if( 'nav_menu' == $taxonomy ) continue;
665
+ $terms = get_terms($taxonomy, array('hide_empty' => true));
666
  if($terms)
667
  {
668
  foreach($terms as $term)
779
  add_action('spu/rules/print_tablets_field', array('Spu_Helper', 'print_select'), 10, 2);
780
  add_action('spu/rules/print_referrer_field', array('Spu_Helper', 'print_textfield'), 10, 1);
781
  }
782
+
783
+ /**
784
+ * Add custom columns to spu cpt
785
+ * @param [type] $columns [description]
786
+ * @since 1.3.3
787
+ */
788
+ public function set_custom_cpt_columns( $columns ){
789
+ unset( $columns['date'] );
790
+
791
+ $columns['spu_id'] = __( 'ID', '$this->plugin_slug' );
792
+ return $columns;
793
+ }
794
+ /**
795
+ * Add callbacks for custom colums
796
+ * @param array $column [description]
797
+ * @param int $post_id [description]
798
+ * @return echo html
799
+ * @since 1.3.3
800
+ */
801
+ function custom_columns( $column, $post_id ) {
802
+ global $wpdb;
803
+
804
+ switch ( $column ) {
805
+ case 'spu_id' :
806
+ echo '#spu-'.$post_id;
807
+ break;
808
+
809
+ }
810
+ }
811
  }
admin/views/metaboxes/metabox-options.php CHANGED
@@ -39,7 +39,7 @@ if ( !defined( 'ABSPATH' ) ) exit;?>
39
  <td colspan="3">
40
  <label><input type="radio" id="spu_auto_hide_1" name="spu[auto_hide]" value="1" <?php checked($opts['auto_hide'], 1); ?> /> <?php _e( 'Yes' ); ?></label> &nbsp;
41
  <label><input type="radio" id="spu_auto_hide_0" name="spu[auto_hide]" value="0" <?php checked($opts['auto_hide'], 0); ?> /> <?php _e( 'No' ); ?></label> &nbsp;
42
- <p class="help"><?php _e( 'Hide box again when visitors scroll back up? Only works when Trigger action is set to &#37; of page height', $this->plugin_slug ); ?></p>
43
  </td>
44
  </tr>
45
  <tr valign="top">
39
  <td colspan="3">
40
  <label><input type="radio" id="spu_auto_hide_1" name="spu[auto_hide]" value="1" <?php checked($opts['auto_hide'], 1); ?> /> <?php _e( 'Yes' ); ?></label> &nbsp;
41
  <label><input type="radio" id="spu_auto_hide_0" name="spu[auto_hide]" value="0" <?php checked($opts['auto_hide'], 0); ?> /> <?php _e( 'No' ); ?></label> &nbsp;
42
+ <p class="help"><?php _e( 'Hide box again when visitors scroll back up?', $this->plugin_slug ); ?></p>
43
  </td>
44
  </tr>
45
  <tr valign="top">
admin/views/settings-page.php CHANGED
@@ -77,6 +77,15 @@
77
 
78
  </tr>
79
  <?php do_action( 'spu/settings_page/after' ); ?>
 
 
 
 
 
 
 
 
 
80
  <tr><td><input type="submit" class="button-primary" value="<?php _e( 'Save settings', $this->plugin_slug );?>"/></td>
81
  <?php wp_nonce_field('spu_save_settings','spu_nonce'); ?>
82
  </table>
77
 
78
  </tr>
79
  <?php do_action( 'spu/settings_page/after' ); ?>
80
+
81
+ <tr valign="top" class="">
82
+ <th><label for="uninstall"><?php _e( 'Delete all data on Uninstall', $this->plugin_slug ); ?></label></th>
83
+ <td colspan="3">
84
+ <label><input type="checkbox" id="uninstall" name="spu_settings[uninstall]" value="1" <?php checked(@$opts['uninstall'], 1); ?> />
85
+ <p class="help"><?php _e( 'When you uninstall the plugin all popups, settings and stats will be deleted from your db', $this->plugin_slug ); ?></p>
86
+ </td>
87
+
88
+ </tr>
89
  <tr><td><input type="submit" class="button-primary" value="<?php _e( 'Save settings', $this->plugin_slug );?>"/></td>
90
  <?php wp_nonce_field('spu_save_settings','spu_nonce'); ?>
91
  </table>
popups.php CHANGED
@@ -11,7 +11,7 @@
11
  * @socialpopup
12
  * Plugin Name: Popups - WordPress Popup
13
  * Plugin URI: http://www.timersys.com/free-plugins/social-popup/
14
- * Version: 1.3.3
15
  * Description: Most complete free Popups plugin, scroll triggered popups, compatible with social networks, Gravity Forms, Ninja Forms, Contact form 7, Mailpoet, Mailchimp for WP, Postmatic, etc
16
  * Author: Damian Logghe
17
  * Author URI: http://wp.timersys.com
@@ -30,7 +30,7 @@ if ( ! defined( 'WPINC' ) ) {
30
  * Public-Facing Functionality
31
  *----------------------------------------------------------------------------*/
32
 
33
- define( 'SPU_VERSION' , '1.3.3' );
34
  define( 'SPU_PLUGIN_DIR' , plugin_dir_path(__FILE__) );
35
  define( 'SPU_PLUGIN_URL' , plugin_dir_url(__FILE__) );
36
  define( 'SPU_PLUGIN_HOOK' , basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ) );
11
  * @socialpopup
12
  * Plugin Name: Popups - WordPress Popup
13
  * Plugin URI: http://www.timersys.com/free-plugins/social-popup/
14
+ * Version: 1.4
15
  * Description: Most complete free Popups plugin, scroll triggered popups, compatible with social networks, Gravity Forms, Ninja Forms, Contact form 7, Mailpoet, Mailchimp for WP, Postmatic, etc
16
  * Author: Damian Logghe
17
  * Author URI: http://wp.timersys.com
30
  * Public-Facing Functionality
31
  *----------------------------------------------------------------------------*/
32
 
33
+ define( 'SPU_VERSION' , '1.4' );
34
  define( 'SPU_PLUGIN_DIR' , plugin_dir_path(__FILE__) );
35
  define( 'SPU_PLUGIN_URL' , plugin_dir_url(__FILE__) );
36
  define( 'SPU_PLUGIN_HOOK' , basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ) );
public/assets/js/min/public-min.js CHANGED
@@ -1 +1 @@
1
- (function(){function t(){}function e(t,e){for(var n=t.length;n--;)if(t[n].listener===e)return n;return-1}function n(t){return function(){return this[t].apply(this,arguments)}}var i=t.prototype,r=this,o=r.EventEmitter;i.getListeners=function(t){var e,n,i=this._getEvents();if("object"==typeof t){e={};for(n in i)i.hasOwnProperty(n)&&t.test(n)&&(e[n]=i[n])}else e=i[t]||(i[t]=[]);return e},i.flattenListeners=function(t){var e,n=[];for(e=0;t.length>e;e+=1)n.push(t[e].listener);return n},i.getListenersAsObject=function(t){var e,n=this.getListeners(t);return n instanceof Array&&(e={},e[t]=n),e||n},i.addListener=function(t,n){var i,r=this.getListenersAsObject(t),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===e(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(t){return this.getListeners(t),this},i.defineEvents=function(t){for(var e=0;t.length>e;e+=1)this.defineEvent(t[e]);return this},i.removeListener=function(t,n){var i,r,o=this.getListenersAsObject(t);for(r in o)o.hasOwnProperty(r)&&(i=e(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},i.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},i.manipulateListeners=function(t,e,n){var i,r,o=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(i=n.length;i--;)o.call(this,e,n[i]);else for(i in e)e.hasOwnProperty(i)&&(r=e[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(t){var e,n=typeof t,i=this._getEvents();if("string"===n)delete i[t];else if("object"===n)for(e in i)i.hasOwnProperty(e)&&t.test(e)&&delete i[e];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(t,e){var n,i,r,o,s=this.getListenersAsObject(t);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(t,n.listener),o=n.listener.apply(this,e||[]),o===this._getOnceReturnValue()&&this.removeListener(t,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},i.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return r.EventEmitter=o,t},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return t}):"object"==typeof module&&module.exports?module.exports=t:this.EventEmitter=t}).call(this),function(t){function e(e){var n=t.event;return n.target=n.target||n.srcElement||e,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(t,e,n){t.addEventListener(e,n,!1)}:n.attachEvent&&(i=function(t,n,i){t[n+i]=i.handleEvent?function(){var n=e(t);i.handleEvent.call(i,n)}:function(){var n=e(t);i.call(t,n)},t.attachEvent("on"+n,t[n+i])});var r=function(){};n.removeEventListener?r=function(t,e,n){t.removeEventListener(e,n,!1)}:n.detachEvent&&(r=function(t,e,n){t.detachEvent("on"+e,t[e+n]);try{delete t[e+n]}catch(i){t[e+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):t.eventie=o}(this),function(t,e){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return e(t,n,i)}):"object"==typeof exports?module.exports=e(t,require("wolfy87-eventemitter"),require("eventie")):t.imagesLoaded=e(t,t.EventEmitter,t.eventie)}(window,function(t,e,n){function i(t,e){for(var n in e)t[n]=e[n];return t}function r(t){return"[object Array]"===p.call(t)}function o(t){var e=[];if(r(t))e=t;else if("number"==typeof t.length)for(var n=0,i=t.length;i>n;n++)e.push(t[n]);else e.push(t);return e}function s(t,e,n){if(!(this instanceof s))return new s(t,e);"string"==typeof t&&(t=document.querySelectorAll(t)),this.elements=o(t),this.options=i({},this.options),"function"==typeof e?n=e:i(this.options,e),n&&this.on("always",n),this.getImages(),c&&(this.jqDeferred=new c.Deferred);var r=this;setTimeout(function(){r.check()})}function a(t){this.img=t}function u(t){this.src=t,h[t]=this}var c=t.jQuery,f=t.console,d=void 0!==f,p=Object.prototype.toString;s.prototype=new e,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var t=0,e=this.elements.length;e>t;t++){var n=this.elements[t];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){var a=r[o];this.addImage(a)}}},s.prototype.addImage=function(t){var e=new a(t);this.images.push(e)},s.prototype.check=function(){function t(t,r){return e.options.debug&&d&&f.log("confirm",t,r),e.progress(t),n++,n===i&&e.complete(),!0}var e=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return void this.complete();for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",t),o.check()}},s.prototype.progress=function(t){this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded;var e=this;setTimeout(function(){e.emit("progress",e,t),e.jqDeferred&&e.jqDeferred.notify&&e.jqDeferred.notify(e,t)})},s.prototype.complete=function(){var t=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var e=this;setTimeout(function(){if(e.emit(t,e),e.emit("always",e),e.jqDeferred){var n=e.hasAnyBroken?"reject":"resolve";e.jqDeferred[n](e)}})},c&&(c.fn.imagesLoaded=function(t,e){var n=new s(this,t,e);return n.jqDeferred.promise(c(this))}),a.prototype=new e,a.prototype.check=function(){var t=h[this.img.src]||new u(this.img.src);if(t.isConfirmed)return void this.confirm(t.isLoaded,"cached was confirmed");if(this.img.complete&&void 0!==this.img.naturalWidth)return void this.confirm(0!==this.img.naturalWidth,"naturalWidth");var e=this;t.on("confirm",function(t,n){return e.confirm(t.isLoaded,n),!0}),t.check()},a.prototype.confirm=function(t,e){this.isLoaded=t,this.emit("confirm",this,e)};var h={};return u.prototype=new e,u.prototype.check=function(){if(!this.isChecked){var t=new Image;n.bind(t,"load",this),n.bind(t,"error",this),t.src=this.src,this.isChecked=!0}},u.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},u.prototype.onload=function(t){this.confirm(!0,"onload"),this.unbindProxyEvents(t)},u.prototype.onerror=function(t){this.confirm(!1,"onerror"),this.unbindProxyEvents(t)},u.prototype.confirm=function(t,e){this.isConfirmed=!0,this.isLoaded=t,this.emit("confirm",this,e)},u.prototype.unbindProxyEvents=function(t){n.unbind(t.target,"load",this),n.unbind(t.target,"error",this)},s}),function($){"use strict";function t(t,e,n,i,r){var o={url:spuvar.ajax_url,data:t,cache:!1,type:"POST",dataType:"json",timeout:3e4},r=r||!1,n=n||!1,i=i||!1;e&&(o.url=e),n&&(o.success=n),i&&(o.error=i),r&&(o.dataType=r),$.ajax(o)}function e(t,e,n){if(n){var i=new Date;i.setTime(i.getTime()+24*n*60*60*1e3);var r="; expires="+i.toGMTString()}else var r="";document.cookie=t+"="+e+r+"; path=/"}function n(t){for(var e=t+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var r=n[i];" "==r.charAt(0);)r=r.substring(1,r.length);if(0==r.indexOf(e))return r.substring(e.length,r.length)}return null}function i(){try{FB.Event.subscribe("edge.create",function(t,e){var n=$(e).parents(".spu-box").data("box-id");n&&SPU.hide(n)})}catch(t){}h=!0,clearInterval(l)}function r(t){var e=$(t.target).parents(".spu-box").data("box-id");e&&SPU.hide(e)}function o(t){if("on"==t.state){var e=jQuery(".spu-gogl").data("box-id");e&&SPU.hide(e)}}function s(t){if("confirm"==t.type){var e=jQuery(".spu-gogl").data("box-id");e&&SPU.hide(e)}}function a(){if(spuvar_social.facebook)try{FB.XFBML.parse()}catch(t){}if(spuvar_social.google)try{gapi.plusone.go()}catch(t){}if(spuvar_social.twitter)try{twttr.widgets.load()}catch(t){}}function u(){$(".spu-box form").each(function(){var t=$(this).attr("action");t&&$(this).attr("action",t.replace("?spu_action=spu_load",""))}),$.fn.wpcf7InitForm&&$(".spu-box div.wpcf7 > form").wpcf7InitForm()}var c=function(){function i(t){var e=f[t],n=$(window).width(),i=$(window).height(),r=e.outerHeight(),o=e.outerWidth(),s=e.data("width"),a=0,u=i/2-r/2,c="fixed",d=$(document).scrollTop();e.hasClass("spu-centered")&&(n>s&&(a=n/2-o/2),e.css({left:a,position:c,top:u})),r+50>i&&(c="absolute",u=d,e.css({position:c,top:u,bottom:"auto"}))}function r(t){var e=$(t).find(".spu-facebook");if(e.length){var n=e.find(".fb-like > span").width();if(0==n){var i=e.find(".fb-like").data("layout");"box_count"==i?e.append('<style type="text/css"> #'+$(t).attr("id")+" .fb-like iframe, #"+$(t).attr("id")+" .fb_iframe_widget span, #"+$(t).attr("id")+" .fb_iframe_widget{ height: 63px !important;width: 80px !important;}</style>"):e.append('<style type="text/css"> #'+$(t).attr("id")+" .fb-like iframe, #"+$(t).attr("id")+" .fb_iframe_widget span, #"+$(t).attr("id")+" .fb_iframe_widget{ height: 20px !important;width: 80px !important;}</style>")}}}function o(t){var e=t,n=e.data("total");if(n){a();var i=0,r=0,o=e.outerWidth(),s=e.find(".spu-content").width();!spuvar.disable_style&&$(window).width()>o&&(e.find(".spu-shortcode").wrapAll('<div class="spu_shortcodes"/>'),e.find(".spu-shortcode").each(function(){i+=$(this).outerWidth()}),r=s-i-20*n),r>0&&(e.find(".spu-shortcode").each(function(){$(this).css("margin-left",r/2)}),2==n?e.find(".spu-shortcode").last().css("margin-left",0):3==n&&e.find(".spu-shortcode").first().css("margin-left",0))}}function s(t,n,r){var s=f[t],a=$("#spu-bg-"+t),u=s.data("bgopa");if(s.is(":animated"))return!1;if(n===!0&&s.is(":visible")||n===!1&&s.is(":hidden"))return!1;if(n===!1){var c=parseInt(s.data("cookie"));c>0&&e("spu_box_"+t,!0,c),s.trigger("spu.box_close",[t])}else setTimeout(function(){o(s)},1500),s.trigger("spu.box_open",[t]),$(window).resize(function(){i(t)}),i(t);var d=s.data("spuanimation"),p=s.data("close-on-conversion");return"fade"===d?n===!0?s.fadeIn("slow"):n===!1&&(p&&r||!r)&&s.fadeOut("slow"):n===!0?s.slideDown("slow"):n===!1&&(p&&r||!r)&&s.slideUp("slow"),n===!0&&u>0?a.fadeIn():n===!1&&(p&&r||!r)&&a.fadeOut(),n}var u=$(window).height(),c=spuvar.is_admin,f=[];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(){spuvar.safe_mode&&$(this).prependTo("body");var e=$(this),i=e.data("trigger"),o=0,a=1===parseInt(e.data("test-mode")),d=e.data("box-id"),p=1===parseInt(e.data("auto-hide")),h=parseInt(e.data("seconds-close")),l=parseInt(e.data("trigger-number"),10),m="percentage"==i?parseInt(e.data("trigger-number"),10)/100:.8,v=m*$(document).height();r(e),$(document).keyup(function(t){27==t.keyCode&&s(d,!1,!1)});var g=navigator.userAgent,y=g.match(/iPad/i)||g.match(/iPhone/i)?"touchstart":"click";$("body").on(y,function(t){void 0!==t.originalEvent&&s(d,!1,!1)}),$("body").on(y,".spu-box",function(t){t.stopPropagation()}),e.hide().css("left",""),f[d]=e;var w=function(){o&&clearTimeout(o),o=window.setTimeout(function(){var t=$(window).scrollTop(),e=t+u>=v;e?(p||$(window).unbind("scroll",w),s(d,!0,!1)):s(d,!1,!1)},100)},b=function(){o&&clearTimeout(o),o=window.setTimeout(function(){s(d,!0,!1)},1e3*l)},_=n("spu_box_"+d);if((void 0==_||""==_||c&&a)&&("seconds"==i?b():($(window).bind("scroll",w),w()),window.location.hash&&window.location.hash.length>0)){var E=window.location.hash,x;E.substring(1)===e.attr("id")&&setTimeout(function(){s(d,!0,!1)},100)}e.on("click",".spu-close-popup",function(){s(d,!1,!1),"percentage"==i&&$(window).unbind("scroll",w)}),$('a[href="#spu-'+d+'"]').on("click",function(t){t.preventDefault(),s(d,!0,!1)}).css("cursor","pointer").addClass("spu-clickable"),e.find(".gform_wrapper form").addClass("gravity-form");var L=e.find("form");if(L.length){if(!L.is(".wpcf7-form, .gravity-form, .infusion-form, .widget_wysija")){var j=L.attr("action"),k=new RegExp(spuvar.site_url,"i");j&&j.length&&(k.test(j)||L.addClass("spu-disable-ajax"))}e.on("submit","form.spu-disable-ajax",function(){e.trigger("spu.form_submitted",[d]),s(d,!1,!0)}),e.on("submit",'form:not(".wpcf7-form, .gravity-form, .infusion-form, .spu-disable-ajax, .widget_wysija")',function(n){n.preventDefault();var i=!0,r=$(this),o=r.serialize(),a=r.attr("action"),u=function(t,e,n){console.log("Spu Form error: "+e+" - "+n)},c=function(t){var e=$(t).filter("#spu-"+d).html();$("#spu-"+d).html(e),$("#spu-"+d).find(".mc4wp-form-error").length||setTimeout(function(){s(d,!1,!0)},1e3*spuvar.seconds_confirmation_close)};return t(o,a,c,u,"html"),e.trigger("spu.form_submitted",[d]),i}),$("body").on("mailsent.wpcf7",function(){e.trigger("spu.form_submitted",[d]),s(d,!1,!0)}),$(document).on("gform_confirmation_loaded",function(){e.trigger("spu.form_submitted",[d]),s(d,!1,!0)}),e.on("submit",".infusion-form",function(t){t.preventDefault(),e.trigger("spu.form_submitted",[d]),s(d,!1,!0),this.submit()})}}),{show:function(t){return s(t,!0,!1)},hide:function(t){return s(t,!1,!1)},request:function(e,n,i,r){return t(e,n,i,r)}}};if(spuvar.ajax_mode){var f={pid:spuvar.pid,referrer:document.referrer,is_category:spuvar.is_category,is_archive:spuvar.is_archive},d=function(t){$("body").append(t),$(".spu-box").imagesLoaded(function(){window.SPU=c(),u()})},p=function(t,e,n){console.log("Problem loading popups - error: "+e+" - "+n)};t(f,spuvar.ajax_mode_url,d,p,"html")}else $(".spu-box").imagesLoaded(function(){window.SPU=c()});var h=!1,l=setInterval(function(){"undefined"==typeof FB||h||i()},1e3);if("undefined"!=typeof twttr)try{twttr.ready(function(t){t.events.bind("tweet",r),t.events.bind("follow",r)})}catch(m){}}(jQuery);
1
+ (function(){function t(){}function e(t,e){for(var n=t.length;n--;)if(t[n].listener===e)return n;return-1}function n(t){return function(){return this[t].apply(this,arguments)}}var i=t.prototype,r=this,o=r.EventEmitter;i.getListeners=function(t){var e,n,i=this._getEvents();if("object"==typeof t){e={};for(n in i)i.hasOwnProperty(n)&&t.test(n)&&(e[n]=i[n])}else e=i[t]||(i[t]=[]);return e},i.flattenListeners=function(t){var e,n=[];for(e=0;t.length>e;e+=1)n.push(t[e].listener);return n},i.getListenersAsObject=function(t){var e,n=this.getListeners(t);return n instanceof Array&&(e={},e[t]=n),e||n},i.addListener=function(t,n){var i,r=this.getListenersAsObject(t),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===e(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(t){return this.getListeners(t),this},i.defineEvents=function(t){for(var e=0;t.length>e;e+=1)this.defineEvent(t[e]);return this},i.removeListener=function(t,n){var i,r,o=this.getListenersAsObject(t);for(r in o)o.hasOwnProperty(r)&&(i=e(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},i.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},i.manipulateListeners=function(t,e,n){var i,r,o=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(i=n.length;i--;)o.call(this,e,n[i]);else for(i in e)e.hasOwnProperty(i)&&(r=e[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(t){var e,n=typeof t,i=this._getEvents();if("string"===n)delete i[t];else if("object"===n)for(e in i)i.hasOwnProperty(e)&&t.test(e)&&delete i[e];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(t,e){var n,i,r,o,s=this.getListenersAsObject(t);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(t,n.listener),o=n.listener.apply(this,e||[]),o===this._getOnceReturnValue()&&this.removeListener(t,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},i.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return r.EventEmitter=o,t},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return t}):"object"==typeof module&&module.exports?module.exports=t:this.EventEmitter=t}).call(this),function(t){function e(e){var n=t.event;return n.target=n.target||n.srcElement||e,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(t,e,n){t.addEventListener(e,n,!1)}:n.attachEvent&&(i=function(t,n,i){t[n+i]=i.handleEvent?function(){var n=e(t);i.handleEvent.call(i,n)}:function(){var n=e(t);i.call(t,n)},t.attachEvent("on"+n,t[n+i])});var r=function(){};n.removeEventListener?r=function(t,e,n){t.removeEventListener(e,n,!1)}:n.detachEvent&&(r=function(t,e,n){t.detachEvent("on"+e,t[e+n]);try{delete t[e+n]}catch(i){t[e+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):t.eventie=o}(this),function(t,e){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return e(t,n,i)}):"object"==typeof exports?module.exports=e(t,require("wolfy87-eventemitter"),require("eventie")):t.imagesLoaded=e(t,t.EventEmitter,t.eventie)}(window,function(t,e,n){function i(t,e){for(var n in e)t[n]=e[n];return t}function r(t){return"[object Array]"===p.call(t)}function o(t){var e=[];if(r(t))e=t;else if("number"==typeof t.length)for(var n=0,i=t.length;i>n;n++)e.push(t[n]);else e.push(t);return e}function s(t,e,n){if(!(this instanceof s))return new s(t,e);"string"==typeof t&&(t=document.querySelectorAll(t)),this.elements=o(t),this.options=i({},this.options),"function"==typeof e?n=e:i(this.options,e),n&&this.on("always",n),this.getImages(),c&&(this.jqDeferred=new c.Deferred);var r=this;setTimeout(function(){r.check()})}function a(t){this.img=t}function u(t){this.src=t,h[t]=this}var c=t.jQuery,f=t.console,d=void 0!==f,p=Object.prototype.toString;s.prototype=new e,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var t=0,e=this.elements.length;e>t;t++){var n=this.elements[t];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){var a=r[o];this.addImage(a)}}},s.prototype.addImage=function(t){var e=new a(t);this.images.push(e)},s.prototype.check=function(){function t(t,r){return e.options.debug&&d&&f.log("confirm",t,r),e.progress(t),n++,n===i&&e.complete(),!0}var e=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return void this.complete();for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",t),o.check()}},s.prototype.progress=function(t){this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded;var e=this;setTimeout(function(){e.emit("progress",e,t),e.jqDeferred&&e.jqDeferred.notify&&e.jqDeferred.notify(e,t)})},s.prototype.complete=function(){var t=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var e=this;setTimeout(function(){if(e.emit(t,e),e.emit("always",e),e.jqDeferred){var n=e.hasAnyBroken?"reject":"resolve";e.jqDeferred[n](e)}})},c&&(c.fn.imagesLoaded=function(t,e){var n=new s(this,t,e);return n.jqDeferred.promise(c(this))}),a.prototype=new e,a.prototype.check=function(){var t=h[this.img.src]||new u(this.img.src);if(t.isConfirmed)return void this.confirm(t.isLoaded,"cached was confirmed");if(this.img.complete&&void 0!==this.img.naturalWidth)return void this.confirm(0!==this.img.naturalWidth,"naturalWidth");var e=this;t.on("confirm",function(t,n){return e.confirm(t.isLoaded,n),!0}),t.check()},a.prototype.confirm=function(t,e){this.isLoaded=t,this.emit("confirm",this,e)};var h={};return u.prototype=new e,u.prototype.check=function(){if(!this.isChecked){var t=new Image;n.bind(t,"load",this),n.bind(t,"error",this),t.src=this.src,this.isChecked=!0}},u.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},u.prototype.onload=function(t){this.confirm(!0,"onload"),this.unbindProxyEvents(t)},u.prototype.onerror=function(t){this.confirm(!1,"onerror"),this.unbindProxyEvents(t)},u.prototype.confirm=function(t,e){this.isConfirmed=!0,this.isLoaded=t,this.emit("confirm",this,e)},u.prototype.unbindProxyEvents=function(t){n.unbind(t.target,"load",this),n.unbind(t.target,"error",this)},s}),function($){"use strict";function t(t,e,n,i,r){var o={url:spuvar.ajax_url,data:t,cache:!1,type:"POST",dataType:"json",timeout:3e4},r=r||!1,n=n||!1,i=i||!1;e&&(o.url=e),n&&(o.success=n),i&&(o.error=i),r&&(o.dataType=r),$.ajax(o)}function e(t,e,n){if(n){var i=new Date;i.setTime(i.getTime()+24*n*60*60*1e3);var r="; expires="+i.toGMTString()}else var r="";document.cookie=t+"="+e+r+"; path=/"}function n(t){for(var e=t+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var r=n[i];" "==r.charAt(0);)r=r.substring(1,r.length);if(0==r.indexOf(e))return r.substring(e.length,r.length)}return null}function i(){try{FB.Event.subscribe("edge.create",function(t,e){var n=$(e).parents(".spu-box").data("box-id");n&&SPU.hide(n)})}catch(t){}h=!0,clearInterval(l)}function r(t){var e=$(t.target).parents(".spu-box").data("box-id");e&&SPU.hide(e)}function o(t){if("on"==t.state){var e=jQuery(".spu-gogl").data("box-id");e&&SPU.hide(e)}}function s(t){if("confirm"==t.type){var e=jQuery(".spu-gogl").data("box-id");e&&SPU.hide(e)}}function a(){if(spuvar_social.facebook)try{FB.XFBML.parse()}catch(t){}if(spuvar_social.google)try{gapi.plusone.go()}catch(t){}if(spuvar_social.twitter)try{twttr.widgets.load()}catch(t){}}function u(){$(".spu-box form").each(function(){var t=$(this).attr("action");t&&$(this).attr("action",t.replace("?spu_action=spu_load",""))}),$.fn.wpcf7InitForm&&$(".spu-box div.wpcf7 > form").wpcf7InitForm()}var c=function(){function i(t){var e=f[t],n=$(window).width(),i=$(window).height(),r=e.outerHeight(),o=e.outerWidth(),s=e.data("width"),a=0,u=i/2-r/2,c="fixed",d=$(document).scrollTop();e.hasClass("spu-centered")&&(n>s&&(a=n/2-o/2),e.css({left:a,position:c,top:u})),r+50>i&&(c="absolute",u=d,e.css({position:c,top:u,bottom:"auto"}))}function r(t){var e=$(t).find(".spu-facebook");if(e.length){var n=e.find(".fb-like > span").width();if(0==n){var i=e.find(".fb-like").data("layout");"box_count"==i?e.append('<style type="text/css"> #'+$(t).attr("id")+" .fb-like iframe, #"+$(t).attr("id")+" .fb_iframe_widget span, #"+$(t).attr("id")+" .fb_iframe_widget{ height: 63px !important;width: 80px !important;}</style>"):e.append('<style type="text/css"> #'+$(t).attr("id")+" .fb-like iframe, #"+$(t).attr("id")+" .fb_iframe_widget span, #"+$(t).attr("id")+" .fb_iframe_widget{ height: 20px !important;width: 80px !important;}</style>")}}}function o(t){var e=t,n=e.data("total");if(n){a();var i=0,r=0,o=e.outerWidth(),s=e.find(".spu-content").width();!spuvar.disable_style&&$(window).width()>o&&(e.find(".spu-shortcode").wrapAll('<div class="spu_shortcodes"/>'),e.find(".spu-shortcode").each(function(){i+=$(this).outerWidth()}),r=s-i-20*n),r>0&&(e.find(".spu-shortcode").each(function(){$(this).css("margin-left",r/2)}),2==n?e.find(".spu-shortcode").last().css("margin-left",0):3==n&&e.find(".spu-shortcode").first().css("margin-left",0))}}function s(t,n,r){var s=f[t],a=$("#spu-bg-"+t),u=s.data("bgopa");if(s.is(":animated"))return!1;if(n===!0&&s.is(":visible")||n===!1&&s.is(":hidden"))return!1;if(n===!1){var c=parseInt(s.data("cookie"));c>0&&e("spu_box_"+t,!0,c),s.trigger("spu.box_close",[t])}else setTimeout(function(){o(s)},1500),s.trigger("spu.box_open",[t]),$(window).resize(function(){i(t)}),i(t);var d=s.data("spuanimation"),p=s.data("close-on-conversion");return"fade"===d?n===!0?s.fadeIn("slow"):n===!1&&(p&&r||!r)&&s.fadeOut("slow"):n===!0?s.slideDown("slow"):n===!1&&(p&&r||!r)&&s.slideUp("slow"),n===!0&&u>0?a.fadeIn():n===!1&&(p&&r||!r)&&a.fadeOut(),n}var u=$(window).height(),c=spuvar.is_admin,f=[];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(){spuvar.safe_mode&&$(this).prependTo("body");var e=$(this),i=e.data("trigger"),o=0,a=1===parseInt(e.data("test-mode")),d=e.data("box-id"),p=1===parseInt(e.data("auto-hide")),h=parseInt(e.data("seconds-close")),l=parseInt(e.data("trigger-number"),10),m="percentage"==i?parseInt(e.data("trigger-number"),10)/100:.8,v=m*$(document).height();r(e),e.on("click",'a:not(".spu-close-popup")',function(){s(d,!1,!0)}),$(document).keyup(function(t){27==t.keyCode&&s(d,!1,!1)});var g=navigator.userAgent,y=g.match(/iPad/i)||g.match(/iPhone/i)?"touchstart":"click";$("body").on(y,function(t){void 0!==t.originalEvent&&s(d,!1,!1)}),$("body").on(y,".spu-box,.spu-clickable",function(t){t.stopPropagation()}),e.hide().css("left",""),f[d]=e;var b=function(){o&&clearTimeout(o),o=window.setTimeout(function(){var t=$(window).scrollTop(),e=t+u>=v;e?(p||$(window).unbind("scroll",b),s(d,!0,!1)):s(d,!1,!1)},100)},w=function(){o&&clearTimeout(o),o=window.setTimeout(function(){s(d,!0,!1)},1e3*l)},_=n("spu_box_"+d);if((void 0==_||""==_||c&&a)&&("seconds"==i&&w(),"percentage"==i&&($(window).bind("scroll",b),b()),window.location.hash&&window.location.hash.length>0)){var x=window.location.hash,E;x.substring(1)===e.attr("id")&&setTimeout(function(){s(d,!0,!1)},100)}e.on("click",".spu-close-popup",function(){s(d,!1,!1),"percentage"==i&&$(window).unbind("scroll",b)}),$('a[href="#spu-'+d+'"]').on("click",function(t){t.preventDefault(),s(d,!0,!1)}).css("cursor","pointer").addClass("spu-clickable"),e.find(".gform_wrapper form").addClass("gravity-form");var L=e.find("form");if(L.length){if(!L.is(".wpcf7-form, .gravity-form, .infusion-form, .widget_wysija, .ninja-forms-form")){var j=L.attr("action"),k=new RegExp(spuvar.site_url,"i");j&&j.length&&(k.test(j)||L.addClass("spu-disable-ajax"))}$(".spu-disable-ajax form").length&&$(".spu-disable-ajax form").addClass("spu-disable-ajax"),e.on("submit","form.spu-disable-ajax",function(){e.trigger("spu.form_submitted",[d]),s(d,!1,!0)}),e.on("submit",'form:not(".wpcf7-form, .gravity-form, .infusion-form, .spu-disable-ajax, .widget_wysija, .ninja-forms-form")',function(n){n.preventDefault();var i=!0,r=$(this),o=r.serialize(),a=r.attr("action"),u=function(t,e,n){console.log("Spu Form error: "+e+" - "+n)},c=function(t){var e=$(t).filter("#spu-"+d).html();$("#spu-"+d).html(e),$("#spu-"+d).find(".mc4wp-form-error").length||setTimeout(function(){s(d,!1,!0)},1e3*spuvar.seconds_confirmation_close)};return t(o,a,c,u,"html"),e.trigger("spu.form_submitted",[d]),i}),$("body").on("mailsent.wpcf7",function(){e.trigger("spu.form_submitted",[d]),s(d,!1,!0)}),$(document).on("gform_confirmation_loaded",function(){e.trigger("spu.form_submitted",[d]),s(d,!1,!0)}),e.on("submit",".infusion-form",function(t){t.preventDefault(),e.trigger("spu.form_submitted",[d]),s(d,!1,!0),this.submit()})}}),{show:function(t){return s(t,!0,!1)},hide:function(t){return s(t,!1,!1)},request:function(e,n,i,r){return t(e,n,i,r)}}};if(spuvar.ajax_mode){var f={pid:spuvar.pid,referrer:document.referrer,is_category:spuvar.is_category,is_archive:spuvar.is_archive},d=function(t){$("body").append(t),$(".spu-box").imagesLoaded(function(){window.SPU=c(),u()})},p=function(t,e,n){console.log("Problem loading popups - error: "+e+" - "+n)};t(f,spuvar.ajax_mode_url,d,p,"html")}else $(".spu-box").imagesLoaded(function(){window.SPU=c()});var h=!1,l=setInterval(function(){"undefined"==typeof FB||h||i()},1e3);if("undefined"!=typeof twttr)try{twttr.ready(function(t){t.events.bind("tweet",r),t.events.bind("follow",r)})}catch(m){}}(jQuery);
public/assets/js/public.js CHANGED
@@ -47,7 +47,11 @@ var SPU_master = function() {
47
 
48
  facebookFix( $box );
49
 
50
-
 
 
 
 
51
  //close with esc
52
  $(document).keyup(function(e) {
53
  if (e.keyCode == 27) {
@@ -67,7 +71,7 @@ var SPU_master = function() {
67
  }
68
  });
69
  //not on the box
70
- $('body' ).on(event,'.spu-box', function(event) {
71
  event.stopPropagation();
72
  });
73
 
@@ -124,7 +128,8 @@ var SPU_master = function() {
124
 
125
  if(triggerMethod == 'seconds') {
126
  triggerSecondsCheck();
127
- } else {
 
128
  $(window).bind( 'scroll', triggerHeightCheck );
129
  // init, check box criteria once
130
  triggerHeightCheck();
@@ -169,7 +174,7 @@ var SPU_master = function() {
169
  var box_form = $box.find('form');
170
  if( box_form.length ) {
171
  // Only if form is not a known one disable ajax
172
- if( ! box_form.is(".wpcf7-form, .gravity-form, .infusion-form, .widget_wysija") ) {
173
  var action = box_form.attr('action'),
174
  pattern = new RegExp(spuvar.site_url, "i");
175
  if (action && action.length) {
@@ -177,7 +182,10 @@ var SPU_master = function() {
177
  box_form.addClass('spu-disable-ajax');
178
  }
179
  }
180
-
 
 
 
181
  // Disable ajax on form by adding .spu-disable-ajax class to it
182
  $box.on('submit','form.spu-disable-ajax', function(){
183
 
@@ -186,7 +194,7 @@ var SPU_master = function() {
186
  });
187
 
188
  // Add generic form tracking
189
- $box.on('submit','form:not(".wpcf7-form, .gravity-form, .infusion-form, .spu-disable-ajax, .widget_wysija")', function(e){
190
  e.preventDefault();
191
 
192
 
47
 
48
  facebookFix( $box );
49
 
50
+ // Custom links conversion
51
+ $box.on('click', 'a:not(".spu-close-popup")', function(){
52
+ // hide the popup and track conversion
53
+ toggleBox( id, false, true);
54
+ });
55
  //close with esc
56
  $(document).keyup(function(e) {
57
  if (e.keyCode == 27) {
71
  }
72
  });
73
  //not on the box
74
+ $('body' ).on(event,'.spu-box,.spu-clickable', function(event) {
75
  event.stopPropagation();
76
  });
77
 
128
 
129
  if(triggerMethod == 'seconds') {
130
  triggerSecondsCheck();
131
+ }
132
+ if(triggerMethod == 'percentage'){
133
  $(window).bind( 'scroll', triggerHeightCheck );
134
  // init, check box criteria once
135
  triggerHeightCheck();
174
  var box_form = $box.find('form');
175
  if( box_form.length ) {
176
  // Only if form is not a known one disable ajax
177
+ if( ! box_form.is(".wpcf7-form, .gravity-form, .infusion-form, .widget_wysija, .ninja-forms-form") ) {
178
  var action = box_form.attr('action'),
179
  pattern = new RegExp(spuvar.site_url, "i");
180
  if (action && action.length) {
182
  box_form.addClass('spu-disable-ajax');
183
  }
184
  }
185
+ // if spu-disable-ajax is on container add it to form (usp forms for example)
186
+ if( $('.spu-disable-ajax form').length ) {
187
+ $('.spu-disable-ajax form').addClass('spu-disable-ajax');
188
+ }
189
  // Disable ajax on form by adding .spu-disable-ajax class to it
190
  $box.on('submit','form.spu-disable-ajax', function(){
191
 
194
  });
195
 
196
  // Add generic form tracking
197
+ $box.on('submit','form:not(".wpcf7-form, .gravity-form, .infusion-form, .spu-disable-ajax, .widget_wysija, .ninja-forms-form")', function(e){
198
  e.preventDefault();
199
 
200
 
public/class-social-popup.php CHANGED
@@ -339,16 +339,18 @@ class SocialPopup {
339
  public function register_scripts() {
340
 
341
  $js_url = plugins_url( 'assets/js/min/public-min.js', __FILE__ );
 
342
 
343
  $opts = $this->spu_settings;
344
 
345
  if( defined( 'SPU_DEBUG_MODE' ) || !empty( $opts['debug'] ) ) {
346
  $js_url = plugins_url( 'assets/js/public.js', __FILE__ );
 
347
  }
348
 
349
  wp_register_style( 'spu-public-css', plugins_url( 'assets/css/public.css', __FILE__ ), array(), self::VERSION );
350
 
351
- wp_register_script( 'spu-public', $js_url, array( 'jquery' ), self::VERSION, true );
352
 
353
  wp_register_script( 'spu-facebook', '//connect.facebook.net/'.get_locale().'/sdk.js#xfbml=1&version=v2.3', array('jquery'), null, FALSE);
354
 
@@ -408,15 +410,21 @@ class SocialPopup {
408
  * @since 1.3
409
  */
410
  public function enqueue_scripts() {
 
411
 
 
 
 
 
 
412
  wp_enqueue_script('spu-public');
413
  wp_enqueue_style('spu-public-css');
414
- wp_localize_script( 'spu-public', 'spuvar',
415
  array(
416
  'is_admin' => current_user_can( 'administrator' ),
417
- 'disable_style' => isset( $this->spu_settings['shortcodes_style'] ) ? $this->spu_settings['shortcodes_style'] : '',
418
- 'safe_mode' => isset( $this->spu_settings['safe'] ) ? $this->spu_settings['safe'] : '',
419
- 'ajax_mode' => isset( $this->spu_settings['ajax_mode'] ) ? $this->spu_settings['ajax_mode'] :'',
420
  'ajax_url' => admin_url('admin-ajax.php'),
421
  'ajax_mode_url' => site_url('/?spu_action=spu_load&lang='.$this->info['wpml_lang']),
422
  'pid' => get_queried_object_id(),
@@ -437,6 +445,7 @@ class SocialPopup {
437
  private function enqueue_social_shortcodes(){
438
  global $wpdb,$spuvar_social;
439
 
 
440
  $spuvar_social = '';
441
 
442
  // Check if defined or remove js in options
339
  public function register_scripts() {
340
 
341
  $js_url = plugins_url( 'assets/js/min/public-min.js', __FILE__ );
342
+ $handle = 'spu-public';
343
 
344
  $opts = $this->spu_settings;
345
 
346
  if( defined( 'SPU_DEBUG_MODE' ) || !empty( $opts['debug'] ) ) {
347
  $js_url = plugins_url( 'assets/js/public.js', __FILE__ );
348
+ $handle = 'spu-public-debug';
349
  }
350
 
351
  wp_register_style( 'spu-public-css', plugins_url( 'assets/css/public.css', __FILE__ ), array(), self::VERSION );
352
 
353
+ wp_register_script( $handle, $js_url, array( 'jquery' ), self::VERSION, true );
354
 
355
  wp_register_script( 'spu-facebook', '//connect.facebook.net/'.get_locale().'/sdk.js#xfbml=1&version=v2.3', array('jquery'), null, FALSE);
356
 
410
  * @since 1.3
411
  */
412
  public function enqueue_scripts() {
413
+ $handle = 'spu-public';
414
 
415
+ $opts = $this->spu_settings;
416
+
417
+ if( defined( 'SPU_DEBUG_MODE' ) || !empty( $opts['debug'] ) ) {
418
+ $handle = 'spu-public-debug';
419
+ }
420
  wp_enqueue_script('spu-public');
421
  wp_enqueue_style('spu-public-css');
422
+ wp_localize_script( $handle, 'spuvar',
423
  array(
424
  'is_admin' => current_user_can( 'administrator' ),
425
+ 'disable_style' => isset( $this->spu_settings['shortcodes_style'] ) ? esc_attr( $this->spu_settings['shortcodes_style'] ) : '',
426
+ 'safe_mode' => isset( $this->spu_settings['safe'] ) ? esc_attr( $this->spu_settings['safe'] ) : '',
427
+ 'ajax_mode' => isset( $this->spu_settings['ajax_mode'] ) ? esc_attr( $this->spu_settings['ajax_mode'] ) :'',
428
  'ajax_url' => admin_url('admin-ajax.php'),
429
  'ajax_mode_url' => site_url('/?spu_action=spu_load&lang='.$this->info['wpml_lang']),
430
  'pid' => get_queried_object_id(),
445
  private function enqueue_social_shortcodes(){
446
  global $wpdb,$spuvar_social;
447
 
448
+ $opts = $this->spu_settings;
449
  $spuvar_social = '';
450
 
451
  // Check if defined or remove js in options
uninstall.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Uninstall file. If selected all data from popups plugin will be deleted
4
+ */
5
+ if( !defined( 'ABSPATH') && !defined('WP_UNINSTALL_PLUGIN') ) exit();
6
+
7
+ $opts = get_option( 'spu_settings' );
8
+
9
+ if( isset( $opts['unistall']) && '1' == $opts['unistall'] ) {
10
+ // delete settings
11
+ delete_option('spu_settings');
12
+ delete_option('spu-version');
13
+ // delete popups
14
+ global $wpdb;
15
+ // IF wpml is active and spucpt is translated get correct ids for language
16
+ $ids = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type='spucpt'");
17
+ if( !empty( $ids ) ) {
18
+ foreach( $ids as $p ) {
19
+ wp_delete_post( $p->ID, true);
20
+ }
21
+ }
22
+ }