Q2W3 Fixed Widget - Version 5.1.7

Version Description

  • Fixed "a.target.className.indexOf is not a function" bug
Download this release

Release Info

Developer advancedads
Plugin Icon 128x128 Q2W3 Fixed Widget
Version 5.1.7
Comparing to
See all releases

Code changes from version 5.1.6 to 5.1.7

js/q2w3-fixed-widget.js CHANGED
@@ -34,9 +34,8 @@ function q2w3_sidebar_init() {
34
  q2w3Refresh = false
35
  var htmlObserver = new MutationObserver(function(mutations) {
36
  mutations.forEach( function(mutation) {
37
- if ( q2w3_exclude_mutations_array(q2w3_sidebar_options).indexOf(mutation.target.id) == -1 && mutation.target.className.indexOf('q2w3-fixed-widget-container') == -1 ) {
38
  q2w3Refresh = true;
39
- //console.log('Mutation detected!');
40
  }
41
  });
42
  });
34
  q2w3Refresh = false
35
  var htmlObserver = new MutationObserver(function(mutations) {
36
  mutations.forEach( function(mutation) {
37
+ if ( q2w3_exclude_mutations_array(q2w3_sidebar_options).indexOf(mutation.target.id) == -1 && (!mutation.target.className || typeof(mutation.target.className.indexOf) != "function" || mutation.target.className.indexOf('q2w3-fixed-widget-container') == -1 ) ) {
38
  q2w3Refresh = true;
 
39
  }
40
  });
41
  });
js/q2w3-fixed-widget.min.js CHANGED
@@ -1 +1 @@
1
- function q2w3_sidebar_init(){for(var a=0;a<q2w3_sidebar_options.length;a++)q2w3_sidebar(q2w3_sidebar_options[a]);jQuery(window).on("resize",function(){for(var a=0;a<q2w3_sidebar_options.length;a++)q2w3_sidebar(q2w3_sidebar_options[a])});var b=function(){for(var a=["WebKit","Moz","O","Ms",""],b=0;b<a.length;b++)if(a[b]+"MutationObserver"in window)return window[a[b]+"MutationObserver"];return!1}();if(0==q2w3_sidebar_options[0].disable_mo_api&&b){q2w3Refresh=!1;var c=new b(function(a){a.forEach(function(a){q2w3_exclude_mutations_array(q2w3_sidebar_options).indexOf(a.target.id)==-1&&a.target.className.indexOf("q2w3-fixed-widget-container")==-1&&(q2w3Refresh=!0)})});c.observe(document.body,{childList:!0,attributes:!0,attributeFilter:["style","class"],subtree:!0}),setInterval(function(){if(q2w3Refresh){for(var a=0;a<q2w3_sidebar_options.length;a++)q2w3_sidebar(q2w3_sidebar_options[a]);q2w3Refresh=!1}},300)}else console.log("MutationObserver not supported or disabled!"),q2w3_sidebar_options[0].refresh_interval>0&&setInterval(function(){for(var a=0;a<q2w3_sidebar_options.length;a++)q2w3_sidebar(q2w3_sidebar_options[a])},q2w3_sidebar_options[0].refresh_interval)}function q2w3_exclude_mutations_array(a){for(var b=new Array,c=0;c<a.length;c++)if(a[c].widgets.length>0)for(var d=0;d<a[c].widgets.length;d++)b.push(a[c].widgets[d]),b.push(a[c].widgets[d]+"_clone");return b}function q2w3_sidebar(a){function b(){}function j(b){var c=b.offset_top-b.fixed_margin_top,f=e-a.margin_bottom;a.stop_id&&jQuery("#"+a.stop_id).length&&(f=jQuery("#"+a.stop_id).offset().top-a.margin_bottom);var g;g=a.width_inherit?"inherit":b.obj.css("width");var h=!1,i=!1,j=!1;jQuery(window).on("scroll."+a.sidebar,function(e){if(jQuery(window).width()<=a.screen_max_width||jQuery(window).height()<=a.screen_max_height)j||(b.obj.css("position",""),b.obj.css("top",""),b.obj.css("bottom",""),b.obj.css("width",""),b.obj.css("margin",""),b.obj.css("padding",""),widget_obj.parent().css("height",""),jQuery("#"+b.clone_id).length>0&&jQuery("#"+b.clone_id).remove(),j=!0,h=!1,i=!1);else{var k=jQuery(this).scrollTop();k+b.fixed_margin_bottom>=f?(i||(b.obj.css("position","fixed"),b.obj.css("top",""),b.obj.css("width",g),jQuery("#"+b.clone_id).length<=0&&b.obj.before(b.clone),i=!0,h=!1,j=!1),b.obj.css("bottom",k+d+b.next_widgets_height-f)):k>=c?h||(b.obj.css("position","fixed"),b.obj.css("top",b.fixed_margin_top),b.obj.css("bottom",""),b.obj.css("width",g),jQuery("#"+b.clone_id).length<=0&&b.obj.before(b.clone),h=!0,i=!1,j=!1):j||(b.obj.css("position",""),b.obj.css("top",""),b.obj.css("bottom",""),b.obj.css("width",""),jQuery("#"+b.clone_id).length>0&&jQuery("#"+b.clone_id).remove(),j=!0,h=!1,i=!1)}}).trigger("scroll."+a.sidebar)}if(!a)return!1;if(!a.widgets)return!1;if(a.widgets.length<1)return!1;a.sidebar||(a.sidebar="q2w3-default-sidebar");var c=new Array,d=jQuery(window).height(),e=jQuery(document).height(),f=a.margin_top;jQuery("#wpadminbar").length&&(f=a.margin_top+jQuery("#wpadminbar").height()),jQuery(".q2w3-widget-clone-"+a.sidebar).remove();for(var g=0;g<a.widgets.length;g++)widget_obj=jQuery("#"+a.widgets[g]),widget_obj.css("position",""),widget_obj.attr("id")?(c[g]=new b,c[g].obj=widget_obj,c[g].clone=widget_obj.clone(),c[g].clone.children().remove(),c[g].clone_id=widget_obj.attr("id")+"_clone",c[g].clone.addClass("q2w3-widget-clone-"+a.sidebar),c[g].clone.attr("id",c[g].clone_id),c[g].clone.css("height",widget_obj.height()),c[g].clone.css("visibility","hidden"),c[g].offset_top=widget_obj.offset().top,c[g].fixed_margin_top=f,c[g].height=widget_obj.outerHeight(!0),c[g].fixed_margin_bottom=f+c[g].height,f+=c[g].height):c[g]=!1;for(var i,h=0,g=c.length-1;g>=0;g--)c[g]&&(c[g].next_widgets_height=h,c[g].fixed_margin_bottom+=h,h+=c[g].height,i||(i=widget_obj.parent(),i.addClass("q2w3-fixed-widget-container"),i.css("height",""),i.height(i.height())));jQuery(window).off("scroll."+a.sidebar);for(var g=0;g<c.length;g++)c[g]&&j(c[g])}"undefined"!=typeof q2w3_sidebar_options&&q2w3_sidebar_options.length>0?window.jQuery?q2w3_sidebar_options[0].window_load_hook?jQuery(window).load(q2w3_sidebar_init()):jQuery(document).ready(q2w3_sidebar_init()):console.log("jQuery is not loaded!"):console.log("q2w3_sidebar_options not found!");
1
+ function q2w3_sidebar_init(){for(var e=0;e<q2w3_sidebar_options.length;e++)q2w3_sidebar(q2w3_sidebar_options[e]);jQuery(window).on("resize",function(){for(var e=0;e<q2w3_sidebar_options.length;e++)q2w3_sidebar(q2w3_sidebar_options[e])});var i=function(){for(var e=["WebKit","Moz","O","Ms",""],i=0;i<e.length;i++)if(e[i]+"MutationObserver"in window)return window[e[i]+"MutationObserver"];return!1}();0==q2w3_sidebar_options[0].disable_mo_api&&i?(q2w3Refresh=!1,new i(function(e){e.forEach(function(e){-1!=q2w3_exclude_mutations_array(q2w3_sidebar_options).indexOf(e.target.id)||e.target.className&&"function"==typeof e.target.className.indexOf&&-1!=e.target.className.indexOf("q2w3-fixed-widget-container")||(q2w3Refresh=!0)})}).observe(document.body,{childList:!0,attributes:!0,attributeFilter:["style","class"],subtree:!0}),setInterval(function(){if(q2w3Refresh){for(var e=0;e<q2w3_sidebar_options.length;e++)q2w3_sidebar(q2w3_sidebar_options[e]);q2w3Refresh=!1}},300)):(console.log("MutationObserver not supported or disabled!"),q2w3_sidebar_options[0].refresh_interval>0&&setInterval(function(){for(var e=0;e<q2w3_sidebar_options.length;e++)q2w3_sidebar(q2w3_sidebar_options[e])},q2w3_sidebar_options[0].refresh_interval))}function q2w3_exclude_mutations_array(e){for(var i=new Array,o=0;o<e.length;o++)if(e[o].widgets.length>0)for(var t=0;t<e[o].widgets.length;t++)i.push(e[o].widgets[t]),i.push(e[o].widgets[t]+"_clone");return i}function q2w3_sidebar(e){if(!e)return!1;if(!e.widgets)return!1;if(e.widgets.length<1)return!1;function i(){}e.sidebar||(e.sidebar="q2w3-default-sidebar");var o=new Array,t=jQuery(window).height(),r=jQuery(document).height(),s=e.margin_top;jQuery("#wpadminbar").length&&(s=e.margin_top+jQuery("#wpadminbar").height()),jQuery(".q2w3-widget-clone-"+e.sidebar).remove();for(var n=0;n<e.widgets.length;n++)widget_obj=jQuery("#"+e.widgets[n]),widget_obj.css("position",""),widget_obj.attr("id")?(o[n]=new i,o[n].obj=widget_obj,o[n].clone=widget_obj.clone(),o[n].clone.children().remove(),o[n].clone_id=widget_obj.attr("id")+"_clone",o[n].clone.addClass("q2w3-widget-clone-"+e.sidebar),o[n].clone.attr("id",o[n].clone_id),o[n].clone.css("height",widget_obj.height()),o[n].clone.css("visibility","hidden"),o[n].offset_top=widget_obj.offset().top,o[n].fixed_margin_top=s,o[n].height=widget_obj.outerHeight(!0),o[n].fixed_margin_bottom=s+o[n].height,s+=o[n].height):o[n]=!1;var d,a=0;for(n=o.length-1;n>=0;n--)o[n]&&(o[n].next_widgets_height=a,o[n].fixed_margin_bottom+=a,a+=o[n].height,d||((d=widget_obj.parent()).addClass("q2w3-fixed-widget-container"),d.css("height",""),d.height(d.height())));jQuery(window).off("scroll."+e.sidebar);for(n=0;n<o.length;n++)o[n]&&_(o[n]);function _(i){var o,s=i.offset_top-i.fixed_margin_top,n=r-e.margin_bottom;e.stop_id&&jQuery("#"+e.stop_id).length&&(n=jQuery("#"+e.stop_id).offset().top-e.margin_bottom),o=e.width_inherit?"inherit":i.obj.css("width");var d=!1,a=!1,_=!1;jQuery(window).on("scroll."+e.sidebar,function(r){if(jQuery(window).width()<=e.screen_max_width||jQuery(window).height()<=e.screen_max_height)_||(i.obj.css("position",""),i.obj.css("top",""),i.obj.css("bottom",""),i.obj.css("width",""),i.obj.css("margin",""),i.obj.css("padding",""),widget_obj.parent().css("height",""),jQuery("#"+i.clone_id).length>0&&jQuery("#"+i.clone_id).remove(),_=!0,d=!1,a=!1);else{var w=jQuery(this).scrollTop();w+i.fixed_margin_bottom>=n?(a||(i.obj.css("position","fixed"),i.obj.css("top",""),i.obj.css("width",o),jQuery("#"+i.clone_id).length<=0&&i.obj.before(i.clone),a=!0,d=!1,_=!1),i.obj.css("bottom",w+t+i.next_widgets_height-n)):w>=s?d||(i.obj.css("position","fixed"),i.obj.css("top",i.fixed_margin_top),i.obj.css("bottom",""),i.obj.css("width",o),jQuery("#"+i.clone_id).length<=0&&i.obj.before(i.clone),d=!0,a=!1,_=!1):_||(i.obj.css("position",""),i.obj.css("top",""),i.obj.css("bottom",""),i.obj.css("width",""),jQuery("#"+i.clone_id).length>0&&jQuery("#"+i.clone_id).remove(),_=!0,d=!1,a=!1)}}).trigger("scroll."+e.sidebar)}}"undefined"!=typeof q2w3_sidebar_options&&q2w3_sidebar_options.length>0?window.jQuery?q2w3_sidebar_options[0].window_load_hook?jQuery(window).load(q2w3_sidebar_init()):jQuery(document).ready(q2w3_sidebar_init()):console.log("jQuery is not loaded!"):console.log("q2w3_sidebar_options not found!");
q2w3-fixed-widget.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://wpadvancedads.com/fixed-widget-wordpress/
5
  Description: Use the fixed widget plugin to create sticky widgets that stay in the visible screen area when the page is scrolled up or down and boost your conversions.
6
  Text Domain: q2w3-fixed-widget
7
  Author: Thomas Maier, Max Bond
8
- Version: 5.1.6
9
  Author URI: https://wpadvancedads.com/fixed-widget-wordpress/
10
  */
11
 
@@ -17,7 +17,7 @@ class q2w3_fixed_widget { // Plugin class
17
 
18
  const ID = 'q2w3_fixed_widget';
19
 
20
- const VERSION = '5.1.6';
21
 
22
  protected static $sidebars_widgets;
23
 
5
  Description: Use the fixed widget plugin to create sticky widgets that stay in the visible screen area when the page is scrolled up or down and boost your conversions.
6
  Text Domain: q2w3-fixed-widget
7
  Author: Thomas Maier, Max Bond
8
+ Version: 5.1.7
9
  Author URI: https://wpadvancedads.com/fixed-widget-wordpress/
10
  */
11
 
17
 
18
  const ID = 'q2w3_fixed_widget';
19
 
20
+ const VERSION = '5.1.7';
21
 
22
  protected static $sidebars_widgets;
23
 
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: webzunft, max-bond, advancedads
3
  Tags: fixed widget, sticky widget, sidebar, ads, widget
4
  Requires at least: 4.0
5
- Tested up to: 5.1
6
- Stable tag: 5.1.6
7
 
8
  More attention and a higher ad performance with fixed sticky widgets.
9
 
@@ -73,6 +73,9 @@ There are two options: `Disable Width` and `Disable Height`. They works the same
73
 
74
  == Changelog ==
75
 
 
 
 
76
  = 5.1.6 =
77
  * linguistic corrections
78
  * cleanup of the options page
2
  Contributors: webzunft, max-bond, advancedads
3
  Tags: fixed widget, sticky widget, sidebar, ads, widget
4
  Requires at least: 4.0
5
+ Tested up to: 5.2
6
+ Stable tag: 5.1.7
7
 
8
  More attention and a higher ad performance with fixed sticky widgets.
9
 
73
 
74
  == Changelog ==
75
 
76
+ = 5.1.7 =
77
+ * Fixed "a.target.className.indexOf is not a function" bug
78
+
79
  = 5.1.6 =
80
  * linguistic corrections
81
  * cleanup of the options page