YITH WooCommerce Zoom Magnifier - Version 1.2.4

Version Description

Download this release

Release Info

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

Code changes from version 1.2.3 to 1.2.4

README.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: zoom, magnifier, woocommerce, product image, themes, yit, e-commerce, shop, thumbnail, thumbnail slider, zoom image, carousel, image carousel
5
  Requires at least: 3.5.1
6
  Tested up to: 4.2.2
7
- Stable tag: 1.2.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -59,6 +59,10 @@ The size of the Zoom Image is automatically setted. If you want to change these
59
 
60
  == Changelog ==
61
 
 
 
 
 
62
  = Version 1.2.3 - RELEASED: MAY 29, 2015 =
63
 
64
  * Added: included jquery-migrate as prerequisite.
4
  Tags: zoom, magnifier, woocommerce, product image, themes, yit, e-commerce, shop, thumbnail, thumbnail slider, zoom image, carousel, image carousel
5
  Requires at least: 3.5.1
6
  Tested up to: 4.2.2
7
+ Stable tag: 1.2.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
59
 
60
  == Changelog ==
61
 
62
+ = Version 1.2.4 - RELEASED: JUN 26, 2015 =
63
+
64
+ * Added: support to srcset and src-orig attributes.
65
+
66
  = Version 1.2.3 - RELEASED: MAY 29, 2015 =
67
 
68
  * Added: included jquery-migrate as prerequisite.
assets/js/frontend.js CHANGED
@@ -5,10 +5,10 @@
5
  * @package YITH WooCommerce Zoom Magnifier
6
  * @version 1.1.2
7
  */
8
- jQuery(document).ready(function($){
9
 
10
  var yith_wcmg = $('.images');
11
- var yith_wcmg_zoom = $('.yith_magnifier_zoom');
12
  var yith_wcmg_image = $('.yith_magnifier_zoom img');
13
 
14
  var yith_wcmg_default_zoom = yith_wcmg.find('.yith_magnifier_zoom').attr('href');
@@ -16,29 +16,32 @@ jQuery(document).ready(function($){
16
 
17
  yith_wcmg.yith_magnifier(yith_magnifier_options);
18
 
19
- $( document ).on( 'found_variation', 'form.variations_form', function( event, variation ) {
20
  var image_magnifier = variation.image_magnifier ? variation.image_magnifier : yith_wcmg_default_zoom;
21
- var image_src = variation.image_src ? variation.image_src : yith_wcmg_default_image;
22
 
23
  yith_wcmg_zoom.attr('href', image_magnifier);
24
  yith_wcmg_image.attr('src', image_src);
 
 
25
 
26
- if( yith_wcmg.data('yith_magnifier') ) {
27
  yith_wcmg.yith_magnifier('destroy');
28
  }
29
 
30
  yith_wcmg.yith_magnifier(yith_magnifier_options);
31
- }).on( 'reset_image', function( event ) {
32
- yith_wcmg_zoom.attr('href', yith_wcmg_default_zoom);
33
- yith_wcmg_image.attr('src', yith_wcmg_default_image);
 
 
34
 
35
- if( yith_wcmg.data('yith_magnifier') ) {
36
- yith_wcmg.yith_magnifier('destroy');
37
- }
38
-
39
- yith_wcmg.yith_magnifier(yith_magnifier_options);
40
- })
41
 
42
- $( 'form.variations_form .variations select').trigger('change');
43
- });
44
 
 
 
5
  * @package YITH WooCommerce Zoom Magnifier
6
  * @version 1.1.2
7
  */
8
+ jQuery(document).ready(function ($) {
9
 
10
  var yith_wcmg = $('.images');
11
+ var yith_wcmg_zoom = $('.yith_magnifier_zoom');
12
  var yith_wcmg_image = $('.yith_magnifier_zoom img');
13
 
14
  var yith_wcmg_default_zoom = yith_wcmg.find('.yith_magnifier_zoom').attr('href');
16
 
17
  yith_wcmg.yith_magnifier(yith_magnifier_options);
18
 
19
+ $(document).on('found_variation', 'form.variations_form', function (event, variation) {
20
  var image_magnifier = variation.image_magnifier ? variation.image_magnifier : yith_wcmg_default_zoom;
21
+ var image_src = variation.image_src ? variation.image_src : yith_wcmg_default_image;
22
 
23
  yith_wcmg_zoom.attr('href', image_magnifier);
24
  yith_wcmg_image.attr('src', image_src);
25
+ yith_wcmg_image.attr('srcset', image_src);
26
+ yith_wcmg_image.attr('src-orig', image_src);
27
 
28
+ if (yith_wcmg.data('yith_magnifier')) {
29
  yith_wcmg.yith_magnifier('destroy');
30
  }
31
 
32
  yith_wcmg.yith_magnifier(yith_magnifier_options);
33
+ }).on('reset_image', function (event) {
34
+ yith_wcmg_zoom.attr('href', yith_wcmg_default_zoom);
35
+ yith_wcmg_image.attr('src', yith_wcmg_default_image);
36
+ yith_wcmg_image.attr('srcset', yith_wcmg_default_image);
37
+ yith_wcmg_image.attr('src-orig', yith_wcmg_default_image);
38
 
39
+ if (yith_wcmg.data('yith_magnifier')) {
40
+ yith_wcmg.yith_magnifier('destroy');
41
+ }
 
 
 
42
 
43
+ yith_wcmg.yith_magnifier(yith_magnifier_options);
44
+ })
45
 
46
+ $('form.variations_form .variations select').trigger('change');
47
+ });
assets/js/frontend.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(i){var r=i(".images"),t=i(".yith_magnifier_zoom"),a=i(".yith_magnifier_zoom img"),e=r.find(".yith_magnifier_zoom").attr("href"),n=r.find(".yith_magnifier_zoom img").attr("src");r.yith_magnifier(yith_magnifier_options),i(document).on("found_variation","form.variations_form",function(i,m){var o=m.image_magnifier?m.image_magnifier:e,f=m.image_src?m.image_src:n;t.attr("href",o),a.attr("src",f),r.data("yith_magnifier")&&r.yith_magnifier("destroy"),r.yith_magnifier(yith_magnifier_options)}).on("reset_image",function(){t.attr("href",e),a.attr("src",n),r.data("yith_magnifier")&&r.yith_magnifier("destroy"),r.yith_magnifier(yith_magnifier_options)}),i("form.variations_form .variations select").trigger("change")});
1
+ jQuery(document).ready(function(i){var r=i(".images"),t=i(".yith_magnifier_zoom"),a=i(".yith_magnifier_zoom img"),e=r.find(".yith_magnifier_zoom").attr("href"),n=r.find(".yith_magnifier_zoom img").attr("src");r.yith_magnifier(yith_magnifier_options),i(document).on("found_variation","form.variations_form",function(i,m){var o=m.image_magnifier?m.image_magnifier:e,f=m.image_src?m.image_src:n;t.attr("href",o),a.attr("src",f),a.attr("srcset",f),a.attr("src-orig",f),r.data("yith_magnifier")&&r.yith_magnifier("destroy"),r.yith_magnifier(yith_magnifier_options)}).on("reset_image",function(){t.attr("href",e),a.attr("src",n),a.attr("srcset",n),a.attr("src-orig",n),r.data("yith_magnifier")&&r.yith_magnifier("destroy"),r.yith_magnifier(yith_magnifier_options)}),i("form.variations_form .variations select").trigger("change")});
assets/js/jquery.carouFredSel.js CHANGED
@@ -3577,7 +3577,6 @@
3577
  });
3578
  }
3579
  function sz_setSizes($c, o) {
3580
- debugger;
3581
  var $w = $c.parent(),
3582
  $i = $c.children(),
3583
  $v = gi_getCurrentItems($i, o),
3577
  });
3578
  }
