YITH WooCommerce Zoom Magnifier - Version 1.0.8

Version Description

  • Added: ability to change the slider programmatically
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Zoom Magnifier
Version 1.0.8
Comparing to
See all releases

Code changes from version 1.0.7 to 1.0.8

README.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: zoom, magnifier, woocommerce, products, themes, yit, e-commerce, shop
5
  Requires at least: 3.5.1
6
  Tested up to: 3.5.1
7
- Stable tag: 1.0.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -69,6 +69,10 @@ The size of the Zoom Image is automatically setted. If you want to change these
69
 
70
  == Changelog ==
71
 
 
 
 
 
72
  = 1.0.7 =
73
 
74
  * Fixed: zoomed image did not change when select a variation
4
  Tags: zoom, magnifier, woocommerce, products, themes, yit, e-commerce, shop
5
  Requires at least: 3.5.1
6
  Tested up to: 3.5.1
7
+ Stable tag: 1.0.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
69
 
70
  == Changelog ==
71
 
72
+ = 1.0.8 =
73
+
74
+ * Added: ability to change the slider programmatically
75
+
76
  = 1.0.7 =
77
 
78
  * Fixed: zoomed image did not change when select a variation
assets/js/frontend.js CHANGED
@@ -3,7 +3,7 @@
3
  *
4
  * @author Your Inspiration Themes
5
  * @package YITH WooCommerce Zoom Magnifier
6
- * @version 1.0.7
7
  */
