Version Description
- Added support for postmatic forms
- Fixed Centering of shortcodes
- Added new facebook page shortcode
Download this release
Release Info
Developer | timersys |
Plugin | Popups – WordPress Popup |
Version | 1.3.2 |
Comparing to | |
See all releases |
Code changes from version 1.3.1.2 to 1.3.2
- README.txt +11 -5
- admin/views/metaboxes/metabox-help.php +13 -0
- admin/views/metaboxes/metabox-premium.php +2 -1
- popups.php +3 -3
- public/assets/css/public.css +7 -1
- public/class-social-popup.php +28 -4
- public/{assets/js → js}/index.php +0 -0
- public/{assets/js → js}/min/public-min.js +1 -1
- public/{assets/js → js}/public.js +106 -99
README.txt
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
=== Popups - WordPress Popup ===
|
2 |
Contributors: timersys
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=K4T6L69EV9G2Q
|
4 |
-
Tags: twitter,google+, facebook,Popups, twitter follow, facebook like, google plus,social boost, social splash,
|
5 |
Requires at least: 3.6
|
6 |
Tested up to: 4.2.2
|
7 |
-
Stable tag: 1.3.
|
8 |
Text Domain: spu
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
12 |
-
Most complete free Popups plugin, scroll triggered popups, compatible with social networks, Gravity Forms, Ninja Forms, Contact form 7, etc
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
|
17 |
The new Popups plugin can display multiple popups. Is the perfect solution to increase your social followers, your mailing lists by adding a form like mailchimp or to display any important message in a simple popup.
|
18 |
|
19 |
-
It's compatible with the major form plugins like : Gravity Forms, Ninja Forms, Contact form 7,
|
20 |
|
21 |
There are multiple display filters that can be combined:
|
22 |
|
@@ -48,7 +48,8 @@ There are multiple display filters that can be combined:
|
|
48 |
>
|
49 |
> Check the **new premium version** available in ([https://wp.timersys.com/popups/](http://wp.timersys.com/popups/?utm_source=readme%20file&utm_medium=readme%20links&utm_campaign=Popups%20Premium))
|
50 |
>
|
51 |
-
> * Beautiful optin forms for popular mail providers like
|
|
|
52 |
> * Track impressions and Conversions of social networks and forms like CF7 or Gravity forms
|
53 |
> * Track impressions and Conversions in Google Analytics
|
54 |
> * 8 New animations effects
|
@@ -110,6 +111,11 @@ Yes if you need to debug you can use uncompressed javascript by addings ([this c
|
|
110 |
|
111 |
== Changelog ==
|
112 |
|
|
|
|
|
|
|
|
|
|
|
113 |
= 1.3.1.2 =
|
114 |
* Hotfix with problems in ajax mode. Sorry :)
|
115 |
* Added Imagesloaded library
|
1 |
=== Popups - WordPress Popup ===
|
2 |
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.2
|
8 |
Text Domain: spu
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
12 |
+
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
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
|
17 |
The new Popups plugin can display multiple popups. Is the perfect solution to increase your social followers, your mailing lists by adding a form like mailchimp or to display any important message in a simple popup.
|
18 |
|
19 |
+
It's compatible with the major form plugins like : Gravity Forms, Ninja Forms, Contact form 7, Jetpack, Mailpoet, Mailchimp for WP, Postmatic, etc
|
20 |
|
21 |
There are multiple display filters that can be combined:
|
22 |
|
48 |
>
|
49 |
> Check the **new premium version** available in ([https://wp.timersys.com/popups/](http://wp.timersys.com/popups/?utm_source=readme%20file&utm_medium=readme%20links&utm_campaign=Popups%20Premium))
|
50 |
>
|
51 |
+
> * Beautiful optin forms for popular mail providers like
|
52 |
+
> * Currently supporting MailChimp, Aweber, Postmatic, Mailpoet
|
53 |
> * Track impressions and Conversions of social networks and forms like CF7 or Gravity forms
|
54 |
> * Track impressions and Conversions in Google Analytics
|
55 |
> * 8 New animations effects
|
111 |
|
112 |
== Changelog ==
|
113 |
|
114 |
+
= 1.3.2 =
|
115 |
+
* Added support for postmatic forms
|
116 |
+
* Fixed Centering of shortcodes
|
117 |
+
* Added new facebook page shortcode
|
118 |
+
|
119 |
= 1.3.1.2 =
|
120 |
* Hotfix with problems in ajax mode. Sorry :)
|
121 |
* Added Imagesloaded library
|
admin/views/metaboxes/metabox-help.php
CHANGED
@@ -5,6 +5,19 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
5 |
|
6 |
<p><?php _e( 'You have three social shortcodes to use that will print a Facebook like, a Google+ Follow and a Twitter follow. Check the available options and <strong>configure them with your social accounts</strong>:', $this->plugin_slug );?></p>
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
<p><strong>Facebook:</strong></p>
|
9 |
<p>
|
10 |
[spu-facebook href="" layout="" show_faces="" share="" action="" width=""]
|
5 |
|
6 |
<p><?php _e( 'You have three social shortcodes to use that will print a Facebook like, a Google+ Follow and a Twitter follow. Check the available options and <strong>configure them with your social accounts</strong>:', $this->plugin_slug );?></p>
|
7 |
|
8 |
+
<p><strong>New Facebook page:</strong></p>
|
9 |
+
<p>
|
10 |
+
[spu-facebook-page href="" name="" show_faces="" hide_cover="" width=""]
|
11 |
+
</p>
|
12 |
+
<a href="fb-opts" onclick="jQuery('#fbpage-opts').slideToggle();return false;"><?php _e( 'View Facebook Page Options', $this->plugin_slug );?></a>
|
13 |
+
<ul id="fbpage-opts" style="display:none;">
|
14 |
+
<li><b>href:</b> <?php _e( 'Your facebook page url', $this->plugin_slug );?></li>
|
15 |
+
<li><b>name:</b> <?php _e( 'Your page name', $this->plugin_slug );?></li>
|
16 |
+
<li><b>show_faces:</b> <?php _e( 'true|false <b>Default value:</b> true', $this->plugin_slug );?></li>
|
17 |
+
<li><b>hide_cover:</b> <?php _e( 'true|false <b>Default value:</b> false', $this->plugin_slug );?></li>
|
18 |
+
<li><b>width:</b></li>
|
19 |
+
</ul>
|
20 |
+
|
21 |
<p><strong>Facebook:</strong></p>
|
22 |
<p>
|
23 |
[spu-facebook href="" layout="" show_faces="" share="" action="" width=""]
|
admin/views/metaboxes/metabox-premium.php
CHANGED
@@ -16,7 +16,8 @@ if($today > $blackbegin && $today < $blackend) : ?>
|
|
16 |
<p><?php _e( 'Take the best WordPress Popups plugin to the next level with Popups Premium extension.', $this->plugin_slug );?></p>
|
17 |
<h2><?php _e( 'Popups Premium Features:', $this->plugin_slug );?></h2>
|
18 |
<ul>
|
19 |
-
<li><?php _e( 'Beautiful optin forms for popular mail providers
|
|
|
20 |
<li><?php _e( 'Track impressions and Conversions of social likes and forms submissions like Contact Form 7, Gravity forms, etc', $this->plugin_slug );?></li>
|
21 |
<li><?php _e( 'Track impressions and Conversions also in Google Analytics', $this->plugin_slug );?></li>
|
22 |
<li><?php _e( 'Exit Intent technology', $this->plugin_slug );?></li>
|
16 |
<p><?php _e( 'Take the best WordPress Popups plugin to the next level with Popups Premium extension.', $this->plugin_slug );?></p>
|
17 |
<h2><?php _e( 'Popups Premium Features:', $this->plugin_slug );?></h2>
|
18 |
<ul>
|
19 |
+
<li><?php _e( 'Beautiful optin forms for popular mail providers', $this->plugin_slug );?></li>
|
20 |
+
<li><?php _e( 'Currently supporting MailChimp, Aweber, Postmatic, Mailpoet', $this->plugin_slug );?></li>
|
21 |
<li><?php _e( 'Track impressions and Conversions of social likes and forms submissions like Contact Form 7, Gravity forms, etc', $this->plugin_slug );?></li>
|
22 |
<li><?php _e( 'Track impressions and Conversions also in Google Analytics', $this->plugin_slug );?></li>
|
23 |
<li><?php _e( 'Exit Intent technology', $this->plugin_slug );?></li>
|
popups.php
CHANGED
@@ -11,8 +11,8 @@
|
|
11 |
* @socialpopup
|
12 |
* Plugin Name: Popups - WordPress Popup
|
13 |
* Plugin URI: http://www.timersys.com/free-plugins/social-popup/
|
14 |
-
* Version: 1.3.
|
15 |
-
* Description:
|
16 |
* Author: Damian Logghe
|
17 |
* Author URI: http://wp.timersys.com
|
18 |
* Text Domain: spu
|
@@ -30,7 +30,7 @@ if ( ! defined( 'WPINC' ) ) {
|
|
30 |
* Public-Facing Functionality
|
31 |
*----------------------------------------------------------------------------*/
|
32 |
|
33 |
-
define( 'SPU_VERSION' , '1.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.3.2
|
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
|
18 |
* Text Domain: spu
|
30 |
* Public-Facing Functionality
|
31 |
*----------------------------------------------------------------------------*/
|
32 |
|
33 |
+
define( 'SPU_VERSION' , '1.3.2' );
|
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/css/public.css
CHANGED
@@ -126,13 +126,19 @@ p.spu-powered a{
|
|
126 |
float: left;
|
127 |
line-height: normal !important;
|
128 |
}
|
|
|
|
|
|
|
|
|
129 |
.spu-shortcode iframe{
|
130 |
max-width: 1200px;
|
131 |
}
|
132 |
.spu_shortcodes{
|
133 |
zoom: 1;
|
134 |
}
|
135 |
-
|
|
|
|
|
136 |
.spu_shortcodes:before,
|
137 |
.spu_shortcodes:after { content: ""; display: table; }
|
138 |
.spu_shortcodes:after { clear: both; }
|
126 |
float: left;
|
127 |
line-height: normal !important;
|
128 |
}
|
129 |
+
.spu-facebook-page{
|
130 |
+
text-align: center;
|
131 |
+
display: block;
|
132 |
+
}
|
133 |
.spu-shortcode iframe{
|
134 |
max-width: 1200px;
|
135 |
}
|
136 |
.spu_shortcodes{
|
137 |
zoom: 1;
|
138 |
}
|
139 |
+
.spu-content .wysija-msg li{
|
140 |
+
list-style: none;
|
141 |
+
}
|
142 |
.spu_shortcodes:before,
|
143 |
.spu_shortcodes:after { content: ""; display: table; }
|
144 |
.spu_shortcodes:after { clear: both; }
|
public/class-social-popup.php
CHANGED
@@ -120,6 +120,7 @@ class SocialPopup {
|
|
120 |
|
121 |
//Register shortcodes
|
122 |
add_shortcode( 'spu-facebook', array( $this, 'facebook_shortcode' ) );
|
|
|
123 |
add_shortcode( 'spu-twitter', array( $this, 'twitter_shortcode' ) );
|
124 |
add_shortcode( 'spu-google', array( $this, 'google_shortcode' ) );
|
125 |
add_shortcode( 'spu-close', array( $this, 'close_shortcode' ) );
|
@@ -349,7 +350,7 @@ class SocialPopup {
|
|
349 |
|
350 |
wp_register_script( 'spu-public', $js_url, array( 'jquery' ), self::VERSION, true );
|
351 |
|
352 |
-
wp_register_script( 'spu-facebook', '//connect.facebook.net/'.get_locale().'/
|
353 |
|
354 |
wp_register_script( 'spu-twitter', '//platform.twitter.com/widgets.js', array('jquery'), self::VERSION, FALSE);
|
355 |
|
@@ -474,9 +475,8 @@ class SocialPopup {
|
|
474 |
|
475 |
//also include gravity forms if needed
|
476 |
if( $gf = $wpdb->get_var( "SELECT meta_value FROM $wpdb->postmeta WHERE meta_key ='spu_gravity' " ) ) {
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
}
|
481 |
}
|
482 |
|
@@ -516,6 +516,30 @@ class SocialPopup {
|
|
516 |
|
517 |
}
|
518 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
519 |
/**
|
520 |
* [twitter_shortcode description]
|
521 |
* @param string $content [description]
|
120 |
|
121 |
//Register shortcodes
|
122 |
add_shortcode( 'spu-facebook', array( $this, 'facebook_shortcode' ) );
|
123 |
+
add_shortcode( 'spu-facebook-page', array( $this, 'facebook_page_shortcode' ) );
|
124 |
add_shortcode( 'spu-twitter', array( $this, 'twitter_shortcode' ) );
|
125 |
add_shortcode( 'spu-google', array( $this, 'google_shortcode' ) );
|
126 |
add_shortcode( 'spu-close', array( $this, 'close_shortcode' ) );
|
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'), self::VERSION, FALSE);
|
354 |
|
355 |
wp_register_script( 'spu-twitter', '//platform.twitter.com/widgets.js', array('jquery'), self::VERSION, FALSE);
|
356 |
|
475 |
|
476 |
//also include gravity forms if needed
|
477 |
if( $gf = $wpdb->get_var( "SELECT meta_value FROM $wpdb->postmeta WHERE meta_key ='spu_gravity' " ) ) {
|
478 |
+
if( function_exists('gravity_form_enqueue_scripts'))
|
479 |
+
gravity_form_enqueue_scripts($gf, true);
|
|
|
480 |
}
|
481 |
}
|
482 |
|
516 |
|
517 |
}
|
518 |
|
519 |
+
/**
|
520 |
+
* Shortcode for facebook page
|
521 |
+
*
|
522 |
+
* @param $atts
|
523 |
+
* @param $content
|
524 |
+
*
|
525 |
+
* @internal param $ $content [description] $content [description]
|
526 |
+
* @internal param $atts [description] $atts [description]
|
527 |
+
* @return string [description]
|
528 |
+
*/
|
529 |
+
function facebook_page_shortcode( $atts, $content ) {
|
530 |
+
|
531 |
+
extract( shortcode_atts( array(
|
532 |
+
'href' => 'https://www.facebook.com/pages/Timersys/146687622031640',
|
533 |
+
'name' => 'Timersys',
|
534 |
+
'show_faces' => 'true', // false
|
535 |
+
'hide_cover' => 'false', // true
|
536 |
+
'width' => '500',
|
537 |
+
), $atts ) );
|
538 |
+
|
539 |
+
return '<div class="spu-facebook-page"><div class="fb-page" data-href="'. $href .'" data-width="'.strtolower( trim( $width ) ).'" data-hide-cover="'.strtolower( trim( $hide_cover ) ).'" data-show-facepile="'.strtolower( trim( $show_faces ) ).'" data-show-posts="false"><div class="fb-xfbml-parse-ignore"><blockquote cite="'. $href .'"><a href="'. $href .'">'.esc_attr( $name ).'</a></blockquote></div></div>';
|
540 |
+
|
541 |
+
}
|
542 |
+
|
543 |
/**
|
544 |
* [twitter_shortcode description]
|
545 |
* @param string $content [description]
|
public/{assets/js → js}/index.php
RENAMED
File without changes
|
public/{assets/js → js}/min/public-min.js
RENAMED
@@ -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]"===h.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,p[t]=this}var c=t.jQuery,f=t.console,d=void 0!==f,h=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=p[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 p={};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){}p=!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=c[t],n=$(window).width(),i=$(window).height(),r=e.outerHeight(),o=e.outerWidth(),s=e.data("width"),a=0,u=i/2-r/2,f="fixed",d=$(document).scrollTop();e.hasClass("spu-centered")&&(n>s&&(a=n/2-o/2),e.css({left:a,position:f,top:u})),r+50>i&&(f="absolute",u=d,e.css({position:f,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");e.append("box_count"==i?'<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>":'<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,n,r){var o=c[t],s=$("#spu-bg-"+t),a=o.data("bgopa");if(o.is(":animated"))return!1;if(n===!0&&o.is(":visible")||n===!1&&o.is(":hidden"))return!1;if(n===!1){var u=parseInt(o.data("cookie"));u>0&&e("spu_box_"+t,!0,u),o.trigger("spu.box_close",[t])}else o.trigger("spu.box_open",[t]),$(window).resize(function(){i(t)}),i(t);var f=o.data("spuanimation"),d=o.data("close-on-conversion");return"fade"===f?n===!0?o.fadeIn("slow"):n===!1&&(d&&r||!r)&&o.fadeOut("slow"):n===!0?o.slideDown("slow"):n===!1&&(d&&r||!r)&&o.slideUp("slow"),n===!0&&a>0?s.fadeIn():n===!1&&d&&s.fadeOut(),n}var s=$(window).height(),u=spuvar.is_admin,c=[];return a(),$(".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"),a=0,f=1===parseInt(e.data("test-mode")),d=e.data("box-id"),h=1===parseInt(e.data("auto-hide")),p=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),$(".spu-google").width($(".spu-google").width()-20),$(".spu-twitter").width($(".spu-twitter ").width()-50);var g=0,y=0,w=e.outerWidth(),b=e.find(".spu-content").width(),_=e.data("total");e.find(".spu-shortcode").wrapAll('<div class="spu_shortcodes"/>'),_&&!spuvar.disable_style&&$(window).width()>w&&(e.find(".spu-shortcode").each(function(){g+=$(this).width()}),y=b-g-_),y>0&&(e.find(".spu-shortcode").each(function(){$(this).css("margin-left",y/2)}),2==_?e.find(".spu-shortcode").last().css("margin-left",0):3==_&&e.find(".spu-shortcode").first().css("margin-left",0)),$(document).keyup(function(t){27==t.keyCode&&o(d,!1,!1)});var E=navigator.userAgent,x=E.match(/iPad/i)||E.match(/iPhone/i)?"touchstart":"click";$("body").on(x,function(t){void 0!==t.originalEvent&&o(d,!1,!1)}),$("body").on(x,".spu-box",function(t){t.stopPropagation()}),e.hide().css("left",""),c[d]=e;var L=function(){a&&clearTimeout(a),a=window.setTimeout(function(){var t=$(window).scrollTop(),e=t+s>=v;e?(h||$(window).unbind("scroll",L),o(d,!0,!1)):o(d,!1,!1)},100)},j=function(){a&&clearTimeout(a),a=window.setTimeout(function(){o(d,!0,!1)},1e3*l)},k=n("spu_box_"+d);if((void 0==k||""==k||u&&f)&&("seconds"==i?j():($(window).bind("scroll",L),L()),window.location.hash&&window.location.hash.length>0)){var O=window.location.hash,P;O.substring(1)===e.attr("id")&&setTimeout(function(){o(d,!0,!1)},100)}e.on("click",".spu-close-popup",function(){o(d,!1,!1),"percentage"==i&&$(window).unbind("scroll",L)}),$('a[href="#'+e.attr("id")+'"]').click(function(){return o(d,!0,!1),!1}),e.find(".gform_wrapper form").addClass("gravity-form");var I=e.find("form");if(I.length){var T=I.attr("action"),A=new RegExp(spuvar.site_url,"i");T&&T.length&&(A.test(T)||I.addClass("spu-disable-ajax"))}e.on("submit","form.spu-disable-ajax",function(){e.trigger("spu.form_submitted",[d]),o(d,!1,!0)}),e.on("submit",'form:not(".wpcf7-form, .gravity-form, .infusion-form, .spu-disable-ajax")',function(n){n.preventDefault();var i=!0,r=$(this),s=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(){o(d,!1,!0)},1e3*spuvar.seconds_confirmation_close)};return t(s,a,c,u,"html"),e.trigger("spu.form_submitted",[d]),i}),$("body").on("mailsent.wpcf7",function(){e.trigger("spu.form_submitted",[d]),o(d,!1,!0)}),$(document).on("gform_confirmation_loaded",function(){e.trigger("spu.form_submitted",[d]),o(d,!1,!0)}),e.on("submit",".infusion-form",function(t){t.preventDefault(),e.trigger("spu.form_submitted",[d]),o(d,!1,!0),this.submit()})}),{show:function(t){return o(t,!0,!1)},hide:function(t){return o(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()})},h=function(t,e,n){console.log("Problem loading popups - error: "+e+" - "+n)};t(f,spuvar.ajax_mode_url,d,h,"html")}else $(".spu-box").imagesLoaded(function(){window.SPU=c()});var p=!1,l=setInterval(function(){"undefined"==typeof FB||p||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]"===h.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,p[t]=this}var c=t.jQuery,f=t.console,d=void 0!==f,h=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=p[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 p={};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){}p=!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();e.find(".spu-shortcode").wrapAll('<div class="spu_shortcodes"/>'),!spuvar.disable_style&&$(window).width()>o&&(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"),h=s.data("close-on-conversion");return"fade"===d?n===!0?s.fadeIn("slow"):n===!1&&(h&&r||!r)&&s.fadeOut("slow"):n===!0?s.slideDown("slow"):n===!1&&(h&&r||!r)&&s.slideUp("slow"),n===!0&&u>0?a.fadeIn():n===!1&&h&&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"),h=1===parseInt(e.data("auto-hide")),p=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?(h||$(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="#'+e.attr("id")+'"]').click(function(){return s(d,!0,!1),!1}),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()})},h=function(t,e,n){console.log("Problem loading popups - error: "+e+" - "+n)};t(f,spuvar.ajax_mode_url,d,h,"html")}else $(".spu-box").imagesLoaded(function(){window.SPU=c()});var p=!1,l=setInterval(function(){"undefined"==typeof FB||p||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 → js}/public.js
RENAMED
@@ -14,8 +14,6 @@ var SPU_master = function() {
|
|
14 |
var isAdmin = spuvar.is_admin;
|
15 |
var $boxes = [];
|
16 |
|
17 |
-
SPU_reload_socials();
|
18 |
-
|
19 |
//remove paddings and margins from first and last items inside box
|
20 |
$(".spu-content").children().first().css({
|
21 |
"margin-top": 0,
|
@@ -48,50 +46,8 @@ var SPU_master = function() {
|
|
48 |
var triggerHeight = ( triggerPercentage * $(document).height() );
|
49 |
|
50 |
facebookFix( $box );
|
51 |
-
//correct widths of sharing icons
|
52 |
-
$('.spu-google').width($('.spu-google').width()-20);
|
53 |
-
$('.spu-twitter').width($('.spu-twitter ').width()-50);
|
54 |
-
|
55 |
-
//center spu-shortcodes
|
56 |
-
var swidth = 0;
|
57 |
-
var free_width = 0;
|
58 |
-
var boxwidth = $box.outerWidth();
|
59 |
-
var cwidth = $box.find(".spu-content").width();
|
60 |
-
var total = $box.data('total'); //total of shortcodes used
|
61 |
-
|
62 |
-
|
63 |
-
//wrap them all
|
64 |
-
$box.find(".spu-shortcode").wrapAll('<div class="spu_shortcodes"/>');
|
65 |
-
if( total && ! spuvar.disable_style && $(window).width() > boxwidth ){
|
66 |
-
|
67 |
-
//calculate total width of shortcodes all togheter
|
68 |
-
$box.find(".spu-shortcode").each(function(){
|
69 |
-
swidth = swidth + $(this).width();
|
70 |
-
});
|
71 |
-
//available space to split margins
|
72 |
-
free_width = cwidth - swidth - total;
|
73 |
-
|
74 |
-
}
|
75 |
-
if( free_width > 0 ) {
|
76 |
-
//leave some margin
|
77 |
-
$box.find(".spu-shortcode").each(function(){
|
78 |
|
79 |
-
$(this).css('margin-left',(free_width / 2 ));
|
80 |
-
|
81 |
-
});
|
82 |
-
//remove margin when neccesary
|
83 |
-
if( total == 2) {
|
84 |
|
85 |
-
$box.find(".spu-shortcode").last().css('margin-left',0);
|
86 |
-
|
87 |
-
} else if( total == 3) {
|
88 |
-
|
89 |
-
$box.find(".spu-shortcode").first().css('margin-left',0);
|
90 |
-
|
91 |
-
}
|
92 |
-
}
|
93 |
-
|
94 |
-
|
95 |
//close with esc
|
96 |
$(document).keyup(function(e) {
|
97 |
if (e.keyCode == 27) {
|
@@ -210,80 +166,85 @@ var SPU_master = function() {
|
|
210 |
// add class to the gravity form if they exist within the box
|
211 |
$box.find('.gform_wrapper form').addClass('gravity-form');
|
212 |
|
213 |
-
// check if
|
214 |
var box_form = $box.find('form');
|
215 |
if( box_form.length ) {
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
|
|
|
|
|
|
221 |
}
|
222 |
-
}
|
223 |
|
224 |
-
|
225 |
-
|
226 |
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
|
235 |
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
|
245 |
-
|
246 |
-
|
247 |
|
248 |
-
|
249 |
-
|
250 |
|
251 |
-
|
252 |
-
|
253 |
|
254 |
-
|
255 |
|
256 |
-
|
257 |
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
|
263 |
-
|
264 |
|
265 |
-
|
266 |
-
|
267 |
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
|
274 |
-
// Gravity forms support (only AJAX mode)
|
275 |
-
$(document).on('gform_confirmation_loaded', function(){
|
276 |
-
$box.trigger('spu.form_submitted', [id]);
|
277 |
-
toggleBox(id, false, true );
|
278 |
-
});
|
279 |
|
280 |
-
// Infusion Software - not ajax
|
281 |
-
$box.on('submit','.infusion-form', function(e){
|
282 |
-
e.preventDefault();
|
283 |
-
$box.trigger('spu.form_submitted', [id]);
|
284 |
-
toggleBox(id, false, true );
|
285 |
-
this.submit();
|
286 |
-
});
|
287 |
|
288 |
});
|
289 |
|
@@ -352,6 +313,49 @@ var SPU_master = function() {
|
|
352 |
}
|
353 |
}
|
354 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
355 |
/**
|
356 |
* Main function to show or hide the popup
|
357 |
* @param id int box id
|
@@ -383,6 +387,9 @@ var SPU_master = function() {
|
|
383 |
}
|
384 |
$box.trigger('spu.box_close', [id]);
|
385 |
} else {
|
|
|
|
|
|
|
386 |
$box.trigger('spu.box_open', [id]);
|
387 |
//bind for resize
|
388 |
$(window).resize(function(){
|
14 |
var isAdmin = spuvar.is_admin;
|
15 |
var $boxes = [];
|
16 |
|
|
|
|
|
17 |
//remove paddings and margins from first and last items inside box
|
18 |
$(".spu-content").children().first().css({
|
19 |
"margin-top": 0,
|
46 |
var triggerHeight = ( triggerPercentage * $(document).height() );
|
47 |
|
48 |
facebookFix( $box );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
|
|
|
|
|
|
|
|
|
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
//close with esc
|
52 |
$(document).keyup(function(e) {
|
53 |
if (e.keyCode == 27) {
|
166 |
// add class to the gravity form if they exist within the box
|
167 |
$box.find('.gform_wrapper form').addClass('gravity-form');
|
168 |
|
169 |
+
// check if we have forms and perform different actions
|
170 |
var box_form = $box.find('form');
|
171 |
if( box_form.length ) {
|
172 |
+
// Only if form is not a known one disable ajax
|
173 |
+
if( ! box_form.is(".wpcf7-form, .gravity-form, .infusion-form, .widget_wysija") ) {
|
174 |
+
var action = box_form.attr('action'),
|
175 |
+
pattern = new RegExp(spuvar.site_url, "i");
|
176 |
+
if (action && action.length) {
|
177 |
+
if (!pattern.test(action))
|
178 |
+
box_form.addClass('spu-disable-ajax');
|
179 |
+
}
|
180 |
}
|
|
|
181 |
|
182 |
+
// Disable ajax on form by adding .spu-disable-ajax class to it
|
183 |
+
$box.on('submit','form.spu-disable-ajax', function(){
|
184 |
|
185 |
+
$box.trigger('spu.form_submitted', [id]);
|
186 |
+
toggleBox(id, false, true );
|
187 |
+
});
|
188 |
|
189 |
+
// Add generic form tracking
|
190 |
+
$box.on('submit','form:not(".wpcf7-form, .gravity-form, .infusion-form, .spu-disable-ajax, .widget_wysija")', function(e){
|
191 |
+
e.preventDefault();
|
192 |
|
193 |
|
194 |
+
var submit = true,
|
195 |
+
form = $(this),
|
196 |
+
data = form.serialize(),
|
197 |
+
url = form.attr('action'),
|
198 |
+
error_cb = function (data, error, errorThrown){
|
199 |
+
console.log('Spu Form error: ' + error + ' - ' + errorThrown);
|
200 |
+
},
|
201 |
+
success_cb = function (data){
|
202 |
|
203 |
+
var response = $(data).filter('#spu-'+ id ).html();
|
204 |
+
$('#spu-' + id ).html(response);
|
205 |
|
206 |
+
// check if an error was returned for m4wp
|
207 |
+
if( ! $('#spu-' + id ).find('.mc4wp-form-error').length ) {
|
208 |
|
209 |
+
// give 2 seconds for response
|
210 |
+
setTimeout( function(){
|
211 |
|
212 |
+
toggleBox(id, false, true );
|
213 |
|
214 |
+
}, spuvar.seconds_confirmation_close * 1000);
|
215 |
|
216 |
+
}
|
217 |
+
};
|
218 |
+
// Send form by ajax and replace popup with response
|
219 |
+
request(data, url, success_cb, error_cb, 'html');
|
220 |
|
221 |
+
$box.trigger('spu.form_submitted', [id]);
|
222 |
|
223 |
+
return submit;
|
224 |
+
});
|
225 |
|
226 |
+
// CF7 support
|
227 |
+
$('body').on('mailsent.wpcf7', function(){
|
228 |
+
$box.trigger('spu.form_submitted', [id]);
|
229 |
+
toggleBox(id, false, true );
|
230 |
+
});
|
231 |
+
|
232 |
+
// Gravity forms support (only AJAX mode)
|
233 |
+
$(document).on('gform_confirmation_loaded', function(){
|
234 |
+
$box.trigger('spu.form_submitted', [id]);
|
235 |
+
toggleBox(id, false, true );
|
236 |
+
});
|
237 |
+
|
238 |
+
// Infusion Software - not ajax
|
239 |
+
$box.on('submit','.infusion-form', function(e){
|
240 |
+
e.preventDefault();
|
241 |
+
$box.trigger('spu.form_submitted', [id]);
|
242 |
+
toggleBox(id, false, true );
|
243 |
+
this.submit();
|
244 |
+
});
|
245 |
+
}
|
246 |
|
|
|
|
|
|
|
|
|
|
|
247 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
|
249 |
});
|
250 |
|
313 |
}
|
314 |
}
|
315 |
|
316 |
+
function centerShortcodes( box ){
|
317 |
+
var $box = box;
|
318 |
+
var total = $box.data('total'); //total of shortcodes used
|
319 |
+
if( total ) { //if we have shortcodes
|
320 |
+
SPU_reload_socials();
|
321 |
+
|
322 |
+
//wrap them all
|
323 |
+
//center spu-shortcodes
|
324 |
+
var swidth = 0;
|
325 |
+
var free_width = 0;
|
326 |
+
var boxwidth = $box.outerWidth();
|
327 |
+
var cwidth = $box.find(".spu-content").width();
|
328 |
+
$box.find(".spu-shortcode").wrapAll('<div class="spu_shortcodes"/>');
|
329 |
+
if (!spuvar.disable_style && $(window).width() > boxwidth) {
|
330 |
+
|
331 |
+
//calculate total width of shortcodes all togheter
|
332 |
+
$box.find(".spu-shortcode").each(function () {
|
333 |
+
swidth = swidth + $(this).outerWidth();
|
334 |
+
});
|
335 |
+
//available space to split margins
|
336 |
+
free_width = cwidth - swidth - (total*20);
|
337 |
+
|
338 |
+
}
|
339 |
+
if (free_width > 0) {
|
340 |
+
//leave some margin
|
341 |
+
$box.find(".spu-shortcode").each(function () {
|
342 |
+
|
343 |
+
$(this).css('margin-left', (free_width / 2 ));
|
344 |
+
|
345 |
+
});
|
346 |
+
//remove margin when neccesary
|
347 |
+
if (total == 2) {
|
348 |
+
|
349 |
+
$box.find(".spu-shortcode").last().css('margin-left', 0);
|
350 |
+
|
351 |
+
} else if (total == 3) {
|
352 |
+
|
353 |
+
$box.find(".spu-shortcode").first().css('margin-left', 0);
|
354 |
+
|
355 |
+
}
|
356 |
+
}
|
357 |
+
}
|
358 |
+
}
|
359 |
/**
|
360 |
* Main function to show or hide the popup
|
361 |
* @param id int box id
|
387 |
}
|
388 |
$box.trigger('spu.box_close', [id]);
|
389 |
} else {
|
390 |
+
setTimeout(function(){
|
391 |
+
centerShortcodes($box);
|
392 |
+
},1500);
|
393 |
$box.trigger('spu.box_open', [id]);
|
394 |
//bind for resize
|
395 |
$(window).resize(function(){
|