promethee 1.7.12 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/promethee/rails/version.rb +1 -1
- data/node_modules/@fancyapps/fancybox/README.md +1 -1
- data/node_modules/@fancyapps/fancybox/dist/jquery.fancybox.css +162 -161
- data/node_modules/@fancyapps/fancybox/dist/jquery.fancybox.js +1281 -790
- data/node_modules/@fancyapps/fancybox/dist/jquery.fancybox.min.css +1 -1
- data/node_modules/@fancyapps/fancybox/dist/jquery.fancybox.min.js +4 -3
- data/node_modules/@fancyapps/fancybox/docs/index.html +1398 -1321
- data/node_modules/@fancyapps/fancybox/package.json +52 -43
- data/node_modules/@fancyapps/fancybox/src/css/core.css +144 -142
- data/node_modules/@fancyapps/fancybox/src/css/thumbs.css +20 -23
- data/node_modules/@fancyapps/fancybox/src/js/core.js +883 -536
- data/node_modules/@fancyapps/fancybox/src/js/fullscreen.js +67 -64
- data/node_modules/@fancyapps/fancybox/src/js/guestures.js +114 -78
- data/node_modules/@fancyapps/fancybox/src/js/hash.js +13 -18
- data/node_modules/@fancyapps/fancybox/src/js/media.js +118 -29
- data/node_modules/@fancyapps/fancybox/src/js/share.js +8 -6
- data/node_modules/@fancyapps/fancybox/src/js/slideshow.js +55 -32
- data/node_modules/@fancyapps/fancybox/src/js/thumbs.js +22 -26
- data/node_modules/@fancyapps/fancybox/src/js/wheel.js +1 -1
- metadata +2 -46
- data/node_modules/fancybox/CHANGELOG.md +0 -125
- data/node_modules/fancybox/README.md +0 -249
- data/node_modules/fancybox/bower.json +0 -24
- data/node_modules/fancybox/demo/1_b.jpg +0 -0
- data/node_modules/fancybox/demo/1_s.jpg +0 -0
- data/node_modules/fancybox/demo/2_b.jpg +0 -0
- data/node_modules/fancybox/demo/2_s.jpg +0 -0
- data/node_modules/fancybox/demo/3_b.jpg +0 -0
- data/node_modules/fancybox/demo/3_s.jpg +0 -0
- data/node_modules/fancybox/demo/4_b.jpg +0 -0
- data/node_modules/fancybox/demo/4_s.jpg +0 -0
- data/node_modules/fancybox/demo/5_b.jpg +0 -0
- data/node_modules/fancybox/demo/5_s.jpg +0 -0
- data/node_modules/fancybox/demo/ajax.txt +0 -15
- data/node_modules/fancybox/demo/iframe.html +0 -26
- data/node_modules/fancybox/demo/index.html +0 -312
- data/node_modules/fancybox/dist/css/jquery.fancybox.css +0 -222
- data/node_modules/fancybox/dist/helpers/css/jquery.fancybox-buttons.css +0 -82
- data/node_modules/fancybox/dist/helpers/css/jquery.fancybox-thumbs.css +0 -46
- data/node_modules/fancybox/dist/helpers/img/fancybox_buttons.png +0 -0
- data/node_modules/fancybox/dist/helpers/js/jquery.fancybox-buttons.cjs.js +0 -121
- data/node_modules/fancybox/dist/helpers/js/jquery.fancybox-buttons.js +0 -122
- data/node_modules/fancybox/dist/helpers/js/jquery.fancybox-media.cjs.js +0 -199
- data/node_modules/fancybox/dist/helpers/js/jquery.fancybox-media.js +0 -199
- data/node_modules/fancybox/dist/helpers/js/jquery.fancybox-thumbs.cjs.js +0 -164
- data/node_modules/fancybox/dist/helpers/js/jquery.fancybox-thumbs.js +0 -165
- data/node_modules/fancybox/dist/helpers/scss/jquery.fancybox-buttons.scss +0 -100
- data/node_modules/fancybox/dist/helpers/scss/jquery.fancybox-thumbs.scss +0 -55
- data/node_modules/fancybox/dist/img/blank.gif +0 -0
- data/node_modules/fancybox/dist/img/fancybox_loading.gif +0 -0
- data/node_modules/fancybox/dist/img/fancybox_loading@2x.gif +0 -0
- data/node_modules/fancybox/dist/img/fancybox_overlay.png +0 -0
- data/node_modules/fancybox/dist/img/fancybox_sprite.png +0 -0
- data/node_modules/fancybox/dist/img/fancybox_sprite@2x.png +0 -0
- data/node_modules/fancybox/dist/js/jquery.fancybox.cjs.js +0 -2027
- data/node_modules/fancybox/dist/js/jquery.fancybox.js +0 -2018
- data/node_modules/fancybox/dist/js/jquery.fancybox.pack.js +0 -46
- data/node_modules/fancybox/dist/scss/jquery.fancybox.scss +0 -276
- data/node_modules/fancybox/fancybox.jquery.json +0 -31
- data/node_modules/fancybox/lib/jquery-1.10.2.min.js +0 -6
- data/node_modules/fancybox/lib/jquery.mousewheel.pack.js +0 -14
- data/node_modules/fancybox/package.json +0 -32
- data/node_modules/fancybox/sprite.psd +0 -0
- data/node_modules/fancybox/test.js +0 -10
@@ -1,199 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* Media helper for fancyBox
|
3
|
-
* version: 1.0.6 (Fri, 14 Jun 2013)
|
4
|
-
* @requires fancyBox v2.0 or later
|
5
|
-
*
|
6
|
-
* Usage:
|
7
|
-
* $(".fancybox").fancybox({
|
8
|
-
* helpers : {
|
9
|
-
* media: true
|
10
|
-
* }
|
11
|
-
* });
|
12
|
-
*
|
13
|
-
* Set custom URL parameters:
|
14
|
-
* $(".fancybox").fancybox({
|
15
|
-
* helpers : {
|
16
|
-
* media: {
|
17
|
-
* youtube : {
|
18
|
-
* params : {
|
19
|
-
* autoplay : 0
|
20
|
-
* }
|
21
|
-
* }
|
22
|
-
* }
|
23
|
-
* }
|
24
|
-
* });
|
25
|
-
*
|
26
|
-
* Or:
|
27
|
-
* $(".fancybox").fancybox({,
|
28
|
-
* helpers : {
|
29
|
-
* media: true
|
30
|
-
* },
|
31
|
-
* youtube : {
|
32
|
-
* autoplay: 0
|
33
|
-
* }
|
34
|
-
* });
|
35
|
-
*
|
36
|
-
* Supports:
|
37
|
-
*
|
38
|
-
* Youtube
|
39
|
-
* http://www.youtube.com/watch?v=opj24KnzrWo
|
40
|
-
* http://www.youtube.com/embed/opj24KnzrWo
|
41
|
-
* http://youtu.be/opj24KnzrWo
|
42
|
-
* http://www.youtube-nocookie.com/embed/opj24KnzrWo
|
43
|
-
* Vimeo
|
44
|
-
* http://vimeo.com/40648169
|
45
|
-
* http://vimeo.com/channels/staffpicks/38843628
|
46
|
-
* http://vimeo.com/groups/surrealism/videos/36516384
|
47
|
-
* http://player.vimeo.com/video/45074303
|
48
|
-
* Metacafe
|
49
|
-
* http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/
|
50
|
-
* http://www.metacafe.com/watch/7635964/
|
51
|
-
* Dailymotion
|
52
|
-
* http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people
|
53
|
-
* Twitvid
|
54
|
-
* http://twitvid.com/QY7MD
|
55
|
-
* Twitpic
|
56
|
-
* http://twitpic.com/7p93st
|
57
|
-
* Instagram
|
58
|
-
* http://instagr.am/p/IejkuUGxQn/
|
59
|
-
* http://instagram.com/p/IejkuUGxQn/
|
60
|
-
* Google maps
|
61
|
-
* http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17
|
62
|
-
* http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
|
63
|
-
* http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56
|
64
|
-
*/
|
65
|
-
;(function ($) {
|
66
|
-
"use strict";
|
67
|
-
|
68
|
-
//Shortcut for fancyBox object
|
69
|
-
var F = $.fancybox,
|
70
|
-
format = function( url, rez, params ) {
|
71
|
-
params = params || '';
|
72
|
-
|
73
|
-
if ( $.type( params ) === "object" ) {
|
74
|
-
params = $.param(params, true);
|
75
|
-
}
|
76
|
-
|
77
|
-
$.each(rez, function(key, value) {
|
78
|
-
url = url.replace( '$' + key, value || '' );
|
79
|
-
});
|
80
|
-
|
81
|
-
if (params.length) {
|
82
|
-
url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params;
|
83
|
-
}
|
84
|
-
|
85
|
-
return url;
|
86
|
-
};
|
87
|
-
|
88
|
-
//Add helper object
|
89
|
-
F.helpers.media = {
|
90
|
-
defaults : {
|
91
|
-
youtube : {
|
92
|
-
matcher : /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i,
|
93
|
-
params : {
|
94
|
-
autoplay : 1,
|
95
|
-
autohide : 1,
|
96
|
-
fs : 1,
|
97
|
-
rel : 0,
|
98
|
-
hd : 1,
|
99
|
-
wmode : 'opaque',
|
100
|
-
enablejsapi : 1
|
101
|
-
},
|
102
|
-
type : 'iframe',
|
103
|
-
url : '//www.youtube.com/embed/$3'
|
104
|
-
},
|
105
|
-
vimeo : {
|
106
|
-
matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/,
|
107
|
-
params : {
|
108
|
-
autoplay : 1,
|
109
|
-
hd : 1,
|
110
|
-
show_title : 1,
|
111
|
-
show_byline : 1,
|
112
|
-
show_portrait : 0,
|
113
|
-
fullscreen : 1
|
114
|
-
},
|
115
|
-
type : 'iframe',
|
116
|
-
url : '//player.vimeo.com/video/$1'
|
117
|
-
},
|
118
|
-
metacafe : {
|
119
|
-
matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/,
|
120
|
-
params : {
|
121
|
-
autoPlay : 'yes'
|
122
|
-
},
|
123
|
-
type : 'swf',
|
124
|
-
url : function( rez, params, obj ) {
|
125
|
-
obj.swf.flashVars = 'playerVars=' + $.param( params, true );
|
126
|
-
|
127
|
-
return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf';
|
128
|
-
}
|
129
|
-
},
|
130
|
-
dailymotion : {
|
131
|
-
matcher : /dailymotion.com\/video\/(.*)\/?(.*)/,
|
132
|
-
params : {
|
133
|
-
additionalInfos : 0,
|
134
|
-
autoStart : 1
|
135
|
-
},
|
136
|
-
type : 'swf',
|
137
|
-
url : '//www.dailymotion.com/swf/video/$1'
|
138
|
-
},
|
139
|
-
twitvid : {
|
140
|
-
matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i,
|
141
|
-
params : {
|
142
|
-
autoplay : 0
|
143
|
-
},
|
144
|
-
type : 'iframe',
|
145
|
-
url : '//www.twitvid.com/embed.php?guid=$1'
|
146
|
-
},
|
147
|
-
twitpic : {
|
148
|
-
matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i,
|
149
|
-
type : 'image',
|
150
|
-
url : '//twitpic.com/show/full/$1/'
|
151
|
-
},
|
152
|
-
instagram : {
|
153
|
-
matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,
|
154
|
-
type : 'image',
|
155
|
-
url : '//$1/p/$2/media/?size=l'
|
156
|
-
},
|
157
|
-
google_maps : {
|
158
|
-
matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i,
|
159
|
-
type : 'iframe',
|
160
|
-
url : function( rez ) {
|
161
|
-
return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed');
|
162
|
-
}
|
163
|
-
}
|
164
|
-
},
|
165
|
-
|
166
|
-
beforeLoad : function(opts, obj) {
|
167
|
-
var url = obj.href || '',
|
168
|
-
type = false,
|
169
|
-
what,
|
170
|
-
item,
|
171
|
-
rez,
|
172
|
-
params;
|
173
|
-
|
174
|
-
for (what in opts) {
|
175
|
-
if (opts.hasOwnProperty(what)) {
|
176
|
-
item = opts[ what ];
|
177
|
-
rez = url.match( item.matcher );
|
178
|
-
|
179
|
-
if (rez) {
|
180
|
-
type = item.type;
|
181
|
-
params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null));
|
182
|
-
|
183
|
-
url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params );
|
184
|
-
|
185
|
-
break;
|
186
|
-
}
|
187
|
-
}
|
188
|
-
}
|
189
|
-
|
190
|
-
if (type) {
|
191
|
-
obj.href = url;
|
192
|
-
obj.type = type;
|
193
|
-
|
194
|
-
obj.autoHeight = false;
|
195
|
-
}
|
196
|
-
}
|
197
|
-
};
|
198
|
-
|
199
|
-
}(jQuery));
|
@@ -1,164 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* Thumbnail helper for fancyBox
|
3
|
-
* version: 1.0.7 (Mon, 01 Oct 2012)
|
4
|
-
* @requires fancyBox v2.0 or later
|
5
|
-
*
|
6
|
-
* Usage:
|
7
|
-
* $(".fancybox").fancybox({
|
8
|
-
* helpers : {
|
9
|
-
* thumbs: {
|
10
|
-
* width : 50,
|
11
|
-
* height : 50
|
12
|
-
* }
|
13
|
-
* }
|
14
|
-
* });
|
15
|
-
*
|
16
|
-
*/
|
17
|
-
module.exports = function($) {
|
18
|
-
//Shortcut for fancyBox object
|
19
|
-
var F = $.fancybox;
|
20
|
-
|
21
|
-
//Add helper object
|
22
|
-
F.helpers.thumbs = {
|
23
|
-
defaults: {
|
24
|
-
width: 50, // thumbnail width
|
25
|
-
height: 50, // thumbnail height
|
26
|
-
position: 'bottom', // 'top' or 'bottom'
|
27
|
-
source: function(item) { // function to obtain the URL of the thumbnail image
|
28
|
-
var href;
|
29
|
-
|
30
|
-
if (item.element) {
|
31
|
-
href = $(item.element).find('img').attr('src');
|
32
|
-
}
|
33
|
-
|
34
|
-
if (!href && item.type === 'image' && item.href) {
|
35
|
-
href = item.href;
|
36
|
-
}
|
37
|
-
|
38
|
-
return href;
|
39
|
-
}
|
40
|
-
},
|
41
|
-
|
42
|
-
wrap: null,
|
43
|
-
list: null,
|
44
|
-
width: 0,
|
45
|
-
|
46
|
-
init: function(opts, obj) {
|
47
|
-
var that = this,
|
48
|
-
list,
|
49
|
-
thumbWidth = opts.width,
|
50
|
-
thumbHeight = opts.height,
|
51
|
-
thumbSource = opts.source;
|
52
|
-
|
53
|
-
//Build list structure
|
54
|
-
list = '';
|
55
|
-
|
56
|
-
for (var n = 0; n < obj.group.length; n++) {
|
57
|
-
list += '<li><a style="width:' + thumbWidth + 'px;height:' + thumbHeight + 'px;" href="javascript:jQuery.fancybox.jumpto(' + n + ');"></a></li>';
|
58
|
-
}
|
59
|
-
|
60
|
-
this.wrap = $('<div id="fancybox-thumbs"></div>').addClass(opts.position).appendTo('body');
|
61
|
-
this.list = $('<ul>' + list + '</ul>').appendTo(this.wrap);
|
62
|
-
|
63
|
-
//Load each thumbnail
|
64
|
-
$.each(obj.group, function(i) {
|
65
|
-
var el = obj.group[i],
|
66
|
-
href = thumbSource(el);
|
67
|
-
|
68
|
-
if (!href) {
|
69
|
-
return;
|
70
|
-
}
|
71
|
-
|
72
|
-
$("<img />").load(function() {
|
73
|
-
var width = this.width,
|
74
|
-
height = this.height,
|
75
|
-
widthRatio, heightRatio, parent;
|
76
|
-
|
77
|
-
if (!that.list || !width || !height) {
|
78
|
-
return;
|
79
|
-
}
|
80
|
-
|
81
|
-
//Calculate thumbnail width/height and center it
|
82
|
-
widthRatio = width / thumbWidth;
|
83
|
-
heightRatio = height / thumbHeight;
|
84
|
-
|
85
|
-
parent = that.list.children().eq(i).find('a');
|
86
|
-
|
87
|
-
if (widthRatio >= 1 && heightRatio >= 1) {
|
88
|
-
if (widthRatio > heightRatio) {
|
89
|
-
width = Math.floor(width / heightRatio);
|
90
|
-
height = thumbHeight;
|
91
|
-
|
92
|
-
} else {
|
93
|
-
width = thumbWidth;
|
94
|
-
height = Math.floor(height / widthRatio);
|
95
|
-
}
|
96
|
-
}
|
97
|
-
|
98
|
-
$(this).css({
|
99
|
-
width: width,
|
100
|
-
height: height,
|
101
|
-
top: Math.floor(thumbHeight / 2 - height / 2),
|
102
|
-
left: Math.floor(thumbWidth / 2 - width / 2)
|
103
|
-
});
|
104
|
-
|
105
|
-
parent.width(thumbWidth).height(thumbHeight);
|
106
|
-
|
107
|
-
$(this).hide().appendTo(parent).fadeIn(300);
|
108
|
-
|
109
|
-
})
|
110
|
-
.attr('src', href)
|
111
|
-
.attr('title', el.title);
|
112
|
-
});
|
113
|
-
|
114
|
-
//Set initial width
|
115
|
-
this.width = this.list.children().eq(0).outerWidth(true);
|
116
|
-
|
117
|
-
this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)));
|
118
|
-
},
|
119
|
-
|
120
|
-
beforeLoad: function(opts, obj) {
|
121
|
-
//Remove self if gallery do not have at least two items
|
122
|
-
if (obj.group.length < 2) {
|
123
|
-
obj.helpers.thumbs = false;
|
124
|
-
|
125
|
-
return;
|
126
|
-
}
|
127
|
-
|
128
|
-
//Increase bottom margin to give space for thumbs
|
129
|
-
obj.margin[opts.position === 'top' ? 0 : 2] += ((opts.height) + 15);
|
130
|
-
},
|
131
|
-
|
132
|
-
afterShow: function(opts, obj) {
|
133
|
-
//Check if exists and create or update list
|
134
|
-
if (this.list) {
|
135
|
-
this.onUpdate(opts, obj);
|
136
|
-
|
137
|
-
} else {
|
138
|
-
this.init(opts, obj);
|
139
|
-
}
|
140
|
-
|
141
|
-
//Set active element
|
142
|
-
this.list.children().removeClass('active').eq(obj.index).addClass('active');
|
143
|
-
},
|
144
|
-
|
145
|
-
//Center list
|
146
|
-
onUpdate: function(opts, obj) {
|
147
|
-
if (this.list) {
|
148
|
-
this.list.stop(true).animate({
|
149
|
-
'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))
|
150
|
-
}, 150);
|
151
|
-
}
|
152
|
-
},
|
153
|
-
|
154
|
-
beforeClose: function() {
|
155
|
-
if (this.wrap) {
|
156
|
-
this.wrap.remove();
|
157
|
-
}
|
158
|
-
|
159
|
-
this.wrap = null;
|
160
|
-
this.list = null;
|
161
|
-
this.width = 0;
|
162
|
-
}
|
163
|
-
}
|
164
|
-
}
|
@@ -1,165 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* Thumbnail helper for fancyBox
|
3
|
-
* version: 1.0.7 (Mon, 01 Oct 2012)
|
4
|
-
* @requires fancyBox v2.0 or later
|
5
|
-
*
|
6
|
-
* Usage:
|
7
|
-
* $(".fancybox").fancybox({
|
8
|
-
* helpers : {
|
9
|
-
* thumbs: {
|
10
|
-
* width : 50,
|
11
|
-
* height : 50
|
12
|
-
* }
|
13
|
-
* }
|
14
|
-
* });
|
15
|
-
*
|
16
|
-
*/
|
17
|
-
;(function ($) {
|
18
|
-
//Shortcut for fancyBox object
|
19
|
-
var F = $.fancybox;
|
20
|
-
|
21
|
-
//Add helper object
|
22
|
-
F.helpers.thumbs = {
|
23
|
-
defaults : {
|
24
|
-
width : 50, // thumbnail width
|
25
|
-
height : 50, // thumbnail height
|
26
|
-
position : 'bottom', // 'top' or 'bottom'
|
27
|
-
source : function ( item ) { // function to obtain the URL of the thumbnail image
|
28
|
-
var href;
|
29
|
-
|
30
|
-
if (item.element) {
|
31
|
-
href = $(item.element).find('img').attr('src');
|
32
|
-
}
|
33
|
-
|
34
|
-
if (!href && item.type === 'image' && item.href) {
|
35
|
-
href = item.href;
|
36
|
-
}
|
37
|
-
|
38
|
-
return href;
|
39
|
-
}
|
40
|
-
},
|
41
|
-
|
42
|
-
wrap : null,
|
43
|
-
list : null,
|
44
|
-
width : 0,
|
45
|
-
|
46
|
-
init: function (opts, obj) {
|
47
|
-
var that = this,
|
48
|
-
list,
|
49
|
-
thumbWidth = opts.width,
|
50
|
-
thumbHeight = opts.height,
|
51
|
-
thumbSource = opts.source;
|
52
|
-
|
53
|
-
//Build list structure
|
54
|
-
list = '';
|
55
|
-
|
56
|
-
for (var n = 0; n < obj.group.length; n++) {
|
57
|
-
list += '<li><a style="width:' + thumbWidth + 'px;height:' + thumbHeight + 'px;" href="javascript:jQuery.fancybox.jumpto(' + n + ');"></a></li>';
|
58
|
-
}
|
59
|
-
|
60
|
-
this.wrap = $('<div id="fancybox-thumbs"></div>').addClass(opts.position).appendTo('body');
|
61
|
-
this.list = $('<ul>' + list + '</ul>').appendTo(this.wrap);
|
62
|
-
|
63
|
-
//Load each thumbnail
|
64
|
-
$.each(obj.group, function (i) {
|
65
|
-
var el = obj.group[ i ],
|
66
|
-
href = thumbSource( el );
|
67
|
-
|
68
|
-
if (!href) {
|
69
|
-
return;
|
70
|
-
}
|
71
|
-
|
72
|
-
$("<img />").load(function () {
|
73
|
-
var width = this.width,
|
74
|
-
height = this.height,
|
75
|
-
widthRatio, heightRatio, parent;
|
76
|
-
|
77
|
-
if (!that.list || !width || !height) {
|
78
|
-
return;
|
79
|
-
}
|
80
|
-
|
81
|
-
//Calculate thumbnail width/height and center it
|
82
|
-
widthRatio = width / thumbWidth;
|
83
|
-
heightRatio = height / thumbHeight;
|
84
|
-
|
85
|
-
parent = that.list.children().eq(i).find('a');
|
86
|
-
|
87
|
-
if (widthRatio >= 1 && heightRatio >= 1) {
|
88
|
-
if (widthRatio > heightRatio) {
|
89
|
-
width = Math.floor(width / heightRatio);
|
90
|
-
height = thumbHeight;
|
91
|
-
|
92
|
-
} else {
|
93
|
-
width = thumbWidth;
|
94
|
-
height = Math.floor(height / widthRatio);
|
95
|
-
}
|
96
|
-
}
|
97
|
-
|
98
|
-
$(this).css({
|
99
|
-
width : width,
|
100
|
-
height : height,
|
101
|
-
top : Math.floor(thumbHeight / 2 - height / 2),
|
102
|
-
left : Math.floor(thumbWidth / 2 - width / 2)
|
103
|
-
});
|
104
|
-
|
105
|
-
parent.width(thumbWidth).height(thumbHeight);
|
106
|
-
|
107
|
-
$(this).hide().appendTo(parent).fadeIn(300);
|
108
|
-
|
109
|
-
})
|
110
|
-
.attr('src', href)
|
111
|
-
.attr('title', el.title);
|
112
|
-
});
|
113
|
-
|
114
|
-
//Set initial width
|
115
|
-
this.width = this.list.children().eq(0).outerWidth(true);
|
116
|
-
|
117
|
-
this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)));
|
118
|
-
},
|
119
|
-
|
120
|
-
beforeLoad: function (opts, obj) {
|
121
|
-
//Remove self if gallery do not have at least two items
|
122
|
-
if (obj.group.length < 2) {
|
123
|
-
obj.helpers.thumbs = false;
|
124
|
-
|
125
|
-
return;
|
126
|
-
}
|
127
|
-
|
128
|
-
//Increase bottom margin to give space for thumbs
|
129
|
-
obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15);
|
130
|
-
},
|
131
|
-
|
132
|
-
afterShow: function (opts, obj) {
|
133
|
-
//Check if exists and create or update list
|
134
|
-
if (this.list) {
|
135
|
-
this.onUpdate(opts, obj);
|
136
|
-
|
137
|
-
} else {
|
138
|
-
this.init(opts, obj);
|
139
|
-
}
|
140
|
-
|
141
|
-
//Set active element
|
142
|
-
this.list.children().removeClass('active').eq(obj.index).addClass('active');
|
143
|
-
},
|
144
|
-
|
145
|
-
//Center list
|
146
|
-
onUpdate: function (opts, obj) {
|
147
|
-
if (this.list) {
|
148
|
-
this.list.stop(true).animate({
|
149
|
-
'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))
|
150
|
-
}, 150);
|
151
|
-
}
|
152
|
-
},
|
153
|
-
|
154
|
-
beforeClose: function () {
|
155
|
-
if (this.wrap) {
|
156
|
-
this.wrap.remove();
|
157
|
-
}
|
158
|
-
|
159
|
-
this.wrap = null;
|
160
|
-
this.list = null;
|
161
|
-
this.width = 0;
|
162
|
-
}
|
163
|
-
}
|
164
|
-
|
165
|
-
}(jQuery));
|