news_reader 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/news_reader/scraper.rb +1 -1
  4. data/lib/news_reader/version.rb +1 -1
  5. metadata +1 -61
  6. data/fixtures/.DS_Store +0 -0
  7. data/fixtures/blog/index.html +0 -200
  8. data/fixtures/blog/index_files/Box.css +0 -29
  9. data/fixtures/blog/index_files/Java_Box.js +0 -89
  10. data/fixtures/blog/index_files/ModuleStyleSheets.css +0 -1655
  11. data/fixtures/blog/index_files/black.css +0 -11
  12. data/fixtures/blog/index_files/blog-jive.jpg +0 -0
  13. data/fixtures/blog/index_files/blog-musolfs.jpg +0 -0
  14. data/fixtures/blog/index_files/blog-poolpak.jpg +0 -0
  15. data/fixtures/blog/index_files/blog-portalaudit.png +0 -0
  16. data/fixtures/blog/index_files/blog-semicolon1.jpg +0 -0
  17. data/fixtures/blog/index_files/blog-semicolon2.jpg +0 -0
  18. data/fixtures/blog/index_files/blog-spa1.jpg +0 -0
  19. data/fixtures/blog/index_files/blog-spa2.jpg +0 -0
  20. data/fixtures/blog/index_files/blog-statera.jpg +0 -0
  21. data/fixtures/blog/index_files/blue.css +0 -11
  22. data/fixtures/blog/index_files/common.js +0 -149
  23. data/fixtures/blog/index_files/dark.css +0 -31
  24. data/fixtures/blog/index_files/featherlight.min.css +0 -8
  25. data/fixtures/blog/index_files/featherlight.min.js +0 -8
  26. data/fixtures/blog/index_files/font-awesome.min.css +0 -4
  27. data/fixtures/blog/index_files/green.css +0 -11
  28. data/fixtures/blog/index_files/isotope.css +0 -64
  29. data/fixtures/blog/index_files/jquery-ui.min.js +0 -5
  30. data/fixtures/blog/index_files/jquery.carouFredSel-6.2.1-packed.js +0 -16
  31. data/fixtures/blog/index_files/jquery.contentcarousel.js +0 -137
  32. data/fixtures/blog/index_files/jquery.easing.1.3.js +0 -205
  33. data/fixtures/blog/index_files/jquery.form.js +0 -1121
  34. data/fixtures/blog/index_files/jquery.hoverdir.js +0 -220
  35. data/fixtures/blog/index_files/jquery.inview.js +0 -60
  36. data/fixtures/blog/index_files/jquery.isotope.min.js +0 -11
  37. data/fixtures/blog/index_files/jquery.magnific-popup.js +0 -2046
  38. data/fixtures/blog/index_files/jquery.mb.YTPlayer.js +0 -1041
  39. data/fixtures/blog/index_files/jquery.min.js +0 -5
  40. data/fixtures/blog/index_files/jquery.nav.js +0 -223
  41. data/fixtures/blog/index_files/jquery.smoothwheel.js +0 -153
  42. data/fixtures/blog/index_files/jquery.sticky.js +0 -129
  43. data/fixtures/blog/index_files/jquery.superslides.js +0 -656
  44. data/fixtures/blog/index_files/jquery.validate.js +0 -1231
  45. data/fixtures/blog/index_files/jquery.vegas.css +0 -34
  46. data/fixtures/blog/index_files/js +0 -201
  47. data/fixtures/blog/index_files/loading.gif +0 -0
  48. data/fixtures/blog/index_files/magnific-popup.css +0 -365
  49. data/fixtures/blog/index_files/main.css +0 -301
  50. data/fixtures/blog/index_files/main.js +0 -26
  51. data/fixtures/blog/index_files/modernizr-2.6.2.min.js +0 -4
  52. data/fixtures/blog/index_files/normalize.css +0 -533
  53. data/fixtures/blog/index_files/ohp3fra.js +0 -44
  54. data/fixtures/blog/index_files/orange.css +0 -11
  55. data/fixtures/blog/index_files/paralax.js +0 -525
  56. data/fixtures/blog/index_files/paralaxNEW4.css +0 -2730
  57. data/fixtures/blog/index_files/plugins.js +0 -221
  58. data/fixtures/blog/index_files/portfolio.js +0 -142
  59. data/fixtures/blog/index_files/purple.css +0 -11
  60. data/fixtures/blog/index_files/red.css +0 -11
  61. data/fixtures/blog/index_files/responsive3.css +0 -329
  62. data/fixtures/blog/index_files/superslides.css +0 -65
  63. data/fixtures/blog/index_files/turquoise.css +0 -11
  64. data/fixtures/blog/index_files/util.js +0 -287
  65. data/fixtures/blog/index_files/yellow.css +0 -11
