news_reader 0.1.0

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 (81) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +5 -0
  5. data/.vscode/settings.json +3 -0
  6. data/CODE_OF_CONDUCT.md +74 -0
  7. data/Gemfile +6 -0
  8. data/Gemfile.lock +97 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +41 -0
  11. data/Rakefile +6 -0
  12. data/bin/console +14 -0
  13. data/bin/news-reader +6 -0
  14. data/bin/setup +8 -0
  15. data/fixtures/.DS_Store +0 -0
  16. data/fixtures/blog/index.html +200 -0
  17. data/fixtures/blog/index_files/Box.css +29 -0
  18. data/fixtures/blog/index_files/Java_Box.js +89 -0
  19. data/fixtures/blog/index_files/ModuleStyleSheets.css +1655 -0
  20. data/fixtures/blog/index_files/black.css +11 -0
  21. data/fixtures/blog/index_files/blog-jive.jpg +0 -0
  22. data/fixtures/blog/index_files/blog-musolfs.jpg +0 -0
  23. data/fixtures/blog/index_files/blog-poolpak.jpg +0 -0
  24. data/fixtures/blog/index_files/blog-portalaudit.png +0 -0
  25. data/fixtures/blog/index_files/blog-semicolon1.jpg +0 -0
  26. data/fixtures/blog/index_files/blog-semicolon2.jpg +0 -0
  27. data/fixtures/blog/index_files/blog-spa1.jpg +0 -0
  28. data/fixtures/blog/index_files/blog-spa2.jpg +0 -0
  29. data/fixtures/blog/index_files/blog-statera.jpg +0 -0
  30. data/fixtures/blog/index_files/blue.css +11 -0
  31. data/fixtures/blog/index_files/common.js +149 -0
  32. data/fixtures/blog/index_files/dark.css +31 -0
  33. data/fixtures/blog/index_files/featherlight.min.css +8 -0
  34. data/fixtures/blog/index_files/featherlight.min.js +8 -0
  35. data/fixtures/blog/index_files/font-awesome.min.css +4 -0
  36. data/fixtures/blog/index_files/green.css +11 -0
  37. data/fixtures/blog/index_files/isotope.css +64 -0
  38. data/fixtures/blog/index_files/jquery-ui.min.js +5 -0
  39. data/fixtures/blog/index_files/jquery.carouFredSel-6.2.1-packed.js +16 -0
  40. data/fixtures/blog/index_files/jquery.contentcarousel.js +137 -0
  41. data/fixtures/blog/index_files/jquery.easing.1.3.js +205 -0
  42. data/fixtures/blog/index_files/jquery.form.js +1121 -0
  43. data/fixtures/blog/index_files/jquery.hoverdir.js +220 -0
  44. data/fixtures/blog/index_files/jquery.inview.js +60 -0
  45. data/fixtures/blog/index_files/jquery.isotope.min.js +11 -0
  46. data/fixtures/blog/index_files/jquery.magnific-popup.js +2046 -0
  47. data/fixtures/blog/index_files/jquery.mb.YTPlayer.js +1041 -0
  48. data/fixtures/blog/index_files/jquery.min.js +5 -0
  49. data/fixtures/blog/index_files/jquery.nav.js +223 -0
  50. data/fixtures/blog/index_files/jquery.smoothwheel.js +153 -0
  51. data/fixtures/blog/index_files/jquery.sticky.js +129 -0
  52. data/fixtures/blog/index_files/jquery.superslides.js +656 -0
  53. data/fixtures/blog/index_files/jquery.validate.js +1231 -0
  54. data/fixtures/blog/index_files/jquery.vegas.css +34 -0
  55. data/fixtures/blog/index_files/js +201 -0
  56. data/fixtures/blog/index_files/loading.gif +0 -0
  57. data/fixtures/blog/index_files/magnific-popup.css +365 -0
  58. data/fixtures/blog/index_files/main.css +301 -0
  59. data/fixtures/blog/index_files/main.js +26 -0
  60. data/fixtures/blog/index_files/modernizr-2.6.2.min.js +4 -0
  61. data/fixtures/blog/index_files/normalize.css +533 -0
  62. data/fixtures/blog/index_files/ohp3fra.js +44 -0
  63. data/fixtures/blog/index_files/orange.css +11 -0
  64. data/fixtures/blog/index_files/paralax.js +525 -0
  65. data/fixtures/blog/index_files/paralaxNEW4.css +2730 -0
  66. data/fixtures/blog/index_files/plugins.js +221 -0
  67. data/fixtures/blog/index_files/portfolio.js +142 -0
  68. data/fixtures/blog/index_files/purple.css +11 -0
  69. data/fixtures/blog/index_files/red.css +11 -0
  70. data/fixtures/blog/index_files/responsive3.css +329 -0
  71. data/fixtures/blog/index_files/superslides.css +65 -0
  72. data/fixtures/blog/index_files/turquoise.css +11 -0
  73. data/fixtures/blog/index_files/util.js +287 -0
  74. data/fixtures/blog/index_files/yellow.css +11 -0
  75. data/lib/news_reader/article.rb +60 -0
  76. data/lib/news_reader/cli.rb +41 -0
  77. data/lib/news_reader/scraper.rb +17 -0
  78. data/lib/news_reader/version.rb +3 -0
  79. data/lib/news_reader.rb +4 -0
  80. data/news_reader.gemspec +40 -0
  81. metadata +209 -0
@@ -0,0 +1,220 @@
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 );
@@ -0,0 +1,60 @@
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);
@@ -0,0 +1,11 @@
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);