3579
  function sz_setSizes($c, o) {
 
3580
  var $w = $c.parent(),
3581
  $i = $c.children(),
3582
  $v = gi_getCurrentItems($i, o),
assets/js/yith_magnifier.js CHANGED
@@ -7,11 +7,12 @@
7
  * MIT License.
8
  */
9
 
10
- ;(function( window, $, undefined ) {
 
11
  'use strict';
12
 
13
  //include imagesLoaded plugin
14
- if( $.fn.imagesLoaded === undefined ) {
15
  /*!
16
  * jQuery imagesLoaded plugin v2.1.1
17
  * http://github.com/desandro/imagesloaded
@@ -22,17 +23,18 @@
22
  /*jshint curly: true, eqeqeq: true, noempty: true, strict: true, undef: true, browser: true */
23
  /*global jQuery: false */
24
 
25
- ;(function($, undefined) {
 
26
  'use strict';
27
 
28
  // blank image data-uri bypasses webkit log warning (thx doug jones)
29
  var BLANK = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';
30
 
31
- $.fn.imagesLoaded = function( callback ) {
32
  var $this = this,
33
  deferred = $.isFunction($.Deferred) ? $.Deferred() : 0,
34
  hasNotify = $.isFunction(deferred.notify),
35
- $images = $this.find('img').add( $this.filter('img') ),
36
  loaded = [],
37
  proper = [],
38
  broken = [];
@@ -52,97 +54,97 @@
52
  var $proper = $(proper),
53
  $broken = $(broken);
54
 
55
- if ( deferred ) {
56
- if ( broken.length ) {
57
- deferred.reject( $images, $proper, $broken );
58
  } else {
59
- deferred.resolve( $images );
60
  }
61
  }
62
 
63
- if ( $.isFunction( callback ) ) {
64
- callback.call( $this, $images, $proper, $broken );
65
  }
66
  }
67
 
68
- function imgLoadedHandler( event ) {
69
- imgLoaded( event.target, event.type === 'error' );
70
  }
71
 
72
- function imgLoaded( img, isBroken ) {
73
  // don't proceed if BLANK image, or image is already loaded
74
- if ( img.src === BLANK || $.inArray( img, loaded ) !== -1 ) {
75
  return;
76
  }
77
 
78
  // store element in loaded images array
79
- loaded.push( img );
80
 
81
  // keep track of broken and properly loaded images
82
- if ( isBroken ) {
83
- broken.push( img );
84
  } else {
85
- proper.push( img );
86
  }
87
 
88
  // cache image and its state for future calls
89
- $.data( img, 'imagesLoaded', { isBroken: isBroken, src: img.src } );
90
 
91
  // trigger deferred progress method if present
92
- if ( hasNotify ) {
93
- deferred.notifyWith( $(img), [ isBroken, $images, $(proper), $(broken) ] );
94
  }
95
 
96
  // call doneLoading and clean listeners if all images are loaded
97
- if ( $images.length === loaded.length ) {
98
- setTimeout( doneLoading );
99
- $images.unbind( '.imagesLoaded', imgLoadedHandler );
100
  }
101
  }
102
 
103
  // if no images, trigger immediately
104
- if ( !$images.length ) {
105
  doneLoading();
106
  } else {
107
- $images.bind( 'load.imagesLoaded error.imagesLoaded', imgLoadedHandler )
108
- .each( function( i, el ) {
109
  var src = el.src;
110
 
111
  // find out if this image has been already checked for status
112
  // if it was, and src has not changed, call imgLoaded on it
113
- var cached = $.data( el, 'imagesLoaded' );
114
- if ( cached && cached.src === src ) {
115
- imgLoaded( el, cached.isBroken );
116
  return;
117
  }
118
 
119
  // if complete is true and browser supports natural sizes, try
120
  // to check for image status manually
121
- if ( el.complete && el.naturalWidth !== undefined ) {
122
- imgLoaded( el, el.naturalWidth === 0 || el.naturalHeight === 0 );
123
  return;
124
  }
125
 
126
  // cached images don't fire load sometimes, so we reset src, but only when
127
  // dealing with IE, or image is complete (loaded) and failed manual check
128
  // webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
129
- if ( el.readyState || el.complete ) {
130
  el.src = BLANK;
131
  el.src = src;
132
  }
133
  });
134
  }
135
 
136
- return deferred ? deferred.promise( $this ) : $this;
137
  };
138
 
139
  })(jQuery);
140
  }
141
 
142
- $.yith_magnifier = function( options, element ) {
143
  this.t = element;
144
- this.element = $( element );
145
- this._init( options );
146
  };
147
 
148
  $.yith_magnifier.defaults = {
@@ -166,16 +168,26 @@
166
  slider: 'carouFredSel',
167
  sliderOptions: {},
168
 
169
- onLoad : function() { return false; },
170
- onEnter: function() { return false },
171
- onLeave: function() { return false },
172
- onMove: function() { return false },
173
- onClick: function() { return false; },
 
 
 
 
 
 
 
 
 
 
174
 
175
- elements : {
176
- zoom : $('.yith_magnifier_zoom'),
177
  zoomImage: $('.yith_magnifier_zoom img'),
178
- gallery : $('.yith_magnifier_gallery li a')
179
  }
180
  };
181
 
@@ -188,19 +200,19 @@
188
  *
189
  * @private
190
  */
191
- _init : function( options ) {
192
  var self = this;
193
 
194
- $.each($.yith_magnifier.defaults.elements, function(i,v){
195
  var el = $.yith_magnifier.defaults.elements;
196
  el[i] = $(v, self);
197
  });
198
- self.options = $.extend( true, {}, $.yith_magnifier.defaults, options );
199
  self.isPhone = self._isPhone();
200
 
201
  self._loading();
202
 
203
- self.element.imagesLoaded(function(){
204
  self.options.onLoad();
205
  self._initZoom();
206
  self._initGallery();
@@ -214,37 +226,39 @@
214
  * @private
215
  *
216
  */
217
- _initGallery: function() {
218
  var self = this;
219
- var elements = self.options.elements;
220
 
221
- var gallery = elements.gallery;
222
- var zoom = elements.zoom;
223
  var zoomImage = elements.zoomImage;
224
 
225
- if( gallery.length > 0 ) {
226
- gallery.on('click', function(e){
227
  e.preventDefault();
228
 
229
  var t = $(this);
230
  self.destroy();
231
 
232
  zoom.attr('href', this.href);
233
-
234
  zoomImage.attr('src', t.data('small'))
 
 
235
  .attr('title', '')
236
  .attr('title', t.attr('title'));
237
- $.data( self.t, 'yith_magnifier', new $.yith_magnifier( self.options, self.element ) );
 
238
  });
239
 
240
  //gallery.filter(':first').trigger('click');
241
 
242
- if( self.options.enableSlider ) {
243
- gallery.parents('ul')[self.options.slider]( self.options.sliderOptions );
244
  }
245
 
246
  } else {
247
- gallery.on('click', function(e){
248
  e.preventDefault();
249
  return false;
250
  })
@@ -256,9 +270,9 @@
256
  *
257
  * @private
258
  */
259
- _loading : function() {
260
- if( this.options.disableRightClick ) {
261
- $(document).on('contextmenu', function(e){
262
  return false;
263
  });
264
  }
@@ -267,7 +281,7 @@
267
  var w = this.options.elements.zoom.width();
268
 
269
  $('<div class="yith_magnifier_loading">' + this.options.loadingLabel + '</div>').css({
270
- 'width' : w,
271
  'text-align': 'center',
272
  opacity: .5
273
  }).appendTo(this.options.elements.zoom.parent());
@@ -279,7 +293,7 @@
279
  *
280
  * @private
281
  */
282
- _initZoom : function() {
283
  var self = this;
284
 
285
  self.zoom = self.options.elements.zoom;
@@ -296,14 +310,14 @@
296
  self.IMG_smallImage = new Image();
297
  self.IMG_smallImage.src = self.zoomImage.attr('src');
298
 
299
- if( $.browser.msie && $.browser.version == 8 ) {
300
- $(self.IMG_zoomImage).load(function(){
301
 
302
  self._initTrap();
303
  });
304
  } else {
305
 
306
- $([self.IMG_zoomImage, self.IMG_smallImage]).imagesLoaded(function(){
307
 
308
  self._initTrap();
309
  });
@@ -315,7 +329,7 @@
315
  *
316
  * @private
317
  */
318
- _initTrap : function() {
319
  var self = this;
320
  var zoomImg = self.IMG_zoomImage,
321
  thumbImg = self.IMG_smallImage;
@@ -343,7 +357,7 @@
343
  //this.zoom.parent().siblings('.yith_magnifier_loading').remove();
344
  $('.yith_magnifier_loading').remove();
345
 
346
- if( this.element.find('.yith_magnifier_mousetrap') ) {
347
  this.element.find('.yith_magnifier_mousetrap').remove();
348
  }
349
 
@@ -355,25 +369,31 @@
355
  }).appendTo(zoom.parent());
356
 
357
  // Detect device type, normal mouse or touchy(ipad android) by albanx
358
- var touchy = ("ontouchstart" in document.documentElement) ? true : false;
359
- var event_move = 'touchmove mousemove';
360
- var event_end = 'touchend mouseleave';
361
- var event_ent = 'touchstart mouseenter';
362
  var event_click = 'touchstart click';
363
 
364
  this.mouseTrap.on(event_move, this, function (e) {
365
  self.options.onMove();
366
 
367
- self.mx = ( typeof(e.originalEvent.touches) !='undefined' ) ? e.originalEvent.touches[0].pageX : e.pageX;
368
- self.my = ( typeof(e.originalEvent.touches) !='undefined' ) ? e.originalEvent.touches[0].pageY : e.pageY;
369
 
370
  }).on(event_end, this, function (e) {
371
 
372
  clearTimeout(self.controlTimer);
373
  //event.data.removeBits();
374
- if(self.lens) { self.lens.fadeOut(299); }
375
- if(self.tint) { self.tint.fadeOut(299); }
376
- if(self.softFocus) { self.softFocus.fadeOut(299); }
 
 
 
 
 
 
377
  self.zoomDiv.fadeOut(300, function () {
378
  self._onLeave();
379
  });
@@ -385,12 +405,12 @@
385
  }).on(event_ent, this, function (e) {
386
  self.options.onEnter();
387
 
388
- if(touchy) {
389
  e.preventDefault();
390
  }
391
 
392
- self.mx = ( typeof(e.originalEvent.touches) !='undefined' ) ? e.originalEvent.touches[0].pageX : e.pageX;
393
- self.my = ( typeof(e.originalEvent.touches) !='undefined' ) ? e.originalEvent.touches[0].pageY : e.pageY;
394
 
395
  self.zw = e.data;
396
  if (self.zoomDiv) {
@@ -448,7 +468,7 @@
448
  }
449
  }
450
 
451
- if( self.isPhone && self.options.phoneBehavior == 'inside' ) {
452
  w = siw;
453
  h = sih;
454
  xPos = 0;
@@ -461,7 +481,7 @@
461
  width: w,
462
  height: h,
463
  'background-repeat': 'no-repeat',
464
- backgroundImage: 'url('+ zoomImg.src + ')'
465
  }).appendTo(appendTo);
466
 
467
  // Add the title from title tag.
@@ -469,8 +489,8 @@
469
  $('<div class="yith_magnifier_title">' + zoomImage.attr('title') + '</div>').appendTo(self.zoomDiv);
470
  }
471
 
472
- if( self.isPhone ) {
473
- if( self.options.phoneBehavior != 'disable' ) {
474
  self.zoomDiv.fadeIn(500);
475
  } else {
476
  self.lens.fadeOut(299);
@@ -484,13 +504,13 @@
484
  self.lens = null;
485
  }
486
 
487
- if( zoomImg.width <= 1) {
488
  self.cw = (zoomImage.outerWidth() / zoomImg.naturalWidth) * self.zoomDiv.width();
489
  } else {
490
  self.cw = (zoomImage.outerWidth() / zoomImg.width) * self.zoomDiv.width();
491
  }
492
 
493
- if( zoomImg.height <= 1 ) {
494
  self.ch = (zoomImage.outerHeight() / zoomImg.naturalHeight) * self.zoomDiv.height();
495
  } else {
496
  self.ch = (zoomImage.outerHeight() / zoomImg.height) * self.zoomDiv.height();
@@ -548,7 +568,7 @@
548
  src: zoomImage.attr('src')
549
  }));
550
 
551
- if( self.lens.find('img').length == 0 ) {
552
  self.lens.append($('<img />', {
553
  src: zoomImage.attr('src')
554
  }));
@@ -562,7 +582,9 @@
562
  if (!noTrans) {
563
  self.lens.css('opacity', self.options.lensOpacity);
564
  }
565
- if ( self.options.position !== 'inside' ) { self.lens.fadeIn(500); }
 
 
566
 
567
  // Start processing.
568
  self.zw._controlLoop();
@@ -576,7 +598,7 @@
576
  *
577
  * @private
578
  */
579
- _controlLoop: function() {
580
  var self = this;
581
 
582
  if (this.lens) {
@@ -611,13 +633,13 @@
611
  });
612
 
613
 
614
- if( this.IMG_zoomImage.width <= 1 ) {
615
  this.destU = (((x) / this.zoomImage.outerWidth()) * this.IMG_zoomImage.naturalWidth) >> 0;
616
  } else {
617
  this.destU = (((x) / this.zoomImage.outerWidth()) * this.IMG_zoomImage.width) >> 0;
618
  }
619
 
620
- if( this.IMG_zoomImage.height <= 1 ) {
621
  this.destV = (((y) / this.zoomImage.outerHeight()) * this.IMG_zoomImage.naturalHeight) >> 0;
622
  } else {
623
  this.destV = (((y) / this.zoomImage.outerHeight()) * this.IMG_zoomImage.height) >> 0;
@@ -640,7 +662,7 @@
640
  *
641
  * @private
642
  */
643
- _onLeave: function() {
644
  this.options.onLeave();
645
 
646
  if (this.zoomDiv) {
@@ -656,7 +678,7 @@
656
  *
657
  * @private
658
  */
659
- _removeElements: function() {
660
  if (this.lens) {
661
  this.lens.remove();
662
  this.lens = null;
@@ -672,7 +694,7 @@
672
  this.softFocus = null;
673
  }
674
 
675
- if( this.element.find('.yith_magnifier_loading').length > 0 ) {
676
  this.element.find('.yith_magnifier_loading').remove();
677
  }
678
  },
@@ -682,7 +704,7 @@
682
  *
683
  * @private
684
  */
685
- _isPhone: function() {
686
  var userAgent = navigator.userAgent.toLowerCase();
687
 
688
  return ( userAgent.match(/iphone/i) || userAgent.match(/ipod/i) || userAgent.match(/android/i) );
@@ -692,12 +714,12 @@
692
  * Destroy the instance
693
  *
694
  */
695
- destroy: function() {
696
- if(this.zoom) {
697
  this.zoom.unwrap();
698
  }
699
 
700
- if(this.mouseTrap) {
701
  this.mouseTrap.unbind();
702
  this.mouseTrap.remove();
703
  this.mouseTrap = null;
@@ -708,7 +730,7 @@
708
  this.zoomDiv = null;
709
  }
710
 
711
- if( this.options.disableRightClick ) {
712
  $(document).unbind();
713
  }
714
 
@@ -718,29 +740,29 @@
718
  }
719
  };
720
 
721
- $.fn.yith_magnifier = function( options ) {
722
 
723
- if ( typeof options === 'string' ) {
724
- var args = Array.prototype.slice.call( arguments, 1 );
725
 
726
- this.each(function() {
727
- var instance = $.data( this, 'yith_magnifier' );
728
- if ( !instance ) {
729
- $.error( "cannot call methods on yith_magnifier prior to initialization; " +
730
- "attempted to call method '" + options + "'" );
731
  return;
732
  }
733
- if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
734
- $.error( "no such method '" + options + "' for yith_magnifier instance" );
735
  return;
736
  }
737
- instance[ options ].apply( instance, args );
738
  });
739
  } else {
740
- this.each(function() {
741
- var instance = $.data( this, 'yith_magnifier' );
742
- if ( !instance ) {
743
- $.data( this, 'yith_magnifier', new $.yith_magnifier( options, this ) );
744
  } else {
745
  $.error('yith_magnifier already istantiated.');
746
  }
@@ -750,4 +772,4 @@
750
  };
751
 
752
 
753
- })( window, jQuery );
7
  * MIT License.
8
  */
9
 
10
+ ;
11
+ (function (window, $, undefined) {
12
  'use strict';
13
 
14
  //include imagesLoaded plugin
15
+ if ($.fn.imagesLoaded === undefined) {
16
  /*!
17
  * jQuery imagesLoaded plugin v2.1.1
18
  * http://github.com/desandro/imagesloaded
23
  /*jshint curly: true, eqeqeq: true, noempty: true, strict: true, undef: true, browser: true */
24
  /*global jQuery: false */
25
 
26
+ ;
27
+ (function ($, undefined) {
28
  'use strict';
29
 
30
  // blank image data-uri bypasses webkit log warning (thx doug jones)
31
  var BLANK = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';
32
 
33
+ $.fn.imagesLoaded = function (callback) {
34
  var $this = this,
35
  deferred = $.isFunction($.Deferred) ? $.Deferred() : 0,
36
  hasNotify = $.isFunction(deferred.notify),
37
+ $images = $this.find('img').add($this.filter('img')),
38
  loaded = [],
39
  proper = [],
40
  broken = [];
54
  var $proper = $(proper),
55
  $broken = $(broken);
56
 
57
+ if (deferred) {
58
+ if (broken.length) {
59
+ deferred.reject($images, $proper, $broken);
60
  } else {
61
+ deferred.resolve($images);
62
  }
63
  }
64
 
65
+ if ($.isFunction(callback)) {
66
+ callback.call($this, $images, $proper, $broken);
67
  }
68
  }
69
 
70
+ function imgLoadedHandler(event) {
71
+ imgLoaded(event.target, event.type === 'error');
72
  }
73
 
74
+ function imgLoaded(img, isBroken) {
75
  // don't proceed if BLANK image, or image is already loaded
76
+ if (img.src === BLANK || $.inArray(img, loaded) !== -1) {
77
  return;
78
  }
79
 
80
  // store element in loaded images array
81
+ loaded.push(img);
82
 
83
  // keep track of broken and properly loaded images
84
+ if (isBroken) {
85
+ broken.push(img);
86
  } else {
87
+ proper.push(img);
88
  }
89
 
90
  // cache image and its state for future calls
91
+ $.data(img, 'imagesLoaded', {isBroken: isBroken, src: img.src});
92
 
93
  // trigger deferred progress method if present
94
+ if (hasNotify) {
95
+ deferred.notifyWith($(img), [isBroken, $images, $(proper), $(broken)]);
96
  }
97
 
98
  // call doneLoading and clean listeners if all images are loaded
99
+ if ($images.length === loaded.length) {
100
+ setTimeout(doneLoading);
101
+ $images.unbind('.imagesLoaded', imgLoadedHandler);
102
  }
103
  }
104
 
105
  // if no images, trigger immediately
106
+ if (!$images.length) {
107
  doneLoading();
108
  } else {
109
+ $images.bind('load.imagesLoaded error.imagesLoaded', imgLoadedHandler)
110
+ .each(function (i, el) {
111
  var src = el.src;
112
 
113
  // find out if this image has been already checked for status
114
  // if it was, and src has not changed, call imgLoaded on it
115
+ var cached = $.data(el, 'imagesLoaded');
116
+ if (cached && cached.src === src) {
117
+ imgLoaded(el, cached.isBroken);
118
  return;
119
  }
120
 
121
  // if complete is true and browser supports natural sizes, try
122
  // to check for image status manually
123
+ if (el.complete && el.naturalWidth !== undefined) {
124
+ imgLoaded(el, el.naturalWidth === 0 || el.naturalHeight === 0);
125
  return;
126
  }
127
 
128
  // cached images don't fire load sometimes, so we reset src, but only when
129
  // dealing with IE, or image is complete (loaded) and failed manual check
130
  // webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
131
+ if (el.readyState || el.complete) {
132
  el.src = BLANK;
133
  el.src = src;
134
  }
135
  });
136
  }
137
 
138
+ return deferred ? deferred.promise($this) : $this;
139
  };
140
 
141
  })(jQuery);
142
  }
143
 
144
+ $.yith_magnifier = function (options, element) {
145
  this.t = element;
146
+ this.element = $(element);
147
+ this._init(options);
148
  };
149
 
150
  $.yith_magnifier.defaults = {
168
  slider: 'carouFredSel',
169
  sliderOptions: {},
170
 
171
+ onLoad: function () {
172
+ return false;
173
+ },
174
+ onEnter: function () {
175
+ return false
176
+ },
177
+ onLeave: function () {
178
+ return false
179
+ },
180
+ onMove: function () {
181
+ return false
182
+ },
183
+ onClick: function () {
184
+ return false;
185
+ },
186
 
187
+ elements: {
188
+ zoom: $('.yith_magnifier_zoom'),
189
  zoomImage: $('.yith_magnifier_zoom img'),
190
+ gallery: $('.yith_magnifier_gallery li a')
191
  }
192
  };
193
 
200
  *
201
  * @private
202
  */
203
+ _init: function (options) {
204
  var self = this;
205
 
206
+ $.each($.yith_magnifier.defaults.elements, function (i, v) {
207
  var el = $.yith_magnifier.defaults.elements;
208
  el[i] = $(v, self);
209
  });
210
+ self.options = $.extend(true, {}, $.yith_magnifier.defaults, options);
211
  self.isPhone = self._isPhone();
212
 
213
  self._loading();
214
 
215
+ self.element.imagesLoaded(function () {
216
  self.options.onLoad();
217
  self._initZoom();
218
  self._initGallery();
226
  * @private
227
  *
228
  */
229
+ _initGallery: function () {
230
  var self = this;
231
+ var elements = self.options.elements;
232
 
233
+ var gallery = elements.gallery;
234
+ var zoom = elements.zoom;
235
  var zoomImage = elements.zoomImage;
236
 
237
+ if (gallery.length > 0) {
238
+ gallery.on('click', function (e) {
239
  e.preventDefault();
240
 
241
  var t = $(this);
242
  self.destroy();
243
 
244
  zoom.attr('href', this.href);
 
245
  zoomImage.attr('src', t.data('small'))
246
+ .attr('srcset', t.data('small'))
247
+ .attr('src-orig', t.data('small'))
248
  .attr('title', '')
249
  .attr('title', t.attr('title'));
250
+
251
+ $.data(self.t, 'yith_magnifier', new $.yith_magnifier(self.options, self.element));
252
  });
253
 
254
  //gallery.filter(':first').trigger('click');
255
 
256
+ if (self.options.enableSlider) {
257
+ gallery.parents('ul')[self.options.slider](self.options.sliderOptions);
258
  }
259
 
260
  } else {
261
+ gallery.on('click', function (e) {
262
  e.preventDefault();
263
  return false;
264
  })
270
  *
271
  * @private
272
  */
273
+ _loading: function () {
274
+ if (this.options.disableRightClick) {
275
+ $(document).on('contextmenu', function (e) {
276
  return false;
277
  });
278
  }
281
  var w = this.options.elements.zoom.width();
282
 
283
  $('<div class="yith_magnifier_loading">' + this.options.loadingLabel + '</div>').css({
284
+ 'width': w,
285
  'text-align': 'center',
286
  opacity: .5
287
  }).appendTo(this.options.elements.zoom.parent());
293
  *
294
  * @private
295
  */
296
+ _initZoom: function () {
297
  var self = this;
298
 
299
  self.zoom = self.options.elements.zoom;
310
  self.IMG_smallImage = new Image();
311
  self.IMG_smallImage.src = self.zoomImage.attr('src');
312
 
313
+ if ($.browser.msie && $.browser.version == 8) {
314
+ $(self.IMG_zoomImage).load(function () {
315
 
316
  self._initTrap();
317
  });
318
  } else {
319
 
320
+ $([self.IMG_zoomImage, self.IMG_smallImage]).imagesLoaded(function () {
321
 
322
  self._initTrap();
323
  });
329
  *
330
  * @private
331
  */
332
+ _initTrap: function () {
333
  var self = this;
334
  var zoomImg = self.IMG_zoomImage,
335
  thumbImg = self.IMG_smallImage;
357
  //this.zoom.parent().siblings('.yith_magnifier_loading').remove();
358
  $('.yith_magnifier_loading').remove();
359
 
360
+ if (this.element.find('.yith_magnifier_mousetrap')) {
361
  this.element.find('.yith_magnifier_mousetrap').remove();
362
  }
363
 
369
  }).appendTo(zoom.parent());
370
 
371
  // Detect device type, normal mouse or touchy(ipad android) by albanx
372
+ var touchy = ("ontouchstart" in document.documentElement) ? true : false;
373
+ var event_move = 'touchmove mousemove';
374
+ var event_end = 'touchend mouseleave';
375
+ var event_ent = 'touchstart mouseenter';
376
  var event_click = 'touchstart click';
377
 
378
  this.mouseTrap.on(event_move, this, function (e) {
379
  self.options.onMove();
380
 
381
+ self.mx = ( typeof(e.originalEvent.touches) != 'undefined' ) ? e.originalEvent.touches[0].pageX : e.pageX;
382
+ self.my = ( typeof(e.originalEvent.touches) != 'undefined' ) ? e.originalEvent.touches[0].pageY : e.pageY;
383
 
384
  }).on(event_end, this, function (e) {
385
 
386
  clearTimeout(self.controlTimer);
387
  //event.data.removeBits();
388
+ if (self.lens) {
389
+ self.lens.fadeOut(299);
390
+ }
391
+ if (self.tint) {
392
+ self.tint.fadeOut(299);
393
+ }
394
+ if (self.softFocus) {
395
+ self.softFocus.fadeOut(299);
396
+ }
397
  self.zoomDiv.fadeOut(300, function () {
398
  self._onLeave();
399
  });
405
  }).on(event_ent, this, function (e) {
406
  self.options.onEnter();
407
 
408
+ if (touchy) {
409
  e.preventDefault();
410
  }
411
 
412
+ self.mx = ( typeof(e.originalEvent.touches) != 'undefined' ) ? e.originalEvent.touches[0].pageX : e.pageX;
413
+ self.my = ( typeof(e.originalEvent.touches) != 'undefined' ) ? e.originalEvent.touches[0].pageY : e.pageY;
414
 
415
  self.zw = e.data;
416
  if (self.zoomDiv) {
468
  }
469
  }
470
 
471
+ if (self.isPhone && self.options.phoneBehavior == 'inside') {
472
  w = siw;
473
  h = sih;
474
  xPos = 0;
481
  width: w,
482
  height: h,
483
  'background-repeat': 'no-repeat',
484
+ backgroundImage: 'url(' + zoomImg.src + ')'
485
  }).appendTo(appendTo);
486
 
487
  // Add the title from title tag.
489
  $('<div class="yith_magnifier_title">' + zoomImage.attr('title') + '</div>').appendTo(self.zoomDiv);
490
  }
491
 
492
+ if (self.isPhone) {
493
+ if (self.options.phoneBehavior != 'disable') {
494
  self.zoomDiv.fadeIn(500);
495
  } else {
496
  self.lens.fadeOut(299);
504
  self.lens = null;
505
  }
506
 
507
+ if (zoomImg.width <= 1) {
508
  self.cw = (zoomImage.outerWidth() / zoomImg.naturalWidth) * self.zoomDiv.width();
509
  } else {
510
  self.cw = (zoomImage.outerWidth() / zoomImg.width) * self.zoomDiv.width();
511
  }
512
 
513
+ if (zoomImg.height <= 1) {
514
  self.ch = (zoomImage.outerHeight() / zoomImg.naturalHeight) * self.zoomDiv.height();
515
  } else {
516
  self.ch = (zoomImage.outerHeight() / zoomImg.height) * self.zoomDiv.height();
568
  src: zoomImage.attr('src')
569
  }));
570
 
571
+ if (self.lens.find('img').length == 0) {
572
  self.lens.append($('<img />', {
573
  src: zoomImage.attr('src')
574
  }));
582
  if (!noTrans) {
583
  self.lens.css('opacity', self.options.lensOpacity);
584
  }
585
+ if (self.options.position !== 'inside') {
586
+ self.lens.fadeIn(500);
587
+ }
588
 
589
  // Start processing.
590
  self.zw._controlLoop();
598
  *
599
  * @private
600
  */
601
+ _controlLoop: function () {
602
  var self = this;
603
 
604
  if (this.lens) {
633
  });
634
 
635
 
636
+ if (this.IMG_zoomImage.width <= 1) {
637
  this.destU = (((x) / this.zoomImage.outerWidth()) * this.IMG_zoomImage.naturalWidth) >> 0;
638
  } else {
639
  this.destU = (((x) / this.zoomImage.outerWidth()) * this.IMG_zoomImage.width) >> 0;
640
  }
641
 
642
+ if (this.IMG_zoomImage.height <= 1) {
643
  this.destV = (((y) / this.zoomImage.outerHeight()) * this.IMG_zoomImage.naturalHeight) >> 0;
644
  } else {
645
  this.destV = (((y) / this.zoomImage.outerHeight()) * this.IMG_zoomImage.height) >> 0;
662
  *
663
  * @private
664
  */
665
+ _onLeave: function () {
666
  this.options.onLeave();
667
 
668
  if (this.zoomDiv) {
678
  *
679
  * @private
680
  */
681
+ _removeElements: function () {
682
  if (this.lens) {
683
  this.lens.remove();
684
  this.lens = null;
694
  this.softFocus = null;
695
  }
696
 
697
+ if (this.element.find('.yith_magnifier_loading').length > 0) {
698
  this.element.find('.yith_magnifier_loading').remove();
699
  }
700
  },
704
  *
705
  * @private
706
  */
707
+ _isPhone: function () {
708
  var userAgent = navigator.userAgent.toLowerCase();
709
 
710
  return ( userAgent.match(/iphone/i) || userAgent.match(/ipod/i) || userAgent.match(/android/i) );
714
  * Destroy the instance
715
  *
716
  */
717
+ destroy: function () {
718
+ if (this.zoom) {
719
  this.zoom.unwrap();
720
  }
721
 
722
+ if (this.mouseTrap) {
723
  this.mouseTrap.unbind();
724
  this.mouseTrap.remove();
725
  this.mouseTrap = null;
730
  this.zoomDiv = null;
731
  }
732
 
733
+ if (this.options.disableRightClick) {
734
  $(document).unbind();
735
  }
736
 
740
  }
741
  };
742
 
743
+ $.fn.yith_magnifier = function (options) {
744
 
745
+ if (typeof options === 'string') {
746
+ var args = Array.prototype.slice.call(arguments, 1);
747
 
748
+ this.each(function () {
749
+ var instance = $.data(this, 'yith_magnifier');
750
+ if (!instance) {
751
+ $.error("cannot call methods on yith_magnifier prior to initialization; " +
752
+ "attempted to call method '" + options + "'");
753
  return;
754
  }
755
+ if (!$.isFunction(instance[options]) || options.charAt(0) === "_") {
756
+ $.error("no such method '" + options + "' for yith_magnifier instance");
757
  return;
758
  }
759
+ instance[options].apply(instance, args);
760
  });
761
  } else {
762
+ this.each(function () {
763
+ var instance = $.data(this, 'yith_magnifier');
764
+ if (!instance) {
765
+ $.data(this, 'yith_magnifier', new $.yith_magnifier(options, this));
766
  } else {
767
  $.error('yith_magnifier already istantiated.');
768
  }
772
  };
773
 
774
 
775
+ })(window, jQuery);
assets/js/yith_magnifier.min.js CHANGED
@@ -1,10 +1 @@
1
- /**
2
- * YITH WooCommerce Zoom Magnifier
3
- *
4
- * @version 1.1
5
- * @author Your Inspiration Themes Team <info@yithemes.com>
6
- *
7
- * MIT License.
8
- */
9
-
10
- !function(t,i,o){"use strict";i.fn.imagesLoaded===o&&!function(t,i){var o="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";t.fn.imagesLoaded=function(e){function n(){var i=t(c),o=t(d);h&&(d.length?h.reject(l,i,o):h.resolve(l)),t.isFunction(e)&&e.call(r,l,i,o)}function s(t){a(t.target,"error"===t.type)}function a(i,e){i.src!==o&&-1===t.inArray(i,u)&&(u.push(i),e?d.push(i):c.push(i),t.data(i,"imagesLoaded",{isBroken:e,src:i.src}),m&&h.notifyWith(t(i),[e,l,t(c),t(d)]),l.length===u.length&&(setTimeout(n),l.unbind(".imagesLoaded",s)))}var r=this,h=t.isFunction(t.Deferred)?t.Deferred():0,m=t.isFunction(h.notify),l=r.find("img").add(r.filter("img")),u=[],c=[],d=[];return t.isPlainObject(e)&&t.each(e,function(t,i){"callback"===t?e=i:h&&h[t](i)}),l.length?l.bind("load.imagesLoaded error.imagesLoaded",s).each(function(e,n){var s=n.src,r=t.data(n,"imagesLoaded");return r&&r.src===s?void a(n,r.isBroken):n.complete&&n.naturalWidth!==i?void a(n,0===n.naturalWidth||0===n.naturalHeight):void((n.readyState||n.complete)&&(n.src=o,n.src=s))}):n(),h?h.promise(r):r}}(jQuery),i.yith_magnifier=function(t,o){this.t=o,this.element=i(o),this._init(t)},i.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:i(".yith_magnifier_zoom"),zoomImage:i(".yith_magnifier_zoom img"),gallery:i(".yith_magnifier_gallery li a")}},i.yith_magnifier.prototype={_init:function(t){var o=this;i.each(i.yith_magnifier.defaults.elements,function(t,e){var n=i.yith_magnifier.defaults.elements;n[t]=i(e,o)}),o.options=i.extend(!0,{},i.yith_magnifier.defaults,t),o.isPhone=o._isPhone(),o._loading(),o.element.imagesLoaded(function(){o.options.onLoad(),o._initZoom(),o._initGallery()})},_initGallery:function(){var t=this,o=t.options.elements,e=o.gallery,n=o.zoom,s=o.zoomImage;e.length>0?(e.on("click",function(o){o.preventDefault();var e=i(this);t.destroy(),n.attr("href",this.href),s.attr("src",e.data("small")).attr("title","").attr("title",e.attr("title")),i.data(t.t,"yith_magnifier",new i.yith_magnifier(t.options,t.element))}),t.options.enableSlider&&e.parents("ul")[t.options.slider](t.options.sliderOptions)):e.on("click",function(t){return t.preventDefault(),!1})},_loading:function(){if(this.options.disableRightClick&&i(document).on("contextmenu",function(){return!1}),this.mouseTrap===o){var t=this.options.elements.zoom.width();i('<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 t=this;t.zoom=t.options.elements.zoom,t.zoomImage=t.options.elements.zoomImage,t.zoom.wrap('<div class="yith_magnifier_zoom_wrap"></div>'),t.IMG_zoomImage=new Image,t.IMG_zoomImage.src=t.zoom.attr("href"),t.IMG_smallImage=new Image,t.IMG_smallImage.src=t.zoomImage.attr("src"),i.browser.msie&&8==i.browser.version?i(t.IMG_zoomImage).load(function(){t._initTrap()}):i([t.IMG_zoomImage,t.IMG_smallImage]).imagesLoaded(function(){t._initTrap()})},_initTrap:function(){{var t=this,o=t.IMG_zoomImage;t.IMG_smallImage}t.mx=0,t.my=0,t.controlTimer=0,t.lens=null,t.tint=null,t.softFocus=null,t.zoomDiv=null,t.cw=0,t.ch=0,t.zw=0,t.destU=0,t.destV=0,t.currU=0,t.currV=0,t.mouseTrap=null;var e=t.options.elements.zoom,n=t.options.elements.zoomImage;i(".yith_magnifier_loading").remove(),this.element.find(".yith_magnifier_mousetrap")&&this.element.find(".yith_magnifier_mousetrap").remove(),this.mouseTrap=i('<div class="yith_magnifier_mousetrap" />').css({width:"100%",height:"100%",top:0,left:0}).appendTo(e.parent());var s="ontouchstart"in document.documentElement?!0:!1,a="touchmove mousemove",r="touchend mouseleave",h="touchstart mouseenter",m="touchstart click";this.mouseTrap.on(a,this,function(i){t.options.onMove(),t.mx="undefined"!=typeof i.originalEvent.touches?i.originalEvent.touches[0].pageX:i.pageX,t.my="undefined"!=typeof i.originalEvent.touches?i.originalEvent.touches[0].pageY:i.pageY}).on(r,this,function(){return clearTimeout(t.controlTimer),t.lens&&t.lens.fadeOut(299),t.tint&&t.tint.fadeOut(299),t.softFocus&&t.softFocus.fadeOut(299),t.zoomDiv.fadeOut(300,function(){t._onLeave()}),!1}).on(m,this,function(){t.options.onClick()}).on(h,this,function(a){t.options.onEnter(),s&&a.preventDefault(),t.mx="undefined"!=typeof a.originalEvent.touches?a.originalEvent.touches[0].pageX:a.pageX,t.my="undefined"!=typeof a.originalEvent.touches?a.originalEvent.touches[0].pageY:a.pageY,t.zw=a.data,t.zoomDiv&&(t.zoomDiv.stop(!0,!1),t.zoomDiv.remove());var r=t.options.adjustX,h=t.options.adjustY,m=n.outerWidth(),l=n.outerHeight(),u=t.options.zoomWidth,c=t.options.zoomHeight;"auto"==t.options.zoomWidth&&(u=m),"auto"==t.options.zoomHeight&&(c=l);var d=e.parent();switch(t.options.position){case"top":h-=c;break;case"right":r+=m;break;case"bottom":h+=l;break;case"left":r-=u;break;case"inside":u=m,c=l;break;default:d=i("#"+t.options.position),d.length?(u=d.innerWidth(),c=d.innerHeight()):(d=e,r+=m,h+=l)}t.isPhone&&"inside"==t.options.phoneBehavior&&(u=m,c=l,r=0,h=0),t.zoomDiv=i('<div class="yith_magnifier_zoom_magnifier" />').css({left:r,top:h,width:u,height:c,"background-repeat":"no-repeat",backgroundImage:"url("+o.src+")"}).appendTo(d),n.attr("title")&&t.options.showTitle&&i('<div class="yith_magnifier_title">'+n.attr("title")+"</div>").appendTo(t.zoomDiv),t.isPhone?"disable"!=t.options.phoneBehavior?t.zoomDiv.fadeIn(500):t.lens.fadeOut(299):t.zoomDiv.fadeIn(500),t.lens&&(t.lens.remove(),t.lens=null),t.cw=o.width<=1?n.outerWidth()/o.naturalWidth*t.zoomDiv.width():n.outerWidth()/o.width*t.zoomDiv.width(),t.ch=o.height<=1?n.outerHeight()/o.naturalHeight*t.zoomDiv.height():n.outerHeight()/o.height*t.zoomDiv.height(),t.lens=i('<div class="yith_magnifier_lens" />').css({width:t.cw,height:t.ch}).appendTo(e),t.mouseTrap.css("cursor",t.lens.css("cursor"));var g=!1;t.options.tint&&(t.tint=i("<div />").css({display:"none",position:"absolute",left:0,top:0,width:n.outerWidth(),height:n.outerHeight(),backgroundColor:t.options.tint,opacity:t.options.tintOpacity}).appendTo(e),t.lens.append(i("<img />",{src:n.attr("src")})),g=!0,t.tint.fadeIn(500)),t.options.softFocus&&(t.softFocus=i("<div />").css({position:"absolute",display:"none",top:"1px",left:"1px",width:n.outerWidth(),height:n.outerHeight(),opacity:.5}).appendTo(e),t.softFocus.append(i("<img />",{src:n.attr("src")})),0==t.lens.find("img").length&&t.lens.append(i("<img />",{src:n.attr("src")})),g=!0,t.softFocus.fadeIn(500)),g||t.lens.css("opacity",t.options.lensOpacity),"inside"!==t.options.position&&t.lens.fadeIn(500),t.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;0>i?i=0:i>this.zoomImage.outerWidth()-this.cw&&(i=this.zoomImage.outerWidth()-this.cw),0>o?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.destU=this.IMG_zoomImage.width<=1?i/this.zoomImage.outerWidth()*this.IMG_zoomImage.naturalWidth>>0:i/this.zoomImage.outerWidth()*this.IMG_zoomImage.width>>0,this.destV=this.IMG_zoomImage.height<=1?o/this.zoomImage.outerHeight()*this.IMG_zoomImage.naturalHeight>>0: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),this.element.find(".yith_magnifier_loading").length>0&&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&&i(document).unbind(),this._removeElements(),this.options.elements.gallery.unbind(),this.element.removeData("yith_magnifier")}},i.fn.yith_magnifier=function(t){if("string"==typeof t){var o=Array.prototype.slice.call(arguments,1);this.each(function(){var e=i.data(this,"yith_magnifier");return e?i.isFunction(e[t])&&"_"!==t.charAt(0)?void e[t].apply(e,o):void i.error("no such method '"+t+"' for yith_magnifier instance"):void i.error("cannot call methods on yith_magnifier prior to initialization; attempted to call method '"+t+"'")})}else this.each(function(){var o=i.data(this,"yith_magnifier");o?i.error("yith_magnifier already istantiated."):i.data(this,"yith_magnifier",new i.yith_magnifier(t,this))});return this}}(window,jQuery);
1
+ !function(t,i,o){"use strict";i.fn.imagesLoaded===o&&!function(t,i){var o="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";t.fn.imagesLoaded=function(e){function n(){var i=t(c),o=t(d);h&&(d.length?h.reject(l,i,o):h.resolve(l)),t.isFunction(e)&&e.call(r,l,i,o)}function s(t){a(t.target,"error"===t.type)}function a(i,e){i.src!==o&&-1===t.inArray(i,u)&&(u.push(i),e?d.push(i):c.push(i),t.data(i,"imagesLoaded",{isBroken:e,src:i.src}),m&&h.notifyWith(t(i),[e,l,t(c),t(d)]),l.length===u.length&&(setTimeout(n),l.unbind(".imagesLoaded",s)))}var r=this,h=t.isFunction(t.Deferred)?t.Deferred():0,m=t.isFunction(h.notify),l=r.find("img").add(r.filter("img")),u=[],c=[],d=[];return t.isPlainObject(e)&&t.each(e,function(t,i){"callback"===t?e=i:h&&h[t](i)}),l.length?l.bind("load.imagesLoaded error.imagesLoaded",s).each(function(e,n){var s=n.src,r=t.data(n,"imagesLoaded");return r&&r.src===s?void a(n,r.isBroken):n.complete&&n.naturalWidth!==i?void a(n,0===n.naturalWidth||0===n.naturalHeight):void((n.readyState||n.complete)&&(n.src=o,n.src=s))}):n(),h?h.promise(r):r}}(jQuery),i.yith_magnifier=function(t,o){this.t=o,this.element=i(o),this._init(t)},i.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:i(".yith_magnifier_zoom"),zoomImage:i(".yith_magnifier_zoom img"),gallery:i(".yith_magnifier_gallery li a")}},i.yith_magnifier.prototype={_init:function(t){var o=this;i.each(i.yith_magnifier.defaults.elements,function(t,e){var n=i.yith_magnifier.defaults.elements;n[t]=i(e,o)}),o.options=i.extend(!0,{},i.yith_magnifier.defaults,t),o.isPhone=o._isPhone(),o._loading(),o.element.imagesLoaded(function(){o.options.onLoad(),o._initZoom(),o._initGallery()})},_initGallery:function(){var t=this,o=t.options.elements,e=o.gallery,n=o.zoom,s=o.zoomImage;e.length>0?(e.on("click",function(o){o.preventDefault();var e=i(this);t.destroy(),n.attr("href",this.href),s.attr("src",e.data("small")).attr("srcset",e.data("small")).attr("src-orig",e.data("small")).attr("title","").attr("title",e.attr("title")),i.data(t.t,"yith_magnifier",new i.yith_magnifier(t.options,t.element))}),t.options.enableSlider&&e.parents("ul")[t.options.slider](t.options.sliderOptions)):e.on("click",function(t){return t.preventDefault(),!1})},_loading:function(){if(this.options.disableRightClick&&i(document).on("contextmenu",function(){return!1}),this.mouseTrap===o){var t=this.options.elements.zoom.width();i('<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 t=this;t.zoom=t.options.elements.zoom,t.zoomImage=t.options.elements.zoomImage,t.zoom.wrap('<div class="yith_magnifier_zoom_wrap"></div>'),t.IMG_zoomImage=new Image,t.IMG_zoomImage.src=t.zoom.attr("href"),t.IMG_smallImage=new Image,t.IMG_smallImage.src=t.zoomImage.attr("src"),i.browser.msie&&8==i.browser.version?i(t.IMG_zoomImage).load(function(){t._initTrap()}):i([t.IMG_zoomImage,t.IMG_smallImage]).imagesLoaded(function(){t._initTrap()})},_initTrap:function(){{var t=this,o=t.IMG_zoomImage;t.IMG_smallImage}t.mx=0,t.my=0,t.controlTimer=0,t.lens=null,t.tint=null,t.softFocus=null,t.zoomDiv=null,t.cw=0,t.ch=0,t.zw=0,t.destU=0,t.destV=0,t.currU=0,t.currV=0,t.mouseTrap=null;var e=t.options.elements.zoom,n=t.options.elements.zoomImage;i(".yith_magnifier_loading").remove(),this.element.find(".yith_magnifier_mousetrap")&&this.element.find(".yith_magnifier_mousetrap").remove(),this.mouseTrap=i('<div class="yith_magnifier_mousetrap" />').css({width:"100%",height:"100%",top:0,left:0}).appendTo(e.parent());var s="ontouchstart"in document.documentElement?!0:!1,a="touchmove mousemove",r="touchend mouseleave",h="touchstart mouseenter",m="touchstart click";this.mouseTrap.on(a,this,function(i){t.options.onMove(),t.mx="undefined"!=typeof i.originalEvent.touches?i.originalEvent.touches[0].pageX:i.pageX,t.my="undefined"!=typeof i.originalEvent.touches?i.originalEvent.touches[0].pageY:i.pageY}).on(r,this,function(){return clearTimeout(t.controlTimer),t.lens&&t.lens.fadeOut(299),t.tint&&t.tint.fadeOut(299),t.softFocus&&t.softFocus.fadeOut(299),t.zoomDiv.fadeOut(300,function(){t._onLeave()}),!1}).on(m,this,function(){t.options.onClick()}).on(h,this,function(a){t.options.onEnter(),s&&a.preventDefault(),t.mx="undefined"!=typeof a.originalEvent.touches?a.originalEvent.touches[0].pageX:a.pageX,t.my="undefined"!=typeof a.originalEvent.touches?a.originalEvent.touches[0].pageY:a.pageY,t.zw=a.data,t.zoomDiv&&(t.zoomDiv.stop(!0,!1),t.zoomDiv.remove());var r=t.options.adjustX,h=t.options.adjustY,m=n.outerWidth(),l=n.outerHeight(),u=t.options.zoomWidth,c=t.options.zoomHeight;"auto"==t.options.zoomWidth&&(u=m),"auto"==t.options.zoomHeight&&(c=l);var d=e.parent();switch(t.options.position){case"top":h-=c;break;case"right":r+=m;break;case"bottom":h+=l;break;case"left":r-=u;break;case"inside":u=m,c=l;break;default:d=i("#"+t.options.position),d.length?(u=d.innerWidth(),c=d.innerHeight()):(d=e,r+=m,h+=l)}t.isPhone&&"inside"==t.options.phoneBehavior&&(u=m,c=l,r=0,h=0),t.zoomDiv=i('<div class="yith_magnifier_zoom_magnifier" />').css({left:r,top:h,width:u,height:c,"background-repeat":"no-repeat",backgroundImage:"url("+o.src+")"}).appendTo(d),n.attr("title")&&t.options.showTitle&&i('<div class="yith_magnifier_title">'+n.attr("title")+"</div>").appendTo(t.zoomDiv),t.isPhone?"disable"!=t.options.phoneBehavior?t.zoomDiv.fadeIn(500):t.lens.fadeOut(299):t.zoomDiv.fadeIn(500),t.lens&&(t.lens.remove(),t.lens=null),t.cw=o.width<=1?n.outerWidth()/o.naturalWidth*t.zoomDiv.width():n.outerWidth()/o.width*t.zoomDiv.width(),t.ch=o.height<=1?n.outerHeight()/o.naturalHeight*t.zoomDiv.height():n.outerHeight()/o.height*t.zoomDiv.height(),t.lens=i('<div class="yith_magnifier_lens" />').css({width:t.cw,height:t.ch}).appendTo(e),t.mouseTrap.css("cursor",t.lens.css("cursor"));var g=!1;t.options.tint&&(t.tint=i("<div />").css({display:"none",position:"absolute",left:0,top:0,width:n.outerWidth(),height:n.outerHeight(),backgroundColor:t.options.tint,opacity:t.options.tintOpacity}).appendTo(e),t.lens.append(i("<img />",{src:n.attr("src")})),g=!0,t.tint.fadeIn(500)),t.options.softFocus&&(t.softFocus=i("<div />").css({position:"absolute",display:"none",top:"1px",left:"1px",width:n.outerWidth(),height:n.outerHeight(),opacity:.5}).appendTo(e),t.softFocus.append(i("<img />",{src:n.attr("src")})),0==t.lens.find("img").length&&t.lens.append(i("<img />",{src:n.attr("src")})),g=!0,t.softFocus.fadeIn(500)),g||t.lens.css("opacity",t.options.lensOpacity),"inside"!==t.options.position&&t.lens.fadeIn(500),t.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;0>i?i=0:i>this.zoomImage.outerWidth()-this.cw&&(i=this.zoomImage.outerWidth()-this.cw),0>o?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.destU=this.IMG_zoomImage.width<=1?i/this.zoomImage.outerWidth()*this.IMG_zoomImage.naturalWidth>>0:i/this.zoomImage.outerWidth()*this.IMG_zoomImage.width>>0,this.destV=this.IMG_zoomImage.height<=1?o/this.zoomImage.outerHeight()*this.IMG_zoomImage.naturalHeight>>0: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),this.element.find(".yith_magnifier_loading").length>0&&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&&i(document).unbind(),this._removeElements(),this.options.elements.gallery.unbind(),this.element.removeData("yith_magnifier")}},i.fn.yith_magnifier=function(t){if("string"==typeof t){var o=Array.prototype.slice.call(arguments,1);this.each(function(){var e=i.data(this,"yith_magnifier");return e?i.isFunction(e[t])&&"_"!==t.charAt(0)?void e[t].apply(e,o):void i.error("no such method '"+t+"' for yith_magnifier instance"):void i.error("cannot call methods on yith_magnifier prior to initialization; attempted to call method '"+t+"'")})}else this.each(function(){var o=i.data(this,"yith_magnifier");o?i.error("yith_magnifier already istantiated."):i.data(this,"yith_magnifier",new i.yith_magnifier(t,this))});return this}}(window,jQuery);
 
 
 
 
 
 
 
 
 
init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://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.2.3
7
  * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: ywzm
@@ -11,7 +11,7 @@
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Magnifier
14
- * @version 1.2.3
15
  */
16
  /* Copyright 2013-2015 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
@@ -65,7 +65,7 @@ if ( ! defined( 'YITH_YWZM_FREE_INIT' ) ) {
65
  }
66
 
67
  if ( ! defined( 'YITH_YWZM_VERSION' ) ) {
68
- define( 'YITH_YWZM_VERSION', '1.2.3' );
69
  }
70
 
71
  if ( ! defined( 'YITH_YWZM_FILE' ) ) {
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://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.2.4
7
  * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: ywzm
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Magnifier
14
+ * @version 1.2.4
15
  */
16
  /* Copyright 2013-2015 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
65
  }
66
 
67
  if ( ! defined( 'YITH_YWZM_VERSION' ) ) {
68
+ define( 'YITH_YWZM_VERSION', '1.2.4' );
69
  }
70
 
71
  if ( ! defined( 'YITH_YWZM_FILE' ) ) {
plugin-fw/assets/css/yit-plugin-panel.css CHANGED
@@ -169,6 +169,7 @@
169
  padding-left: 6px;
170
  position: absolute;
171
  z-index: 2;
 
172
  }
173
  .ie8 .yit_options select,
174
  .ie8 .yit-options select {
169
  padding-left: 6px;
170
  position: absolute;
171
  z-index: 2;
172
+ overflow: hidden;
173
  }
174
  .ie8 .yit_options select,
175
  .ie8 .yit-options select {
plugin-fw/assets/js/metabox.js CHANGED
@@ -42,22 +42,26 @@
42
  $(document).on('click', '.metaboxes-tab .upload_button', function(e) {
43
  var send_attachment_bkp = wp.media.editor.send.attachment;
44
  var button = $(this);
45
- var id = button.attr('id').replace('-button', '');
46
- _custom_media = true;
47
- wp.media.editor.send.attachment = function(props, attachment){
48
- if ( _custom_media ) {
49
- if( $("#"+id).is('input[type=text]') ) {
50
- $("#"+id).val(attachment.url);
 
 
 
 
 
51
  } else {
52
- $("#"+id + '_custom').val(attachment.url);
53
- }
54
- } else {
55
- return _orig_send_attachment.apply( this, [props, attachment] );
56
- };
 
57
  }
58
 
59
- wp.media.editor.open(button);
60
- return false;
61
  });
62
 
63
  $('.metaboxes-tab .add_media').on('click', function(){
42
  $(document).on('click', '.metaboxes-tab .upload_button', function(e) {
43
  var send_attachment_bkp = wp.media.editor.send.attachment;
44
  var button = $(this);
45
+ if( typeof button.attr('id') != 'undefined' ) {
46
+
47
+ var id = button.attr('id').replace('-button', '');
48
+ _custom_media = true;
49
+ wp.media.editor.send.attachment = function(props, attachment){
50
+ if ( _custom_media ) {
51
+ if( $("#"+id).is('input[type=text]') ) {
52
+ $("#"+id).val(attachment.url);
53
+ } else {
54
+ $("#"+id + '_custom').val(attachment.url);
55
+ }
56
  } else {
57
+ return _orig_send_attachment.apply( this, [props, attachment] );
58
+ };
59
+ }
60
+
61
+ wp.media.editor.open(button);
62
+ return false;
63
  }
64
 
 
 
65
  });
66
 
67
  $('.metaboxes-tab .add_media').on('click', function(){
plugin-fw/assets/js/yit-plugin-panel.js CHANGED
@@ -113,36 +113,13 @@
113
  var url = $(this).val();
114
  var re = new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)");
115
 
116
- var preview = $(this).parent().siblings('.upload_img_preview');
117
  if (re.test(url)) {
118
  preview.html('<img src="' + url + '" style="max-width:600px; max-height:300px;" />');
119
  } else {
120
  preview.html('');
121
  }
122
- }).change();
123
-
124
- //$(document).on('click', '.plugin-option .upload_button', function (e) {
125
- // var send_attachment_bkp = wp.media.editor.send.attachment;
126
- // var button = $(this);
127
- // var id = button.attr('id').replace('-button', '');
128
- // _custom_media = true;
129
- // wp.media.editor.send.attachment = function (props, attachment) {
130
- // if (_custom_media) {
131
- // if ($("#" + id).is('input[type=text]')) {
132
- // $("#" + id).val(attachment.url);
133
- // } else {
134
- // $("#" + id + '_custom').val(attachment.url);
135
- // }
136
- //
137
- // } else {
138
- // return _orig_send_attachment.apply(this, [props, attachment]);
139
- // }
140
- // ;
141
- // }
142
- //
143
- // wp.media.editor.open(button);
144
- // return false;
145
- //});
146
 
147
  $( document ).on( 'click', '.plugin-option .upload_button', function(e) {
148
  e.preventDefault();
@@ -188,6 +165,7 @@
188
  var attachment = custom_uploader.state().get( 'selection' ).first().toJSON();
189
 
190
  $("#" + id).val( attachment.url );
 
191
  });
192
 
193
  //Open the uploader dialog
113
  var url = $(this).val();
114
  var re = new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)");
115
 
116
+ var preview = $(this).parents().siblings('.upload_img_preview');
117
  if (re.test(url)) {
118
  preview.html('<img src="' + url + '" style="max-width:600px; max-height:300px;" />');
119
  } else {
120
  preview.html('');
121
  }
122
+ }).trigger( 'change' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
 
124
  $( document ).on( 'click', '.plugin-option .upload_button', function(e) {
125
  e.preventDefault();
165
  var attachment = custom_uploader.state().get( 'selection' ).first().toJSON();
166
 
167
  $("#" + id).val( attachment.url );
168
+ $('.plugin-option .upload_img_url').trigger('change');
169
  });
170
 
171
  //Open the uploader dialog
plugin-fw/assets/js/yit-plugin-panel.min.js CHANGED
@@ -1,10 +1,10 @@
1
  (function(a){var l=function(){var b="";a(this).attr("multiple")?(a(this).children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()}),""==b&&a(this).children().children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()})):(b=a(this).children("option:selected").text(),""==b&&(b=a(this).children().children("option:selected").text()));0>=a(this).parent().find("span").length&&a(this).before("<span></span>");a(this).parent().children("span").replaceWith("<span>"+b+
2
  "</span>")};a(".plugin-option .select_wrapper select").not(".chosen").each(l).change(l);a(".plugin-option .select_wrapper").click(function(b){b.stopPropagation();a(this).find("select[multiple]").not(".chosen").toggle()});a(".plugin-option .select_wrapper select[multiple]").not(".chosen").click(function(a){a.stopPropagation()});a(window).click(function(){a(".plugin-option .select_wrapper select[multiple]").not(".chosen").hide()});a(".plugin-option .chosen .select_wrapper select").chosen();a(".plugin-option .on_off_container span").on("click",
3
- function(){var b=a(this).prev("input");b.prop("checked")?b.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):b.prop("checked",!0).attr("value","yes").addClass("onoffchecked");b.change()});a(".plugin-option .slider_container .ui-slider-horizontal").each(function(){var b=a(this).data("val"),c=a(this).data("min"),d=a(this).data("max"),e=a(this).data("step"),f=a(this).data("labels");a(this).slider({value:b,min:c,max:d,range:"min",step:e,slide:function(b,c){a(this).find("input").val(c.value);
4
- a(this).siblings(".feedback").find("strong").text(c.value+f)}})});"undefined"!==typeof wp&&"undefined"!==typeof wp.media&&(a(".plugin-option .upload_img_url").change(function(){var b=a(this).val(),c=a(this).parent().siblings(".upload_img_preview");/(http|ftp|https):\/\/[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)/.test(b)?c.html('<img src="'+b+'" style="max-width:600px; max-height:300px;" />'):c.html("")}).change(),a(document).on("click",".plugin-option .upload_button",function(b){b.preventDefault();
5
- var c,d=a(this).attr("id").replace(/-button$/,"");c||(b=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})],c=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:b}),c.on("select",function(){var b=c.state().get("selection").first().toJSON();a("#"+d).val(b.url)}));c.open()}));a(".plugin-option .add_media").on("click",function(){});a("[data-field]").each(function(){var b=
6
- a(this),c="#"+b.data("field"),d="#"+b.data("dep"),e=b.data("value");a(d).on("change",function(){var b=d,g=e.toString(),h=!0;if("string"==typeof b){":radio"==b.substr(0,6)&&(b+=":checked");for(var g=g.split(","),k=0;k<g.length;k++)if(a(b).val()!=g[k])h=!1;else{h=!0;break}}h?a(c+"-container").closest("tr").show():a(c+"-container").closest("tr").hide()}).change()});a(".rm_connectedlist").each(function(){var b=a(this).find("ul"),c=a(this).find(":hidden");b.sortable({connectWith:b,update:function(d,e){var f=
7
- {};b.each(function(){var b={};a(this).children().each(function(){b[a(this).data("option")]=a(this).text()});f[a(this).data("list")]=b});c.val(JSON.stringify(f).replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0"))}}).disableSelection()});a(document).ready(function(){a(".yith-video-link").click(function(b){b.preventDefault();b=a(this).data("video-id");a("."+b).dialog({dialogClass:"wp-dialog yit-dialog yit-video-dialog",modal:!0,closeOnEscape:!0,width:"auto",resizable:!1,draggable:!1,create:function(b,
8
- d){a(this).css("maxWidth","853px")},open:function(b,d){a(".ui-widget-overlay").bind("click",function(){a(this).siblings(".ui-dialog").find(".ui-dialog-content").dialog("close")})}});a(".ui-dialog :button").blur()})});a(document).ready(function(){a(".codemirror").each(function(b,c){var d=CodeMirror.fromTextArea(c,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});a(c).data("codemirrorInstance",d)})});a(document).ready(function(){a(".google-analytic-generate").click(function(){var b=a("#"+
9
- a(this).data("textarea")).data("codemirrorInstance"),c=a("#"+a(this).data("input")).val(),d=a(this).data("basename"),e;e="(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\nm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n";e+="})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n";e+="ga('create', '"+c+"', '"+d+"');\n";e+="ga('send', 'pageview');\n";
10
- b.replaceRange(e,b.getCursor("start"),b.getCursor("end"))})})})(jQuery);
1
  (function(a){var l=function(){var b="";a(this).attr("multiple")?(a(this).children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()}),""==b&&a(this).children().children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()})):(b=a(this).children("option:selected").text(),""==b&&(b=a(this).children().children("option:selected").text()));0>=a(this).parent().find("span").length&&a(this).before("<span></span>");a(this).parent().children("span").replaceWith("<span>"+b+
2
  "</span>")};a(".plugin-option .select_wrapper select").not(".chosen").each(l).change(l);a(".plugin-option .select_wrapper").click(function(b){b.stopPropagation();a(this).find("select[multiple]").not(".chosen").toggle()});a(".plugin-option .select_wrapper select[multiple]").not(".chosen").click(function(a){a.stopPropagation()});a(window).click(function(){a(".plugin-option .select_wrapper select[multiple]").not(".chosen").hide()});a(".plugin-option .chosen .select_wrapper select").chosen();a(".plugin-option .on_off_container span").on("click",
3
+ function(){var b=a(this).prev("input");b.prop("checked")?b.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):b.prop("checked",!0).attr("value","yes").addClass("onoffchecked");b.change()});a(".plugin-option .slider_container .ui-slider-horizontal").each(function(){var b=a(this).data("val"),c=a(this).data("min"),d=a(this).data("max"),e=a(this).data("step"),f=a(this).data("labels");a(this).slider({value:b,min:c,max:d,range:"min",step:e,slide:function(b,c){a(this).find("input").val(c.value);
4
+ a(this).siblings(".feedback").find("strong").text(c.value+f)}})});"undefined"!==typeof wp&&"undefined"!==typeof wp.media&&(a(".plugin-option .upload_img_url").change(function(){var b=a(this).val(),c=a(this).parents().siblings(".upload_img_preview");/(http|ftp|https):\/\/[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)/.test(b)?c.html('<img src="'+b+'" style="max-width:600px; max-height:300px;" />'):c.html("")}).trigger("change"),a(document).on("click",".plugin-option .upload_button",function(b){b.preventDefault();
5
+ var c,d=a(this).attr("id").replace(/-button$/,"");c||(b=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})],c=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:b}),c.on("select",function(){var b=c.state().get("selection").first().toJSON();a("#"+d).val(b.url);a(".plugin-option .upload_img_url").trigger("change")}));c.open()}));a(".plugin-option .add_media").on("click",
6
+ function(){});a("[data-field]").each(function(){var b=a(this),c="#"+b.data("field"),d="#"+b.data("dep"),e=b.data("value");a(d).on("change",function(){var b=d,g=e.toString(),h=!0;if("string"==typeof b){":radio"==b.substr(0,6)&&(b+=":checked");for(var g=g.split(","),k=0;k<g.length;k++)if(a(b).val()!=g[k])h=!1;else{h=!0;break}}h?a(c+"-container").closest("tr").show():a(c+"-container").closest("tr").hide()}).change()});a(".rm_connectedlist").each(function(){var b=a(this).find("ul"),c=a(this).find(":hidden");
7
+ b.sortable({connectWith:b,update:function(d,e){var f={};b.each(function(){var b={};a(this).children().each(function(){b[a(this).data("option")]=a(this).text()});f[a(this).data("list")]=b});c.val(JSON.stringify(f).replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0"))}}).disableSelection()});a(document).ready(function(){a(".yith-video-link").click(function(b){b.preventDefault();b=a(this).data("video-id");a("."+b).dialog({dialogClass:"wp-dialog yit-dialog yit-video-dialog",modal:!0,closeOnEscape:!0,width:"auto",
8
+ resizable:!1,draggable:!1,create:function(b,d){a(this).css("maxWidth","853px")},open:function(b,d){a(".ui-widget-overlay").bind("click",function(){a(this).siblings(".ui-dialog").find(".ui-dialog-content").dialog("close")})}});a(".ui-dialog :button").blur()})});a(document).ready(function(){a(".codemirror").each(function(b,c){var d=CodeMirror.fromTextArea(c,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});a(c).data("codemirrorInstance",d)})});a(document).ready(function(){a(".google-analytic-generate").click(function(){var b=
9
+ a("#"+a(this).data("textarea")).data("codemirrorInstance"),c=a("#"+a(this).data("input")).val(),d=a(this).data("basename"),e;e="(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\nm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n";e+="})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n";e+="ga('create', '"+c+"', '"+d+"');\n";e+="ga('send', 'pageview');\n";
10
+ b.replaceRange(e,b.getCursor("start"),b.getCursor("end"))})})})(jQuery);
plugin-fw/lib/yit-plugin-common.php CHANGED
@@ -27,6 +27,7 @@ class YIT_Plugin_Common {
27
 
28
 
29
  'awesome_icons' => array(
 
30
  'f042' => 'adjust',
31
  'f170' => 'adn',
32
  'f037' => 'align-center',
27
 
28
 
29
  'awesome_icons' => array(
30
+ '' => 'no-icon',
31
  'f042' => 'adjust',
32
  'f170' => 'adn',
33
  'f037' => 'align-center',
plugin-fw/lib/yit-plugin-panel.php CHANGED
@@ -92,7 +92,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
92
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
93
  */
94
  public function add_menu_page() {
95
- $position = apply_filters( 'yit_plugins_menu_item_position', 62.32 );
96
  add_menu_page( 'yit_plugin_panel', __( 'YIT Plugins', 'yith-plugin-fw' ), 'manage_options', 'yit_plugin_panel', NULL, YIT_CORE_PLUGIN_URL . '/assets/images/yithemes-icon.png', $position );
97
  }
98
 
92
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
93
  */
94
  public function add_menu_page() {
95
+ $position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
96
  add_menu_page( 'yit_plugin_panel', __( 'YIT Plugins', 'yith-plugin-fw' ), 'manage_options', 'yit_plugin_panel', NULL, YIT_CORE_PLUGIN_URL . '/assets/images/yithemes-icon.png', $position );
97
  }
98
 
plugin-fw/lib/yit-plugin-subpanel.php CHANGED
@@ -97,8 +97,9 @@ if ( ! class_exists( 'YIT_Plugin_SubPanel' ) ) {
97
  if ( isset( $admin_logo ) && ! empty( $admin_logo ) && $admin_logo != '' && $admin_logo) {
98
  $logo = $admin_logo;
99
  }
 
 
100
 
101
- add_menu_page( 'yit_plugin_panel', __( 'YIT Plugins', 'yith-plugin-fw' ), 'nosuchcapability', 'yit_plugin_panel', NULL, $logo, 62 );
102
  add_submenu_page( 'yit_plugin_panel', $this->settings['label'], $this->settings['label'], 'manage_options', $this->settings['page'], array( $this, 'yit_panel' ) );
103
  remove_submenu_page( 'yit_plugin_panel', 'yit_plugin_panel' );
104
 
97
  if ( isset( $admin_logo ) && ! empty( $admin_logo ) && $admin_logo != '' && $admin_logo) {
98
  $logo = $admin_logo;
99
  }
100
+ $position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
101
+ add_menu_page( 'yit_plugin_panel', __( 'YIT Plugins', 'yith-plugin-fw' ), 'nosuchcapability', 'yit_plugin_panel', NULL, $logo, $position );
102
 
 
103
  add_submenu_page( 'yit_plugin_panel', $this->settings['label'], $this->settings['label'], 'manage_options', $this->settings['page'], array( $this, 'yit_panel' ) );
104
  remove_submenu_page( 'yit_plugin_panel', 'yit_plugin_panel' );
105