@@ -1,220 +0,0 @@
1
- /**
2
- * jquery.hoverdir.js v1.1.0
3
- * http://www.codrops.com
4
- *
5
- * Licensed under the MIT license.
6
- * http://www.opensource.org/licenses/mit-license.php
7
- *
8
- * Copyright 2012, Codrops
9
- * http://www.codrops.com
10
- */
11
- ;( function( $, window, undefined ) {
12
-
13
- 'use strict';
14
-
15
- $.HoverDir = function( options, element ) {
16
-
17
- this.$el = $( element );
18
- this._init( options );
19
-
20
- };
21
-
22
- // the options
23
- $.HoverDir.defaults = {
24
- speed : 300,
25
- easing : 'ease',
26
- hoverDelay : 10,
27
- inverse : false
28
- };
29
-
30
- $.HoverDir.prototype = {
31
-
32
- _init : function( options ) {
33
-
34
- // options
35
- this.options = $.extend( true, {}, $.HoverDir.defaults, options );
36
- // transition properties
37
- this.transitionProp = 'all ' + this.options.speed + 'ms ' + this.options.easing;
38
- // support for CSS transitions
39
- this.support = Modernizr.csstransitions;
40
- // load the events
41
- this._loadEvents();
42
-
43
- },
44
- _loadEvents : function() {
45
-
46
- var self = this;
47
-
48
- this.$el.on( 'mouseenter.hoverdir, mouseleave.hoverdir', function( event ) {
49
-
50
- var $el = $( this ),
51
- $hoverElem = $el.find( 'div' ),
52
- direction = self._getDir( $el, { x : event.pageX, y : event.pageY } ),
53
- styleCSS = self._getStyle( direction );
54
-
55
- if( event.type === 'mouseenter' ) {
56
-
57
- $hoverElem.hide().css( styleCSS.from );
58
- clearTimeout( self.tmhover );
59
-
60
- self.tmhover = setTimeout( function() {
61
-
62
- $hoverElem.show( 0, function() {
63
-
64
- var $el = $( this );
65
- if( self.support ) {
66
- $el.css( 'transition', self.transitionProp );
67
- }
68
- self._applyAnimation( $el, styleCSS.to, self.options.speed );
69
-
70
- } );
71
-
72
-
73
- }, self.options.hoverDelay );
74
-
75
- }
76
- else {
77
-
78
- if( self.support ) {
79
- $hoverElem.css( 'transition', self.transitionProp );
80
- }
81
- clearTimeout( self.tmhover );
82
- self._applyAnimation( $hoverElem, styleCSS.from, self.options.speed );
83
-
84
- }
85
-
86
- } );
87
-
88
- },
89
- // credits : http://stackoverflow.com/a/3647634
90
- _getDir : function( $el, coordinates ) {
91
-
92
- // the width and height of the current div
93
- var w = $el.width(),
94
- h = $el.height(),
95
-
96
- // calculate the x and y to get an angle to the center of the div from that x and y.
97
- // gets the x value relative to the center of the DIV and "normalize" it
98
- x = ( coordinates.x - $el.offset().left - ( w/2 )) * ( w > h ? ( h/w ) : 1 ),
99
- y = ( coordinates.y - $el.offset().top - ( h/2 )) * ( h > w ? ( w/h ) : 1 ),
100
-
101
- // the angle and the direction from where the mouse came in/went out clockwise (TRBL=0123);
102
- // first calculate the angle of the point,
103
- // add 180 deg to get rid of the negative values
104
- // divide by 90 to get the quadrant
105
- // add 3 and do a modulo by 4 to shift the quadrants to a proper clockwise TRBL (top/right/bottom/left) **/
106
- direction = Math.round( ( ( ( Math.atan2(y, x) * (180 / Math.PI) ) + 180 ) / 90 ) + 3 ) % 4;
107
-
108
- return direction;
109
-
110
- },
111
- _getStyle : function( direction ) {
112
-
113
- var fromStyle, toStyle,
114
- slideFromTop = { left : '0px', top : '-25%' },
115
- slideFromBottom = { left : '0px', top : '25%' },
116
- slideFromLeft = { left : '-25%', top : '0px' },
117
- slideFromRight = { left : '25%', top : '0px' },
118
- slideTop = { top : '0px' },
119
- slideLeft = { left : '0px' };
120
-
121
- switch( direction ) {
122
- case 0:
123
- // from top
124
- fromStyle = !this.options.inverse ? slideFromTop : slideFromBottom;
125
- toStyle = slideTop;
126
- break;
127
- case 1:
128
- // from right
129
- fromStyle = !this.options.inverse ? slideFromRight : slideFromLeft;
130
- toStyle = slideLeft;
131
- break;
132
- case 2:
133
- // from bottom
134
- fromStyle = !this.options.inverse ? slideFromBottom : slideFromTop;
135
- toStyle = slideTop;
136
- break;
137
- case 3:
138
- // from left
139
- fromStyle = !this.options.inverse ? slideFromLeft : slideFromRight;
140
- toStyle = slideLeft;
141
- break;
142
- };
143
-
144
- return { from : fromStyle, to : toStyle };
145
-
146
- },
147
- // apply a transition or fallback to jquery animate based on Modernizr.csstransitions support
148
- _applyAnimation : function( el, styleCSS, speed ) {
149
-
150
- $.fn.applyStyle = this.support ? $.fn.css : $.fn.animate;
151
- el.stop().applyStyle( styleCSS, $.extend( true, [], { duration : speed + 'ms' } ) );
152
-
153
- },
154
-
155
- };
156
-
157
- var logError = function( message ) {
158
-
159
- if ( window.console ) {
160
-
161
- window.console.error( message );
162
-
163
- }
164
-
165
- };
166
-
167
- $.fn.hoverdir = function( options ) {
168
-
169
- var instance = $.data( this, 'hoverdir' );
170
-
171
- if ( typeof options === 'string' ) {
172
-
173
- var args = Array.prototype.slice.call( arguments, 1 );
174
-
175
- this.each(function() {
176
-
177
- if ( !instance ) {
178
-
179
- logError( "cannot call methods on hoverdir prior to initialization; " +
180
- "attempted to call method '" + options + "'" );
181
- return;
182
-
183
- }
184
-
185
- if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
186
-
187
- logError( "no such method '" + options + "' for hoverdir instance" );
188
- return;
189
-
190
- }
191
-
192
- instance[ options ].apply( instance, args );
193
-
194
- });
195
-
196
- }
197
- else {
198
-
199
- this.each(function() {
200
-
201
- if ( instance ) {
202
-
203
- instance._init();
204
-
205
- }
206
- else {
207
-
208
- instance = $.data( this, 'hoverdir', new $.HoverDir( options, this ) );
209
-
210
- }
211
-
212
- });
213
-
214
- }
215
-
216
- return instance;
217
-
218
- };
219
-
220
- } )( jQuery, window );
@@ -1,60 +0,0 @@
1
- /**
2
- * author Remy Sharp
3
- * url http://remysharp.com/2009/01/26/element-in-view-event-plugin/
4
- */
5
- (function ($) {
6
- function getViewportHeight() {
7
- var height = window.innerHeight; // Safari, Opera
8
- var mode = document.compatMode;
9
-
10
- if ( (mode || !$.support.boxModel) ) { // IE, Gecko
11
- height = (mode == 'CSS1Compat') ?
12
- document.documentElement.clientHeight : // Standards
13
- document.body.clientHeight; // Quirks
14
- }
15
-
16
- return height;
17
- }
18
-
19
- $(window).scroll(function () {
20
- var vpH = getViewportHeight(),
21
- scrolltop = (document.documentElement.scrollTop ?
22
- document.documentElement.scrollTop :
23
- document.body.scrollTop),
24
- elems = [];
25
-
26
- // naughty, but this is how it knows which elements to check for
27
- $.each($.cache, function () {
28
- if (this.events && this.events.inview) {
29
- elems.push(this.handle.elem);
30
- }
31
- });
32
-
33
- if (elems.length) {
34
- $(elems).each(function () {
35
- var $el = $(this),
36
- top = $el.offset().top,
37
- height = $el.height(),
38
- inview = $el.data('inview') || false;
39
-
40
- if (scrolltop > (top + height) || scrolltop + vpH < top) {
41
- if (inview) {
42
- $el.data('inview', false);
43
- $el.trigger('inview', [ false ]);
44
- }
45
- } else if (scrolltop < (top + height)) {
46
- if (!inview) {
47
- $el.data('inview', true);
48
- $el.trigger('inview', [ true ]);
49
- }
50
- }
51
- });
52
- }
53
- });
54
-
55
- // kick the event to pick up any elements already in view.
56
- // note however, this only works if the plugin is included after the elements are bound to 'inview'
57
- $(function () {
58
- $(window).scroll();
59
- });
60
- })(jQuery);
@@ -1,11 +0,0 @@
1
- /**
2
- * Isotope v1.5.25
3
- * An exquisite jQuery plugin for magical layouts
4
- * http://isotope.metafizzy.co
5
- *
6
- * Commercial use requires one-time license fee
7
- * http://metafizzy.co/#licenses
8
- *
9
- * Copyright 2012 David DeSandro / Metafizzy
10
- */
11
- (function(a,b,c){"use strict";var d=a.document,e=a.Modernizr,f=function(a){return a.charAt(0).toUpperCase()+a.slice(1)},g="Moz Webkit O Ms".split(" "),h=function(a){var b=d.documentElement.style,c;if(typeof b[a]=="string")return a;a=f(a);for(var e=0,h=g.length;e<h;e++){c=g[e]+a;if(typeof b[c]=="string")return c}},i=h("transform"),j=h("transitionProperty"),k={csstransforms:function(){return!!i},csstransforms3d:function(){var a=!!h("perspective");if(a){var c=" -o- -moz- -ms- -webkit- -khtml- ".split(" "),d="@media ("+c.join("transform-3d),(")+"modernizr)",e=b("<style>"+d+"{#modernizr{height:3px}}"+"</style>").appendTo("head"),f=b('<div id="modernizr" />').appendTo("html");a=f.height()===3,f.remove(),e.remove()}return a},csstransitions:function(){return!!j}},l;if(e)for(l in k)e.hasOwnProperty(l)||e.addTest(l,k[l]);else{e=a.Modernizr={_version:"1.6ish: miniModernizr for Isotope"};var m=" ",n;for(l in k)n=k[l](),e[l]=n,m+=" "+(n?"":"no-")+l;b("html").addClass(m)}if(e.csstransforms){var o=e.csstransforms3d?{translate:function(a){return"translate3d("+a[0]+"px, "+a[1]+"px, 0) "},scale:function(a){return"scale3d("+a+", "+a+", 1) "}}:{translate:function(a){return"translate("+a[0]+"px, "+a[1]+"px) "},scale:function(a){return"scale("+a+") "}},p=function(a,c,d){var e=b.data(a,"isoTransform")||{},f={},g,h={},j;f[c]=d,b.extend(e,f);for(g in e)j=e[g],h[g]=o[g](j);var k=h.translate||"",l=h.scale||"",m=k+l;b.data(a,"isoTransform",e),a.style[i]=m};b.cssNumber.scale=!0,b.cssHooks.scale={set:function(a,b){p(a,"scale",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.scale?d.scale:1}},b.fx.step.scale=function(a){b.cssHooks.scale.set(a.elem,a.now+a.unit)},b.cssNumber.translate=!0,b.cssHooks.translate={set:function(a,b){p(a,"translate",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.translate?d.translate:[0,0]}}}var q,r;e.csstransitions&&(q={WebkitTransitionProperty:"webkitTransitionEnd",MozTransitionProperty:"transitionend",OTransitionProperty:"oTransitionEnd otransitionend",transitionProperty:"transitionend"}[j],r=h("transitionDuration"));var s=b.event,t=b.event.handle?"handle":"dispatch",u;s.special.smartresize={setup:function(){b(this).bind("resize",s.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",s.special.smartresize.handler)},handler:function(a,b){var c=this,d=arguments;a.type="smartresize",u&&clearTimeout(u),u=setTimeout(function(){s[t].apply(c,d)},b==="execAsap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])},b.Isotope=function(a,c,d){this.element=b(c),this._create(a),this._init(d)};var v=["width","height"],w=b(a);b.Isotope.settings={resizable:!0,layoutMode:"masonry",containerClass:"isotope",itemClass:"isotope-item",hiddenClass:"isotope-hidden",hiddenStyle:{opacity:0,scale:.001},visibleStyle:{opacity:1,scale:1},containerStyle:{position:"relative",overflow:"hidden"},animationEngine:"best-available",animationOptions:{queue:!1,duration:800},sortBy:"original-order",sortAscending:!0,resizesContainer:!0,transformsEnabled:!0,itemPositionDataEnabled:!1},b.Isotope.prototype={_create:function(a){this.options=b.extend({},b.Isotope.settings,a),this.styleQueue=[],this.elemCount=0;var c=this.element[0].style;this.originalStyle={};var d=v.slice(0);for(var e in this.options.containerStyle)d.push(e);for(var f=0,g=d.length;f<g;f++)e=d[f],this.originalStyle[e]=c[e]||"";this.element.css(this.options.containerStyle),this._updateAnimationEngine(),this._updateUsingTransforms();var h={"original-order":function(a,b){return b.elemCount++,b.elemCount},random:function(){return Math.random()}};this.options.getSortData=b.extend(this.options.getSortData,h),this.reloadItems(),this.offset={left:parseInt(this.element.css("padding-left")||0,10),top:parseInt(this.element.css("padding-top")||0,10)};var i=this;setTimeout(function(){i.element.addClass(i.options.containerClass)},0),this.options.resizable&&w.bind("smartresize.isotope",function(){i.resize()}),this.element.delegate("."+this.options.hiddenClass,"click",function(){return!1})},_getAtoms:function(a){var b=this.options.itemSelector,c=b?a.filter(b).add(a.find(b)):a,d={position:"absolute"};return c=c.filter(function(a,b){return b.nodeType===1}),this.usingTransforms&&(d.left=0,d.top=0),c.css(d).addClass(this.options.itemClass),this.updateSortData(c,!0),c},_init:function(a){this.$filteredAtoms=this._filter(this.$allAtoms),this._sort(),this.reLayout(a)},option:function(a){if(b.isPlainObject(a)){this.options=b.extend(!0,this.options,a);var c;for(var d in a)c="_update"+f(d),this[c]&&this[c]()}},_updateAnimationEngine:function(){var a=this.options.animationEngine.toLowerCase().replace(/[ _\-]/g,""),b;switch(a){case"css":case"none":b=!1;break;case"jquery":b=!0;break;default:b=!e.csstransitions}this.isUsingJQueryAnimation=b,this._updateUsingTransforms()},_updateTransformsEnabled:function(){this._updateUsingTransforms()},_updateUsingTransforms:function(){var a=this.usingTransforms=this.options.transformsEnabled&&e.csstransforms&&e.csstransitions&&!this.isUsingJQueryAnimation;a||(delete this.options.hiddenStyle.scale,delete this.options.visibleStyle.scale),this.getPositionStyles=a?this._translate:this._positionAbs},_filter:function(a){var b=this.options.filter===""?"*":this.options.filter;if(!b)return a;var c=this.options.hiddenClass,d="."+c,e=a.filter(d),f=e;if(b!=="*"){f=e.filter(b);var g=a.not(d).not(b).addClass(c);this.styleQueue.push({$el:g,style:this.options.hiddenStyle})}return this.styleQueue.push({$el:f,style:this.options.visibleStyle}),f.removeClass(c),a.filter(b)},updateSortData:function(a,c){var d=this,e=this.options.getSortData,f,g;a.each(function(){f=b(this),g={};for(var a in e)!c&&a==="original-order"?g[a]=b.data(this,"isotope-sort-data")[a]:g[a]=e[a](f,d);b.data(this,"isotope-sort-data",g)})},_sort:function(){var a=this.options.sortBy,b=this._getSorter,c=this.options.sortAscending?1:-1,d=function(d,e){var f=b(d,a),g=b(e,a);return f===g&&a!=="original-order"&&(f=b(d,"original-order"),g=b(e,"original-order")),(f>g?1:f<g?-1:0)*c};this.$filteredAtoms.sort(d)},_getSorter:function(a,c){return b.data(a,"isotope-sort-data")[c]},_translate:function(a,b){return{translate:[a,b]}},_positionAbs:function(a,b){return{left:a,top:b}},_pushPosition:function(a,b,c){b=Math.round(b+this.offset.left),c=Math.round(c+this.offset.top);var d=this.getPositionStyles(b,c);this.styleQueue.push({$el:a,style:d}),this.options.itemPositionDataEnabled&&a.data("isotope-item-position",{x:b,y:c})},layout:function(a,b){var c=this.options.layoutMode;this["_"+c+"Layout"](a);if(this.options.resizesContainer){var d=this["_"+c+"GetContainerSize"]();this.styleQueue.push({$el:this.element,style:d})}this._processStyleQueue(a,b),this.isLaidOut=!0},_processStyleQueue:function(a,c){var d=this.isLaidOut?this.isUsingJQueryAnimation?"animate":"css":"css",f=this.options.animationOptions,g=this.options.onLayout,h,i,j,k;i=function(a,b){b.$el[d](b.style,f)};if(this._isInserting&&this.isUsingJQueryAnimation)i=function(a,b){h=b.$el.hasClass("no-transition")?"css":d,b.$el[h](b.style,f)};else if(c||g||f.complete){var l=!1,m=[c,g,f.complete],n=this;j=!0,k=function(){if(l)return;var b;for(var c=0,d=m.length;c<d;c++)b=m[c],typeof b=="function"&&b.call(n.element,a,n);l=!0};if(this.isUsingJQueryAnimation&&d==="animate")f.complete=k,j=!1;else if(e.csstransitions){var o=0,p=this.styleQueue[0],s=p&&p.$el,t;while(!s||!s.length){t=this.styleQueue[o++];if(!t)return;s=t.$el}var u=parseFloat(getComputedStyle(s[0])[r]);u>0&&(i=function(a,b){b.$el[d](b.style,f).one(q,k)},j=!1)}}b.each(this.styleQueue,i),j&&k(),this.styleQueue=[]},resize:function(){this["_"+this.options.layoutMode+"ResizeChanged"]()&&this.reLayout()},reLayout:function(a){this["_"+this.options.layoutMode+"Reset"](),this.layout(this.$filteredAtoms,a)},addItems:function(a,b){var c=this._getAtoms(a);this.$allAtoms=this.$allAtoms.add(c),b&&b(c)},insert:function(a,b){this.element.append(a);var c=this;this.addItems(a,function(a){var d=c._filter(a);c._addHideAppended(d),c._sort(),c.reLayout(),c._revealAppended(d,b)})},appended:function(a,b){var c=this;this.addItems(a,function(a){c._addHideAppended(a),c.layout(a),c._revealAppended(a,b)})},_addHideAppended:function(a){this.$filteredAtoms=this.$filteredAtoms.add(a),a.addClass("no-transition"),this._isInserting=!0,this.styleQueue.push({$el:a,style:this.options.hiddenStyle})},_revealAppended:function(a,b){var c=this;setTimeout(function(){a.removeClass("no-transition"),c.styleQueue.push({$el:a,style:c.options.visibleStyle}),c._isInserting=!1,c._processStyleQueue(a,b)},10)},reloadItems:function(){this.$allAtoms=this._getAtoms(this.element.children())},remove:function(a,b){this.$allAtoms=this.$allAtoms.not(a),this.$filteredAtoms=this.$filteredAtoms.not(a);var c=this,d=function(){a.remove(),b&&b.call(c.element)};a.filter(":not(."+this.options.hiddenClass+")").length?(this.styleQueue.push({$el:a,style:this.options.hiddenStyle}),this._sort(),this.reLayout(d)):d()},shuffle:function(a){this.updateSortData(this.$allAtoms),this.options.sortBy="random",this._sort(),this.reLayout(a)},destroy:function(){var a=this.usingTransforms,b=this.options;this.$allAtoms.removeClass(b.hiddenClass+" "+b.itemClass).each(function(){var b=this.style;b.position="",b.top="",b.left="",b.opacity="",a&&(b[i]="")});var c=this.element[0].style;for(var d in this.originalStyle)c[d]=this.originalStyle[d];this.element.unbind(".isotope").undelegate("."+b.hiddenClass,"click").removeClass(b.containerClass).removeData("isotope"),w.unbind(".isotope")},_getSegments:function(a){var b=this.options.layoutMode,c=a?"rowHeight":"columnWidth",d=a?"height":"width",e=a?"rows":"cols",g=this.element[d](),h,i=this.options[b]&&this.options[b][c]||this.$filteredAtoms["outer"+f(d)](!0)||g;h=Math.floor(g/i),h=Math.max(h,1),this[b][e]=h,this[b][c]=i},_checkIfSegmentsChanged:function(a){var b=this.options.layoutMode,c=a?"rows":"cols",d=this[b][c];return this._getSegments(a),this[b][c]!==d},_masonryReset:function(){this.masonry={},this._getSegments();var a=this.masonry.cols;this.masonry.colYs=[];while(a--)this.masonry.colYs.push(0)},_masonryLayout:function(a){var c=this,d=c.masonry;a.each(function(){var a=b(this),e=Math.ceil(a.outerWidth(!0)/d.columnWidth);e=Math.min(e,d.cols);if(e===1)c._masonryPlaceBrick(a,d.colYs);else{var f=d.cols+1-e,g=[],h,i;for(i=0;i<f;i++)h=d.colYs.slice(i,i+e),g[i]=Math.max.apply(Math,h);c._masonryPlaceBrick(a,g)}})},_masonryPlaceBrick:function(a,b){var c=Math.min.apply(Math,b),d=0;for(var e=0,f=b.length;e<f;e++)if(b[e]===c){d=e;break}var g=this.masonry.columnWidth*d,h=c;this._pushPosition(a,g,h);var i=c+a.outerHeight(!0),j=this.masonry.cols+1-f;for(e=0;e<j;e++)this.masonry.colYs[d+e]=i},_masonryGetContainerSize:function(){var a=Math.max.apply(Math,this.masonry.colYs);return{height:a}},_masonryResizeChanged:function(){return this._checkIfSegmentsChanged()},_fitRowsReset:function(){this.fitRows={x:0,y:0,height:0}},_fitRowsLayout:function(a){var c=this,d=this.element.width(),e=this.fitRows;a.each(function(){var a=b(this),f=a.outerWidth(!0),g=a.outerHeight(!0);e.x!==0&&f+e.x>d&&(e.x=0,e.y=e.height),c._pushPosition(a,e.x,e.y),e.height=Math.max(e.y+g,e.height),e.x+=f})},_fitRowsGetContainerSize:function(){return{height:this.fitRows.height}},_fitRowsResizeChanged:function(){return!0},_cellsByRowReset:function(){this.cellsByRow={index:0},this._getSegments(),this._getSegments(!0)},_cellsByRowLayout:function(a){var c=this,d=this.cellsByRow;a.each(function(){var a=b(this),e=d.index%d.cols,f=Math.floor(d.index/d.cols),g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByRowGetContainerSize:function(){return{height:Math.ceil(this.$filteredAtoms.length/this.cellsByRow.cols)*this.cellsByRow.rowHeight+this.offset.top}},_cellsByRowResizeChanged:function(){return this._checkIfSegmentsChanged()},_straightDownReset:function(){this.straightDown={y:0}},_straightDownLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,0,c.straightDown.y),c.straightDown.y+=d.outerHeight(!0)})},_straightDownGetContainerSize:function(){return{height:this.straightDown.y}},_straightDownResizeChanged:function(){return!0},_masonryHorizontalReset:function(){this.masonryHorizontal={},this._getSegments(!0);var a=this.masonryHorizontal.rows;this.masonryHorizontal.rowXs=[];while(a--)this.masonryHorizontal.rowXs.push(0)},_masonryHorizontalLayout:function(a){var c=this,d=c.masonryHorizontal;a.each(function(){var a=b(this),e=Math.ceil(a.outerHeight(!0)/d.rowHeight);e=Math.min(e,d.rows);if(e===1)c._masonryHorizontalPlaceBrick(a,d.rowXs);else{var f=d.rows+1-e,g=[],h,i;for(i=0;i<f;i++)h=d.rowXs.slice(i,i+e),g[i]=Math.max.apply(Math,h);c._masonryHorizontalPlaceBrick(a,g)}})},_masonryHorizontalPlaceBrick:function(a,b){var c=Math.min.apply(Math,b),d=0;for(var e=0,f=b.length;e<f;e++)if(b[e]===c){d=e;break}var g=c,h=this.masonryHorizontal.rowHeight*d;this._pushPosition(a,g,h);var i=c+a.outerWidth(!0),j=this.masonryHorizontal.rows+1-f;for(e=0;e<j;e++)this.masonryHorizontal.rowXs[d+e]=i},_masonryHorizontalGetContainerSize:function(){var a=Math.max.apply(Math,this.masonryHorizontal.rowXs);return{width:a}},_masonryHorizontalResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_fitColumnsReset:function(){this.fitColumns={x:0,y:0,width:0}},_fitColumnsLayout:function(a){var c=this,d=this.element.height(),e=this.fitColumns;a.each(function(){var a=b(this),f=a.outerWidth(!0),g=a.outerHeight(!0);e.y!==0&&g+e.y>d&&(e.x=e.width,e.y=0),c._pushPosition(a,e.x,e.y),e.width=Math.max(e.x+f,e.width),e.y+=g})},_fitColumnsGetContainerSize:function(){return{width:this.fitColumns.width}},_fitColumnsResizeChanged:function(){return!0},_cellsByColumnReset:function(){this.cellsByColumn={index:0},this._getSegments(),this._getSegments(!0)},_cellsByColumnLayout:function(a){var c=this,d=this.cellsByColumn;a.each(function(){var a=b(this),e=Math.floor(d.index/d.rows),f=d.index%d.rows,g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByColumnGetContainerSize:function(){return{width:Math.ceil(this.$filteredAtoms.length/this.cellsByColumn.rows)*this.cellsByColumn.columnWidth}},_cellsByColumnResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_straightAcrossReset:function(){this.straightAcross={x:0}},_straightAcrossLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,c.straightAcross.x,0),c.straightAcross.x+=d.outerWidth(!0)})},_straightAcrossGetContainerSize:function(){return{width:this.straightAcross.x}},_straightAcrossResizeChanged:function(){return!0}},b.fn.imagesLoaded=function(a){function h(){a.call(c,d)}function i(a){var c=a.target;c.src!==f&&b.inArray(c,g)===-1&&(g.push(c),--e<=0&&(setTimeout(h),d.unbind(".imagesLoaded",i)))}var c=this,d=c.find("img").add(c.filter("img")),e=d.length,f="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",g=[];return e||h(),d.bind("load.imagesLoaded error.imagesLoaded",i).each(function(){var a=this.src;this.src=f,this.src=a}),c};var x=function(b){a.console&&a.console.error(b)};b.fn.isotope=function(a,c){if(typeof a=="string"){var d=Array.prototype.slice.call(arguments,1);this.each(function(){var c=b.data(this,"isotope");if(!c){x("cannot call methods on isotope prior to initialization; attempted to call method '"+a+"'");return}if(!b.isFunction(c[a])||a.charAt(0)==="_"){x("no such method '"+a+"' for isotope instance");return}c[a].apply(c,d)})}else this.each(function(){var d=b.data(this,"isotope");d?(d.option(a),d._init(c)):b.data(this,"isotope",new b.Isotope(a,this,c))});return this}})(window,jQuery);
@@ -1,2046 +0,0 @@
1
- /*! Magnific Popup - v0.9.9 - 2013-11-25
2
- * http://dimsemenov.com/plugins/magnific-popup/
3
- * Copyright (c) 2013 Dmitry Semenov; */
4
- ;(function($) {
5
-
6
- /*>>core*/
7
- /**
8
- *
9
- * Magnific Popup Core JS file
10
- *
11
- */
12
-
13
-
14
- /**
15
- * Private static constants
16
- */
17
- var CLOSE_EVENT = 'Close',
18
- BEFORE_CLOSE_EVENT = 'BeforeClose',
19
- AFTER_CLOSE_EVENT = 'AfterClose',
20
- BEFORE_APPEND_EVENT = 'BeforeAppend',
21
- MARKUP_PARSE_EVENT = 'MarkupParse',
22
- OPEN_EVENT = 'Open',
23
- CHANGE_EVENT = 'Change',
24
- NS = 'mfp',
25
- EVENT_NS = '.' + NS,
26
- READY_CLASS = 'mfp-ready',
27
- REMOVING_CLASS = 'mfp-removing',
28
- PREVENT_CLOSE_CLASS = 'mfp-prevent-close';
29
-
30
-
31
- /**
32
- * Private vars
33
- */
34
- var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'
35
- MagnificPopup = function(){},
36
- _isJQ = !!(window.jQuery),
37
- _prevStatus,
38
- _window = $(window),
39
- _body,
40
- _document,
41
- _prevContentType,
42
- _wrapClasses,
43
- _currPopupType;
44
-
45
-
46
- /**
47
- * Private functions
48
- */
49
- var _mfpOn = function(name, f) {
50
- mfp.ev.on(NS + name + EVENT_NS, f);
51
- },
52
- _getEl = function(className, appendTo, html, raw) {
53
- var el = document.createElement('div');
54
- el.className = 'mfp-'+className;
55
- if(html) {
56
- el.innerHTML = html;
57
- }
58
- if(!raw) {
59
- el = $(el);
60
- if(appendTo) {
61
- el.appendTo(appendTo);
62
- }
63
- } else if(appendTo) {
64
- appendTo.appendChild(el);
65
- }
66
- return el;
67
- },
68
- _mfpTrigger = function(e, data) {
69
- mfp.ev.triggerHandler(NS + e, data);
70
-
71
- if(mfp.st.callbacks) {
72
- // converts "mfpEventName" to "eventName" callback and triggers it if it's present
73
- e = e.charAt(0).toLowerCase() + e.slice(1);
74
- if(mfp.st.callbacks[e]) {
75
- mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]);
76
- }
77
- }
78
- },
79
- _getCloseBtn = function(type) {
80
- if(type !== _currPopupType || !mfp.currTemplate.closeBtn) {
81
- mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) );
82
- _currPopupType = type;
83
- }
84
- return mfp.currTemplate.closeBtn;
85
- },
86
- // Initialize Magnific Popup only when called at least once
87
- _checkInstance = function() {
88
- if(!$.magnificPopup.instance) {
89
- mfp = new MagnificPopup();
90
- mfp.init();
91
- $.magnificPopup.instance = mfp;
92
- }
93
- },
94
- // CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr
95
- supportsTransitions = function() {
96
- var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist
97
- v = ['ms','O','Moz','Webkit']; // 'v' for vendor
98
-
99
- if( s['transition'] !== undefined ) {
100
- return true;
101
- }
102
-
103
- while( v.length ) {
104
- if( v.pop() + 'Transition' in s ) {
105
- return true;
106
- }
107
- }
108
-
109
- return false;
110
- };
111
-
112
-
113
-
114
- /**
115
- * Public functions
116
- */
117
- MagnificPopup.prototype = {
118
-
119
- constructor: MagnificPopup,
120
-
121
- /**
122
- * Initializes Magnific Popup plugin.
123
- * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed
124
- */
125
- init: function() {
126
- var appVersion = navigator.appVersion;
127
- mfp.isIE7 = appVersion.indexOf("MSIE 7.") !== -1;
128
- mfp.isIE8 = appVersion.indexOf("MSIE 8.") !== -1;
129
- mfp.isLowIE = mfp.isIE7 || mfp.isIE8;
130
- mfp.isAndroid = (/android/gi).test(appVersion);
131
- mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
132
- mfp.supportsTransition = supportsTransitions();
133
-
134
- // We disable fixed positioned lightbox on devices that don't handle it nicely.
135
- // If you know a better way of detecting this - let me know.
136
- mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) );
137
- _body = $(document.body);
138
- _document = $(document);
139
-
140
- mfp.popupsCache = {};
141
- },
142
-
143
- /**
144
- * Opens popup
145
- * @param data [description]
146
- */
147
- open: function(data) {
148
-
149
- var i;
150
-
151
- if(data.isObj === false) {
152
- // convert jQuery collection to array to avoid conflicts later
153
- mfp.items = data.items.toArray();
154
-
155
- mfp.index = 0;
156
- var items = data.items,
157
- item;
158
- for(i = 0; i < items.length; i++) {
159
- item = items[i];
160
- if(item.parsed) {
161
- item = item.el[0];
162
- }
163
- if(item === data.el[0]) {
164
- mfp.index = i;
165
- break;
166
- }
167
- }
168
- } else {
169
- mfp.items = $.isArray(data.items) ? data.items : [data.items];
170
- mfp.index = data.index || 0;
171
- }
172
-
173
- // if popup is already opened - we just update the content
174
- if(mfp.isOpen) {
175
- mfp.updateItemHTML();
176
- return;
177
- }
178
-
179
- mfp.types = [];
180
- _wrapClasses = '';
181
- if(data.mainEl && data.mainEl.length) {
182
- mfp.ev = data.mainEl.eq(0);
183
- } else {
184
- mfp.ev = _document;
185
- }
186
-
187
- if(data.key) {
188
- if(!mfp.popupsCache[data.key]) {
189
- mfp.popupsCache[data.key] = {};
190
- }
191
- mfp.currTemplate = mfp.popupsCache[data.key];
192
- } else {
193
- mfp.currTemplate = {};
194
- }
195
-
196
-
197
-
198
- mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data );
199
- mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos;
200
-
201
- if(mfp.st.modal) {
202
- mfp.st.closeOnContentClick = false;
203
- mfp.st.closeOnBgClick = false;
204
- mfp.st.showCloseBtn = false;
205
- mfp.st.enableEscapeKey = false;
206
- }
207
-
208
-
209
- // Building markup
210
- // main containers are created only once
211
- if(!mfp.bgOverlay) {
212
-
213
- // Dark overlay
214
- mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() {
215
- mfp.close();
216
- });
217
-
218
- mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) {
219
- if(mfp._checkIfClose(e.target)) {
220
- mfp.close();
221
- }
222
- });
223
-
224
- mfp.container = _getEl('container', mfp.wrap);
225
- }
226
-
227
- mfp.contentContainer = _getEl('content');
228
- if(mfp.st.preloader) {
229
- mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading);
230
- }
231
-
232
-
233
- // Initializing modules
234
- var modules = $.magnificPopup.modules;
235
- for(i = 0; i < modules.length; i++) {
236
- var n = modules[i];
237
- n = n.charAt(0).toUpperCase() + n.slice(1);
238
- mfp['init'+n].call(mfp);
239
- }
240
- _mfpTrigger('BeforeOpen');
241
-
242
-
243
- if(mfp.st.showCloseBtn) {
244
- // Close button
245
- if(!mfp.st.closeBtnInside) {
246
- mfp.wrap.append( _getCloseBtn() );
247
- } else {
248
- _mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) {
249
- values.close_replaceWith = _getCloseBtn(item.type);
250
- });
251
- _wrapClasses += ' mfp-close-btn-in';
252
- }
253
- }
254
-
255
- if(mfp.st.alignTop) {
256
- _wrapClasses += ' mfp-align-top';
257
- }
258
-
259
-
260
-
261
- if(mfp.fixedContentPos) {
262
- mfp.wrap.css({
263
- overflow: mfp.st.overflowY,
264
- overflowX: 'hidden',
265
- overflowY: mfp.st.overflowY
266
- });
267
- } else {
268
- mfp.wrap.css({
269
- top: _window.scrollTop(),
270
- position: 'absolute'
271
- });
272
- }
273
- if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) {
274
- mfp.bgOverlay.css({
275
- height: _document.height(),
276
- position: 'absolute'
277
- });
278
- }
279
-
280
-
281
-
282
- if(mfp.st.enableEscapeKey) {
283
- // Close on ESC key
284
- _document.on('keyup' + EVENT_NS, function(e) {
285
- if(e.keyCode === 27) {
286
- mfp.close();
287
- }
288
- });
289
- }
290
-
291
- _window.on('resize' + EVENT_NS, function() {
292
- mfp.updateSize();
293
- });
294
-
295
-
296
- if(!mfp.st.closeOnContentClick) {
297
- _wrapClasses += ' mfp-auto-cursor';
298
- }
299
-
300
- if(_wrapClasses)
301
- mfp.wrap.addClass(_wrapClasses);
302
-
303
-
304
- // this triggers recalculation of layout, so we get it once to not to trigger twice
305
- var windowHeight = mfp.wH = _window.height();
306
-
307
-
308
- var windowStyles = {};
309
-
310
- if( mfp.fixedContentPos ) {
311
- if(mfp._hasScrollBar(windowHeight)){
312
- var s = mfp._getScrollbarSize();
313
- if(s) {
314
- windowStyles.marginRight = s;
315
- }
316
- }
317
- }
318
-
319
- if(mfp.fixedContentPos) {
320
- if(!mfp.isIE7) {
321
- windowStyles.overflow = 'hidden';
322
- } else {
323
- // ie7 double-scroll bug
324
- $('body, html').css('overflow', 'hidden');
325
- }
326
- }
327
-
328
-
329
-
330
- var classesToadd = mfp.st.mainClass;
331
- if(mfp.isIE7) {
332
- classesToadd += ' mfp-ie7';
333
- }
334
- if(classesToadd) {
335
- mfp._addClassToMFP( classesToadd );
336
- }
337
-
338
- // add content
339
- mfp.updateItemHTML();
340
-
341
- _mfpTrigger('BuildControls');
342
-
343
-
344
- // remove scrollbar, add margin e.t.c
345
- $('html').css(windowStyles);
346
-
347
- // add everything to DOM
348
- mfp.bgOverlay.add(mfp.wrap).prependTo( document.body );
349
-
350
-
351
-
352
- // Save last focused element
353
- mfp._lastFocusedEl = document.activeElement;
354
-
355
- // Wait for next cycle to allow CSS transition
356
- setTimeout(function() {
357
-
358
- if(mfp.content) {
359
- mfp._addClassToMFP(READY_CLASS);
360
- mfp._setFocus();
361
- } else {
362
- // if content is not defined (not loaded e.t.c) we add class only for BG
363
- mfp.bgOverlay.addClass(READY_CLASS);
364
- }
365
-
366
- // Trap the focus in popup
367
- _document.on('focusin' + EVENT_NS, mfp._onFocusIn);
368
-
369
- }, 16);
370
-
371
- mfp.isOpen = true;
372
- mfp.updateSize(windowHeight);
373
- _mfpTrigger(OPEN_EVENT);
374
-
375
- return data;
376
- },
377
-
378
- /**
379
- * Closes the popup
380
- */
381
- close: function() {
382
- if(!mfp.isOpen) return;
383
- _mfpTrigger(BEFORE_CLOSE_EVENT);
384
-
385
- mfp.isOpen = false;
386
- // for CSS3 animation
387
- if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) {
388
- mfp._addClassToMFP(REMOVING_CLASS);
389
- setTimeout(function() {
390
- mfp._close();
391
- }, mfp.st.removalDelay);
392
- } else {
393
- mfp._close();
394
- }
395
- },
396
-
397
- /**
398
- * Helper for close() function
399
- */
400
- _close: function() {
401
- _mfpTrigger(CLOSE_EVENT);
402
-
403
- var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';
404
-
405
- mfp.bgOverlay.detach();
406
- mfp.wrap.detach();
407
- mfp.container.empty();
408
-
409
- if(mfp.st.mainClass) {
410
- classesToRemove += mfp.st.mainClass + ' ';
411
- }
412
-
413
- mfp._removeClassFromMFP(classesToRemove);
414
-
415
- if(mfp.fixedContentPos) {
416
- var windowStyles = {marginRight: ''};
417
- if(mfp.isIE7) {
418
- $('body, html').css('overflow', '');
419
- } else {
420
- windowStyles.overflow = '';
421
- }
422
- $('html').css(windowStyles);
423
- }
424
-
425
- _document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);
426
- mfp.ev.off(EVENT_NS);
427
-
428
- // clean up DOM elements that aren't removed
429
- mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style');
430
- mfp.bgOverlay.attr('class', 'mfp-bg');
431
- mfp.container.attr('class', 'mfp-container');
432
-
433
- // remove close button from target element
434
- if(mfp.st.showCloseBtn &&
435
- (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) {
436
- if(mfp.currTemplate.closeBtn)
437
- mfp.currTemplate.closeBtn.detach();
438
- }
439
-
440
-
441
- if(mfp._lastFocusedEl) {
442
- $(mfp._lastFocusedEl).focus(); // put tab focus back
443
- }
444
- mfp.currItem = null;
445
- mfp.content = null;
446
- mfp.currTemplate = null;
447
- mfp.prevHeight = 0;
448
-
449
- _mfpTrigger(AFTER_CLOSE_EVENT);
450
- },
451
-
452
- updateSize: function(winHeight) {
453
-
454
- if(mfp.isIOS) {
455
- // fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2
456
- var zoomLevel = document.documentElement.clientWidth / window.innerWidth;
457
- var height = window.innerHeight * zoomLevel;
458
- mfp.wrap.css('height', height);
459
- mfp.wH = height;
460
- } else {
461
- mfp.wH = winHeight || _window.height();
462
- }
463
- // Fixes #84: popup incorrectly positioned with position:relative on body
464
- if(!mfp.fixedContentPos) {
465
- mfp.wrap.css('height', mfp.wH);
466
- }
467
-
468
- _mfpTrigger('Resize');
469
-
470
- },
471
-
472
- /**
473
- * Set content of popup based on current index
474
- */
475
- updateItemHTML: function() {
476
- var item = mfp.items[mfp.index];
477
-
478
- // Detach and perform modifications
479
- mfp.contentContainer.detach();
480
-
481
- if(mfp.content)
482
- mfp.content.detach();
483
-
484
- if(!item.parsed) {
485
- item = mfp.parseEl( mfp.index );
486
- }
487
-
488
- var type = item.type;
489
-
490
- _mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
491
- // BeforeChange event works like so:
492
- // _mfpOn('BeforeChange', function(e, prevType, newType) { });
493
-
494
- mfp.currItem = item;
495
-
496
-
497
-
498
-
499
-
500
- if(!mfp.currTemplate[type]) {
501
- var markup = mfp.st[type] ? mfp.st[type].markup : false;
502
-
503
- // allows to modify markup
504
- _mfpTrigger('FirstMarkupParse', markup);
505
-
506
- if(markup) {
507
- mfp.currTemplate[type] = $(markup);
508
- } else {
509
- // if there is no markup found we just define that template is parsed
510
- mfp.currTemplate[type] = true;
511
- }
512
- }
513
-
514
- if(_prevContentType && _prevContentType !== item.type) {
515
- mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
516
- }
517
-
518
- var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
519
- mfp.appendContent(newContent, type);
520
-
521
- item.preloaded = true;
522
-
523
- _mfpTrigger(CHANGE_EVENT, item);
524
- _prevContentType = item.type;
525
-
526
- // Append container back after its content changed
527
- mfp.container.prepend(mfp.contentContainer);
528
-
529
- _mfpTrigger('AfterChange');
530
- },
531
-
532
-
533
- /**
534
- * Set HTML content of popup
535
- */
536
- appendContent: function(newContent, type) {
537
- mfp.content = newContent;
538
-
539
- if(newContent) {
540
- if(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&
541
- mfp.currTemplate[type] === true) {
542
- // if there is no markup, we just append close button element inside
543
- if(!mfp.content.find('.mfp-close').length) {
544
- mfp.content.append(_getCloseBtn());
545
- }
546
- } else {
547
- mfp.content = newContent;
548
- }
549
- } else {
550
- mfp.content = '';
551
- }
552
-
553
- _mfpTrigger(BEFORE_APPEND_EVENT);
554
- mfp.container.addClass('mfp-'+type+'-holder');
555
-
556
- mfp.contentContainer.append(mfp.content);
557
- },
558
-
559
-
560
-
561
-
562
- /**
563
- * Creates Magnific Popup data object based on given data
564
- * @param {int} index Index of item to parse
565
- */
566
- parseEl: function(index) {
567
- var item = mfp.items[index],
568
- type = item.type;
569
-
570
- if(item.tagName) {
571
- item = { el: $(item) };
572
- } else {
573
- item = { data: item, src: item.src };
574
- }
575
-
576
- if(item.el) {
577
- var types = mfp.types;
578
-
579
- // check for 'mfp-TYPE' class
580
- for(var i = 0; i < types.length; i++) {
581
- if( item.el.hasClass('mfp-'+types[i]) ) {
582
- type = types[i];
583
- break;
584
- }
585
- }
586
-
587
- item.src = item.el.attr('data-mfp-src');
588
- if(!item.src) {
589
- item.src = item.el.attr('href');
590
- }
591
- }
592
-
593
- item.type = type || mfp.st.type || 'inline';
594
- item.index = index;
595
- item.parsed = true;
596
- mfp.items[index] = item;
597
- _mfpTrigger('ElementParse', item);
598
-
599
- return mfp.items[index];
600
- },
601
-
602
-
603
- /**
604
- * Initializes single popup or a group of popups
605
- */
606
- addGroup: function(el, options) {
607
- var eHandler = function(e) {
608
- e.mfpEl = this;
609
- mfp._openClick(e, el, options);
610
- };
611
-
612
- if(!options) {
613
- options = {};
614
- }
615
-
616
- var eName = 'click.magnificPopup';
617
- options.mainEl = el;
618
-
619
- if(options.items) {
620
- options.isObj = true;
621
- el.off(eName).on(eName, eHandler);
622
- } else {
623
- options.isObj = false;
624
- if(options.delegate) {
625
- el.off(eName).on(eName, options.delegate , eHandler);
626
- } else {
627
- options.items = el;
628
- el.off(eName).on(eName, eHandler);
629
- }
630
- }
631
- },
632
- _openClick: function(e, el, options) {
633
- var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;
634
-
635
-
636
- if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey ) ) {
637
- return;
638
- }
639
-
640
- var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;
641
-
642
- if(disableOn) {
643
- if($.isFunction(disableOn)) {
644
- if( !disableOn.call(mfp) ) {
645
- return true;
646
- }
647
- } else { // else it's number
648
- if( _window.width() < disableOn ) {
649
- return true;
650
- }
651
- }
652
- }
653
-
654
- if(e.type) {
655
- e.preventDefault();
656
-
657
- // This will prevent popup from closing if element is inside and popup is already opened
658
- if(mfp.isOpen) {
659
- e.stopPropagation();
660
- }
661
- }
662
-
663
-
664
- options.el = $(e.mfpEl);
665
- if(options.delegate) {
666
- options.items = el.find(options.delegate);
667
- }
668
- mfp.open(options);
669
- },
670
-
671
-
672
- /**
673
- * Updates text on preloader
674
- */
675
- updateStatus: function(status, text) {
676
-
677
- if(mfp.preloader) {
678
- if(_prevStatus !== status) {
679
- mfp.container.removeClass('mfp-s-'+_prevStatus);
680
- }
681
-
682
- if(!text && status === 'loading') {
683
- text = mfp.st.tLoading;
684
- }
685
-
686
- var data = {
687
- status: status,
688
- text: text
689
- };
690
- // allows to modify status
691
- _mfpTrigger('UpdateStatus', data);
692
-
693
- status = data.status;
694
- text = data.text;
695
-
696
- mfp.preloader.html(text);
697
-
698
- mfp.preloader.find('a').on('click', function(e) {
699
- e.stopImmediatePropagation();
700
- });
701
-
702
- mfp.container.addClass('mfp-s-'+status);
703
- _prevStatus = status;
704
- }
705
- },
706
-
707
-
708
- /*
709
- "Private" helpers that aren't private at all
710
- */
711
- // Check to close popup or not
712
- // "target" is an element that was clicked
713
- _checkIfClose: function(target) {
714
-
715
- if($(target).hasClass(PREVENT_CLOSE_CLASS)) {
716
- return;
717
- }
718
-
719
- var closeOnContent = mfp.st.closeOnContentClick;
720
- var closeOnBg = mfp.st.closeOnBgClick;
721
-
722
- if(closeOnContent && closeOnBg) {
723
- return true;
724
- } else {
725
-
726
- // We close the popup if click is on close button or on preloader. Or if there is no content.
727
- if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) {
728
- return true;
729
- }
730
-
731
- // if click is outside the content
732
- if( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) {
733
- if(closeOnBg) {
734
- // last check, if the clicked element is in DOM, (in case it's removed onclick)
735
- if( $.contains(document, target) ) {
736
- return true;
737
- }
738
- }
739
- } else if(closeOnContent) {
740
- return true;
741
- }
742
-
743
- }
744
- return false;
745
- },
746
- _addClassToMFP: function(cName) {
747
- mfp.bgOverlay.addClass(cName);
748
- mfp.wrap.addClass(cName);
749
- },
750
- _removeClassFromMFP: function(cName) {
751
- this.bgOverlay.removeClass(cName);
752
- mfp.wrap.removeClass(cName);
753
- },
754
- _hasScrollBar: function(winHeight) {
755
- return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) );
756
- },
757
- _setFocus: function() {
758
- (mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
759
- },
760
- _onFocusIn: function(e) {
761
- if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {
762
- mfp._setFocus();
763
- return false;
764
- }
765
- },
766
- _parseMarkup: function(template, values, item) {
767
- var arr;
768
- if(item.data) {
769
- values = $.extend(item.data, values);
770
- }
771
- _mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] );
772
-
773
- $.each(values, function(key, value) {
774
- if(value === undefined || value === false) {
775
- return true;
776
- }
777
- arr = key.split('_');
778
- if(arr.length > 1) {
779
- var el = template.find(EVENT_NS + '-'+arr[0]);
780
-
781
- if(el.length > 0) {
782
- var attr = arr[1];
783
- if(attr === 'replaceWith') {
784
- if(el[0] !== value[0]) {
785
- el.replaceWith(value);
786
- }
787
- } else if(attr === 'img') {
788
- if(el.is('img')) {
789
- el.attr('src', value);
790
- } else {
791
- el.replaceWith( '<img src="'+value+'" class="' + el.attr('class') + '" />' );
792
- }
793
- } else {
794
- el.attr(arr[1], value);
795
- }
796
- }
797
-
798
- } else {
799
- template.find(EVENT_NS + '-'+key).html(value);
800
- }
801
- });
802
- },
803
-
804
- _getScrollbarSize: function() {
805
- // thx David
806
- if(mfp.scrollbarSize === undefined) {
807
- var scrollDiv = document.createElement("div");
808
- scrollDiv.id = "mfp-sbm";
809
- scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';
810
- document.body.appendChild(scrollDiv);
811
- mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
812
- document.body.removeChild(scrollDiv);
813
- }
814
- return mfp.scrollbarSize;
815
- }
816
-
817
- }; /* MagnificPopup core prototype end */
818
-
819
-
820
-
821
-
822
- /**
823
- * Public static functions
824
- */
825
- $.magnificPopup = {
826
- instance: null,
827
- proto: MagnificPopup.prototype,
828
- modules: [],
829
-
830
- open: function(options, index) {
831
- _checkInstance();
832
-
833
- if(!options) {
834
- options = {};
835
- } else {
836
- options = $.extend(true, {}, options);
837
- }
838
-
839
-
840
- options.isObj = true;
841
- options.index = index || 0;
842
- return this.instance.open(options);
843
- },
844
-
845
- close: function() {
846
- return $.magnificPopup.instance && $.magnificPopup.instance.close();
847
- },
848
-
849
- registerModule: function(name, module) {
850
- if(module.options) {
851
- $.magnificPopup.defaults[name] = module.options;
852
- }
853
- $.extend(this.proto, module.proto);
854
- this.modules.push(name);
855
- },
856
-
857
- defaults: {
858
-
859
- // Info about options is in docs:
860
- // http://dimsemenov.com/plugins/magnific-popup/documentation.html#options
861
-
862
- disableOn: 0,
863
-
864
- key: null,
865
-
866
- midClick: false,
867
-
868
- mainClass: '',
869
-
870
- preloader: true,
871
-
872
- focus: '', // CSS selector of input to focus after popup is opened
873
-
874
- closeOnContentClick: false,
875
-
876
- closeOnBgClick: true,
877
-
878
- closeBtnInside: true,
879
-
880
- showCloseBtn: true,
881
-
882
- enableEscapeKey: true,
883
-
884
- modal: false,
885
-
886
- alignTop: false,
887
-
888
- removalDelay: 0,
889
-
890
- fixedContentPos: 'auto',
891
-
892
- fixedBgPos: 'auto',
893
-
894
- overflowY: 'auto',
895
-
896
- closeMarkup: '<button title="%title%" type="button" class="mfp-close">&times;</button>',
897
-
898
- tClose: 'Close (Esc)',
899
-
900
- tLoading: 'Loading...'
901
-
902
- }
903
- };
904
-
905
-
906
-
907
- $.fn.magnificPopup = function(options) {
908
- _checkInstance();
909
-
910
- var jqEl = $(this);
911
-
912
- // We call some API method of first param is a string
913
- if (typeof options === "string" ) {
914
-
915
- if(options === 'open') {
916
- var items,
917
- itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup,
918
- index = parseInt(arguments[1], 10) || 0;
919
-
920
- if(itemOpts.items) {
921
- items = itemOpts.items[index];
922
- } else {
923
- items = jqEl;
924
- if(itemOpts.delegate) {
925
- items = items.find(itemOpts.delegate);
926
- }
927
- items = items.eq( index );
928
- }
929
- mfp._openClick({mfpEl:items}, jqEl, itemOpts);
930
- } else {
931
- if(mfp.isOpen)
932
- mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1));
933
- }
934
-
935
- } else {
936
- // clone options obj
937
- options = $.extend(true, {}, options);
938
-
939
- /*
940
- * As Zepto doesn't support .data() method for objects
941
- * and it works only in normal browsers
942
- * we assign "options" object directly to the DOM element. FTW!
943
- */
944
- if(_isJQ) {
945
- jqEl.data('magnificPopup', options);
946
- } else {
947
- jqEl[0].magnificPopup = options;
948
- }
949
-
950
- mfp.addGroup(jqEl, options);
951
-
952
- }
953
- return jqEl;
954
- };
955
-
956
-
957
- //Quick benchmark
958
- /*
959
- var start = performance.now(),
960
- i,
961
- rounds = 1000;
962
-
963
- for(i = 0; i < rounds; i++) {
964
-
965
- }
966
- console.log('Test #1:', performance.now() - start);
967
-
968
- start = performance.now();
969
- for(i = 0; i < rounds; i++) {
970
-
971
- }
972
- console.log('Test #2:', performance.now() - start);
973
- */
974
-
975
-
976
- /*>>core*/
977
-
978
- /*>>inline*/
979
-
980
- var INLINE_NS = 'inline',
981
- _hiddenClass,
982
- _inlinePlaceholder,
983
- _lastInlineElement,
984
- _putInlineElementsBack = function() {
985
- if(_lastInlineElement) {
986
- _inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach();
987
- _lastInlineElement = null;
988
- }
989
- };
990
-
991
- $.magnificPopup.registerModule(INLINE_NS, {
992
- options: {
993
- hiddenClass: 'hide', // will be appended with `mfp-` prefix
994
- markup: '',
995
- tNotFound: 'Content not found'
996
- },
997
- proto: {
998
-
999
- initInline: function() {
1000
- mfp.types.push(INLINE_NS);
1001
-
1002
- _mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() {
1003
- _putInlineElementsBack();
1004
- });
1005
- },
1006
-
1007
- getInline: function(item, template) {
1008
-
1009
- _putInlineElementsBack();
1010
-
1011
- if(item.src) {
1012
- var inlineSt = mfp.st.inline,
1013
- el = $(item.src);
1014
-
1015
- if(el.length) {
1016
-
1017
- // If target element has parent - we replace it with placeholder and put it back after popup is closed
1018
- var parent = el[0].parentNode;
1019
- if(parent && parent.tagName) {
1020
- if(!_inlinePlaceholder) {
1021
- _hiddenClass = inlineSt.hiddenClass;
1022
- _inlinePlaceholder = _getEl(_hiddenClass);
1023
- _hiddenClass = 'mfp-'+_hiddenClass;
1024
- }
1025
- // replace target inline element with placeholder
1026
- _lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);
1027
- }
1028
-
1029
- mfp.updateStatus('ready');
1030
- } else {
1031
- mfp.updateStatus('error', inlineSt.tNotFound);
1032
- el = $('<div>');
1033
- }
1034
-
1035
- item.inlineElement = el;
1036
- return el;
1037
- }
1038
-
1039
- mfp.updateStatus('ready');
1040
- mfp._parseMarkup(template, {}, item);
1041
- return template;
1042
- }
1043
- }
1044
- });
1045
-
1046
- /*>>inline*/
1047
-
1048
- /*>>ajax*/
1049
- var AJAX_NS = 'ajax',
1050
- _ajaxCur,
1051
- _removeAjaxCursor = function() {
1052
- if(_ajaxCur) {
1053
- _body.removeClass(_ajaxCur);
1054
- }
1055
- },
1056
- _destroyAjaxRequest = function() {
1057
- _removeAjaxCursor();
1058
- if(mfp.req) {
1059
- mfp.req.abort();
1060
- }
1061
- };
1062
-
1063
- $.magnificPopup.registerModule(AJAX_NS, {
1064
-
1065
- options: {
1066
- settings: null,
1067
- cursor: 'mfp-ajax-cur',
1068
- tError: '<a href="%url%">The content</a> could not be loaded.'
1069
- },
1070
-
1071
- proto: {
1072
- initAjax: function() {
1073
- mfp.types.push(AJAX_NS);
1074
- _ajaxCur = mfp.st.ajax.cursor;
1075
-
1076
- _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
1077
- _mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
1078
- },
1079
- getAjax: function(item) {
1080
-
1081
- if(_ajaxCur)
1082
- _body.addClass(_ajaxCur);
1083
-
1084
- mfp.updateStatus('loading');
1085
-
1086
- var opts = $.extend({
1087
- url: item.src,
1088
- success: function(data, textStatus, jqXHR) {
1089
- var temp = {
1090
- data:data,
1091
- xhr:jqXHR
1092
- };
1093
-
1094
- _mfpTrigger('ParseAjax', temp);
1095
-
1096
- mfp.appendContent( $(temp.data), AJAX_NS );
1097
-
1098
- item.finished = true;
1099
-
1100
- _removeAjaxCursor();
1101
-
1102
- mfp._setFocus();
1103
-
1104
- setTimeout(function() {
1105
- mfp.wrap.addClass(READY_CLASS);
1106
- }, 16);
1107
-
1108
- mfp.updateStatus('ready');
1109
-
1110
- _mfpTrigger('AjaxContentAdded');
1111
- },
1112
- error: function() {
1113
- _removeAjaxCursor();
1114
- item.finished = item.loadError = true;
1115
- mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));
1116
- }
1117
- }, mfp.st.ajax.settings);
1118
-
1119
- mfp.req = $.ajax(opts);
1120
-
1121
- return '';
1122
- }
1123
- }
1124
- });
1125
-
1126
-
1127
-
1128
-
1129
-
1130
-
1131
-
1132
- /*>>ajax*/
1133
-
1134
- /*>>image*/
1135
- var _imgInterval,
1136
- _getTitle = function(item) {
1137
- if(item.data && item.data.title !== undefined)
1138
- return item.data.title;
1139
-
1140
- var src = mfp.st.image.titleSrc;
1141
-
1142
- if(src) {
1143
- if($.isFunction(src)) {
1144
- return src.call(mfp, item);
1145
- } else if(item.el) {
1146
- return item.el.attr(src) || '';
1147
- }
1148
- }
1149
- return '';
1150
- };
1151
-
1152
- $.magnificPopup.registerModule('image', {
1153
-
1154
- options: {
1155
- markup: '<div class="mfp-figure">'+
1156
- '<div class="mfp-close"></div>'+
1157
- '<figure>'+
1158
- '<div class="mfp-img"></div>'+
1159
- '<figcaption>'+
1160
- '<div class="mfp-bottom-bar">'+
1161
- '<div class="mfp-title"></div>'+
1162
- '<div class="mfp-counter"></div>'+
1163
- '</div>'+
1164
- '</figcaption>'+
1165
- '</figure>'+
1166
- '</div>',
1167
- cursor: 'mfp-zoom-out-cur',
1168
- titleSrc: 'title',
1169
- verticalFit: true,
1170
- tError: '<a href="%url%">The image</a> could not be loaded.'
1171
- },
1172
-
1173
- proto: {
1174
- initImage: function() {
1175
- var imgSt = mfp.st.image,
1176
- ns = '.image';
1177
-
1178
- mfp.types.push('image');
1179
-
1180
- _mfpOn(OPEN_EVENT+ns, function() {
1181
- if(mfp.currItem.type === 'image' && imgSt.cursor) {
1182
- _body.addClass(imgSt.cursor);
1183
- }
1184
- });
1185
-
1186
- _mfpOn(CLOSE_EVENT+ns, function() {
1187
- if(imgSt.cursor) {
1188
- _body.removeClass(imgSt.cursor);
1189
- }
1190
- _window.off('resize' + EVENT_NS);
1191
- });
1192
-
1193
- _mfpOn('Resize'+ns, mfp.resizeImage);
1194
- if(mfp.isLowIE) {
1195
- _mfpOn('AfterChange', mfp.resizeImage);
1196
- }
1197
- },
1198
- resizeImage: function() {
1199
- var item = mfp.currItem;
1200
- if(!item || !item.img) return;
1201
-
1202
- if(mfp.st.image.verticalFit) {
1203
- var decr = 0;
1204
- // fix box-sizing in ie7/8
1205
- if(mfp.isLowIE) {
1206
- decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);
1207
- }
1208
- item.img.css('max-height', mfp.wH-decr);
1209
- }
1210
- },
1211
- _onImageHasSize: function(item) {
1212
- if(item.img) {
1213
-
1214
- item.hasSize = true;
1215
-
1216
- if(_imgInterval) {
1217
- clearInterval(_imgInterval);
1218
- }
1219
-
1220
- item.isCheckingImgSize = false;
1221
-
1222
- _mfpTrigger('ImageHasSize', item);
1223
-
1224
- if(item.imgHidden) {
1225
- if(mfp.content)
1226
- mfp.content.removeClass('mfp-loading');
1227
-
1228
- item.imgHidden = false;
1229
- }
1230
-
1231
- }
1232
- },
1233
-
1234
- /**
1235
- * Function that loops until the image has size to display elements that rely on it asap
1236
- */
1237
- findImageSize: function(item) {
1238
-
1239
- var counter = 0,
1240
- img = item.img[0],
1241
- mfpSetInterval = function(delay) {
1242
-
1243
- if(_imgInterval) {
1244
- clearInterval(_imgInterval);
1245
- }
1246
- // decelerating interval that checks for size of an image
1247
- _imgInterval = setInterval(function() {
1248
- if(img.naturalWidth > 0) {
1249
- mfp._onImageHasSize(item);
1250
- return;
1251
- }
1252
-
1253
- if(counter > 200) {
1254
- clearInterval(_imgInterval);
1255
- }
1256
-
1257
- counter++;
1258
- if(counter === 3) {
1259
- mfpSetInterval(10);
1260
- } else if(counter === 40) {
1261
- mfpSetInterval(50);
1262
- } else if(counter === 100) {
1263
- mfpSetInterval(500);
1264
- }
1265
- }, delay);
1266
- };
1267
-
1268
- mfpSetInterval(1);
1269
- },
1270
-
1271
- getImage: function(item, template) {
1272
-
1273
- var guard = 0,
1274
-
1275
- // image load complete handler
1276
- onLoadComplete = function() {
1277
- if(item) {
1278
- if (item.img[0].complete) {
1279
- item.img.off('.mfploader');
1280
-
1281
- if(item === mfp.currItem){
1282
- mfp._onImageHasSize(item);
1283
-
1284
- mfp.updateStatus('ready');
1285
- }
1286
-
1287
- item.hasSize = true;
1288
- item.loaded = true;
1289
-
1290
- _mfpTrigger('ImageLoadComplete');
1291
-
1292
- }
1293
- else {
1294
- // if image complete check fails 200 times (20 sec), we assume that there was an error.
1295
- guard++;
1296
- if(guard < 200) {
1297
- setTimeout(onLoadComplete,100);
1298
- } else {
1299
- onLoadError();
1300
- }
1301
- }
1302
- }
1303
- },
1304
-
1305
- // image error handler
1306
- onLoadError = function() {
1307
- if(item) {
1308
- item.img.off('.mfploader');
1309
- if(item === mfp.currItem){
1310
- mfp._onImageHasSize(item);
1311
- mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
1312
- }
1313
-
1314
- item.hasSize = true;
1315
- item.loaded = true;
1316
- item.loadError = true;
1317
- }
1318
- },
1319
- imgSt = mfp.st.image;
1320
-
1321
-
1322
- var el = template.find('.mfp-img');
1323
- if(el.length) {
1324
- var img = document.createElement('img');
1325
- img.className = 'mfp-img';
1326
- item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
1327
- img.src = item.src;
1328
-
1329
- // without clone() "error" event is not firing when IMG is replaced by new IMG
1330
- // TODO: find a way to avoid such cloning
1331
- if(el.is('img')) {
1332
- item.img = item.img.clone();
1333
- }
1334
-
1335
- img = item.img[0];
1336
- if(img.naturalWidth > 0) {
1337
- item.hasSize = true;
1338
- } else if(!img.width) {
1339
- item.hasSize = false;
1340
- }
1341
- }
1342
-
1343
- mfp._parseMarkup(template, {
1344
- title: _getTitle(item),
1345
- img_replaceWith: item.img
1346
- }, item);
1347
-
1348
- mfp.resizeImage();
1349
-
1350
- if(item.hasSize) {
1351
- if(_imgInterval) clearInterval(_imgInterval);
1352
-
1353
- if(item.loadError) {
1354
- template.addClass('mfp-loading');
1355
- mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
1356
- } else {
1357
- template.removeClass('mfp-loading');
1358
- mfp.updateStatus('ready');
1359
- }
1360
- return template;
1361
- }
1362
-
1363
- mfp.updateStatus('loading');
1364
- item.loading = true;
1365
-
1366
- if(!item.hasSize) {
1367
- item.imgHidden = true;
1368
- template.addClass('mfp-loading');
1369
- mfp.findImageSize(item);
1370
- }
1371
-
1372
- return template;
1373
- }
1374
- }
1375
- });
1376
-
1377
-
1378
-
1379
- /*>>image*/
1380
-
1381
- /*>>zoom*/
1382
- var hasMozTransform,
1383
- getHasMozTransform = function() {
1384
- if(hasMozTransform === undefined) {
1385
- hasMozTransform = document.createElement('p').style.MozTransform !== undefined;
1386
- }
1387
- return hasMozTransform;
1388
- };
1389
-
1390
- $.magnificPopup.registerModule('zoom', {
1391
-
1392
- options: {
1393
- enabled: true,
1394
- easing: 'ease-in-out',
1395
- duration: 300,
1396
- opener: function(element) {
1397
- return element.is('img') ? element : element.find('img');
1398
- }
1399
- },
1400
-
1401
- proto: {
1402
-
1403
- initZoom: function() {
1404
- var zoomSt = mfp.st.zoom,
1405
- ns = '.zoom',
1406
- image;
1407
-
1408
- if(!zoomSt.enabled || !mfp.supportsTransition) {
1409
- return;
1410
- }
1411
-
1412
- var duration = zoomSt.duration,
1413
- getElToAnimate = function(image) {
1414
- var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),
1415
- transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,
1416
- cssObj = {
1417
- position: 'fixed',
1418
- zIndex: 9999,
1419
- left: 0,
1420
- top: 0,
1421
- '-webkit-backface-visibility': 'hidden'
1422
- },
1423
- t = 'transition';
1424
-
1425
- cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition;
1426
-
1427
- newImg.css(cssObj);
1428
- return newImg;
1429
- },
1430
- showMainContent = function() {
1431
- mfp.content.css('visibility', 'visible');
1432
- },
1433
- openTimeout,
1434
- animatedImg;
1435
-
1436
- _mfpOn('BuildControls'+ns, function() {
1437
- if(mfp._allowZoom()) {
1438
-
1439
- clearTimeout(openTimeout);
1440
- mfp.content.css('visibility', 'hidden');
1441
-
1442
- // Basically, all code below does is clones existing image, puts in on top of the current one and animated it
1443
-
1444
- image = mfp._getItemToZoom();
1445
-
1446
- if(!image) {
1447
- showMainContent();
1448
- return;
1449
- }
1450
-
1451
- animatedImg = getElToAnimate(image);
1452
-
1453
- animatedImg.css( mfp._getOffset() );
1454
-
1455
- mfp.wrap.append(animatedImg);
1456
-
1457
- openTimeout = setTimeout(function() {
1458
- animatedImg.css( mfp._getOffset( true ) );
1459
- openTimeout = setTimeout(function() {
1460
-
1461
- showMainContent();
1462
-
1463
- setTimeout(function() {
1464
- animatedImg.remove();
1465
- image = animatedImg = null;
1466
- _mfpTrigger('ZoomAnimationEnded');
1467
- }, 16); // avoid blink when switching images
1468
-
1469
- }, duration); // this timeout equals animation duration
1470
-
1471
- }, 16); // by adding this timeout we avoid short glitch at the beginning of animation
1472
-
1473
-
1474
- // Lots of timeouts...
1475
- }
1476
- });
1477
- _mfpOn(BEFORE_CLOSE_EVENT+ns, function() {
1478
- if(mfp._allowZoom()) {
1479
-
1480
- clearTimeout(openTimeout);
1481
-
1482
- mfp.st.removalDelay = duration;
1483
-
1484
- if(!image) {
1485
- image = mfp._getItemToZoom();
1486
- if(!image) {
1487
- return;
1488
- }
1489
- animatedImg = getElToAnimate(image);
1490
- }
1491
-
1492
-
1493
- animatedImg.css( mfp._getOffset(true) );
1494
- mfp.wrap.append(animatedImg);
1495
- mfp.content.css('visibility', 'hidden');
1496
-
1497
- setTimeout(function() {
1498
- animatedImg.css( mfp._getOffset() );
1499
- }, 16);
1500
- }
1501
-
1502
- });
1503
-
1504
- _mfpOn(CLOSE_EVENT+ns, function() {
1505
- if(mfp._allowZoom()) {
1506
- showMainContent();
1507
- if(animatedImg) {
1508
- animatedImg.remove();
1509
- }
1510
- image = null;
1511
- }
1512
- });
1513
- },
1514
-
1515
- _allowZoom: function() {
1516
- return mfp.currItem.type === 'image';
1517
- },
1518
-
1519
- _getItemToZoom: function() {
1520
- if(mfp.currItem.hasSize) {
1521
- return mfp.currItem.img;
1522
- } else {
1523
- return false;
1524
- }
1525
- },
1526
-
1527
- // Get element postion relative to viewport
1528
- _getOffset: function(isLarge) {
1529
- var el;
1530
- if(isLarge) {
1531
- el = mfp.currItem.img;
1532
- } else {
1533
- el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);
1534
- }
1535
-
1536
- var offset = el.offset();
1537
- var paddingTop = parseInt(el.css('padding-top'),10);
1538
- var paddingBottom = parseInt(el.css('padding-bottom'),10);
1539
- offset.top -= ( $(window).scrollTop() - paddingTop );
1540
-
1541
-
1542
- /*
1543
-
1544
- Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.
1545
-
1546
- */
1547
- var obj = {
1548
- width: el.width(),
1549
- // fix Zepto height+padding issue
1550
- height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop
1551
- };
1552
-
1553
- // I hate to do this, but there is no another option
1554
- if( getHasMozTransform() ) {
1555
- obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)';
1556
- } else {
1557
- obj.left = offset.left;
1558
- obj.top = offset.top;
1559
- }
1560
- return obj;
1561
- }
1562
-
1563
- }
1564
- });
1565
-
1566
-
1567
-
1568
- /*>>zoom*/
1569
-
1570
- /*>>iframe*/
1571
-
1572
- var IFRAME_NS = 'iframe',
1573
- _emptyPage = '//about:blank',
1574
-
1575
- _fixIframeBugs = function(isShowing) {
1576
- if(mfp.currTemplate[IFRAME_NS]) {
1577
- var el = mfp.currTemplate[IFRAME_NS].find('iframe');
1578
- if(el.length) {
1579
- // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug
1580
- if(!isShowing) {
1581
- el[0].src = _emptyPage;
1582
- }
1583
-
1584
- // IE8 black screen bug fix
1585
- if(mfp.isIE8) {
1586
- el.css('display', isShowing ? 'block' : 'none');
1587
- }
1588
- }
1589
- }
1590
- };
1591
-
1592
- $.magnificPopup.registerModule(IFRAME_NS, {
1593
-
1594
- options: {
1595
- markup: '<div class="mfp-iframe-scaler">'+
1596
- '<div class="mfp-close"></div>'+
1597
- '<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>'+
1598
- '</div>',
1599
-
1600
- srcAction: 'iframe_src',
1601
-
1602
- // we don't care and support only one default type of URL by default
1603
- patterns: {
1604
- youtube: {
1605
- index: 'youtube.com',
1606
- id: 'v=',
1607
- src: '//www.youtube.com/embed/%id%?autoplay=1'
1608
- },
1609
- vimeo: {
1610
- index: 'vimeo.com/',
1611
- id: '/',
1612
- src: '//player.vimeo.com/video/%id%?autoplay=1'
1613
- },
1614
- gmaps: {
1615
- index: '//maps.google.',
1616
- src: '%id%&output=embed'
1617
- }
1618
- }
1619
- },
1620
-
1621
- proto: {
1622
- initIframe: function() {
1623
- mfp.types.push(IFRAME_NS);
1624
-
1625
- _mfpOn('BeforeChange', function(e, prevType, newType) {
1626
- if(prevType !== newType) {
1627
- if(prevType === IFRAME_NS) {
1628
- _fixIframeBugs(); // iframe if removed
1629
- } else if(newType === IFRAME_NS) {
1630
- _fixIframeBugs(true); // iframe is showing
1631
- }
1632
- }// else {
1633
- // iframe source is switched, don't do anything
1634
- //}
1635
- });
1636
-
1637
- _mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() {
1638
- _fixIframeBugs();
1639
- });
1640
- },
1641
-
1642
- getIframe: function(item, template) {
1643
- var embedSrc = item.src;
1644
- var iframeSt = mfp.st.iframe;
1645
-
1646
- $.each(iframeSt.patterns, function() {
1647
- if(embedSrc.indexOf( this.index ) > -1) {
1648
- if(this.id) {
1649
- if(typeof this.id === 'string') {
1650
- embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);
1651
- } else {
1652
- embedSrc = this.id.call( this, embedSrc );
1653
- }
1654
- }
1655
- embedSrc = this.src.replace('%id%', embedSrc );
1656
- return false; // break;
1657
- }
1658
- });
1659
-
1660
- var dataObj = {};
1661
- if(iframeSt.srcAction) {
1662
- dataObj[iframeSt.srcAction] = embedSrc;
1663
- }
1664
- mfp._parseMarkup(template, dataObj, item);
1665
-
1666
- mfp.updateStatus('ready');
1667
-
1668
- return template;
1669
- }
1670
- }
1671
- });
1672
-
1673
-
1674
-
1675
- /*>>iframe*/
1676
-
1677
- /*>>gallery*/
1678
- /**
1679
- * Get looped index depending on number of slides
1680
- */
1681
- var _getLoopedId = function(index) {
1682
- var numSlides = mfp.items.length;
1683
- if(index > numSlides - 1) {
1684
- return index - numSlides;
1685
- } else if(index < 0) {
1686
- return numSlides + index;
1687
- }
1688
- return index;
1689
- },
1690
- _replaceCurrTotal = function(text, curr, total) {
1691
- return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
1692
- };
1693
-
1694
- $.magnificPopup.registerModule('gallery', {
1695
-
1696
- options: {
1697
- enabled: false,
1698
- arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
1699
- preload: [0,2],
1700
- navigateByImgClick: true,
1701
- arrows: true,
1702
-
1703
- tPrev: 'Previous (Left arrow key)',
1704
- tNext: 'Next (Right arrow key)',
1705
- tCounter: '%curr% of %total%'
1706
- },
1707
-
1708
- proto: {
1709
- initGallery: function() {
1710
-
1711
- var gSt = mfp.st.gallery,
1712
- ns = '.mfp-gallery',
1713
- supportsFastClick = Boolean($.fn.mfpFastClick);
1714
-
1715
- mfp.direction = true; // true - next, false - prev
1716
-
1717
- if(!gSt || !gSt.enabled ) return false;
1718
-
1719
- _wrapClasses += ' mfp-gallery';
1720
-
1721
- _mfpOn(OPEN_EVENT+ns, function() {
1722
-
1723
- if(gSt.navigateByImgClick) {
1724
- mfp.wrap.on('click'+ns, '.mfp-img', function() {
1725
- if(mfp.items.length > 1) {
1726
- mfp.next();
1727
- return false;
1728
- }
1729
- });
1730
- }
1731
-
1732
- _document.on('keydown'+ns, function(e) {
1733
- if (e.keyCode === 37) {
1734
- mfp.prev();
1735
- } else if (e.keyCode === 39) {
1736
- mfp.next();
1737
- }
1738
- });
1739
- });
1740
-
1741
- _mfpOn('UpdateStatus'+ns, function(e, data) {
1742
- if(data.text) {
1743
- data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
1744
- }
1745
- });
1746
-
1747
- _mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {
1748
- var l = mfp.items.length;
1749
- values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';
1750
- });
1751
-
1752
- _mfpOn('BuildControls' + ns, function() {
1753
- if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {
1754
- var markup = gSt.arrowMarkup,
1755
- arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
1756
- arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
1757
-
1758
- var eName = supportsFastClick ? 'mfpFastClick' : 'click';
1759
- arrowLeft[eName](function() {
1760
- mfp.prev();
1761
- });
1762
- arrowRight[eName](function() {
1763
- mfp.next();
1764
- });
1765
-
1766
- // Polyfill for :before and :after (adds elements with classes mfp-a and mfp-b)
1767
- if(mfp.isIE7) {
1768
- _getEl('b', arrowLeft[0], false, true);
1769
- _getEl('a', arrowLeft[0], false, true);
1770
- _getEl('b', arrowRight[0], false, true);
1771
- _getEl('a', arrowRight[0], false, true);
1772
- }
1773
-
1774
- mfp.container.append(arrowLeft.add(arrowRight));
1775
- }
1776
- });
1777
-
1778
- _mfpOn(CHANGE_EVENT+ns, function() {
1779
- if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
1780
-
1781
- mfp._preloadTimeout = setTimeout(function() {
1782
- mfp.preloadNearbyImages();
1783
- mfp._preloadTimeout = null;
1784
- }, 16);
1785
- });
1786
-
1787
-
1788
- _mfpOn(CLOSE_EVENT+ns, function() {
1789
- _document.off(ns);
1790
- mfp.wrap.off('click'+ns);
1791
-
1792
- if(mfp.arrowLeft && supportsFastClick) {
1793
- mfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick();
1794
- }
1795
- mfp.arrowRight = mfp.arrowLeft = null;
1796
- });
1797
-
1798
- },
1799
- next: function() {
1800
- mfp.direction = true;
1801
- mfp.index = _getLoopedId(mfp.index + 1);
1802
- mfp.updateItemHTML();
1803
- },
1804
- prev: function() {
1805
- mfp.direction = false;
1806
- mfp.index = _getLoopedId(mfp.index - 1);
1807
- mfp.updateItemHTML();
1808
- },
1809
- goTo: function(newIndex) {
1810
- mfp.direction = (newIndex >= mfp.index);
1811
- mfp.index = newIndex;
1812
- mfp.updateItemHTML();
1813
- },
1814
- preloadNearbyImages: function() {
1815
- var p = mfp.st.gallery.preload,
1816
- preloadBefore = Math.min(p[0], mfp.items.length),
1817
- preloadAfter = Math.min(p[1], mfp.items.length),
1818
- i;
1819
-
1820
- for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {
1821
- mfp._preloadItem(mfp.index+i);
1822
- }
1823
- for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {
1824
- mfp._preloadItem(mfp.index-i);
1825
- }
1826
- },
1827
- _preloadItem: function(index) {
1828
- index = _getLoopedId(index);
1829
-
1830
- if(mfp.items[index].preloaded) {
1831
- return;
1832
- }
1833
-
1834
- var item = mfp.items[index];
1835
- if(!item.parsed) {
1836
- item = mfp.parseEl( index );
1837
- }
1838
-
1839
- _mfpTrigger('LazyLoad', item);
1840
-
1841
- if(item.type === 'image') {
1842
- item.img = $('<img class="mfp-img" />').on('load.mfploader', function() {
1843
- item.hasSize = true;
1844
- }).on('error.mfploader', function() {
1845
- item.hasSize = true;
1846
- item.loadError = true;
1847
- _mfpTrigger('LazyLoadError', item);
1848
- }).attr('src', item.src);
1849
- }
1850
-
1851
-
1852
- item.preloaded = true;
1853
- }
1854
- }
1855
- });
1856
-
1857
- /*
1858
- Touch Support that might be implemented some day
1859
-
1860
- addSwipeGesture: function() {
1861
- var startX,
1862
- moved,
1863
- multipleTouches;
1864
-
1865
- return;
1866
-
1867
- var namespace = '.mfp',
1868
- addEventNames = function(pref, down, move, up, cancel) {
1869
- mfp._tStart = pref + down + namespace;
1870
- mfp._tMove = pref + move + namespace;
1871
- mfp._tEnd = pref + up + namespace;
1872
- mfp._tCancel = pref + cancel + namespace;
1873
- };
1874
-
1875
- if(window.navigator.msPointerEnabled) {
1876
- addEventNames('MSPointer', 'Down', 'Move', 'Up', 'Cancel');
1877
- } else if('ontouchstart' in window) {
1878
- addEventNames('touch', 'start', 'move', 'end', 'cancel');
1879
- } else {
1880
- return;
1881
- }
1882
- _window.on(mfp._tStart, function(e) {
1883
- var oE = e.originalEvent;
1884
- multipleTouches = moved = false;
1885
- startX = oE.pageX || oE.changedTouches[0].pageX;
1886
- }).on(mfp._tMove, function(e) {
1887
- if(e.originalEvent.touches.length > 1) {
1888
- multipleTouches = e.originalEvent.touches.length;
1889
- } else {
1890
- //e.preventDefault();
1891
- moved = true;
1892
- }
1893
- }).on(mfp._tEnd + ' ' + mfp._tCancel, function(e) {
1894
- if(moved && !multipleTouches) {
1895
- var oE = e.originalEvent,
1896
- diff = startX - (oE.pageX || oE.changedTouches[0].pageX);
1897
-
1898
- if(diff > 20) {
1899
- mfp.next();
1900
- } else if(diff < -20) {
1901
- mfp.prev();
1902
- }
1903
- }
1904
- });
1905
- },
1906
- */
1907
-
1908
-
1909
- /*>>gallery*/
1910
-
1911
- /*>>retina*/
1912
-
1913
- var RETINA_NS = 'retina';
1914
-
1915
- $.magnificPopup.registerModule(RETINA_NS, {
1916
- options: {
1917
- replaceSrc: function(item) {
1918
- return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; });
1919
- },
1920
- ratio: 1 // Function or number. Set to 1 to disable.
1921
- },
1922
- proto: {
1923
- initRetina: function() {
1924
- if(window.devicePixelRatio > 1) {
1925
-
1926
- var st = mfp.st.retina,
1927
- ratio = st.ratio;
1928
-
1929
- ratio = !isNaN(ratio) ? ratio : ratio();
1930
-
1931
- if(ratio > 1) {
1932
- _mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) {
1933
- item.img.css({
1934
- 'max-width': item.img[0].naturalWidth / ratio,
1935
- 'width': '100%'
1936
- });
1937
- });
1938
- _mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) {
1939
- item.src = st.replaceSrc(item, ratio);
1940
- });
1941
- }
1942
- }
1943
-
1944
- }
1945
- }
1946
- });
1947
-
1948
- /*>>retina*/
1949
-
1950
- /*>>fastclick*/
1951
- /**
1952
- * FastClick event implementation. (removes 300ms delay on touch devices)
1953
- * Based on https://developers.google.com/mobile/articles/fast_buttons
1954
- *
1955
- * You may use it outside the Magnific Popup by calling just:
1956
- *
1957
- * $('.your-el').mfpFastClick(function() {
1958
- * console.log('Clicked!');
1959
- * });
1960
- *
1961
- * To unbind:
1962
- * $('.your-el').destroyMfpFastClick();
1963
- *
1964
- *
1965
- * Note that it's a very basic and simple implementation, it blocks ghost click on the same element where it was bound.
1966
- * If you need something more advanced, use plugin by FT Labs https://github.com/ftlabs/fastclick
1967
- *
1968
- */
1969
-
1970
- (function() {
1971
- var ghostClickDelay = 1000,
1972
- supportsTouch = 'ontouchstart' in window,
1973
- unbindTouchMove = function() {
1974
- _window.off('touchmove'+ns+' touchend'+ns);
1975
- },
1976
- eName = 'mfpFastClick',
1977
- ns = '.'+eName;
1978
-
1979
-
1980
- // As Zepto.js doesn't have an easy way to add custom events (like jQuery), so we implement it in this way
1981
- $.fn.mfpFastClick = function(callback) {
1982
-
1983
- return $(this).each(function() {
1984
-
1985
- var elem = $(this),
1986
- lock;
1987
-
1988
- if( supportsTouch ) {
1989
-
1990
- var timeout,
1991
- startX,
1992
- startY,
1993
- pointerMoved,
1994
- point,
1995
- numPointers;
1996
-
1997
- elem.on('touchstart' + ns, function(e) {
1998
- pointerMoved = false;
1999
- numPointers = 1;
2000
-
2001
- point = e.originalEvent ? e.originalEvent.touches[0] : e.touches[0];
2002
- startX = point.clientX;
2003
- startY = point.clientY;
2004
-
2005
- _window.on('touchmove'+ns, function(e) {
2006
- point = e.originalEvent ? e.originalEvent.touches : e.touches;
2007
- numPointers = point.length;
2008
- point = point[0];
2009
- if (Math.abs(point.clientX - startX) > 10 ||
2010
- Math.abs(point.clientY - startY) > 10) {
2011
- pointerMoved = true;
2012
- unbindTouchMove();
2013
- }
2014
- }).on('touchend'+ns, function(e) {
2015
- unbindTouchMove();
2016
- if(pointerMoved || numPointers > 1) {
2017
- return;
2018
- }
2019
- lock = true;
2020
- e.preventDefault();
2021
- clearTimeout(timeout);
2022
- timeout = setTimeout(function() {
2023
- lock = false;
2024
- }, ghostClickDelay);
2025
- callback();
2026
- });
2027
- });
2028
-
2029
- }
2030
-
2031
- elem.on('click' + ns, function() {
2032
- if(!lock) {
2033
- callback();
2034
- }
2035
- });
2036
- });
2037
- };
2038
-
2039
- $.fn.destroyMfpFastClick = function() {
2040
- $(this).off('touchstart' + ns + ' click' + ns);
2041
- if(supportsTouch) _window.off('touchmove'+ns+' touchend'+ns);
2042
- };
2043
- })();
2044
-
2045
- /*>>fastclick*/
2046
- _checkInstance(); })(window.jQuery || window.Zepto);