masonry-rails 0.1.8 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +68 -79
- data/README.md +43 -24
- data/VERSION +1 -1
- data/masonry-rails.gemspec +6 -3
- data/vendor/assets/javascripts/debounce.js +27 -0
- data/vendor/assets/javascripts/jquery.debounced_resize.js +47 -0
- data/vendor/assets/javascripts/jquery.isotope.js +15 -9
- data/vendor/assets/javascripts/jquery.isotope.min.js +2 -2
- data/vendor/assets/javascripts/jquery.throttled_resize.js +58 -0
- data/vendor/assets/javascripts/masonry/jquery.event-drag.js +1 -1
- data/vendor/assets/javascripts/masonry/jquery.infinitescroll.min.js +2 -35
- data/vendor/assets/javascripts/masonry/jquery.masonry.js +9 -189
- data/vendor/assets/javascripts/masonry/jquery.masonry.min.js +2 -2
- metadata +7 -4
data/Gemfile.lock
CHANGED
@@ -1,101 +1,90 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
rack
|
15
|
-
rack-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
arel (
|
32
|
-
builder (
|
33
|
-
diff-lcs (1.1
|
34
|
-
erubis (2.
|
4
|
+
abstract (1.0.0)
|
5
|
+
actionmailer (3.0.8)
|
6
|
+
actionpack (= 3.0.8)
|
7
|
+
mail (~> 2.2.19)
|
8
|
+
actionpack (3.0.8)
|
9
|
+
activemodel (= 3.0.8)
|
10
|
+
activesupport (= 3.0.8)
|
11
|
+
builder (~> 2.1.2)
|
12
|
+
erubis (~> 2.6.6)
|
13
|
+
i18n (~> 0.5.0)
|
14
|
+
rack (~> 1.2.1)
|
15
|
+
rack-mount (~> 0.6.14)
|
16
|
+
rack-test (~> 0.5.7)
|
17
|
+
tzinfo (~> 0.3.23)
|
18
|
+
activemodel (3.0.8)
|
19
|
+
activesupport (= 3.0.8)
|
20
|
+
builder (~> 2.1.2)
|
21
|
+
i18n (~> 0.5.0)
|
22
|
+
activerecord (3.0.8)
|
23
|
+
activemodel (= 3.0.8)
|
24
|
+
activesupport (= 3.0.8)
|
25
|
+
arel (~> 2.0.10)
|
26
|
+
tzinfo (~> 0.3.23)
|
27
|
+
activeresource (3.0.8)
|
28
|
+
activemodel (= 3.0.8)
|
29
|
+
activesupport (= 3.0.8)
|
30
|
+
activesupport (3.0.8)
|
31
|
+
arel (2.0.10)
|
32
|
+
builder (2.1.2)
|
33
|
+
diff-lcs (1.2.1)
|
34
|
+
erubis (2.6.6)
|
35
|
+
abstract (>= 1.0.0)
|
35
36
|
git (1.2.5)
|
36
|
-
|
37
|
-
i18n (0.6.0)
|
37
|
+
i18n (0.5.0)
|
38
38
|
jeweler (1.8.4)
|
39
39
|
bundler (~> 1.0)
|
40
40
|
git (>= 1.2.5)
|
41
41
|
rake
|
42
42
|
rdoc
|
43
|
-
|
44
|
-
|
45
|
-
mail (2.4.4)
|
43
|
+
mail (2.2.19)
|
44
|
+
activesupport (>= 2.3.6)
|
46
45
|
i18n (>= 0.4.0)
|
47
46
|
mime-types (~> 1.16)
|
48
47
|
treetop (~> 1.4.8)
|
49
|
-
mime-types (1.
|
50
|
-
multi_json (1.
|
48
|
+
mime-types (1.21)
|
49
|
+
multi_json (1.7.1)
|
51
50
|
polyglot (0.3.3)
|
52
|
-
rack (1.
|
53
|
-
rack-
|
54
|
-
rack (>= 0.
|
55
|
-
rack-
|
56
|
-
rack
|
57
|
-
rack-test (0.6.1)
|
51
|
+
rack (1.2.8)
|
52
|
+
rack-mount (0.6.14)
|
53
|
+
rack (>= 1.0.0)
|
54
|
+
rack-test (0.5.7)
|
58
55
|
rack (>= 1.0)
|
59
|
-
rails (3.
|
60
|
-
actionmailer (= 3.
|
61
|
-
actionpack (= 3.
|
62
|
-
activerecord (= 3.
|
63
|
-
activeresource (= 3.
|
64
|
-
activesupport (= 3.
|
56
|
+
rails (3.0.8)
|
57
|
+
actionmailer (= 3.0.8)
|
58
|
+
actionpack (= 3.0.8)
|
59
|
+
activerecord (= 3.0.8)
|
60
|
+
activeresource (= 3.0.8)
|
61
|
+
activesupport (= 3.0.8)
|
65
62
|
bundler (~> 1.0)
|
66
|
-
railties (= 3.
|
67
|
-
railties (3.
|
68
|
-
actionpack (= 3.
|
69
|
-
activesupport (= 3.
|
70
|
-
rack-ssl (~> 1.3.2)
|
63
|
+
railties (= 3.0.8)
|
64
|
+
railties (3.0.8)
|
65
|
+
actionpack (= 3.0.8)
|
66
|
+
activesupport (= 3.0.8)
|
71
67
|
rake (>= 0.8.7)
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
rspec-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
rspec-
|
83
|
-
|
84
|
-
rspec-mocks (2.11.2)
|
85
|
-
simplecov (0.6.4)
|
68
|
+
thor (~> 0.14.4)
|
69
|
+
rake (10.0.3)
|
70
|
+
rdoc (4.0.0)
|
71
|
+
rspec (2.13.0)
|
72
|
+
rspec-core (~> 2.13.0)
|
73
|
+
rspec-expectations (~> 2.13.0)
|
74
|
+
rspec-mocks (~> 2.13.0)
|
75
|
+
rspec-core (2.13.1)
|
76
|
+
rspec-expectations (2.13.0)
|
77
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
78
|
+
rspec-mocks (2.13.0)
|
79
|
+
simplecov (0.7.1)
|
86
80
|
multi_json (~> 1.0)
|
87
|
-
simplecov-html (~> 0.
|
88
|
-
simplecov-html (0.
|
89
|
-
|
90
|
-
|
91
|
-
rack (~> 1.0)
|
92
|
-
tilt (~> 1.1, != 1.3.0)
|
93
|
-
thor (0.15.4)
|
94
|
-
tilt (1.3.3)
|
95
|
-
treetop (1.4.10)
|
81
|
+
simplecov-html (~> 0.7.1)
|
82
|
+
simplecov-html (0.7.1)
|
83
|
+
thor (0.14.6)
|
84
|
+
treetop (1.4.12)
|
96
85
|
polyglot
|
97
86
|
polyglot (>= 0.3.1)
|
98
|
-
tzinfo (0.3.
|
87
|
+
tzinfo (0.3.37)
|
99
88
|
|
100
89
|
PLATFORMS
|
101
90
|
ruby
|
data/README.md
CHANGED
@@ -6,6 +6,14 @@ Using fork from [masonry](https://github.com/kristianmandrup/masonry)
|
|
6
6
|
|
7
7
|
See more Masonry info at [masonry README](https://github.com/desandro/masonry/README.mdown)
|
8
8
|
|
9
|
+
Versions:
|
10
|
+
Currently uses *jQuery Masonry v2.1.08* and *Isotope 1.5.25*
|
11
|
+
|
12
|
+
* [isotope](https://github.com/desandro/isotope)
|
13
|
+
* [masonry](https://github.com/desandro/masonry)
|
14
|
+
|
15
|
+
Please notify if you have any problems ;)
|
16
|
+
|
9
17
|
This gem includes:
|
10
18
|
|
11
19
|
* jquery masonry
|
@@ -13,28 +21,37 @@ This gem includes:
|
|
13
21
|
* jquery infinitescroll
|
14
22
|
* jquery event drag
|
15
23
|
|
16
|
-
Now [Isotope](http://isotope.metafizzy.co/index.html) is also included. Masonry and Isotope can even be used in combination!
|
17
|
-
|
18
24
|
For random content generation
|
19
25
|
|
20
26
|
* box maker
|
21
27
|
* loremimages
|
22
28
|
|
23
|
-
## Isotope
|
29
|
+
## Isotope
|
30
|
+
|
31
|
+
[Isotope](http://isotope.metafizzy.co/index.html) is also included. Isotope is very similar to Masonry and might be a nice alternative for some use cases. Why it is included ;)
|
32
|
+
|
33
|
+
### Isotope assets
|
24
34
|
|
25
35
|
Javascript
|
26
36
|
|
27
37
|
* jquery.isotope.js
|
28
38
|
* jquery.isotope.min.js
|
29
39
|
|
40
|
+
Extras:
|
41
|
+
|
42
|
+
* jquery.debounced_resize.min.js
|
43
|
+
* jquery.throttled_resize.min.js
|
44
|
+
|
30
45
|
Stylesheets
|
31
46
|
|
32
47
|
* isotope.css
|
33
48
|
|
34
|
-
More stylesheets in `isotope` folder in `vendor/assets
|
49
|
+
More isotope related stylesheets in `isotope` folder in `vendor/assets. Use as inspiration...
|
35
50
|
|
36
51
|
Please see Isotope [License](http://isotope.metafizzy.co/docs/license.html) for commercial use.
|
37
52
|
|
53
|
+
Usage: See [Getting started](http://isotope.metafizzy.co/docs/introduction.html#getting_started)
|
54
|
+
|
38
55
|
## Usage
|
39
56
|
|
40
57
|
In Gemfile
|
@@ -62,24 +79,24 @@ Use these stylesheets as a base in order to play around with different effects..
|
|
62
79
|
### Javascript
|
63
80
|
|
64
81
|
```javascript
|
65
|
-
|
82
|
+
//= require masonry/jquery.masonry
|
66
83
|
```
|
67
84
|
|
68
85
|
Optional
|
69
86
|
|
70
87
|
```javascript
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
88
|
+
//= require masonry/jquery.event-drag
|
89
|
+
//= require masonry/jquery.imagesloaded.min
|
90
|
+
//= require masonry/jquery.infinitescroll.min
|
91
|
+
//= require masonry/modernizr-transitions
|
75
92
|
```
|
76
93
|
|
77
94
|
Content generation helpers:
|
78
95
|
|
79
96
|
```javascript
|
80
|
-
|
81
|
-
|
82
|
-
|
97
|
+
//= require masonry/box-maker
|
98
|
+
//= require masonry/jquery.loremimages.min
|
99
|
+
```
|
83
100
|
|
84
101
|
See examples on [masonry](http://masonry.desandro.com/docs/intro.html) or [github](https://github.com/desandro/masonry)
|
85
102
|
|
@@ -90,7 +107,7 @@ We will use the _infinite scroll_ example for a full walkthrough of how to setup
|
|
90
107
|
*Main container*
|
91
108
|
|
92
109
|
```html
|
93
|
-
<div id="container" class="transitions-enabled infinite-scroll clearfix">
|
110
|
+
<div id="masonry-container" class="transitions-enabled infinite-scroll clearfix">
|
94
111
|
|
95
112
|
<div class="box col3">
|
96
113
|
|
@@ -107,8 +124,10 @@ We will use the _infinite scroll_ example for a full walkthrough of how to setup
|
|
107
124
|
</div>
|
108
125
|
```
|
109
126
|
|
127
|
+
Note: We use the ID `masonry-container` in order to ensure against conflicts with other "plugins". Twitter Bootstrap, f.ex reserves the class names `container` and `container-fluid` for particular (container) layouts.
|
128
|
+
|
110
129
|
```css
|
111
|
-
#container {
|
130
|
+
#masonry-container {
|
112
131
|
background: #FFF;
|
113
132
|
padding: 5px;
|
114
133
|
margin-bottom: 20px;
|
@@ -149,7 +168,7 @@ Example:
|
|
149
168
|
```javascript
|
150
169
|
$(function(){
|
151
170
|
|
152
|
-
$('#container').masonry({
|
171
|
+
$('#masonry-container').masonry({
|
153
172
|
itemSelector: '.box',
|
154
173
|
columnWidth: 100,
|
155
174
|
gutterWidth: 40
|
@@ -169,7 +188,7 @@ See `masonry/right-to-left.css`
|
|
169
188
|
```javascript
|
170
189
|
$(function(){
|
171
190
|
|
172
|
-
$('#container').masonry({
|
191
|
+
$('#masonry-container').masonry({
|
173
192
|
itemSelector: '.box',
|
174
193
|
columnWidth: 100,
|
175
194
|
isAnimated: !Modernizr.csstransitions,
|
@@ -199,7 +218,7 @@ See `masonry/centered.css`
|
|
199
218
|
|
200
219
|
```javascript
|
201
220
|
$(function(){
|
202
|
-
$('#container').masonry({
|
221
|
+
$('#masonry-container').masonry({
|
203
222
|
itemSelector: '.box',
|
204
223
|
columnWidth: 200,
|
205
224
|
isAnimated: !Modernizr.csstransitions,
|
@@ -214,7 +233,7 @@ $(function(){
|
|
214
233
|
For fluid or responsive layouts, where the width of the column is a percentage of the container's width, you can pass in a function for `columnWidth`.
|
215
234
|
|
216
235
|
```javascript
|
217
|
-
$('#container').masonry({
|
236
|
+
$('#masonry-container').masonry({
|
218
237
|
itemSelector: '.box',
|
219
238
|
// set columnWidth a fraction of the container width
|
220
239
|
columnWidth: function( containerWidth ) {
|
@@ -283,7 +302,7 @@ In your CSS, add transition styles below. The Masonry plugin will add a class of
|
|
283
302
|
To get the best of both worlds, you can use *Modernizr* to detect browser support for CSS transitions. Add the transitions styles above, then enable animated based on Modernizr’s detected support for transitions. This will allow browsers that support *CSS transitions* to use them, and browsers without support to use *jQuery animation*.
|
284
303
|
|
285
304
|
```javascript
|
286
|
-
$('#container').masonry({
|
305
|
+
$('#masonry-container').masonry({
|
287
306
|
// options...
|
288
307
|
isAnimated: !Modernizr.csstransitions
|
289
308
|
});
|
@@ -298,7 +317,7 @@ Or simply include `masonry/modernizr-transitions` in your javascript manifest.
|
|
298
317
|
Use with [infinite-scroll](https://github.com/paulirish/infinite-scroll) which is included for convenience. All credits & license rights (MIT) to Paul Irish.
|
299
318
|
|
300
319
|
```javascript
|
301
|
-
|
320
|
+
//= require masonry/jquery.infinitescroll.min
|
302
321
|
```
|
303
322
|
|
304
323
|
See [infinite-scroll-jquery-plugin](http://www.infinite-scroll.com/infinite-scroll-jquery-plugin/) for configuration info.
|
@@ -336,7 +355,7 @@ These will be appended at the bottom of the `#container`. If you are using searc
|
|
336
355
|
```javascript
|
337
356
|
$(function(){
|
338
357
|
|
339
|
-
var $container = $('#container');
|
358
|
+
var $container = $('#masonry-container');
|
340
359
|
|
341
360
|
$container.imagesLoaded(function(){
|
342
361
|
$container.masonry({
|
@@ -430,7 +449,7 @@ For more see [sausage info](http://christophercliff.github.com/sausage)
|
|
430
449
|
The div with a class of 'page' is important for sausage. It is used to determine the different pages for the navigation on the right.
|
431
450
|
|
432
451
|
```html
|
433
|
-
<div id="container" class="transitions-enabled infinite-scroll clearfix">
|
452
|
+
<div id="masonry-container" class="transitions-enabled infinite-scroll clearfix">
|
434
453
|
<div class='page'>
|
435
454
|
<%= render @articles %>
|
436
455
|
</div>
|
@@ -488,7 +507,7 @@ It checks if the user scrolled to the bottom of the page. If that is the case, a
|
|
488
507
|
When the ajax-request is sent to the ArticlesController we need to append the next page of articles. We need to create a file named `index.js.erb` to achieve this goal.
|
489
508
|
|
490
509
|
```javascript
|
491
|
-
$("#container").append("<div class='page'><%= escape_javascript(render(@articles)) %></div>");
|
510
|
+
$("#masonry-container").append("<div class='page'><%= escape_javascript(render(@articles)) %></div>");
|
492
511
|
```
|
493
512
|
|
494
513
|
Note: You need to configure Jquery UI to use sausage.
|
@@ -512,7 +531,7 @@ See [repo](http://desandro.github.com/imagesloaded/)
|
|
512
531
|
A jQuery plugin that triggers a callback after all the selected/child images have been loaded. Because you can't do `.load()` on cached images.
|
513
532
|
|
514
533
|
```javascript
|
515
|
-
|
534
|
+
//= require masonry/jquery.imagesloaded.min
|
516
535
|
```
|
517
536
|
|
518
537
|
Also included is the [loremimages plugin](http://darsa.in/loremImages/), useful for testing purposes ;)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/masonry-rails.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "masonry-rails"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kristian Mandrup"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2013-03-21"
|
13
13
|
s.description = "Masonry will rock your world!"
|
14
14
|
s.email = "kmandrup@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -64,8 +64,11 @@ Gem::Specification.new do |s|
|
|
64
64
|
"spec/index.html",
|
65
65
|
"spec/spec_helper.rb",
|
66
66
|
"vendor/assets/images/masonry/loader.gif",
|
67
|
+
"vendor/assets/javascripts/debounce.js",
|
68
|
+
"vendor/assets/javascripts/jquery.debounced_resize.js",
|
67
69
|
"vendor/assets/javascripts/jquery.isotope.js",
|
68
70
|
"vendor/assets/javascripts/jquery.isotope.min.js",
|
71
|
+
"vendor/assets/javascripts/jquery.throttled_resize.js",
|
69
72
|
"vendor/assets/javascripts/masonry/box-maker.js",
|
70
73
|
"vendor/assets/javascripts/masonry/jquery.event-drag.js",
|
71
74
|
"vendor/assets/javascripts/masonry/jquery.imagesloaded.js",
|
@@ -97,7 +100,7 @@ Gem::Specification.new do |s|
|
|
97
100
|
s.homepage = "http://github.com/kristianmandrup/masonry-rails"
|
98
101
|
s.licenses = ["MIT"]
|
99
102
|
s.require_paths = ["lib"]
|
100
|
-
s.rubygems_version = "1.8.
|
103
|
+
s.rubygems_version = "1.8.25"
|
101
104
|
s.summary = "Use JQuery Masonry with Rails asset pipeline"
|
102
105
|
|
103
106
|
if s.respond_to? :specification_version then
|
@@ -0,0 +1,27 @@
|
|
1
|
+
(function($,sr){
|
2
|
+
|
3
|
+
// debouncing function from John Hann
|
4
|
+
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
|
5
|
+
var debounce = function (func, threshold, execAsap) {
|
6
|
+
var timeout;
|
7
|
+
|
8
|
+
return function debounced () {
|
9
|
+
var obj = this, args = arguments;
|
10
|
+
function delayed () {
|
11
|
+
if (!execAsap)
|
12
|
+
func.apply(obj, args);
|
13
|
+
timeout = null;
|
14
|
+
};
|
15
|
+
|
16
|
+
if (timeout)
|
17
|
+
clearTimeout(timeout);
|
18
|
+
else if (execAsap)
|
19
|
+
func.apply(obj, args);
|
20
|
+
|
21
|
+
timeout = setTimeout(delayed, threshold || 100);
|
22
|
+
};
|
23
|
+
}
|
24
|
+
// smartresize
|
25
|
+
jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); };
|
26
|
+
|
27
|
+
})(jQuery,'smartresize');
|
@@ -0,0 +1,47 @@
|
|
1
|
+
/*
|
2
|
+
* debouncedresize: special jQuery event that happens once after a window resize
|
3
|
+
*
|
4
|
+
* latest version and complete README available on Github:
|
5
|
+
* https://github.com/louisremi/jquery-smartresize
|
6
|
+
*
|
7
|
+
* Copyright 2012 @louis_remi
|
8
|
+
* Licensed under the MIT license.
|
9
|
+
*
|
10
|
+
* This saved you an hour of work?
|
11
|
+
* Send me music http://www.amazon.co.uk/wishlist/HNTU0468LQON
|
12
|
+
*/
|
13
|
+
(function($) {
|
14
|
+
|
15
|
+
var $event = $.event,
|
16
|
+
$special,
|
17
|
+
resizeTimeout;
|
18
|
+
|
19
|
+
$special = $event.special.debouncedresize = {
|
20
|
+
setup: function() {
|
21
|
+
$( this ).on( "resize", $special.handler );
|
22
|
+
},
|
23
|
+
teardown: function() {
|
24
|
+
$( this ).off( "resize", $special.handler );
|
25
|
+
},
|
26
|
+
handler: function( event, execAsap ) {
|
27
|
+
// Save the context
|
28
|
+
var context = this,
|
29
|
+
args = arguments,
|
30
|
+
dispatch = function() {
|
31
|
+
// set correct event type
|
32
|
+
event.type = "debouncedresize";
|
33
|
+
$event.dispatch.apply( context, args );
|
34
|
+
};
|
35
|
+
|
36
|
+
if ( resizeTimeout ) {
|
37
|
+
clearTimeout( resizeTimeout );
|
38
|
+
}
|
39
|
+
|
40
|
+
execAsap ?
|
41
|
+
dispatch() :
|
42
|
+
resizeTimeout = setTimeout( dispatch, $special.threshold );
|
43
|
+
},
|
44
|
+
threshold: 150
|
45
|
+
};
|
46
|
+
|
47
|
+
})(jQuery);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* Isotope v1.5.
|
2
|
+
* Isotope v1.5.25
|
3
3
|
* An exquisite jQuery plugin for magical layouts
|
4
4
|
* http://isotope.metafizzy.co
|
5
5
|
*
|
@@ -260,8 +260,8 @@
|
|
260
260
|
transitionEndEvent = {
|
261
261
|
WebkitTransitionProperty: 'webkitTransitionEnd', // webkit
|
262
262
|
MozTransitionProperty: 'transitionend',
|
263
|
-
OTransitionProperty: 'oTransitionEnd',
|
264
|
-
transitionProperty: '
|
263
|
+
OTransitionProperty: 'oTransitionEnd otransitionend',
|
264
|
+
transitionProperty: 'transitionend'
|
265
265
|
}[ transitionProp ];
|
266
266
|
|
267
267
|
transitionDurProp = getStyleProperty('transitionDuration');
|
@@ -280,6 +280,7 @@
|
|
280
280
|
*/
|
281
281
|
|
282
282
|
var $event = $.event,
|
283
|
+
dispatchMethod = $.event.handle ? 'handle' : 'dispatch',
|
283
284
|
resizeTimeout;
|
284
285
|
|
285
286
|
$event.special.smartresize = {
|
@@ -299,7 +300,7 @@
|
|
299
300
|
|
300
301
|
if ( resizeTimeout ) { clearTimeout( resizeTimeout ); }
|
301
302
|
resizeTimeout = setTimeout(function() {
|
302
|
-
|
303
|
+
$event[ dispatchMethod ].apply( context, args );
|
303
304
|
}, execAsap === "execAsap"? 0 : 100 );
|
304
305
|
}
|
305
306
|
};
|
@@ -346,7 +347,7 @@
|
|
346
347
|
sortBy : 'original-order',
|
347
348
|
sortAscending : true,
|
348
349
|
resizesContainer : true,
|
349
|
-
transformsEnabled:
|
350
|
+
transformsEnabled: true,
|
350
351
|
itemPositionDataEnabled: false
|
351
352
|
};
|
352
353
|
|
@@ -427,6 +428,11 @@
|
|
427
428
|
// base style for atoms
|
428
429
|
atomStyle = { position: 'absolute' };
|
429
430
|
|
431
|
+
// filter out text nodes
|
432
|
+
$atoms = $atoms.filter( function( i, atom ) {
|
433
|
+
return atom.nodeType === 1;
|
434
|
+
});
|
435
|
+
|
430
436
|
if ( this.usingTransforms ) {
|
431
437
|
atomStyle.left = 0;
|
432
438
|
atomStyle.top = 0;
|
@@ -804,11 +810,12 @@
|
|
804
810
|
|
805
811
|
// removes elements from Isotope widget
|
806
812
|
remove: function( $content, callback ) {
|
807
|
-
// remove elements from Isotope instance
|
808
|
-
|
813
|
+
// remove elements immediately from Isotope instance
|
814
|
+
this.$allAtoms = this.$allAtoms.not( $content );
|
815
|
+
this.$filteredAtoms = this.$filteredAtoms.not( $content );
|
809
816
|
// remove() as a callback, for after transition / animation
|
817
|
+
var instance = this;
|
810
818
|
var removeContent = function() {
|
811
|
-
instance.$allAtoms = instance.$allAtoms.not( $content );
|
812
819
|
$content.remove();
|
813
820
|
if ( callback ) {
|
814
821
|
callback.call( instance.element );
|
@@ -818,7 +825,6 @@
|
|
818
825
|
if ( $content.filter( ':not(.' + this.options.hiddenClass + ')' ).length ) {
|
819
826
|
// if any non-hidden content needs to be removed
|
820
827
|
this.styleQueue.push({ $el: $content, style: this.options.hiddenStyle });
|
821
|
-
this.$filteredAtoms = this.$filteredAtoms.not( $content );
|
822
828
|
this._sort();
|
823
829
|
this.reLayout( removeContent );
|
824
830
|
} else {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* Isotope v1.5.
|
2
|
+
* Isotope v1.5.25
|
3
3
|
* An exquisite jQuery plugin for magical layouts
|
4
4
|
* http://isotope.metafizzy.co
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
*
|
9
9
|
* Copyright 2012 David DeSandro / Metafizzy
|
10
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",transitionProperty:"transitionEnd"}[j],r=h("transitionDuration"));var s=b.event,t;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",t&&clearTimeout(t),t=setTimeout(function(){jQuery.event.handle.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 u=["width","height"],v=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:!b.browser.opera,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=u.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&&v.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 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){var c=this,d=function(){c.$allAtoms=c.$allAtoms.not(a),a.remove(),b&&b.call(c.element)};a.filter(":not(."+this.options.hiddenClass+")").length?(this.styleQueue.push({$el:a,style:this.options.hiddenStyle}),this.$filteredAtoms=this.$filteredAtoms.not(a),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"),v.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 w=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){w("cannot call methods on isotope prior to initialization; attempted to call method '"+a+"'");return}if(!b.isFunction(c[a])||a.charAt(0)==="_"){w("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);
|
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);
|
@@ -0,0 +1,58 @@
|
|
1
|
+
/*
|
2
|
+
* throttledresize: special jQuery event that happens at a reduced rate compared to "resize"
|
3
|
+
*
|
4
|
+
* latest version and complete README available on Github:
|
5
|
+
* https://github.com/louisremi/jquery-smartresize
|
6
|
+
*
|
7
|
+
* Copyright 2012 @louis_remi
|
8
|
+
* Licensed under the MIT license.
|
9
|
+
*
|
10
|
+
* This saved you an hour of work?
|
11
|
+
* Send me music http://www.amazon.co.uk/wishlist/HNTU0468LQON
|
12
|
+
*/
|
13
|
+
(function($) {
|
14
|
+
|
15
|
+
var $event = $.event,
|
16
|
+
$special,
|
17
|
+
dummy = {_:0},
|
18
|
+
frame = 0,
|
19
|
+
wasResized, animRunning;
|
20
|
+
|
21
|
+
$special = $event.special.throttledresize = {
|
22
|
+
setup: function() {
|
23
|
+
$( this ).on( "resize", $special.handler );
|
24
|
+
},
|
25
|
+
teardown: function() {
|
26
|
+
$( this ).off( "resize", $special.handler );
|
27
|
+
},
|
28
|
+
handler: function( event, execAsap ) {
|
29
|
+
// Save the context
|
30
|
+
var context = this,
|
31
|
+
args = arguments;
|
32
|
+
|
33
|
+
wasResized = true;
|
34
|
+
|
35
|
+
if ( !animRunning ) {
|
36
|
+
setInterval(function(){
|
37
|
+
frame++;
|
38
|
+
|
39
|
+
if ( frame > $special.threshold && wasResized || execAsap ) {
|
40
|
+
// set correct event type
|
41
|
+
event.type = "throttledresize";
|
42
|
+
$event.dispatch.apply( context, args );
|
43
|
+
wasResized = false;
|
44
|
+
frame = 0;
|
45
|
+
}
|
46
|
+
if ( frame > 9 ) {
|
47
|
+
$(dummy).stop();
|
48
|
+
animRunning = false;
|
49
|
+
frame = 0;
|
50
|
+
}
|
51
|
+
}, 30);
|
52
|
+
animRunning = true;
|
53
|
+
}
|
54
|
+
},
|
55
|
+
threshold: 0
|
56
|
+
};
|
57
|
+
|
58
|
+
})(jQuery);
|
@@ -178,7 +178,7 @@ drag = $special.drag = {
|
|
178
178
|
case !dd.dragging && 'touchmove':
|
179
179
|
event.preventDefault();
|
180
180
|
case !dd.dragging && 'mousemove':
|
181
|
-
// drag tolerance, x
|
181
|
+
// drag tolerance, x^2 + y^2 = distance^2
|
182
182
|
if ( Math.pow( event.pageX-dd.pageX, 2 ) + Math.pow( event.pageY-dd.pageY, 2 ) < Math.pow( dd.distance, 2 ) )
|
183
183
|
break; // distance tolerance not reached
|
184
184
|
event.target = dd.target; // force target from "mousedown" event (fix distance issue)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Infinite Scroll
|
4
4
|
--------------------------------
|
5
5
|
+ https://github.com/paulirish/infinitescroll
|
6
|
-
+ version 2.0b2.
|
6
|
+
+ version 2.0b2.120519
|
7
7
|
+ Copyright 2011 Paul Irish & Luke Shumard
|
8
8
|
+ Licensed under the MIT license
|
9
9
|
|
@@ -11,37 +11,4 @@
|
|
11
11
|
|
12
12
|
*/
|
13
13
|
|
14
|
-
(function(window,$,undefined){$.infinitescroll=function infscr(options,callback,element){this.element=$(element);this._create(options,callback);};$.infinitescroll.defaults={loading:{finished:undefined,finishedMsg:"<em>Congratulations, you've reached the end of the internet.</em>",img:"http://www.infinite-scroll.com/loading.gif",msg:null,msgText:"<em>Loading the next set of posts...</em>",selector:null,speed:'fast',start:undefined},state:{isDuringAjax:false,isInvalidPage:false,isDestroyed:false,isDone:false,isPaused:false,currPage:1},callback:undefined,debug:false,behavior:undefined,binder:$(window),nextSelector:"div.navigation a:first",navSelector:"div.navigation",contentSelector:null,extraScrollPx:150,itemSelector:"div.post",animate:false,pathParse:undefined,dataType:'html',appendCallback:true,bufferPx:40,errorCallback:function(){},infid:0,pixelsFromNavToBottom:undefined,path:undefined};$.infinitescroll.prototype={_binding:function infscr_binding(binding){var instance=this,opts=instance.options;if(!!opts.behavior&&this['_binding_'+opts.behavior]!==undefined){this['_binding_'+opts.behavior].call(this);return;}
|
15
|
-
if(binding!=='bind'&&binding!=='unbind'){this._debug('Binding value '+binding+' not valid')
|
16
|
-
return false;}
|
17
|
-
if(binding=='unbind'){(this.options.binder).unbind('smartscroll.infscr.'+instance.options.infid);}else{(this.options.binder)[binding]('smartscroll.infscr.'+instance.options.infid,function(){instance.scroll();});};this._debug('Binding',binding);},_create:function infscr_create(options,callback){if(!this._validate(options)){return false;}
|
18
|
-
var opts=this.options=$.extend(true,{},$.infinitescroll.defaults,options),relurl=/(.*?\/\/).*?(\/.*)/,path=$(opts.nextSelector).attr('href');opts.contentSelector=opts.contentSelector||this.element;opts.loading.selector=opts.loading.selector||opts.contentSelector;if(!path){this._debug('Navigation selector not found');return;}
|
19
|
-
opts.path=this._determinepath(path);opts.loading.msg=$('<div id="infscr-loading"><img alt="Loading..." src="'+opts.loading.img+'" /><div>'+opts.loading.msgText+'</div></div>');(new Image()).src=opts.loading.img;opts.pixelsFromNavToBottom=$(document).height()-$(opts.navSelector).offset().top;opts.loading.start=opts.loading.start||function(){$(opts.navSelector).hide();opts.loading.msg.appendTo(opts.loading.selector).show(opts.loading.speed,function(){beginAjax(opts);});};opts.loading.finished=opts.loading.finished||function(){opts.loading.msg.fadeOut('normal');};opts.callback=function(instance,data){if(!!opts.behavior&&instance['_callback_'+opts.behavior]!==undefined){instance['_callback_'+opts.behavior].call($(opts.contentSelector)[0],data);}
|
20
|
-
if(callback){callback.call($(opts.contentSelector)[0],data);}};this._setup();},_debug:function infscr_debug(){if(this.options.debug){return window.console&&console.log.call(console,arguments);}},_determinepath:function infscr_determinepath(path){var opts=this.options;if(!!opts.behavior&&this['_determinepath_'+opts.behavior]!==undefined){this['_determinepath_'+opts.behavior].call(this,path);return;}
|
21
|
-
if(!!opts.pathParse){this._debug('pathParse manual');return opts.pathParse;}else if(path.match(/^(.*?)\b2\b(.*?$)/)){path=path.match(/^(.*?)\b2\b(.*?$)/).slice(1);}else if(path.match(/^(.*?)2(.*?$)/)){if(path.match(/^(.*?page=)2(\/.*|$)/)){path=path.match(/^(.*?page=)2(\/.*|$)/).slice(1);return path;}
|
22
|
-
path=path.match(/^(.*?)2(.*?$)/).slice(1);}else{if(path.match(/^(.*?page=)1(\/.*|$)/)){path=path.match(/^(.*?page=)1(\/.*|$)/).slice(1);return path;}else{this._debug('Sorry, we couldn\'t parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com.');opts.state.isInvalidPage=true;}}
|
23
|
-
this._debug('determinePath',path);return path;},_error:function infscr_error(xhr){var opts=this.options;if(!!opts.behavior&&this['_error_'+opts.behavior]!==undefined){this['_error_'+opts.behavior].call(this,xhr);return;}
|
24
|
-
if(xhr!=='destroy'&&xhr!=='end'){xhr='unknown';}
|
25
|
-
this._debug('Error',xhr);if(xhr=='end'){this._showdonemsg();}
|
26
|
-
opts.state.isDone=true;opts.state.currPage=1;opts.state.isPaused=false;this._binding('unbind');},_loadcallback:function infscr_loadcallback(box,data){var opts=this.options,callback=this.options.callback,result=(opts.state.isDone)?'done':(!opts.appendCallback)?'no-append':'append',frag;if(!!opts.behavior&&this['_loadcallback_'+opts.behavior]!==undefined){this['_loadcallback_'+opts.behavior].call(this,box,data);return;}
|
27
|
-
switch(result){case'done':this._showdonemsg();return false;break;case'no-append':if(opts.dataType=='html'){data='<div>'+data+'</div>';data=$(data).find(opts.itemSelector);};break;case'append':var children=box.children();if(children.length==0){return this._error('end');}
|
28
|
-
frag=document.createDocumentFragment();while(box[0].firstChild){frag.appendChild(box[0].firstChild);}
|
29
|
-
this._debug('contentSelector',$(opts.contentSelector)[0])
|
30
|
-
$(opts.contentSelector)[0].appendChild(frag);data=children.get();break;}
|
31
|
-
opts.loading.finished.call($(opts.contentSelector)[0],opts)
|
32
|
-
if(opts.animate){var scrollTo=$(window).scrollTop()+$('#infscr-loading').height()+opts.extraScrollPx+'px';$('html,body').animate({scrollTop:scrollTo},800,function(){opts.state.isDuringAjax=false;});}
|
33
|
-
if(!opts.animate)opts.state.isDuringAjax=false;callback(this,data);},_nearbottom:function infscr_nearbottom(){var opts=this.options,pixelsFromWindowBottomToBottom=0+$(document).height()-(opts.binder.scrollTop())-$(window).height();if(!!opts.behavior&&this['_nearbottom_'+opts.behavior]!==undefined){this['_nearbottom_'+opts.behavior].call(this);return;}
|
34
|
-
this._debug('math:',pixelsFromWindowBottomToBottom,opts.pixelsFromNavToBottom);return(pixelsFromWindowBottomToBottom-opts.bufferPx<opts.pixelsFromNavToBottom);},_pausing:function infscr_pausing(pause){var opts=this.options;if(!!opts.behavior&&this['_pausing_'+opts.behavior]!==undefined){this['_pausing_'+opts.behavior].call(this,pause);return;}
|
35
|
-
if(pause!=='pause'&&pause!=='resume'&&pause!==null){this._debug('Invalid argument. Toggling pause value instead');};pause=(pause&&(pause=='pause'||pause=='resume'))?pause:'toggle';switch(pause){case'pause':opts.state.isPaused=true;break;case'resume':opts.state.isPaused=false;break;case'toggle':opts.state.isPaused=!opts.state.isPaused;break;}
|
36
|
-
this._debug('Paused',opts.state.isPaused);return false;},_setup:function infscr_setup(){var opts=this.options;if(!!opts.behavior&&this['_setup_'+opts.behavior]!==undefined){this['_setup_'+opts.behavior].call(this);return;}
|
37
|
-
this._binding('bind');return false;},_showdonemsg:function infscr_showdonemsg(){var opts=this.options;if(!!opts.behavior&&this['_showdonemsg_'+opts.behavior]!==undefined){this['_showdonemsg_'+opts.behavior].call(this);return;}
|
38
|
-
opts.loading.msg.find('img').hide().parent().find('div').html(opts.loading.finishedMsg).animate({opacity:1},2000,function(){$(this).parent().fadeOut('normal');});opts.errorCallback.call($(opts.contentSelector)[0],'done');},_validate:function infscr_validate(opts){for(var key in opts){if(key.indexOf&&key.indexOf('Selector')>-1&&$(opts[key]).length===0){this._debug('Your '+key+' found no elements.');return false;}
|
39
|
-
return true;}},bind:function infscr_bind(){this._binding('bind');},destroy:function infscr_destroy(){this.options.state.isDestroyed=true;return this._error('destroy');},pause:function infscr_pause(){this._pausing('pause');},resume:function infscr_resume(){this._pausing('resume');},retrieve:function infscr_retrieve(pageNum){var instance=this,opts=instance.options,path=opts.path,box,frag,desturl,method,condition,pageNum=pageNum||null,getPage=(!!pageNum)?pageNum:opts.state.currPage;beginAjax=function infscr_ajax(opts){opts.state.currPage++;instance._debug('heading into ajax',path);box=$(opts.contentSelector).is('table')?$('<tbody/>'):$('<div/>');desturl=path.join(opts.state.currPage);method=(opts.dataType=='html'||opts.dataType=='json')?opts.dataType:'html+callback';if(opts.appendCallback&&opts.dataType=='html')method+='+callback'
|
40
|
-
switch(method){case'html+callback':instance._debug('Using HTML via .load() method');box.load(desturl+' '+opts.itemSelector,null,function infscr_ajax_callback(responseText){instance._loadcallback(box,responseText);});break;case'html':case'json':instance._debug('Using '+(method.toUpperCase())+' via $.ajax() method');$.ajax({url:desturl,dataType:opts.dataType,complete:function infscr_ajax_callback(jqXHR,textStatus){condition=(typeof(jqXHR.isResolved)!=='undefined')?(jqXHR.isResolved()):(textStatus==="success"||textStatus==="notmodified");(condition)?instance._loadcallback(box,jqXHR.responseText):instance._error('end');}});break;}};if(!!opts.behavior&&this['retrieve_'+opts.behavior]!==undefined){this['retrieve_'+opts.behavior].call(this,pageNum);return;}
|
41
|
-
if(opts.state.isDestroyed){this._debug('Instance is destroyed');return false;};opts.state.isDuringAjax=true;opts.loading.start.call($(opts.contentSelector)[0],opts);},scroll:function infscr_scroll(){var opts=this.options,state=opts.state;if(!!opts.behavior&&this['scroll_'+opts.behavior]!==undefined){this['scroll_'+opts.behavior].call(this);return;}
|
42
|
-
if(state.isDuringAjax||state.isInvalidPage||state.isDone||state.isDestroyed||state.isPaused)return;if(!this._nearbottom())return;this.retrieve();},toggle:function infscr_toggle(){this._pausing();},unbind:function infscr_unbind(){this._binding('unbind');},update:function infscr_options(key){if($.isPlainObject(key)){this.options=$.extend(true,this.options,key);}}}
|
43
|
-
$.fn.infinitescroll=function infscr_init(options,callback){var thisCall=typeof options;switch(thisCall){case'string':var args=Array.prototype.slice.call(arguments,1);this.each(function(){var instance=$.data(this,'infinitescroll');if(!instance){return false;}
|
44
|
-
if(!$.isFunction(instance[options])||options.charAt(0)==="_"){return false;}
|
45
|
-
instance[options].apply(instance,args);});break;case'object':this.each(function(){var instance=$.data(this,'infinitescroll');if(instance){instance.update(options);}else{$.data(this,'infinitescroll',new $.infinitescroll(options,callback,this));}});break;}
|
46
|
-
return this;};var event=$.event,scrollTimeout;event.special.smartscroll={setup:function(){$(this).bind("scroll",event.special.smartscroll.handler);},teardown:function(){$(this).unbind("scroll",event.special.smartscroll.handler);},handler:function(event,execAsap){var context=this,args=arguments;event.type="smartscroll";if(scrollTimeout){clearTimeout(scrollTimeout);}
|
47
|
-
scrollTimeout=setTimeout(function(){$.event.handle.apply(context,args);},execAsap==="execAsap"?0:100);}};$.fn.smartscroll=function(fn){return fn?this.bind("smartscroll",fn):this.trigger("smartscroll",["execAsap"]);};})(window,jQuery);
|
14
|
+
(function(o,i,k){i.infinitescroll=function z(D,F,E){this.element=i(E);if(!this._create(D,F)){this.failed=true}};i.infinitescroll.defaults={loading:{finished:k,finishedMsg:"<em>Congratulations, you've reached the end of the internet.</em>",img:"data:image/gif;base64,R0lGODlh3AATAPQeAPDy+MnQ6LW/4N3h8MzT6rjC4sTM5r/I5NHX7N7j8c7U6tvg8OLl8uXo9Ojr9b3G5MfP6Ovu9tPZ7PT1+vX2+tbb7vf4+8/W69jd7rC73vn5/O/x+K243ai02////wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQECgD/ACwAAAAA3AATAAAF/6AnjmRpnmiqrmzrvnAsz3Rt33iu73zv/8CgcEj0BAScpHLJbDqf0Kh0Sq1ar9isdioItAKGw+MAKYMFhbF63CW438f0mg1R2O8EuXj/aOPtaHx7fn96goR4hmuId4qDdX95c4+RBIGCB4yAjpmQhZN0YGYGXitdZBIVGAsLoq4BBKQDswm1CQRkcG6ytrYKubq8vbfAcMK9v7q7EMO1ycrHvsW6zcTKsczNz8HZw9vG3cjTsMIYqQkCLBwHCgsMDQ4RDAYIqfYSFxDxEfz88/X38Onr16+Bp4ADCco7eC8hQYMAEe57yNCew4IVBU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G5HU/3sRlnTG2ytyadytnD3HrmuRcSn+0h1dycexIK1KCjYaCnjCCVqOFFJTZ5GkUUjESWaUIKU2lgCmAKKQIUjHapXRKE+t2og1VgankNYnohqKJ2CmKplso6GKz7WYCgqxeuyoF8u9IQAgA7",msg:null,msgText:"<em>Loading the next set of posts...</em>",selector:null,speed:"fast",start:k},state:{isDuringAjax:false,isInvalidPage:false,isDestroyed:false,isDone:false,isPaused:false,currPage:1},debug:false,behavior:k,binder:i(o),nextSelector:"div.navigation a:first",navSelector:"div.navigation",contentSelector:null,extraScrollPx:150,itemSelector:"div.post",animate:false,pathParse:k,dataType:"html",appendCallback:true,bufferPx:40,errorCallback:function(){},infid:0,pixelsFromNavToBottom:k,path:k,prefill:false};i.infinitescroll.prototype={_binding:function g(F){var D=this,E=D.options;E.v="2.0b2.120520";if(!!E.behavior&&this["_binding_"+E.behavior]!==k){this["_binding_"+E.behavior].call(this);return}if(F!=="bind"&&F!=="unbind"){this._debug("Binding value "+F+" not valid");return false}if(F==="unbind"){(this.options.binder).unbind("smartscroll.infscr."+D.options.infid)}else{(this.options.binder)[F]("smartscroll.infscr."+D.options.infid,function(){D.scroll()})}this._debug("Binding",F)},_create:function t(F,J){var G=i.extend(true,{},i.infinitescroll.defaults,F);this.options=G;var I=i(o);var D=this;if(!D._validate(F)){return false}var H=i(G.nextSelector).attr("href");if(!H){this._debug("Navigation selector not found");return false}G.path=G.path||this._determinepath(H);G.contentSelector=G.contentSelector||this.element;G.loading.selector=G.loading.selector||G.contentSelector;G.loading.msg=G.loading.msg||i('<div id="infscr-loading"><img alt="Loading..." src="'+G.loading.img+'" /><div>'+G.loading.msgText+"</div></div>");(new Image()).src=G.loading.img;if(G.pixelsFromNavToBottom===k){G.pixelsFromNavToBottom=i(document).height()-i(G.navSelector).offset().top}var E=this;G.loading.start=G.loading.start||function(){i(G.navSelector).hide();G.loading.msg.appendTo(G.loading.selector).show(G.loading.speed,i.proxy(function(){this.beginAjax(G)},E))};G.loading.finished=G.loading.finished||function(){G.loading.msg.fadeOut(G.loading.speed)};G.callback=function(K,M,L){if(!!G.behavior&&K["_callback_"+G.behavior]!==k){K["_callback_"+G.behavior].call(i(G.contentSelector)[0],M,L)}if(J){J.call(i(G.contentSelector)[0],M,G,L)}if(G.prefill){I.bind("resize.infinite-scroll",K._prefill)}};if(F.debug){if(Function.prototype.bind&&(typeof console==="object"||typeof console==="function")&&typeof console.log==="object"){["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(K){console[K]=this.call(console[K],console)},Function.prototype.bind)}}this._setup();if(G.prefill){this._prefill()}return true},_prefill:function n(){var D=this;var G=i(document);var F=i(o);function E(){return(G.height()<=F.height())}this._prefill=function(){if(E()){D.scroll()}F.bind("resize.infinite-scroll",function(){if(E()){F.unbind("resize.infinite-scroll");D.scroll()}})};this._prefill()},_debug:function q(){if(true!==this.options.debug){return}if(typeof console!=="undefined"&&typeof console.log==="function"){if((Array.prototype.slice.call(arguments)).length===1&&typeof Array.prototype.slice.call(arguments)[0]==="string"){console.log((Array.prototype.slice.call(arguments)).toString())}else{console.log(Array.prototype.slice.call(arguments))}}else{if(!Function.prototype.bind&&typeof console!=="undefined"&&typeof console.log==="object"){Function.prototype.call.call(console.log,console,Array.prototype.slice.call(arguments))}}},_determinepath:function A(E){var D=this.options;if(!!D.behavior&&this["_determinepath_"+D.behavior]!==k){return this["_determinepath_"+D.behavior].call(this,E)}if(!!D.pathParse){this._debug("pathParse manual");return D.pathParse(E,this.options.state.currPage+1)}else{if(E.match(/^(.*?)\b2\b(.*?$)/)){E=E.match(/^(.*?)\b2\b(.*?$)/).slice(1)}else{if(E.match(/^(.*?)2(.*?$)/)){if(E.match(/^(.*?page=)2(\/.*|$)/)){E=E.match(/^(.*?page=)2(\/.*|$)/).slice(1);return E}E=E.match(/^(.*?)2(.*?$)/).slice(1)}else{if(E.match(/^(.*?page=)1(\/.*|$)/)){E=E.match(/^(.*?page=)1(\/.*|$)/).slice(1);return E}else{this._debug("Sorry, we couldn't parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com.");D.state.isInvalidPage=true}}}}this._debug("determinePath",E);return E},_error:function v(E){var D=this.options;if(!!D.behavior&&this["_error_"+D.behavior]!==k){this["_error_"+D.behavior].call(this,E);return}if(E!=="destroy"&&E!=="end"){E="unknown"}this._debug("Error",E);if(E==="end"){this._showdonemsg()}D.state.isDone=true;D.state.currPage=1;D.state.isPaused=false;this._binding("unbind")},_loadcallback:function c(H,G,E){var D=this.options,J=this.options.callback,L=(D.state.isDone)?"done":(!D.appendCallback)?"no-append":"append",K;if(!!D.behavior&&this["_loadcallback_"+D.behavior]!==k){this["_loadcallback_"+D.behavior].call(this,H,G);return}switch(L){case"done":this._showdonemsg();return false;case"no-append":if(D.dataType==="html"){G="<div>"+G+"</div>";G=i(G).find(D.itemSelector)}break;case"append":var F=H.children();if(F.length===0){return this._error("end")}K=document.createDocumentFragment();while(H[0].firstChild){K.appendChild(H[0].firstChild)}this._debug("contentSelector",i(D.contentSelector)[0]);i(D.contentSelector)[0].appendChild(K);G=F.get();break}D.loading.finished.call(i(D.contentSelector)[0],D);if(D.animate){var I=i(o).scrollTop()+i("#infscr-loading").height()+D.extraScrollPx+"px";i("html,body").animate({scrollTop:I},800,function(){D.state.isDuringAjax=false})}if(!D.animate){D.state.isDuringAjax=false}J(this,G,E);if(D.prefill){this._prefill()}},_nearbottom:function u(){var E=this.options,D=0+i(document).height()-(E.binder.scrollTop())-i(o).height();if(!!E.behavior&&this["_nearbottom_"+E.behavior]!==k){return this["_nearbottom_"+E.behavior].call(this)}this._debug("math:",D,E.pixelsFromNavToBottom);return(D-E.bufferPx<E.pixelsFromNavToBottom)},_pausing:function l(E){var D=this.options;if(!!D.behavior&&this["_pausing_"+D.behavior]!==k){this["_pausing_"+D.behavior].call(this,E);return}if(E!=="pause"&&E!=="resume"&&E!==null){this._debug("Invalid argument. Toggling pause value instead")}E=(E&&(E==="pause"||E==="resume"))?E:"toggle";switch(E){case"pause":D.state.isPaused=true;break;case"resume":D.state.isPaused=false;break;case"toggle":D.state.isPaused=!D.state.isPaused;break}this._debug("Paused",D.state.isPaused);return false},_setup:function r(){var D=this.options;if(!!D.behavior&&this["_setup_"+D.behavior]!==k){this["_setup_"+D.behavior].call(this);return}this._binding("bind");return false},_showdonemsg:function a(){var D=this.options;if(!!D.behavior&&this["_showdonemsg_"+D.behavior]!==k){this["_showdonemsg_"+D.behavior].call(this);return}D.loading.msg.find("img").hide().parent().find("div").html(D.loading.finishedMsg).animate({opacity:1},2000,function(){i(this).parent().fadeOut(D.loading.speed)});D.errorCallback.call(i(D.contentSelector)[0],"done")},_validate:function w(E){for(var D in E){if(D.indexOf&&D.indexOf("Selector")>-1&&i(E[D]).length===0){this._debug("Your "+D+" found no elements.");return false}}return true},bind:function p(){this._binding("bind")},destroy:function C(){this.options.state.isDestroyed=true;return this._error("destroy")},pause:function e(){this._pausing("pause")},resume:function h(){this._pausing("resume")},beginAjax:function B(G){var E=this,I=G.path,F,D,K,J;G.state.currPage++;F=i(G.contentSelector).is("table")?i("<tbody/>"):i("<div/>");D=(typeof I==="function")?I(G.state.currPage):I.join(G.state.currPage);E._debug("heading into ajax",D);K=(G.dataType==="html"||G.dataType==="json")?G.dataType:"html+callback";if(G.appendCallback&&G.dataType==="html"){K+="+callback"}switch(K){case"html+callback":E._debug("Using HTML via .load() method");F.load(D+" "+G.itemSelector,k,function H(L){E._loadcallback(F,L,D)});break;case"html":E._debug("Using "+(K.toUpperCase())+" via $.ajax() method");i.ajax({url:D,dataType:G.dataType,complete:function H(L,M){J=(typeof(L.isResolved)!=="undefined")?(L.isResolved()):(M==="success"||M==="notmodified");if(J){E._loadcallback(F,L.responseText,D)}else{E._error("end")}}});break;case"json":E._debug("Using "+(K.toUpperCase())+" via $.ajax() method");i.ajax({dataType:"json",type:"GET",url:D,success:function(N,O,M){J=(typeof(M.isResolved)!=="undefined")?(M.isResolved()):(O==="success"||O==="notmodified");if(G.appendCallback){if(G.template!==k){var L=G.template(N);F.append(L);if(J){E._loadcallback(F,L)}else{E._error("end")}}else{E._debug("template must be defined.");E._error("end")}}else{if(J){E._loadcallback(F,N,D)}else{E._error("end")}}},error:function(){E._debug("JSON ajax request failed.");E._error("end")}});break}},retrieve:function b(F){F=F||null;var D=this,E=D.options;if(!!E.behavior&&this["retrieve_"+E.behavior]!==k){this["retrieve_"+E.behavior].call(this,F);return}if(E.state.isDestroyed){this._debug("Instance is destroyed");return false}E.state.isDuringAjax=true;E.loading.start.call(i(E.contentSelector)[0],E)},scroll:function f(){var D=this.options,E=D.state;if(!!D.behavior&&this["scroll_"+D.behavior]!==k){this["scroll_"+D.behavior].call(this);return}if(E.isDuringAjax||E.isInvalidPage||E.isDone||E.isDestroyed||E.isPaused){return}if(!this._nearbottom()){return}this.retrieve()},toggle:function y(){this._pausing()},unbind:function m(){this._binding("unbind")},update:function j(D){if(i.isPlainObject(D)){this.options=i.extend(true,this.options,D)}}};i.fn.infinitescroll=function d(F,G){var E=typeof F;switch(E){case"string":var D=Array.prototype.slice.call(arguments,1);this.each(function(){var H=i.data(this,"infinitescroll");if(!H){return false}if(!i.isFunction(H[F])||F.charAt(0)==="_"){return false}H[F].apply(H,D)});break;case"object":this.each(function(){var H=i.data(this,"infinitescroll");if(H){H.update(F)}else{H=new i.infinitescroll(F,G,this);if(!H.failed){i.data(this,"infinitescroll",H)}}});break}return this};var x=i.event,s;x.special.smartscroll={setup:function(){i(this).bind("scroll",x.special.smartscroll.handler)},teardown:function(){i(this).unbind("scroll",x.special.smartscroll.handler)},handler:function(G,D){var F=this,E=arguments;G.type="smartscroll";if(s){clearTimeout(s)}s=setTimeout(function(){i.event.handle.apply(F,E)},D==="execAsap"?0:100)}};i.fn.smartscroll=function(D){return D?this.bind("smartscroll",D):this.trigger("smartscroll",["execAsap"])}})(window,jQuery);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* jQuery Masonry v2.1.
|
2
|
+
* jQuery Masonry v2.1.08
|
3
3
|
* A dynamic layout plugin for jQuery
|
4
4
|
* The flip-side of CSS Floats
|
5
5
|
* http://masonry.desandro.com
|
@@ -45,7 +45,8 @@
|
|
45
45
|
|
46
46
|
if ( resizeTimeout ) { clearTimeout( resizeTimeout ); }
|
47
47
|
resizeTimeout = setTimeout(function() {
|
48
|
-
|
48
|
+
$event.dispatch.apply( context, args );
|
49
|
+
|
49
50
|
}, execAsap === "execAsap"? 0 : 100 );
|
50
51
|
}
|
51
52
|
};
|
@@ -69,9 +70,6 @@
|
|
69
70
|
|
70
71
|
$.Mason.settings = {
|
71
72
|
isResizable: true,
|
72
|
-
isDraggable: false,
|
73
|
-
dragHandleSelector: null,
|
74
|
-
dragClass: null,
|
75
73
|
isAnimated: false,
|
76
74
|
animationOptions: {
|
77
75
|
queue: false,
|
@@ -123,9 +121,11 @@
|
|
123
121
|
|
124
122
|
this.horizontalDirection = this.options.isRTL ? 'right' : 'left';
|
125
123
|
|
124
|
+
var x = this.element.css( 'padding-' + this.horizontalDirection );
|
125
|
+
var y = this.element.css( 'padding-top' );
|
126
126
|
this.offset = {
|
127
|
-
x: parseInt(
|
128
|
-
y: parseInt(
|
127
|
+
x: x ? parseInt( x, 10 ) : 0,
|
128
|
+
y: y ? parseInt( y, 10 ) : 0
|
129
129
|
};
|
130
130
|
|
131
131
|
this.isFluid = this.options.columnWidth && typeof this.options.columnWidth === 'function';
|
@@ -147,14 +147,8 @@
|
|
147
147
|
// need to get bricks
|
148
148
|
this.reloadItems();
|
149
149
|
|
150
|
-
// set up dragging
|
151
|
-
if (this.options.isDraggable ){
|
152
|
-
this._initDrag(this.$bricks);
|
153
|
-
}
|
154
|
-
|
155
150
|
},
|
156
|
-
|
157
|
-
|
151
|
+
|
158
152
|
// _init fires when instance is first created
|
159
153
|
// and when instance is triggered again -> $el.masonry();
|
160
154
|
_init : function( callback ) {
|
@@ -391,180 +385,6 @@
|
|
391
385
|
|
392
386
|
$(window).unbind('.masonry');
|
393
387
|
|
394
|
-
},
|
395
|
-
|
396
|
-
_getDistanceBetween : function(point1, point2){
|
397
|
-
var dx = point1.x - point2.x,
|
398
|
-
dy = point1.y - point2.y;
|
399
|
-
return Math.sqrt(dx*dx + dy*dy);
|
400
|
-
},
|
401
|
-
|
402
|
-
_getBrickPoint : function($brick){
|
403
|
-
var offset = $brick.offset();
|
404
|
-
return {
|
405
|
-
$brick: $brick,
|
406
|
-
x : offset.left + ($brick.outerWidth()/2),
|
407
|
-
y : offset.top + ($brick.outerHeight()/2)
|
408
|
-
};
|
409
|
-
},
|
410
|
-
|
411
|
-
_getClosestBrick : function(brick){
|
412
|
-
|
413
|
-
var $brick = $(brick),
|
414
|
-
_this = this,
|
415
|
-
dPoint = this._getBrickPoint($brick),
|
416
|
-
closest = null,
|
417
|
-
point, dist, $b, last, midpoint;
|
418
|
-
|
419
|
-
// find the index of the closest brick
|
420
|
-
this.$bricks.each(function(i, b){
|
421
|
-
|
422
|
-
$b = $(b);
|
423
|
-
point = _this._getBrickPoint($b);
|
424
|
-
|
425
|
-
// first check the distance from the brick center
|
426
|
-
dist = _this._getDistanceBetween(dPoint, point);
|
427
|
-
|
428
|
-
if(closest === null || dist < closest.dist){
|
429
|
-
closest = {
|
430
|
-
dist: dist,
|
431
|
-
$brick: $b,
|
432
|
-
index: (point.x > dPoint.x) ? i : i+1
|
433
|
-
};
|
434
|
-
}
|
435
|
-
|
436
|
-
// get the distance between the center of the line
|
437
|
-
// connecting the current and last block
|
438
|
-
if(typeof last !== 'undefined'){
|
439
|
-
midpoint = {
|
440
|
-
x : (last.x + point.x) / 2,
|
441
|
-
y : (last.y + point.y) / 2
|
442
|
-
};
|
443
|
-
dist = _this._getDistanceBetween(dPoint, midpoint);
|
444
|
-
if(dist < closest.dist){
|
445
|
-
closest = {
|
446
|
-
dist: dist,
|
447
|
-
$brick: $b,
|
448
|
-
index: (point.x > dPoint.x) ? i : i+1
|
449
|
-
};
|
450
|
-
}
|
451
|
-
}
|
452
|
-
|
453
|
-
last = point;
|
454
|
-
|
455
|
-
});
|
456
|
-
|
457
|
-
return closest;
|
458
|
-
},
|
459
|
-
|
460
|
-
_createGhostBrick : function($brick){
|
461
|
-
|
462
|
-
var closest = this._getClosestBrick($brick),
|
463
|
-
$ghost = $brick.clone().html('').addClass('drag-ghost'),
|
464
|
-
pos = $brick.position();
|
465
|
-
|
466
|
-
$ghost.css({
|
467
|
-
width : $brick.width(),
|
468
|
-
height : $brick.height()
|
469
|
-
});
|
470
|
-
|
471
|
-
this.$bricks.splice(closest.index, 0, $ghost[0]);
|
472
|
-
this.element.append($ghost);
|
473
|
-
this._reLayout();
|
474
|
-
|
475
|
-
return closest.index;
|
476
|
-
},
|
477
|
-
|
478
|
-
_initDrag : function($bricks){
|
479
|
-
|
480
|
-
var _this = this,
|
481
|
-
dragged = null,
|
482
|
-
pos, closest,
|
483
|
-
ghostInterval = null,
|
484
|
-
ghostIndex = -1,
|
485
|
-
ghostTime, ghostReset;
|
486
|
-
|
487
|
-
$bricks.bind('dragstart', function(e) {
|
488
|
-
|
489
|
-
// make sure we're dragging by the right thing
|
490
|
-
if(_this.options.dragHandleSelector !== null
|
491
|
-
&& !$(e.target).is(_this.options.dragHandleSelector)){
|
492
|
-
return false;
|
493
|
-
}
|
494
|
-
|
495
|
-
pos = $(this).position();
|
496
|
-
|
497
|
-
// add the dragClass
|
498
|
-
if(_this.options.dragClass !== null){
|
499
|
-
$(this).addClass(_this.options.dragClass);
|
500
|
-
}
|
501
|
-
|
502
|
-
// remove the brick being dragged from the array
|
503
|
-
dragged = this;
|
504
|
-
_this.$bricks = _this.$bricks.not(this);
|
505
|
-
_this._reLayout();
|
506
|
-
|
507
|
-
ghostTime = ghostReset = new Date().getTime();
|
508
|
-
|
509
|
-
ghostInterval = setInterval(function(){
|
510
|
-
if(ghostReset !== ghostTime){
|
511
|
-
if(ghostIndex !== -1){
|
512
|
-
|
513
|
-
// this kinda sucks because it doesn't use the original
|
514
|
-
// position of the bricks
|
515
|
-
if(_this._getClosestBrick($(dragged)).index === ghostIndex){
|
516
|
-
return;
|
517
|
-
}
|
518
|
-
|
519
|
-
$(_this.$bricks.splice(ghostIndex,1)).fadeOut(function(){
|
520
|
-
$(this).remove();
|
521
|
-
});
|
522
|
-
ghostIndex = -1;
|
523
|
-
_this._reLayout();
|
524
|
-
}
|
525
|
-
if(new Date().getTime() - ghostReset > 200){
|
526
|
-
ghostIndex = _this._createGhostBrick($(dragged));
|
527
|
-
ghostTime = ghostReset;
|
528
|
-
}
|
529
|
-
}
|
530
|
-
}, 100);
|
531
|
-
|
532
|
-
}).bind('drag', function(e, dd) {
|
533
|
-
|
534
|
-
$(this).css({
|
535
|
-
top : pos.top + dd.deltaY,
|
536
|
-
left : pos.left + dd.deltaX
|
537
|
-
});
|
538
|
-
|
539
|
-
ghostReset = new Date().getTime();
|
540
|
-
|
541
|
-
}).bind('dragend', function(e) {
|
542
|
-
|
543
|
-
// clear the ghosting interval
|
544
|
-
clearInterval(ghostInterval);
|
545
|
-
|
546
|
-
// remove the dragClass
|
547
|
-
if(_this.options.dragClass !== null){
|
548
|
-
$(this).removeClass(_this.options.dragClass);
|
549
|
-
}
|
550
|
-
|
551
|
-
// insert the brick back into the array
|
552
|
-
if(ghostIndex !== -1) {
|
553
|
-
var $ghost = $(_this.$bricks[ghostIndex]);
|
554
|
-
$ghost.fadeOut(function(){
|
555
|
-
$ghost.remove();
|
556
|
-
});
|
557
|
-
_this.$bricks[ghostIndex] = dragged;
|
558
|
-
ghostIndex = -1;
|
559
|
-
} else {
|
560
|
-
closest = _this._getClosestBrick(dragged);
|
561
|
-
_this.$bricks.splice(closest.index , 0, dragged);
|
562
|
-
}
|
563
|
-
dragged = null;
|
564
|
-
|
565
|
-
|
566
|
-
_this._reLayout();
|
567
|
-
});
|
568
388
|
}
|
569
389
|
|
570
390
|
};
|
@@ -679,4 +499,4 @@
|
|
679
499
|
return this;
|
680
500
|
};
|
681
501
|
|
682
|
-
})( window, jQuery );
|
502
|
+
})( window, jQuery );
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* jQuery Masonry v2.1.
|
2
|
+
* jQuery Masonry v2.1.08
|
3
3
|
* A dynamic layout plugin for jQuery
|
4
4
|
* The flip-side of CSS Floats
|
5
5
|
* http://masonry.desandro.com
|
@@ -7,4 +7,4 @@
|
|
7
7
|
* Licensed under the MIT license.
|
8
8
|
* Copyright 2012 David DeSandro
|
9
9
|
*/
|
10
|
-
(function(
|
10
|
+
(function(e,t,n){"use strict";var r=t.event,i;r.special.smartresize={setup:function(){t(this).bind("resize",r.special.smartresize.handler)},teardown:function(){t(this).unbind("resize",r.special.smartresize.handler)},handler:function(e,t){var n=this,s=arguments;e.type="smartresize",i&&clearTimeout(i),i=setTimeout(function(){r.dispatch.apply(n,s)},t==="execAsap"?0:100)}},t.fn.smartresize=function(e){return e?this.bind("smartresize",e):this.trigger("smartresize",["execAsap"])},t.Mason=function(e,n){this.element=t(n),this._create(e),this._init()},t.Mason.settings={isResizable:!0,isAnimated:!1,animationOptions:{queue:!1,duration:500},gutterWidth:0,isRTL:!1,isFitWidth:!1,containerStyle:{position:"relative"}},t.Mason.prototype={_filterFindBricks:function(e){var t=this.options.itemSelector;return t?e.filter(t).add(e.find(t)):e},_getBricks:function(e){var t=this._filterFindBricks(e).css({position:"absolute"}).addClass("masonry-brick");return t},_create:function(n){this.options=t.extend(!0,{},t.Mason.settings,n),this.styleQueue=[];var r=this.element[0].style;this.originalStyle={height:r.height||""};var i=this.options.containerStyle;for(var s in i)this.originalStyle[s]=r[s]||"";this.element.css(i),this.horizontalDirection=this.options.isRTL?"right":"left";var o=this.element.css("padding-"+this.horizontalDirection),u=this.element.css("padding-top");this.offset={x:o?parseInt(o,10):0,y:u?parseInt(u,10):0},this.isFluid=this.options.columnWidth&&typeof this.options.columnWidth=="function";var a=this;setTimeout(function(){a.element.addClass("masonry")},0),this.options.isResizable&&t(e).bind("smartresize.masonry",function(){a.resize()}),this.reloadItems()},_init:function(e){this._getColumns(),this._reLayout(e)},option:function(e,n){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))},layout:function(e,t){for(var n=0,r=e.length;n<r;n++)this._placeBrick(e[n]);var i={};i.height=Math.max.apply(Math,this.colYs);if(this.options.isFitWidth){var s=0;n=this.cols;while(--n){if(this.colYs[n]!==0)break;s++}i.width=(this.cols-s)*this.columnWidth-this.options.gutterWidth}this.styleQueue.push({$el:this.element,style:i});var o=this.isLaidOut?this.options.isAnimated?"animate":"css":"css",u=this.options.animationOptions,a;for(n=0,r=this.styleQueue.length;n<r;n++)a=this.styleQueue[n],a.$el[o](a.style,u);this.styleQueue=[],t&&t.call(e),this.isLaidOut=!0},_getColumns:function(){var e=this.options.isFitWidth?this.element.parent():this.element,t=e.width();this.columnWidth=this.isFluid?this.options.columnWidth(t):this.options.columnWidth||this.$bricks.outerWidth(!0)||t,this.columnWidth+=this.options.gutterWidth,this.cols=Math.floor((t+this.options.gutterWidth)/this.columnWidth),this.cols=Math.max(this.cols,1)},_placeBrick:function(e){var n=t(e),r,i,s,o,u;r=Math.ceil(n.outerWidth(!0)/this.columnWidth),r=Math.min(r,this.cols);if(r===1)s=this.colYs;else{i=this.cols+1-r,s=[];for(u=0;u<i;u++)o=this.colYs.slice(u,u+r),s[u]=Math.max.apply(Math,o)}var a=Math.min.apply(Math,s),f=0;for(var l=0,c=s.length;l<c;l++)if(s[l]===a){f=l;break}var h={top:a+this.offset.y};h[this.horizontalDirection]=this.columnWidth*f+this.offset.x,this.styleQueue.push({$el:n,style:h});var p=a+n.outerHeight(!0),d=this.cols+1-c;for(l=0;l<d;l++)this.colYs[f+l]=p},resize:function(){var e=this.cols;this._getColumns(),(this.isFluid||this.cols!==e)&&this._reLayout()},_reLayout:function(e){var t=this.cols;this.colYs=[];while(t--)this.colYs.push(0);this.layout(this.$bricks,e)},reloadItems:function(){this.$bricks=this._getBricks(this.element.children())},reload:function(e){this.reloadItems(),this._init(e)},appended:function(e,t,n){if(t){this._filterFindBricks(e).css({top:this.element.height()});var r=this;setTimeout(function(){r._appended(e,n)},1)}else this._appended(e,n)},_appended:function(e,t){var n=this._getBricks(e);this.$bricks=this.$bricks.add(n),this.layout(n,t)},remove:function(e){this.$bricks=this.$bricks.not(e),e.remove()},destroy:function(){this.$bricks.removeClass("masonry-brick").each(function(){this.style.position="",this.style.top="",this.style.left=""});var n=this.element[0].style;for(var r in this.originalStyle)n[r]=this.originalStyle[r];this.element.unbind(".masonry").removeClass("masonry").removeData("masonry"),t(e).unbind(".masonry")}},t.fn.imagesLoaded=function(e){function u(){e.call(n,r)}function a(e){var n=e.target;n.src!==s&&t.inArray(n,o)===-1&&(o.push(n),--i<=0&&(setTimeout(u),r.unbind(".imagesLoaded",a)))}var n=this,r=n.find("img").add(n.filter("img")),i=r.length,s="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",o=[];return i||u(),r.bind("load.imagesLoaded error.imagesLoaded",a).each(function(){var e=this.src;this.src=s,this.src=e}),n};var s=function(t){e.console&&e.console.error(t)};t.fn.masonry=function(e){if(typeof e=="string"){var n=Array.prototype.slice.call(arguments,1);this.each(function(){var r=t.data(this,"masonry");if(!r){s("cannot call methods on masonry prior to initialization; attempted to call method '"+e+"'");return}if(!t.isFunction(r[e])||e.charAt(0)==="_"){s("no such method '"+e+"' for masonry instance");return}r[e].apply(r,n)})}else this.each(function(){var n=t.data(this,"masonry");n?(n.option(e||{}),n._init()):t.data(this,"masonry",new t.Mason(e,this))});return this}})(window,jQuery);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: masonry-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-03-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -162,8 +162,11 @@ files:
|
|
162
162
|
- spec/index.html
|
163
163
|
- spec/spec_helper.rb
|
164
164
|
- vendor/assets/images/masonry/loader.gif
|
165
|
+
- vendor/assets/javascripts/debounce.js
|
166
|
+
- vendor/assets/javascripts/jquery.debounced_resize.js
|
165
167
|
- vendor/assets/javascripts/jquery.isotope.js
|
166
168
|
- vendor/assets/javascripts/jquery.isotope.min.js
|
169
|
+
- vendor/assets/javascripts/jquery.throttled_resize.js
|
167
170
|
- vendor/assets/javascripts/masonry/box-maker.js
|
168
171
|
- vendor/assets/javascripts/masonry/jquery.event-drag.js
|
169
172
|
- vendor/assets/javascripts/masonry/jquery.imagesloaded.js
|
@@ -206,7 +209,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
206
209
|
version: '0'
|
207
210
|
segments:
|
208
211
|
- 0
|
209
|
-
hash:
|
212
|
+
hash: 1844422040452268934
|
210
213
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
211
214
|
none: false
|
212
215
|
requirements:
|
@@ -215,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
218
|
version: '0'
|
216
219
|
requirements: []
|
217
220
|
rubyforge_project:
|
218
|
-
rubygems_version: 1.8.
|
221
|
+
rubygems_version: 1.8.25
|
219
222
|
signing_key:
|
220
223
|
specification_version: 3
|
221
224
|
summary: Use JQuery Masonry with Rails asset pipeline
|