j1-template 2021.2.7 → 2021.2.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/themes/j1/blocks/footer/boxes/contacts_box.proc +1 -1
- data/_includes/themes/j1/layouts/content_generator_article_navigator.html +2 -2
- data/_includes/themes/j1/layouts/content_generator_blog_archive.html +2 -2
- data/_includes/themes/j1/layouts/content_generator_news_panel_posts.html +2 -2
- data/_includes/themes/j1/modules/boards/news_pin_board.html +10 -10
- data/_includes/themes/j1/modules/connectors/translators/google-translator.html +20 -4
- data/_includes/themes/j1/modules/navigator/generator.html +6 -6
- data/_includes/themes/j1/procedures/posts/collate_calendar.proc +3 -3
- data/_includes/themes/j1/procedures/posts/create_series_header.proc +1 -1
- data/_includes/themes/j1/procedures/posts/pager.proc +1 -1
- data/assets/data/gallery_customizer.html +1 -1
- data/assets/data/menu.html +17 -17
- data/assets/data/mmenu.html +17 -17
- data/assets/data/quicklinks.html +3 -3
- data/assets/data/translator.html +2 -2
- data/assets/themes/j1/adapter/js/cookieConsent.js +4 -3
- data/assets/themes/j1/adapter/js/j1.js +1 -1
- data/assets/themes/j1/adapter/js/translator.js +84 -125
- data/assets/themes/j1/modules/backstretch/js/backstretch.min.js +1 -1
- data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.full.js +1 -1
- data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.js +1 -1
- data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.min.js +1 -1
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +70 -10
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js +1 -1
- data/assets/themes/j1/modules/datatables/js/datatables.js +1 -1
- data/assets/themes/j1/modules/datatables/js/datatables.min.js +5 -5
- data/assets/themes/j1/modules/iframeResizer/examples/frame.absolute.html +3 -3
- data/assets/themes/j1/modules/iframeResizer/examples/frame.content.html +6 -6
- data/assets/themes/j1/modules/iframeResizer/examples/frame.tolerance.html +2 -2
- data/assets/themes/j1/modules/iframeResizer/js/client/iframeResizer.contentWindow.js +1 -1
- data/assets/themes/j1/modules/iframeResizer/js/client/iframeResizer.contentWindow.min.js +1 -1
- data/assets/themes/j1/modules/iframeResizer/js/resizer.min.js +1 -1
- data/assets/themes/j1/modules/j1Deepl/js/j1deepl.min.js +1 -1
- data/assets/themes/j1/modules/j1Scroll/js/j1scroll.js +1 -1
- data/assets/themes/j1/modules/j1Scroll/js/j1scroll.min.js +1 -1
- data/assets/themes/j1/modules/jquery/js/jquery.js +2 -2
- data/assets/themes/j1/modules/jquery/js/jquery.min.js +1 -1
- data/assets/themes/j1/modules/jquery/js/jqueryUI.js +7 -7
- data/assets/themes/j1/modules/jquery/js/jqueryUI.min.js +3 -3
- data/assets/themes/j1/modules/lightGallery/js/core/j1/lightgallery-x.min.js +1 -1
- data/assets/themes/j1/modules/lightGallery/js/core/lightgallery.min.js +1 -1
- data/assets/themes/j1/modules/lightGallery/js/modules/j1/j1-video.min.js +1 -1
- data/assets/themes/j1/modules/lightGallery/js/modules/j1/j1-x-video.min.js +1 -1
- data/assets/themes/j1/modules/lightbox/js/lightbox.js +1 -1
- data/assets/themes/j1/modules/lightbox/js/lightbox.min.js +1 -1
- data/assets/themes/j1/modules/lunrSearch/js/mustache.js +1 -1
- data/assets/themes/j1/modules/lunrSearch/js/mustache.min.js +1 -1
- data/assets/themes/j1/modules/lunrSearch/js/uri.js +1 -1
- data/assets/themes/j1/modules/lunrSearch/js/uri.min.js +7 -7
- data/assets/themes/j1/modules/mdiPreviewer/js/previewer.min.js +1 -1
- data/assets/themes/j1/modules/mdilPreviewer/js/previewer.min.js +1 -1
- data/assets/themes/j1/modules/themeSwitcher/js/switcher.js +1 -1
- data/assets/themes/j1/modules/themeSwitcher/js/switcher.min.js +1 -1
- data/assets/themes/j1/modules/translator/js/translator.js +14 -9
- data/assets/themes/j1/modules/translator/js/translator.min.js +1 -1
- data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.js +1 -1
- data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.min.js +1 -1
- data/assets/themes/j1/modules/videojs/js/video.min.js +2 -2
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_data/apps/carousel.yml +4 -4
- data/lib/starter_web/_data/blocks/defaults/footer.yml +2 -2
- data/lib/starter_web/_data/blocks/footer.yml +2 -2
- data/lib/starter_web/_data/modules/attics.yml +1 -1
- data/lib/starter_web/_data/modules/cookieconsent.yml +0 -1
- data/lib/starter_web/_data/modules/defaults/attics.yml +2 -2
- data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +3 -1
- data/lib/starter_web/_data/modules/defaults/translator.yml +2 -1
- data/lib/starter_web/_data/modules/translator.yml +3 -0
- data/lib/starter_web/_includes/attributes.asciidoc +1 -1
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +2 -2
- data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +3 -3
- data/lib/starter_web/pages/public/previewer/preview_bootstrap_theme.adoc +85 -85
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +2 -2
@@ -28,6 +28,7 @@ regenerate: true
|
|
28
28
|
{% comment %} Set config files
|
29
29
|
-------------------------------------------------------------------------------- {% endcomment %}
|
30
30
|
{% assign environment = site.environment %}
|
31
|
+
{% assign contentLanguage = site.language %}
|
31
32
|
{% assign blocks = site.data.blocks %}
|
32
33
|
{% assign modules = site.data.modules %}
|
33
34
|
{% assign template_config = site.data.j1_config %}
|
@@ -38,10 +39,9 @@ regenerate: true
|
|
38
39
|
{% assign translator_settings = modules.translator.settings %}
|
39
40
|
{% assign tracking_enabled = template_config.analytics.enabled %}
|
40
41
|
|
41
|
-
|
42
42
|
{% comment %} Set config options
|
43
43
|
-------------------------------------------------------------------------------- {% endcomment %}
|
44
|
-
{% assign translator_options
|
44
|
+
{% assign translator_options = translator_defaults | merge: translator_settings %}
|
45
45
|
|
46
46
|
{% assign production = false %}
|
47
47
|
{% if environment == 'prod' or environment == 'production' %}
|
@@ -87,7 +87,6 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
87
87
|
var user_translate = {};
|
88
88
|
var _this;
|
89
89
|
var $modal;
|
90
|
-
var domain;
|
91
90
|
var cookie_names;
|
92
91
|
var user_consent;
|
93
92
|
var logger;
|
@@ -118,16 +117,37 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
118
117
|
function setCookie(options /*cName, cValue, expDays*/) {
|
119
118
|
var defaults = {};
|
120
119
|
var settings;
|
120
|
+
var document_cookie;
|
121
|
+
var stringifiedAttributes = '';
|
121
122
|
|
122
123
|
defaults = {
|
123
124
|
name: '',
|
124
125
|
path: '/',
|
125
126
|
expires: 0,
|
126
|
-
domain: 'localhost'
|
127
|
+
domain: 'localhost',
|
128
|
+
samesite: 'Strict',
|
129
|
+
http_only: false,
|
130
|
+
secure: false
|
127
131
|
};
|
128
132
|
settings = $.extend(defaults, options);
|
129
133
|
|
130
|
-
|
134
|
+
stringifiedAttributes += '; ' + 'path=' + settings.path;
|
135
|
+
|
136
|
+
if (settings.expires > 0) {
|
137
|
+
date.setTime(date.getTime() + (settings.expires * 24 * 60 * 60 * 1000));
|
138
|
+
stringifiedAttributes += '; ' + 'expires=' + date.toUTCString();
|
139
|
+
}
|
140
|
+
|
141
|
+
stringifiedAttributes += '; ' + 'SameSite=' + settings.samesite;
|
142
|
+
|
143
|
+
if (settings.secure) {
|
144
|
+
stringifiedAttributes += '; ' + 'secure=' + settings.secure;
|
145
|
+
}
|
146
|
+
|
147
|
+
// document_cookie = settings.name + '=' + settings.data + '; path=' + settings.path + '; ' + 'domain=' + settings.domain + '; ' + 'SameSite=' + settings.samesite + ';';
|
148
|
+
document_cookie = settings.name + '=' + settings.data + stringifiedAttributes;
|
149
|
+
|
150
|
+
document.cookie = document_cookie;
|
131
151
|
};
|
132
152
|
|
133
153
|
// ---------------------------------------------------------------------------
|
@@ -149,6 +169,7 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
149
169
|
baseUrl = url.origin;
|
150
170
|
hostname = url.hostname;
|
151
171
|
domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
|
172
|
+
cookie_domain = (domain.includes('.')) ? '.' + domain : domain;
|
152
173
|
secure = (url.protocol.includes('https')) ? true : false;
|
153
174
|
modal_language = "{{site.language}}";
|
154
175
|
navigator_language = navigator.language || navigator.userLanguage; // userLanguage for MS IE compatibility
|
@@ -169,13 +190,7 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
169
190
|
'translationLanguage': translation_language,
|
170
191
|
};
|
171
192
|
|
172
|
-
//
|
173
|
-
if(domain !== 'localhost') {
|
174
|
-
cookie_domain = '.' + hostname;
|
175
|
-
} else {
|
176
|
-
cookie_domain = hostname;
|
177
|
-
}
|
178
|
-
|
193
|
+
// load|initialize user translate cookie
|
179
194
|
if (j1.existsCookie(cookie_names.user_translate)) {
|
180
195
|
user_translate = j1.readCookie(cookie_names.user_translate);
|
181
196
|
} else {
|
@@ -184,17 +199,11 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
184
199
|
name: cookie_names.user_translate,
|
185
200
|
data: user_translate,
|
186
201
|
samesite: 'Strict',
|
202
|
+
secure: secure,
|
187
203
|
expires: 365
|
188
204
|
});
|
189
205
|
}
|
190
206
|
|
191
|
-
// set domain used by cookies
|
192
|
-
if(domain !== 'localhost') {
|
193
|
-
cookie_domain = '.' + hostname;
|
194
|
-
} else {
|
195
|
-
cookie_domain = hostname;
|
196
|
-
}
|
197
|
-
|
198
207
|
// initialize state flag
|
199
208
|
_this.state = 'pending';
|
200
209
|
// _this.settings.languageList = '/assets/data/ms_select.json';
|
@@ -229,6 +238,7 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
229
238
|
logger.info('\n' + 'state: ' + _this.getState());
|
230
239
|
logger.info('\n' + 'module is being initialized');
|
231
240
|
|
241
|
+
// hide the google translate element if exists
|
232
242
|
if ($('google_translate_element')) {
|
233
243
|
$('google_translate_element').hide();
|
234
244
|
}
|
@@ -256,7 +266,8 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
256
266
|
name: cookie_names.user_translate,
|
257
267
|
data: user_translate,
|
258
268
|
samesite: 'Strict',
|
259
|
-
secure: secure
|
269
|
+
secure: secure,
|
270
|
+
expires: 365
|
260
271
|
});
|
261
272
|
|
262
273
|
j1.translator = new Translator({
|
@@ -274,15 +285,21 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
274
285
|
postSelectionCallback: moduleOptions.google.postSelectionCallback
|
275
286
|
});
|
276
287
|
|
288
|
+
// enable|disable translation (after callback)
|
277
289
|
if (user_consent.analysis && user_consent.personalization && user_translate.translationEnabled) {
|
278
290
|
if (moduleOptions.translatorName === 'google') {
|
279
291
|
head.appendChild(script);
|
280
|
-
$('google_translate_element')
|
292
|
+
if ($('google_translate_element')) {
|
293
|
+
$('google_translate_element').hide();
|
294
|
+
}
|
281
295
|
}
|
282
296
|
} else {
|
283
297
|
if (moduleOptions.translatorName === 'google') {
|
284
|
-
|
285
|
-
|
298
|
+
// remove all googtrans cookies that POTENTIALLY exists
|
299
|
+
Cookies.remove('googtrans', { domain: cookie_domain });
|
300
|
+
Cookies.remove('googtrans', { domain: hostname });
|
301
|
+
Cookies.remove('googtrans');
|
302
|
+
}
|
286
303
|
}
|
287
304
|
|
288
305
|
_this.setState('finished');
|
@@ -336,32 +353,35 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
336
353
|
return _this.state;
|
337
354
|
}, // END getState
|
338
355
|
|
356
|
+
// -------------------------------------------------------------------------
|
357
|
+
// postTranslateElementInit()
|
358
|
+
// ???
|
359
|
+
// -------------------------------------------------------------------------
|
360
|
+
postTranslateElementInit: function (response) {
|
361
|
+
// code for post processing
|
362
|
+
logger.info('\n' + 'postTranslateElementInit entered');
|
363
|
+
logger.info('\n' + response.T.Dh);
|
364
|
+
return;
|
365
|
+
}, // END postTranslateElementInit
|
366
|
+
|
339
367
|
// -------------------------------------------------------------------------
|
340
368
|
// cbGoogle()
|
341
|
-
// Called by the translator CORE module after the user
|
342
|
-
//
|
369
|
+
// Called by the translator CORE module after the user made the
|
370
|
+
// selection for a translation|language
|
343
371
|
// -------------------------------------------------------------------------
|
344
372
|
cbGoogle: function () {
|
373
|
+
var logger = log4javascript.getLogger('j1.adapter.translator.cbGoogle');
|
345
374
|
var cookie_names = j1.getCookieNames();
|
346
375
|
var user_state = j1.readCookie(cookie_names.user_state);
|
347
376
|
var user_consent = j1.readCookie(cookie_names.user_consent);
|
348
377
|
var user_translate = j1.readCookie(cookie_names.user_translate);
|
349
|
-
var msDropdownLang = document.getElementById('dropdownJSON').msDropdown;
|
350
378
|
var msDropdown = document.getElementById('dropdownJSON').msDropdown;
|
351
|
-
var
|
352
|
-
var script;
|
379
|
+
var selectedTranslationLanguage;
|
353
380
|
var srcLang;
|
354
381
|
var destLang;
|
355
382
|
var transCode;
|
356
|
-
var cookie_written;
|
357
|
-
var htmlScriptElement;
|
358
|
-
var selectedTranslationLanguage;
|
359
383
|
|
360
|
-
|
361
|
-
logger.debug('\n' + 'current values from cookie consent: ' + JSON.stringify(user_consent));
|
362
|
-
logger.debug('\n' + 'current values from user state: ' + JSON.stringify(user_state));
|
363
|
-
|
364
|
-
selectedTranslationLanguage = msDropdownLang.value;
|
384
|
+
selectedTranslationLanguage = msDropdown.value;
|
365
385
|
logger.info('\n' + 'selected translation language: ' + selectedTranslationLanguage);
|
366
386
|
|
367
387
|
// update cookie consent settings
|
@@ -373,109 +393,48 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
373
393
|
data: user_consent,
|
374
394
|
samesite: 'Strict',
|
375
395
|
secure: secure,
|
376
|
-
expires:
|
396
|
+
expires: 365
|
377
397
|
});
|
378
398
|
|
379
|
-
//
|
380
|
-
if (
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
script.src = '//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit';
|
385
|
-
htmlScriptElement = document.getElementById(script.id);
|
386
|
-
|
387
|
-
if (user_translate.translationEnabled && moduleOptions.translatorName === 'google') {
|
388
|
-
head.appendChild(script);
|
389
|
-
|
390
|
-
if ($('google_translate_element')) {
|
391
|
-
$('google_translate_element').hide();
|
392
|
-
}
|
393
|
-
|
394
|
-
// set transCode settings
|
395
|
-
srcLang = "{{site.language}}";
|
396
|
-
destLang = translation_language;
|
397
|
-
transCode = '/' + srcLang + '/' + selectedTranslationLanguage;
|
398
|
-
|
399
|
-
// set the transCode cookie (googtrans)
|
400
|
-
setCookie({
|
401
|
-
name: 'googtrans',
|
402
|
-
data: transCode
|
403
|
-
});
|
404
|
-
|
405
|
-
// enable google transalate button if not visible
|
406
|
-
if ($('#quickLinksTranslateButton').css('display') === 'none') {
|
407
|
-
$('#quickLinksTranslateButton').css('display', 'block');
|
408
|
-
}
|
409
|
-
} else { // translation NOT allowed
|
410
|
-
|
411
|
-
// update cookie user translate settings
|
412
|
-
user_translate.translationEnabled = false;
|
413
|
-
cookie_written = j1.writeCookie({
|
414
|
-
name: cookie_names.user_translate,
|
415
|
-
data: user_translate,
|
416
|
-
samesite: 'Strict',
|
417
|
-
secure: secure
|
418
|
-
});
|
419
|
-
|
420
|
-
// stop translation for all pages
|
421
|
-
if (htmlScriptElement) { htmlScriptElement.remove(); }
|
422
|
-
j1.removeCookie({name: 'googtrans', domain: cookie_domain});
|
423
|
-
}
|
424
|
-
}
|
425
|
-
|
426
|
-
// translation NOT allowed
|
427
|
-
if (!user_translate.analysis || !user_translate.personalization) {
|
428
|
-
head = document.getElementsByTagName('head')[0];
|
429
|
-
script = document.createElement('script');
|
430
|
-
script.id = 'google-translate';
|
431
|
-
|
432
|
-
// update cookie consent settings
|
433
|
-
user_consent.analysis = user_translate.analysis;
|
434
|
-
user_consent.personalization = user_translate.personalization;
|
435
|
-
cookie_written = j1.writeCookie({
|
436
|
-
name: cookie_names.user_consent,
|
437
|
-
data: user_consent,
|
438
|
-
samesite: 'Strict',
|
439
|
-
secure: secure,
|
440
|
-
expires: 0
|
441
|
-
});
|
442
|
-
|
443
|
-
// update cookie user translate settings
|
444
|
-
user_translate.translationEnabled = false;
|
445
|
-
cookie_written = j1.writeCookie({
|
446
|
-
name: cookie_names.user_translate,
|
447
|
-
data: user_consent,
|
448
|
-
samesite: 'Strict',
|
449
|
-
secure: secure,
|
450
|
-
expires: 0
|
451
|
-
});
|
452
|
-
|
453
|
-
// stop translation for all pages
|
454
|
-
if (htmlScriptElement) { htmlScriptElement.remove(); }
|
455
|
-
j1.removeCookie({name: 'googtrans', domain: cookie_domain});
|
399
|
+
// set content language
|
400
|
+
if (moduleOptions.contentLanguage === 'auto') {
|
401
|
+
srcLang = '{{contentLanguage}}';
|
402
|
+
} else {
|
403
|
+
srcLang = moduleOptions.contentLanguage;
|
456
404
|
}
|
457
405
|
|
458
|
-
|
459
|
-
|
406
|
+
// translation language MUST be DIFFERENT from content language
|
407
|
+
if (srcLang == selectedTranslationLanguage ) {
|
408
|
+
Cookies.remove('googtrans', { domain: cookie_domain });
|
409
|
+
Cookies.remove('googtrans', { domain: hostname });
|
410
|
+
Cookies.remove('googtrans');
|
460
411
|
location.reload(true);
|
461
412
|
}
|
462
413
|
|
463
|
-
//
|
464
|
-
|
465
|
-
|
466
|
-
|
414
|
+
// set transCode settings
|
415
|
+
destLang = translation_language;
|
416
|
+
transCode = '/' + srcLang + '/' + selectedTranslationLanguage;
|
417
|
+
|
418
|
+
// remove all googtrans cookies that POTENTIALLY exists
|
419
|
+
Cookies.remove('googtrans', { domain: cookie_domain });
|
420
|
+
Cookies.remove('googtrans', { domain: hostname });
|
421
|
+
Cookies.remove('googtrans');
|
467
422
|
|
423
|
+
// write the googtrans cookie w/o DOMAIN!
|
424
|
+
Cookies.set('googtrans', transCode);
|
425
|
+
|
426
|
+
// reload current page (skip cache)
|
427
|
+
location.reload(true);
|
468
428
|
}, // END cbGoogle
|
469
429
|
|
470
430
|
// -------------------------------------------------------------------------
|
471
431
|
// cbDeepl()
|
472
|
-
// Called by the translator CORE module after the user
|
473
|
-
//
|
432
|
+
// Called by the translator CORE module after the user made the
|
433
|
+
// selection for a translation language
|
474
434
|
// -------------------------------------------------------------------------
|
475
435
|
cbDeepl: function () {
|
476
|
-
|
477
|
-
// code for post
|
478
|
-
|
436
|
+
var logger = log4javascript.getLogger('j1.adapter.translator.cbDeepl');
|
437
|
+
// code for post processing
|
479
438
|
} // END cbDeepl
|
480
439
|
|
481
440
|
}; // END return
|
@@ -17,4 +17,4 @@
|
|
17
17
|
# See: https://github.com/danielgindi/jquery-backstretch
|
18
18
|
# -----------------------------------------------------------------------------
|
19
19
|
*/
|
20
|
-
(function(d,i,e){var n=/^.*(youtu\.be\/|youtube\.com\/v\/|youtube\.com\/embed\/|youtube\.com\/watch\?v=|youtube\.com\/watch\?.*\&v=)([^#\&\?]*).*/i;var l;d.fn.backstretch=function(v,x){var w=arguments;if(d(i).scrollTop()===0){i.scrollTo(0,0)}var u;this.each(function(A){var C=d(this),B=C.data("backstretch");if(B){if(typeof w[0]==="string"&&typeof B[w[0]]==="function"){var z=B[w[0]].apply(B,Array.prototype.slice.call(w,1));if(z===B){z=e}if(z!==e){u=u||[];u[A]=z}return}x=d.extend(B.options,x);if(B.hasOwnProperty("destroy")){B.destroy(true)}}if(!v||(v&&v.length===0)){var y=C.css("background-image");if(y&&y!=="none"){v=[{url:C.css("backgroundImage").replace(/url\(|\)|"|'/g,"")}]}else{d.error("No images were supplied for Backstretch, or element must have a CSS-defined background image.")}}B=new b(this,v,x||{});C.data("backstretch",B)});return u?u.length===1?u[0]:u:this};d.backstretch=function(u,v){return d("body").backstretch(u,v).data("backstretch")};d.expr[":"].backstretch=function(u){return d(u).data("backstretch")!==e};d.fn.backstretch.defaults={debug:false,duration:5000,transition:"fade",transitionDuration:0,animateFirst:true,alignX:0.5,alignY:0.5,paused:false,start:0,preload:2,preloadSize:1,resolutionRefreshRate:2500,resolutionChangeRatioThreshold:0.1};var j={wrap:{left:0,top:0,overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",zIndex:-999999},itemWrapper:{position:"absolute",display:"none",margin:0,padding:0,border:"none",width:"100%",height:"100%",zIndex:-999999},item:{position:"absolute",margin:0,padding:0,border:"none",width:"100%",height:"100%",maxWidth:"none"}};var f=(function(){var v=function(x){for(var A=1;A<x.length;A++){var z=x[A],y=A;while(x[y-1]&&parseInt(x[y-1].width,10)>parseInt(z.width,10)){x[y]=x[y-1];--y}x[y]=z}return x};var w=function(D,H,C){var F=i.devicePixelRatio||1;var B=k();var E=p();var y=(H>D)?"portrait":(D>H?"landscape":"square");var x=0;var G;for(var A=0,z;A<C.length;A++){z=C[A];if(typeof z==="string"){z=C[A]={url:z}}if(z.pixelRatio&&z.pixelRatio!=="auto"&&parseFloat(z.pixelRatio)!==F){continue}if(z.deviceOrientation&&z.deviceOrientation!==B){continue}if(z.windowOrientation&&z.windowOrientation!==B){continue}if(z.orientation&&z.orientation!==y){continue}x=A;G=D;if(z.pixelRatio==="auto"){D*=F}if(z.width>=G){break}}return C[Math.min(A,x)]};var u=function(x,z){if(typeof x==="string"){x=x.replace(/{{(width|height)}}/g,z)}else{if(x instanceof Array){for(var y=0;y<x.length;y++){if(x[y].src){x[y].src=u(x[y].src,z)}else{x[y]=u(x[y],z)}}}}return x};return function(E,A){var B=E.width(),F=E.height();var x=[];var C=function(G,H){if(H==="width"){return B}if(H==="height"){return F}return G};for(var y=0;y<A.length;y++){if(d.isArray(A[y])){A[y]=v(A[y]);var z=w(B,F,A[y]);x.push(z)}else{if(typeof A[y]==="string"){A[y]={url:A[y]}}var D=d.extend({},A[y]);D.url=u(D.url,C);x.push(D)}}return x}})();var t=function(u){return n.test(u.url)||u.isVideo};var m=(function(u,x,y,z,C){var v=[];var B=function(E){for(var D=0;D<v.length;D++){if(v[D].src===E.src){return v[D]}}v.push(E);return E};var w=function(D,F,E){if(typeof F==="function"){F.call(D,E)}};return function A(D,I,J,K,L){if(typeof D==="undefined"){return}if(!d.isArray(D)){D=[D]}if(arguments.length<5&&typeof arguments[arguments.length-1]==="function"){L=arguments[arguments.length-1]}I=(typeof I==="function"||!I)?0:I;J=(typeof J==="function"||!J||J<0)?D.length:Math.min(J,D.length);K=(typeof K==="function"||!K)?1:K;if(I>=D.length){I=0;J=0}if(K<0){K=J}K=Math.min(K,J);var H=D.slice(I+K,J-K);D=D.slice(I,K);J=D.length;if(!J){w(D,L,true);return}var M=0;var G=function(){M++;if(M!==J){return}w(D,L,!H);A(H,0,0,K,L)};var E;for(var F=0;F<D.length;F++){if(t(D[F])){continue}else{E=new Image();E.src=D[F].url;E=B(E);if(E.complete){G()}else{d(E).on("load error",G)}}}}})();var g=function(u){var w=[];for(var v=0;v<u.length;v++){if(typeof u[v]==="string"){w.push({url:u[v]})}else{if(d.isArray(u[v])){w.push(g(u[v]))}else{w.push(r(u[v]))}}}return w};var r=function(u,v){if(u.centeredX||u.centeredY){if(i.console&&i.console.log){i.console.log("jquery.backstretch: `centeredX`/`centeredY` is deprecated, please use `alignX`/`alignY`")}if(u.centeredX){u.alignX=0.5}if(u.centeredY){u.alignY=0.5}}if(u.speed!==e){if(i.console&&i.console.log){i.console.log("jquery.backstretch: `speed` is deprecated, please use `transitionDuration`")}u.transitionDuration=u.speed;u.transition="fade"}if(u.resolutionChangeRatioTreshold!==e){i.console.log("jquery.backstretch: `treshold` is a typo!");u.resolutionChangeRatioThreshold=u.resolutionChangeRatioTreshold}if(u.fadeFirst!==e){u.animateFirst=u.fadeFirst}if(u.fade!==e){u.transitionDuration=u.fade;u.transition="fade"}if(u.scale){u.scale=a(u.scale)}return s(u)};var s=function(u,v){if(u.alignX==="left"){u.alignX=0}else{if(u.alignX==="center"){u.alignX=0.5}else{if(u.alignX==="right"){u.alignX=1}else{if(u.alignX!==e||v){u.alignX=parseFloat(u.alignX);if(isNaN(u.alignX)){u.alignX=0.5}}}}}if(u.alignY==="top"){u.alignY=0}else{if(u.alignY==="center"){u.alignY=0.5}else{if(u.alignY==="bottom"){u.alignY=1}else{if(u.alignX!==e||v){u.alignY=parseFloat(u.alignY);if(isNaN(u.alignY)){u.alignY=0.5}}}}}return u};var o={cover:"cover",fit:"fit","fit-smaller":"fit-smaller",fill:"fill"};function a(u){if(!o.hasOwnProperty(u)){return"cover"}return u}var b=function(w,v,y){this.options=d.extend({},d.fn.backstretch.defaults,y||{});this.firstShow=true;r(this.options,true);this.images=g(d.isArray(v)?v:[v]);if(this.options.paused){this.paused=true}if(this.options.start>=this.images.length){this.options.start=this.images.length-1}if(this.options.start<0){this.options.start=0}this.isBody=w===document.body;var z=d(i);this.$container=d(w);this.$root=this.isBody?q?z:d(document):this.$container;this.originalImages=this.images;this.images=f(this.options.alwaysTestWindowResolution?z:this.$root,this.originalImages);m(this.images,this.options.start||0,this.options.preload||1);var x=this.$container.children(".backstretch").first();this.$wrap=x.length?x:d('<div class="backstretch"></div>').css(this.options.bypassCss?{}:j.wrap).appendTo(this.$container);if(!this.options.bypassCss){if(!this.isBody){var u=this.$container.css("position"),A=this.$container.css("zIndex");this.$container.css({position:u==="static"?"relative":u,zIndex:A==="auto"?0:A});this.$wrap.css({zIndex:-999998})}this.$wrap.css({position:this.isBody&&q?"fixed":"absolute"})}this.index=this.options.start;this.show(this.index);z.on("resize.backstretch",d.proxy(this.resize,this)).on("orientationchange.backstretch",d.proxy(function(){if(this.isBody&&i.pageYOffset===0){i.scrollTo(0,1);this.resize()}},this))};var c=function(D){var y=D.transition||"fade";if(typeof y==="string"&&y.indexOf("|")>-1){y=y.split("|")}if(y instanceof Array){y=y[Math.round(Math.random()*(y.length-1))]}var u=D["new"];var B=D.old?D.old:d([]);switch(y.toString().toLowerCase()){default:case"fade":u.fadeIn({duration:D.duration,complete:D.complete,easing:D.easing||e});break;case"fadeinout":case"fade_in_out":var w=function(){u.fadeIn({duration:D.duration/2,complete:D.complete,easing:D.easing||e})};if(B.length){B.fadeOut({duration:D.duration/2,complete:w,easing:D.easing||e})}else{w()}break;case"pushleft":case"push_left":case"pushright":case"push_right":case"pushup":case"push_up":case"pushdown":case"push_down":case"coverleft":case"cover_left":case"coverright":case"cover_right":case"coverup":case"cover_up":case"coverdown":case"cover_down":var x=y.match(/^(cover|push)_?(.*)$/);var v=x[2]==="left"?"right":x[2]==="right"?"left":x[2]==="down"?"top":x[2]==="up"?"bottom":"right";var C={display:""},A={};C[v]="-100%";A[v]=0;u.css(C).animate(A,{duration:D.duration,complete:function(){u.css(v,"");D.complete.apply(this,arguments)},easing:D.easing||e});if(x[1]==="push"&&B.length){var z={};z[v]="100%";B.animate(z,{duration:D.duration,complete:function(){B.css("display","none")},easing:D.easing||e})}break}};b.prototype={resize:function(){try{var O=log4javascript.getLogger("j1.core.attic");var P=this.options.alwaysTestWindowResolution?d(i):this.$root;var v=P.width();var z=P.height();var K=v/(this._lastResizeContainerWidth||0);var M=z/(this._lastResizeContainerHeight||0);var F=this.options.resolutionChangeRatioThreshold||0;if((v!==this._lastResizeContainerWidth||z!==this._lastResizeContainerHeight)&&((Math.abs(K-1)>=F||isNaN(K))||(Math.abs(M-1)>=F||isNaN(M)))){this._lastResizeContainerWidth=v;this._lastResizeContainerHeight=z;this.images=f(P,this.originalImages);if(this.options.preload){m(this.images,(this.index+1)%this.images.length,this.options.preload)}if(this.images.length===1&&this._currentImage.url!==this.images[0].url){var D=this;clearTimeout(D._selectAnotherResolutionTimeout);D._selectAnotherResolutionTimeout=setTimeout(function(){D.show(0)},this.options.resolutionRefreshRate)}}var C={left:0,top:0,right:"auto",bottom:"auto"},E=this.isBody?this.$root.width():this.$root.innerWidth(),A=this.isBody?(i.innerHeight?i.innerHeight:this.$root.height()):this.$root.innerHeight(),x=this.$itemWrapper.data("width"),w=this.$itemWrapper.data("height"),B=(x/w)||1,L=this._currentImage.alignX===e?this.options.alignX:this._currentImage.alignX,I=this._currentImage.alignY===e?this.options.alignY:this._currentImage.alignY,N=a(this._currentImage.scale||this.options.scale);if(this.options.debug){l="resize: boxHeight x boxWidth: "+A+" x "+E;O.debug(l)}if(A==0||E==0){l="Kacke am Schuh";O.warn(l)}var J,H;if(N==="fit"||N==="fit-smaller"){J=x;H=w;if(J>E||H>A||N==="fit-smaller"){var u=E/A;if(u>B){J=Math.floor(A*B);H=A}else{if(u<B){J=E;H=Math.floor(E/B)}else{J=E;H=A}}}}else{if(N==="fill"){J=E;H=A}else{J=Math.max(A*B,E);H=Math.max(J/B,A)}}C.top=-(H-A)*I;C.left=-(J-E)*L;C.width=J;C.height=H;if(!this.options.bypassCss){this.$wrap.css({width:E,height:A}).find(">.backstretch-item").not(".deleteable").each(function(){var Q=d(this);Q.find("img,video,iframe").css(C)})}var G=d.Event("backstretch.resize",{relatedTarget:this.$container[0]});this.$container.trigger(G,this)}catch(y){l="resize: jadams, IE7 hack to let it fail gracefully: "+y;O.warn(l)}return this},show:function(B,y){var C=log4javascript.getLogger("j1.core.attic");if(Math.abs(B)>this.images.length-1){return}var z=this,A=z.$wrap.find(">.backstretch-item").addClass("deleteable"),w=z.videoWrapper,x={relatedTarget:z.$container[0]};z.$container.trigger(d.Event("backstretch.before",x),[z,B]);this.index=B;var v=z.images[B];clearTimeout(z._cycleTimeout);delete z.videoWrapper;var u=t(v);if(u){z.videoWrapper=new h(v);z.$item=z.videoWrapper.$video.css("pointer-events","none")}else{z.$item=d("<img />")}z.$itemWrapper=d('<div class="backstretch-item">').append(z.$item);if(this.options.bypassCss){z.$itemWrapper.css({display:"none"})}else{z.$itemWrapper.css(j.itemWrapper);z.$item.css(j.item)}z.$item.bind(u?"canplay":"load",function(M){var P=d(this),L=P.parent(),S=L.data("options");if(y){S=d.extend({},S,y)}var Q=this.naturalWidth||this.videoWidth||this.width,R=this.naturalHeight||this.videoHeight||this.height;L.data("width",Q).data("height",R);var E=function(T){return S[T]!==e?S[T]:z.options[T]};var N=E("transition");var F=E("transitionEasing");var G=E("transitionDuration");var I=function(){if(w){w.stop();w.destroy()}A.remove();if(!z.paused&&z.images.length>1){z.cycle()}if(!z.options.bypassCss&&!z.isBody){}d(["after","show"]).each(function(){z.$container.trigger(d.Event("backstretch."+this,x),[z,B])});if(u){z.videoWrapper.play()}};if((z.firstShow&&!z.options.animateFirst)||!G||!N){L.show();I()}else{c({"new":L,old:A,transition:N,duration:G,easing:F,complete:I})}z.firstShow=false;var O=this.naturalWidth||this.videoWidth||this.width;var K=this.naturalHeight||this.videoHeight||this.height;var D="show: imageHeight x imageWidth: "+K+" x "+O;if(z.options.debug){C.debug(D)}var J="#"+z.$container["0"]["id"];var H=setInterval(function(){if(d(J).is(":visible")){clearInterval(H);C.info("container visible on id: "+J);z.resize()}},50)});z.$itemWrapper.appendTo(z.$wrap);z.$item.attr("alt",v.alt||"");z.$itemWrapper.data("options",v);if(!u){z.$item.attr("src",v.url)}z._currentImage=v;return z},current:function(){return this.index},next:function(){var u=Array.prototype.slice.call(arguments,0);u.unshift(this.index<this.images.length-1?this.index+1:0);return this.show.apply(this,u)},prev:function(){var u=Array.prototype.slice.call(arguments,0);u.unshift(this.index===0?this.images.length-1:this.index-1);return this.show.apply(this,u)},pause:function(){this.paused=true;if(this.videoWrapper){this.videoWrapper.pause()}return this},resume:function(){this.paused=false;if(this.videoWrapper){this.videoWrapper.play()}this.cycle();return this},cycle:function(){if(this.images.length>1){clearTimeout(this._cycleTimeout);var v=(this._currentImage&&this._currentImage.duration)||this.options.duration;var u=t(this._currentImage);var x=function(){this.$item.off(".cycle");if(!this.paused){this.next()}};if(u){if(!this._currentImage.loop){var w=0;this.$item.on("playing.cycle",function(){var y=d(this).data("player");clearTimeout(w);if(typeof y!="undefined"){w=setTimeout(function(){y.pause();y.$video.trigger("ended")},(y.getDuration()-y.getCurrentTime())*1000)}}).on("ended.cycle",function(){clearTimeout(w)})}this.$item.on("error.cycle initerror.cycle",d.proxy(x,this))}if(u&&!this._currentImage.duration){this.$item.on("ended.cycle",d.proxy(x,this))}else{this._cycleTimeout=setTimeout(d.proxy(x,this),v)}}return this},destroy:function(u){d(i).off("resize.backstretch orientationchange.backstretch");if(this.videoWrapper){this.videoWrapper.destroy()}clearTimeout(this._cycleTimeout);if(!u){this.$wrap.remove()}this.$container.removeData("backstretch")}};var h=function(){this.init.apply(this,arguments)};h.prototype.init=function(C){var y=this;var w;var z=function(){y.$video=w;y.video=w[0]};var A="video";if(!(C.url instanceof Array)&&n.test(C.url)){A="youtube"}y.type=A;if(A==="youtube"){h.loadYoutubeAPI();y.ytId=C.url.match(n)[2];var u="https://www.youtube.com/embed/"+y.ytId+"?rel=0&autoplay=0&showinfo=0&controls=0&modestbranding=1&cc_load_policy=0&disablekb=1&iv_load_policy=3&loop=0&enablejsapi=1&origin="+encodeURIComponent(i.location.origin);y.__ytStartMuted=!!C.mute||C.mute===e;w=d("<iframe />").attr({src_to_load:u}).css({border:0,margin:0,padding:0}).data("player",y);if(C.loop){w.on("ended.loop",function(){if(!y.__manuallyStopped){y.play()}})}y.ytReady=false;z();if(i.YT){y._initYoutube();w.trigger("initsuccess")}else{d(i).one("youtube_api_load",function(){y._initYoutube();w.trigger("initsuccess")})}}else{w=d("<video>").prop("autoplay",false).prop("controls",false).prop("loop",!!C.loop).prop("muted",!!C.mute||C.mute===e).prop("preload","auto").prop("poster",C.poster||"");var v=(C.url instanceof Array)?C.url:[C.url];for(var x=0;x<v.length;x++){var B=v[x];if(typeof(B)==="string"){B={src:B}}d("<source>").attr("src",B.src).attr("type",B.type||null).appendTo(w)}if(!w[0].canPlayType||!v.length){w.trigger("initerror")}else{w.trigger("initsuccess")}z()}};h.prototype._initYoutube=function(){var x=this;var w=i.YT;x.$video.attr("src",x.$video.attr("src_to_load")).removeAttr("src_to_load");var u=!!x.$video[0].parentNode;if(!u){var y=d("<div>").css("display","none !important").appendTo(document.body);x.$video.appendTo(y)}var v=new w.Player(x.video,{events:{onReady:function(){if(x.__ytStartMuted){v.mute()}if(!u){if(x.$video[0].parentNode===y[0]){x.$video.detach()}y.remove()}x.ytReady=true;x._updateYoutubeSize();x.$video.trigger("canplay")},onStateChange:function(z){switch(z.data){case w.PlayerState.PLAYING:x.$video.trigger("playing");break;case w.PlayerState.ENDED:x.$video.trigger("ended");break;case w.PlayerState.PAUSED:x.$video.trigger("pause");break;case w.PlayerState.BUFFERING:x.$video.trigger("waiting");break;case w.PlayerState.CUED:x.$video.trigger("canplay");break}},onPlaybackQualityChange:function(){x._updateYoutubeSize();x.$video.trigger("resize")},onError:function(z){x.hasError=true;x.$video.trigger({type:"error",error:z})}}});x.ytPlayer=v;return x};h.prototype._updateYoutubeSize=function(){var u=this;switch(u.ytPlayer.getPlaybackQuality()||"medium"){case"small":u.video.videoWidth=426;u.video.videoHeight=240;break;case"medium":u.video.videoWidth=640;u.video.videoHeight=360;break;default:case"large":u.video.videoWidth=854;u.video.videoHeight=480;break;case"hd720":u.video.videoWidth=1280;u.video.videoHeight=720;break;case"hd1080":u.video.videoWidth=1920;u.video.videoHeight=1080;break;case"highres":u.video.videoWidth=2560;u.video.videoHeight=1440;break}return u};h.prototype.play=function(){var u=this;u.__manuallyStopped=false;if(u.type==="youtube"){if(u.ytReady){u.$video.trigger("play");u.ytPlayer.playVideo()}}else{u.video.play()}return u};h.prototype.pause=function(){var u=this;u.__manuallyStopped=false;if(u.type==="youtube"){if(u.ytReady){u.ytPlayer.pauseVideo()}}else{u.video.pause()}return u};h.prototype.stop=function(){var u=this;u.__manuallyStopped=true;if(u.type==="youtube"){if(u.ytReady){u.ytPlayer.pauseVideo();u.ytPlayer.seekTo(0)}}else{u.video.pause();u.video.currentTime=0}return u};h.prototype.destroy=function(){var u=this;if(u.ytPlayer){u.ytPlayer.destroy()}u.$video.remove();return u};h.prototype.getCurrentTime=function(v){var u=this;if(u.type==="youtube"){if(u.ytReady){return u.ytPlayer.getCurrentTime()}}else{return u.video.currentTime}return 0};h.prototype.setCurrentTime=function(v){var u=this;if(u.type==="youtube"){if(u.ytReady){u.ytPlayer.seekTo(v,true)}}else{u.video.currentTime=v}return u};h.prototype.getDuration=function(){var u=this;if(u.type==="youtube"){if(u.ytReady){return u.ytPlayer.getDuration()}}else{return u.video.duration}return 0};h.loadYoutubeAPI=function(){if(i.YT){return}if(!d("script[src*=www\\.youtube\\.com\\/iframe_api]").length){d('<script type="text/javascript" src="https://www.youtube.com/iframe_api">').appendTo("body")}var u=setInterval(function(){if(i.YT&&i.YT.loaded){d(i).trigger("youtube_api_load");clearTimeout(u)}},50)};var k=function(){if("matchMedia" in i){if(i.matchMedia("(orientation: portrait)").matches){return"portrait"}else{if(i.matchMedia("(orientation: landscape)").matches){return"landscape"}}}if(screen.height>screen.width){return"portrait"}return"landscape"};var p=function(){if(i.innerHeight>i.innerWidth){return"portrait"}if(i.innerWidth>i.innerHeight){return"landscape"}return"square"};var q=(function(){var v=navigator.userAgent,x=navigator.platform,D=v.match(/AppleWebKit\/([0-9]+)/),B=!!D&&D[1],w=v.match(/Fennec\/([0-9]+)/),z=!!w&&w[1],A=v.match(/Opera Mobi\/([0-9]+)/),u=!!A&&A[1],y=v.match(/MSIE ([0-9]+)/),C=!!y&&y[1];return !(((x.indexOf("iPhone")>-1||x.indexOf("iPad")>-1||x.indexOf("iPod")>-1)&&B&&B<534)||(i.operamini&&({}).toString.call(i.operamini)==="[object OperaMini]")||(A&&u<7458)||(v.indexOf("Android")>-1&&B&&B<533)||(z&&z<6)||("palmGetResource" in i&&B&&B<534)||(v.indexOf("MeeGo")>-1&&v.indexOf("NokiaBrowser/8.5.0")>-1)||(C&&C<=6))}())}(jQuery,window));
|
20
|
+
(function(d,i,e){var n=/^.*(youtu\.be\/|youtube\.com\/v\/|youtube\.com\/embed\/|youtube\.com\/watch\?v=|youtube\.com\/watch\?.*\&v=)([^#\&\?]*).*/i;var l;d.fn.backstretch=function(v,x){var w=arguments;if(d(i).scrollTop()===0){i.scrollTo(0,0)}var u;this.each(function(A){var C=d(this),B=C.data("backstretch");if(B){if(typeof w[0]==="string"&&typeof B[w[0]]==="function"){var z=B[w[0]].apply(B,Array.prototype.slice.call(w,1));if(z===B){z=e}if(z!==e){u=u||[];u[A]=z}return}x=d.extend(B.options,x);if(B.hasOwnProperty("destroy")){B.destroy(true)}}if(!v||(v&&v.length===0)){var y=C.css("background-image");if(y&&y!=="none"){v=[{url:C.css("backgroundImage").replace(/url\(|\)|"|'/g,"")}]}else{d.error("No images were supplied for Backstretch, or element must have a CSS-defined background image.")}}B=new b(this,v,x||{});C.data("backstretch",B)});return u?u.length===1?u[0]:u:this};d.backstretch=function(u,v){return d("body").backstretch(u,v).data("backstretch")};d.expr[":"].backstretch=function(u){return d(u).data("backstretch")!==e};d.fn.backstretch.defaults={debug:false,duration:5000,transition:"fade",transitionDuration:0,animateFirst:true,alignX:0.5,alignY:0.5,paused:false,start:0,preload:2,preloadSize:1,resolutionRefreshRate:2500,resolutionChangeRatioThreshold:0.1};var j={wrap:{left:0,top:0,overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",zIndex:-999999},itemWrapper:{position:"absolute",display:"none",margin:0,padding:0,border:"none",width:"100%",height:"100%",zIndex:-999999},item:{position:"absolute",margin:0,padding:0,border:"none",width:"100%",height:"100%",maxWidth:"none"}};var f=(function(){var v=function(x){for(var A=1;A<x.length;A++){var z=x[A],y=A;while(x[y-1]&&parseInt(x[y-1].width,10)>parseInt(z.width,10)){x[y]=x[y-1];--y}x[y]=z}return x};var w=function(D,H,C){var F=i.devicePixelRatio||1;var B=k();var E=p();var y=(H>D)?"portrait":(D>H?"landscape":"square");var x=0;var G;for(var A=0,z;A<C.length;A++){z=C[A];if(typeof z==="string"){z=C[A]={url:z}}if(z.pixelRatio&&z.pixelRatio!=="auto"&&parseFloat(z.pixelRatio)!==F){continue}if(z.deviceOrientation&&z.deviceOrientation!==B){continue}if(z.windowOrientation&&z.windowOrientation!==B){continue}if(z.orientation&&z.orientation!==y){continue}x=A;G=D;if(z.pixelRatio==="auto"){D*=F}if(z.width>=G){break}}return C[Math.min(A,x)]};var u=function(x,z){if(typeof x==="string"){x=x.replace(/{{(width|height)}}/g,z)}else{if(x instanceof Array){for(var y=0;y<x.length;y++){if(x[y].src){x[y].src=u(x[y].src,z)}else{x[y]=u(x[y],z)}}}}return x};return function(E,A){var B=E.width(),F=E.height();var x=[];var C=function(G,H){if(H==="width"){return B}if(H==="height"){return F}return G};for(var y=0;y<A.length;y++){if(d.isArray(A[y])){A[y]=v(A[y]);var z=w(B,F,A[y]);x.push(z)}else{if(typeof A[y]==="string"){A[y]={url:A[y]}}var D=d.extend({},A[y]);D.url=u(D.url,C);x.push(D)}}return x}})();var t=function(u){return n.test(u.url)||u.isVideo};var m=(function(u,x,y,z,C){var v=[];var B=function(E){for(var D=0;D<v.length;D++){if(v[D].src===E.src){return v[D]}}v.push(E);return E};var w=function(D,F,E){if(typeof F==="function"){F.call(D,E)}};return function A(D,I,J,K,L){if(typeof D==="undefined"){return}if(!d.isArray(D)){D=[D]}if(arguments.length<5&&typeof arguments[arguments.length-1]==="function"){L=arguments[arguments.length-1]}I=(typeof I==="function"||!I)?0:I;J=(typeof J==="function"||!J||J<0)?D.length:Math.min(J,D.length);K=(typeof K==="function"||!K)?1:K;if(I>=D.length){I=0;J=0}if(K<0){K=J}K=Math.min(K,J);var H=D.slice(I+K,J-K);D=D.slice(I,K);J=D.length;if(!J){w(D,L,true);return}var M=0;var G=function(){M++;if(M!==J){return}w(D,L,!H);A(H,0,0,K,L)};var E;for(var F=0;F<D.length;F++){if(t(D[F])){continue}else{E=new Image();E.src=D[F].url;E=B(E);if(E.complete){G()}else{d(E).on("load error",G)}}}}})();var g=function(u){var w=[];for(var v=0;v<u.length;v++){if(typeof u[v]==="string"){w.push({url:u[v]})}else{if(d.isArray(u[v])){w.push(g(u[v]))}else{w.push(r(u[v]))}}}return w};var r=function(u,v){if(u.centeredX||u.centeredY){if(i.console&&i.console.log){i.console.log("jquery.backstretch: `centeredX`/`centeredY` is deprecated, please use `alignX`/`alignY`")}if(u.centeredX){u.alignX=0.5}if(u.centeredY){u.alignY=0.5}}if(u.speed!==e){if(i.console&&i.console.log){i.console.log("jquery.backstretch: `speed` is deprecated, please use `transitionDuration`")}u.transitionDuration=u.speed;u.transition="fade"}if(u.resolutionChangeRatioTreshold!==e){i.console.log("jquery.backstretch: `treshold` is a typo!");u.resolutionChangeRatioThreshold=u.resolutionChangeRatioTreshold}if(u.fadeFirst!==e){u.animateFirst=u.fadeFirst}if(u.fade!==e){u.transitionDuration=u.fade;u.transition="fade"}if(u.scale){u.scale=a(u.scale)}return s(u)};var s=function(u,v){if(u.alignX==="left"){u.alignX=0}else{if(u.alignX==="center"){u.alignX=0.5}else{if(u.alignX==="right"){u.alignX=1}else{if(u.alignX!==e||v){u.alignX=parseFloat(u.alignX);if(isNaN(u.alignX)){u.alignX=0.5}}}}}if(u.alignY==="top"){u.alignY=0}else{if(u.alignY==="center"){u.alignY=0.5}else{if(u.alignY==="bottom"){u.alignY=1}else{if(u.alignX!==e||v){u.alignY=parseFloat(u.alignY);if(isNaN(u.alignY)){u.alignY=0.5}}}}}return u};var o={cover:"cover",fit:"fit","fit-smaller":"fit-smaller",fill:"fill"};function a(u){if(!o.hasOwnProperty(u)){return"cover"}return u}var b=function(w,v,y){this.options=d.extend({},d.fn.backstretch.defaults,y||{});this.firstShow=true;r(this.options,true);this.images=g(d.isArray(v)?v:[v]);if(this.options.paused){this.paused=true}if(this.options.start>=this.images.length){this.options.start=this.images.length-1}if(this.options.start<0){this.options.start=0}this.isBody=w===document.body;var z=d(i);this.$container=d(w);this.$root=this.isBody?q?z:d(document):this.$container;this.originalImages=this.images;this.images=f(this.options.alwaysTestWindowResolution?z:this.$root,this.originalImages);m(this.images,this.options.start||0,this.options.preload||1);var x=this.$container.children(".backstretch").first();this.$wrap=x.length?x:d('<div class="backstretch"></div>').css(this.options.bypassCss?{}:j.wrap).appendTo(this.$container);if(!this.options.bypassCss){if(!this.isBody){var u=this.$container.css("position"),A=this.$container.css("zIndex");this.$container.css({position:u==="static"?"relative":u,zIndex:A==="auto"?0:A});this.$wrap.css({zIndex:-999998})}this.$wrap.css({position:this.isBody&&q?"fixed":"absolute"})}this.index=this.options.start;this.show(this.index);z.on("resize.backstretch",d.proxy(this.resize,this)).on("orientationchange.backstretch",d.proxy(function(){if(this.isBody&&i.pageYOffset===0){i.scrollTo(0,1);this.resize()}},this))};var c=function(D){var y=D.transition||"fade";if(typeof y==="string"&&y.indexOf("|")>-1){y=y.split("|")}if(y instanceof Array){y=y[Math.round(Math.random()*(y.length-1))]}var u=D["new"];var B=D.old?D.old:d([]);switch(y.toString().toLowerCase()){default:case"fade":u.fadeIn({duration:D.duration,complete:D.complete,easing:D.easing||e});break;case"fadeinout":case"fade_in_out":var w=function(){u.fadeIn({duration:D.duration/2,complete:D.complete,easing:D.easing||e})};if(B.length){B.fadeOut({duration:D.duration/2,complete:w,easing:D.easing||e})}else{w()}break;case"pushleft":case"push_left":case"pushright":case"push_right":case"pushup":case"push_up":case"pushdown":case"push_down":case"coverleft":case"cover_left":case"coverright":case"cover_right":case"coverup":case"cover_up":case"coverdown":case"cover_down":var x=y.match(/^(cover|push)_?(.*)$/);var v=x[2]==="left"?"right":x[2]==="right"?"left":x[2]==="down"?"top":x[2]==="up"?"bottom":"right";var C={display:""},A={};C[v]="-100%";A[v]=0;u.css(C).animate(A,{duration:D.duration,complete:function(){u.css(v,"");D.complete.apply(this,arguments)},easing:D.easing||e});if(x[1]==="push"&&B.length){var z={};z[v]="100%";B.animate(z,{duration:D.duration,complete:function(){B.css("display","none")},easing:D.easing||e})}break}};b.prototype={resize:function(){try{var O=log4javascript.getLogger("j1.core.attic");var P=this.options.alwaysTestWindowResolution?d(i):this.$root;var v=P.width();var z=P.height();var K=v/(this._lastResizeContainerWidth||0);var M=z/(this._lastResizeContainerHeight||0);var F=this.options.resolutionChangeRatioThreshold||0;if((v!==this._lastResizeContainerWidth||z!==this._lastResizeContainerHeight)&&((Math.abs(K-1)>=F||isNaN(K))||(Math.abs(M-1)>=F||isNaN(M)))){this._lastResizeContainerWidth=v;this._lastResizeContainerHeight=z;this.images=f(P,this.originalImages);if(this.options.preload){m(this.images,(this.index+1)%this.images.length,this.options.preload)}if(this.images.length===1&&this._currentImage.url!==this.images[0].url){var D=this;clearTimeout(D._selectAnotherResolutionTimeout);D._selectAnotherResolutionTimeout=setTimeout(function(){D.show(0)},this.options.resolutionRefreshRate)}}var C={left:0,top:0,right:"auto",bottom:"auto"},E=this.isBody?this.$root.width():this.$root.innerWidth(),A=this.isBody?(i.innerHeight?i.innerHeight:this.$root.height()):this.$root.innerHeight(),x=this.$itemWrapper.data("width"),w=this.$itemWrapper.data("height"),B=(x/w)||1,L=this._currentImage.alignX===e?this.options.alignX:this._currentImage.alignX,I=this._currentImage.alignY===e?this.options.alignY:this._currentImage.alignY,N=a(this._currentImage.scale||this.options.scale);if(this.options.debug){l="resize: boxHeight x boxWidth: "+A+" x "+E;O.debug(l)}if(A==0||E==0){l="Kacke am Schuh";O.warn(l)}var J,H;if(N==="fit"||N==="fit-smaller"){J=x;H=w;if(J>E||H>A||N==="fit-smaller"){var u=E/A;if(u>B){J=Math.floor(A*B);H=A}else{if(u<B){J=E;H=Math.floor(E/B)}else{J=E;H=A}}}}else{if(N==="fill"){J=E;H=A}else{J=Math.max(A*B,E);H=Math.max(J/B,A)}}C.top=-(H-A)*I;C.left=-(J-E)*L;C.width=J;C.height=H;if(!this.options.bypassCss){this.$wrap.css({width:E,height:A}).find(">.backstretch-item").not(".deleteable").each(function(){var Q=d(this);Q.find("img,video,iframe").css(C)})}var G=d.Event("backstretch.resize",{relatedTarget:this.$container[0]});this.$container.trigger(G,this)}catch(y){l="resize: jadams, IE7 hack to let it fail gracefully: "+y;O.warn(l)}return this},show:function(B,y){var C=log4javascript.getLogger("j1.core.attic");if(Math.abs(B)>this.images.length-1){return}var z=this,A=z.$wrap.find(">.backstretch-item").addClass("deleteable"),w=z.videoWrapper,x={relatedTarget:z.$container[0]};z.$container.trigger(d.Event("backstretch.before",x),[z,B]);this.index=B;var v=z.images[B];clearTimeout(z._cycleTimeout);delete z.videoWrapper;var u=t(v);if(u){z.videoWrapper=new h(v);z.$item=z.videoWrapper.$video.css("pointer-events","none")}else{z.$item=d("<img />")}z.$itemWrapper=d('<div class="backstretch-item">').append(z.$item);if(this.options.bypassCss){z.$itemWrapper.css({display:"none"})}else{z.$itemWrapper.css(j.itemWrapper);z.$item.css(j.item)}z.$item.bind(u?"canplay":"load",function(M){var P=d(this),L=P.parent(),S=L.data("options");if(y){S=d.extend({},S,y)}var Q=this.naturalWidth||this.videoWidth||this.width,R=this.naturalHeight||this.videoHeight||this.height;L.data("width",Q).data("height",R);var E=function(T){return S[T]!==e?S[T]:z.options[T]};var N=E("transition");var F=E("transitionEasing");var G=E("transitionDuration");var I=function(){if(w){w.stop();w.destroy()}A.remove();if(!z.paused&&z.images.length>1){z.cycle()}if(!z.options.bypassCss&&!z.isBody){}d(["after","show"]).each(function(){z.$container.trigger(d.Event("backstretch."+this,x),[z,B])});if(u){z.videoWrapper.play()}};if((z.firstShow&&!z.options.animateFirst)||!G||!N){L.show();I()}else{c({"new":L,old:A,transition:N,duration:G,easing:F,complete:I})}z.firstShow=false;var O=this.naturalWidth||this.videoWidth||this.width;var K=this.naturalHeight||this.videoHeight||this.height;var D="show: imageHeight x imageWidth: "+K+" x "+O;if(z.options.debug){C.debug(D)}var J="#void"+z.$container["0"]["id"];var H=setInterval(function(){if(d(J).is(":visible")){clearInterval(H);C.info("container visible on id: "+J);z.resize()}},50)});z.$itemWrapper.appendTo(z.$wrap);z.$item.attr("alt",v.alt||"");z.$itemWrapper.data("options",v);if(!u){z.$item.attr("src",v.url)}z._currentImage=v;return z},current:function(){return this.index},next:function(){var u=Array.prototype.slice.call(arguments,0);u.unshift(this.index<this.images.length-1?this.index+1:0);return this.show.apply(this,u)},prev:function(){var u=Array.prototype.slice.call(arguments,0);u.unshift(this.index===0?this.images.length-1:this.index-1);return this.show.apply(this,u)},pause:function(){this.paused=true;if(this.videoWrapper){this.videoWrapper.pause()}return this},resume:function(){this.paused=false;if(this.videoWrapper){this.videoWrapper.play()}this.cycle();return this},cycle:function(){if(this.images.length>1){clearTimeout(this._cycleTimeout);var v=(this._currentImage&&this._currentImage.duration)||this.options.duration;var u=t(this._currentImage);var x=function(){this.$item.off(".cycle");if(!this.paused){this.next()}};if(u){if(!this._currentImage.loop){var w=0;this.$item.on("playing.cycle",function(){var y=d(this).data("player");clearTimeout(w);if(typeof y!="undefined"){w=setTimeout(function(){y.pause();y.$video.trigger("ended")},(y.getDuration()-y.getCurrentTime())*1000)}}).on("ended.cycle",function(){clearTimeout(w)})}this.$item.on("error.cycle initerror.cycle",d.proxy(x,this))}if(u&&!this._currentImage.duration){this.$item.on("ended.cycle",d.proxy(x,this))}else{this._cycleTimeout=setTimeout(d.proxy(x,this),v)}}return this},destroy:function(u){d(i).off("resize.backstretch orientationchange.backstretch");if(this.videoWrapper){this.videoWrapper.destroy()}clearTimeout(this._cycleTimeout);if(!u){this.$wrap.remove()}this.$container.removeData("backstretch")}};var h=function(){this.init.apply(this,arguments)};h.prototype.init=function(C){var y=this;var w;var z=function(){y.$video=w;y.video=w[0]};var A="video";if(!(C.url instanceof Array)&&n.test(C.url)){A="youtube"}y.type=A;if(A==="youtube"){h.loadYoutubeAPI();y.ytId=C.url.match(n)[2];var u="https://www.youtube.com/embed/"+y.ytId+"?rel=0&autoplay=0&showinfo=0&controls=0&modestbranding=1&cc_load_policy=0&disablekb=1&iv_load_policy=3&loop=0&enablejsapi=1&origin="+encodeURIComponent(i.location.origin);y.__ytStartMuted=!!C.mute||C.mute===e;w=d("<iframe />").attr({src_to_load:u}).css({border:0,margin:0,padding:0}).data("player",y);if(C.loop){w.on("ended.loop",function(){if(!y.__manuallyStopped){y.play()}})}y.ytReady=false;z();if(i.YT){y._initYoutube();w.trigger("initsuccess")}else{d(i).one("youtube_api_load",function(){y._initYoutube();w.trigger("initsuccess")})}}else{w=d("<video>").prop("autoplay",false).prop("controls",false).prop("loop",!!C.loop).prop("muted",!!C.mute||C.mute===e).prop("preload","auto").prop("poster",C.poster||"");var v=(C.url instanceof Array)?C.url:[C.url];for(var x=0;x<v.length;x++){var B=v[x];if(typeof(B)==="string"){B={src:B}}d("<source>").attr("src",B.src).attr("type",B.type||null).appendTo(w)}if(!w[0].canPlayType||!v.length){w.trigger("initerror")}else{w.trigger("initsuccess")}z()}};h.prototype._initYoutube=function(){var x=this;var w=i.YT;x.$video.attr("src",x.$video.attr("src_to_load")).removeAttr("src_to_load");var u=!!x.$video[0].parentNode;if(!u){var y=d("<div>").css("display","none !important").appendTo(document.body);x.$video.appendTo(y)}var v=new w.Player(x.video,{events:{onReady:function(){if(x.__ytStartMuted){v.mute()}if(!u){if(x.$video[0].parentNode===y[0]){x.$video.detach()}y.remove()}x.ytReady=true;x._updateYoutubeSize();x.$video.trigger("canplay")},onStateChange:function(z){switch(z.data){case w.PlayerState.PLAYING:x.$video.trigger("playing");break;case w.PlayerState.ENDED:x.$video.trigger("ended");break;case w.PlayerState.PAUSED:x.$video.trigger("pause");break;case w.PlayerState.BUFFERING:x.$video.trigger("waiting");break;case w.PlayerState.CUED:x.$video.trigger("canplay");break}},onPlaybackQualityChange:function(){x._updateYoutubeSize();x.$video.trigger("resize")},onError:function(z){x.hasError=true;x.$video.trigger({type:"error",error:z})}}});x.ytPlayer=v;return x};h.prototype._updateYoutubeSize=function(){var u=this;switch(u.ytPlayer.getPlaybackQuality()||"medium"){case"small":u.video.videoWidth=426;u.video.videoHeight=240;break;case"medium":u.video.videoWidth=640;u.video.videoHeight=360;break;default:case"large":u.video.videoWidth=854;u.video.videoHeight=480;break;case"hd720":u.video.videoWidth=1280;u.video.videoHeight=720;break;case"hd1080":u.video.videoWidth=1920;u.video.videoHeight=1080;break;case"highres":u.video.videoWidth=2560;u.video.videoHeight=1440;break}return u};h.prototype.play=function(){var u=this;u.__manuallyStopped=false;if(u.type==="youtube"){if(u.ytReady){u.$video.trigger("play");u.ytPlayer.playVideo()}}else{u.video.play()}return u};h.prototype.pause=function(){var u=this;u.__manuallyStopped=false;if(u.type==="youtube"){if(u.ytReady){u.ytPlayer.pauseVideo()}}else{u.video.pause()}return u};h.prototype.stop=function(){var u=this;u.__manuallyStopped=true;if(u.type==="youtube"){if(u.ytReady){u.ytPlayer.pauseVideo();u.ytPlayer.seekTo(0)}}else{u.video.pause();u.video.currentTime=0}return u};h.prototype.destroy=function(){var u=this;if(u.ytPlayer){u.ytPlayer.destroy()}u.$video.remove();return u};h.prototype.getCurrentTime=function(v){var u=this;if(u.type==="youtube"){if(u.ytReady){return u.ytPlayer.getCurrentTime()}}else{return u.video.currentTime}return 0};h.prototype.setCurrentTime=function(v){var u=this;if(u.type==="youtube"){if(u.ytReady){u.ytPlayer.seekTo(v,true)}}else{u.video.currentTime=v}return u};h.prototype.getDuration=function(){var u=this;if(u.type==="youtube"){if(u.ytReady){return u.ytPlayer.getDuration()}}else{return u.video.duration}return 0};h.loadYoutubeAPI=function(){if(i.YT){return}if(!d("script[src*=www\\.youtube\\.com\\/iframe_api]").length){d('<script type="text/javascript" src="https://www.youtube.com/iframe_api">').appendTo("body")}var u=setInterval(function(){if(i.YT&&i.YT.loaded){d(i).trigger("youtube_api_load");clearTimeout(u)}},50)};var k=function(){if("matchMedia" in i){if(i.matchMedia("(orientation: portrait)").matches){return"portrait"}else{if(i.matchMedia("(orientation: landscape)").matches){return"landscape"}}}if(screen.height>screen.width){return"portrait"}return"landscape"};var p=function(){if(i.innerHeight>i.innerWidth){return"portrait"}if(i.innerWidth>i.innerHeight){return"landscape"}return"square"};var q=(function(){var v=navigator.userAgent,x=navigator.platform,D=v.match(/AppleWebKit\/([0-9]+)/),B=!!D&&D[1],w=v.match(/Fennec\/([0-9]+)/),z=!!w&&w[1],A=v.match(/Opera Mobi\/([0-9]+)/),u=!!A&&A[1],y=v.match(/MSIE ([0-9]+)/),C=!!y&&y[1];return !(((x.indexOf("iPhone")>-1||x.indexOf("iPad")>-1||x.indexOf("iPod")>-1)&&B&&B<534)||(i.operamini&&({}).toString.call(i.operamini)==="[object OperaMini]")||(A&&u<7458)||(v.indexOf("Android")>-1&&B&&B<533)||(z&&z<6)||("palmGetResource" in i&&B&&B<534)||(v.indexOf("MeeGo")>-1&&v.indexOf("NokiaBrowser/8.5.0")>-1)||(C&&C<=6))}())}(jQuery,window));
|
@@ -6119,7 +6119,7 @@
|
|
6119
6119
|
var _this;
|
6120
6120
|
|
6121
6121
|
_this = _BaseLayout.call(this, $element, $.extend(true, {}, Default, config)) || this;
|
6122
|
-
_this.$toggles = $("[data-toggle=\"drawer\"][href=\"#" + _this.$element[0].id + "\"], [data-toggle=\"drawer\"][data-target=\"#" + _this.$element[0].id + "\"]");
|
6122
|
+
_this.$toggles = $("[data-toggle=\"drawer\"][href=\"#void" + _this.$element[0].id + "\"], [data-toggle=\"drawer\"][data-target=\"#void" + _this.$element[0].id + "\"]");
|
6123
6123
|
|
6124
6124
|
_this._addAria(); // click or escape on the backdrop closes the drawer
|
6125
6125
|
|
@@ -6119,7 +6119,7 @@
|
|
6119
6119
|
var _this;
|
6120
6120
|
|
6121
6121
|
_this = _BaseLayout.call(this, $element, $.extend(true, {}, Default, config)) || this;
|
6122
|
-
_this.$toggles = $("[data-toggle=\"drawer\"][href=\"#" + _this.$element[0].id + "\"], [data-toggle=\"drawer\"][data-target=\"#" + _this.$element[0].id + "\"]");
|
6122
|
+
_this.$toggles = $("[data-toggle=\"drawer\"][href=\"#void" + _this.$element[0].id + "\"], [data-toggle=\"drawer\"][data-target=\"#void" + _this.$element[0].id + "\"]");
|
6123
6123
|
|
6124
6124
|
_this._addAria(); // click or escape on the backdrop closes the drawer
|
6125
6125
|
|