8
  jQuery(document).ready(function($){
9
 
3
  *
4
  * @author Your Inspiration Themes
5
  * @package YITH WooCommerce Zoom Magnifier
6
+ * @version 1.0.8
7
  */
8
  jQuery(document).ready(function($){
9
 
assets/js/frontend.min.js CHANGED
@@ -3,7 +3,7 @@
3
  *
4
  * @author Your Inspiration Themes
5
  * @package YITH WooCommerce Zoom Magnifier
6
- * @version 1.0.7
7
  */
8
  jQuery(document).ready(function(b){var a=b(".images"),d=b(".yith_magnifier_zoom"),f=b(".yith_magnifier_zoom img"),e=a.find(".yith_magnifier_zoom").attr("href"),g=a.find(".yith_magnifier_zoom img").attr("src");a.yith_magnifier(yith_magnifier_options);b(document).on("found_variation","form.variations_form",function(b,c){var h=c.image_src?c.image_src:g;d.attr("href",c.image_magnifier?c.image_magnifier:e);f.attr("src",h);a.data("yith_magnifier")&&a.yith_magnifier("destroy");a.yith_magnifier(yith_magnifier_options)}).on("reset_image",
9
  function(b){d.attr("href",e);a.data("yith_magnifier")&&a.yith_magnifier("destroy");a.yith_magnifier(yith_magnifier_options)});b("form.variations_form .variations select").trigger("change")});
3
  *
4
  * @author Your Inspiration Themes
5
  * @package YITH WooCommerce Zoom Magnifier
6
+ * @version 1.0.8
7
  */
8
  jQuery(document).ready(function(b){var a=b(".images"),d=b(".yith_magnifier_zoom"),f=b(".yith_magnifier_zoom img"),e=a.find(".yith_magnifier_zoom").attr("href"),g=a.find(".yith_magnifier_zoom img").attr("src");a.yith_magnifier(yith_magnifier_options);b(document).on("found_variation","form.variations_form",function(b,c){var h=c.image_src?c.image_src:g;d.attr("href",c.image_magnifier?c.image_magnifier:e);f.attr("src",h);a.data("yith_magnifier")&&a.yith_magnifier("destroy");a.yith_magnifier(yith_magnifier_options)}).on("reset_image",
9
  function(b){d.attr("href",e);a.data("yith_magnifier")&&a.yith_magnifier("destroy");a.yith_magnifier(yith_magnifier_options)});b("form.variations_form .variations select").trigger("change")});
assets/js/yith_magnifier.js CHANGED
@@ -167,6 +167,7 @@
167
  loadingLabel: 'Loading...',
168
 
169
  enableSlider: true,
 
170
  sliderOptions: {},
171
 
172
  onLoad : function() { return false; },
@@ -243,7 +244,7 @@
243
  //gallery.filter(':first').trigger('click');
244
 
245
  if( self.options.enableSlider ) {
246
- gallery.parents('ul').carouFredSel( self.options.sliderOptions );
247
  }
248
 
249
  } else {
167
  loadingLabel: 'Loading...',
168
 
169
  enableSlider: true,
170
+ slider: 'carouFredSel',
171
  sliderOptions: {},
172
 
173
  onLoad : function() { return false; },
244
  //gallery.filter(':first').trigger('click');
245
 
246
  if( self.options.enableSlider ) {
247
+ gallery.parents('ul')[self.options.slider]( self.options.sliderOptions );
248
  }
249
 
250
  } else {
assets/js/yith_magnifier.min.js CHANGED
@@ -6,22 +6,22 @@
6
  *
7
  * MIT License.
8
  */
9
- (function(s,b,q){if(b.fn.imagesLoaded===q){var g=jQuery,r="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";g.fn.imagesLoaded=function(a){function b(){var d=g(k),e=g(j);c&&(j.length?c.reject(h,d,e):c.resolve(h));g.isFunction(a)&&a.call(p,h,d,e)}function e(a){f(a.target,"error"===a.type)}function f(a,f){a.src===r||-1!==g.inArray(a,m)||(m.push(a),f?j.push(a):k.push(a),g.data(a,"imagesLoaded",{isBroken:f,src:a.src}),l&&c.notifyWith(g(a),[f,h,g(k),g(j)]),h.length===m.length&&(setTimeout(b),
10
- h.unbind(".imagesLoaded",e)))}var p=this,c=g.isFunction(g.Deferred)?g.Deferred():0,l=g.isFunction(c.notify),h=p.find("img").add(p.filter("img")),m=[],k=[],j=[];g.isPlainObject(a)&&g.each(a,function(b,d){if("callback"===b)a=d;else if(c)c[b](d)});h.length?h.bind("load.imagesLoaded error.imagesLoaded",e).each(function(a,b){var c=b.src,d=g.data(b,"imagesLoaded");if(d&&d.src===c)f(b,d.isBroken);else if(b.complete&&void 0!==b.naturalWidth)f(b,0===b.naturalWidth||0===b.naturalHeight);else if(b.readyState||
11
- b.complete)b.src=r,b.src=c}):b();return c?c.promise(p):p}}b.yith_magnifier=function(a,d){this.t=d;this.element=b(d);this._init(a)};b.yith_magnifier.defaults={zoomWidth:"auto",zoomHeight:"auto",position:"right",tint:!1,tintOpacity:0.5,lensOpacity:0.5,softFocus:!1,smoothMove:3,showTitle:!0,titleOpacity:0.5,adjustX:0,adjustY:0,phoneBehavior:"inside",loadingLabel:"Loading...",enableSlider:!0,sliderOptions:{},onLoad:function(){return!1},onEnter:function(){return!1},onLeave:function(){return!1},onMove:function(){return!1},
12
- onClick:function(){return!1},elements:{zoom:b(".yith_magnifier_zoom"),zoomImage:b(".yith_magnifier_zoom img"),gallery:b(".yith_magnifier_gallery li a")}};b.yith_magnifier.prototype={_init:function(a){var d=this;b.each(b.yith_magnifier.defaults.elements,function(a,f){b.yith_magnifier.defaults.elements[a]=b(f,d)});d.options=b.extend(!0,{},b.yith_magnifier.defaults,a);d.isPhone=d._isPhone();d._loading();d.element.imagesLoaded(function(){d.options.onLoad();d._initZoom();d._initGallery()})},_initGallery:function(){var a=
13
- this,d=a.options.elements,e=d.gallery,f=d.zoom,g=d.zoomImage;if(0<e.length)e.on("click",function(c){c.preventDefault();c=b(this);a.destroy();f.attr("href",this.href);g.attr("src",c.data("small")).attr("title","").attr("title",c.attr("title"));b.data(a.t,"yith_magnifier",new b.yith_magnifier(a.options,a.element))}),a.options.enableSlider&&e.parents("ul").carouFredSel(a.options.sliderOptions);else e.on("click",function(a){a.preventDefault();return!1})},_loading:function(){if(this.options.disableRightClick)b(document).on("contextmenu",
14
- function(){return!1});if(this.mouseTrap===q){var a=this.options.elements.zoom.width();b('<div class="yith_magnifier_loading">'+this.options.loadingLabel+"</div>").css({width:a/3,left:a/2-a/6,opacity:0.5}).appendTo(this.options.elements.zoom.parent())}},_initZoom:function(){var a=this;a.zoom=a.options.elements.zoom;a.zoomImage=a.options.elements.zoomImage;a.zoom.wrap('<div class="yith_magnifier_zoom_wrap"></div>');a.IMG_zoomImage=new Image;a.IMG_zoomImage.src=a.zoom.attr("href");a.IMG_smallImage=new Image;
15
- a.IMG_smallImage.src=a.zoomImage.attr("src");b.browser.msie&&8==b.browser.version?b(a.IMG_zoomImage).load(function(){a._initTrap()}):b([a.IMG_zoomImage,a.IMG_smallImage]).imagesLoaded(function(){a._initTrap()})},_initTrap:function(){var a=this,d=a.IMG_zoomImage;a.mx=0;a.my=0;a.controlTimer=0;a.lens=null;a.tint=null;a.softFocus=null;a.zoomDiv=null;a.cw=0;a.ch=0;a.zw=0;a.destU=0;a.destV=0;a.currU=0;a.currV=0;a.mouseTrap=null;var e=a.options.elements.zoom,f=a.options.elements.zoomImage;b(".yith_magnifier_loading").remove();
16
- this.element.find(".yith_magnifier_mousetrap")&&this.element.find(".yith_magnifier_mousetrap").remove();this.mouseTrap=b('<div class="yith_magnifier_mousetrap" />').css({width:"100%",height:"100%",top:0,left:0}).appendTo(e.parent());var g="ontouchstart"in document.documentElement?!0:!1;this.mouseTrap.on("touchmove mousemove",this,function(b){a.options.onMove();a.mx="undefined"!=typeof b.originalEvent.touches?b.originalEvent.touches[0].pageX:b.pageX;a.my="undefined"!=typeof b.originalEvent.touches?
17
- b.originalEvent.touches[0].pageY:b.pageY}).on("touchend mouseleave",this,function(){clearTimeout(a.controlTimer);a.lens&&a.lens.fadeOut(299);a.tint&&a.tint.fadeOut(299);a.softFocus&&a.softFocus.fadeOut(299);a.zoomDiv.fadeOut(300,function(){a._onLeave()});return!1}).on("touchstart click",this,function(){a.options.onClick()}).on("touchstart mouseenter",this,function(c){a.options.onEnter();g&&c.preventDefault();a.mx="undefined"!=typeof c.originalEvent.touches?c.originalEvent.touches[0].pageX:c.pageX;
18
- a.my="undefined"!=typeof c.originalEvent.touches?c.originalEvent.touches[0].pageY:c.pageY;a.zw=c.data;a.zoomDiv&&(a.zoomDiv.stop(!0,!1),a.zoomDiv.remove());c=a.options.adjustX;var l=a.options.adjustY,h=f.outerWidth(),m=f.outerHeight(),k=a.options.zoomWidth,j=a.options.zoomHeight;"auto"==a.options.zoomWidth&&(k=h);"auto"==a.options.zoomHeight&&(j=m);var n=e.parent();switch(a.options.position){case "top":l-=j;break;case "right":c+=h;break;case "bottom":l+=m;break;case "left":c-=k;break;case "inside":k=
19
- h;j=m;break;default:n=b("#"+a.options.position),n.length?(k=n.innerWidth(),j=n.innerHeight()):(n=e,c+=h,l+=m)}a.isPhone&&"inside"==a.options.phoneBehavior&&(k=h,j=m,l=c=0);a.zoomDiv=b('<div class="yith_magnifier_zoom_magnifier" />').css({left:c,top:l,width:k,height:j,backgroundImage:"url("+d.src+")"}).appendTo(n);f.attr("title")&&a.options.showTitle&&b('<div class="yith_magnifier_title">'+f.attr("title")+"</div>").appendTo(a.zoomDiv);a.isPhone?"disable"!=a.options.phoneBehavior?a.zoomDiv.fadeIn(500):
20
- a.lens.fadeOut(299):a.zoomDiv.fadeIn(500);a.lens&&(a.lens.remove(),a.lens=null);a.cw=1>=d.width?f.outerWidth()/d.naturalWidth*a.zoomDiv.width():f.outerWidth()/d.width*a.zoomDiv.width();a.ch=1>=d.height?f.outerHeight()/d.naturalHeight*a.zoomDiv.height():f.outerHeight()/d.height*a.zoomDiv.height();a.lens=b('<div class="yith_magnifier_lens" />').css({width:a.cw,height:a.ch}).appendTo(e);a.mouseTrap.css("cursor",a.lens.css("cursor"));c=!1;a.options.tint&&(a.tint=b("<div />").css({display:"none",position:"absolute",
21
- left:0,top:0,width:f.outerWidth(),height:f.outerHeight(),backgroundColor:a.options.tint,opacity:a.options.tintOpacity}).appendTo(e),a.lens.append(b("<img />",{src:f.attr("src")})),c=!0,a.tint.fadeIn(500));a.options.softFocus&&(a.softFocus=b("<div />").css({position:"absolute",display:"none",top:"1px",left:"1px",width:f.outerWidth(),height:f.outerHeight(),opacity:0.5}).appendTo(e),a.softFocus.append(b("<img />",{src:f.attr("src")})),0==a.lens.find("img").length&&a.lens.append(b("<img />",{src:f.attr("src")})),
22
- c=!0,a.softFocus.fadeIn(500));c||a.lens.css("opacity",a.options.lensOpacity);"inside"!==a.options.position&&a.lens.fadeIn(500);a.zw._controlLoop()})},_controlLoop:function(){var a=this;if(this.lens){var b=this.mx-this.zoomImage.offset().left-0.5*this.cw>>0,e=this.my-this.zoomImage.offset().top-0.5*this.ch>>0;0>b?b=0:b>this.zoomImage.outerWidth()-this.cw&&(b=this.zoomImage.outerWidth()-this.cw);0>e?e=0:e>this.zoomImage.outerHeight()-this.ch&&(e=this.zoomImage.outerHeight()-this.ch);this.lens.css({left:b-
23
- 2,top:e-1});this.lens.find("img").css({width:this.zoomImage.outerWidth(),height:this.zoomImage.outerHeight(),marginLeft:-b+"px ",marginTop:-e+"px"});this.destU=1>=this.IMG_zoomImage.width?b/this.zoomImage.outerWidth()*this.IMG_zoomImage.naturalWidth>>0:b/this.zoomImage.outerWidth()*this.IMG_zoomImage.width>>0;this.destV=1>=this.IMG_zoomImage.height?e/this.zoomImage.outerHeight()*this.IMG_zoomImage.naturalHeight>>0:e/this.zoomImage.outerHeight()*this.IMG_zoomImage.height>>0;this.currU+=(this.destU-
24
- this.currU)/this.options.smoothMove;this.currV+=(this.destV-this.currV)/this.options.smoothMove;this.zoomDiv.css("background-position",-(this.currU>>0)+"px "+(-(this.currV>>0)+"px"))}this.controlTimer=setTimeout(function(){a._controlLoop()},30)},_onLeave:function(){this.options.onLeave();this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null);this._removeElements()},_removeElements:function(){this.lens&&(this.lens.remove(),this.lens=null);this.tint&&(this.tint.remove(),this.tint=null);this.softFocus&&
25
- (this.softFocus.remove(),this.softFocus=null);0<this.element.find(".yith_magnifier_loading").length&&this.element.find(".yith_magnifier_loading").remove()},_isPhone:function(){var a=navigator.userAgent.toLowerCase();return a.match(/iphone/i)||a.match(/ipod/i)||a.match(/android/i)},destroy:function(){this.zoom&&this.zoom.unwrap();this.mouseTrap&&(this.mouseTrap.unbind(),this.mouseTrap.remove(),this.mouseTrap=null);this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null);this.options.disableRightClick&&
26
- b(document).unbind();this._removeElements();this.options.elements.gallery.unbind();this.element.removeData("yith_magnifier")}};b.fn.yith_magnifier=function(a){if("string"===typeof a){var d=Array.prototype.slice.call(arguments,1);this.each(function(){var e=b.data(this,"yith_magnifier");e?!b.isFunction(e[a])||"_"===a.charAt(0)?b.error("no such method '"+a+"' for yith_magnifier instance"):e[a].apply(e,d):b.error("cannot call methods on yith_magnifier prior to initialization; attempted to call method '"+
27
- a+"'")})}else this.each(function(){b.data(this,"yith_magnifier")?b.error("yith_magnifier already istantiated."):b.data(this,"yith_magnifier",new b.yith_magnifier(a,this))});return this}})(window,jQuery);
6
  *
7
  * MIT License.
8
  */
9
+ (function(t,b,s){b.fn.imagesLoaded===s&&function(a,b){var f="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";a.fn.imagesLoaded=function(c){function p(){var b=a(r),d=a(q);h&&(q.length?h.reject(g,b,d):h.resolve(g));a.isFunction(c)&&c.call(l,g,b,d)}function d(a){k(a.target,"error"===a.type)}function k(b,e){b.src!==f&&-1===a.inArray(b,m)&&(m.push(b),e?q.push(b):r.push(b),a.data(b,"imagesLoaded",{isBroken:e,src:b.src}),n&&h.notifyWith(a(b),[e,g,a(r),a(q)]),g.length===m.length&&
10
+ (setTimeout(p),g.unbind(".imagesLoaded",d)))}var l=this,h=a.isFunction(a.Deferred)?a.Deferred():0,n=a.isFunction(h.notify),g=l.find("img").add(l.filter("img")),m=[],r=[],q=[];a.isPlainObject(c)&&a.each(c,function(a,b){if("callback"===a)c=b;else if(h)h[a](b)});g.length?g.bind("load.imagesLoaded error.imagesLoaded",d).each(function(d,c){var h=c.src,g=a.data(c,"imagesLoaded");if(g&&g.src===h)k(c,g.isBroken);else if(c.complete&&c.naturalWidth!==b)k(c,0===c.naturalWidth||0===c.naturalHeight);else if(c.readyState||
11
+ c.complete)c.src=f,c.src=h}):p();return h?h.promise(l):l}}(jQuery);b.yith_magnifier=function(a,e){this.t=e;this.element=b(e);this._init(a)};b.yith_magnifier.defaults={zoomWidth:"auto",zoomHeight:"auto",position:"right",tint:!1,tintOpacity:0.5,lensOpacity:0.5,softFocus:!1,smoothMove:3,showTitle:!0,titleOpacity:0.5,adjustX:0,adjustY:0,phoneBehavior:"inside",loadingLabel:"Loading...",enableSlider:!0,slider:"carouFredSel",sliderOptions:{},onLoad:function(){return!1},onEnter:function(){return!1},onLeave:function(){return!1},
12
+ onMove:function(){return!1},onClick:function(){return!1},elements:{zoom:b(".yith_magnifier_zoom"),zoomImage:b(".yith_magnifier_zoom img"),gallery:b(".yith_magnifier_gallery li a")}};b.yith_magnifier.prototype={_init:function(a){var e=this;b.each(b.yith_magnifier.defaults.elements,function(a,c){b.yith_magnifier.defaults.elements[a]=b(c,e)});e.options=b.extend(!0,{},b.yith_magnifier.defaults,a);e.isPhone=e._isPhone();e._loading();e.element.imagesLoaded(function(){e.options.onLoad();e._initZoom();e._initGallery()})},
13
+ _initGallery:function(){var a=this,e=a.options.elements,f=e.gallery,c=e.zoom,p=e.zoomImage;if(0<f.length){if(f.on("click",function(d){d.preventDefault();d=b(this);a.destroy();c.attr("href",this.href);p.attr("src",d.data("small")).attr("title","").attr("title",d.attr("title"));b.data(a.t,"yith_magnifier",new b.yith_magnifier(a.options,a.element))}),a.options.enableSlider)f.parents("ul")[a.options.slider](a.options.sliderOptions)}else f.on("click",function(a){a.preventDefault();return!1})},_loading:function(){if(this.options.disableRightClick)b(document).on("contextmenu",
14
+ function(a){return!1});if(this.mouseTrap===s){var a=this.options.elements.zoom.width();b('<div class="yith_magnifier_loading">'+this.options.loadingLabel+"</div>").css({width:a/3,left:a/2-a/6,opacity:0.5}).appendTo(this.options.elements.zoom.parent())}},_initZoom:function(){var a=this;a.zoom=a.options.elements.zoom;a.zoomImage=a.options.elements.zoomImage;a.zoom.wrap('<div class="yith_magnifier_zoom_wrap"></div>');a.IMG_zoomImage=new Image;a.IMG_zoomImage.src=a.zoom.attr("href");a.IMG_smallImage=
15
+ new Image;a.IMG_smallImage.src=a.zoomImage.attr("src");b.browser.msie&&8==b.browser.version?b(a.IMG_zoomImage).load(function(){a._initTrap()}):b([a.IMG_zoomImage,a.IMG_smallImage]).imagesLoaded(function(){a._initTrap()})},_initTrap:function(){var a=this,e=a.IMG_zoomImage;a.mx=0;a.my=0;a.controlTimer=0;a.lens=null;a.tint=null;a.softFocus=null;a.zoomDiv=null;a.cw=0;a.ch=0;a.zw=0;a.destU=0;a.destV=0;a.currU=0;a.currV=0;a.mouseTrap=null;var f=a.options.elements.zoom,c=a.options.elements.zoomImage;b(".yith_magnifier_loading").remove();
16
+ this.element.find(".yith_magnifier_mousetrap")&&this.element.find(".yith_magnifier_mousetrap").remove();this.mouseTrap=b('<div class="yith_magnifier_mousetrap" />').css({width:"100%",height:"100%",top:0,left:0}).appendTo(f.parent());var p="ontouchstart"in document.documentElement?!0:!1;this.mouseTrap.on("touchmove mousemove",this,function(b){a.options.onMove();a.mx="undefined"!=typeof b.originalEvent.touches?b.originalEvent.touches[0].pageX:b.pageX;a.my="undefined"!=typeof b.originalEvent.touches?
17
+ b.originalEvent.touches[0].pageY:b.pageY}).on("touchend mouseleave",this,function(b){clearTimeout(a.controlTimer);a.lens&&a.lens.fadeOut(299);a.tint&&a.tint.fadeOut(299);a.softFocus&&a.softFocus.fadeOut(299);a.zoomDiv.fadeOut(300,function(){a._onLeave()});return!1}).on("touchstart click",this,function(b){a.options.onClick()}).on("touchstart mouseenter",this,function(d){a.options.onEnter();p&&d.preventDefault();a.mx="undefined"!=typeof d.originalEvent.touches?d.originalEvent.touches[0].pageX:d.pageX;
18
+ a.my="undefined"!=typeof d.originalEvent.touches?d.originalEvent.touches[0].pageY:d.pageY;a.zw=d.data;a.zoomDiv&&(a.zoomDiv.stop(!0,!1),a.zoomDiv.remove());d=a.options.adjustX;var k=a.options.adjustY,l=c.outerWidth(),h=c.outerHeight(),n=a.options.zoomWidth,g=a.options.zoomHeight;"auto"==a.options.zoomWidth&&(n=l);"auto"==a.options.zoomHeight&&(g=h);var m=f.parent();switch(a.options.position){case "top":k-=g;break;case "right":d+=l;break;case "bottom":k+=h;break;case "left":d-=n;break;case "inside":n=
19
+ l;g=h;break;default:m=b("#"+a.options.position),m.length?(n=m.innerWidth(),g=m.innerHeight()):(m=f,d+=l,k+=h)}a.isPhone&&"inside"==a.options.phoneBehavior&&(n=l,g=h,k=d=0);a.zoomDiv=b('<div class="yith_magnifier_zoom_magnifier" />').css({left:d,top:k,width:n,height:g,backgroundImage:"url("+e.src+")"}).appendTo(m);c.attr("title")&&a.options.showTitle&&b('<div class="yith_magnifier_title">'+c.attr("title")+"</div>").appendTo(a.zoomDiv);a.isPhone?"disable"!=a.options.phoneBehavior?a.zoomDiv.fadeIn(500):
20
+ a.lens.fadeOut(299):a.zoomDiv.fadeIn(500);a.lens&&(a.lens.remove(),a.lens=null);a.cw=1>=e.width?c.outerWidth()/e.naturalWidth*a.zoomDiv.width():c.outerWidth()/e.width*a.zoomDiv.width();a.ch=1>=e.height?c.outerHeight()/e.naturalHeight*a.zoomDiv.height():c.outerHeight()/e.height*a.zoomDiv.height();a.lens=b('<div class="yith_magnifier_lens" />').css({width:a.cw,height:a.ch}).appendTo(f);a.mouseTrap.css("cursor",a.lens.css("cursor"));d=!1;a.options.tint&&(a.tint=b("<div />").css({display:"none",position:"absolute",
21
+ left:0,top:0,width:c.outerWidth(),height:c.outerHeight(),backgroundColor:a.options.tint,opacity:a.options.tintOpacity}).appendTo(f),a.lens.append(b("<img />",{src:c.attr("src")})),d=!0,a.tint.fadeIn(500));a.options.softFocus&&(a.softFocus=b("<div />").css({position:"absolute",display:"none",top:"1px",left:"1px",width:c.outerWidth(),height:c.outerHeight(),opacity:0.5}).appendTo(f),a.softFocus.append(b("<img />",{src:c.attr("src")})),0==a.lens.find("img").length&&a.lens.append(b("<img />",{src:c.attr("src")})),
22
+ d=!0,a.softFocus.fadeIn(500));d||a.lens.css("opacity",a.options.lensOpacity);"inside"!==a.options.position&&a.lens.fadeIn(500);a.zw._controlLoop()})},_controlLoop:function(){var a=this;if(this.lens){var b=this.mx-this.zoomImage.offset().left-0.5*this.cw>>0,f=this.my-this.zoomImage.offset().top-0.5*this.ch>>0;0>b?b=0:b>this.zoomImage.outerWidth()-this.cw&&(b=this.zoomImage.outerWidth()-this.cw);0>f?f=0:f>this.zoomImage.outerHeight()-this.ch&&(f=this.zoomImage.outerHeight()-this.ch);this.lens.css({left:b-
23
+ 2,top:f-1});this.lens.find("img").css({width:this.zoomImage.outerWidth(),height:this.zoomImage.outerHeight(),marginLeft:-b+"px ",marginTop:-f+"px"});this.destU=1>=this.IMG_zoomImage.width?b/this.zoomImage.outerWidth()*this.IMG_zoomImage.naturalWidth>>0:b/this.zoomImage.outerWidth()*this.IMG_zoomImage.width>>0;this.destV=1>=this.IMG_zoomImage.height?f/this.zoomImage.outerHeight()*this.IMG_zoomImage.naturalHeight>>0:f/this.zoomImage.outerHeight()*this.IMG_zoomImage.height>>0;this.currU+=(this.destU-
24
+ this.currU)/this.options.smoothMove;this.currV+=(this.destV-this.currV)/this.options.smoothMove;this.zoomDiv.css("background-position",-(this.currU>>0)+"px "+(-(this.currV>>0)+"px"))}this.controlTimer=setTimeout(function(){a._controlLoop()},30)},_onLeave:function(){this.options.onLeave();this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null);this._removeElements()},_removeElements:function(){this.lens&&(this.lens.remove(),this.lens=null);this.tint&&(this.tint.remove(),this.tint=null);this.softFocus&&
25
+ (this.softFocus.remove(),this.softFocus=null);0<this.element.find(".yith_magnifier_loading").length&&this.element.find(".yith_magnifier_loading").remove()},_isPhone:function(){var a=navigator.userAgent.toLowerCase();return a.match(/iphone/i)||a.match(/ipod/i)||a.match(/android/i)},destroy:function(){this.zoom&&this.zoom.unwrap();this.mouseTrap&&(this.mouseTrap.unbind(),this.mouseTrap.remove(),this.mouseTrap=null);this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null);this.options.disableRightClick&&
26
+ b(document).unbind();this._removeElements();this.options.elements.gallery.unbind();this.element.removeData("yith_magnifier")}};b.fn.yith_magnifier=function(a){if("string"===typeof a){var e=Array.prototype.slice.call(arguments,1);this.each(function(){var f=b.data(this,"yith_magnifier");f?b.isFunction(f[a])&&"_"!==a.charAt(0)?f[a].apply(f,e):b.error("no such method '"+a+"' for yith_magnifier instance"):b.error("cannot call methods on yith_magnifier prior to initialization; attempted to call method '"+
27
+ a+"'")})}else this.each(function(){b.data(this,"yith_magnifier")?b.error("yith_magnifier already istantiated."):b.data(this,"yith_magnifier",new b.yith_magnifier(a,this))});return this}})(window,jQuery);
class.yith-wcmg-admin.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
- * @version 1.0.7
8
  */
