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