Version Description
Download this release
Release Info
Developer | yithemes |
Plugin | YITH WooCommerce Zoom Magnifier |
Version | 1.3.4 |
Comparing to | |
See all releases |
Code changes from version 1.3.3 to 1.3.4
- README.txt +5 -1
- assets/js/yith_magnifier.min.js +1 -1
- init.php +3 -3
README.txt
CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
|
|
4 |
Tags: zoom, magnifier, slider, carousel, woocommerce
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.9.4
|
7 |
-
Stable tag: 1.3.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
Documentation: https://docs.yithemes.com/yith-woocommerce-zoom-magnifier/
|
@@ -52,6 +52,10 @@ YITH WooCommerce Zoom Magnifier will add a new tab called "Zoom Magnifier" in "Y
|
|
52 |
|
53 |
== Changelog ==
|
54 |
|
|
|
|
|
|
|
|
|
55 |
= Version 1.3.3 - Released: June 22, 2018 =
|
56 |
|
57 |
* Update: documentation link
|
4 |
Tags: zoom, magnifier, slider, carousel, woocommerce
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.9.4
|
7 |
+
Stable tag: 1.3.4
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
Documentation: https://docs.yithemes.com/yith-woocommerce-zoom-magnifier/
|
52 |
|
53 |
== Changelog ==
|
54 |
|
55 |
+
= Version 1.3.4 - Released: June 26, 2018 =
|
56 |
+
|
57 |
+
* Fix: click thumbnails and zoom them
|
58 |
+
|
59 |
= Version 1.3.3 - Released: June 22, 2018 =
|
60 |
|
61 |
* Update: documentation link
|
assets/js/yith_magnifier.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(t,d,i){"use strict";var u,p;d.fn.imagesLoaded===i&&(u=jQuery,p="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",u.fn.imagesLoaded=function(o){var e=this,n=u.isFunction(u.Deferred)?u.Deferred():0,s=u.isFunction(n.notify),a=e.find("img").add(e.filter("img")),r=[],m=[],h=[];function l(){var t=u(m),i=u(h);n&&(h.length?n.reject(a,t,i):n.resolve(a)),u.isFunction(o)&&o.call(e,a,t,i)}function c(t){g(t.target,"error"===t.type)}function g(t,i){t.src!==p&&-1===u.inArray(t,r)&&(r.push(t),i?h.push(t):m.push(t),u.data(t,"imagesLoaded",{isBroken:i,src:t.src}),s&&n.notifyWith(u(t),[i,a,u(m),u(h)]),a.length===r.length&&(setTimeout(l),a.unbind(".imagesLoaded",c)))}return u.isPlainObject(o)&&u.each(o,function(t,i){"callback"===t?o=i:n&&n[t](i)}),a.length?a.bind("load.imagesLoaded error.imagesLoaded",c).each(function(t,i){var o=i.src,e=u.data(i,"imagesLoaded");e&&e.src===o?g(i,e.isBroken):i.complete&&void 0!==i.naturalWidth?g(i,0===i.naturalWidth||0===i.naturalHeight):(i.readyState||i.complete)&&(i.src=p,i.src=o)}):l(),n?n.promise(e):e}),d.yith_magnifier=function(t,i){this.t=i,this.element=d(i),this._init(t)},d.yith_magnifier.defaults={zoomWidth:"auto",zoomHeight:"auto",position:"right",tint:!1,tintOpacity:.5,lensOpacity:.5,softFocus:!1,smoothMove:3,showTitle:!0,titleOpacity:.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},onMove:function(){return!1},onClick:function(){return!1},elements:{zoom:d(".yith_magnifier_zoom"),zoomImage:d(".yith_magnifier_zoom img").first(),gallery:d(".yith_magnifier_gallery li a")}},d.yith_magnifier.prototype={_init:function(t){var o=this;d(document).trigger("yith_magnifier_before_init"),d.each(d.yith_magnifier.defaults.elements,function(t,i){d.yith_magnifier.defaults.elements[t]=d(i,o)}),o.options=d.extend(!0,{},d.yith_magnifier.defaults,t),o.isPhone=o._isPhone(),o._loading(),o.element.imagesLoaded(function(){o.options.onLoad(),o._initZoom(),o._initGallery()}),d(document).trigger("yith_magnifier_after_init")},_initGallery:function(){var o=this,t=o.options.elements,i=t.gallery,e=t.zoom,n=t.zoomImage;0<i.length?(i.on("click",function(t){t.preventDefault(),d("#yith_wc_zoom_magnifier_click_on_gallery").val("yes");var i=d(this);o.destroy(),e.attr("href",this.href),n.attr("src",i.data("small")).attr("srcset",i.data("small")).attr("src-orig",i.data("small")).attr("title","").attr("title",i.attr("title")),d.data(o.t,"yith_magnifier",new d.yith_magnifier(o.options,o.element))}),o.options.enableSlider&&(i.closest("ul").trigger("yith_magnifier_slider_destroy"),i.closest("ul")[o.options.slider](o.options.sliderOptions))):i.on("click",function(t){return t.preventDefault(),!1})},_loading:function(){if(this.options.disableRightClick&&d(document).on("contextmenu",function(t){return!1}),this.mouseTrap===i){var t=this.options.elements.zoom.width();this.options.loadingLabel&&d('<div class="yith_magnifier_loading">'+this.options.loadingLabel+"</div>").css({width:t,"text-align":"center",opacity:.5}).appendTo(this.options.elements.zoom.parent())}},_initZoom:function(){var i=this;i.zoom=i.options.elements.zoom,i.zoomImage=i.options.elements.zoomImage;var t="yith_magnifier_zoom_wrap";i.options.zoom_wrap_additional_css&&(d("."+t).length||(t+=" "+i.options.zoom_wrap_additional_css)),i.zoom.wrap('<div class="'+t+'"></div>'),i.IMG_zoomImage=new Image;var o=!0;d("#yith_wc_zoom_magnifier_click_on_gallery").length&&"yes"==d("#yith_wc_zoom_magnifier_click_on_gallery").val()&&(d("#yith_wc_zoom_magnifier_click_on_gallery").val("no"),o=!1);var e=d(".woocommerce-variation-add-to-cart .variation_id").val();if(d.isNumeric(e)&&0!=e&&o){var n={action:"yith_wc_zoom_magnifier_get_main_image",product_id:e};d.ajax({data:n,url:yith_wc_zoom_magnifier_storage_object.ajax_url,type:"post",error:function(t){console.log("ERROR - Yith_WC_Zoom_Magnifier"),console.log(t)},success:function(t){i.IMG_zoomImage.src=t.url,i.IMG_smallImage=new Image,i.IMG_smallImage.src=i.zoomImage.attr("src"),d.browser&&d.browser.msie&&8==d.browser.version?d(i.IMG_zoomImage).load(function(){i._initTrap()}):d([i.IMG_zoomImage,i.IMG_smallImage]).imagesLoaded(function(){i._initTrap()}),d(document).trigger("yith_magnifier_after_init_zoom")}})}else i.IMG_zoomImage.src=i.zoom.attr("href"),i.IMG_smallImage=new Image,i.IMG_smallImage.src=i.zoomImage.attr("src"),d.browser&&d.browser.msie&&8==d.browser.version?d(i.IMG_zoomImage).load(function(){i._initTrap()}):d([i.IMG_zoomImage,i.IMG_smallImage]).imagesLoaded(function(){i._initTrap()}),d(document).trigger("yith_magnifier_after_init_zoom")},_initTrap:function(){var h=this,l=h.IMG_zoomImage;h.IMG_smallImage;h.mx=0,h.my=0,h.controlTimer=0,h.lens=null,h.tint=null,h.softFocus=null,h.zoomDiv=null,h.cw=0,h.ch=0,h.zw=0,h.destU=0,h.destV=0,h.currU=0,h.currV=0,h.mouseTrap=null;var c=h.options.elements.zoom,g=h.options.elements.zoomImage;d(".yith_magnifier_loading").remove(),this.element.find(".yith_magnifier_mousetrap")&&this.element.find(".yith_magnifier_mousetrap").remove(),this.mouseTrap=d('<div class="yith_magnifier_mousetrap" />').css({width:"100%",height:"100%",top:0,left:0}).appendTo(c.parent());var u="ontouchstart"in document.documentElement;this.mouseTrap.on("touchmove mousemove",this,function(t){h.options.onMove(),h.mx=void 0!==t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,h.my=void 0!==t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY}).on("touchend mouseleave",this,function(t){return clearTimeout(h.controlTimer),h.lens&&h.lens.fadeOut(299),h.tint&&h.tint.fadeOut(299),h.softFocus&&h.softFocus.fadeOut(299),h.zoomDiv.fadeOut(300,function(){h._onLeave()}),!1}).on("touchstart click",this,function(t){h.options.onClick()}).on("touchstart mouseenter",this,function(t){h.options.onEnter(),u&&t.preventDefault(),h.mx=void 0!==t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,h.my=void 0!==t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY,h.zw=t.data,h.zoomDiv&&(h.zoomDiv.stop(!0,!1),h.zoomDiv.remove());var i=h.options.adjustX,o=h.options.adjustY,e=g.outerWidth(),n=g.outerHeight(),s=h.options.zoomWidth,a=h.options.zoomHeight;"auto"==h.options.zoomWidth&&(s=e),"auto"==h.options.zoomHeight&&(a=n);var r=c.parent();switch(h.options.position){case"top":o-=a;break;case"right":i+=e;break;case"bottom":o+=n;break;case"left":i-=s;break;case"inside":s=e,a=n;break;default:(r=d("#"+h.options.position)).length?(s=r.innerWidth(),a=r.innerHeight()):(r=c,i+=e,o+=n)}h.isPhone&&"inside"==h.options.phoneBehavior&&(s=e,a=n,o=i=0),h.zoomDiv=d('<div class="yith_magnifier_zoom_magnifier" />').css({left:i,top:o,width:s,height:a,"background-repeat":"no-repeat",backgroundImage:"url("+l.src+")"}).appendTo(r),g.attr("title")&&h.options.showTitle&&d('<div class="yith_magnifier_title">'+g.attr("title")+"</div>").appendTo(h.zoomDiv),h.isPhone?"disable"!=h.options.phoneBehavior?h.zoomDiv.fadeIn(500):h.lens.fadeOut(299):h.zoomDiv.fadeIn(500),h.lens&&(h.lens.remove(),h.lens=null),l.width<=1?h.cw=g.outerWidth()/l.naturalWidth*h.zoomDiv.width():h.cw=g.outerWidth()/l.width*h.zoomDiv.width(),l.height<=1?h.ch=g.outerHeight()/l.naturalHeight*h.zoomDiv.height():h.ch=g.outerHeight()/l.height*h.zoomDiv.height(),h.lens=d('<div class="yith_magnifier_lens" />').css({width:h.cw,height:h.ch}).appendTo(c),h.mouseTrap.css("cursor",h.lens.css("cursor"));var m=!1;h.options.tint&&(h.tint=d("<div />").css({display:"none",position:"absolute",left:0,top:0,width:g.outerWidth(),height:g.outerHeight(),backgroundColor:h.options.tint,opacity:h.options.tintOpacity}).appendTo(c),h.lens.append(d("<img />",{src:g.attr("src")})),m=!0,h.tint.fadeIn(500)),h.options.softFocus&&(h.softFocus=d("<div />").css({position:"absolute",display:"none",top:"1px",left:"1px",width:g.outerWidth(),height:g.outerHeight(),opacity:.5}).appendTo(c),h.softFocus.append(d("<img />",{src:g.attr("src")})),0==h.lens.find("img").length&&h.lens.append(d("<img />",{src:g.attr("src")})),m=!0,h.softFocus.fadeIn(500)),m||h.lens.css("opacity",h.options.lensOpacity),"inside"!==h.options.position&&h.lens.fadeIn(500),h.zw._controlLoop()})},_controlLoop:function(){var t=this;if(this.lens){var i=this.mx-this.zoomImage.offset().left-.5*this.cw>>0,o=this.my-this.zoomImage.offset().top-.5*this.ch>>0;i<0?i=0:i>this.zoomImage.outerWidth()-this.cw&&(i=this.zoomImage.outerWidth()-this.cw),o<0?o=0:o>this.zoomImage.outerHeight()-this.ch&&(o=this.zoomImage.outerHeight()-this.ch),this.lens.css({left:i-2,top:o-1}),this.lens.find("img").css({width:this.zoomImage.outerWidth(),height:this.zoomImage.outerHeight(),marginLeft:-i+"px ",marginTop:-o+"px"}),this.IMG_zoomImage.width<=1?this.destU=i/this.zoomImage.outerWidth()*this.IMG_zoomImage.naturalWidth>>0:this.destU=i/this.zoomImage.outerWidth()*this.IMG_zoomImage.width>>0,this.IMG_zoomImage.height<=1?this.destV=o/this.zoomImage.outerHeight()*this.IMG_zoomImage.naturalHeight>>0:this.destV=o/this.zoomImage.outerHeight()*this.IMG_zoomImage.height>>0,this.currU+=(this.destU-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(){t._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&&(this.softFocus.remove(),this.softFocus=null),0<this.element.find(".yith_magnifier_loading").length&&this.element.find(".yith_magnifier_loading").remove()},_isPhone:function(){var t=navigator.userAgent.toLowerCase();return t.match(/iphone/i)||t.match(/ipod/i)||t.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&&d(document).unbind(),this._removeElements(),this.options.elements.gallery.unbind(),this.element.removeData("yith_magnifier")}},d.fn.yith_magnifier=function(i){if("string"==typeof i){var o=Array.prototype.slice.call(arguments,1);this.each(function(){var t=d.data(this,"yith_magnifier");t?d.isFunction(t[i])&&"_"!==i.charAt(0)?t[i].apply(t,o):d.error("no such method '"+i+"' for yith_magnifier instance"):d.error("cannot call methods on yith_magnifier prior to initialization; attempted to call method '"+i+"'")})}else this.each(function(){d.data(this,"yith_magnifier")?d.error("yith_magnifier already istantiated."):d.data(this,"yith_magnifier",new d.yith_magnifier(i,this))});return this}}(window,jQuery);
|
1 |
+
!function(t,d,i){"use strict";var g,p;d.fn.imagesLoaded===i&&(g=jQuery,p="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",g.fn.imagesLoaded=function(o){var e=this,n=g.isFunction(g.Deferred)?g.Deferred():0,s=g.isFunction(n.notify),a=e.find("img").add(e.filter("img")),r=[],m=[],h=[];function l(){var t=g(m),i=g(h);n&&(h.length?n.reject(a,t,i):n.resolve(a)),g.isFunction(o)&&o.call(e,a,t,i)}function c(t){u(t.target,"error"===t.type)}function u(t,i){t.src!==p&&-1===g.inArray(t,r)&&(r.push(t),i?h.push(t):m.push(t),g.data(t,"imagesLoaded",{isBroken:i,src:t.src}),s&&n.notifyWith(g(t),[i,a,g(m),g(h)]),a.length===r.length&&(setTimeout(l),a.unbind(".imagesLoaded",c)))}return g.isPlainObject(o)&&g.each(o,function(t,i){"callback"===t?o=i:n&&n[t](i)}),a.length?a.bind("load.imagesLoaded error.imagesLoaded",c).each(function(t,i){var o=i.src,e=g.data(i,"imagesLoaded");e&&e.src===o?u(i,e.isBroken):i.complete&&void 0!==i.naturalWidth?u(i,0===i.naturalWidth||0===i.naturalHeight):(i.readyState||i.complete)&&(i.src=p,i.src=o)}):l(),n?n.promise(e):e}),d.yith_magnifier=function(t,i){this.t=i,this.element=d(i),this._init(t)},d.yith_magnifier.defaults={zoomWidth:"auto",zoomHeight:"auto",position:"right",tint:!1,tintOpacity:.5,lensOpacity:.5,softFocus:!1,smoothMove:3,showTitle:!0,titleOpacity:.5,adjustX:0,adjustY:0,phoneBehavior:"inside",loadingLabel:"Loading...",enableSlider:!0,slider:"carouFredSel",sliderOptions:{},from_gallery:"no",onLoad:function(){return!1},onEnter:function(){return!1},onLeave:function(){return!1},onMove:function(){return!1},onClick:function(){return!1},elements:{zoom:d(".yith_magnifier_zoom"),zoomImage:d(".yith_magnifier_zoom img").first(),gallery:d(".yith_magnifier_gallery li a")}},d.yith_magnifier.prototype={_init:function(t){var o=this;d(document).trigger("yith_magnifier_before_init"),d.each(d.yith_magnifier.defaults.elements,function(t,i){d.yith_magnifier.defaults.elements[t]=d(i,o)}),o.options=d.extend(!0,{},d.yith_magnifier.defaults,t),o.isPhone=o._isPhone(),o._loading(),o.element.imagesLoaded(function(){o.options.onLoad(),o._initZoom(),o._initGallery()}),d(document).trigger("yith_magnifier_after_init")},_initGallery:function(){var o=this,t=o.options.elements,i=t.gallery,e=t.zoom,n=t.zoomImage;0<i.length?(i.on("click",function(t){t.preventDefault(),o.options.from_gallery="yes";var i=d(this);o.destroy(),e.attr("href",this.href),n.attr("src",i.data("small")).attr("srcset",i.data("small")).attr("src-orig",i.data("small")).attr("title","").attr("title",i.attr("title")),d.data(o.t,"yith_magnifier",new d.yith_magnifier(o.options,o.element))}),o.options.enableSlider&&(i.closest("ul").trigger("yith_magnifier_slider_destroy"),i.closest("ul")[o.options.slider](o.options.sliderOptions))):i.on("click",function(t){return t.preventDefault(),!1})},_loading:function(){if(this.options.disableRightClick&&d(document).on("contextmenu",function(t){return!1}),this.mouseTrap===i){var t=this.options.elements.zoom.width();this.options.loadingLabel&&d('<div class="yith_magnifier_loading">'+this.options.loadingLabel+"</div>").css({width:t,"text-align":"center",opacity:.5}).appendTo(this.options.elements.zoom.parent())}},_initZoom:function(){var i=this;i.zoom=i.options.elements.zoom,i.zoomImage=i.options.elements.zoomImage;var t="yith_magnifier_zoom_wrap";i.options.zoom_wrap_additional_css&&(d("."+t).length||(t+=" "+i.options.zoom_wrap_additional_css)),i.zoom.wrap('<div class="'+t+'"></div>'),i.IMG_zoomImage=new Image;var o=d(".woocommerce-variation-add-to-cart .variation_id").val();if(d.isNumeric(o)&&0!=o&&"no"==i.options.from_gallery){var e={action:"yith_wc_zoom_magnifier_get_main_image",product_id:o};d.ajax({data:e,url:yith_wc_zoom_magnifier_storage_object.ajax_url,type:"post",error:function(t){console.log("ERROR - Yith_WC_Zoom_Magnifier"),console.log(t)},success:function(t){i.IMG_zoomImage.src=t.url,i.IMG_smallImage=new Image,i.IMG_smallImage.src=i.zoomImage.attr("src"),d.browser&&d.browser.msie&&8==d.browser.version?d(i.IMG_zoomImage).load(function(){i._initTrap()}):d([i.IMG_zoomImage,i.IMG_smallImage]).imagesLoaded(function(){i._initTrap()}),d(document).trigger("yith_magnifier_after_init_zoom")}})}else i.IMG_zoomImage.src=i.zoom.attr("href"),i.IMG_smallImage=new Image,i.IMG_smallImage.src=i.zoomImage.attr("src"),d.browser&&d.browser.msie&&8==d.browser.version?d(i.IMG_zoomImage).load(function(){i._initTrap()}):d([i.IMG_zoomImage,i.IMG_smallImage]).imagesLoaded(function(){i._initTrap()}),d(document).trigger("yith_magnifier_after_init_zoom")},_initTrap:function(){var h=this,l=h.IMG_zoomImage;h.IMG_smallImage;h.mx=0,h.my=0,h.controlTimer=0,h.lens=null,h.tint=null,h.softFocus=null,h.zoomDiv=null,h.cw=0,h.ch=0,h.zw=0,h.destU=0,h.destV=0,h.currU=0,h.currV=0,h.mouseTrap=null;var c=h.options.elements.zoom,u=h.options.elements.zoomImage;d(".yith_magnifier_loading").remove(),this.element.find(".yith_magnifier_mousetrap")&&this.element.find(".yith_magnifier_mousetrap").remove(),this.mouseTrap=d('<div class="yith_magnifier_mousetrap" />').css({width:"100%",height:"100%",top:0,left:0}).appendTo(c.parent());var g="ontouchstart"in document.documentElement;this.mouseTrap.on("touchmove mousemove",this,function(t){h.options.onMove(),h.mx=void 0!==t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,h.my=void 0!==t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY}).on("touchend mouseleave",this,function(t){return clearTimeout(h.controlTimer),h.lens&&h.lens.fadeOut(299),h.tint&&h.tint.fadeOut(299),h.softFocus&&h.softFocus.fadeOut(299),h.zoomDiv.fadeOut(300,function(){h._onLeave()}),!1}).on("touchstart click",this,function(t){h.options.onClick()}).on("touchstart mouseenter",this,function(t){h.options.onEnter(),g&&t.preventDefault(),h.mx=void 0!==t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,h.my=void 0!==t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY,h.zw=t.data,h.zoomDiv&&(h.zoomDiv.stop(!0,!1),h.zoomDiv.remove());var i=h.options.adjustX,o=h.options.adjustY,e=u.outerWidth(),n=u.outerHeight(),s=h.options.zoomWidth,a=h.options.zoomHeight;"auto"==h.options.zoomWidth&&(s=e),"auto"==h.options.zoomHeight&&(a=n);var r=c.parent();switch(h.options.position){case"top":o-=a;break;case"right":i+=e;break;case"bottom":o+=n;break;case"left":i-=s;break;case"inside":s=e,a=n;break;default:(r=d("#"+h.options.position)).length?(s=r.innerWidth(),a=r.innerHeight()):(r=c,i+=e,o+=n)}h.isPhone&&"inside"==h.options.phoneBehavior&&(s=e,a=n,o=i=0),h.zoomDiv=d('<div class="yith_magnifier_zoom_magnifier" />').css({left:i,top:o,width:s,height:a,"background-repeat":"no-repeat",backgroundImage:"url("+l.src+")"}).appendTo(r),u.attr("title")&&h.options.showTitle&&d('<div class="yith_magnifier_title">'+u.attr("title")+"</div>").appendTo(h.zoomDiv),h.isPhone?"disable"!=h.options.phoneBehavior?h.zoomDiv.fadeIn(500):h.lens.fadeOut(299):h.zoomDiv.fadeIn(500),h.lens&&(h.lens.remove(),h.lens=null),l.width<=1?h.cw=u.outerWidth()/l.naturalWidth*h.zoomDiv.width():h.cw=u.outerWidth()/l.width*h.zoomDiv.width(),l.height<=1?h.ch=u.outerHeight()/l.naturalHeight*h.zoomDiv.height():h.ch=u.outerHeight()/l.height*h.zoomDiv.height(),h.lens=d('<div class="yith_magnifier_lens" />').css({width:h.cw,height:h.ch}).appendTo(c),h.mouseTrap.css("cursor",h.lens.css("cursor"));var m=!1;h.options.tint&&(h.tint=d("<div />").css({display:"none",position:"absolute",left:0,top:0,width:u.outerWidth(),height:u.outerHeight(),backgroundColor:h.options.tint,opacity:h.options.tintOpacity}).appendTo(c),h.lens.append(d("<img />",{src:u.attr("src")})),m=!0,h.tint.fadeIn(500)),h.options.softFocus&&(h.softFocus=d("<div />").css({position:"absolute",display:"none",top:"1px",left:"1px",width:u.outerWidth(),height:u.outerHeight(),opacity:.5}).appendTo(c),h.softFocus.append(d("<img />",{src:u.attr("src")})),0==h.lens.find("img").length&&h.lens.append(d("<img />",{src:u.attr("src")})),m=!0,h.softFocus.fadeIn(500)),m||h.lens.css("opacity",h.options.lensOpacity),"inside"!==h.options.position&&h.lens.fadeIn(500),h.zw._controlLoop()})},_controlLoop:function(){var t=this;if(this.lens){var i=this.mx-this.zoomImage.offset().left-.5*this.cw>>0,o=this.my-this.zoomImage.offset().top-.5*this.ch>>0;i<0?i=0:i>this.zoomImage.outerWidth()-this.cw&&(i=this.zoomImage.outerWidth()-this.cw),o<0?o=0:o>this.zoomImage.outerHeight()-this.ch&&(o=this.zoomImage.outerHeight()-this.ch),this.lens.css({left:i-2,top:o-1}),this.lens.find("img").css({width:this.zoomImage.outerWidth(),height:this.zoomImage.outerHeight(),marginLeft:-i+"px ",marginTop:-o+"px"}),this.IMG_zoomImage.width<=1?this.destU=i/this.zoomImage.outerWidth()*this.IMG_zoomImage.naturalWidth>>0:this.destU=i/this.zoomImage.outerWidth()*this.IMG_zoomImage.width>>0,this.IMG_zoomImage.height<=1?this.destV=o/this.zoomImage.outerHeight()*this.IMG_zoomImage.naturalHeight>>0:this.destV=o/this.zoomImage.outerHeight()*this.IMG_zoomImage.height>>0,this.currU+=(this.destU-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(){t._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&&(this.softFocus.remove(),this.softFocus=null),0<this.element.find(".yith_magnifier_loading").length&&this.element.find(".yith_magnifier_loading").remove()},_isPhone:function(){var t=navigator.userAgent.toLowerCase();return t.match(/iphone/i)||t.match(/ipod/i)||t.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&&d(document).unbind(),this._removeElements(),this.options.elements.gallery.unbind(),this.element.removeData("yith_magnifier")}},d.fn.yith_magnifier=function(i){if("string"==typeof i){var o=Array.prototype.slice.call(arguments,1);this.each(function(){var t=d.data(this,"yith_magnifier");t?d.isFunction(t[i])&&"_"!==i.charAt(0)?t[i].apply(t,o):d.error("no such method '"+i+"' for yith_magnifier instance"):d.error("cannot call methods on yith_magnifier prior to initialization; attempted to call method '"+i+"'")})}else this.each(function(){d.data(this,"yith_magnifier")?d.error("yith_magnifier already istantiated."):d.data(this,"yith_magnifier",new d.yith_magnifier(i,this))});return this}}(window,jQuery);
|
init.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: YITH WooCommerce Zoom Magnifier
|
4 |
* Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
|
5 |
* Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images and a thumbnail slider for the product image gallery.
|
6 |
-
* Version: 1.3.
|
7 |
* Author: YITHEMES
|
8 |
* Author URI: https://yithemes.com/
|
9 |
* Text Domain: yith-woocommerce-zoom-magnifier
|
@@ -13,7 +13,7 @@
|
|
13 |
*
|
14 |
* @author Your Inspiration Themes
|
15 |
* @package YITH WooCommerce Magnifier
|
16 |
-
* @version 1.3.
|
17 |
*/
|
18 |
/* Copyright 2013-2018 Your Inspiration Themes (email : plugins@yithemes.com)
|
19 |
|
@@ -80,7 +80,7 @@ if ( ! function_exists ( 'yith_plugin_registration_hook' ) ) {
|
|
80 |
register_activation_hook ( __FILE__, 'yith_plugin_registration_hook' );
|
81 |
|
82 |
defined ( 'YITH_YWZM_FREE_INIT' ) || define ( 'YITH_YWZM_FREE_INIT', plugin_basename ( __FILE__ ) );
|
83 |
-
defined ( 'YITH_YWZM_VERSION' ) || define ( 'YITH_YWZM_VERSION', '1.3.
|
84 |
defined ( 'YITH_YWZM_FILE' ) || define ( 'YITH_YWZM_FILE', __FILE__ );
|
85 |
defined ( 'YITH_YWZM_DIR' ) || define ( 'YITH_YWZM_DIR', plugin_dir_path ( __FILE__ ) );
|
86 |
defined ( 'YITH_YWZM_URL' ) || define ( 'YITH_YWZM_URL', plugins_url ( '/', __FILE__ ) );
|
3 |
* Plugin Name: YITH WooCommerce Zoom Magnifier
|
4 |
* Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
|
5 |
* Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images and a thumbnail slider for the product image gallery.
|
6 |
+
* Version: 1.3.4
|
7 |
* Author: YITHEMES
|
8 |
* Author URI: https://yithemes.com/
|
9 |
* Text Domain: yith-woocommerce-zoom-magnifier
|
13 |
*
|
14 |
* @author Your Inspiration Themes
|
15 |
* @package YITH WooCommerce Magnifier
|
16 |
+
* @version 1.3.4
|
17 |
*/
|
18 |
/* Copyright 2013-2018 Your Inspiration Themes (email : plugins@yithemes.com)
|
19 |
|
80 |
register_activation_hook ( __FILE__, 'yith_plugin_registration_hook' );
|
81 |
|
82 |
defined ( 'YITH_YWZM_FREE_INIT' ) || define ( 'YITH_YWZM_FREE_INIT', plugin_basename ( __FILE__ ) );
|
83 |
+
defined ( 'YITH_YWZM_VERSION' ) || define ( 'YITH_YWZM_VERSION', '1.3.4' );
|
84 |
defined ( 'YITH_YWZM_FILE' ) || define ( 'YITH_YWZM_FILE', __FILE__ );
|
85 |
defined ( 'YITH_YWZM_DIR' ) || define ( 'YITH_YWZM_DIR', plugin_dir_path ( __FILE__ ) );
|
86 |
defined ( 'YITH_YWZM_URL' ) || define ( 'YITH_YWZM_URL', plugins_url ( '/', __FILE__ ) );
|