9
 
10
  if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
+ * @version 1.0.8
8
  */
9
 
10
  if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
class.yith-wcmg-frontend.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
- * @version 1.0.7
8
  */
9
 
10
  if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
@@ -88,11 +88,12 @@ if( !class_exists( 'YITH_WCMG_Frontend' ) ) {
88
  */
89
  public function enqueue_styles_scripts() {
90
  global $post;
91
-
92
- if( is_product() || ( ! empty( $post->post_content ) && strstr( $post->post_content, '[product_page' ) ) ) {
93
- $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
94
 
95
- wp_enqueue_script('jquery-caroufredsel', YITH_WCMG_URL . 'assets/js/jquery.carouFredSel' . $suffix .'.js', array('jquery'), '6.2.1', true);
 
 
 
 
96
  wp_enqueue_script('yith-magnifier', YITH_WCMG_URL . 'assets/js/yith_magnifier' . $suffix .'.js', array('jquery'), $this->version, true);
97
  wp_enqueue_script('yith_wcmg_frontend', YITH_WCMG_URL . 'assets/js/frontend' . $suffix .'.js', array('jquery', 'yith-magnifier'), $this->version, true);
98
  wp_enqueue_style( 'yith-magnifier', YITH_WCMG_URL . 'assets/css/yith_magnifier.css' );
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
+ * @version 1.0.8
8
  */
9
 
10
  if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
88
  */
89
  public function enqueue_styles_scripts() {
90
  global $post;
 
 
 
91
 
92
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
93
+ wp_register_script('yith-magnifier-slider', YITH_WCMG_URL . 'assets/js/jquery.carouFredSel' . $suffix .'.js', array('jquery'), '6.2.1', true);
94
+
95
+ if( is_product() || ( ! empty( $post->post_content ) && strstr( $post->post_content, '[product_page' ) ) ) {
96
+ wp_enqueue_script('yith-magnifier-slider');
97
  wp_enqueue_script('yith-magnifier', YITH_WCMG_URL . 'assets/js/yith_magnifier' . $suffix .'.js', array('jquery'), $this->version, true);
98
  wp_enqueue_script('yith_wcmg_frontend', YITH_WCMG_URL . 'assets/js/frontend' . $suffix .'.js', array('jquery', 'yith-magnifier'), $this->version, true);
99
  wp_enqueue_style( 'yith-magnifier', YITH_WCMG_URL . 'assets/css/yith_magnifier.css' );
class.yith-wcmg.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
- * @version 1.0.7
8
  */
9
 
10
  if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
@@ -22,7 +22,7 @@ if( !class_exists( 'YITH_WCMG' ) ) {
22
  * @var string
23
  * @since 1.0.0
24
  */
25
- public $version = '1.0.7';
26
 
27
  /**
28
  * Plugin object
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
+ * @version 1.0.8
8
  */
9
 
10
  if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
22
  * @var string
23
  * @since 1.0.0
24
  */
25
+ public $version = '1.0.8';
26
 
27
  /**
28
  * Plugin object
functions.yith-wcmg.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
- * @version 1.0.7
8
  */
9
 
10
  if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
+ * @version 1.0.8
8
  */
9
 
10
  if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images.
6
- * Version: 1.0.7
7
  * Author: Your Inspiration Themes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yit
@@ -11,7 +11,7 @@
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Magnifier
14
- * @version 1.0.7
15
  */
16
  /* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images.
6
+ * Version: 1.0.8
7
  * Author: Your Inspiration Themes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yit
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Magnifier
14
+ * @version 1.0.8
15
  */
16
  /* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
uninstall.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
- * @version 1.0.7
8
  */
9
 
10
  // If uninstall not called from WordPress exit
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
+ * @version 1.0.8
8
  */
9
 
10
  // If uninstall not called from WordPress exit