1/******************************************************************************* 2 Filename : shared.lib.js 3 4 Created : 08.07.2014 5 Created by : Michael Hagi 6 7 Last Updated : 08.07.2014 8 Updated by : Michael Hagi 9 10 Comments : Verschiedene global genutzte JS-Funktionen 11*******************************************************************************/ 12 13 14/******************************************************************************* 15 Filename : shared.lib.js 16 17 Created : 08.07.2014 18 Created by : Michael Hagi 19 20 Last Updated : 08.07.2014 21 Updated by : Michael Hagi 22 23 Comments : Verschiedene global genutzte JS-Funktionen 24*******************************************************************************/ 25 26 27/* 28 BESTAETIGUNGSDIALOG MIT WEITERLEITUNG 29 Ausgabemeldung anzeigen und bei Bestaetigung auf url weiterleiten 30 @param: msg = Ausgabemeldung/Hinweis 31 @param: url = Pfad/URI 32*/ 33 34function fns_confirmMessage(msg,url) { 35 if (url && msg) { 36 tmp = confirm(msg); 37 if (tmp == true) { 38 location.replace(url); 39 } 40 } 41} 42 43function fns_confirmMessageAsync(msg,url,imgID) { 44 if (url && msg) { 45 tmp = confirm(msg); 46 if (tmp == true) { 47 48 $.ajax({
49 url: url, 50 type: 'GET', 51 success: function(res) { 52 $('.'+ imgID ).hide(); 53 } 54 }); 55 56 } 57 } 58} 59 60/* 61 DECODEEMAIL 62 Entschluesselt mit fns_base64 codierte Werte (E-Mail-Adressen). Schutz vor Spam-Bots 63 @param: base64string 64 @param: option = link|blank (leer) 65 @call: <a href="javascript:fns_base64_decodeEmail('base64string','option');"><?php echo base64_decode('base64string-from-php');?></a> 66*/ 67 68function fns_base64_decodeEmail(base64string,option) { 69 /* --- Entschluesselung des gelieferten Strings --- */ 70 decodedValue = fns_base64.decode(base64string); 71 /* --- Search & Replace (at) to @ um E-Mails wirklich versenden zu koennen --- */ 72 Search = new Array("(at)"); 73 Replace = new Array ("@"); 74 if (option == "link") 75 { 76 for (var i = 0; i <= Search.length-1; i++) 77 { 78 for (var j = 0; j <= decodedValue.length; j++) 79 { 80 decodedValue = decodedValue.replace(Search[i],Replace[i]); 81 } 82 } 83 location.href='mailto:' + decodedValue; 84 } 85 else 86 { 87 return decodedValue; 88 } 89} 90 91function fns_decodeM(name,subject,body,domain) { 92 loc = 'mailto:' + name + '@' + domain + '?subject=' + subject; 93 if (body) { 94 loc = loc + '&body=' + body; 95 } 96 location.href = loc; 97} 98 99/* 100 fns_base64 ENCODE/DECODE 101 Verschluesselt in fns_base64 und entschluesselt fns_base64 102 @param: @call = encode|decode 103 @call: fns_base64.encode('Werte') | fns_base64.decode('Wert)' 104*/ 105 106var fns_base64 = { 107 108 // private property 109 _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", 110 111 // public method for encoding 112 encode : function (input) { 113 var output = ""; 114 var chr1, chr2, chr3, enc1, enc2, enc3, enc4; 115 var i = 0; 116 117 input = fns_base64._utf8_encode(input); 118 119 while (i < input.length) { 120 121 chr1 = input.charCodeAt(i++); 122 chr2 = input.charCodeAt(i++); 123 chr3 = input.charCodeAt(i++); 124 125 enc1 = chr1 >> 2; 126 enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); 127 enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); 128 enc4 = chr3 & 63; 129 130 if (isNaN(chr2)) { 131 enc3 = enc4 = 64; 132 } else if (isNaN(chr3)) { 133 enc4 = 64; 134 } 135 136 output = output + 137 this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + 138 this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); 139 140 } 141 142 return output; 143 }, 144 145 // public method for decoding 146 decode : function (input) { 147 var output = ""; 148 var chr1, chr2, chr3; 149 var enc1, enc2, enc3, enc4; 150 var i = 0; 151 152 input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); 153 154 while (i < input.length) { 155 156 enc1 = this._keyStr.indexOf(input.charAt(i++)); 157 enc2 = this._keyStr.indexOf(input.charAt(i++)); 158 enc3 = this._keyStr.indexOf(input.charAt(i++)); 159 enc4 = this._keyStr.indexOf(input.charAt(i++)); 160 161 chr1 = (enc1 << 2) | (enc2 >> 4); 162 chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); 163 chr3 = ((enc3 & 3) << 6) | enc4; 164 165 output = output + String.fromCharCode(chr1); 166 167 if (enc3 != 64) { 168 output = output + String.fromCharCode(chr2); 169 } 170 if (enc4 != 64) { 171 output = output + String.fromCharCode(chr3); 172 } 173 174 } 175 176 output = fns_base64._utf8_decode(output); 177 178 return output; 179 180 }, 181 182 // private method for UTF-8 encoding 183 _utf8_encode : function (string) { 184 string = string.replace(/\r\n/g,"\n"); 185 var utftext = ""; 186 187 for (var n = 0; n < string.length; n++) { 188 189 var c = string.charCodeAt(n); 190 191 if (c < 128) { 192 utftext += String.fromCharCode(c); 193 } 194 else if((c > 127) && (c < 2048)) { 195 utftext += String.fromCharCode((c >> 6) | 192); 196 utftext += String.fromCharCode((c & 63) | 128); 197 } 198 else { 199 utftext += String.fromCharCode((c >> 12) | 224); 200 utftext += String.fromCharCode(((c >> 6) & 63) | 128); 201 utftext += String.fromCharCode((c & 63) | 128); 202 } 203 204 } 205 206 return utftext; 207 }, 208 209 // private method for UTF-8 decoding 210 _utf8_decode : function (utftext) { 211 var string = ""; 212 var i = 0; 213 var c = c1 = c2 = 0; 214 215 while ( i < utftext.length ) { 216 217 c = utftext.charCodeAt(i); 218 219 if (c < 128) {
220 string += String.fromCharCode(c); 221 i++; 222 } 223 else if((c > 191) && (c < 224)) { 224 c2 = utftext.charCodeAt(i+1); 225 string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); 226 i += 2; 227 } 228 else { 229 c2 = utftext.charCodeAt(i+1); 230 c3 = utftext.charCodeAt(i+2); 231 string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); 232 i += 3; 233 } 234 235 } 236 237 return string; 238 } 239 240} 241 242fns_OpenPrintPreview = function(width, height, name){ 243 244 var name = name || 'printpreview'; 245 246 /* ANPASSUNG FÃR SOURCE PRETTY URLs */ 247 var url = ''; 248 if (/[0-9]+_.*/.test(location.href) && !/.php/.test(location.href)) { 249 url = location.href.replace(/#.*/, '') + '&viewmode=print'; 250 } else { 251 url = location.href.indexOf('?') == -1 ? location.href.replace(/#.*/, '') + '?viewmode=print' : location.href.replace(/#.*/, '') + '&viewmode=print'; 252 } 253 options = ',location=no,menubar=no,toolbar=no,resizable=yes,scrollbars=yes,status=no'; 254 255 wOpenPopupURL(url, width, height, name, options); 256}; 257 258 259wCssClassesToAddGlobal = {'#blockHeader #blockHeaderBefore #searchBox .searchBoxContainer .searchBoxElement .searchTerm' : ['wglSearchSuggest'], 'body' : ['wglAddScrollTop'], '.clickable' : ['wglClickable'], '.elementBox_var540' : ['wglAnimateAfterTime', 'isClosed'], '.elementContainerStandardColumns_var3366noSpace' : ['wAdjustsInnerItemIcons'], '.elementContainerStandardColumns_var6633noSpace' : ['wAdjustsInnerItemIcons'], '.elementSubmap_var0 li a' : ['next'], '.elementTabContainer_var0 .tabs' : ['wglCheckBreakChildren'], '.elementTable_var0 table th' : ['isDarkBackground'], '.elementSectionObjectNews .linkDetails' : ['next'], '.listDefaultCols_var2' : ['wglAdjustHeightMax'], '.listDefaultCols_var3' : ['wglAdjustHeightMax'], '.listDefaultCols_var4' : ['wglAdjustHeightMax'], '.listPictureGallery_var0 .listEntries .listEntryDescription' : ['text-sub'], '.listPictureGalleryPictureLightbox_var0.listPictureGallery_var20 .listEntries .listEntriesInner' : ['wglOverflowXTouch']}; 260wCssDataToAddGlobal = {'#blockHeader #blockHeaderMain #navigationMain > nav > div > ul > li span.navpointToggler' : ['ontoggle=closeSiblings'], '#blockHeader #blockHeaderMain #navigationMain > nav > div > ul' : ['adaptlayer=1', 'embedmode=', 'addnavid='], '#blockHeader #blockHeaderMain #navigationMain > nav > div > ul > li ul' : ['wislayer=1'], 'html' : ['widthnavigationmainmenumax=1200px', 'megadropdownopentype=click', 'navigationlayeropentype=click', 'offsetscrolledtop=96', 'offsetbottomchangescrollstatus=300'], '.elementAccordion > div.wglAccordion' : ['slide-duration=300', 'slide-easing=wEaseOut'], '.elementBox_var540' : ['classtoaddaftertime=isOpen', 'classtoremoveaftertime=isClosed'], '.elementLink > a, .elementObjectContactPerson .elementObjectContactPersonData .elementObjectContactPersonVcard > a' : ['scrollingauto=yes', 'scrollsmoothtotargetduration=400'], '.elementTabContainer_var0 .tabs' : ['targetbreakchildrenclass=closest(.elementTabContainer)'], '.elementText a, .elementObjectContactPerson .elementObjectContactPersonData .elementObjectContactPersonText a, .elementObjectContactPerson .elementObjectContactPersonData .elementObjectContactPersonLinks a, .elementObjectContactPerson .elementObjectContactPersonData .elementObjectContactPersonAddress a, .elementObjectContactPerson .elementObjectContactPersonData .elementObjectContactPersonDepartments a' : ['scrollingauto=yes', 'scrollsmoothtotargetduration=400']}; 261wCssEventsToAddGlobal = {'.elementLink > a, .elementObjectContactPerson .elementObjectContactPersonData .elementObjectContactPersonVcard > a' : ['onclick=wScrollSmoothToTarget'], '.elementText a, .elementObjectContactPerson .elementObjectContactPersonData .elementObjectContactPersonText a, .elementObjectContactPerson .elementObjectContactPersonData .elementObjectContactPersonLinks a, .elementObjectContactPerson .elementObjectContactPersonData .elementObjectContactPersonAddress a, .elementObjectContactPerson .elementObjectContactPersonData .elementObjectContactPersonDepartments a' : ['onclick=wScrollSmoothToTarget'], '.azNaviList a' : ['onclick=wScrollSmoothToTarget']}; 262wCssJQuery = {'#blockHeader #blockHeaderBefore #searchBox .searchBoxContainer .searchBoxElement .searchTerm' : {'jQuery' : 'jQuery(this).on(\'focus\', function(event){jQuery(this).parent().addClass(\'hasFocus\')});jQuery(this).on(\'blur\', function(event){jQuery(this).parent().removeClass(\'hasFocus\')})', 'event' : 'document.ready'}, '.linkButton, .listEntryElementLink_var20 a, .listLoaderMore >
262 a, .elementSectionObjectNews .linkDetails, .elementLink_var10 > a, .elementObjectContactPerson .elementObjectContactPersonData .elementObjectContactPersonVcard > a' : {'jQuery' : 'jQuery(this).parent().addClass(\'isInverseBackground\')', 'event' : 'document.ready'}, '.linkButtonWhite, .listDefaultLink_var41 .listEntryLink a' : {'jQuery' : 'jQuery(this).parent().addClass(\'isLightBackground\')', 'event' : 'document.ready'}, '.linkButtonGhostWhite, .listBannerSliderInfolayer_var40 .listEntry .listEntryInfoLayerInner .listEntryLink > *, .listBannerSliderInfolayer_var20 .listEntry .listEntryInfoLayerInner .listEntryLink > *, .listBannerSliderInfolayer_var10 .listEntry .listEntryInfoLayerInner .listEntryLink > *' : {'jQuery' : 'jQuery(this).parent().addClass(\'isDarkBackground\')', 'event' : 'document.ready'}, '.linkButtonImportant' : {'jQuery' : 'jQuery(this).parent().addClass(\'isInverseBackground\')', 'event' : 'document.ready'}, '.elementBox_var540' : {'jQuery' : 'if(document.cookie.indexOf(\'hasShownInfo\' + jQuery(this).attr(\'data-infoid\') + \'=1\') != -1){jQuery(this).attr(\'data-hasshownonce\', \'1\')};jQuery(this).prepend(\'<div class="boxInnerToggler"></div>\');if(jQuery(this).attr(\'data-timehideauto\')){var timeToHideAuto = jQuery(this).attr(\'data-timehideauto\') * 1000;var lastjQueryObject=jQuery(this);window.setTimeout(function(){lastjQueryObject.find(\'.boxInnerToggler\').trigger(\'click\')}, timeToHideAuto)};', 'event' : 'document.ready'}, '.elementBox_var540 .boxInnerToggler' : {'jQuery' : 'if(jQuery(this).parent().data(\'showonlyonce\')==\'1\'){document.cookie=\'hasShownInfo\' + jQuery(this).parent().attr(\'data-infoid\') + \'=1\'};jQuery(this).click(function(){jQuery(this).parent().toggleClass("isOpen isClosed");})', 'event' : 'document.ready'}, '.elementTabContainer_var223 .tabsOuter' : {'jQuery' : 'jQuery(this).prepend(\'<span class="tabOpener" onclick="jQuery(this).parent().toggleClass(\\\'tabOpenerOpen\\\')">Auswählen</span>\')', 'event' : 'document.ready'}, '.elementTabContainer_var223 .tabsOuter .tabs > .tab' : {'jQuery' : 'jQuery(this).on(\'click\', function(event){jQuery(this).parent().parent().removeClass(\'tabOpenerOpen\');jQuery(this).parent().parent().find(\'.tabOpener\').text(jQuery(this).text()).css(\'background-image\', jQuery(this).find(\'div\').css(\'background-image\'))})', 'event' : 'document.ready'}, '.elementTabContainer_var223 .tabsOuter .tabs > .tab.tabSelected' : {'jQuery' : 'jQuery(this).parent().parent().find(\'.tabOpener\').text(jQuery(this).text())', 'event' : 'document.ready'}, '.elementText ul > li > ul, .elementObjectContactPerson .elementObjectContactPersonData .elementObjectContactPersonText ul > li > ul, .elementObjectContactPerson .elementObjectContactPersonData .elementObjectContactPersonLinks ul > li > ul, .elementObjectContactPerson .elementObjectContactPersonData .elementObjectContactPersonAddress ul > li > ul, .elementObjectContactPerson .elementObjectContactPersonData .elementObjectContactPersonDepartments ul > li > ul' : {'jQuery' : 'jQuery(this).parent().addClass(\'hasList\')', 'event' : 'document.ready'}}; 263wMediaqueriesToAddGlobal = {'xl_min' : {}, 'xl_max' : {}, 'l_min' : {}, 'l_max' : {}, 'm_min' : {}, 'm_max' : {}, 's_min' : {}, 's_max' : {}, 'xs_min' : {}, 'xs_max' : {}}; 264/* 265//////////////////////////////////////////////////////////////// 266// 267// UI JavaScript Funktionen 268// 269// Weblication CMS 270// erstellt durch Scholl Communications AG, 77694 Kehl, www.scholl.de 271// erstellt mit Weblication Content Management System, www.weblication.de 272// 273//////////////////////////////////////////////////////////////// 274 275//////////////////////////////////////////////////////////////// 276// // 277// BITTE NICHT ANPASSEN! // 278// JS-Anpassungen können in der design.js // 279// durchgeführt werden. // 280// // 281//////////////////////////////////////////////////////////////// 282*/ 283 284/* 285//////////////////////////////////////////////////////////////// 286// 287// UI JavaScript Funktionen 288// 289// Weblication CMS 290// erstellt durch Scholl Communications AG, 77694 Kehl, www.scholl.de 291// erstellt mit Weblication Content Management System, www.weblication.de 292// 293//////////////////////////////////////////////////////////////// 294
295//////////////////////////////////////////////////////////////// 296// // 297// BITTE NICHT ANPASSEN! // 298// JS-Anpassungen können in der design.js // 299// durchgeführt werden. // 300// // 301//////////////////////////////////////////////////////////////// 302*/ 303 304wUiVersion = '1.1.162'; 305wAllowMinimize = true; 306 307if(typeof wUiTmp == 'undefined'){ 308 wUiTmp = {}; 309 if(typeof wUiTmp['wGlobalProjectPath'] == 'undefined'){ 310 var scriptTags = document.getElementsByTagName('script'); 311 try{ 312 for(i = 0; i < scriptTags.length; i++){ 313 if(scriptTags[i].getAttribute('src') && scriptTags[i].getAttribute('src').indexOf('/optimized/') != -1){ 314 wUiTmp['wGlobalProjectPath'] = scriptTags[i].getAttribute('src').replace(/^(\/[^\/]*)[^\?]*/, '$1').replace(/\?[\s\S]*$/, ''); 315 } 316 } 317 } 318 catch(e){} 319 } 320} 321 322wUiTmp['lastScrollTop'] = 0; 323wUiTmp['lang'] = typeof wUiTmp['lang'] == 'undefined' || wUiTmp['lang'] == '' ? jQuery('html').attr('lang') : wUiTmp['lang'] == '' ? wUiTmp['lang'] : 'de'; 324 325devicePixelRatio = window.devicePixelRatio || 1; 326hdLimitDpr = 2; 327wOffsetScrolledTopDefault = 0; 328wCssClassesToAddGlobal = typeof(wCssClassesToAddGlobal) != 'undefined' ? wCssClassesToAddGlobal : {}; 329wCssDataToAddGlobal = typeof(wCssDataToAddGlobal) != 'undefined' ? wCssDataToAddGlobal : {}; 330wCssEventsToAddGlobal = typeof(wCssEventsToAddGlobal) != 'undefined' ? wCssEventsToAddGlobal : {}; 331wCssJQuery = typeof(wCssJQuery) != 'undefined' ? wCssJQuery : {}; 332wCssDOM = typeof(wCssDOM) != 'undefined' ? wCssDOM : {}; 333wMediaqueriesToAddGlobal = typeof(wMediaqueriesToAddGlobal) != 'undefined' ? wMediaqueriesToAddGlobal : {}; 334wLightboxOpener = null; 335 336if(document.documentElement){ 337 document.documentElement.className = document.documentElement.className + (!/MSIE (6|7|8)/.test(navigator.appVersion) ? ' pagestatus-uiloaded' : ''); 338} 339 340handleObserveVisible = function(entries, observer){ 341 342 var entry = null, i = 0; 343 344 for(i = 0; i < entries.length; i++){ 345 entry = entries[i]; 346 var cE = jQuery(entry.target), timestamp = (new Date()).getTime(); 347 var show = false; 348 if(typeof wObserverOptions != 'undefined'){ 349 if(entry.isIntersecting){ 350 var ratioOfViewport = (entry.intersectionRect.height * entry.intersectionRect.width) / (window.innerWidth * window.innerHeight); 351 if(entry.intersectionRatio > 0.1 || ratioOfViewport > 0.1) show = true; 352 } 353 } 354 else { 355 var ratio = 0.1; 356 if(cE.height()/window.innerHeight > 2) ratio = 0.01; 357 if(entry.intersectionRatio > ratio) show = true; 358 } 359 360 if(show){ 361 if(cE.hasClass('wglAnimateIfVisible')){ 362 if(!cE.hasClass('isVisible')){ 363 cE.addClass('isVisibleOnce isVisible').removeClass('isInvisible'); 364 if(typeof(wOnAfterAnimateIfVisible) === 'function'){ 365 wOnAfterAnimateIfVisible(cE); 366 } 367 } 368 } 369 370 if(cE.data('doifbecomevisible') && !cE.data('isvisible') && !cE.data('lastbecomevisible') || timestamp - cE.data('lastbecomevisible') > 1000){ 371 cE.data('lastbecomevisible', (new Date()).getTime()); 372 cE.data('isvisible', true); 373 var event = document.createEvent('Event'); 374 var functionDoifbecomevisible = function(){ 375 eval(cE.data('doifbecomevisible')); 376 }; 377 functionDoifbecomevisible.call(cE.get(0)); 378 } 379 } 380 else{ 381 if(cE.hasClass('wglAnimateIfVisible')){ 382 if(cE.hasClass('isVisible')){ 383 cE.addClass('isInvisible').removeClass('isVisible'); 384 if(typeof(wOnAfterAnimateIfInvisible) === 'function'){ 385 wOnAfterAnimateIfInvisible(cE); 386 } 387 } 388 } 389 390 if(cE.data('doifbecomevisible')){ 391 cE.data('isvisible', false); 392 } 393 } 394 } 395}; 396 397handleObserveVisibleOnce = function(entries, observer){ 398 //console.log('handleObserveVisibleOnce'); 399 400 var entry = null, i = 0; 401 for(i = 0; i < entries.length; i++){ 402 entry = entries[i]; 403 if(entry.intersectionRatio > 0){ 404 var cE = jQuery(entry.target); 405 if(entry.target.nodeName == 'IMG'){ 406 wShowLazyLoadImage(cE); 407 } 408 else if(entry.target.nodeName == 'IFRAME'){ 409 wShowLazyLoadIframe(cE); 410 } 411 412 if(cE.data('doifbecomevisibleonce') && !cE.data('isvisible')){ 413 cE.data('lastbecomevisible', (new Date()).getTime()); 414 cE.data('isvisible', true); 415 var event = document.createEvent('Event'); 416 var functionDoifbecomevisible = function(){ 417 eval(cE.data('doifbecomevisibleonce')); 418 }; 419 functionDoifbecomevisible.call(cE.get(0)); 420 cE.removeAttr('data-doifbecomevisibleonce'); 421 } 422 423 if(cE.hasClass('wglAnimateIfVisibleOnce')){ 424 cE.addClass('wglAnimateIfVisibleOnceVisible').removeClass('wglAnimateIfVisibleOnce'); 425 } 426 427 observeVisibleOnce.unobserve(entry.target); 428 } 429 } 430}; 431 432var observeVisible = null; 433var observeVisibleOnce = null 434 435jQuery(document).ready(function(){ 436 437 wUiTmp['documentReady'] = true; 438 439 var htmlAdditionalClasses = ''; 440 441 if(parent != self){ 442 if(location.href.indexOf('viewmode=blank') != -1){ 443 htmlAdditionalClasses += ' isInLightbox'; 444 if(typeof(wAccessibility) !== 'undefined' && wAccessibility['accessEventHandler'] != null && wAccessibility['accessEventHandler'].active){ 445 var aEObject = Object.assign({}, wAccessEvents['wLightboxIframe'], { 446 element: jQuery(window.document) 447 }); 448 wAccessHandler.addEvent(aEObject); 449 } 450 else{ 451 if(parent.jQuery('#wLightboxIframe').data('openpointertype') === ''){ 452 var elementToFocus = document.querySelector('h1, h2, h3, h4'); 453 if(!elementToFocus){ 454 elementToFocus = document.querySelector('div, p'); 455 } 456 457 if(elementToFocus){ 458 elementToFocus.setAttribute('tabindex', '0'); 459 elementToFocus.focus(); 460 } 461 } 462 463 document.addEventListener('keydown', function(event) { 464 if(event.key === 'Escape'){ 465 event.preventDefault(); 466 if(parent.wLightboxOpener){
467 parent.wLightboxOpener.focus(); 468 } 469 parent.jQuery('.wLightboxCloser').trigger('click'); 470 } 471 }); 472 } 473 } 474 } 475 476 if(navigator.appVersion.match(/MSIE (\d+\..)/)){ 477 htmlAdditionalClasses += ' ie' + String(navigator.appVersion.match(/MSIE (\d+\..)/)[1]).replace(/\..*/, ''); 478 } 479 else if(navigator.userAgent.match(/Trident\/7/)){ 480 htmlAdditionalClasses += ' ie11'; 481 } 482 483 if(/mobile/i.test(navigator.userAgent)) htmlAdditionalClasses += ' mobile'; 484 if(/iPad/i.test(navigator.platform) || (navigator.platform == 'MacIntel' && navigator.maxTouchPoints == 5)) htmlAdditionalClasses += ' ipad'; 485 if(/iPhone/i.test(navigator.platform)) htmlAdditionalClasses += ' iphone'; 486 if(/iPod/i.test(navigator.platform)) htmlAdditionalClasses += ' ipod'; 487 if(/(iPod|iPhone|iPad)/i.test(navigator.platform) || (navigator.platform == 'MacIntel' && navigator.maxTouchPoints == 5)){ 488 htmlAdditionalClasses += ' ios'; 489 if(/Version\/(4|5|6|7|8|9|10|11|12|13)/.test(navigator.userAgent) && !/iPhone\s+OS\s+(4|5|6|7|8|9|10|11|12|13)/.test(navigator.userAgent)){ 490 htmlAdditionalClasses += ' ioslt14'; 491 } 492 if(/CriOs/i.test(navigator.userAgent)){ 493 htmlAdditionalClasses += ' crios'; 494 } 495 else if(/Safari/i.test(navigator.userAgent)){ 496 wUiTmp['isSafari'] = true; 497 htmlAdditionalClasses += ' saios'; 498 } 499 } 500 if(/MacIntel/.test(navigator.platform) && navigator.maxTouchPoints && navigator.maxTouchPoints > 2){ 501 if(/CriOs/i.test(navigator.userAgent)){ 502 htmlAdditionalClasses += ' crios'; 503 } 504 else if(/Safari/i.test(navigator.userAgent)){ 505 wUiTmp['isSafari'] = true; 506 htmlAdditionalClasses += ' saios'; 507 } 508 } 509 510 htmlAdditionalClasses += ' viewmode-' + (/viewmode=([^&]+)/.test(location.href) ? RegExp.$1 : 'default'); 511 htmlAdditionalClasses += location.href.indexOf('targetPreview=embed') != -1 ? ' wpreview' : ''; 512 htmlAdditionalClasses += location.href.indexOf('createImageRaster=1') != -1 ? ' createImageRaster' : ''; 513 htmlAdditionalClasses += (!navigator.userAgent.match(/Trident\/7/) && (('ontouchstart' in window) || navigator.msMaxTouchPoints || window.DocumentTouch && document instanceof DocumentTouch) ? ' touch' : ' no-touch'); 514 htmlAdditionalClasses += (jQuery(window).scrollTop() <= wOffsetScrolledTopDefault && jQuery(window).scrollTop() >= 0) && document.documentElement.className.indexOf(' scrolled-top') == -1 ? ' scrolled-top' : ''; 515 516 if(document.cookie.indexOf('websitezoom=l') != -1){ 517 htmlAdditionalClasses += ' zoom-l'; 518 } 519 520 if(document.cookie.indexOf('websitecontrast=1') != -1){ 521 htmlAdditionalClasses += ' contrast-height'; 522 } 523 524 if(document.documentElement){ 525 if(document.documentElement.getAttribute('lang')){ 526 htmlAdditionalClasses += ' lang-' + document.documentElement.getAttribute('lang'); 527 } 528 529 var documentElementClassName = document.documentElement.className; 530 531 if(jQuery(window).scrollTop() > wOffsetScrolledTopDefault){ 532 documentElementClassName = documentElementClassName.replace(' scrolled-top', ''); 533 } 534 documentElementClassName = (documentElementClassName.replace('no-js', 'js') + htmlAdditionalClasses).replace(/^\s+/, ''); 535 if(typeof(wEditor) == 'undefined'){ 536 documentElementClassName = documentElementClassName.replace(' weditor', ' no-weditor'); 537 } 538 else{ 539 documentElementClassName = documentElementClassName.replace(' no-weditor', ' weditor'); 540 } 541 documentElementClassName = documentElementClassName + (!/MSIE (6|7|8)/.test(navigator.appVersion) ? ' pagestatus-ready' : ''); 542 if(/MSIE (6|7|8)/.test(navigator.appVersion)){ 543 documentElementClassName = documentElementClassName.replace(/pagestatus-\w+/g, ''); 544 } 545 document.documentElement.className = documentElementClassName; 546 } 547 548 wPersonalizeAccessibility(); 549 550 for(var addClassSelector in wCssClassesToAddGlobal){ 551 jQuery(addClassSelector).each(function(index){ 552 var classesToAdd = wCssClassesToAddGlobal[addClassSelector]; 553 for(var i = 0, arrayLength = classesToAdd.length; i < arrayLength; i++){ 554 var classData = classesToAdd[i].split('='); 555 if(classData.length == 2){ 556 var selector = classData[0].trim(); 557 if(selector == '.'){ 558 jQuery(this).addClass(classData[1].trim()); 559 } 560 else if(selector == 'parent'){ 561 jQuery(this).parent().addClass(classData[1].trim()); 562 } 563 else{ 564 jQuery(this).find(selector).addClass(classData[1].trim()); 565 } 566 } 567 else{ 568 jQuery(this).addClass(classData[0].trim()); 569 } 570 } 571 }); 572 } 573
574 for(var addDataSelector in wCssDataToAddGlobal){ 575 jQuery(addDataSelector).each(function(index){ 576 var dataToAdd = wCssDataToAddGlobal[addDataSelector]; 577 578 for(var i = 0, arrayLength = dataToAdd.length; i < arrayLength; i++){ 579 var data = dataToAdd[i].split('='); 580 if(data[0] != null && data[0] != '') jQuery(this).attr('data-' + data[0].trim(), (data[1] != null && typeof data[1] == 'string' ? data[1].trim() : '')); 581 } 582 }); 583 } 584 585 if(typeof wCssAttributesToAddGlobal !== 'undefined'){ 586 for(var addAttributeSelector in wCssAttributesToAddGlobal){ 587 jQuery(addAttributeSelector).each(function(index){ 588 var attributeToAdd = wCssAttributesToAddGlobal[addAttributeSelector]; 589 590 for(var i = 0, arrayLength = attributeToAdd.length; i < arrayLength; i++){ 591 var data = attributeToAdd[i].split('='); 592 jQuery(this).attr(data[0].trim(), data[1].trim()); 593 } 594 }); 595 } 596 } 597 598 jQuery('*[data-w-addclasses]').each(function(index){ 599 600 var classesToAdd = jQuery(this).data('w-addclasses').split(','); 601 jQuery(this).removeAttr('data-w-addclasses'); 602 for(var i = 0, arrayLength = classesToAdd.length; i < arrayLength; i++){ 603 var classData = classesToAdd[i].split('='); 604 var selector = jQuery.trim(classData[0]); 605 if(selector == '.'){ 606 jQuery(this).addClass(jQuery.trim(classData[1])); 607 } 608 else{ 609 jQuery(this).find(selector).addClass(jQuery.trim(classData[1])); 610 } 611 } 612 }); 613 614 for(var addEventSelector in wCssEventsToAddGlobal){ 615 jQuery(addEventSelector).each(function(index){ 616 var eventsToAdd = wCssEventsToAddGlobal[addEventSelector]; 617 for(var i = 0, arrayLength = eventsToAdd.length; i < arrayLength; i++){ 618 var eventData = eventsToAdd[i].split('='); 619 if(eventData.length == 2){ 620 var eventType = eventData[0].trim().replace(/^on/, ''); 621 var eventFunction = eventData[1].trim(); 622 jQuery(this).on(eventType, (new Function('event', eventFunction + '(this, event.originalEvent);'))); 623 } 624 } 625 }); 626 } 627 628 for(var wCssJQueryEntry in wCssJQuery){ 629 jQuery(wCssJQueryEntry).each(function(index){ 630 if(!wCssJQuery[wCssJQueryEntry]['event'] || wCssJQuery[wCssJQueryEntry]['event'] == 'document.ready'){ 631 eval(wCssJQuery[wCssJQueryEntry]['jQuery']); 632 } 633 }); 634 } 635 636 for(var wCssDOMEntry in wCssDOM){ 637 jQuery(wCssDOMEntry).each(function(index){ 638 domActions = {'prependto' : 'prependTo', 'appendto' : 'appendTo', 'insertbefore' : 'insertBefore', 'insertafter' : 'insertAfter'}; 639 if(/^(\w+)\(/.test(wCssDOM[wCssDOMEntry]['path'])){ 640 eval('jQuery(this).' + domActions[wCssDOM[wCssDOMEntry]['action'].toLowerCase()] + '(jQuery(this).' + wCssDOM[wCssDOMEntry]['path'].replace(/\*\/$/, '') + ');'); 641 } 642 else{ 643 if(wCssDOM[wCssDOMEntry]['action'] == 'prependto'){ 644 jQuery(this).prependTo(wCssDOM[wCssDOMEntry]['path']); 645 } 646 else if(wCssDOM[wCssDOMEntry]['action'] == 'appendto'){ 647 jQuery(this).appendTo(wCssDOM[wCssDOMEntry]['path']); 648 } 649 else if(wCssDOM[wCssDOMEntry]['action'] == 'insertbefore'){ 650 jQuery(this).insertBefore(wCssDOM[wCssDOMEntry]['path']); 651 } 652 else if(wCssDOM[wCssDOMEntry]['action'] == 'insertafter'){ 653 jQuery(this).insertAfter(wCssDOM[wCssDOMEntry]['path']); 654 } 655 } 656 }); 657 } 658 659 if(typeof wHasInterpretedCssJs === 'function'){ 660 wHasInterpretedCssJs(); 661 } 662 663 if(typeof wEditor != 'undefined' && typeof wEditor.wHasInterpretedCssJs === 'function'){ 664 wEditor.wHasInterpretedCssJs(); 665 } 666 667 var mediaQueriesTmpToAdd = '<div id="wMediaqueriesTmp">'; 668 669 for(var wMediaqueryToAddGlobal in wMediaqueriesToAddGlobal){ 670 mediaQueriesTmpToAdd += '<div id="wMediaqueryTmp_' + wMediaqueryToAddGlobal + '"></div>'; 671 } 672 673 mediaQueriesTmpToAdd += '</div>'; 674 wCookieNoticeVar = typeof(wCookieNoticeVar) != 'undefined' ? wCookieNoticeVar : ''; 675 var useAccessEvent = (typeof(wAccessibility) !== 'undefined' && wAccessibility['accessEventHandler'] != null && wAccessibility['accessEventHandler'].active === true) ? true : false;
676 var useAccessEvent = true; 677 if(useAccessEvent) wAccessHandler.addEvent(wAccessEvents['cookieNotice']); 678 679 if(typeof(wEditor) != 'undefined' || typeof doNotShowCookieNotice !== 'undefined' && doNotShowCookieNotice || document.cookie.indexOf('hideCookieNotice' + wCookieNoticeVar + '=1') != -1 || /bot|search|slurp|spider|crawler|lighthouse|mediapartners|Google-AdWords-Express/i.test(navigator.userAgent)){ 680 if(typeof closeCookieNotice === 'function'){ 681 closeCookieNotice(); 682 } 683 else{ 684 jQuery('#cookieNotice').hide(); 685 } 686 if(useAccessEvent) wAccessEvents['cookieNotice'].deactivate(wAccessEvents['cookieNotice']); 687 } 688 else{ 689 690 var cIfDnt = typeof confirmIfDnt !== 'undefined' ? confirmIfDnt : ''; 691 692 if(cIfDnt === 'hideCookieInfo' && typeof navigator.doNotTrack !== 'undefined' && navigator.doNotTrack === '1'){ 693 if(typeof closeCookieNotice === 'function'){ 694 closeCookieNotice(); 695 } 696 else{ 697 jQuery('#cookieNotice').hide(); 698 } 699 if(useAccessEvent) wAccessEvents['cookieNotice'].deactivate(wAccessEvents['cookieNotice']); 700 document.cookie = 'allowTracking=0;path=/;sameSite=lax'; 701 document.cookie = 'allowLoadExternRessources=0;path=/;sameSite=lax'; 702 document.cookie = 'hideCookieNotice=1;path=/;sameSite=lax'; 703 } 704 else if(cIfDnt === 'showOnlyDntInfo' && typeof navigator.doNotTrack !== 'undefined' && navigator.doNotTrack === '1'){ 705 jQuery('#cookieNotice').hide(); 706 if(typeof showDntNotice === 'function'){ 707 showDntNotice(); 708 } 709 else{ 710 var timeDisplay = 8000; 711 712 setTimeout(function(){ 713 jQuery('#dntNotice').css({'display' : 'block'}); 714 }, 1800); 715 716 setTimeout(function(){ 717 jQuery('#dntNotice').addClass('isVisible'); 718 setTimeout(function(){ 719 jQuery('#dntNotice').removeClass('isVisible'); 720 setTimeout(function(){ 721 jQuery('#dntNotice').css({'display' : 'none'}); 722 }, 1000); 723 }, timeDisplay); 724 }, 2000); 725 726 document.cookie = 'allowTracking=0;path=/;sameSite=lax'; 727 document.cookie = 'allowLoadExternRessources=0;path=/;sameSite=lax'; 728 document.cookie = 'hideCookieNotice=1;path=/;sameSite=lax'; 729 } 730 } 731 else if(typeof showCookieNotice === 'function'){ 732 if(useAccessEvent) wAccessEvents['cookieNotice'].activate(wAccessEvents['cookieNotice'], {'isWall' : true}); 733 showCookieNotice(); 734 } 735 else{ 736 //jQuery('#cookieNotice').show(); 737 if(jQuery('#cookieNotice').hasClass('blockPage')){ 738 if(useAccessEvent) wAccessEvents['cookieNotice'].activate(wAccessEvents['cookieNotice'], {'isWall' : true}); 739 else{ 740 jQuery('body').on('keyup', function(e){ 741 if(e.keyCode == 9 && !jQuery(e.target).is('#cookieNotice *')){ 742 jQuery('#cookieNotice').attr('tabindex', 0).focus(); 743 return false; 744 } 745 }); 746 } 747 } 748 } 749 } 750 751 if(typeof(wSelectionFontSizeAddToCookieNotice) !== 'undefined' && wSelectionFontSizeAddToCookieNotice ||Â typeof(wSelectionContrastAddToCookieNotice) !== 'undefined' && wSelectionContrastAddToCookieNotice){ 752 if(!jQuery('#waiSectionCookieNotice').length){ 753 jQuery('#cookieNoticeInner > div').prepend('<div id="waiSectionCookieNotice"></div>'); 754 } 755 756 if(typeof(wSelectionFontSizeAddToCookieNotice) !== 'undefined' && wSelectionFontSizeAddToCookieNotice){ 757 jQuery('#waiSectionCookieNotice').append(jQuery('.wAiSectionFontSize').clone()); 758 } 759 if(typeof(wSelectionContrastAddToCookieNotice) !== 'undefined' && wSelectionContrastAddToCookieNotice){ 760 jQuery('#waiSectionCookieNotice').append(jQuery('.wAiSectionContrast').clone()); 761 } 762 } 763 764 wOffsetScrolledTopSet = typeof(wOffsetScrolledTop) != 'undefined' ? wOffsetScrolledTop : (document.documentElement.getAttribute('data-offsetscrolledtop') && document.documentElement.getAttribute('data-offsetscrolledtop') != '' ? document.documentElement.getAttribute('data-offsetscrolledtop') : 0); 765 wOffsetBottomChangeScrollStatusSet = typeof(wOffsetBottomChangeScrollStatus) != 'undefined' ? wOffsetBottomChangeScrollStatus : (document.documentElement.getAttribute('data-offsetscrolledtop') && document.documentElement.getAttribute('data-offsetbottomchangescrollstatus') != '' ? document.documentElement.getAttribute('data-offsetbottomchangescrollstatus') : 0); 766 767 if(wOffsetScrolledTopSet != wOffsetScrolledTopDefault){ 768 wOffsetScrolledTopDefault = wOffsetScrolledTopSet; 769 if(jQuery(window).scrollTop() > wOffsetScrolledTopDefault){ 770 documentElementClassName = documentElementClassName.replace(' scrolled-top', ''); 771 } 772 else if(document.documentElement.className.indexOf(' scrolled-top') == -1){ 773 document.documentElement.className += ' scrolled-top'; 774 } 775 } 776 777 if(typeof(wHandleObserveVisible) != 'undefined' && wHandleObserveVisible === true){ 778 var options= {threshold: 0.1}; 779 if(typeof wObserverOptions != 'undefined'){ 780 options = wObserverOptions; 781 } 782 observeVisible = ('IntersectionObserver' in window) ? new IntersectionObserver(handleObserveVisible, options) : null; 783 observeVisibleOnce = ('IntersectionObserver' in window) ? new IntersectionObserver(handleObserveVisibleOnce, options) : null; 784 } 785 786 jQuery('body').append(mediaQueriesTmpToAdd); 787 jQuery('.wglTabcontainer').wTabcontainer(); 788 jQuery('.wglAccordion').wAccordion(); 789 jQuery('.wglBannerSlider').wBannerSlider(); 790 jQuery('.wglSmartSlider').wSmartSlider(); 791 jQuery('.wglPictureGallery').wPictureGallery(); 792 jQuery('.wglLightbox').wLightbox(); 793 jQuery('.wglMaximizer').wMaximizer(); 794 jQuery('.wglDatepicker').wDatepicker(); 795 jQuery('.wglSearchSuggest').wSearchSuggest(); 796 jQuery('textarea[data-autoheight="1"]').wAutoheight(); 797 jQuery('input[type="range"]').wInputRange(); 798 jQuery('[data-accessevent]').wAccessEventHandler(); 799 800 if(observeVisible){ 801 jQuery('img.wglLazyLoadInit').each(function(index){ 802 observeVisible.observe(jQuery(this).get(0)); 803 }); 804 jQuery('iframe.wglLazyLoadInit').each(function(index){ 805 observeVisible.observe(jQuery(this).get(0)); 806 }); 807 } 808 809 if(observeVisibleOnce){ 810 jQuery('img.wglLazyLoadInit').each(function(index){ 811 observeVisibleOnce.observe(jQuery(this).get(0)); 812 }); 813 jQuery('iframe.wglLazyLoadInit').each(function(index){ 814 observeVisibleOnce.observe(jQuery(this).get(0)); 815 }); 816 } 817 818 var labels = jQuery('#blockBody').length > 0 ? jQuery('#blockBody label, #blockFooter label') : jQuery('label'); 819 labels.each(function(index){ 820 var nameFor = jQuery(this).attr('for'); 821 if(nameFor && nameFor != ''){ 822 var currentForm = jQuery(this).closest('form').get(0); 823 if(currentForm){ 824 var elementFor = currentForm.elements[nameFor]; 825 if(elementFor && elementFor.length){ 826 elementFor = elementFor[0]; 827 } 828 829 if(!elementFor){ 830 elementFor = jQuery(this).closest('form').find('#' + nameFor).get(0); 831 } 832 833 if(elementFor && typeof(elementFor.getAttribute('placeholder')) == 'string' && (elementFor.className.indexOf('wglIsInvalid') == -1 || elementFor.value == '')){ 834 if(elementFor.getAttribute('data-showlabelifhasplaceholder') !== '1' && typeof(elementFor.placeholder) != 'undefined'){ 835 if(jQuery(this).is(':visible') && !jQuery(this).hasClass('visuallyhidden')){ 836 jQuery(this).css({'display' : 'none'}); 837 } 838 } 839 } 840 } 841 } 842 }); 843 844 wPrepareHTML(); 845 846 if(window.matchMedia){ 847 window.matchMedia('print').addListener(function(){ 848 wUiTmp['isMediaPrint'] = true; 849 jQuery(window).trigger('resize'); 850 }); 851 } 852 else{ 853 window.onbeforeprint = function(event){ 854 wUiTmp['isMediaPrint'] = true; 855 jQuery(window).trigger('resize'); 856 }; 857 } 858 859 if(/viewmode=print/.test(location.search)){ 860 wUiTmp['isViewmodePrint'] = true; 861 } 862 863 window.setTimeout(function(event){ 864 wAdaptParallax(event); 865 }, 320); 866 867 wAdaptConditionalFormData(); 868 869 jQuery('.wglAddScrollProgress').each(function(index){ 870 871 var cE = jQuery(this);
872 cE.append('<progress id="scrollProgress" max="1000" value="0"><div></div></progress'); 873 874 wUiTmp['elementScrollProgress'] = jQuery('#scrollProgress'); 875 876 jQuery(window).on('resize scroll', function(){ 877 var documentHeight = jQuery(document).height(); 878 var scrollPercentage = Math.round(1000 * wUiTmp['lastScrollTop'] / (documentHeight - wUiTmp['lastWindowHeight'])); 879 wUiTmp['elementScrollProgress'].attr('value', scrollPercentage) 880 }); 881 }); 882 883 jQuery('.wglAddScrollTop').each(function(index){ 884 885 var cE = jQuery(this); 886 if(cE.get(0).nodeName.toLowerCase() == 'body'){ 887 cE.append('<div id="scrollTopOuter"><div id="scrollTop" tabindex="0" role="button" title="' + (jQuery('body').data('titlescrolltop') ? jQuery('body').data('titlescrolltop') : '') + '" aria-label="' + (jQuery('body').data('titlescrolltop') ? jQuery('body').data('titlescrolltop') : '') + '"><div class="scrollTopInner"></div></div></div'); 888 } 889 else{ 890 cE.after('<div id="scrollTopOuter"><div id="scrollTop" tabindex="0" role="button" title="' + (jQuery('body').data('titlescrolltop') ? jQuery('body').data('titlescrolltop') : '') + '" aria-label="' + (jQuery('body').data('titlescrolltop') ? jQuery('body').data('titlescrolltop') : '') + '"><div class="scrollTopInner"></div></div></div'); 891 } 892 var stO = jQuery('#scrollTop'); 893 stO.on('click', function (event){ 894 event.preventDefault(); 895 jQuery('body, html').animate({scrollTop:0}); 896 }); 897 898 stO.on('keyup', function (event){ 899 if(event.keyCode == 13){ 900 jQuery(this).trigger('click'); 901 } 902 }); 903 904 jQuery(window).on('scroll', function(){ 905 var scrollTop = jQuery(this).scrollTop(); 906 wUiTmp['scrollMax'] = typeof(wUiTmp['scrollMax']) !== 'undefined' ? Math.max(wUiTmp['scrollMax'], scrollTop) : scrollTop; 907 var fadeInAt = stO.attr('data-fadeInAt') != undefined ? parseInt(stO.attr('data-fadeInAt')) : 200; 908 if(scrollTop > fadeInAt){ 909 stO.fadeIn(); 910 } 911 else{ 912 stO.fadeOut(); 913 } 914 }); 915 916 }); 917 918 jQuery('.wglShrinkToMinWidthWithoutBreak').each(function(index){ 919 920 var cE = jQuery(this); 921 var textAlignBefore = cE.css('text-align'); 922 cE.css({'text-align' : 'left'}); 923 var lastElementInner = cE.children('*:last'); 924 var offsetRightLastElementInner = Math.ceil(lastElementInner.get(0).offsetLeft + lastElementInner.outerWidth() + parseInt(lastElementInner.css('margin-right'))); 925 cE.css({'text-align' : textAlignBefore, 'width' : String(offsetRightLastElementInner) + 'px'}); 926 }); 927 928 jQuery('.wglAdjustWidthEqual').each(function(index){ 929 930 var cE = jQuery(this); 931 var nE = 0; 932 cE.children('*').each(function(index){ 933 if(jQuery(this).css('display') != 'none'){ 934 nE++; 935 } 936 }); 937 var widthPerEntry = String(100 / nE) + '%'; 938 cE.children('*').each(function(index){ 939 if(jQuery(this).css('display') != 'none'){ 940 jQuery(this).css({'width' : widthPerEntry}); 941 } 942 }); 943 }); 944 945 jQuery('.wglRemoveOnClick').each(function(index){ 946 jQuery(this).attr('onclick', '').off('click'); 947 }); 948 949 jQuery('.wglCaptcha').each(function(index){ 950 if(jQuery(this).find('iframe[data-h="1"]').length == 1){ 951 jQuery(this).closest('.formElementCaptcha').hide(); 952 jQuery(this).closest('form').find('button[type="submit"]').on('click', function(event){ 953 var iFr = jQuery(this).closest('form').find('iframe[class="wglIFrameSc"]'); 954 jQuery(this).closest('form').find('input[id="captchaInput"]').val(iFr.get(0).contentWindow.gv(event.originalEvent, iFr.data('k')).substr(5, 4)); 955 }); 956 } 957 }); 958 959 if(typeof(wEditor) == 'undefined'){ 960 jQuery('.wglAnimateAfterTime').each(function(index){ 961 var cE = jQuery(this); 962 var ti = typeof(cE.data('animateaftertime')) != 'undefined' ? cE.data('animateaftertime') * 1000 : 0; 963 window.setTimeout(function(){ 964 cE.addClass('isAfterTime' + (typeof(cE.data('classtoaddaftertime')) != 'undefined' ? ' ' + cE.data('classtoaddaftertime') : '')); 965 cE.removeClass(typeof(cE.data('classtoremoveaftertime')) != 'undefined' ? ' ' + cE.data('classtoremoveaftertime') : ''); 966 }, ti); 967 }); 968 } 969 970 if(typeof(wEditor) == 'undefined'){ 971 jQuery('.wglLightbox').each(function(index){ 972 var cE = jQuery(this); 973 if(cE.get(0).nodeName == 'IMG'){ 974 var wrapElement = cE.parent().attr('class') == 'listEntryThumbnailOuter' ? cE.parent() : cE; 975 var srcLightbox = cE.attr('src'); 976 if(cE.attr('data-src') && cE.attr('data-src') != ''){ 977 srcLightbox = cE.attr('data-src'); 978 } 979 else{ 980 if(/\-/.test(srcLightbox.replace(/[\s\S]+\//, ''))){ 981 srcLightbox = srcLightbox.replace(/\/weblication\/wThumbnails/, '').replace(/-[^-]+(\.\w+)$/, '$1'); 982 } 983 else if(cE.attr('data-src2x') && cE.attr('data-src2x') != ''){ 984 srcLightbox = cE.attr('data-src2x'); 985 } 986 } 987 988 var closestList = cE.closest('.elementList'); 989 var relId = ''; 990 if(closestList.length == 1){ 991 relId = closestList.attr('id'); 992 } 993 wrapElement.wrap('<a rel="' + relId + '" onclick="event && event.stopPropagation ? event.stopPropagation() : event.cancelBubble = true;" title="' + cE.get(0).alt + '" class="boxPictureOnly" href="' + srcLightbox + '"/>'); 994 } 995 }); 996 } 997 998 jQuery('form').not('[data-inlinevalidation="onblur"]').find('input[data-validators="email"]').each(function(){ 999 jQuery(this).on('blur', function(){ 1000 jQuery(this).val(jQuery(this).val().trim()); 1001 }); 1002 }); 1003
1004 wAddInlineValidator = function(input){ 1005 1006 currentForm = input.closest('form'); 1007 currentForm.attr('data-hasinputstovalidate', '1'); 1008 1009 if(location.search.indexOf('wFormStatus=failed') != -1 && currentForm.attr('data-showinlinevalidationaferfailed') == '1'){ 1010 wglValidateElementInline(input.get(0), {'clientside' : currentForm.attr('action').indexOf('/weblication/grid5/tmpHTTP/wForm-') == -1}); 1011 } 1012 else if(location.search.indexOf('wFormStatus=failed') != -1 && input.find('#wFormErrorMessages').length > 0){ 1013 wglValidateElementInline(input.get(0), {'onInit' : true, 'clientside' : currentForm.attr('action').indexOf('/weblication/grid5/tmpHTTP/wForm-') == -1}); 1014 } 1015 else{ 1016 var vlr = wGetValidationInfoInput(input); 1017 currentForm.attr('data-hasvalidated', '1'); 1018 if(!vlr['isValid']){ 1019 input.attr('data-isinvalid', '1'); 1020 currentForm.attr('data-hasinputsinvalid', '1'); 1021 } 1022 } 1023 1024 var eventsToValidate = 'blur'; 1025 if(input.attr('type') == 'radio' ||Â input.attr('type') == 'checkbox'){ 1026 eventsToValidate = 'blur click'; 1027 } 1028 else if(input.attr('type') == 'file' || input.prop("tagName") == 'SELECT' || input.hasClass('hasDatepicker')){ 1029 eventsToValidate = 'blur change'; 1030 } 1031 1032 input.on(eventsToValidate, function(){ 1033 if(input.attr('readOnly') === 'readonly'){ 1034 window.setTimeout(function(){ 1035 wglValidateElementInline(input.get(0), {'clientside' : currentForm.attr('action').indexOf('/weblication/grid5/tmpHTTP/wForm-') == -1}); 1036 }, 320); 1037 } 1038 else{ 1039 wglValidateElementInline(input.get(0), {'clientside' : currentForm.attr('action').indexOf('/weblication/grid5/tmpHTTP/wForm-') == -1}); 1040 } 1041 }); 1042 input.on('keyup', function(event){ 1043 if(event.originalEvent && (event.originalEvent.keyCode == 9 || event.originalEvent.keyCode == 16)){ 1044 } 1045 else{ 1046 wglValidateElementInline(jQuery(this).get(0), {'userinfo' : false, 'clientside' : currentForm.attr('action').indexOf('/weblication/grid5/tmpHTTP/wForm-') == -1}); 1047 } 1048 }); 1049 }; 1050 1051 wInitInlineValidation = function() { 1052 jQuery('form[data-inlinevalidation="onblur"]').each(function () { 1053 wUiTmp['formPos'] = wUiTmp['formPos'] ? wUiTmp['formPos'] + 1 : 1; 1054 var currentForm = jQuery(this); 1055 1056 currentForm.attr('data-formpos', wUiTmp['formPos']); 1057 currentForm.attr('data-hasinputstovalidate', '0'); 1058 1059 currentForm.find('input, textarea, select').each(function () { 1060 if (jQuery(this).attr('data-validators') && jQuery(this).attr('data-validators') !== '') { 1061 wAddInlineValidator(jQuery(this)); 1062 } 1063 else if (typeof wAddEmptyInputValidators !== 'undefined' && wAddEmptyInputValidators) { 1064 wAddInlineValidator(jQuery(this)); 1065 } 1066 }); 1067 }); 1068 }; 1069 wInitInlineValidation(); 1070 1071 jQuery(document).on("input change", ".wglTime", function (){ 1072 const min = this.min; 1073 const max = this.max; 1074 let value = this.value; 1075 1076 if(!value) return; 1077 1078 if(min && value < min){ 1079 this.value = min; 1080 } 1081 else if (max && value > max){ 1082 this.value = max; 1083 } 1084 }); 1085 1086 jQuery('.wglTimeLeft:not([data-init="1"]').each(function(index){ 1087 1088 var cO = jQuery(this); 1089 var cE = cO.get(0); 1090 1091 if(typeof(wEditor) != 'undefined'){ 1092 cO.attr('data-init', '1'); 1093 return false; 1094 } 1095 1096 cO.attr('data-init', '1'); 1097 1098 var htmlTemplate = cE.innerHTML; 1099 if(cE.hasAttribute('data-text-template') && (htmlTemplate == '' && cE.getAttribute('data-text-template') != '' || cE.getAttribute('data-text-template') != '')){ 1100 htmlTemplate = cE.getAttribute('data-text-template'); 1101 if(cO.children().hasClass('wglCountUp') || cE.innerHTML == ''){ 1102 htmlTemplate = jQuery(cE.getAttribute('data-text-template')).addClass('wglCountUp').get(0).outerHTML; 1103 } 1104 } 1105 1106 intervalToSetTime = 10000; 1107 1108 var intervalFunction = function(){ 1109 1110 var now = new Date(); 1111 var nowYear = now.getUTCFullYear(); 1112 1113 var dateTimeStr = cE.getAttribute('data-time').trim(); 1114 if(dateTimeStr){ 1115 dateTimeStr = dateTimeStr.replace('Y', now.getUTCFullYear()); 1116 dateTimeStr = dateTimeStr.replace('m', now.getMonth() + 1); 1117 } 1118 1119 var lang = (document.documentElement.getAttribute('lang') ? document.documentElement.getAttribute('lang') : 'de').replace(/-\w+/, ''); 1120 var numberDigitsSeconds = cE.getAttribute('data-number-digits-seconds') ? cE.getAttribute('data-number-digits-seconds') : 1; 1121 1122 var textDay = cE.getAttribute('data-text-day-' + lang) ? cE.getAttribute('data-text-day-' + lang) : (cE.getAttribute('data-text-day') ? cE.getAttribute('data-text-day') : 'Tag'); 1123 1124 var textDay = cE.getAttribute('data-text-day-' + lang) ? cE.getAttribute('data-text-day-' + lang) : (cE.getAttribute('data-text-day') ? cE.getAttribute('data-text-day') : 'Tag'); 1125 var textDays = cE.getAttribute('data-text-days-' + lang) ? cE.getAttribute('data-text-days-' + lang) : (cE.getAttribute('data-text-days') ? cE.getAttribute('data-text-days') : 'Tage'); 1126 1127 var textHour = cE.getAttribute('data-text-hour-' + lang) ? cE.getAttribute('data-text-hour-' + lang) : (cE.getAttribute('data-text-hour') ? cE.getAttribute('data-text-hour') : 'Stunde'); 1128 var textHours = cE.getAttribute('data-text-hours-' + lang) ? cE.getAttribute('data-text-hours-' + lang) : (cE.getAttribute('data-text-hours') ? cE.getAttribute('data-text-hours') : 'Stunden'); 1129 1130 var textMinute = cE.getAttribute('data-text-minute-' + lang) ? cE.getAttribute('data-text-minute-' + lang) : (cE.getAttribute('data-text-minute') ? cE.getAttribute('data-text-minute') : 'Minute');
1131 var textMinutes = cE.getAttribute('data-text-minutes-' + lang) ? cE.getAttribute('data-text-minutes-' + lang) : (cE.getAttribute('data-text-minutes') ? cE.getAttribute('data-text-minutes') : 'Minuten'); 1132 1133 var textSecond = cE.getAttribute('data-text-second-' + lang) ? cE.getAttribute('data-text-second-' + lang) : (cE.getAttribute('data-text-second') ? cE.getAttribute('data-text-second') : 'Sekunde'); 1134 var textSeconds = cE.getAttribute('data-text-seconds-' + lang) ? cE.getAttribute('data-text-seconds-' + lang) : (cE.getAttribute('data-text-seconds') ? cE.getAttribute('data-text-seconds') : 'Sekunden'); 1135 1136 if(/^(\d+)-(\d+)-(\d+)$/.test(dateTimeStr)){ 1137 dateTimeStr += ' 00:00:00'; 1138 } 1139 1140 if(/(\d+)-(\d+)-(\d+) (\d+)\:(\d+)\:(\d+)/.test(dateTimeStr)){ 1141 var dateTime = new Date(RegExp.$1, RegExp.$2 - 1, RegExp.$3, RegExp.$4, RegExp.$5, RegExp.$6); 1142 var diffSeconds = parseInt(dateTime.getTime() / 1000) - parseInt(now.getTime() / 1000); 1143 1144 if(diffSeconds > 0){ 1145 var remainingDays = Math.floor(diffSeconds / 86400); 1146 var remainingHours = Math.floor((diffSeconds % 86400) / 3600); 1147 var remainingMinutes = Math.floor((diffSeconds % 3600) / 60); 1148 var remainingSeconds = Math.floor((diffSeconds % 60)); 1149 1150 if(numberDigitsSeconds == 2 && remainingSeconds < 10){ 1151 remainingSeconds = '0' + String(remainingSeconds); 1152 } 1153 1154 var html = htmlTemplate; 1155 1156 html = html.replace('%days', remainingDays == 1 ? '1 ' + textDay : remainingDays + ' ' + textDays); 1157 html = html.replace('%hours', remainingHours == 1 ? '1 ' + textHour : remainingHours + ' ' + textHours); 1158 html = html.replace('%minutes', remainingMinutes == 1 ? '1 ' + textMinute : remainingMinutes + ' ' + textMinutes); 1159 html = html.replace('%seconds', remainingSeconds == 1 || remainingSeconds == '01' ? remainingSeconds + ' ' + textSecond : remainingSeconds + ' ' + textSeconds); 1160 1161 cE.innerHTML = html; 1162 } 1163 else{ 1164 cO.parent().addClass('hasReachedTime'); 1165 } 1166 } 1167 }; 1168 1169 intervalFunction(); 1170 1171 if(htmlTemplate.indexOf('%seconds') != -1){ 1172 window.setInterval(intervalFunction, 1000); 1173 } 1174 else if(htmlTemplate.indexOf('%minutes') != -1){ 1175 window.setInterval(intervalFunction, 1000 * 60); 1176 } 1177 else{ 1178 window.setInterval(intervalFunction, 1000 * 3600); 1179 } 1180 }); 1181 1182 if(/Android/i.test(navigator.userAgent) && (typeof(wAddAccessDocumentOnPdfsIfAndroid) == 'undefined' || wAddAccessDocumentOnPdfsIfAndroid)){ 1183 jQuery('a').each(function(){ 1184 var cE = jQuery(this); 1185 var hrefCurrent = cE.attr('href'); 1186 if(/\.pdf$/.test(hrefCurrent) && !/accessDocument\.php/.test(hrefCurrent) && !/^https?\:\/\//.test(hrefCurrent)){ 1187 if(cE.attr('data-pathPrepend')){ 1188 hrefCurrent = cE.attr('data-pathPrepend') + hrefCurrent; 1189 } 1190 cE.attr('href', wUiTmp['wGlobalProjectPath'] + '/wGlobal/scripts/accessDocument.php?forceDownload=' + (cE.hasClass('download') ? '1' : '0') + '&document=' + encodeURIComponent(hrefCurrent)); 1191 } 1192 }); 1193 } 1194 1195 jQuery(window).trigger('resize'); 1196 1197 if((typeof(wDoNotFireOnLoadBeforeReady) == 'undefined' || wDoNotFireOnLoadBeforeReady) && wUiTmp['windowLoadAfterReady']){ 1198 wWindowOnLoad(); 1199 } 1200 1201 showNoticeExternalLinks(); 1202 1203 //Barrierefreiheit 1204 jQuery('.elementBox[role="link"]').each(function(){ 1205 if(jQuery(this).find('a, *[role="link"]').length > 0) jQuery(this).removeAttr('role'); 1206 }); 1207 1208 window.addEventListener('beforeunload', function(){ 1209 if(window.speechSynthesis && window.speechSynthesis.speaking){ 1210 window.speechSynthesis.cancel(); 1211 } 1212 }); 1213 1214 if(typeof waiReportActive !== 'undefined' && waiReportActive){ 1215 window.setTimeout(function(){ 1216 if(!/bot/i.test(navigator.userAgent)){ 1217 let se = document.createElement('script'); 1218 se.src = '/weblication/grid5/gui/scripts/waiChecker.js' + (typeof(wCe) !== 'undefined' ? '?av=' + wCe : ''); 1219 se.onload = function(){ 1220 wWaiChecker.feedbackDataReport(location.pathname); 1221 }; 1222 document.head.appendChild(se); 1223 } 1224 }, 1000); 1225 } 1226}); 1227 1228jQuery(window).on('load', function(){ 1229 1230 if(typeof(wDoNotFireOnLoadBeforeReady) == 'undefined' || wDoNotFireOnLoadBeforeReady){ 1231 if(wUiTmp['documentReady'] && !wUiTmp['windowLoad']){ 1232 wWindowOnLoad(); 1233 } 1234 else{ 1235 wUiTmp['windowLoadAfterReady'] = true; 1236 } 1237 } 1238 else{ 1239 wWindowOnLoad(); 1240 } 1241}); 1242 1243jQuery(window).on('scroll', function(){ 1244 1245 const scrollTop = jQuery(window).scrollTop(); 1246 wUiTmp['scrollMax'] = typeof(wUiTmp['scrollMax']) !== 'undefined' ? Math.max(wUiTmp['scrollMax'], scrollTop) : scrollTop; 1247 if(jQuery('#blockBody').length !== 0 && jQuery('#blockHeader').length !== 0){ 1248 const blockBodyBottom = jQuery('#blockHeader').height() + jQuery('#blockBody').height(); 1249 const vc = blockBodyBottom > 0 ? (Math.round(100 * (scrollTop + jQuery(window).height()) / (blockBodyBottom))/ 100) : 0; 1250 wUiTmp['viewContentMax'] = typeof(wUiTmp['viewContentMax']) !== 'undefined' ? Math.max(wUiTmp['viewContentMax'], vc) : vc; 1251 } 1252}); 1253 1254wWindowOnLoad = function(){ 1255 1256 wUiTmp['windowLoad'] = true; 1257 1258 for(var wCssJQueryEntry in wCssJQuery){ 1259 jQuery(wCssJQueryEntry).each(function(index){ 1260 if(wCssJQuery[wCssJQueryEntry]['event'] && wCssJQuery[wCssJQueryEntry]['event'] == 'window.load'){ 1261 eval(wCssJQuery[wCssJQueryEntry]['jQuery']); 1262 } 1263 }); 1264 } 1265 1266 jQuery("img[data-srchover]").each(function(){ 1267 var cE = jQuery(this); 1268 var hoverTriggerElement = cE; 1269 var hoverTriggerPath = cE.data('hovertrigger'); 1270 if(hoverTriggerPath){ 1271 eval('hoverTriggerElement = hoverTriggerElement.' + hoverTriggerPath); 1272 } 1273 hoverTriggerElement.on('mouseover', function (event){ 1274 cE.data('srcbeforehover', cE.attr('src')); 1275 if(cE.data('ishd') == '1'){ 1276 cE.attr('src', cE.data('srchover2x')); 1277 } 1278 else{ 1279 cE.attr('src', cE.data('srchover')); 1280 } 1281 }); 1282 hoverTriggerElement.on('mouseout', function (event){ 1283 cE.attr('src', cE.data('srcbeforehover')); 1284 }); 1285 }); 1286 1287 window.setTimeout(function(){ 1288 //var jQueryHashId = location.hash; 1289 if(location.hash != '' && location.hash != '#'){ 1290 wAdaptOnChangeHash({'event' : 'load'}); 1291 } 1292 }, 120); 1293 1294 if(document.documentElement){ 1295 window.setTimeout(function(){ 1296 document.documentElement.className = document.documentElement.className + ' pagestatus-loaded'; 1297 }, 800); 1298 } 1299 1300 jQuery('.wglImageMap').wImageMap(); 1301 jQuery('.wglMagnifier').wMagnifier(); 1302 jQuery('.wglImageCompare').wImageCompare(); 1303 jQuery('.wglTicker').wTicker(); 1304 1305 jQuery('.wglOverflowXTouch').each(function(index){ 1306 1307 var cE = jQuery(this); 1308 var widthOuter = cE.width(); 1309 var widthInner = cE.children('*').outerWidth(); 1310 1311 if(!cE.is(":visible") || widthInner <= widthOuter){ 1312 return false;
1313 } 1314 else{ 1315 var lastElementInner = cE.children('*').children('*:last'); 1316 var offsetRightLastElementInner = lastElementInner.get(0).offsetLeft + lastElementInner.outerWidth() + parseInt(lastElementInner.css('margin-right')); 1317 cE.children('*').children('*').each(function(index){ 1318 jQuery(this).css('width', jQuery(this).width()); 1319 }); 1320 lastElementInner.parent().css({'width' : String(offsetRightLastElementInner) + 'px'}); 1321 } 1322 1323 jQuery(this).find('img').attr('unselectable', 'on'); 1324 1325 jQuery('body').on('touchstart mousedown', function(event){ 1326 if(jQuery(event.target).closest(cE).length != 0){ 1327 event.preventDefault(); 1328 } 1329 }); 1330 1331 jQuery('body').on("touchmove mousemove", function(event){ 1332 if(jQuery('body').data('wtouchelement')){ 1333 1334 var mouseXDiff = (event.originalEvent.touches ? event.originalEvent.touches[0].pageX : event.pageX) - jQuery('body').data('wtouchmousex'); 1335 var mouseYDiff = (event.originalEvent.touches ? event.originalEvent.touches[0].pageY : event.pageY) - jQuery('body').data('wtouchmousey'); 1336 1337 jQuery('body').data('wtouchmousex', event.originalEvent.touches ? event.originalEvent.touches[0].pageX : event.pageX); 1338 jQuery('body').data('wtouchmousey', event.originalEvent.touches ? event.originalEvent.touches[0].pageY : event.pageY); 1339 jQuery('body').data('wtouchlastdiffx', mouseXDiff); 1340 jQuery('body').data('wtouchlastdiffy', mouseYDiff); 1341 1342 var milliseconds = (new Date()).getTime(); 1343 var timeDiff = milliseconds - jQuery('body').data('timestamplast'); 1344 jQuery('body').data('timestampbefore', jQuery('body').data('timestamplast')); 1345 jQuery('body').data('timestamplast', milliseconds); 1346 1347 var speedX = Math.round(100 * (mouseXDiff > 0 ? mouseXDiff : -mouseXDiff) / timeDiff) + 1; 1348 1349 jQuery('body').data('wtouchspeedX', speedX); 1350 1351 var touchDiffX = jQuery('body').data('wtouchmousex') - jQuery('body').data('wtouchstartmousex'); 1352 jQuery('body').data('wtouchdiffx', touchDiffX); 1353 1354 var widthOuter = parseInt(jQuery('body').data('wtouchelement').width()); 1355 var left = parseInt(jQuery('body').data('wtouchelement').children('*').css('margin-left')); 1356 left = isNaN(left) ? 0 : left; 1357 var right = parseInt(jQuery('body').data('wtouchelement').width()) - parseInt(jQuery('body').data('wtouchelement').children('*').css('margin-left')) - jQuery('body').data('wtouchelement').children('*').width(); 1358 right = isNaN(right) ? 0 : right; 1359 1360 if(left > 32){ 1361 jQuery('body').data('wtouchelement').children('*').animate({'margin-left' : 0}); 1362 jQuery('body').removeData('wtouchelement'); 1363 return false; 1364 } 1365 else if(right > 32){ 1366 jQuery('body').data('wtouchelement').children('*').animate({'margin-left' : String(parseInt(jQuery('body').data('wtouchelement').width()) - parseInt(jQuery('body').data('wtouchelement').children('*').width())) + 'px'}); 1367 jQuery('body').removeData('wtouchelement'); 1368 return false; 1369 } 1370 if(jQuery('body').data('wtouchelement').data('wtouchstartmarginleft') + touchDiffX < 0){ 1371 jQuery('body').data('wtouchelement').children('*').css({'margin-left' : String(jQuery('body').data('wtouchelement').data('wtouchstartmarginleft') + touchDiffX) + 'px'}); 1372 } 1373 else{ 1374 jQuery('body').data('wtouchelement').children('*').css({'margin-left' : String(jQuery('body').data('wtouchelement').data('wtouchstartmarginleft') + touchDiffX) + 'px'}); 1375 } 1376 } 1377 }); 1378 1379 jQuery(this).on('touchstart mousedown', function(event){ 1380 jQuery(this).children('*').stop(); 1381 jQuery('body').data('wtouchelement', jQuery(this)); 1382 jQuery(this).data('wtouchstartmarginleft', parseInt(jQuery(this).children('*').css('margin-left'))); 1383 jQuery(this).data('wtouchstartmargintop', parseInt(jQuery(this).children('*').css('margin-top'))); 1384 jQuery('body').data('wtouchstartmousex', event.originalEvent.touches ? event.originalEvent.touches[0].pageX : event.pageX); 1385 jQuery('body').data('wtouchstartmousey', event.originalEvent.touches ? event.originalEvent.touches[0].pageY : event.pageY); 1386 }); 1387 1388 jQuery('body').on("touchend mouseup", function(event){ 1389 if(jQuery('body').data('wtouchelement')){ 1390 var milliseconds = (new Date()).getTime(); 1391 var timeDiff = milliseconds - jQuery('body').data('timestamplast'); 1392 var touchDiffX = jQuery('body').data('wtouchdiffx'); 1393 var lastDiffX = jQuery('body').data('wtouchlastdiffx'); 1394 var lastDiffXn = lastDiffX >= 0 ? lastDiffX : -lastDiffX; 1395 1396 if(lastDiffXn > 1){ 1397 var speedX = (Math.round((lastDiffXn > 0 ? lastDiffXn : -lastDiffXn) / timeDiff) + 1) * 5; 1398 if(speedX > 200){ 1399 speedX = 200; 1400 } 1401 var movingWidth = Math.round(touchDiffX * 2 * (1 + speedX / 100)); 1402 if(jQuery('body').data('wtouchdiffx') < 0){
1403 var right = parseInt(jQuery('body').data('wtouchelement').width()) - parseInt(jQuery('body').data('wtouchelement').children('*').css('margin-left')) - jQuery('body').data('wtouchelement').children('*').width(); 1404 if(movingWidth < right){ 1405 movingWidth = right; 1406 } 1407 var duration = (movingWidth > 0 ? movingWidth : -movingWidth) * 1.5 + Math.round(100 / speedX); 1408 jQuery('body').data('wtouchelement').children('*').animate({'margin-left' : '+=' + String(movingWidth)}, {'duration' : duration, 'easing' : 'wEaseOut'}); 1409 } 1410 else{ 1411 var left = parseInt(jQuery('body').data('wtouchelement').children('*').css('margin-left')); 1412 if(-movingWidth < left){ 1413 movingWidth = -left; 1414 } 1415 var duration = (movingWidth > 0 ? movingWidth : -movingWidth) * 1.5 + Math.round(100 / speedX); 1416 jQuery('body').data('wtouchelement').children('*').animate({'margin-left' : '+=' + String(movingWidth)}, {'duration' : duration, 'easing' : 'wEaseOut'}); 1417 } 1418 } 1419 jQuery('body').removeData('wtouchelement'); 1420 } 1421 }); 1422 }); 1423 1424 jQuery('.wglOverflowXTouchScroll').each(function(index){ 1425 1426 if(typeof(wEditor) != 'undefined'){ 1427 return false; 1428 } 1429 1430 var el = jQuery(this); 1431 1432 jQuery('body').on('touchstart mousedown', function(event){ 1433 if(jQuery(event.target).closest(el).length != 0){ 1434 event.preventDefault(); 1435 } 1436 }); 1437 1438 jQuery('body').on("touchmove mousemove", function(event){ 1439 if(jQuery('body').data('wtouchelement')){ 1440 var scrollLeftStart = jQuery('body').data('wtouchstartscrollleft'); 1441 var mouseXDiff = (event.originalEvent.touches ? event.originalEvent.touches[0].pageX : event.pageX) - jQuery('body').data('wtouchstartmousex'); 1442 jQuery('body').data('wtouchelement').scrollLeft(scrollLeftStart - mouseXDiff); 1443 } 1444 }); 1445 1446 jQuery(this).on('touchstart mousedown', function(event){ 1447 jQuery('body').data('wtouchelement', jQuery(this)); 1448 jQuery('body').data('wtouchstartmousex', event.originalEvent.touches ? event.originalEvent.touches[0].pageX : event.pageX); 1449 jQuery('body').data('wtouchstartscrollleft', jQuery(this).scrollLeft()); 1450 }); 1451 1452 jQuery('body').on("touchend mouseup", function(event){ 1453 jQuery('body').removeData('wtouchelement'); 1454 }); 1455 }); 1456 1457 if(typeof(wHighlightBlockRoot) == 'undefined'){ 1458 wHighlightBlockRoot = 'blockContentInner'; 1459 } 1460 1461 if(wHighlightBlockRoot != 'none' && /highlight=([^&]+)/.test(decodeURIComponent(location.search.replace('+', ' ')))){ 1462 1463 highlightTexts = RegExp.$1; 1464 window.setTimeout(function(){ 1465 var highlightTextsArray = highlightTexts.split(/\s+/); 1466 var elementRoot = jQuery('#' + wHighlightBlockRoot); 1467 for(var j = 0; j < highlightTextsArray.length; j++){ 1468 var highlightText = highlightTextsArray[j]; 1469 var regExpWord = new RegExp('^(?:[\\w\\W]*\\W+|)(' + highlightText.replace('+', '\\+').replace(/(\w) /, '$1\\w* +') + '\\w*)([\\w\\W]*|)$', 'gim'); 1470 elementRoot.find('div, p, h1, h2, h3, h4, h5, h6, li').each(function(){ 1471 var nodeCurrent = jQuery(this).get(0); 1472 if(nodeCurrent.tagName != 'DIV' && !/<\w+/.test(nodeCurrent.innerHTML)){ 1473 nodeCurrent.innerHTML = nodeCurrent.innerHTML.replace(/[\n\r\s\t]+/g, ' '); 1474 } 1475 for(var j = 0; j < 6; j++){ 1476 var childNodes = nodeCurrent.childNodes; 1477 var childNodesLength = childNodes.length; 1478 for(var i = childNodesLength - 1; i >= 0; i--){ 1479 if(childNodes[i].nodeType == 3 && childNodes[i].nodeValue.trim() != ''){ 1480 if(regExpWord.test(childNodes[i].nodeValue)){
1481 var splitedNode = childNodes[i].splitText(childNodes[i].nodeValue.length - RegExp.$1.length - RegExp.$2.length); 1482 splitedNode.nodeValue = splitedNode.nodeValue.substr(RegExp.$1.length); 1483 var highlightNode = document.createElement('span'); 1484 highlightNode.className = 'wglHighlightWord'; 1485 highlightNode.setAttribute('data-hightlightword', highlightTexts); 1486 highlightNode.appendChild(document.createTextNode(RegExp.$1)); 1487 splitedNode.parentNode.insertBefore(highlightNode, splitedNode); 1488 var accHeaderE = jQuery(this).closest('.accordionContent').prev('.accordionHeader'); 1489 if(accHeaderE.data('ishighlighted') != true){ 1490 accHeaderE.data({noaccchange: true, noaccactivate: true, ishighlighted : true}).trigger('click'); 1491 } 1492 } 1493 } 1494 } 1495 } 1496 }); 1497 elementRoot.find('span, strong, td, a').each(function(){ 1498 var nodeCurrent = jQuery(this).get(0); 1499 if(nodeCurrent.className != 'wglHighlightWord'){ 1500 if(!/<\w+/.test(nodeCurrent.innerHTML)){ 1501 nodeCurrent.innerHTML = nodeCurrent.innerHTML.replace(/[\n\r\s\t]+/g, ' '); 1502 } 1503 for(var j = 0; j < 6; j++){ 1504 var childNodes = nodeCurrent.childNodes; 1505 var childNodesLength = childNodes.length; 1506 for(var i = childNodesLength - 1; i >= 0; i--){ 1507 if(childNodes[i].nodeType == 3 && childNodes[i].nodeValue.trim() != ''){ 1508 if(regExpWord.test(childNodes[i].nodeValue)){
1509 var splitedNode = childNodes[i].splitText(childNodes[i].nodeValue.length - RegExp.$1.length - RegExp.$2.length); 1510 splitedNode.nodeValue = splitedNode.nodeValue.substr(RegExp.$1.length); 1511 var highlightNode = document.createElement('span'); 1512 highlightNode.className = 'wglHighlightWord'; 1513 highlightNode.setAttribute('data-hightlightword', highlightTexts); 1514 highlightNode.appendChild(document.createTextNode(RegExp.$1)); 1515 splitedNode.parentNode.insertBefore(highlightNode, splitedNode); 1516 var accHeaderE = jQuery(this).closest('.accordionContent').prev('.accordionHeader'); 1517 if(accHeaderE.data('ishighlighted') != true){ 1518 accHeaderE.data({noaccchange: true, noaccactivate: true, ishighlighted : true}).trigger('click'); 1519 } 1520 } 1521 } 1522 } 1523 } 1524 } 1525 }); 1526 } 1527 }, 160); 1528 } 1529 1530 jQuery(window).trigger('resize'); 1531 1532 window.setTimeout(function(){ 1533 if(!observeVisible){ 1534 wAnimateIfVisible(); 1535 } 1536 wProcessWglAdjustHeightMax(); 1537 wLazyLoading(); 1538 }, 500); 1539 1540 if(location.hash == '#scrollposleftlist' ||Â location.hash == '#scrollsmoothposleftlist'){ 1541 var scrollToY = wGetScrollPosLeftList(); 1542 if(scrollToY > 0){ 1543 if(location.hash == '#scrollsmoothposleftlist'){ 1544 jQuery('body, html').animate({scrollTop: scrollToY}); 1545 } 1546 else{ 1547 jQuery('html, body').scrollTop(scrollToY); 1548 } 1549 } 1550 } 1551 1552 if(typeof(wUiTmp['callbackAfterLoad']) != 'undefined' && wUiTmp['callbackAfterLoad'].length && wUiTmp['callbackAfterLoad'].length > 0){ 1553 for(var i = 0; i < wUiTmp['callbackAfterLoad'].length; i++){ 1554 wUiTmp['callbackAfterLoad'][i](); 1555 } 1556 } 1557 1558 if(typeof(wUiTmp['viewContentMax']) === 'undefined' && jQuery('#blockBody').length !== 0 && jQuery('#blockHeader').length !== 0){ 1559 let blockBodyBottom = jQuery('#blockHeader').height() + jQuery('#blockBody').height(); 1560 wUiTmp['viewContentMax'] = blockBodyBottom > 0 ? (Math.round(100 * (jQuery(window).height()) / (jQuery('#blockHeader').height() + jQuery('#blockBody').height()))/ 100) : 0; 1561 } 1562}; 1563 1564jQuery(window).on('resize', function(){ 1565 1566 wUiTmp['lastWindowHeight'] = jQuery(window).height(); 1567 wUiTmp['lastDocumentHeight'] = jQuery(document).height(); 1568 wUiTmp['lastWindowWidth'] = jQuery(window).width(); 1569 1570 var hasChangedMediaQuery = false; 1571 1572 jQuery('#wMediaqueriesTmp > div').each(function(index){ 1573 if(window.getComputedStyle){ 1574 try{ 1575 var computedStyle = window.getComputedStyle(jQuery(this).get(0)); 1576 var fontFamily = computedStyle.fontFamily.replace(/"/g, ''); 1577 var lastMediaQuery = jQuery(this).data('lastmediaquery') || ''; 1578 if(fontFamily != lastMediaQuery){ 1579 if(fontFamily.indexOf('mediaquery_') == 0){ 1580 eval('if(typeof(' + fontFamily + '_onactivate) == \'function\'){' + fontFamily + '_onactivate();}'); 1581 } 1582 else if(lastMediaQuery.indexOf('mediaquery_') == 0){ 1583 eval('if(typeof(' + lastMediaQuery + '_ondeactivate) == \'function\'){' + lastMediaQuery + '_ondeactivate();}'); 1584 } 1585 jQuery(this).data('lastmediaquery', fontFamily); 1586 hasChangedMediaQuery = true; 1587 } 1588 } 1589 catch(e){}; 1590 } 1591 }); 1592 1593 if(hasChangedMediaQuery){ 1594 jQuery("img[data-srcmin]").each(function(){ 1595 var currentImg = jQuery(this); 1596 var widthOrig = parseInt(typeof(currentImg.attr('widthorig')) != 'undefined' ? currentImg.attr('data-widthorig') : currentImg.attr('width')); 1597 var srcMin = currentImg.data('srcmin') ? currentImg.data('srcmin') : ''; 1598 var widthCurrent = parseInt(currentImg.width()); 1599 var attrWidthCur = parseInt(typeof(currentImg.attr('width')) != 'undefined' ? currentImg.attr('width') : 0); 1600 var widthMin = parseInt(srcMin.replace(/.*@min/, '').replace(/\..*/, '')); 1601 //var widthOuter = parseInt(currentImg.closest('.elementStandard').width()); 1602 var widthOuter = parseInt(currentImg.parent().width()); 1603 1604 var diffWidthFrame = 0; 1605 if(currentImg.parent().parent().parent().parent().hasClass('picture')){ 1606 diffWidthFrame = currentImg.parent().parent().parent().parent().outerWidth() - widthCurrent; 1607 } 1608 else if(currentImg.parent().parent().hasClass('picture')){ 1609 diffWidthFrame = currentImg.parent().parent().outerWidth() - widthCurrent; 1610 } 1611 1612 if(widthCurrent > widthOrig && widthOuter > widthOrig + diffWidthFrame + 1 && widthMin > widthOrig){ 1613 currentImg.attr('src', srcMin); 1614 if(typeof(currentImg.attr('width')) != 'undefined' && currentImg.attr('width') != ''){ 1615 currentImg.attr('data-widthorig', currentImg.attr('width')).removeAttr('width').attr('height', 'auto'); 1616 } 1617 } 1618 }); 1619 } 1620 1621 jQuery('.wglExpandToHeighestChild').each(function(index){ 1622 1623 var cE = jQuery(this); 1624 var maxHeight = 0; 1625 cE.children('*').each(function(index){ 1626 if(jQuery(this).attr('data-adjusttoheighestchild') != 'no' && jQuery(this).outerHeight(true) > maxHeight){ 1627 maxHeight = jQuery(this).outerHeight(true); 1628 } 1629 }); 1630 if(maxHeight > 0){ 1631 cE.css('height', String(maxHeight) + 'px'); 1632 } 1633 }); 1634 1635 jQuery('.wglCheckWidthParent').each(function(index){ 1636 1637 var cE = jQuery(this); 1638 1639 var widthSelf = cE.attr('data-width-init') || cE.outerWidth(); 1640 var widthParent = cE.parent().width(); 1641 1642 if(cE.parent().hasClass('isToSmall') && cE.parent().is(":visible")){ 1643 cE.parent().removeClass('isToSmall'); 1644 widthParent = cE.parent().width(); 1645 } 1646 1647 if(!cE.attr('data-width-init')){ 1648 cE.attr('data-width-init', widthSelf); 1649 } 1650 1651 if(widthParent >= widthSelf){ 1652 cE.parent().removeClass('isToSmall'); 1653 } 1654 else{ 1655 cE.parent().addClass('isToSmall'); 1656 } 1657 }); 1658 1659 jQuery('.wglCheckOverflow').each(function(index){ 1660 1661 if(typeof(wEditor) != 'undefined'){ 1662 return false;
1663 } 1664 1665 var cE = jQuery(this); 1666 var scrollMax = cE.get(0).scrollWidth - cE.get(0).clientWidth; 1667 1668 cE.attr('data-isoverflowx', cE.get(0).clientWidth < cE.get(0).scrollWidth ? '1' : 0); 1669 cE.attr('data-scrollleft', String(cE.get(0).scrollLeft)); 1670 if(cE.get(0).scrollLeft == 0){ 1671 cE.attr('data-scrollpos', 'left'); 1672 } 1673 else if(cE.get(0).scrollLeft + 0.5 >= scrollMax){ 1674 cE.attr('data-scrollpos', 'right'); 1675 } 1676 else{ 1677 cE.attr('data-scrollpos', ''); 1678 } 1679 1680 jQuery(this).on('scroll', function(){ 1681 1682 var cE = jQuery(this); 1683 var scrollMax = cE.get(0).scrollWidth - cE.get(0).clientWidth; 1684 1685 cE.attr('data-scrollleft', String(cE.get(0).scrollLeft)); 1686 if(cE.get(0).scrollLeft == 0){ 1687 cE.attr('data-scrollpos', 'left'); 1688 } 1689 else if(cE.get(0).scrollLeft + 0.5 >= scrollMax){ 1690 cE.attr('data-scrollpos', 'right'); 1691 } 1692 else{ 1693 cE.attr('data-scrollpos', ''); 1694 } 1695 }); 1696 }); 1697 1698 let debouncedResize = wDebounce(function(){ 1699 1700 jQuery('.wglCheckBreakChildren').each(function(index){ 1701 1702 if(typeof(wEditor) != 'undefined'){ 1703 return false; 1704 } 1705 1706 var cE = jQuery(this); 1707 1708 var widthSelf = cE.attr('data-width-init') || cE.outerWidth(); 1709 var widthParent = cE.parent().width(); 1710 var offsetTop = 0; 1711 var offsetTopFirst = 0; 1712 var breakChildren = false;
1713 var targetBreakChildrenClass = cE.data('targetbreakchildrenclass'); 1714 var targetbreakchildrencallback = cE.data('targetbreakchildrencallback'); 1715 1716 var targetToSetClass = cE.parent(); 1717 if(targetBreakChildrenClass && /closest\(([^\)]+)\)/.test(targetBreakChildrenClass)){ 1718 targetToSetClass = cE.closest(RegExp.$1); 1719 if(targetToSetClass.length == 0){ 1720 targetToSetClass = cE.parent(); 1721 } 1722 } 1723 1724 var hasBreakChildrenBefore = targetToSetClass.hasClass('breakChildren'); 1725 1726 targetToSetClass.removeClass('breakChildren'); 1727 1728 if(hasBreakChildrenBefore && cE.parent().is(":visible")){ 1729 targetToSetClass.removeClass('breakChildren'); 1730 cE.children('*').each(function(index){ 1731 offsetTop = jQuery(this).offset().top; 1732 if(index == 0){ 1733 offsetTopFirst = offsetTop; 1734 } 1735 else if(offsetTop > offsetTopFirst + 5){ 1736 breakChildren = true; 1737 return false; 1738 } 1739 }); 1740 } 1741 else{ 1742 cE.children('*').each(function(index){ 1743 offsetTop = jQuery(this).offset().top; 1744 if(index == 0){ 1745 offsetTopFirst = offsetTop; 1746 } 1747 else if(offsetTop > offsetTopFirst + 5){ 1748 breakChildren = true; 1749 return false; 1750 } 1751 }); 1752 } 1753 1754 if(!cE.attr('data-width-init')){ 1755 cE.attr('data-width-init', widthSelf); 1756 } 1757 1758 if(breakChildren){ 1759 cE.attr('data-width-break', cE.outerWidth()); 1760 targetToSetClass.addClass('breakChildren'); 1761 } 1762 //else{ 1763 //targetToSetClass.removeClass('breakChildren'); 1764 //} 1765 if(hasBreakChildrenBefore != breakChildren && targetbreakchildrencallback && targetbreakchildrencallback != ''){ 1766 var f = window[targetbreakchildrencallback]; 1767 if(typeof f === 'function'){ 1768 f(cE); 1769 } 1770 } 1771 }); 1772 1773 wOptimizePictureSizes(); 1774 wProcessPictureZoomer(); 1775 wLazyLoading(); 1776 }, !wUiTmp['wHasInitResize'] ? 0 : 250); 1777 1778 debouncedResize(); 1779 1780 wProcessWglExpandToParent(); 1781 wProcessWglAdjustHeightMax(); 1782 1783 wAdaptHeightBlockHeaderOuter(); 1784 1785 wUiTmp['wHasInitResize'] = true; 1786}); 1787 1788jQuery(window).on('resize scroll', function(event){ 1789 1790 var hcw = false; 1791 1792 if(typeof(wUiTmp['lastWindowHeight']) == 'undefined' || event.type == 'resize'){ 1793 wUiTmp['lastWindowHeight'] = jQuery(window).height(); 1794 wUiTmp['lastDocumentHeight'] = jQuery(document).height(); 1795 } 1796 1797 if(typeof(wUiTmp['lastWindowWidthResized']) == 'undefined' || event.type == 'resize'){ 1798 var cw = jQuery(window).width(); 1799 if(cw != wUiTmp['lastWindowWidthResized']){ 1800 hcw = true; 1801 } 1802 wUiTmp['lastWindowWidthResized'] = cw; 1803 } 1804 1805 if(hcw){ 1806 jQuery('div[data-isdarkbackgroundminwidth]').each(function(index){ 1807 var v = parseInt(jQuery(this).attr('data-isdarkbackgroundminwidth').replace('px', '')); 1808 if(cw >= v){ 1809 jQuery(this).addClass('isDarkBackground'); 1810 } 1811 else{ 1812 jQuery(this).removeClass('isDarkBackground'); 1813 } 1814 }); 1815 } 1816 1817 wUiTmp['lastScrollTop'] = jQuery(window).scrollTop(); 1818 wUiTmp['lastScrollTime'] = new Date().getTime(); 1819 1820 wSetScrollStatus(); 1821 if(wUiTmp['lastScrollStatus'] === 'top'){ 1822 wAdaptHeightBlockHeaderOuter(); 1823 } 1824 1825 1826 if(typeof(wEditor) == 'undefined'){ 1827 wReader(); 1828 wCountUp(); 1829 } 1830 1831 wUiTmp['timeoutObserveAlt'] = typeof(wUiTmp['timeoutObserveAlt']) == 'undefined' || wUiTmp['timeoutObserveAlt'] == 0 ? 8 : wUiTmp['timeoutObserveAlt'] - 1; 1832 if(!observeVisible || wUiTmp['timeoutObserveAlt'] == 0){ 1833 wLazyLoading(); 1834 if(!observeVisible){ 1835 wAnimateIfVisible(); 1836 } 1837 } 1838 1839 wKeepInsideTopOnScroll(); 1840 wAdaptNavigationSection(); 1841 1842 wUiTmp['hasToAdaptParallax'] = true; 1843 1844 if(!wUiTmp['adaptParallax']){ 1845 window.requestAnimationFrame(wAdaptParallax); 1846 wUiTmp['adaptParallax'] = true; 1847 } 1848 1849 wUiTmp['lastScrollTopBefore'] = wUiTmp['lastScrollTop']; 1850}); 1851 1852wSetScrollStatus = function(){ 1853 1854 var canChange = wUiTmp['lastScrollTop'] >=0 && (wUiTmp['lastScrollTop'] + wUiTmp['lastWindowHeight'] - wUiTmp['lastDocumentHeight']) < 0 ? true : false;
1855 1856 if(typeof(wOffsetBottomChangeScrollStatusSet) != 'undefined'){ 1857 if((wUiTmp['lastWindowHeight'] + wUiTmp['lastScrollTop']) > (wUiTmp['lastDocumentHeight'] - wOffsetBottomChangeScrollStatusSet)){ 1858 canChange = false; 1859 } 1860 } 1861 1862 if(typeof(wBlockChangeScrollstatus) != 'undefined' && wBlockChangeScrollstatus){ 1863 canChange = false; 1864 } 1865 1866 if(typeof(wUiTmp['lastScrollTop']) == 'undefined'){ 1867 wUiTmp['lastScrollTop'] = wOffsetScrolledTopDefault -1; 1868 } 1869 1870 var changeScrollstatusOnAutoscrolling = false; 1871 1872 if(typeof(wChangeScrollstatusOnAutoscrolling) != 'undefined' && wChangeScrollstatusOnAutoscrolling){ 1873 changeScrollstatusOnAutoscrolling = true; 1874 } 1875 1876 if((!wUiTmp['scrollingAuto'] || changeScrollstatusOnAutoscrolling) && canChange){ 1877 if(wUiTmp['lastScrollTop'] <= wOffsetScrolledTopDefault){ 1878 if(wUiTmp['lastScrollStatus'] != 'top'){ 1879 document.documentElement.className = document.documentElement.className.replace(' scrolled-top', '').replace(' scrolldirection-down', '').replace(' scrolldirection-up', '') + ' scrolled-top'; 1880 } 1881 wUiTmp['lastScrollStatus'] = 'top'; 1882 } 1883 else if(wUiTmp['lastScrollTop'] < wUiTmp['lastScrollTopBefore']){ 1884 if(wUiTmp['lastScrollStatus'] != 'scrollup'){ 1885 document.documentElement.className = document.documentElement.className.replace(' scrolled-top', '').replace(' scrolldirection-down', '') + ' scrolldirection-up'; 1886 } 1887 wUiTmp['lastScrollStatus'] = 'scrollup'; 1888 } 1889 else if(typeof wUiTmp['lastScrollStatus'] == 'undefined' && wUiTmp['lastScrollTop'] > wOffsetScrolledTopDefault || wUiTmp['lastScrollTop'] > wUiTmp['lastScrollTopBefore']){ 1890 if(wUiTmp['lastScrollStatus'] != 'scrolldown'){ 1891 document.documentElement.className = document.documentElement.className.replace(' scrolled-top', '').replace(' scrolldirection-up', '') + ' scrolldirection-down'; 1892 } 1893 wUiTmp['lastScrollStatus'] = 'scrolldown'; 1894 } 1895 } 1896}; 1897 1898wSetScrollPosLeftList = function(eventTarget){ 1899 sessionStorage.setItem('scrollposleftlist:' + location.pathname, window.scrollY); 1900 sessionStorage.setItem('scrollposleftlist:' + location.pathname + location.search, window.scrollY); 1901}; 1902 1903wGetScrollPosLeftList = function(){ 1904 scrollToY = 0; 1905 if(sessionStorage.getItem('scrollposleftlist:' + location.pathname) != ''){ 1906 scrollToY = sessionStorage.getItem('scrollposleftlist:' + location.pathname); 1907 } 1908 else if(sessionStorage.getItem('scrollposleftlist:' + location.pathname + location.search) != ''){ 1909 scrollToY = sessionStorage.getItem('scrollposleftlist:' + location.pathname + location.search); 1910 } 1911 return scrollToY; 1912}; 1913 1914wAdaptHeightBlockHeaderOuter = function(){ 1915 try{ 1916 if(jQuery(':root').css('--adaptHeightBlockHeaderOuter') !== 'no'){ 1917 var blockHeaderHeight = jQuery('#blockHeader').length !== 0 ? jQuery('#blockHeader').height() : 0; 1918 1919 try{ 1920 if(typeof jQuery(':root').css('--heightBlockHeader') === 'undefined'){ 1921 wUiTmp['heightBlockHeaderUndefinedBeforeSet'] = true; 1922 } 1923 } 1924 catch(e){ 1925 wUiTmp['heightBlockHeaderUndefinedBeforeSet'] = true; 1926 } 1927 1928 jQuery(':root').css('--heightBlockHeader', String(blockHeaderHeight) + 'px'); 1929 jQuery(':root').css('--heightApp', String(jQuery(window).height()) + 'px'); 1930 1931 if(wUiTmp['heightBlockHeaderUndefinedBeforeSet']){ 1932 wUiTmp['heightBlockHeaderWasSetTo'] = jQuery(':root').css('--heightBlockHeader'); 1933 } 1934 } 1935 } 1936 catch(e){} 1937 1938}; 1939 1940wAdaptNavigationSection = function(){ 1941 1942 const $adpatNavigationSectionsObj = jQuery(".elementNavigationSections"); 1943 if($adpatNavigationSectionsObj.length == 0) return true; 1944 1945 var idTopSection = '', titleSection = '', cE, nearestPositionTop = 100000, elementPositionTop = 0; 1946 var offsetTopFixed = jQuery('.wglContainerInsideTopOnScroll').length > 0 ? jQuery('.wglContainerInsideTopOnScroll').outerHeight() : 0; 1947 1948 jQuery('.elementSection').each(function(index){ 1949 cE = jQuery(this); 1950 elementPositionTop = parseInt(cE.offset().top) - wUiTmp['lastScrollTop'] - offsetTopFixed; 1951 if(elementPositionTop < wUiTmp['lastWindowHeight'] - 128 && (elementPositionTop >= 0 && elementPositionTop < nearestPositionTop || elementPositionTop < 0 && elementPositionTop * -1 < nearestPositionTop)){ 1952 if(cE.height() > 8){ 1953 nearestPositionTop = (elementPositionTop >= 0 ? elementPositionTop : - elementPositionTop); 1954 titleSection = cE.attr('id') ? cE.attr('id') : ''; 1955 } 1956 } 1957 }); 1958 1959 if(titleSection != '' && titleSection != wUiTmp['lastSectionSelected']){ 1960 if(typeof(wKeepNavigationSectionsIfNoTitle) != 'undefined' && wKeepNavigationSectionsIfNoTitle){ 1961 if(jQuery(".elementNavigationSections li > a[href='#" + titleSection + "']").length != 0){ 1962 jQuery(".elementNavigationSections li").removeClass('selected'); 1963 jQuery(".elementNavigationSections li > a[href='#" + titleSection + "']").parent().addClass('selected'); 1964 wUiTmp['lastSectionSelected'] = titleSection; 1965 } 1966 } 1967 else{ 1968 jQuery(".elementNavigationSections li").removeClass('selected'); 1969 jQuery(".elementNavigationSections li > a[href='#" + titleSection + "']").parent().addClass('selected'); 1970 wUiTmp['lastSectionSelected'] = titleSection; 1971 } 1972 } 1973}; 1974 1975wPrefetchLink = function(link){ 1976 1977 var l = document.createElement("link"); 1978 l.rel = "prefetch"; 1979 l.href = link; 1980 document.head.appendChild(l); 1981}; 1982 1983wReader = function(){ 1984 1985 jQuery('.wglReader:not([data-init="1"]').each(function(index){ 1986 1987 if(window.speechSynthesis){ 1988 var cE = jQuery(this); 1989 var textToRead = cE.get(0).innerText; 1990 1991 if(textToRead != ''){ 1992 var rts = 'this.parentNode.nextSibling'; 1993 var rta = cE.data('readertarget') ? cE.data('readertarget') : ''; 1994 if(rta == 'prepend'){ 1995 rts = 'this.parentNode.parentNode'; 1996 } 1997 else if(rta.substr(0, 1) == '#'){ 1998 rts = 'document.getElementById(\'' + rta.substr(1) + '\')'; 1999 } 2000 cE.before('<div class="wReaderPanelEmbed"><div class="wButtonStartReading" onclick="wStartReadingText(' + rts + ', this.parentNode)"></div><div class="wButtonPauseReading" onclick="wPauseReadingText(' + rts + ', this.parentNode)"></div><div class="wButtonStopReading" onclick="wStopReadingText(' + rts + ', this.parentNode)"></div></div>'); 2001 } 2002 2003 cE.attr('data-init', '1'); 2004 } 2005 }); 2006}; 2007 2008wCountUp = function(){ 2009 2010 jQuery('.wglCountUp:not([data-init="1"])').each(function(index){ 2011 2012 var cE = jQuery(this); 2013 var nodeName = cE.get(0).nodeName; 2014 2015 if(typeof(wEditor) != 'undefined'){ 2016 cE.attr('data-init', '1'); 2017 return false;
2018 } 2019 2020 var offsetTop = parseInt(cE.offset().top); 2021 if(offsetTop > wUiTmp['lastScrollTop'] + wUiTmp['lastWindowHeight']){ 2022 return false; 2023 } 2024 2025 cE.attr('data-init', '1'); 2026 var currentDataOrig = cE.data(); 2027 var currentData = {}; 2028 2029 for(key in currentDataOrig){ 2030 currentData[key.toLowerCase()] = currentDataOrig[key]; 2031 } 2032 2033 currentData['countupFrom'] = currentData['countupfrom'] || 0; 2034 currentData['countupTo'] = currentData['countupto'] || cE.html(); 2035 currentData['countupDecimals'] = currentData['countupdecimals'] || 0; 2036 currentData['countupDuration'] = currentData['countupduration'] || 2; 2037 currentData['countupInitdelay'] = currentData['countupinitdelay'] || 1000; 2038 currentData['countupPrefix'] = currentData['countupprefix'] || ''; 2039 currentData['countupSuffix'] = currentData['countupsuffix'] || ''; 2040 2041 if(/((\w*)\. )/.test(currentData['countupTo'])) currentData['countupTo'] = currentData['countupTo'].replace(/((\w*)\. )/, RegExp.$2+'~#~ '); 2042 if(/^([^\d\,\.]*)([\d\,\.\']+)([^\d\,\.]*\.?)$/.test(currentData['countupTo'])){ 2043 currentData['countupPrefix'] = RegExp.$1.replace('~#~', '.'); 2044 currentData['countupTo'] = RegExp.$2; 2045 currentData['countupSuffix'] = RegExp.$3.replace('~#~', '.'); 2046 } 2047 2048 currentData['countupSeperator'] = ''; 2049 2050 if(/^\d+([\.\'])\\d\d\d/.test(currentData['countupFrom']) || /^\d+([\.\'])\d\d\d/.test(currentData['countupTo'])){ 2051 currentData['countupSeperator'] = RegExp.$1; 2052 } 2053 2054 if(currentData['countupSeperator'] != ''){ 2055 currentData['countupFrom'] = String(currentData['countupFrom']).replace(/^(\d+)[\.\'](\d\d\d)/, '$1$2').replace(/^(\d+)[\.\'](\d\d\d)/, '$1$2').replace(/^(\d+)[\.\'](\d\d\d)/, '$1$2'); 2056 currentData['countupTo'] = String(currentData['countupTo']).replace(/^(\d+)[\.\'](\d\d\d)/, '$1$2').replace(/^(\d+)[\.\'](\d\d\d)/, '$1$2').replace(/^(\d+)[\.\'](\d\d\d)/, '$1$2'); 2057 } 2058 2059 valueToSet = String(currentData['countupFrom']); 2060 2061 currentData['countupTo'] = currentData['countupTo'].replace(',', '.'); 2062 if(currentData['countupTo']){ 2063 if(/^\d+\.(\d+)$/.test(currentData['countupTo'])){ 2064 currentData['countupDecimals'] = RegExp.$1.length; 2065 } 2066 else if(/^([\d\,\.]+)$/.test(currentData['countupTo'])){ 2067 } 2068 else{ 2069 return true; 2070 } 2071 } 2072 else{ 2073 return true; 2074 } 2075 2076 if(currentData['countupDecimals'] > 0){ 2077 valueToSet = parseFloat(valueToSet).toFixed(currentData['countupDecimals']).replace('.', ','); 2078 } 2079 else{ 2080 valueToSet = String(Math.ceil(valueToSet)); 2081 if(currentData['countupSeperator'] != ''){ 2082 valueToSet = valueToSet.replace(/(\d)(\d{3})$/, '$1.$2').replace(/(\d)(\d{3})\./, '$1.$2.').replace(/(\d)(\d{3})\./, '$1.$2.'); 2083 } 2084 } 2085 2086 if(nodeName == 'text'){ 2087 cE.get(0).textContent = currentData['countupPrefix'] + valueToSet + currentData['countupSuffix']; 2088 } 2089 else{ 2090 cE.html(currentData['countupPrefix'] + valueToSet + currentData['countupSuffix']); 2091 } 2092 2093 var timeoutInit = 25; 2094 var timeout = timeoutInit; 2095 window.setTimeout(function(){ 2096 var intervalCountup = window.setInterval(function(){ 2097 if(timeout < 0.5){ 2098 timeout -= 0.02; 2099 } 2100 else if(timeout < 2){ 2101 timeout -= 0.05; 2102 } 2103 else if(timeout < 3){ 2104 timeout -= 0.14; 2105 } 2106 else if(timeout < 4){ 2107 timeout -= 0.4; 2108 } 2109 else{ 2110 timeout--; 2111 } 2112 2113 var valueToSet = (currentData['countupTo'] - currentData['countupFrom']) / timeoutInit * (timeoutInit - timeout) + parseFloat(currentData['countupFrom']); 2114 2115 if(timeout <= 0.1){ 2116 window.clearInterval(intervalCountup); 2117 valueToSet = currentData['countupTo']; 2118 } 2119 2120 if(currentData['countupDecimals'] > 0){ 2121 valueToSet = String(parseFloat(valueToSet).toFixed(currentData['countupDecimals']).replace('.', ',')); 2122 if(currentData['countupSeperator'] != ''){ 2123 if(/(\d+)\,(\d+)/.test(valueToSet)){ 2124 var valueToSetBefore = RegExp.$1; 2125 var valueToSetAfter = RegExp.$2; 2126 if(currentData['countupSeperator'] == '\''){ 2127 valueToSetBefore = valueToSetBefore.replace(/(\d)(\d{3})$/, '$1\'$2').replace(/(\d)(\d{3})\'/, '$1\'$2.').replace(/(\d)(\d{3})\'/, '$1\'$2.'); 2128 } 2129 else{ 2130 valueToSetBefore = valueToSetBefore.replace(/(\d)(\d{3})$/, '$1.$2').replace(/(\d)(\d{3})\./, '$1.$2.').replace(/(\d)(\d{3})\./, '$1.$2.'); 2131 } 2132 valueToSet = valueToSetBefore + ',' + valueToSetAfter; 2133 } 2134 } 2135 } 2136 else{ 2137 valueToSet = String(Math.ceil(valueToSet)); 2138 2139 if(currentData['countupSeperator'] != ''){ 2140 if(currentData['countupSeperator'] == '\''){ 2141 valueToSet = valueToSet.replace(/(\d)(\d{3})$/, '$1\'$2').replace(/(\d)(\d{3})\'/, '$1\'$2\'').replace(/(\d)(\d{3})\./, '$1\'$2.'); 2142 } 2143 else{ 2144 valueToSet = valueToSet.replace(/(\d)(\d{3})$/, '$1.$2').replace(/(\d)(\d{3})\./, '$1.$2.').replace(/(\d)(\d{3})\./, '$1.$2.'); 2145 } 2146 } 2147 } 2148
2149 if(nodeName == 'text'){ 2150 cE.get(0).textContent = currentData['countupPrefix'] + valueToSet + currentData['countupSuffix']; 2151 } 2152 else{ 2153 cE.html(currentData['countupPrefix'] + valueToSet + currentData['countupSuffix']); 2154 } 2155 //console.log(valueToSet); 2156 }, parseInt(currentData['countupDuration'] * 500 / timeoutInit)); 2157 }, currentData['countupInitdelay']); 2158 }); 2159}; 2160 2161wAnimateIfVisible = function(){ 2162 2163 jQuery("[data-doifbecomevisible]").each(function(index){ 2164 var cE = jQuery(this); 2165 var isVisibleState = cE.data('isvisible'); 2166 var offsetTop = parseInt(cE.offset().top); 2167 if(offsetTop < wUiTmp['lastScrollTop'] + wUiTmp['lastWindowHeight'] || location.href.indexOf('viewmode=print') != -1){ 2168 if(!isVisibleState){ 2169 cE.data('isvisible', true); 2170 eval(cE.data('doifbecomevisible')); 2171 2172 var functionDoifbecomevisible = function(){ 2173 eval(cE.data('doifbecomevisible')); 2174 }; 2175 functionDoifbecomevisible.call(cE.get(0)); 2176 } 2177 } 2178 else if(isVisibleState){ 2179 cE.data('isvisible', false); 2180 } 2181 }); 2182 2183 jQuery("[data-doifbecomevisibleonce]").each(function(index){ 2184 var cE = jQuery(this); 2185 var isVisibleState = cE.data('isvisible'); 2186 var offsetTop = parseInt(cE.offset().top); 2187 if(offsetTop < wUiTmp['lastScrollTop'] + wUiTmp['lastWindowHeight'] || location.href.indexOf('viewmode=print') != -1){ 2188 if(!isVisibleState){ 2189 cE.data('isvisible', true); 2190 //eval(cE.data('doifbecomevisibleonce')); 2191 2192 var functionDoifbecomevisible = function(){ 2193 eval(cE.data('doifbecomevisibleonce')); 2194 }; 2195 functionDoifbecomevisible.call(cE.get(0)); 2196 cE.removeAttr('data-doifbecomevisibleonce'); 2197 } 2198 } 2199 else if(isVisibleState){ 2200 cE.data('isvisible', false); 2201 } 2202 }); 2203 2204 jQuery('.wglAnimateIfVisibleOnce').each(function(index){ 2205 var cE = jQuery(this); 2206 if(parseInt(cE.offset().top) < wUiTmp['lastScrollTop'] + wUiTmp['lastWindowHeight'] || location.href.indexOf('viewmode=print') != -1){ 2207 cE.addClass('wglAnimateIfVisibleOnceVisible').removeClass('wglAnimateIfVisibleOnce'); 2208 if(typeof(wOnAfterAnimateIfVisible) === 'function'){ 2209 wOnAfterAnimateIfVisible(cE); 2210 } 2211 } 2212 }); 2213 2214 jQuery('.wglAnimateIfVisible').each(function(index){ 2215 var cE = jQuery(this); 2216 var offsetTop = parseInt(cE.offset().top); 2217 var offsetHeight = parseInt(cE.outerHeight()); 2218 if((offsetTop < wUiTmp['lastScrollTop'] + wUiTmp['lastWindowHeight'] && offsetTop + offsetHeight > wUiTmp['lastScrollTop']) || location.href.indexOf('viewmode=print') != -1){ 2219 if(!cE.hasClass('isVisible')){ 2220 cE.addClass('isVisibleOnce isVisible').removeClass('isInvisible'); 2221 if(typeof(wOnAfterAnimateIfVisible) === 'function'){ 2222 wOnAfterAnimateIfVisible(cE); 2223 } 2224 } 2225 } 2226 else{ 2227 if(cE.hasClass('isVisible')){ 2228 cE.addClass('isInvisible').removeClass('isVisible'); 2229 if(typeof(wOnAfterAnimateIfInvisible) === 'function'){ 2230 wOnAfterAnimateIfInvisible(cE); 2231 } 2232 } 2233 } 2234 }); 2235}; 2236 2237wShowContentOfElementInLightbox = function(elCurrent, el){ 2238 2239 var options = {}; 2240 options['type'] = 'inline'; 2241 options['content'] = jQuery(el).html(); 2242 2243 wLightbox(jQuery(elCurrent), options); 2244}; 2245 2246jQuery('body').on("touchmove", function(event){ 2247 wAdaptParallax(event); 2248}); 2249 2250jQuery(window).on("touchend", function(event){ 2251 wAdaptParallax(event); 2252}); 2253 2254jQuery(window).on('mousewheel DOMMouseScroll', function (event){ 2255 jQuery('body, html').stop(true, true); 2256}); 2257 2258wLazyLoading = function(){ 2259 2260 var winWidth = jQuery(window).width(); 2261 2262 wUiTmp['widthOfRwids'] = {}; 2263 2264 jQuery('img.wglLazyLoadInit').each(function(index){ 2265 2266 if(jQuery(this).data('solvesources') == '1'){ 2267 return true; 2268 } 2269 2270 var currentImg = jQuery(this); 2271 var offsetTop = parseInt(currentImg.offset().top); 2272 var srcMin = currentImg.data('srcmin') ? currentImg.data('srcmin') : ''; 2273 var widthCurrent = parseInt(currentImg.width()); 2274 var attrWidthCur = parseInt(typeof(currentImg.attr('width')) != 'undefined' ? currentImg.attr('width') : 0); 2275 var widthMin = parseInt(srcMin.replace(/.*@min/, '').replace(/\..*/, '')); 2276 2277 var isVisibleComponent = true; 2278 var isVisiblePicture = false; 2279 2280 if(currentImg.attr('data-maxwidthifinvisible') && currentImg.attr('data-maxwidthifinvisible') > widthCurrent){ 2281 widthCurrent = currentImg.attr('data-maxwidthifinvisible'); 2282 } 2283 2284 if(!currentImg.is(':visible')){ 2285 isVisibleComponent = false;
2286 closestElement = currentImg.closest('.elementList'); 2287 if(closestElement.length > 0 && closestElement.is(':visible')){ 2288 if(closestElement.find("div[data-lazyloadifvisibleentry='1']").length > 0){ 2289 } 2290 else if(closestElement.offset().top < wUiTmp['lastScrollTop'] + wUiTmp['lastWindowHeight']){ 2291 isVisibleComponent = true; 2292 } 2293 } 2294 } 2295 2296 if(currentImg.attr('data-lazyloadwidthmaxactive')){ 2297 if(winWidth >= currentImg.attr('data-lazyloadwidthmaxactive')){ 2298 isVisibleComponent = true; 2299 isVisiblePicture = true; 2300 } 2301 } 2302 2303 if(isVisibleComponent){ 2304 if(currentImg.parent().prop('tagName') == 'PICTURE'){ 2305 if(widthCurrent > 0){ 2306 wUiTmp['widthOfRwids'][currentImg.parent().attr('data-rwid')] = widthCurrent; 2307 } 2308 else if(wUiTmp['widthOfRwids'][currentImg.parent().attr('data-rwid')]){ 2309 widthCurrent = wUiTmp['widthOfRwids'][currentImg.parent().attr('data-rwid')]; 2310 } 2311 } 2312 } 2313 2314 if(isVisibleComponent || wUiTmp['isMediaPrint'] || wUiTmp['isViewmodePrint']){ 2315 if(isVisiblePicture || (offsetTop < wUiTmp['lastScrollTop'] + wUiTmp['lastWindowHeight']) || wUiTmp['isMediaPrint'] || wUiTmp['isViewmodePrint']){ 2316 wShowLazyLoadImage(currentImg); 2317 } 2318 } 2319 }); 2320}; 2321 2322wShowLazyLoadImage = function(currentImg){ 2323 2324 var widthCurrent = parseInt(currentImg.width()); 2325 var srcMin = currentImg.data('srcmin') ? currentImg.data('srcmin') : ''; 2326 var widthCurrent = parseInt(currentImg.width()); 2327 var attrWidthCur = parseInt(typeof(currentImg.attr('width')) != 'undefined' ? currentImg.attr('width') : 0); 2328 var widthMin = parseInt(srcMin.replace(/.*@min/, '').replace(/\..*/, '')); 2329 var widthMax = 0; 2330 2331 if(currentImg.parent().prop('tagName') == 'PICTURE'){ 2332 currentImg.data('solvesources', '1'); 2333 2334 if(currentImg.parent().children('source').length > 0){ 2335 currentImg.parent().children('source').each(function(){ 2336 //notwendig wegen IE11 2337 if(/(\d+)/.test(jQuery(this).attr('sizes'))){ 2338 if(parseInt(RegExp.$1) > widthMax){ 2339 widthMax = parseInt(RegExp.$1); 2340 } 2341 } 2342 if(jQuery(this).attr('data-src')){ 2343 var currentImgElement = jQuery(this).parent().find('img').get(0); 2344 currentImgElement.setAttribute('data-widthbefore', currentImgElement.style.width); 2345 //ggf. notwendig wegen IE11 2346 if(currentImgElement.offsetWidth > 0){ 2347 currentImgElement.style.width = String(currentImgElement.offsetWidth) + 'px'; 2348 } 2349 else{ 2350 currentImgElement.style.width = '100%'; 2351 } 2352 //console.log('setSrcset1:'); 2353 jQuery(this).attr('srcset', jQuery(this).data('src')).removeData('src'); 2354 var xi = 0; 2355 if(jQuery(this).parent().attr('data-lazywaitcompleted') != '1'){ 2356 jQuery(this).parent().attr('data-lazywaitcompleted', 1); 2357 var intervalLazyWaitCompleted = window.setInterval(function(){ 2358 if(currentImgElement.complete || xi > 200){ 2359 currentImgElement.style.width = currentImgElement.getAttribute('data-widthbefore'); 2360 currentImgElement.removeAttribute('data-widthbefore'); 2361 jQuery(this).parent().removeAttr('data-lazywaitcompleted'); 2362 currentImg.removeClass('wglLazyLoadInit'); 2363 if(typeof(wDoNotAdjustHeightMaxAfterLazyLoad) == 'undefined' || !wDoNotAdjustHeightMaxAfterLazyLoad){ 2364 wProcessWglAdjustHeightMax(); 2365 } 2366 if(typeof(wOnAfterLazyLoading) === 'function'){ 2367 wOnAfterLazyLoading(currentImg); 2368 } 2369 window.clearInterval(intervalLazyWaitCompleted); 2370 } 2371 xi++; 2372 }, 100); 2373 } 2374 else{ 2375 currentImgElement.style.width = currentImgElement.getAttribute('data-widthbefore'); 2376 currentImgElement.removeAttribute('data-widthbefore'); 2377 } 2378 } 2379 if(jQuery(this).attr('media')){ 2380 jQuery(this).attr('media', jQuery(this).attr('media').replace(/(\:\s*)999?9?\./, '$1')); 2381 } 2382 }); 2383 } 2384 } 2385 2386 var ie11 = navigator.appVersion.match(/MSIE (\d+\..)/) || navigator.userAgent.match(/Trident\/7/); 2387
2388 if(devicePixelRatio >= hdLimitDpr && typeof(currentImg.attr('data-src2x')) != 'undefined' && currentImg.attr('data-src2x') != '' && attrWidthCur < widthCurrent * 2 && currentImg.attr('data-ishd') != '1'){ 2389 currentImg.attr('src', currentImg.data('src2x')).attr('data-ishd', '1'); 2390 } 2391 else if(typeof(currentImg.attr('data-srcmin')) != 'undefined' && currentImg.attr('data-srcmin') != '' && widthCurrent < widthMin && widthMin < attrWidthCur && currentImg.attr('data-ismin') != '1' && currentImg.attr('data-ishd') != '1' && currentImg.attr('data-isld') != '1'){ 2392 currentImg.attr('src', currentImg.data('srcmin')).attr('data-ismin', '1'); 2393 } 2394 else if(typeof(currentImg.attr('data-src')) != 'undefined' && currentImg.attr('data-src') != '' && currentImg.attr('data-ishd') != '1' && currentImg.attr('data-isld') != '1'){ 2395 if(currentImg.data('src').indexOf('@px') != -1){ 2396 try{ 2397 if(currentImg.get(0).getBoundingClientRect()['width'] - widthCurrent == -0.5){ 2398 currentImg.get(0).style.width = 'calc(100% + 0.5px)'; 2399 currentImg.get(0).style.maxWidth = 'calc(100% + 0.5px)'; 2400 } 2401 } 2402 catch(e){console.log(e)} 2403 currentImg.attr('src', currentImg.data('src').replace('@px', '@' + (devicePixelRatio >= hdLimitDpr ? widthCurrent * 2 : widthCurrent) + 'px')); 2404 } 2405 else if(currentImg.data('src').indexOf('@ll') != -1){
2406 try{ 2407 if(currentImg.get(0).getBoundingClientRect()['width'] - widthCurrent == -0.5){ 2408 currentImg.get(0).style.width = 'calc(100% + 0.5px)'; 2409 currentImg.get(0).style.maxWidth = 'calc(100% + 0.5px)'; 2410 } 2411 } 2412 catch(e){console.log(e)} 2413 if(ie11){ 2414 widthMax = widthMax > 0 ? widthMax : (widthCurrent > 1 ? widthCurrent : 1024); 2415 currentImg.attr('src', currentImg.data('src').replace('@ll', '@' + (devicePixelRatio >= hdLimitDpr ? widthMax * 2 : widthMax) + 'll')); 2416 } 2417 else{ 2418 currentImg.attr('src', currentImg.data('src').replace('@ll', '@' + (devicePixelRatio >= hdLimitDpr ? widthCurrent * 2 : widthCurrent) + 'll')); 2419 } 2420 } 2421 else{ 2422 currentImg.attr('src', currentImg.data('src')); 2423 } 2424 currentImg.attr('data-isld', '1'); 2425 } 2426 2427 if(jQuery(this).parent().attr('data-lazywaitcompleted') != '1'){ 2428 currentImg.removeClass('wglLazyLoadInit'); 2429 if(typeof(wDoNotAdjustHeightMaxAfterLazyLoad) == 'undefined' || !wDoNotAdjustHeightMaxAfterLazyLoad){ 2430 wProcessWglAdjustHeightMax(); 2431 } 2432 if(typeof(wOnAfterLazyLoading) === 'function'){ 2433 wOnAfterLazyLoading(currentImg); 2434 } 2435 } 2436}; 2437 2438wShowLazyLoadIframe = function(el){ 2439 el.get(0).contentWindow.location.href = el.attr('data-src'); 2440}; 2441 2442wKeepInsideTopOnScroll = function(){ 2443 2444 jQuery('.wglKeepInsideTopOnScroll').each(function(index){ 2445 var cE = jQuery(this); 2446 var elementMovedNodeName = cE.attr('data-nodename') ? cE.attr('data-nodename') : cE.prop('nodeName'); 2447 var elementMoved = null; 2448 var offsetTop = parseInt(cE.offset().top); 2449 var scrollTopDiff = wGetScrollTopDiff({'considerWglContainerInsideTopOnScroll' : false}); 2450 var diffTop = offsetTop - wUiTmp['lastScrollTop'] - scrollTopDiff; 2451 var moveID = ''; 2452 var container = cE.data('container'); 2453 2454 window.clearInterval(wUiTmp['scrollStack']); 2455 if(container == 'parent'){ 2456 if(diffTop < 0){ 2457 var hasInit = false; 2458 if(cE.attr('data-hasmoved') != '1'){ 2459 cE.css({'transition' : 'none'}); 2460 cE.css({'transform' : 'translateY(0)'}); 2461 cE.attr('data-offsettopinit', offsetTop); 2462 cE.attr('data-scrolltopinit', wUiTmp['lastScrollTop']); 2463 cE.attr('data-movemax', cE.parent().height() - cE.outerHeight()); 2464 cE.attr('data-hasmoved', '1'); 2465 hasInit = true; 2466 } 2467 offsetTop = cE.attr('data-offsettopinit'); 2468 diffTop = offsetTop - wUiTmp['lastScrollTop'] - scrollTopDiff; 2469 diffTop = -diffTop > cE.attr('data-movemax') ? -cE.attr('data-movemax') : diffTop; 2470 if(hasInit){ 2471 cE.attr('data-movetopinit', -diffTop); 2472 } 2473 cE.css({'transform' : 'translateY(' + String(- diffTop) + 'px)'}); 2474 if(hasInit){ 2475 cE.css({'transition' : ''}); 2476 } 2477 } 2478 else if(cE.attr('data-hasmoved') == '1'){ 2479 if(wUiTmp['lastScrollTop'] < cE.attr('data-scrolltopinit') - cE.attr('data-movetopinit')){ 2480 cE.attr('data-offsettopinit', ''); 2481 cE.attr('data-hasmoved', ''); 2482 //cE.css({'transition' : ''}); 2483 cE.css({'transform' : 'translateY(0)'}); 2484 } 2485 else { 2486 offsetTop = cE.data('offsettopinit'); 2487 diffTop = offsetTop - wUiTmp['lastScrollTop'] - scrollTopDiff; 2488 diffTop = -diffTop > cE.attr('data-movemax') ? -cE.attr('data-movemax') : diffTop; 2489 //cE.css({'transition' : ''}); 2490 cE.css({'transform' : 'translateY(' + String(- diffTop) + 'px)'}); 2491 } 2492 } 2493 } 2494 else{ 2495 if(diffTop < 0 && (elementMovedNodeName != 'THEAD' || diffTop > (-cE.parent().outerHeight()))){ 2496 if(cE.attr('data-hasmoved') != '1'){ 2497 2498 var thStyles = {}; 2499 var widthTable = 0; 2500 var widthElementTable = 0; 2501 2502 if(cE.prop("nodeName") == 'THEAD'){ 2503 var elementSource = cE.parent(); 2504 if(elementSource){ 2505 var firstTh = elementSource.find('thead th').get(0); 2506 if(firstTh){ 2507 var computedStysle = window.getComputedStyle(firstTh); 2508 thStyles['color'] = computedStysle['color']; 2509 thStyles['background-color'] = computedStysle['background-color']; 2510 thStyles['padding-top'] = computedStysle['padding-top']; 2511 thStyles['padding-right'] = computedStysle['padding-right']; 2512 thStyles['padding-bottom'] = computedStysle['padding-bottom']; 2513 thStyles['padding-left'] = computedStysle['padding-left']; 2514 thStyles['font-weight'] = computedStysle['font-weight']; 2515 thStyles['text-align'] = computedStysle['text-align']; 2516 } 2517 elementSource.parent().scroll(function(){ 2518 cE.parent().scrollLeft(jQuery(this).scrollLeft()); 2519 }); 2520 widthTable = elementSource.outerWidth(); 2521 widthElementTable = elementSource.parent().width(); 2522 elementSource.css({'width' : String(widthTable) + 'px'}); 2523 elementSource.find('tbody > tr:first-child > td').each(function(index){ 2524 jQuery(this).css({'width' : String(jQuery(this).outerWidth()) + 'px'}); 2525 }); 2526 } 2527 } 2528 2529 if(!jQuery('.wglContainerInsideTopOnScroll').length){ 2530 jQuery('body').prepend('<div class="wglContainerInsideTopOnScroll"></div>'); 2531 } 2532 2533 cE.attr('data-hasmoved', '1'); 2534 moveID = String(parseInt(Math.random() * 1000000)); 2535 2536 if(typeof(cE.attr('data-moveidsource')) == 'undefined'){ 2537 cE.attr('data-moveidsource', moveID); 2538 } 2539 else{ 2540 moveID = cE.attr('data-moveidsource'); 2541 } 2542 2543 cE.before('<div id="moveidsource-' + moveID + '" class="wglKeepInsideTopOnScroll" data-noden
2543ame="' + cE.prop("nodeName") + '" data-hasmoved="1" data-moveidsource="' + moveID + '"></div>'); 2544 cE.removeAttr('data-moveidsource').attr('data-moveidtarget', moveID).attr('data-moveidtarget', moveID).appendTo('.wglContainerInsideTopOnScroll').addClass('moved-init').removeClass('wglKeepInsideTopOnScroll').removeClass('restored-init').removeClass('restored-ready'); 2545 window.setTimeout(function(){ 2546 cE.removeClass('moved-init').addClass('moved-ready'); 2547 }, 10); 2548 height = cE.height(); 2549 jQuery('#' + 'moveidsource-' + moveID).css('height', String(height) + 'px'); 2550 2551 if(cE.prop("nodeName") == 'THEAD'){ 2552 var elementSource = jQuery('#' + 'moveidsource-' + moveID).parent(); 2553 var offsetSource = elementSource.parent().offset(); 2554 if(offsetSource){ 2555 cE.css({'display' : 'block', 'width' : String(widthTable) + 'px'}); 2556 cE.parent().css({'overflow-x' : 'auto', 'left' : String(offsetSource.left) + 'px', 'width' : String(widthElementTable) + 'px'}); 2557 elementSource.find('tbody > tr:first-child > td').each(function(index){ 2558 cE.find('th:nth-child(' + (index + 1) + ')').css(thStyles); 2559 cE.find('th:nth-child(' + (index + 1) + ')').css({'width' : String(jQuery(this).outerWidth()) + 'px'}); 2560 }); 2561 elementSource.parent().trigger('scroll'); 2562 } 2563 } 2564 } 2565 else{ 2566 height = jQuery(".wglContainerInsideTopOnScroll *[data-moveidtarget='" + cE.attr('data-moveidsource') + "']").height(); 2567 cE.css('height', String(height) + 'px'); 2568 } 2569 jQuery('.wglContainerInsideTopOnScroll').css({'top': String(scrollTopDiff) + 'px'}); 2570 } 2571 else if(jQuery('html').hasClass('object-fullpage') && cE.attr('data-hasmoved') == '1'){} 2572 else if(cE.attr('data-hasmoved') == '1'){ 2573 moveID = cE.attr('data-moveidsource'); 2574 elementMoved = jQuery(".wglContainerInsideTopOnScroll *[data-moveidtarget='" + moveID + "']"); 2575 if(elementMoved.prop("nodeName") == 'THEAD'){ 2576 elementMoved.css({'display' : '', 'width' : ''}); 2577 } 2578 cE.before(elementMoved.addClass('wglKeepInsideTopOnScroll').removeClass('moved-init').removeClass('moved-ready').addClass('restored-init').removeAttr('data-hasmoved')); 2579 window.setTimeout(function(){ 2580 if(cE.html() == ''){ 2581 cE.remove(); 2582 } 2583 elementMoved.removeClass('restored-init').addClass('restored-ready'); 2584 }, 10); 2585 } 2586 } 2587 2588 var currentTime = new Date().getTime(); 2589 2590 if(currentTime - (wUiTmp['lastScrollTime']) > 1000){ 2591 window.clearInterval(wUiTmp['scrollStack']); 2592 } 2593 else{ 2594 wUiTmp['scrollStack'] = window.setTimeout(function(){ 2595 wKeepInsideTopOnScroll(); 2596 }, 10); 2597 } 2598 }); 2599 if(typeof(wOnAfterKeepInsideTopOnScroll) == 'function'){ 2600 wOnAfterKeepInsideTopOnScroll(); 2601 } 2602}; 2603 2604wSortTableRows = function(table, col, direction){ 2605 2606 var tb = table.find('tbody'), c = col - 1 || 0, d = direction || '', rs = tb.children(), rl = rs.length; 2607 2608 if(d == '' && event && event.target){ 2609 var th = event.target.nodeName == 'SPAN' ? event.target.parentNode.parentNode : (event.target.nodeName == 'DIV' ? event.target.parentNode : event.target); 2610 d = jQuery(th).attr('data-sort-status') == 'asc' ? 'desc' : 'asc'; 2611 jQuery(th).parent().find('th').attr('data-sort-status', 'init'); 2612 jQuery(th).attr('data-sort-status', d); 2613 } 2614 2615 var factors = {'KB': 1024, 'MB': 1024 * 1024, 'GB': 1024 * 1024 * 1024, 'TB': 1024 * 1024 * 1024 * 1024}; 2616 2617 if(!table.attr('data-rowspreparedforsort') || table.attr('data-rowspreparedforsort').indexOf('|' + col + '|') == -1){ 2618 for(var i = 0; i < rl; i++){ 2619 var cell = jQuery(rs[i]).children('td').get(c); 2620 var vn = cell.innerText 2621 if(/^\s*(\d+(?:[\.,\d]*))\s*(KB|MB|GB|TB)\s*$/i.test(vn)){ 2622 vn = String(factors[RegExp.$2.toUpperCase()] * RegExp.$1.replace(',','.')); 2623 } 2624 vn = vn.replace('m²', ''); 2625 vn = vn.replace(/^[^\d]+\s+(\d+)/, '$1'); 2626 vn = vn.replace(/(\d+)\,(\d+)/, '$1.$2'); 2627 jQuery(rs[i]).children('td').get(c).setAttribute('data-sv', String(vn).trim()); 2628 } 2629 table.attr('data-rowspreparedforsort', (table.attr('data-rowspreparedforsort') ? table.attr('data-rowspreparedforsort') : '|') + col + '|'); 2630 } 2631 2632 while(rl > 1){ 2633 for(var i = 0; i < rl - 1; i++){ 2634 var vc = jQuery(rs[i]).children('td').get(c).getAttribute('data-sv'); 2635 var vn = jQuery(rs[i+1]).children('td').get(c).getAttribute('data-sv'); 2636 2637 vc = /^\d+([\,\.]*\d+)?$/.test(vc) ? parseFloat(vc) : vc; 2638 vn = /^\d+([\,\.]*\d+)?$/.test(vn) ? parseFloat(vn) : vn; 2639 2640 if(d == 'asc' && vc > vn || d == 'desc' && vc < vn){ 2641 jQuery(rs[i]).before(jQuery(rs[i+1])); 2642 rs = tb.children(); 2643 } 2644 } 2645 rl -= 1; 2646 } 2647}; 2648 2649wglValidateFormInline = function(form){ 2650 jQuery(form).find('input, textarea, select').each(function(){ 2651 if(jQuery(this).attr('data-validators') && jQuery(this).attr('data-validators') != ''){ 2652 wglValidateElementInline(jQuery(this), {}); 2653 } 2654 }); 2655}; 2656 2657wglValidateElementInline = function(currentInputElement, options){ 2658 2659 var currentInput = jQuery(currentInputElement); 2660 var currentForm = currentInput.closest('form'); 2661 var async = typeof options['async'] != 'undefined' ? options['async'] : true; 2662 2663 var formPos = currentForm.attr('data-formpos'); 2664 var formAction = currentForm.attr('action'); 2665 2666 var elementName = currentInput.attr('name'); 2667 elementName = elementName.replace('[]', ''); 2668 2669 var elementValue = currentInput.val(); 2670 2671 if(currentInput.attr('type') == 'checkbox'){ 2672 elementValue = ''; 2673 currentInput.parent().parent().find('input').each(function(){ 2674 elementValue += (jQuery(this).get(0).checked ? jQuery(this).val() : ''); 2675 }); 2676 } 2677 else if(currentInput.attr('type') == 'radio'){ 2678 elementValue = ''; 2679 currentInput.parent().parent().find('input').each(function(){ 2680 elementValue += (jQuery(this).get(0).checked ? jQuery(this).val() : ''); 2681 }); 2682 } 2683 else if(currentInput.prop("tagName") == 'SELECT' && currentInput.attr('multiple') == 'multiple'){ 2684 elementValue = ''; 2685 currentInput.children().each(function(){ 2686 elementValue += (jQuery(this).get(0).selected ? jQuery(this).val() : ''); 2687 }); 2688 } 2689 2690 if(elementValue == null){ 2691 elementValue = ''; 2692 } 2693
2694 if(typeof(wTrimInputsBeforeValidateOnBlur) != 'undefined' && wTrimInputsBeforeValidateOnBlur && event && event.type == 'blur'){ 2695 if(currentInput.prop("nodeName") == 'TEXTAREA' || currentInput.attr("type") == 'text'){ 2696 currentInput.val(currentInput.val().trim()); 2697 elementValue = currentInput.val(); 2698 } 2699 } 2700 2701 wFnValidationResultSilent = function(result){ 2702 return wFnValidationResult(result, true) 2703 }; 2704 2705 wFnValidationResult = function(result, silent){ 2706 //console.log(result); 2707 2708 silent = silent === true; 2709 2710 elementsWithValidationClass = currentInput; 2711 elementsWithValidationAttr = currentInput; 2712 2713 var validationID = formPos + (elementsWithValidationClass.attr('id') ? elementsWithValidationClass.attr('id') : ''); 2714 2715 if(currentInput.attr('type') == 'checkbox' || currentInput.attr('type') == 'radio'){ 2716 validationID = formPos + (elementsWithValidationClass.attr('name').replace('[]', '') ? elementsWithValidationClass.attr('name').replace('[]', '') : ''); 2717 elementsWithValidationClass = elementsWithValidationClass.parent().parent().children(); 2718 elementsWithValidationAttr = elementsWithValidationClass.parent().parent().find('input[type="' + currentInput.attr('type') + '"]'); 2719 } 2720 2721 if(currentInput.attr('type') == 'hidden' && currentInput.attr('class') != null && currentInput.attr('class').indexOf('elementInputUpload') === -1){ 2722 validationID = formPos + (elementsWithValidationClass.attr('name').replace('[]', '') ? elementsWithValidationClass.attr('name').replace('[]', '') : ''); 2723 elementsWithValidationClass = elementsWithValidationClass.parent().parent() 2724 elementsWithValidationAttr = elementsWithValidationClass.parent().parent(); 2725 } 2726 2727 var elementToAddError = elementsWithValidationClass.parent(); 2728 2729 if(elementToAddError.get(0).nodeName === 'FIELDSET'){ 2730 elementToAddError = elementToAddError.find('legend'); 2731 } 2732 else if(elementsWithValidationClass.parent().prev('dt').length != 0){ 2733 elementToAddError = elementsWithValidationClass.parent().prev('dt'); 2734 } 2735 else if(elementsWithValidationClass.parent().prev('div').length != 0){ 2736 elementToAddError = elementsWithValidationClass.parent().prev('div'); 2737 } 2738 2739 var elementToAddOK = elementsWithValidationClass.parent(); 2740 2741 if(elementsWithValidationClass.closest('*[data-addvalidationstatusok="1"]', elementsWithValidationClass.closest('.formElement')).length != 0){ 2742 elementToAddOK = elementsWithValidationClass.closest('*[data-addvalidationstatusok="1"]', elementsWithValidationClass.closest('.formElement')); 2743 } 2744 else if(elementsWithValidationClass.attr('name') && elementsWithValidationClass.closest('form').find('label[for="' + elementsWithValidationClass.attr('name').replace('[]', '') + '"]').length != 0){ 2745 elementToAddOK = elementsWithValidationClass.closest('form').find('label[for="' + elementsWithValidationClass.attr('name').replace('[]', '') + '"]'); 2746 } 2747 else if(elementToAddOK.get(0).nodeName === 'FIELDSET'){ 2748 elementToAddOK = elementToAddOK.find('legend'); 2749 } 2750 else if(elementsWithValidationClass.parent().prev('dt').length != 0 && elementsWithValidationClass.parent().prev('dt').find('label')){ 2751 elementToAddOK = elementsWithValidationClass.parent().prev('dt').find('label'); 2752 } 2753 else if(elementsWithValidationClass.parent().prev('div').length != 0 && elementsWithValidationClass.parent().prev('div').find('label')){ 2754 elementToAddOK = elementsWithValidationClass.parent().prev('div').find('label'); 2755 } 2756 2757 if(!currentInput.attr('data-validators') && currentInput.attr('data-force-validation') != '1'){ 2758 //console.log(currentInput); 2759 } 2760 else 2761 if(result['isValid'] == false){ 2762 elementsWithValidationAttr.attr('data-isinvalid', '1'); 2763 2764 if(silent){ 2765 elementsWithValidationClass.removeClass('wglIsValid'); 2766 2767 jQuery('#validationStatus_' + validationID).remove(); 2768 2769 jQuery('#errorMessage_' + validationID).remove(); 2770 if(elementToAddError.find('.wglErrorMessageInline').length == 0){ 2771 elementToAddError.removeClass('wglContainsErrorMessageInline'); 2772 elementToAddError.find('.wglErrorMessageInline').remove(); 2773 if(currentInput.attr('aria-describedby') == 'errorMessage_' + validationID){ 2774 currentInput.removeAttr('aria-describedby'); 2775 } 2776 } 2777 } 2778 else{ 2779 elementsWithValidationClass.addClass('wglIsInvalid'); 2780 elementsWithValidationClass.removeClass('wglIsValid'); 2781 2782 jQuery('#validationStatus_' + validationID).remove(); 2783 2784 if(result['errorMessage'] != ''){ 2785 if(jQuery('#errorMessage_' + validationID).length == 0){ 2786 elementToAddError.addClass('wglContainsErrorMessageInline').append('<div class="wglErrorMessageInline" id="errorMessage_' + validationID + '" role="alert"><div>' + result['errorMessage'].replace(/\|.*/, '') + '</div></div>'); 2787 currentInput.attr('aria-describedby', 'errorMessage_' + validationID); 2788 if(elementToAddError.addClass('wglContainsErrorMessageInline').find('label').length == 2){ 2789 if(currentInput.attr('id') == elementToAddError.addClass('wglContainsErrorMessageInline').find('label').attr('for')){ 2790 jQuery('#errorMessage_' + validationID).css({'right' : String(Math.round(elementToAddError.addClass('wglContainsErrorMessageInline').width() - elementToAddError.addClass('wglContainsErrorMessageInline').find('label').width())) + 'px'}); 2791 } 2792 }
2793 (function(validationID){ 2794 window.setTimeout(function(){ 2795 jQuery('#errorMessage_' + validationID).addClass("loaded"); 2796 }, 32); 2797 })(validationID); 2798 } 2799 } 2800 } 2801 } 2802 else if(result['isValid'] == true){ 2803 elementsWithValidationAttr.removeAttr('data-isinvalid'); 2804 2805 if(silent){ 2806 elementsWithValidationClass.removeClass('wglIsInvalid'); 2807 2808 jQuery('#errorMessage_' + validationID).remove(); 2809 if(elementToAddError.find('.wglErrorMessageInline').length == 0){ 2810 elementToAddError.removeClass('wglContainsErrorMessageInline'); 2811 elementToAddError.find('.wglErrorMessageInline').remove(); 2812 if(currentInput.attr('aria-describedby') == 'errorMessage_' + validationID){ 2813 currentInput.removeAttr('aria-describedby'); 2814 } 2815 } 2816 } 2817 else{ 2818 elementsWithValidationClass.removeClass('wglIsInvalid'); 2819 elementsWithValidationClass.addClass('wglIsValid'); 2820 2821 jQuery('#errorMessage_' + validationID).remove(); 2822 if(elementToAddError.find('.wglErrorMessageInline').length == 0){ 2823 elementToAddError.removeClass('wglContainsErrorMessageInline'); 2824 elementToAddError.find('.wglErrorMessageInline').remove(); 2825 if(currentInput.attr('aria-describedby') == 'errorMessage_' + validationID){ 2826 currentInput.removeAttr('aria-describedby'); 2827 } 2828 } 2829 2830 if(jQuery('#validationStatus_' + validationID).length == 0){ 2831 elementToAddOK.addClass('wglContainsValidationStatusInline').append('<div class="wglValidationStatusOK" id="validationStatus_' + validationID + '"><div></div></div>'); 2832 (function(validationID){ 2833 window.setTimeout(function(){ 2834 jQuery('#validationStatus_' + validationID).addClass("loaded"); 2835 }, 32); 2836 })(validationID); 2837 } 2838 } 2839 } 2840 2841 wglUpdateValidationCurrentForm(currentInput); 2842 }; 2843 2844 var silent = typeof(options['userinfo']) !== 'undefined' && !options['userinfo'] ? true : false; 2845 2846 vlr = wGetValidationInfoInput(currentInput); 2847 wFnValidationResult(vlr, silent); 2848}; 2849 2850wglUpdateValidationCurrentForm = function(input){ 2851 2852 currentForm = jQuery(input).closest('form'); 2853 currentForm.attr('data-hasvalidated', '1'); 2854 currentForm.attr('data-hasinputsinvalid', '0'); 2855 currentForm.find('*[data-isinvalid="1"]').each(function(){ 2856 if(jQuery(this).closest('.wglHideConditionalFormdata').length == 0){ 2857 currentForm.attr('data-hasinputsinvalid', '1'); 2858 } 2859 }); 2860}; 2861 2862wGetValidationInfoInput = function(currentInput){ 2863 2864 var elementName = currentInput.attr('name'); 2865 elementName = elementName.replace('[]', ''); 2866 2867 var elementValue = currentInput.val(); 2868 if(currentInput.attr('type') == 'checkbox'){ 2869 elementValue = ''; 2870 currentInput.parent().parent().find('input').each(function(){ 2871 elementValue += (jQuery(this).get(0).checked ? jQuery(this).val() : ''); 2872 }); 2873 } 2874 else if(currentInput.attr('type') == 'radio'){ 2875 elementValue = ''; 2876 currentInput.parent().parent().find('input').each(function(){ 2877 elementValue += (jQuery(this).get(0).checked ? jQuery(this).val() : ''); 2878 }); 2879 } 2880 else if(currentInput.prop("tagName") == 'SELECT' && currentInput.attr('multiple') == 'multiple'){ 2881 elementValue = ''; 2882 currentInput.children().each(function(){ 2883 elementValue += (jQuery(this).get(0).selected ? jQuery(this).val() : ''); 2884 }); 2885 } 2886 2887 if(elementValue == null){ 2888 elementValue = ''; 2889 } 2890 2891 var vtv = elementValue; 2892 var vln = jQuery(currentInput).attr('data-validators') ? jQuery(currentInput).attr('data-validators') : ''; 2893 vln = vln.replace(/\\'/g, 'wBkslhApos'); 2894 if(/^(!)?preg(i)?(u)?Match(OrEmpty)?\('([^']+)'\)/.test(vln)){vln = RegExp.$1 + 'preg' + RegExp.$2 + RegExp.$3 + 'Match' + RegExp.$4 + '(\'' + RegExp.$5.replace(/\|/g, 'wPipe') + '\')';} 2895 var vls = vln.split('|'); 2896 var vlr = {'isValid' : true}; 2897 var vlv = '', regExpVal = null; 2898 for(var j = 0; j < vls.length; j ++){ 2899 vlv = vls[j]; 2900 2901 if(vlv == 'required' && vtv == ''){ 2902 vlr = {'isValid' : false}; 2903 } 2904 else if(vlv == 'captcha' && vtv == ''){ 2905 vlr = {'isValid' : false}; 2906 } 2907 else if(vlv == 'email' && !/^([a-zA-Z0-9\.\-_]+@([a-zA-Z0-9öäuÃÃÃ][a-zA-Z0-9öäuÃÃÃ\.-]*|[a-zA-Z0-9öäuÃÃÃ])\.\w\w+)$/.test(vtv) || vlv == 'emailOrEmpty' && vtv != '' && !/^([a-zA-Z0-9\.\-_]+@[a-zA-Z0-9öäuÃÃÃ][a-zA-Z0-9öäuÃÃÃ\.-]*[a-zA-Z0-9öäuÃÃÃ]\.\w\w+)$/.test(vtv)){ 2908 vlr = {'isValid' : false}; 2909 } 2910 else if(vlv == 'file' && vtv == ''){ 2911 vlr = {'isValid' : false}; 2912 } 2913 else if(/isEqualInput\((\w+)\)/.test(vlv)){ 2914 var ntc = RegExp.$1; 2915 if(vtv != jQuery('#' + ntc).val()){ 2916 vlr = {'isValid' : false}; 2917 } 2918 } 2919 else if(/maxlength\((\d+)\)/.test(vlv) && vtv.length > parseInt(RegExp.$1)){ 2920 vlr = {'isValid' : false}; 2921 } 2922 else if(/maxvalue\((\d+)\)/.test(vlv) && vtv > parseInt(RegExp.$1)){ 2923 vlr = {'isValid' : false}; 2924 } 2925 else if(/^(!)?preg(i)?(u)?Match(OrEmpty)?\('([^']+)'\)/.test(vlv)){ 2926 var regExpExt = RegExp.$2 + RegExp.$3; 2927 2928 if(RegExp.$4 == 'OrEmpty' && vtv == ''){ 2929 } 2930 else{ 2931 var isNeg = RegExp.$1 == '!'; 2932 var regExpPattern = RegExp.$5.replace(/wBkslhApos/g, '\'').replace(/wPipe/g, '|'); 2933 regExpVal = new RegExp(regExpPattern, regExpExt); 2934 if(isNeg && regExpVal.test(vtv) || !isNeg && !regExpVal.test(vtv)){ 2935 vlr = {'isValid' : false}; 2936 } 2937 } 2938 } 2939 else if(/password\w?/.test(vlv)){ 2940 var password = vtv; 2941 var rules = currentInput.data('passwordpolicy'); 2942 var rulesLocal = rules; 2943 var rulesOk = true; 2944 if(/^(\d+)\,?/.test(rules)){ 2945 lengthMin = RegExp.$1; 2946 if(password.length < lengthMin){ 2947 rulesOk = false;
2948 } 2949 } 2950 if(/^\d+\,([\w\W]+)/.test(rules)){ 2951 rulesLocal = RegExp.$1; 2952 } 2953 if(/a/.test(rulesLocal)){ 2954 if(!/[a-z]/.test(password)){ 2955 rulesOk = false; 2956 } 2957 } 2958 if(/A/.test(rulesLocal)){ 2959 if(!/[A-ZÃÃÃ]/.test(password)){ 2960 rulesOk = false; 2961 } 2962 } 2963 if(/1/.test(rulesLocal)){ 2964 if(!/[0-9]/.test(password)){ 2965 rulesOk = false; 2966 } 2967 } 2968 if(/\\$/.test(rulesLocal)){ 2969 if(!/\W/.test(password)){ 2970 rulesOk = false; 2971 } 2972 } 2973 if(!rulesOk){ 2974 vlr = {'isValid' : false}; 2975 } 2976 } 2977 if(!vlr['isValid']){ 2978 vlr['errorMessage'] = jQuery(currentInput).attr('data-errormessages'); 2979 j = vls.length; 2980 } 2981 } 2982 return vlr; 2983}; 2984 2985wPrepareHTML = function(root){ 2986 //console.log('wPrepareHTML'); 2987 2988 if(!root){ 2989 root = jQuery('body'); 2990 } 2991 2992 jQuery(root).find('.wglLightbox').wLightbox(); 2993 2994 wAjaxUrl(root); 2995 wFormElement(root); 2996 wLazyLoading(); 2997 2998 if(observeVisible){ 2999 jQuery('[data-doifbecomevisible]').each(function(index){ 3000 observeVisible.observe(jQuery(this).get(0)); 3001 }); 3002 jQuery('.wglAnimateIfVisible').each(function(index){ 3003 observeVisible.observe(jQuery(this).get(0)); 3004 }); 3005 } 3006 3007 if(observeVisibleOnce){ 3008 jQuery('[data-doifbecomevisibleonce]').each(function(index){ 3009 observeVisibleOnce.observe(jQuery(this).get(0)); 3010 }); 3011 jQuery('.wglAnimateIfVisibleOnce').each(function(index){ 3012 observeVisibleOnce.observe(jQuery(this).get(0)); 3013 }); 3014 jQuery('img.wglLazyLoadInit').each(function(index){ 3015 observeVisibleOnce.observe(jQuery(this).get(0)); 3016 }); 3017 jQuery('iframe.wglLazyLoadInit').each(function(index){ 3018 observeVisibleOnce.observe(jQuery(this).get(0)); 3019 }); 3020 } 3021}; 3022 3023wAjaxUrl = function(root){ 3024 3025 var i, j, k; 3026 3027 if(!root){ 3028 root = jQuery('body'); 3029 } 3030 3031 jQuery(root).find("a[data-ajaxurl]").each(function(){ 3032 var cE = jQuery(this); 3033 var ajaxURL = cE.data('ajaxurl'); 3034 var ajaxAddMode = cE.data('ajaxaddmode'); 3035 var ajaxTarget = cE.data('ajaxtarget'); 3036 var ajaxCallback = cE.data('ajaxcallback'); 3037 cE.on('click', function (event){ 3038 jQuery('html').addClass('adaptLoading'); 3039 3040 var elementTarget = cE.parent().parent(); 3041 3042 if(elementTarget.hasClass('elementList')){ 3043 elementTarget.addClass('adaptLoading'); 3044 elementTarget.find('.listDefault').addClass('adaptLoading'); 3045 } 3046 3047 if(typeof(wOnBeforeReloadElementByAjaxUrl) === 'function'){ 3048 wOnBeforeReloadElementByAjaxUrl(elementTarget); 3049 } 3050 3051 jQuery.ajax({type: "GET", url: ajaxURL, async: true, success: function(result){ 3052 3053 jQuery('html').removeClass('adaptLoading'); 3054 3055 if(elementTarget.hasClass('elementList')){ 3056 elementTarget.removeClass('adaptLoading'); 3057 elementTarget.find('.listDefault').removeClass('adaptLoading'); 3058 } 3059 3060 if(ajaxTarget && /^\.\.\/\.\.\/$/.test(ajaxTarget)){ 3061 elementTarget = cE.parent().parent(); 3062 } 3063 if(ajaxTarget && /^\.\.\/$/.test(ajaxTarget)){ 3064 elementTarget = cE.parent().find(RegExp.$1); 3065 } 3066 if(ajaxTarget && /^\.\.\/(\w+)/.test(ajaxTarget)){ 3067 elementTarget = cE.parent().find(RegExp.$1); 3068 } 3069 if(ajaxTarget && /^\.\.\/\.\.\/(\w+)/.test(ajaxTarget)){ 3070 elementTarget = cE.parent().parent().find(RegExp.$1); 3071 } 3072 3073 if(typeof(window[ajaxCallback]) === 'function'){ 3074 window[ajaxCallback](elementTarget, result); 3075 return; 3076 } 3077 3078 elementTarget.fadeTo(0, 0); 3079 if(ajaxAddMode == 'append'){ 3080 elementTarget.html(elementTarget.html() + result); 3081 } 3082 else{ 3083 elementTarget.html(result); 3084 } 3085 history.pushState({page: cE.attr('href')}, '', cE.attr('href')); 3086 wPrepareHTML(elementTarget.get(0)); 3087 elementTarget.fadeTo(600, 1); 3088 if(cE.attr('data-preventscrolltotarget') != '1'){ 3089 wScrollSmoothToElement(elementTarget.get(0), {'targetPos' : 'top'}); 3090 } 3091
3092 for(var addClassSelector in wCssClassesToAddGlobal){ 3093 jQuery(addClassSelector).each(function(index){ 3094 var classesToAdd = wCssClassesToAddGlobal[addClassSelector]; 3095 for(var i = 0, arrayLength = classesToAdd.length; i < arrayLength; i++){ 3096 var classData = classesToAdd[i].split('='); 3097 if(classData.length == 2){ 3098 var selector = jQuery.trim(classData[0]); 3099 if(selector == '.'){ 3100 jQuery(this).addClass(jQuery.trim(classData[1])); 3101 } 3102 else if(selector == 'parent'){ 3103 jQuery(this).parent().addClass(jQuery.trim(classData[1])); 3104 } 3105 else{ 3106 jQuery(this).find(selector).addClass(jQuery.trim(classData[1])); 3107 } 3108 } 3109 else{ 3110 jQuery(this).addClass(jQuery.trim(classData[0])); 3111 } 3112 } 3113 }); 3114 } 3115 3116 if(typeof(wOnAfterReloadElementByAjaxUrl) === 'function'){ 3117 wOnAfterReloadElementByAjaxUrl(elementTarget); 3118 } 3119 window.setTimeout(function(){ 3120 jQuery(window).trigger('resize'); 3121 }, 100); 3122 window.setTimeout(function(){ 3123 jQuery(window).trigger('resize'); 3124 }, 500); 3125 window.setTimeout(function(){ 3126 jQuery(window).trigger('resize'); 3127 }, 1000); 3128 }}); 3129 return false; 3130 }); 3131 }); 3132}; 3133 3134wFormElement = function(root){ 3135 3136 if(!root){ 3137 root = jQuery('body'); 3138 } 3139 3140 jQuery(root).find('.formElementInput input, .formElementInput select, .formElementInput textarea').each(function(){ 3141 if((!jQuery(this).attr('name') || jQuery(this).attr('name').indexOf('wFormToken') == -1)){ 3142 if(jQuery(this).prop('tagName') == 'SELECT' && !jQuery(this).attr('multiple') && jQuery(this).val() == '' || jQuery(this).prop('tagName') != 'SELECT' && jQuery(this).val() == '' && jQuery(this).text() == ''){ 3143 jQuery(this).closest('.formElementInput').addClass('empty'); 3144 } 3145 else{ 3146 jQuery(this).closest('.formElementInput').removeClass('empty'); 3147 } 3148 3149 if(jQuery(this).hasClass('wglInputTimeAfterDate') && (jQuery(this).val() != '' || jQuery(this).closest('.formElementInput').find('input.wglDatepicker').val() != '')){ 3150 jQuery(this).closest('.formElementInput').removeClass('empty'); 3151 } 3152 3153 } 3154 }); 3155 3156 jQuery(root).find('.formElementInput input, .formElementInput select, .formElementInput textarea').on('change', function(){ 3157 if(jQuery(this).prop('tagName') == 'SELECT' && !jQuery(this).attr('multiple') && jQuery(this).val() == '' || jQuery(this).prop('tagName') != 'SELECT' && jQuery(this).val() == '' && jQuery(this).text() == ''){ 3158 jQuery(this).closest('.formElementInput').addClass('empty'); 3159 } 3160 else{ 3161 jQuery(this).closest('.formElementInput').removeClass('empty'); 3162 } 3163 }); 3164 3165 jQuery(root).find('.formElementInput input, .formElementInput textarea').on('focus', function(){ 3166 jQuery(this).closest('.formElementInput').addClass('focus'); 3167 }); 3168 3169 jQuery(root).find('.formElementInput input, .formElementInput textarea').on('blur', function(){ 3170 jQuery(this).closest('.formElementInput').removeClass('focus'); 3171 }); 3172}; 3173 3174jQuery.extend(jQuery.easing, { 3175 3176 wEaseOut: function(x, t, b, c, d){ 3177 return b - c * (t /= d) * (t - 2); 3178 }, 3179 3180 wEaseOutExpo: function(x, t, b, c, d){ 3181 return (t == d) ? b + c : b + c * (-Math.pow(2, -10 * t / d) + 1); 3182 }, 3183 3184 wEaseIn: function(x, t, b, c, d){ 3185 return b + c * (t /= d) * t; 3186 } 3187}); 3188 3189jQuery.fn.wAddAnalytics = function(viewmode){ 3190 3191 jQuery.each(jQuery(this), function(){ 3192 jQuery(this).click(function(){ga('send', {'hitType': 'pageview', 'page': jQuery(this).attr('href'), 'title': jQuery(this).attr('title')})}); 3193 }); 3194}; 3195 3196jQuery.fn.wSetViewmode = function(viewmode){ 3197 3198 jQuery.each(jQuery(this), function(){ 3199 3200 var hrefNew = this.getAttribute('href') || ''; 3201 var anchor = ''; 3202 if(/#[^#]+$/.test(hrefNew)){ 3203 anchor = hrefNew.replace(/.*#/, ''); 3204 hrefNew = hrefNew.replace(/#.*/, ''); 3205 } 3206 3207 hrefNew = hrefNew.indexOf('?') != -1 ? hrefNew + '&viewmode=' + viewmode: hrefNew + '?viewmode=' + viewmode; 3208 3209 if(anchor != ''){ 3210 hrefNew += '#' + anchor; 3211 } 3212 if(this.className.indexOf('boxOnly') == -1 && this.innerHTML.indexOf('<img ') != -1){ 3213 this.style.background = 'none'; 3214 this.style.paddingLeft = 'none'; 3215 } 3216 this.setAttribute('href', hrefNew); 3217 }); 3218}; 3219 3220wOpenPrintPreview = function(width, height, name){ 3221 3222 var name = name || 'printpreview'; 3223 3224 var url = location.href.indexOf('?') == -1 ? location.href.replace(/#.*/, '') + '?viewmode=print' : location.href.replace(/#.*/, '') + '&viewmode=print'; 3225 3226 options = ',location=no,menubar=no,toolbar=no,resizable=yes,scrollbars=yes,status=no'; 3227 3228 wOpenPopupURL(url, width, height, name, options); 3229}; 3230 3231wOpenURL = function(url, target, element){ 3232 3233 target = typeof(target) != 'undefined' && target ? target : (jQuery('html.isInLightbox').length == 1 ? '_top' : ''); 3234 3235 if(location.pathname.indexOf('/weblication/grid5/') != 0){ 3236 3237 if(typeof event != 'undefined' && jQuery(event.target).closest('ul.listDefault').length > 0){ 3238 wSetScrollPosLeftList(event.target); 3239 } 3240 3241 if(/Android/i.test(navigator.userAgent)){ 3242 var cE = jQuery(element); 3243 var hrefCurrent = cE.attr('href') ? cE.attr('href') : url; 3244 if(/\.pdf$/.test(url) && !/accessDocument\.php/.test(url) && !/^https?\:\/\//.test(url)){ 3245 if(cE.attr('data-pathPrepend')){ 3246 hrefCurrent = cE.attr('data-pathPrepend') + hrefCurrent; 3247 } 3248 url = wUiTmp['wGlobalProjectPath'] + '/wGlobal/scripts/accessDocument.php?forceDownload=' + (cE.hasClass('download') ? '1' : '0') + '&document=' + encodeURIComponent(hrefCurrent); 3249 } 3250 } 3251 3252 if(target == '_blank'){ 3253 var windowOpen = window.open(url); 3254 if(!/^\/\w+/.test(url)){ 3255 windowOpen.opener = null; 3256 windowOpen.location = url; 3257 } 3258 } 3259 else if(target == '_top'){ 3260 top.location.href = url; 3261 } 3262 else if(target.indexOf('embedListEntrySelf') !== -1){ 3263 var options = {}; 3264 var i = 8; 3265 while(element.nodeName != 'LI' && i-- > 0){ 3266 element = element.parentNode; 3267 } 3268 if(element.nodeName == 'LI'){ 3269 options['embedRoot'] = element.getAttribute('data-embedroot') ? element.getAttribute('data-embedroot') : (element.parentNode.getAttribute('data-embedroot') ? element.parentNode.getAttribute('data-embedroot') : ''); 3270 options['embedClass'] = element.getAttribute('data-embedclass') ? element.getAttribute('data-embedclass') : (element.parentNode.getAttribute('data-embedclass') ? element.parentNode.getAttribute('data-embedclass') : ''); 3271 options['embedClassAdditional'] = element.getAttribute('data-embedclassadditional') ? element.getAttribute('data-embedclassadditional') : (element.parentNode.getAttribute('data-embedclassadditional') ? element.parentNode.getAttribute('data-embedclassadditional') : ''); 3272 options['embedBefore'] = element.getAttribute('data-embedbefore') ? element.getAttribute('data-embedbefore') : (element.parentNode.getAttribute('data-embedbefore') ? element.parentNode.getAttribute('data-embedbefore') : ''); 3273 options['embedMultiple'] = element.getAttribute('data-embedmultiple') ? element.getAttribute('data-embedmultiple') : (element.parentNode.getAttribute('data-embedmultiple') ? element.parentNode.getAttribute('data-embedmultiple') : ''); 3274 if(element.parentNode.getAttribute('data-scrolltopoffsetifnotvisibleembed') == 'listEntryHeight'){ 3275 options['scrollTopOffset'] = element.offsetHeight; 3276 } 3277 } 3278 wEmbedPage(url, 'listEntrySelf', element, options); 3279 } 3280 else if(target.indexOf('embedListNextRow') !== -1){ 3281 var options = {}; 3282 var i = 8; 3283 while(element.nodeName != 'LI' && i-- > 0){ 3284 element = element.parentNode; 3285 } 3286 if(element.nodeName == 'LI'){ 3287 options['embedRoot'] = element.getAttribute('data-embedroot') ? element.getAttribute('data-embedroot') : (element.parentNode.getAttribute('data-embedroot') ? element.parentNode.getAttribute('data-embedroot') : ''); 3288 options['embedClass'] = element.getAttribute('data-embedclass') ? element.getAttribute('data-embedclass') : (element.parentNode.getAttribute('data-embedclass') ? element.parentNode.getAttribute('data-embedclass') : ''); 3289 options['embedClassAdditional'] = element.getAttribute('data-embedclassadditional') ? element.getAttribute('data-embedclassadditional') : (element.parentNode.getAttribute('data-embedclassadditional') ? element.parentNode.getAttribute('data-embedclassadditional') : ''); 3290 options['embedScrollElement'] = element.getAttribute('data-embedscrollelement') ? element.getAttribute('data-embedscrollelement') : (element.parentNode.getAttribute('data-embedscrollelement') ? element.parentNode.getAttribute('data-embedscrollelement') : ''); 3291 if(element.parentNode.getAttribute('data-scrolltopoffsetifnotvisibleembed') == 'listEntryHeight'){ 3292 options['scrollTopOffset'] = element.offsetHeight; 3293 } 3294 } 3295 wEmbedPage(url, 'listNextRow', element, options); 3296 } 3297 else if(target.indexOf('embedBody') !== -1){ 3298 var options = {}; 3299 options['embedRoot'] = element.getAttribute('data-embedroot') ? element.getAttribute('data-embedroot') : (element.parentNode.getAttribute('data-embedroot') ? element.parentNode.getAttribute('data-embedroot') : ''); 3300 options['embedClass'] = element.getAttribute('data-embedclass') ? element.getAttribute('data-embedclass') : (element.parentNode.getAttribute('data-embedclass') ? element.parentNode.getAttribute('data-embedclass') : ''); 3301 options['embedClassAdditional'] = element.getAttribute('data-embedclassadditional') ? element.getAttribute('data-embedclassadditional') : (element.parentNode.getAttribute('data-embedclassadditional') ? element.parentNode.getAttribute('data-embedclassadditional') : ''); 3302 wEmbedPage(url, 'body', element, options); 3303 } 3304 else if(target.indexOf('box') !== -1){ 3305 if(typeof(element) != 'undefined' && element.nodeType && element.nodeType == 1){ 3306 wLightbox(jQuery(element), {"variant": target, "href" : url}); 3307 } 3308 else{ 3309 wLightbox({"variant": target, "href" : url}); 3310 } 3311 } 3312 else if(url !== undefined){ 3313 if(url.indexOf('#') == 0){ 3314 wScrollSmoothToElement(url); 3315 } 3316 else { 3317 location.href = url; 3318 } 3319 } 3320 } 3321}; 3322 3323wSetParameterAndReload = function(name, value){ 3324 3325 location.href = wSetParameter(location.href, name, value); 3326}; 3327 3328wSetParameter = function(url, name, value){ 3329 3330 var urlHash = ''; 3331 if(/(#[\w\W]*)$/.test(url)){ 3332 urlHash = RegExp.$1; 3333 url = url.replace(/(#[\w\W]*)$/, ''); 3334 } 3335 3336 var paramReg = new RegExp('([\\?\\&])' + name + '=([^\\&]+)'); 3337 if(paramReg.test(url)){ 3338 if(value == ''){ 3339 url = url.replace(paramReg, RegExp.$1); 3340 url = url.replace(/([\?\&])[\?\&]+/g, '$1'); 3341 url = url.replace(/[\?\&]$/g, ''); 3342 } 3343 else{ 3344 url = url.replace(paramReg, RegExp.$1 + name + '=' + value); 3345 } 3346 } 3347 else if(value == ''){ 3348 3349 } 3350 else if(url.indexOf('?') != -1){ 3351 url += '&' + name + '=' + value; 3352 } 3353 else{ 3354 url += '?' + name + '=' + value; 3355 } 3356 return url + urlHash; 3357}; 3358 3359wEmbedPage = function(url, target, element, options){ 3360 3361 options = options || {}; 3362 3363 options['type'] = options['type'] || 'ajax'; 3364 options['embedRoot'] = options['embedRoot'] || ''; 3365 options['scrollTopOffset'] = options['scrollTopOffset'] || 0; 3366 3367 var id = 'wEmbededPage-' + String(parseInt(Math.random() * 100000)); 3368 3369 var elementToAppend = element; 3370 var rootSameEmbed = jQuery('body'); 3371 3372 if(target == 'listEntrySelf'){ 3373 3374 if(url == wUiTmp['wEmbePageCurrentURL']){ 3375 wUiTmp['wEmbePageCurrentURL'] = ''; 3376 wEmbedPageClose(); 3377 return false;
3378 } 3379 3380 wUiTmp['wEmbePageCurrentURL'] = url; 3381 3382 rootSameEmbed = jQuery(element).closest('li').length == 1 ? jQuery(element).closest('li') : rootSameEmbed; 3383 3384 elementToAppend = jQuery(element).get(0); 3385 3386 if(options['embedMulti'] != '1'){ 3387 rootSameEmbed.parent().find('.wEmbededPage-' + target).remove(); 3388 } 3389 3390 if(options['embedMulti'] == '1' || rootSameEmbed.find('.wEmbededPage-' + target).length == 0){ 3391 var embedClass = options['embedClass'] && options['embedClass'] != '' ? ' wEmbededPage-' + options['embedClass'] : ''; 3392 if(options['embedClassAdditional'] && options['embedClassAdditional'] != ''){ 3393 embedClass += ' ' + options['embedClassAdditional']; 3394 } 3395 var embedHTML = '<div id="' + id + '" class="wEmbededPage wEmbededPage-' + target + ' wEmbededPage-' + options['type'] + embedClass + '" data-embedpagetarget="' + target + '" data-src="' + url + '"' + (options['embedMulti'] == '1' ? ' data-multi="1"' : '') + ' onclick="event.stopPropagation()"><div class="wEmbededPageInner"></div><div class="wEmbededPageCloser" onclick="wEmbedPageClose(event)"></div></div>'; 3396 if(options['embedBefore'] && jQuery(element).find(options['embedBefore']).length != 0){ 3397 jQuery(embedHTML).insertBefore(jQuery(element).find(options['embedBefore'])); 3398 } 3399 else{ 3400 jQuery(embedHTML).appendTo(elementToAppend); 3401 } 3402 } 3403 else{ 3404 rootSameEmbed.find('.wEmbededPage-' + target).attr('id', id); 3405 } 3406 if(options['embedMulti'] != '1'){ 3407 jQuery(element).siblings().removeClass('listEntryHasEmbedded'); 3408 } 3409 jQuery(element).addClass('listEntryHasEmbedded'); 3410 } 3411 else if(target == 'listNextRow'){ 3412 3413 if(url == wUiTmp['wEmbePageCurrentURL']){ 3414 wUiTmp['wEmbePageCurrentURL'] = ''; 3415 wEmbedPageClose(); 3416 return false; 3417 } 3418 3419 wUiTmp['wEmbePageCurrentURL'] = url; 3420 3421 rootSameEmbed = jQuery(element).closest('ul').length == 1 ? jQuery(element).closest('ul') : rootSameEmbed; 3422 3423 elementToAppend = jQuery(element).parent().children().last().get(0); 3424 var offsetTopCurrent = element.offsetTop; 3425 3426 jQuery(element).nextAll().each(function(){ 3427 if(jQuery(this).get(0).offsetTop > offsetTopCurrent){ 3428 elementToAppend = jQuery(this).prev().get(0); 3429 return false; 3430 } 3431 }); 3432 3433 if(elementToAppend != wUiTmp['wEmbePagecEToAppend']){ 3434 rootSameEmbed.find('.wEmbededPage-' + target).remove(); 3435 } 3436 3437 if(rootSameEmbed.find('.wEmbededPage-' + target).length == 0){ 3438 var embedClass = options['embedClass'] && options['embedClass'] != '' ? ' wEmbededPage-' + options['embedClass'] : ''; 3439 if(options['embedClassAdditional'] && options['embedClassAdditional'] != ''){ 3440 embedClass += ' ' + options['embedClassAdditional']; 3441 } 3442 jQuery('<li id="' + id + '" class="wEmbededPage wEmbededPage-' + target + ' wEmbededPage-' + options['type'] + embedClass + '" data-embedpagetarget="' + target + '" data-src="' + url + '"><div class="wEmbededPageInner" data-scrollelement="' + options['embedScrollElement'] + '"></div><div class="wEmbededPageCloser" onclick="event.stopPropagation();wEmbedPageClose(event);return false;"></div></li>').insertAfter(elementToAppend); 3443 } 3444 else{ 3445 rootSameEmbed.find('.wEmbededPage-' + target).attr('id', id); 3446 } 3447 } 3448 else{ 3449 if(url == wUiTmp['wEmbePageCurrentURL']){ 3450 wUiTmp['wEmbePageCurrentURL'] = ''; 3451 wEmbedPageClose(); 3452 return false; 3453 } 3454 3455 wUiTmp['wEmbePageCurrentURL'] = url; 3456 3457 elementToAppend = rootSameEmbed; 3458 var offsetTopCurrent = element.offsetTop; 3459 3460 if(rootSameEmbed.find('.wEmbededPage-' + target).length == 0){ 3461 var embedClass = options['embedClass'] && options['embedClass'] != '' ? ' wEmbededPage-' + options['embedClass'] : ''; 3462 if(options['embedClassAdditional'] && options['embedClassAdditional'] != ''){ 3463 embedClass += ' ' + options['embedClassAdditional']; 3464 } 3465 jQuery('<div id="' + id + '" class="wEmbededPage wEmbededPage-' + target + ' wEmbededPage-' + options['type'] + embedClass + '" data-embedpagetarget="' + target + '" data-src="' + url + '"><div class="wEmbededPageInner"></div><div class="wEmbededPageCloser" onclick="wEmbedPageClose(event)"></div></div>').appendTo(elementToAppend); 3466 } 3467 else{ 3468 rootSameEmbed.find('.wEmbededPage-' + target).attr('id', id); 3469 } 3470 } 3471 3472 rootSameEmbed.find('.wEmbededPage-' + target).addClass('loading'); 3473 3474 wUiTmp['wEmbePagecEToAppend'] = elementToAppend; 3475 3476 jQuery(element).siblings().removeClass('listEntrySelected'); 3477 jQuery(element).addClass('listEntrySelected'); 3478 3479 jQuery('html').removeClass('embedpage-loaded'); 3480 jQuery('html').addClass('embedpage-loading'); 3481 jQuery('html').addClass('embedpage-open'); 3482 jQuery('html').addClass('embedpage-' + target + '-open'); 3483 3484 jQuery.ajax({type: "GET", url: url, success: function(result){ 3485 htmlToEmbed = result.replace(/^[\s\S]*<body[^>]*>/, '').replace(/<\/body[^>]*>[\s\S]*$/, ''); 3486 if(typeof(wOnBeforeEmbedPage) === 'function'){ 3487 wOnBeforeEmbedPage(htmlToEmbed, url); 3488 } 3489 3490 var htmlToEmbedElement = document.createElement('div'); 3491 htmlToEmbedElement.innerHTML = htmlToEmbed; 3492 3493 if(typeof(wKeepIDsInEmbededPage) == 'undefined' || !wKeepIDsInEmbededPage){ 3494 htmlToEmbed = htmlToEmbed.replace(/ id="([^"]*)"/g, ' id="embed_$1"'); 3495 htmlToEmbed = htmlToEmbed.replace(/ id="embed_(tab|accordion|container|pictureGallery|bannerSlider|listEntries)/g, ' id="$1'); 3496 } 3497 3498 var scriptsCurrent = document.getElementsByTagName('script'); 3499 var scriptsToEmbed = []; 3500 3501 if(/<script[^>]*src="([^"]+jquery-ui\.js)/.test(result) && !/<script[^>]*src="([^"]+jquery-ui\.js)/.test(document.documentElement.innerHTML)){ 3502 scriptsToEmbed.push(RegExp.$1); 3503 } 3504 3505 if(/<script[^>]*src="([^"]+\.date\.js)/.test(result) && !/<script[^>]*src="([^"]+\.date\.js)/.test(document.documentElement.innerHTML)){ 3506 scriptsToEmbed.push(RegExp.$1); 3507 } 3508 3509 if(/<script[^>]*src="([^"]+\/pictureGallery\.js)/.test(result) && !/<script[^>]*src="([^"]+\/pictureGallery\.js)/.test(document.documentElement.innerHTML)){ 3510 scriptsToEmbed.push(RegExp.$1); 3511 } 3512 3513 if(/<script[^>]*src="([^"]+\/bannerSlider\.js)/.test(result) && !/<script[^>]*src="([^"]+\/bannerSlider\.js)/.test(document.documentElement.innerHTML)){ 3514 scriptsToEmbed.push(RegExp.$1); 3515 } 3516 3517 htmlToEmbed = htmlToEmbed.replace(/<script[^>]+src="[^>]+>([\s\n\r\t]*<\/script>)?/g, ''); 3518 htmlToEmbed = htmlToEmbed.replace('<div id="cookieNotice"', '<div style="display:none"'); 3519 htmlToEmbed = htmlToEmbed.replace('<div id="dntNotice"', '<div style="display:none"'); 3520 3521 for(var i = 0; i < scriptsToEmbed.length; i++){ 3522 var scriptElement = document.createElement('script'); 3523 scriptElement.setAttribute('type', 'text/javascript'); 3524 scriptElement.setAttribute('src', scriptsToEmbed[i]); 3525 scriptElement.setAttribute('data-hasloadtoembed', '1'); 3526 if(typeof(callbackOnLoad) === 'function'){ 3527 scriptElement.wAddEvent('load', callbackOnLoad); 3528 } 3529 document.body.appendChild(scriptElement); 3530 } 3531 3532 if(options['embedRoot'] && options['embedRoot'] != ''){ 3533 if(typeof(wKeepIDsInEmbededPage) == 'undefined' || !wKeepIDsInEmbededPage){ 3534 options['embedRoot'] = options['embedRoot'].replace('#', '#embed_'); 3535 } 3536 3537 var tmpFragment = document.createElement('DIV'); 3538 tmpFragment.innerHTML = htmlToEmbed; 3539 3540 var resultNode = tmpFragment.querySelector(options['embedRoot']); 3541 3542 if(resultNode){ 3543 htmlToEmbed = resultNode.innerHTML; 3544 } 3545 } 3546 3547 var tmp = ''; 3548 var jsStr = ''; 3549 var strArray = htmlToEmbed.split(/<script[^>]*>
3549/); 3550 3551 tmp += strArray[0]; 3552 3553 for(var i = 1; i < strArray.length; i++){ 3554 strArray[i] = strArray[i].replace(/^([\s\S]*)<\/script[^>]*>/m, ''); 3555 jsStr += RegExp.$1.replace(/;?[\n\r\t\s]*$/, ';').replace(/;+$/, ';'); 3556 tmp += strArray[i]; 3557 } 3558 3559 htmlToEmbed = tmp; 3560 3561 jQuery('#' + id).find('.wEmbededPageInner').html(htmlToEmbed); 3562 3563 for(var addClassSelector in wCssClassesToAddGlobal){ 3564 jQuery('#' + id).find(addClassSelector).each(function(index){ 3565 var classesToAdd = wCssClassesToAddGlobal[addClassSelector]; 3566 for(var i = 0, arrayLength = classesToAdd.length; i < arrayLength; i++){ 3567 var classData = classesToAdd[i].split('='); 3568 if(classData.length == 2){ 3569 var selector = jQuery.trim(classData[0]); 3570 if(selector == '.'){ 3571 jQuery(this).addClass(jQuery.trim(classData[1])); 3572 } 3573 else if(selector == 'parent'){ 3574 jQuery(this).parent().addClass(jQuery.trim(classData[1])); 3575 } 3576 else{ 3577 jQuery(this).find(selector).addClass(jQuery.trim(classData[1])); 3578 } 3579 } 3580 else{ 3581 jQuery(this).addClass(jQuery.trim(classData[0])); 3582 } 3583 } 3584 }); 3585 } 3586 3587 jQuery('#' + id).find('.wEmbededPageInner .wglBannerSlider').wBannerSlider(); 3588 jQuery('#' + id).find('.wEmbededPageInner .wglSmartSlider').wSmartSlider(); 3589 jQuery('#' + id).find('.wEmbededPageInner .wglPictureGallery').wPictureGallery(); 3590 3591 if(typeof(wExecuteJsInEmbededPage) != 'undefined' && wExecuteJsInEmbededPage){ 3592 try{eval(jsStr);}catch(e){} 3593 } 3594 3595 jQuery('#' + id).on('scroll', function(){ 3596 jQuery(window).trigger('scroll'); 3597 }); 3598 3599 var [query, hash] = url.split('#'); 3600 jQuery('#' + id).find('.wEmbededPageInner .wglTabcontainer').wTabcontainer({'curHashId' : '#' + hash}); 3601 jQuery('#' + id).find('.wEmbededPageInner .wglAccordion').wAccordion(); 3602 jQuery('#' + id).find('.wEmbededPageInner .wglBannerSlider').wBannerSlider(); 3603 jQuery('#' + id).find('.wEmbededPageInner .wglSmartSlider').wSmartSlider(); 3604 jQuery('#' + id).find('.wEmbededPageInner .wglPictureGallery').wPictureGallery(); 3605 jQuery('#' + id).find('.wEmbededPageInner .wglMagnifier').wMagnifier(); 3606 jQuery('#' + id).find('.wEmbededPageInner .wglLightbox').wLightbox(); 3607 jQuery('#' + id).find('.wEmbededPageInner .wglMaximizer').wMaximizer(); 3608 jQuery('#' + id).find('.wEmbededPageInner .wglDatepicker').wDatepicker(); 3609 jQuery('#' + id).find('.wEmbededPageInner .wglTicker').wTicker(); 3610 jQuery('#' + id).find('.wEmbededPageInner .wglSearchSuggest').wSearchSuggest(); 3611 jQuery('#' + id).find('.wEmbededPageInner textarea[data-autoheight="1"]').wAutoheight(); 3612 jQuery('#' + id).find('.wEmbededPageInner').wOptimizePictureSizes(); 3613 3614 wAdaptConditionalFormData(); 3615 wInitInlineValidation(); 3616 3617 window.setTimeout(function(){ 3618 wLazyLoading(); 3619 window.setTimeout(function(){ 3620 wLazyLoading(); 3621 }, 720); 3622 }, 160); 3623 3624 wPrepareHTML(); 3625 3626 jQuery('html').removeClass('embedpage-loading'); 3627 jQuery('html').addClass('embedpage-loaded'); 3628 rootSameEmbed.find('.wEmbededPage-' + target).removeClass('loading'); 3629 3630 if(typeof(wOnAfterEmbedPage) === 'function'){ 3631 wOnAfterEmbedPage(rootSameEmbed.find('.wEmbededPage-' + target).get(0), url); 3632 } 3633 3634 if(target == 'listNextRow'){ 3635 wScrollSmoothToElement(jQuery('#' + id).find('.wEmbededPageInner').get(0), {'targetPos' : 'top', 'scrollTopOffset' : options['scrollTopOffset']}); 3636 } 3637 3638 if(typeof(wSimulateBreakpointsInEmbededPage) != 'undefined' && wSimulateBreakpointsInEmbededPage){ 3639 window.setTimeout(function(){ 3640 if(typeof(wSimulateBreakpointsIfNeccessary) != 'undefined'){ 3641 wSimulateBreakpointsIfNeccessary({root : jQuery('#' + id).find('.wEmbededPageInner').get(0), urlToSimulate : url}); 3642 } 3643 }, 1000); 3644 } 3645 }}); 3646}; 3647 3648wEmbedPageClose = function(event){ 3649 3650 if(typeof(event) != 'undefined'){ 3651 event.stopPropagation(); 3652 } 3653 3654 var rootSameEmbed = jQuery('body'); 3655 3656 if(typeof(event) != 'undefined' && jQuery(event.target).closest('li[data-embedpagetarget="listNextRow"]').length == 1){ 3657 rootSameEmbed = jQuery(event.target).closest('ul') 3658 } 3659 3660 document.documentElement.className = document.documentElement.className.replace(/embedpage-\w+-open/, ''); 3661 3662 jQuery('html').removeClass('embedpage-open'); 3663 jQuery('html').removeClass('embedpage-loaded'); 3664 jQuery('script[data-hasloadtoembed="1"]').remove(); 3665 3666 if(typeof(event) != 'undefined' && jQuery(event.target).closest('.wEmbededPage').length == 1 && jQuery(event.target).closest('.wEmbededPage').attr('data-multi') == '1'){ 3667 var embedCurrent = jQuery(event.target).closest('.wEmbededPage'); 3668 embedCurrent.closest('li.listEntryHasEmbedded').removeClass('listEntryHasEmbedded'); 3669 embedCurrent.closest('li.listEntrySelected').removeClass('listEntrySelected'); 3670 embedCurrent.siblings().removeClass('listEntrySelected'); 3671 embedCurrent.siblings().removeClass('listEntryHasEmbedded'); 3672 embedCurrent.remove(); 3673 } 3674 else{ 3675 rootSameEmbed.find('.wEmbededPage').closest('li.listEntryHasEmbedded').removeClass('listEntryHasEmbedded'); 3676 rootSameEmbed.find('.wEmbededPage').closest('li.listEntrySelected').removeClass('listEntrySelected'); 3677 rootSameEmbed.find('.wEmbededPage').siblings().removeClass('listEntrySelected'); 3678 rootSameEmbed.find('.wEmbededPage').siblings().removeClass('listEntryHasEmbedded'); 3679 rootSameEmbed.find('.wEmbededPage').remove(); 3680 } 3681 3682 wUiTmp['wEmbePageCurrentURL'] = ''; 3683
3684 if(typeof(wOnAfterCloseEmbedPage) === 'function'){ 3685 wOnAfterCloseEmbedPage(); 3686 } 3687}; 3688 3689wOpenPopupURL = function(url, width, height, name, options){ 3690 3691 var name = name || ''; 3692 3693 if(width == '' || width == ' ' || typeof(width) == 'undefined'){ 3694 width = 786; 3695 } 3696 if(height == '' || height == ' ' || typeof(height) == 'undefined'){ 3697 height = 677; 3698 } 3699 3700 url = url.replace(/&/g, '&'); 3701 options = options || ',location=no,menubar=no,toolbar=no,resizable=yes,scrollbars=yes,status=no'; 3702 3703 var width = parseInt(width); 3704 var height = parseInt(height); 3705 3706 var posLeft = (screen.width / 2) - (width / 2); 3707 var posTop = (screen.height / 2) - (height / 2); 3708 3709 var windowOpen = window.open(url, name, 'top='+posTop+',left='+posLeft+',width='+width+',height='+height+',' + options); 3710 if(!/^\/\w+/.test(url)){ 3711 windowOpen.opener = null; 3712 windowOpen.location = url; 3713 } 3714}; 3715 3716wDisableAnalytics = function(){ 3717 3718 document.cookie = 'disableGoogleAnalytics=1;path=/;sameSite=Lax;expires='+(new Date(new Date().getTime() + 365 * 1000 * 60 * 60 * 24).toGMTString()); 3719 if(window['gaId']){ 3720 window['ga-disable-' + window['gaId']] = true; 3721 } 3722 else if(typeof(gaOptout) != 'undefined'){ 3723 gaOptout(); 3724 } 3725}; 3726 3727wDisableWaNextRequest = function(){ 3728 3729 document.cookie = 'wDisableWaNextRequest=1;path=/;sameSite=Lax'; 3730}; 3731 3732wSendMailNospam = function(data){ 3733 3734 var rtc = true; 3735 if(typeof(wOnBeforeClickSendMailNospam) == 'function'){ 3736 rtc = wOnBeforeClickSendMailNospam(data.replace('|', '@').replace(/wApos/, "'"), event); 3737 } 3738 if(rtc){ 3739 top.location.href = 'mailto:' + data.replace('|', '@').replace(/wApos/, "'", event); 3740 } 3741}; 3742 3743wAdaptConditionalFormData = function(){ 3744 3745 jQuery("*[data-conditionalformdata]").each(function(){ 3746 var cE = jQuery(this); 3747 3748 var conditionalformdata = cE.data('conditionalformdata'); 3749 var conditionalFormDataArray = conditionalformdata.split('|AND|'); 3750 3751 for(var k = 0; k < conditionalFormDataArray.length; k++){ 3752 var type = 'showIf'; 3753 var dyndisplayOperator = 'and'; 3754 var callbackJS = ''; 3755 var conditionalformdata = conditionalFormDataArray[k]; 3756 3757 if(/callbackJS\:([^;]+)/.test(conditionalformdata)){ 3758 callbackJS = RegExp.$1; 3759 } 3760 3761 if(/type\:(showIf|hideIf)/.test(conditionalformdata)){ 3762 type = RegExp.$1; 3763 } 3764 3765 if(/operator\:(and|or)/.test(conditionalformdata)){ 3766 dyndisplayOperator = RegExp.$1; 3767 } 3768 3769 if(/conditions\:(.*)/.test(conditionalformdata)){ 3770 conditionalformdata = RegExp.$1; 3771 } 3772 3773 conditionalformdata = conditionalformdata.replace(/,([\w\-]+(==|\!=|\>=|\>|\<=|\<|)')/g, '_WCMA_$1'); 3774 3775 var conditionalFormDatas = conditionalformdata.split('_WCMA_'); 3776 var isActive = dyndisplayOperator == 'or' ? false : true; 3777 var isActiveCurrent = false; 3778 3779 for(var i = 0; i < conditionalFormDatas.length; i++){ 3780 3781 conditionalFormDatas[i] = conditionalFormDatas[i].replace("\\'", 'WBSAP'); 3782 3783 /^([\w\-]+)(\=\=|\!\=|<\=|<|>|>\=|pregMatch|\!pregMatch|contains|\!contains|pregiMatch|\!pregiMatch|containsi|\!containsi|callback)\'([^\']*)\'/.test(conditionalFormDatas[i]); 3784 3785 var elementToObserveName = RegExp.$1; 3786 var operator = RegExp.$2; 3787 var condition = RegExp.$3.replace('WBSAP', "'").replace('wMyProject::', ''); 3788 3789 if(condition.substr(0, 1) == '$'){ 3790 var elementWidthConditionName = condition.substr(1); 3791 var elementWithConditionValue = null; 3792 var elementWithCondition = cE.closest('form').find("*[name='" + elementWidthConditionName + "']"); 3793 if(elementWithCondition.length != 0){ 3794 condition = elementWithCondition.val(); 3795 3796 if(elementWithCondition.attr('type') == 'radio'){ 3797 elementWithConditionValue = cE.closest('form').find("input[name='" + elementWidthConditionName + "']:checked, input[name='" + elementWidthConditionName + "[]:checked']"); 3798 if(elementWithConditionValue.length != 0){ 3799 condition = elementWithConditionValue.val(); 3800 } 3801 else{ 3802 condition = ''; 3803 } 3804 } 3805 else if(elementWithCondition.attr('type') == 'checkbox'){ 3806 condition = new Array(); 3807 elementToObserve.each(function(){ 3808 if(jQuery(this).is(':checked')){ 3809 condition.push(jQuery(this).val()); 3810 } 3811 }); 3812 } 3813 } 3814 } 3815 3816 var elementToObserve = cE.closest('form').find("*[name='" + elementToObserveName + "'], *[name='" + elementToObserveName + "[]']");
3817 var elementToObserveValue = elementToObserve; 3818 var value = elementToObserveValue.length > 0 ? elementToObserveValue.val() : ''; 3819 3820 if(jQuery(elementToObserveValue).hasClass('elementInputDate')){ 3821 value = value.replace(/^[a-zA-Z]+, /, ''); 3822 if(/^\d\d\.\d\d\.\d\d\d\d$/.test(value)){ 3823 value = value.substr(6, 4) + '-' + value.substr(3, 2) + '-' + value.substr(0, 2); 3824 } 3825 if(/^\d\d\.\d\d\.\d\d\d\d$/.test(condition)){ 3826 condition = condition.substr(6, 4) + '-' + condition.substr(3, 2) + '-' + condition.substr(0, 2); 3827 } 3828 } 3829 3830 //console.log(elementToObserveName + '(' + value + ') ' + operator + ' ' + condition); 3831 3832 if(elementToObserve.attr('type') == 'file'){ 3833 if(elementToObserve.attr('data-isUploaded') && elementToObserve.attr('data-isUploaded') === '1'){ 3834 value = 'wIsUploaded'; 3835 } 3836 } 3837 else 3838 if(elementToObserve.attr('type') == 'radio'){
3839 elementToObserveValue = cE.closest('form').find("input[name='" + elementToObserveName + "']:checked, input[name='" + elementToObserveName + "[]:checked']"); 3840 if(elementToObserveValue.length != 0){ 3841 value = elementToObserveValue.val(); 3842 } 3843 else{ 3844 value = ''; 3845 } 3846 } 3847 else if(elementToObserve.attr('type') == 'checkbox'){ 3848 value = new Array(); 3849 elementToObserve.each(function(){ 3850 if(jQuery(this).is(':checked')){ 3851 value.push(jQuery(this).val()); 3852 } 3853 }); 3854 } 3855 3856 if(!elementToObserve.data('hasaddedobserver')){ 3857 elementToObserve.data('hasaddedobserver', true); 3858 elementToObserve.on('change keyup', function(){wAdaptConditionalFormData();}); 3859 } 3860 3861 isActiveCurrent = false; 3862 3863 if(operator == '<' || operator == '<=' || operator == '>=' || operator == '>'){ 3864 if(!jQuery(elementToObserveValue).hasClass('elementInputDate')){ 3865 value = isNaN(parseFloat(value)) ? 0 : parseFloat(value); 3866 } 3867 } 3868 3869 var regExpOperator = null; 3870 if(operator == 'pregMatch' || operator == '!pregMatch'){ 3871 regExpOperator = new RegExp(condition); 3872 } 3873 else if(operator == 'pregiMatch' || operator == '!pregiMatch'){ 3874 regExpOperator = new RegExp(condition, 'i'); 3875 } 3876 3877 if(Array.isArray(value) && condition == ''){ 3878 if(operator == '!=' && value.length != 0 || operator == '==' && value.length == 0){ 3879 if(dyndisplayOperator == 'or'){ 3880 isActive = true; 3881 break; 3882 } 3883 } 3884 else{ 3885 if(dyndisplayOperator == 'and'){ 3886 isActive = false; 3887 break; 3888 } 3889 } 3890 } 3891 else if(Array.isArray(value) && condition.indexOf('|') == -1){ 3892 if(operator == '!=' && value.indexOf(condition) == -1 || operator == '==' && value.indexOf(condition) != -1){ 3893 if(dyndisplayOperator == 'or'){ 3894 isActive = true; 3895 break; 3896 } 3897 } 3898 else{ 3899 if(dyndisplayOperator == 'and'){ 3900 isActive = false; 3901 break; 3902 } 3903 } 3904 } 3905 else if(Array.isArray(value)){ 3906 var conditions = condition.split('|'); 3907 isActiveCurrent = false; 3908 for(var j = 0; j < conditions.length; j++){ 3909 if(operator == '!=' && value.indexOf(conditions[j]) == -1 || operator == '==' && value.indexOf(conditions[j]) != -1){ 3910 isActiveCurrent = true; 3911 break; 3912 } 3913 } 3914 if(isActiveCurrent){ 3915 if(dyndisplayOperator == 'or'){ 3916 isActive = true; 3917 break; 3918 } 3919 } 3920 else{ 3921 if(dyndisplayOperator == 'and'){ 3922 isActive = false; 3923 break; 3924 } 3925 } 3926 } 3927 else if(operator == 'pregMatch' && regExpOperator.test(value) || operator == '!pregMatch' && !regExpOperator.test(value) || operator == 'pregiMatch' && regExpOperator.test(value) || operator == '!pregiMatch' && !regExpOperator.test(value)){ 3928 if(dyndisplayOperator == 'or'){ 3929 isActive = true; 3930 break; 3931 } 3932 } 3933 else if(operator == 'contains' && value.indexOf(condition) != -1 || operator == '!contains' && value.indexOf(condition) == -1 || operator == 'containsi' && value.toLowerCase().indexOf(condition.toLowerCase()) != -1 || operator == '!containsi' && value.toLowerCase().indexOf(condition.toLowerCase()) == -1){ 3934 if(dyndisplayOperator == 'or'){ 3935 isActive = true; 3936 break; 3937 } 3938 } 3939 else if(operator == '!=' && value != condition || operator == '==' && value == condition || operator == '<' && value < condition || operator == '<=' && value <= condition || operator == '>=' && value >= condition || operator == '>' && value > condition){ 3940 if(dyndisplayOperator == 'or'){ 3941 isActive = true; 3942 break; 3943 } 3944 } 3945 else if(operator == 'callback' && typeof(globalThis[condition]) === 'function' && globalThis[condition](value)){ 3946 if(dyndisplayOperator == 'or'){ 3947 isActive = true; 3948 break; 3949 } 3950 } 3951 else{ 3952 if(dyndisplayOperator == 'and'){ 3953 isActive = false;
3954 break; 3955 } 3956 } 3957 } 3958 if(!isActive){ 3959 break; 3960 } 3961 } 3962 3963 var hasChangedDisplay = false; 3964 3965 if(type == 'showIf' && !isActive || type == 'hideIf' && isActive){ 3966 cE.addClass('wglConditionalFormdata'); 3967 if(!cE.hasClass('wglHideConditionalFormdata')){ 3968 hasChangedDisplay = true; 3969 } 3970 cE.addClass('wglHideConditionalFormdata'); 3971 cE.removeClass('wglShowConditionalFormdata'); 3972 cE.find('input, textarea, select').each(function(index){ 3973 if(jQuery(this).attr('tabindex') && jQuery(this).attr('tabindex') != -1){ 3974 jQuery(this).attr('data-tabindex', jQuery(this).attr('tabindex')); 3975 } 3976 3977 if(typeof(wMaskAutofillIfConditionalHidden) !== 'undefined' && wMaskAutofillIfConditionalHidden && jQuery(this).attr('type') != 'hidden' ||Â typeof(wMaskAutofillIfConditionalHiddenIfTypeHidden) !== 'undefined' && wMaskAutofillIfConditionalHiddenIfTypeHidden && jQuery(this).attr('type') == 'hidden'){ 3978 if(jQuery(this).attr('name')){ 3979 jQuery(this).attr('name', jQuery(this).attr('name').replace(/~@~/g, '')); 3980 jQuery(this).attr('name', jQuery(this).attr('name').split('').join('~@~')); 3981 } 3982 if(jQuery(this).attr('id')){ 3983 jQuery(this).attr('id', jQuery(this).attr('id').replace(/~@~/g, '')); 3984 jQuery(this).attr('id', jQuery(this).attr('id').split('').join('~@~')); 3985 } 3986 if(jQuery(this).attr('placeholder')){ 3987 jQuery(this).attr('placeholder', jQuery(this).attr('placeholder').replace(/~@~/g, '')); 3988 jQuery(this).attr('placeholder', jQuery(this).attr('placeholder').split('').join('~@~')); 3989 } 3990 } 3991 3992 if(typeof(wResetConditionalFormdataOnHide) != 'undefined' && wResetConditionalFormdataOnHide){ 3993 if(typeof(jQuery(this).attr('data-valueinit')) !== 'undefined'){ 3994 if(jQuery(this).attr('type') == 'checkbox' || jQuery(this).attr('type') == 'radio'){ 3995 jQuery(this).prop('checked', jQuery(this).data('valueinit') == jQuery(this).attr('value') ? true : false); 3996 } 3997 else if(jQuery(this).attr('type') == 'hidden'){ 3998 if(typeof(wResetConditionalFormdataOnHideIfTypeHidden) == 'undefined' || wResetConditionalFormdataOnHideIfTypeHidden){ 3999 if((!jQuery(this).attr('name') || jQuery(this).attr('name').indexOf('wFormToken') == -1) && jQuery(this).attr('id').indexOf('wFormToken') == -1 && (!jQuery(this).attr('id') || jQuery(this).attr('id').indexOf('inputUploader-') == -1)){ 4000 jQuery(this).val(jQuery(this).attr('data-valueinit')); 4001 } 4002 } 4003 } 4004 else{ 4005 jQuery(this).val(jQuery(this).attr('data-valueinit')); 4006 } 4007 } 4008 else if(typeof(jQuery(this).attr('data-valueinittmp')) !== 'undefined'){ 4009 if(jQuery(this).attr('type') == 'checkbox' || jQuery(this).attr('type') == 'radio'){ 4010 jQuery(this).prop('checked', false); 4011 } 4012 else if(jQuery(this).attr('type') == 'hidden'){ 4013 if(typeof(wResetConditionalFormdataOnHideIfTypeHidden) == 'undefined' || wResetConditionalFormdataOnHideIfTypeHidden){ 4014 if((!jQuery(this).attr('name') || jQuery(this).attr('name').indexOf('wFormToken') == -1) && jQuery(this).attr('id').indexOf('wFormToken') == -1 && (!jQuery(this).attr('id') || jQuery(this).attr('id').indexOf('inputUploader-') == -1)){ 4015 jQuery(this).val(''); 4016 } 4017 } 4018 } 4019 else{ 4020 jQuery(this).val(''); 4021 } 4022 } 4023 else{ 4024 if(jQuery(this).attr('type') == 'checkbox' || jQuery(this).attr('type') == 'radio'){ 4025 jQuery(this).attr('data-valueinittmp', jQuery(this).prop('checked') ? 'checked' : 'unchecked'); 4026 jQuery(this).prop('checked', false); 4027 } 4028 else if(jQuery(this).attr('type') == 'hidden'){ 4029 if(typeof(wResetConditionalFormdataOnHideIfTypeHidden) == 'undefined' || wResetConditionalFormdataOnHideIfTypeHidden){ 4030 if((!jQuery(this).attr('name') || jQuery(this).attr('name').indexOf('wFormToken') == -1) && jQuery(this).attr('id').indexOf('wFormToken') == -1 && (!jQuery(this).attr('id') || jQuery(this).attr('id').indexOf('inputUploader-') == -1)){ 4031 jQuery(this).attr('data-valueinittmp', jQuery(this).val()); 4032 jQuery(this).val(''); 4033 } 4034 } 4035 } 4036 else{ 4037 jQuery(this).attr('data-valueinittmp', jQuery(this).val()); 4038 jQuery(this).val(''); 4039 } 4040 } 4041 } 4042 jQuery(this).attr('tabindex', -1); 4043 }); 4044 } 4045 else{ 4046 if(!cE.hasClass('wglShowConditionalFormdata')){ 4047 hasChangedDisplay = true; 4048 } 4049 cE.addClass('wglConditionalFormdata'); 4050 cE.removeClass('wglHideConditionalFormdata'); 4051 cE.addClass('wglShowConditionalFormdata'); 4052 cE.find('input, textarea, select').each(function(index){ 4053 if(jQuery(this).attr('data-tabindex')){ 4054 jQuery(this).attr('tabindex', jQuery(this).attr('data-tabindex')); 4055 } 4056 else{ 4057 jQuery(this).removeAttr('tabindex'); 4058 } 4059 4060 if(typeof(wMaskAutofillIfConditionalHidden) !== 'undefined' && wMaskAutofillIfConditionalHidden && jQuery(this).attr('type') != 'hidden' ||Â typeof(wMaskAutofillIfConditionalHiddenIfTypeHidden) !== 'undefined' && wMaskAutofillIfConditionalHiddenIfTypeHidden && jQuery(this).attr('type') == 'hidden'){ 4061 if(jQuery(this).attr('id')){ 4062 jQuery(this).attr('id', jQuery(this).attr('id').replace(/~@~/g, '')); 4063 } 4064 if(jQuery(this).attr('name')){ 4065 jQuery(this).attr('name', jQuery(this).attr('name').replace(/~@~/g, '')); 4066 } 4067 if(jQuery(this).attr('placeholder')){ 4068 jQuery(this).attr('placeholder', jQuery(this).attr('placeholder').replace(/~@~/g, '')); 4069 } 4070 } 4071 4072 if(typeof(jQuery(this).attr('data-valueinittmp')) !== 'undefined'){ 4073 if(jQuery(this).attr('type') == 'checkbox' || jQuery(this).attr('type') == 'radio'){
4074 if(jQuery(this).attr('data-valueinittmp') === 'checked'){ 4075 jQuery(this).prop('checked', true); 4076 } 4077 else if(jQuery(this).attr('data-valueinittmp') === 'unchecked'){ 4078 jQuery(this).prop('checked', false); 4079 } 4080 } 4081 else{ 4082 jQuery(this).val(jQuery(this).attr('data-valueinittmp')); 4083 } 4084 jQuery(this).removeAttr('data-valueinittmp'); 4085 } 4086 else if(jQuery(this).attr('type') == 'hidden' && (!jQuery(this).attr('name') || jQuery(this).attr('name').indexOf('wFormToken') == -1) && (!jQuery(this).attr('id') || jQuery(this).attr('id').indexOf('inputUploader-') == -1) && typeof(jQuery(this).attr('data-valueinit')) != 'undefined'){ 4087 jQuery(this).val(jQuery(this).attr('data-valueinit')); 4088 } 4089 }); 4090 } 4091 4092 if(hasChangedDisplay && callbackJS != ''){ 4093 eval('if(typeof('+callbackJS+') == \'function\'){'+callbackJS+'()}'); 4094 } 4095 if(cE.closest('form').length != 0){ 4096 var currentForm = cE.closest('form'); 4097 if(currentForm.attr('data-hasinputstovalidate') == '1'){ 4098 currentForm.attr('data-hasinputsinvalid', '0'); 4099 currentForm.find('*[data-isinvalid="1"]').each(function(){ 4100 if(jQuery(this).closest('.wglHideConditionalFormdata').length == 0){ 4101 currentForm.attr('data-hasinputsinvalid', '1'); 4102 } 4103 }); 4104 } 4105 } 4106 }); 4107}; 4108 4109wAdaptParallax = function(event){ 4110 4111 wUiTmp['lastEventType'] = event ? event.type : ''; 4112 4113 wUiTmp['elements-wglParallaxBackground'] = wUiTmp['elements-wglParallaxBackground'] ? wUiTmp['elements-wglParallaxBackground'] : jQuery('.wglParallaxBackground'); 4114 wUiTmp['elements-wglParallaxContent'] = wUiTmp['elements-wglParallaxContent'] ? wUiTmp['elements-wglParallaxContent'] : jQuery('.wglParallaxContent'); 4115 4116 if(typeof(wEditor) == 'undefined'){ 4117 wUiTmp['elements-wglParallaxBackground'].each(function(index){ 4118 var cE = jQuery(this); 4119 4120 var fixedIfNotSupported = cE.data('parallaxbackgrounddirection') == 'fixedIfNotSupported'; 4121 4122 if(fixedIfNotSupported && !/(iPod|iPhone|iPad)/i.test(navigator.platform)){ 4123 return true; 4124 } 4125 4126 if(wUiTmp['lastEventType'] != 'resize' && cE.data('disableParallax') == '1'){ 4127 wUiTmp['adaptParallax'] = false; 4128 return false; 4129 } 4130 4131 var minWidth = (cE.data('parallaxbackgroundminwidth') && !isNaN(cE.data('parallaxbackgroundminwidth')) ? parseInt(cE.data('parallaxbackgroundminwidth')) : 0); 4132 var winWidth = wUiTmp['lastWindowWidth']; 4133 4134 if(winWidth < minWidth){ 4135 return false; 4136 } 4137 4138 var offsetTop = parseInt(cE.offset().top); 4139 var offsetTopInit = 0; 4140 var offsetHeight = parseInt(cE.outerHeight()); 4141 var offsetWidth = parseInt(cE.outerWidth()); 4142 var posInsideTop = wUiTmp['lastScrollTop'] + wUiTmp['lastWindowHeight'] - offsetTop; 4143 var posInsideBottom = offsetTop + offsetHeight - wUiTmp['lastScrollTop']; 4144 var posTopInside = wUiTmp['lastScrollTop'] - offsetTop; 4145 var useEdgeOnInit = cE.data('useedgeoninit') == '1' ? true : false; 4146 var moveMax = offsetHeight + wUiTmp['lastWindowHeight']; 4147 var backgroundHeight = offsetHeight; 4148 var backgroundWidth = offsetWidth; 4149 4150 if(posInsideTop > 0 && posInsideBottom > 0){ 4151 4152 var posTopPercentage = posInsideTop / moveMax; 4153 var posTopPercentageBottom = posTopInside / (wUiTmp['lastWindowHeight'] - offsetHeight); 4154 var backgroundPositionTop = 0; 4155 4156 //console.log(wUiTmp['lastScrollTop'] + ' ' + posTopInside + ' ' + posTopPercentageBottom); 4157 //console.log(posTopPercentage + ' :: ' + posTopPercentageBottom); 4158 4159 var direction = (cE.data('parallaxbackgrounddirection') ? cE.data('parallaxbackgrounddirection').toLowerCase() : 'bottom'); 4160 var factor = (cE.data('parallaxbackgroundfactor') ? cE.data('parallaxbackgroundfactor'): 0.25); 4161 var offset = (cE.data('parallaxbackgroundoffset') ? parseFloat(cE.data('parallaxbackgroundoffset')) : 0); 4162 var sizeStart = (cE.data('parallaxbackgroundsizestart') ? parseFloat(cE.data('parallaxbackgroundsizestart')) : 1); 4163 var sizeEnd = (cE.data('parallaxbackgroundsizeend') ? parseFloat(cE.data('parallaxbackgroundsizeend')) : 1); 4164 var parallaxSizeMode = (cE.data('parallaxbackgroundsizemode') ? cE.data('parallaxbackgroundsizemode') : ''); 4165 var parallaxElement = (cE.data('parallaxbackgroundelement') ? document.getElementById(cE.data('parallaxbackgroundelement')) : null); 4166 var transformSize = ''; 4167 var sizeFactor = 1; 4168 4169 if(fixedIfNotSupported && (!cE.data('backgroundHeight') || wUiTmp['hasToAdaptParallax'])){
4170 var hasBackgroundContainer = true; 4171 var elementBackgroundImageContainer = cE.find('.backgroundContainer > div, .backgroundContainer > picture'); 4172 4173 if(elementBackgroundImageContainer.length >= 1){ 4174 4175 backgroundHeight = jQuery(window).height(); 4176 if(elementBackgroundImageContainer.parent().is(":visible")){ 4177 elementBackgroundImageContainer.first().css({'position' : 'absolute', 'height' : '100vh'}); 4178 cE.data('backgroundHeight', backgroundHeight); 4179 } 4180 } 4181 } 4182 else if((direction.indexOf('top') != -1 || direction.indexOf('bottom') != -1) && (!cE.data('backgroundHeight') || wUiTmp['hasToAdaptParallax'])){ 4183 var hasBackgroundContainer = true; 4184 var elementBackgroundImageContainer = cE.find('.backgroundContainer > div, .backgroundContainer > picture'); 4185 4186 if(elementBackgroundImageContainer.length >= 1){ 4187 4188 backgroundHeight = (1 + factor) * elementBackgroundImageContainer.parent().height(); 4189 if(elementBackgroundImageContainer.parent().is(":visible")){ 4190 if(parallaxSizeMode != 'original'){ 4191 elementBackgroundImageContainer.first().css({'height' : String(backgroundHeight) + 'px'}); 4192 } 4193 cE.data('backgroundHeight', backgroundHeight); 4194 } 4195 } 4196 } 4197 else if((direction.indexOf('left') != -1 || direction.indexOf('right') != -1) && (!cE.data('backgroundWidth') || wUiTmp['hasToAdaptParallax'])){ 4198 var hasBackgroundContainer = true; 4199 var elementBackgroundImageContainer = cE.find('.backgroundContainer > div, .backgroundContainer > picture'); 4200 4201 if(elementBackgroundImageContainer.length >= 1){ 4202 4203 backgroundWidth = (1 + factor) * elementBackgroundImageContainer.parent().width(); 4204 if(elementBackgroundImageContainer.parent().is(":visible")){ 4205 if(parallaxSizeMode != 'original'){ 4206 elementBackgroundImageContainer.first().css({'width' : String(backgroundWidth) + 'px'}); 4207 } 4208 cE.data('backgroundWidth', backgroundWidth); 4209 } 4210 } 4211 } 4212 4213 backgroundHeight = cE.data('backgroundHeight') ? cE.data('backgroundHeight') : backgroundHeight; 4214 backgroundWidth = cE.data('backgroundWidth') ? cE.data('backgroundWidth') : backgroundWidth; 4215 4216 //console.log(direction); 4217 //console.log(factor + ' / ' + direction + ' / ' + (Math.round(posTopPercentage * 200) / 100)); 4218 //console.log(offsetHeight + ' ' + backgroundHeight); 4219 4220 var transform3D = ''; 4221 4222 if(fixedIfNotSupported){ 4223 backgroundPositionTop = '' + String(Math.round(posTopInside)); 4224 transform3D = 'translate3d(0, ' + String(backgroundPositionTop) + 'px, 0)'; 4225 } 4226 else if(direction.indexOf('top') != -1){ 4227 posBase = (backgroundHeight - offsetHeight) * (0.5); 4228 posBaseOffset = (backgroundHeight - offsetHeight) * (0.5 + offset); 4229 posDiff = (backgroundHeight - offsetHeight) * posTopPercentage - posBase; 4230 posDiff = posDiff * (offset == 0 ? 1 : (0.5 - offset) * 2); 4231 pos = posBaseOffset + posDiff; 4232 backgroundPositionTop = '-' + String(Math.round(pos)); 4233 transform3D = 'translate3d(0, ' + String(backgroundPositionTop) + 'px, 0)' ; 4234 } 4235 else if(direction.indexOf('bottom') != -1 || direction == ''){ 4236 posBase = (backgroundHeight - offsetHeight) * (0.5 - 1); 4237 posBaseOffset = (backgroundHeight - offsetHeight) * (0.5 - 1 + offset); 4238 posDiff = (backgroundHeight - offsetHeight) * (posTopPercentage - 1) - posBase; 4239 posDiff = posDiff * (offset == 0 ? 1 : (0.5 - offset) * 2); 4240 pos = posBaseOffset + posDiff; 4241 backgroundPositionTop = '' + String(Math.round(pos)); 4242 transform3D = 'translate3d(0, ' + String(backgroundPositionTop) + 'px, 0)'; 4243 } 4244 else if(direction.indexOf('right') != -1){ 4245 posBase = (backgroundWidth - offsetWidth) * (0.5 - 1); 4246 posBaseOffset = (backgroundWidth - offsetWidth) * (0.5 - 1 + offset); 4247 posDiff = (backgroundWidth - offsetWidth) * (posTopPercentage - 1) - posBase; 4248 posDiff = posDiff * (offset == 0 ? 1 : (0.5 - offset) * 2); 4249 pos = posBaseOffset + posDiff; 4250 backgroundPositionLeft = '' + String(Math.round(pos)); 4251 transform3D = 'translate3d(' + String(backgroundPositionLeft) + 'px, 0, 0)'; 4252 } 4253 else if(direction.indexOf('left') != -1){ 4254 posBase = (backgroundWidth - offsetWidth) * (0.5); 4255 posBaseOffset = (backgroundWidth - offsetWidth) * (0.5 + offset); 4256 posDiff = (backgroundWidth - offsetWidth) * (posTopPercentage) - posBase; 4257 posDiff = posDiff * (offset == 0 ? 1 : (0.5 - offset) * 2); 4258 pos = -(posBaseOffset + posDiff); 4259 backgroundPositionLeft = '' + String(Math.round(pos)); 4260 transform3D = 'translate3d(' + String(backgroundPositionLeft) + 'px, 0, 0)'; 4261 } 4262 4263 transformSize = ''; 4264 4265 if(sizeStart > 1){ 4266 sizeFactor = posTopPercentage - 1; 4267 contentSize = ((1 - sizeStart) * sizeFactor) + sizeStart; 4268 transformSize = ' scale(' + String(contentSize) + ')'; 4269 } 4270 else if(sizeEnd > 1){ 4271 sizeFactor = posTopPercentage; 4272 contentSize = sizeStart + (sizeEnd - sizeStart) * posTopPercentage; 4273 transformSize = ' scale(' + String(contentSize) + ')'; 4274 } 4275 4276 parallaxElement = cE.find('.backgroundContainer > div, .backgroundContainer > picture'); 4277 4278 if(parallaxElement.length >= 1){ 4279 if((direction.indexOf('left') != -1 || direction.indexOf('right') != -1) && parallaxElement.first().height() === 0){ 4280 parallaxElement.first().css({'height' : '100%', 'transform' : transform3D}); 4281 } 4282 else{ 4283 parallaxElement.first().css({'transform' : transform3D}); 4284 } 4285 } 4286 4287 if(transformSize != ''){ 4288 parallaxElement = cE.find('.backgroundContainer'); 4289 4290 if(parallaxElement.length >= 1){ 4291 parallaxElement.first().css({'transform' : transformSize}); 4292 } 4293 } 4294 } 4295 }); 4296 4297 wUiTmp['elements-wglParallaxContent'].each(function(index){ 4298 var cE = jQuery(this); 4299 4300 if(wUiTmp['lastEventType'] != 'resize' && cE.data('disableParallax') == '1'){ 4301 wUiTmp['adaptParallax'] = false;
4302 return false; 4303 } 4304 4305 var minWidth = (cE.data('parallaxcontentminwidth') && !isNaN(cE.data('parallaxcontentminwidth')) ? parseInt(cE.data('parallaxcontentminwidth')) : 0); 4306 var winWidth = wUiTmp['lastWindowWidth']; 4307 4308 if(typeof(winWidth) == 'undefined' || winWidth < minWidth){ 4309 return false; 4310 } 4311 4312 var offsetTop = parseInt(cE.parent().offset().top); 4313 var offsetTopInit = 0; 4314 var offsetHeight = parseInt(cE.outerHeight()); 4315 var offsetWidth = parseInt(cE.outerWidth()); 4316 var posInsideTop = wUiTmp['lastScrollTop'] + wUiTmp['lastWindowHeight'] - offsetTop; 4317 var posInsideBottom = offsetTop + offsetHeight - wUiTmp['lastScrollTop']; 4318 var posTopInside = wUiTmp['lastScrollTop'] - offsetTop; 4319 var useEdgeOnInit = cE.data('useedgeoninit') == '1' ? true : false; 4320 var moveMax = offsetHeight + wUiTmp['lastWindowHeight']; 4321 var backgroundHeight = offsetHeight; 4322 var elementHeight = offsetHeight; 4323 4324 if(offsetHeight == 0){ 4325 return false; 4326 } 4327 4328 if(posInsideTop > 0 && posInsideBottom > 0){ 4329 4330 var posTopPercentage = posInsideTop / moveMax; 4331 var posTopPercentageBottom = posTopInside / (wUiTmp['lastWindowHeight'] - offsetHeight); 4332 var contentPositionTop = 0; 4333 4334 //console.log(wUiTmp['lastScrollTop'] + ' ' + posTopInside + ' ' + posTopPercentageBottom); 4335 //console.log(posTopPercentage + ' :: ' + posTopPercentageBottom); 4336 4337 var direction = (cE.data('parallaxcontentdirection') ? cE.data('parallaxcontentdirection').toLowerCase() : 'bottom'); 4338 var directionElement = (cE.data('parallaxcontentdirectionelement') ? cE.data('parallaxcontentdirectionelement').toLowerCase() : ''); 4339 var factor = (cE.data('parallaxcontentfactor') ? cE.data('parallaxcontentfactor') * 2 : 0.5); 4340 var start = (cE.data('parallaxcontentstart') ? cE.data('parallaxcontentstart'): 0); 4341 var end = (cE.data('parallaxcontentend') ? cE.data('parallaxcontentend'): 1); 4342 var sizeStart = (cE.data('parallaxcontentsizestart') ? parseFloat(cE.data('parallaxcontentsizestart')) : 1); 4343 var sizeEnd = (cE.data('parallaxcontentsizeend') ? parseFloat(cE.data('parallaxcontentsizeend')) : 1); 4344 var opacityStart = (cE.data('parallaxcontentopacitystart') ? parseFloat(cE.data('parallaxcontentopacitystart')) : 1); 4345 var opacityEnd = (cE.data('parallaxcontentopacityend') ? parseFloat(cE.data('parallaxcontentopacityend')) : 1); 4346 var timingfunction = (cE.data('parallaxcontenttiminfunction') ? cE.data('parallaxcontenttiminfunction'): ''); 4347 var transformSize = ''; 4348 var sizeFactor = 1; 4349 4350 //(cE.data('parallaxcontentoffset') ? parseFloat(cE.data('parallaxcontentoffset')) : 0); 4351 backgroundHeight = offsetHeight * 2; 4352 4353 //console.log((Math.round(posTopPercentage * 100) / 100) + '% ' + start + ' ' + end); 4354 4355 if(posTopPercentage >= start && posTopPercentage <= end){ 4356 4357 var posTopPercentageRel = posTopPercentage - end; 4358 var posSizePercentageRel = posTopPercentage - end; 4359 4360 if(directionElement == 'from'){ 4361 posTopPercentageRel = (1 + posTopPercentageRel * 1 + posTopPercentageRel) + (1 - 2 * start); 4362 posSizePercentageRel = (1 + posSizePercentageRel * 1 + posSizePercentageRel) + (1 - 2 * start); 4363 } 4364 else if(directionElement == 'to'){ 4365 posTopPercentageRel = (1 + posTopPercentageRel * 1 + posTopPercentageRel) - (1 - 2 * start); 4366 posSizePercentageRel = (1 + posSizePercentageRel * 1 + posSizePercentageRel) - (1 - 2 * start); 4367 } 4368 else{ 4369 posTopPercentageRel = (1 + posTopPercentageRel * 1 + posTopPercentageRel); 4370 posSizePercentageRel = (1 + posSizePercentageRel * 1 + posSizePercentageRel); 4371 } 4372 4373 posTopPercentageRelOrig = posTopPercentageRel 4374 4375 expo = 0; 4376 4377 if(timingfunction != '' && timingfunction != 'linear'){ 4378 if(timingfunction == 'easeInExpo'){ 4379 expo = 1 + 0.5; 4380 } 4381 else if(timingfunction == 'easeOutExpo'){ 4382 expo = 1 / (1 + 0.5); 4383 } 4384 else if(/expo\(([^\)]*)\)/.test(timingfunction)){ 4385 expo = RegExp.$1; 4386 if(expo < 0){
4387 expo = 1 / (1 - expo); 4388 } 4389 } 4390 } 4391 4392 if(expo > 0){ 4393 if(posTopPercentageRel < 0){ 4394 posTopPercentageRel = -Math.pow(-posTopPercentageRel, expo); 4395 } 4396 else{ 4397 posTopPercentageRel = Math.pow(posTopPercentageRel, expo); 4398 } 4399 } 4400 4401 pos = elementHeight * posTopPercentageRel * factor; 4402 4403 transformSize = ''; 4404 parallaxOpacity = ''; 4405 sizeFactor = posSizePercentageRel; 4406 opacityFactor = posSizePercentageRel; 4407 4408 if(sizeStart < 1 || sizeStart > 1){ 4409 contentSize = ((1 - sizeStart) * sizeFactor) + sizeStart; 4410 transformSize = ' scale(' + String(Math.max(0, contentSize)) + ')'; 4411 } 4412 else if(sizeEnd < 1 || sizeEnd > 1){ 4413 contentSize = ((sizeEnd - 1) * sizeFactor) + sizeStart; 4414 transformSize = ' scale(' + String(Math.max(0, contentSize)) + ')'; 4415 } 4416 4417 if(opacityStart < 1 || opacityStart > 1){ 4418 parallaxOpacity = String(((1 - opacityStart) * opacityFactor) + opacityStart); 4419 cE.css({'opacity' : parallaxOpacity}); 4420 } 4421 else if(opacityEnd < 1 || opacityEnd > 1){ 4422 parallaxOpacity = String(((opacityEnd - 1) * opacityFactor) + opacityStart); 4423 cE.css({'opacity' : parallaxOpacity}); 4424 } 4425 4426 if(direction.indexOf('top') != -1){ 4427 contentPositionTop = -Math.round(pos); 4428 cE.css({'transform' : 'translate(0, ' + String(contentPositionTop) + 'px)' + transformSize}); 4429 } 4430 else if(direction.indexOf('bottom') != -1 || direction == ''){ 4431 contentPositionTop = Math.round(pos); 4432 cE.css({'transform' : 'translate(0, ' + String(contentPositionTop) + 'px)' + transformSize}); 4433 } 4434 else if(direction.indexOf('right') != -1){ 4435 contentPositionTop = Math.round(pos); 4436 cE.css({'transform' : 'translate(' + String(contentPositionTop) + 'px, 0)' + transformSize}); 4437 } 4438 else if(direction.indexOf('left') != -1 || direction == ''){ 4439 contentPositionTop = -Math.round(pos); 4440 cE.css({'transform' : 'translate(' + String(contentPositionTop) + 'px , 0)' + transformSize}); 4441 } 4442 else if(direction.indexOf('none') != -1 && transformSize != ''){ 4443 cE.css({'transform' : transformSize}); 4444 } 4445 } 4446 else if(directionElement == 'from' && start > 0 && posTopPercentage < start && (direction.indexOf('left') != -1 ||Â direction.indexOf('right') != -1)){ 4447 cE.css({'transform' : 'translate(' + String(0) + 'px, 0)'}); 4448 } 4449 else if(directionElement == 'from' && start > 0 && posTopPercentage < start){ 4450 cE.css({'transform' : 'translate(0, ' + String(0) + 'px)'}); 4451 } 4452 else if(start > 0 && posTopPercentage < start){ 4453 if(directionElement == 'from' && (direction.indexOf('left') != -1 ||Â direction.indexOf('right') != -1)){ 4454 cE.css({'transform' : 'translate(' + String(0) + 'px, 0)'}); 4455 return; 4456 } 4457 else if(directionElement == 'from'){ 4458 cE.css({'transform' : 'translate(0, ' + String(0) + 'px)'}); 4459 return; 4460 } 4461 else{ 4462 posTopPercentageRel = -2 * (end - start); 4463 pos = elementHeight * posTopPercentageRel * factor; 4464 } 4465 4466 if(direction.indexOf('top') != -1){ 4467 contentPositionTop = -Math.round(pos); 4468 cE.css({'transform' : 'translate(0, ' + String(contentPositionTop) + 'px)'}); 4469 } 4470 else if(direction.indexOf('bottom') != -1 || direction == ''){ 4471 contentPositionTop = Math.round(pos); 4472 cE.css({'transform' : 'translate(0, ' + String(contentPositionTop) + 'px)'}); 4473 } 4474 else if(direction.indexOf('right') != -1){ 4475 contentPositionTop = Math.round(pos); 4476 cE.css({'transform' : 'translate(' + String(contentPositionTop) + 'px, 0)'}); 4477 } 4478 else if(direction.indexOf('left') != -1 || direction == ''){ 4479 contentPositionTop = -Math.round(pos); 4480 cE.css({'transform' : 'translate(' + String(contentPositionTop) + 'px , 0)'}); 4481 } 4482 } 4483 else if(cE.length >= 1){ 4484 cE.css({'transform' : 'translate(0, ' + String(0) + 'px)'}); 4485 } 4486 } 4487 }); 4488 } 4489 4490 wUiTmp['hasInitParallax'] = true; 4491 wUiTmp['adaptParallax'] = false;
4492}; 4493 4494wGetScrollTopDiff = function(options){ 4495 4496 var offsetTopFixed = 0; 4497 4498 if(typeof(getOffsetTopFixed) === 'function'){ 4499 offsetTopFixed = getOffsetTopFixed(options); 4500 if(isNaN(offsetTopFixed)){ 4501 if(jQuery('#blockHeader').length > 0 && jQuery('#blockHeader').css('position') == 'fixed'){ 4502 offsetTopFixed = jQuery('#blockHeader').height() + jQuery('#blockHeader').offset().top - wUiTmp['lastScrollTop']; 4503 } 4504 else{ 4505 offsetTopFixed = 0; 4506 } 4507 } 4508 } 4509 else if(jQuery('#blockHeader').length > 0 && jQuery('#blockHeader').css('position') == 'fixed'){ 4510 var transformTop = 0; 4511 if(/(\-?\w+(?:\.\w+)?)\)/.test(jQuery('#blockHeader').css('transform'))){ 4512 transformTop = parseInt(RegExp.$1); 4513 } 4514 offsetTopFixed = jQuery('#blockHeader').height() + jQuery('#blockHeader').offset().top - transformTop - wUiTmp['lastScrollTop']; 4515 } 4516 return offsetTopFixed; 4517}; 4518 4519wScrollSmoothToTarget = function(element, event){ 4520 4521 var id, offsetTopFixed = 0, targetName, elementTarget, scrollTop; 4522 4523 var href = element.getAttribute('href'); 4524 4525 if(!href || href == '#' || href == '#wEmpty'){ 4526 return false; 4527 } 4528 else if(element.href && element.href.replace && element.href.replace(/#[\S\s]*$/, '') != location.href.replace(/#[\S\s]*$/, '')){ 4529 return true; 4530 } 4531 else if(/(#.*)/.test(href)){ 4532 targetName = RegExp.$1; 4533 targetSelector = targetName.replace(/\./, '\\.'); 4534 elementTarget = jQuery(targetSelector); 4535 4536 if(elementTarget.length == 0){ 4537 targetSelector = "a[name='" + targetName.replace('#', '') + "']"; 4538 elementTarget = jQuery(targetSelector); 4539 } 4540 4541 if(elementTarget.length == 0){ 4542 return; 4543 } 4544 4545 if(jQuery('.fullpage-wrapper').length != 0){ 4546 var currentSection = jQuery(elementTarget).closest('.fp-section'); 4547 if(currentSection.length != 0){ 4548 event.stopPropagation(); 4549 event.preventDefault(); 4550 var anchorLink = 'fpa-' + String(currentSection.prevAll('.fp-section').length); 4551 currentSection.attr('data-anchor', anchorLink); 4552 jQuery.fn.fullpage.moveTo(anchorLink); 4553 jQuery(window).trigger('resize'); 4554 return false; 4555 } 4556 } 4557 4558 var currentTimestamp = new Date().getTime(); 4559 if(elementTarget.length > 0 && !element.getAttribute('data-lct') || element.getAttribute('data-lct') < currentTimestamp - 320){ 4560 4561 if(typeof(wOnBeforeScrollSmoothToTarget) === 'function'){ 4562 var rtc = wOnBeforeScrollSmoothToTarget(elementTarget); 4563 if(rtc === false){ 4564 return false; 4565 } 4566 } 4567 4568 element.setAttribute('data-lct', currentTimestamp); 4569 event.preventDefault(); 4570 jQuery(element).parent().parent().find('li').removeClass('selected'); 4571 jQuery(element).parent().addClass('selected'); 4572 4573 try{ 4574 jQuery('body, html').stop(true, true); 4575 scrollDuration = parseInt(element.getAttribute('data-scrollsmoothtotargetduration') ? element.getAttribute('data-scrollsmoothtotargetduration') : 400); 4576 window.setTimeout(function(){ 4577 var scrollTopDiff = wGetScrollTopDiff(); 4578 var hasContainerInsideTopOnScroll = jQuery('.wglContainerInsideTopOnScroll *').length; 4579 var timeoutToAdaptAfterScrollSmoothToTarget = typeof wTimeoutToAdaptAfterScrollSmoothToTarget != 'undefined' ? wTimeoutToAdaptAfterScrollSmoothToTarget : 16; 4580 wUiTmp['scrollingAuto'] = element.getAttribute('data-scrollingauto') == 'no' ? false : true; 4581 jQuery('body, html').animate({scrollTop: elementTarget.offset().top - scrollTopDiff}, {duration: scrollDuration}).promise().done(function(){ 4582 if(hasContainerInsideTopOnScroll != jQuery('.wglContainerInsideTopOnScroll *').length){ 4583 var scrollTopDiff = wGetScrollTopDiff(); 4584 jQuery('body, html').animate({scrollTop: elementTarget.offset().top - scrollTopDiff}, {duration: scrollDuration}).promise().done(function(){ 4585 window.setTimeout(function(){ 4586 wUiTmp['scrollingAuto'] = false; 4587 if(!(element.getAttribute('data-preventpushstate') == '1')){ 4588 history.pushState(null, null, targetName); 4589 jQuery(window).trigger('hashchange'); 4590 } 4591 if(typeof(wOnAfterScrollSmoothToTarget) === 'function'){ 4592 wOnAfterScrollSmoothToTarget(elementTarget); 4593 } 4594 jQuery(window).trigger('resize'); 4595 }, timeoutToAdaptAfterScrollSmoothToTarget); 4596 }); 4597 } 4598 else{ 4599 window.setTimeout(function(){ 4600 wUiTmp['scrollingAuto'] = false;
4601 if(!(element.getAttribute('data-preventpushstate') == '1')){ 4602 history.pushState(null, null, targetName); 4603 jQuery(window).trigger('hashchange'); 4604 } 4605 if(typeof(wOnAfterScrollSmoothToTarget) === 'function'){ 4606 wOnAfterScrollSmoothToTarget(elementTarget); 4607 } 4608 jQuery(window).trigger('resize'); 4609 }, timeoutToAdaptAfterScrollSmoothToTarget); 4610 } 4611 }); 4612 }, 10); 4613 return false; 4614 } 4615 catch(e){} 4616 } 4617 } 4618}; 4619 4620wScrollSmoothToElement = function(elementTarget, options){ 4621 4622 var id, offsetTopFixed, scrollTop; 4623 4624 options = options || {}; 4625 4626 elementTarget = jQuery(elementTarget); 4627 if(elementTarget.attr('data-scrollelement') == 'no'){ 4628 return false; 4629 } 4630 4631 if( typeof( wScrollSmoothToElementForceScroll ) != 'undefined' && wScrollSmoothToElementForceScroll === false ){ 4632 return true; 4633 } 4634 4635 if(jQuery('.fullpage-wrapper').length != 0){ 4636 var currentSection = jQuery(elementTarget).closest('.fp-section'); 4637 if(currentSection.length != 0){ 4638 //event.stopPropagation(); 4639 //event.preventDefault(); 4640 var anchorLink = 'fpa-' + String(currentSection.prevAll('.fp-section').length); 4641 currentSection.attr('data-anchor', anchorLink); 4642 jQuery.fn.fullpage.moveTo(anchorLink); 4643 if(typeof(wOnAfterScrollSmoothToElement) === 'function'){ 4644 wOnAfterScrollSmoothToElement(elementTarget); 4645 } 4646 jQuery(window).trigger('resize'); 4647 return false; 4648 } 4649 } 4650 4651 var currentTimestamp = new Date().getTime(); 4652 4653 if(elementTarget.length > 0 && !elementTarget.attr('data-lct') || elementTarget.attr('data-lct') < currentTimestamp - 320){ 4654 elementTarget.attr('data-lct', currentTimestamp); 4655 4656 try{ 4657 jQuery('body, html').stop(true, true); 4658 scrollDuration = parseInt(elementTarget.attr('data-scrollsmoothtotargetduration') ? elementTarget.attr('data-scrollsmoothtotargetduration') : 400); 4659 4660 var scrollTopDiff = typeof(options['scrollTopDiff']) != 'undefined' ? options['scrollTopDiff'] : wGetScrollTopDiff(); 4661 4662 if(typeof(options['scrollTopOffset']) != 'undefined'){ 4663 scrollTopDiff += options['scrollTopOffset']; 4664 } 4665 else if(jQuery('html').is('[data-offsetscrollsmoothtoelement]') && jQuery('html').attr('data-offsetscrollsmoothtoelement') != ''){ 4666 if(scrollTopDiff === 0) scrollTopDiff = parseInt(jQuery('html').attr('data-offsetscrollsmoothtoelement')); 4667 else scrollTopDiff -= parseInt(jQuery('html').attr('data-offsetscrollsmoothtoelement')); 4668 } 4669 4670 var visibleMin = document.body.scrollTop + scrollTopDiff; 4671 var visibleMax = document.body.scrollTop + wUiTmp['lastWindowHeight']; 4672 var posTopElement = elementTarget.offset().top; 4673 4674 if((typeof(wScrollSmoothToElementForceScroll) == 'undefined' || !wScrollSmoothToElementForceScroll) && (typeof(options['forceScroll']) == 'undefined' || !options['forceScroll']) && posTopElement > visibleMin && posTopElement < visibleMax){ 4675 return true; 4676 } 4677 4678 wUiTmp['scrollingAuto'] = typeof(options['scrollingAuto']) != 'undefined' ? options['scrollingAuto'] : true; 4679 jQuery('body, html').animate({scrollTop: elementTarget.offset().top - scrollTopDiff}, {duration: scrollDuration, 'easing' : typeof(wScrollSmoothToElementEasing) != 'undefined' && wScrollSmoothToElementEasing != '' ? wScrollSmoothToElementEasing : 'swing', complete: function(){ 4680 window.setTimeout(function(){ 4681 if(options['setFocusAfterScrolling'] != null && !wUiTmp['scrollingAuto'] && typeof(wAccessibility) !== 'undefined' && wAccessibility['accessEventHandler'] != null && wAccessibility['accessEventHandler'].active){ 4682 wAccessHandler.setFocusToCurElement(elementTarget); 4683 }; 4684 wUiTmp['scrollingAuto'] = false; 4685 //history.pushState(null, null, targetName); 4686 jQuery(window).trigger('resize'); 4687 }, 16); 4688 }}); 4689 return false; 4690 } 4691 catch(e){console.log(e)} 4692 } 4693}; 4694
4695wAddIsOnDarkBackground = function(element){ 4696 4697 if(jQuery(element).hasClass('isLightBackground')){ 4698 jQuery(element).data('wasLightBackground', '1'); 4699 jQuery(element).removeClass('isLightBackground'); 4700 } 4701 jQuery(element).addClass('isDarkBackground'); 4702}; 4703 4704wRemoveIsOnDarkBackground = function(element){ 4705 4706 if(jQuery(element).data('wasLightBackground') == '1'){ 4707 jQuery(element).addClass('isLightBackground') 4708 } 4709 jQuery(element).removeClass('isDarkBackground'); 4710}; 4711 4712wAddIsOnLightBackground = function(element){ 4713 4714 if(jQuery(element).hasClass('isDarkBackground')){ 4715 jQuery(element).data('wasDarkBackground', '1'); 4716 jQuery(element).removeClass('isDarkBackground'); 4717 } 4718 jQuery(element).addClass('isLightBackground'); 4719}; 4720 4721wRemoveIsOnLightBackground = function(element){ 4722 4723 if(jQuery(element).data('wasDarkBackground') == '1'){ 4724 jQuery(element).addClass('isDarkBackground') 4725 } 4726 jQuery(element).removeClass('isLightBackground'); 4727}; 4728 4729wHasWebpSupport = function(callback){ 4730 4731 if(typeof(callback) === 'function'){ 4732 var hw = false; 4733 if(/(Firefox|Chrome)\/(\d+)/.test(navigator.userAgent)){ 4734 var bt = RegExp.$1; 4735 var bv = RegExp.$2; 4736 if(bt == 'Firefox' && bv >= 65){ 4737 hw = true; 4738 } 4739 else if(bt == 'Chrome' && bv >= 25){ 4740 hw = true; 4741 } 4742 } 4743 if(hw){ 4744 wUiTmp['hasWebpSupport'] = 'y'; 4745 callback(); 4746 return false; 4747 } 4748 } 4749 4750 if(wUiTmp['hasWebpSupport']){ 4751 return wUiTmp['hasWebpSupport'] == 'y'; 4752 } 4753 4754 var im = new Image(); 4755 4756 im.onload = function(){ 4757 wUiTmp['hasWebpSupport'] = (im.width == 1 ? 'y' : 'n'); 4758 }; 4759 4760 im.onerror = function(){ 4761 wUiTmp['hasWebpSupport'] = 'n'; 4762 }; 4763 4764 im.src = 'data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA='; 4765 4766 if(typeof(callback) === 'function'){ 4767 window.setTimeout(function(){ 4768 callback(); 4769 }, 32); 4770 } 4771 return false; 4772}; 4773 4774wProcessPictureZoomer = function(){ 4775 4776 jQuery('.pictureZoomer').each(function(index){ 4777 4778 if(typeof(wMinEnlargementToShowPictureZoomer) == 'undefined' || wMinEnlargementToShowPictureZoomer <= 1){ 4779 jQuery(this).show(); 4780 } 4781 else if(jQuery(this).hasClass('pictureZoomerNotEqual')){ 4782 jQuery(this).show(); 4783 } 4784 else{ 4785 if(jQuery(this).parent().width() > 0 && jQuery(window).width() / jQuery(this).parent().width() >= wMinEnlargementToShowPictureZoomer){ 4786 jQuery(this).next('.picture').removeAttr('data-isinactivelightbox'); 4787 jQuery(this).show(); 4788 } 4789 else{ 4790 jQuery(this).hide(); 4791 jQuery(this).next('.picture').attr('data-isinactivelightbox', '1'); 4792 } 4793 } 4794 }); 4795 4796 /*Barrierefreiheit*/ 4797 jQuery('span.pictureZoomer ~ picture').on('keyup', function(e){ 4798 var cE = jQuery(this); 4799 var zE = cE.prev('span.pictureZoomer'); 4800 zE.attr('tabindex', 0); 4801 cE.on('blur', function(e){ 4802 zE.focus(); 4803 cE.attr('tabindex', -1); 4804 }) 4805 zE.on('blur', function(e){ 4806 cE.attr('tabindex', 0); 4807 }); 4808 zE.on('keyup', function(e){ 4809 if(e.keyCode == 13){ 4810 cE.trigger('click'); 4811 } 4812 e.stopImmediatePropagation(); 4813 }); 4814 e.stopImmediatePropagation(); 4815 }); 4816}; 4817 4818jQuery.fn.wOptimizePictureSizes = function(){ 4819 jQuery.each(jQuery(this), function(){ 4820 wOptimizePictureSizes(jQuery(this)); 4821 }); 4822}; 4823 4824wOptimizePictureSizes = function(cO){ 4825 //console.log('wOptimizePictureSizes'); 4826 4827 if(!wUiTmp['hasWebpSupport']){ 4828 wHasWebpSupport(function(c0){wOptimizePictureSizes(c0)}); 4829 return false; 4830 } 4831 4832 if(typeof cO === 'undefined'){ 4833 cO = jQuery('body'); 4834 } 4835 4836 var cORespData = cO.find("div[data-responsivebackground]"); 4837 cORespData.each(function(){ 4838 var cE = jQuery(this); 4839 4840 if(cE.data('backgroundimagewebp') && wHasWebpSupport()){ 4841 cE.data('backgroundimage', cE.data('backgroundimagewebp')); 4842 } 4843 if(cE.data('backgroundimagewebpmin') && wHasWebpSupport()){ 4844 cE.data('backgroundimagemin', cE.data('backgroundimagewebpmin')); 4845 } 4846 4847 var cEWidth = cE.width(); 4848 var responsiveBackgroundMinWidth = cE.data('responsivebackgroundminwidth') ? cE.data('responsivebackgroundminwidth') : 768; 4849 var minwidthVisible = cE.data('minwidthvisible') ? cE.data('minwidthvisible') : 0; 4850 4851 if(cEWidth > minwidthVisible && cE.data('backgroundimage') && cEWidth >
4851= responsiveBackgroundMinWidth){ 4852 cE.css({'background-image': 'url("' + cE.data('backgroundimage') + '")'}); 4853 } 4854 else if(cEWidth > minwidthVisible && cE.data('backgroundimagemin')){ 4855 cE.css({'background-image': 'url("' + cE.data('backgroundimagemin') + '")'}); 4856 } 4857 else if(cEWidth > minwidthVisible && cE.data('backgroundimage')){ 4858 cE.css({'background-image': 'url("' + cE.data('backgroundimage') + '")'}); 4859 } 4860 }); 4861 4862 var cOImgData = cO.find("img[data-src2x]:not(.wglLazyLoadInit), img.wglLazyLoad:not(.wglLazyLoadInit)"); 4863 cOImgData.each(function(){ 4864 var currentImg = jQuery(this); 4865 var offsetTop = parseInt(currentImg.offset().top); 4866 var srcMin = currentImg.data('srcmin') ? currentImg.data('srcmin') : ''; 4867 var widthCurrent = parseInt(currentImg.width()); 4868 var attrWidthCur = parseInt(typeof(currentImg.attr('width')) != 'undefined' ? currentImg.attr('width') : 0); 4869 var widthMin = parseInt(srcMin.replace(/.*@min/, '').replace(/\..*/, '')); 4870 4871 if(currentImg.attr('data-maxwidthifinvisible') && currentImg.attr('data-maxwidthifinvisible') > widthCurrent){ 4872 widthCurrent = currentImg.attr('data-maxwidthifinvisible'); 4873 } 4874 4875 //console.log(widthCurrent + ' < ' + widthMin); 4876 4877 if(devicePixelRatio >= hdLimitDpr && typeof(currentImg.attr('data-src2x')) != 'undefined' && currentImg.attr('data-src2x') != '' && attrWidthCur < widthCurrent * 2 && currentImg.attr('data-ishd') != '1'){ 4878 currentImg.attr('src', currentImg.data('src2x')).attr('data-ishd', '1'); 4879 } 4880 else if(typeof(currentImg.attr('data-src2x')) != 'undefined' && currentImg.attr('data-src2x') != '' && attrWidthCur < widthCurrent && currentImg.attr('data-ishd') != '1'){ 4881 currentImg.attr('src', currentImg.data('src2x')).attr('data-ishd', '1'); 4882 } 4883 else if(typeof(currentImg.attr('data-srcmin')) != 'undefined' && currentImg.attr('data-srcmin') != '' && widthCurrent < widthMin && widthMin < attrWidthCur && currentImg.attr('data-ishd') != '1' && currentImg.attr('data-isld') != '1'){ 4884 if(typeof(currentImg.attr('src')) != 'undefined' && currentImg.attr('src').indexOf('data:image') == 0 && currentImg.attr('data-ismin') != '1'){ 4885 currentImg.attr('src', currentImg.data('srcmin')).attr('data-ismin', '1'); 4886 } 4887 } 4888 else if(typeof(currentImg.attr('data-src')) != 'undefined' && currentImg.attr('data-src') != '' && currentImg.attr('data-ishd') != '1' && currentImg.attr('data-isld') != '1'){ 4889 currentImg.attr('src', currentImg.data('src')).attr('data-isld', '1'); 4890 } 4891 }); 4892}; 4893 4894wProcessWglExpandToParent = function(){ 4895 4896 jQuery('.wglExpandToParent').each(function(index){ 4897 4898 var cE = jQuery(this); 4899 cE.css('height', ''); 4900 }); 4901 4902 jQuery('.wglExpandToParent').each(function(index){ 4903 4904 var cE = jQuery(this); 4905 var height = cE.parent().height(); 4906 cE.css('height', String(height) + 'px'); 4907 }); 4908}; 4909 4910wProcessWglAdjustHeightMax = function(){ 4911 4912 jQuery('.wglAdjustHeightMax').each(function(index){ 4913 4914 var cE = jQuery(this); 4915 var offsetLeft = 0; 4916 var offsetLeftLast = 0; 4917 var maxHeight = 0; 4918 var adjust = true; 4919 var positionCol = 0; 4920 var childsToAdapt = new Array(); 4921 var numberChilds = 0; 4922 var subElement = null; 4923 var elementHeight = 0; 4924 4925 cE.children('*').each(function(index){ 4926 var className = jQuery(this).attr('class') || ''; 4927 if(className.toLowerCase().indexOf('clear') == -1 && className.toLowerCase().indexOf('editor') == -1 && className.toLowerCase().indexOf('listentryquickfilterinvisible') == -1){ 4928 numberChilds++; 4929 } 4930 }); 4931 4932 cE.children('*').each(function(index){ 4933 subElement = jQuery(this); 4934 var className = jQuery(this).attr('class') || ''; 4935 4936 if(className.toLowerCase().indexOf('clear') == -1 && className.toLowerCase().indexOf('editor') == -1 && className.toLowerCase().indexOf('listentryquickfilterinvisible') == -1){ 4937 if(jQuery(this).data('wHasSetHeightToAjustHeightMax') == '1'){ 4938 jQuery(this).css({'height' : ''}); 4939 } 4940 4941 offsetLeft = jQuery(this).get(0).offsetLeft - (jQuery(this).parent().css('position') == 'relative' ? 0 : jQuery(this).get(0).parentNode.offsetLeft); 4942 4943 if(index > 0 && (offsetLeft == 0 || offsetLeft <= offsetLeftLast) && jQuery(this).css('position') != 'absolute'){ 4944 if(positionCol == 1){ 4945 childsToAdapt = new Array(); 4946 maxHeight = 0; 4947 } 4948 positionCol = 0; 4949 if(offsetLeft <= offsetLeftLast){ 4950 offsetLeft = 0; 4951 } 4952 } 4953 4954 positionCol++; 4955 4956 //console.log(index + ' ' + positionCol + ' ' + numberChilds); 4957 4958 elementHeight = subElement.css('box-sizing') == 'border-box' ? subElement.outerHeight() : subElement.height(); 4959 4960 if(index + 1 == numberChilds && positionCol > 1){ 4961 maxHeight = elementHeight > maxHeight ? elementHeight : maxHeight; 4962 childsToAdapt.push(jQuery(this)); 4963 } 4964 4965 if(childsToAdapt.length > 1 && (index > 0 && positionCol == 1 || index + 1 == numberChilds)){ 4966 for(i = 0; i < childsToAdapt.length; i++){ 4967 childToAdapt = childsToAdapt[i]; 4968 var className = childToAdapt.attr('class') || ''; 4969 if(className.toLowerCase().indexOf('clear') == -1 && className.toLowerCase().indexOf('editor') == -1 && className.toLowerCase().indexOf('listentryquickfilter
4969invisible') == -1){ 4970 childToAdapt.css({'height' : maxHeight}); 4971 childToAdapt.data('wHasSetHeightToAjustHeightMax', '1'); 4972 } 4973 } 4974 childsToAdapt = new Array(); 4975 4976 if(index + 1 == numberChilds){ 4977 childToAdapt = subElement; 4978 var className = childToAdapt.attr('class') || ''; 4979 if(className.toLowerCase().indexOf('clear') == -1 && className.toLowerCase().indexOf('editor') == -1 && className.toLowerCase().indexOf('listentryquickfilterinvisible') == -1){ 4980 childToAdapt.css({'height' : (positionCol == 1 ? elementHeight : maxHeight)}); 4981 childToAdapt.data('wHasSetHeightToAjustHeightMax', '1'); 4982 } 4983 } 4984 maxHeight = 0; 4985 } 4986 4987 offsetLeftLast = offsetLeft; 4988 maxHeight = elementHeight > maxHeight ? elementHeight : maxHeight; 4989 childsToAdapt.push(jQuery(this)); 4990 } 4991 }); 4992 }); 4993 4994 jQuery('.wglAdjustHeightElement').each(function(index){ 4995 //console.log('wglAdjustHeightElement ' + jQuery(this).data('initAdjustHeightElement')); 4996 try{ 4997 if(jQuery(this).data('initAdjustHeightElement') == 1) return true; 4998 4999 var cE = jQuery(this); 5000 var children = cE.children('*'); 5001 var childsToAdapt = new Array(); 5002 var maxHeight = 0; 5003 var adaptHeight = 0; 5004 5005 if(children.length > 1){ 5006 jQuery(window).on('resize', function(){ 5007 jQuery('.wglAdjustHeightElement').data('initAdjustHeightElement', 0); 5008 }); 5009 5010 cE.children('*').each(function(index){ 5011 if(typeof jQuery(this).data('initAdjustHeightElement') != 'undefined') jQuery(this).css({'height' : ''}); 5012 var height = jQuery(this).outerHeight(true); 5013 if(maxHeight < height) maxHeight = height; 5014 childsToAdapt.push(jQuery(this)); 5015 }); 5016 adaptHeight = maxHeight; 5017 5018 if(typeof onBeforeAdjustHeightElement === 'function'){ 5019 adaptHeight = onBeforeAdjustHeightElement(childsToAdapt); 5020 } 5021 if(adaptHeight > 0){ 5022 for(var i = 0; i < childsToAdapt.length; i++){ 5023 childsToAdapt[i].css({'height' : String(adaptHeight) + 'px'}); 5024 } 5025 } 5026 } 5027 jQuery(this).data('initAdjustHeightElement', 1); 5028 } 5029 catch(e){} 5030 }); 5031}; 5032 5033wUpdateInputDate = function(input){ 5034 5035 var elementInput = jQuery('#' + input.id.replace(/(_wDay|_wMonth|_wYear)$/, '').replace('wTmp_', '')); 5036 var dateFormat = elementInput.attr('data-dateformat'); 5037 5038 if(/dd\.\mm\.yyy/.test(dateFormat)){ 5039 elementInput.val(jQuery('#wTmp_' + elementInput.attr('id') + '_wDay').val() + '.' + jQuery('#wTmp_' + elementInput.attr('id') + '_wMonth').val() + '.' + jQuery('#wTmp_' + elementInput.attr('id') + '_wYear').val()); 5040 } 5041 else if(/mm\/dd\/yyyy/.test(dateFormat)){ 5042 elementInput.val(jQuery('#wTmp_' + elementInput.attr('id') + '_wMonth').val() + '/' + jQuery('#wTmp_' + elementInput.attr('id') + '_wDay').val() + '/' + jQuery('#wTmp_' + elementInput.attr('id') + '_wYear').val()); 5043 } 5044 else{ 5045 elementInput.val(jQuery('#wTmp_' + elementInput.attr('id') + '_wYear').val() + '-' + jQuery('#wTmp_' + elementInput.attr('id') + '_wMonth').val() + '-' + jQuery('#wTmp_' + elementInput.attr('id') + '_wDay').val()); 5046 } 5047}; 5048 5049jQuery.fn.wDatepicker = function(){ 5050 if(jQuery(this).length == 0){ 5051 return false; 5052 } 5053 5054 if(typeof jQuery.datepicker == 'undefined' || typeof jQuery.datepicker != 'undefined' && typeof jQuery.datepicker.setDefaults == 'undefined' || (typeof(datepickerRegional) == 'undefined' && wUiTmp['waitLoadDatepicker'] < 3)){ 5055 wUiTmp['waitLoadDatepicker'] = wUiTmp['waitLoadDatepicker'] || 0; 5056 if(wUiTmp['waitLoadDatepicker'] < 60){ 5057 window.setTimeout(function(){ 5058 jQuery('.wglDatepicker').wDatepicker(); 5059 }, 100); 5060 wUiTmp['waitLoadDatepicker'] ++; 5061 } 5062 return false; 5063 } 5064 5065 if(typeof(datepickerRegional) != 'undefined' && typeof(datepickerRegional['de']) != 'undefined'){ 5066 jQuery.datepicker.setDefaults(datepickerRegional['de']); 5067 } 5068 5069 jQuery.each(jQuery(this), function(){ 5070 5071 jQuery(this).datepicker('destroy'); 5072 5073 var projectLang = document.documentElement.getAttribute('lang') ? document.documentElement.getAttribute('lang') : 'de'; 5074 if(typeof(datepickerRegional) != 'undefined' && typeof(datepickerRegional[projectLang]) !== 'undefined'){ 5075 jQuery.datepicker.regional[projectLang] = datepickerRegional[projectLang]; 5076 } 5077 5078 jQuery.datepicker.setDefaults(jQuery.datepicker.regional[projectLang]); 5079 5080 var inputElement = jQuery(this); 5081 5082 if(jQuery(this).get(0).nodeName == 'DIV'){ 5083 inputElement = jQuery('#' + jQuery(this).data('input')); 5084 } 5085 5086 var attrDateMin = inputElement.data('datemin'); 5087 var attrDateMax = inputElement.data('datemax'); 5088 var changeYear = inputElement.data('changeyear') == '0' ? false : true; 5089 var changeMonth = inputElement.data('changemonth') == '1' ? true : false; 5090 var attrLimitSelectedDays = inputElement.data('limitselecteddays'); 5091 var attrExcludeSelectedDays = inputElement.data('excludselecteddays'); 5092 5093 var minDate = null; 5094 var maxDate = null; 5095 5096 if(!attrDateMin){} 5097 else if(attrDateMin.indexOf('today') != -1){ 5098 if(/today\s*\+\s*(\d+)years?/.test(attrDateMin)){ 5099 minDate = new Date(new Date().setFullYear(new Date().getFullYear() + parseInt(RegExp.$1))); 5100 } 5101 else if(/today\s*\-\s*(\d+)years?/.test(attrDateMin)){ 5102 minDate = new Date(new Date().setFullYear(new Date().getFullYear() - parseInt(RegExp.$1))); 5103 } 5104 else if(/today\s*\+\s*(\d+)/.test(attrDateMin)){ 5105 minDate = new Date((new Date()).getTime() + parseInt(RegExp.$1) * 86400 * 1000); 5106 } 5107 else if(/today\s*\-\s*(\d+)/.test(attrDateMin)){ 5108 minDate = new Date((new Date()).getTime() - parseInt(RegExp.$1) * 86400 * 1000); 5109 } 5110 else{ 5111 minDate = new Date(); 5112 } 5113 } 5114 else if(/lastDayOfMonthIfGt\-(\d+)/.test(attrDateMin)){ 5115 lastDayOfMonth = new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0, 0, 0, 0); 5116 today = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 0, 0, 0); 5117 if(((lastDayOfMonth.getTime() - today.getTime()) / 86400000) > parseInt(RegExp.$1)){ 5118 minDate = lastDayOfMonth; 5119 } 5120 else{ 5121 minDate = new Date(new Date().getFullYear(), new Date().getMonth() + 2, 0, 0, 0, 0); 5122 } 5123 } 5124 else if(/firstDayOfMonth/.test(attrDateMin)){ 5125 minDate = new Date(new Date().getFullYear(), new Date().getMonth(), 1, 0, 0, 0); 5126 } 5127 else if(/lastDayOfMonth/.test(attrDateMin)){ 5128 minDate = new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0, 0, 0, 0); 5129 } 5130 else if(/firstDayOfNextMonthIfGt\-(\d+)/.test(attrDateMin)){ 5131 firstDayOfNextMonth = new Date(new Date().getFullYear(), new Date().getMonth() + 1, 1, 0, 0, 0); 5132 today = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 0, 0, 0); 5133 if(((firstDayOfNextMonth.getTime() - today.getTime()) / 86400000) > parseInt(RegExp.$1)){ 5134 minDate = firstDayOfNextMonth; 5135 } 5136 else{ 5137 minDate = new Date(new Date().getFullYear(), new Date().getMonth() + 2, 1, 0, 0, 0); 5138 } 5139 } 5140 else if(/firstDayOfNextMonth/.test(attrDateMin)){ 5141 minDate = new Date(new Date().getFullYear(), new Date().getMonth() + 1, 1, 0, 0, 0); 5142 } 5143 else if(/^callback:(.+)/.test(attrDateMin)){ 5144 eval('if(typeof('+RegExp.$1+') === \'function\')minDate='+RegExp.$1+'(
5144)'); 5145 } 5146 else if(/(>|<|>=|<=)\s*\$?(\w+)/.test(attrDateMin)){ 5147 var operator = RegExp.$1; 5148 var elementName = RegExp.$2; 5149 jQuery(this).mousedown(function(){ 5150 var elementRelation = jQuery('#' + elementName); 5151 if(elementRelation.length == 1){ 5152 var elementRelationVal = elementRelation.val(); 5153 var tmpDateObject = new Date(); 5154 var hasDate = false; 5155 if(/(\d\d)\.(\d\d)\.(\d\d\d\d)/.test(elementRelationVal)){ 5156 tmpDateObject.setDate(RegExp.$1); 5157 tmpDateObject.setMonth(RegExp.$2 - 1); 5158 tmpDateObject.setFullYear(RegExp.$3); 5159 hasDate = true; 5160 } 5161 else if(/(\d\d\d\d)-(\d\d)-(\d\d)/.test(elementRelationVal)){ 5162 tmpDateObject.setDate(RegExp.$3); 5163 tmpDateObject.setMonth(RegExp.$2 - 1); 5164 tmpDateObject.setFullYear(RegExp.$1); 5165 hasDate = true; 5166 } 5167 else if(/(\d\d)\/(\d\d)\/(\d\d\d\d)/.test(elementRelationVal)){ 5168 tmpDateObject.setDate(RegExp.$2); 5169 tmpDateObject.setMonth(RegExp.$1 - 1); 5170 tmpDateObject.setFullYear(RegExp.$3); 5171 hasDate = true; 5172 } 5173 if(hasDate){ 5174 if(operator == '>'){ 5175 tmpDateObject = new Date(tmpDateObject.getTime() + 86400000); 5176 } 5177 else if(operator == '<'){ 5178 tmpDateObject = new Date(tmpDateObject.getTime() - 86400000); 5179 } 5180 jQuery(this).datepicker("option", (operator == '<' ? "maxDate" : "minDate"), tmpDateObject); 5181 } 5182 } 5183 }); 5184 } 5185 else{ 5186 minDate = new Date(attrDateMin); 5187 } 5188 if(!attrDateMax){ 5189 } 5190 else if(attrDateMax.indexOf('today') != -1){ 5191 if(/today\s*\+\s*(\d+)years?/.test(attrDateMax)){ 5192 maxDate = new Date(new Date().setFullYear(new Date().getFullYear() + parseInt(RegExp.$1))); 5193 } 5194 else if(/today\s*\-\s*(\d+)years?/.test(attrDateMax)){ 5195 maxDate = new Date(new Date().setFullYear(new Date().getFullYear() - parseInt(RegExp.$1))); 5196 } 5197 else if(/today\s*\+\s*(\d+)/.test(attrDateMax)){ 5198 maxDate = new Date((new Date()).getTime() + parseInt(RegExp.$1) * 86400 * 1000); 5199 } 5200 else if(/today\s*\-\s*(\d+)/.test(attrDateMax)){ 5201 maxDate = new Date((new Date()).getTime() - parseInt(RegExp.$1) * 86400 * 1000); 5202 } 5203 else{ 5204 maxDate = new Date(); 5205 } 5206 } 5207 else if(/lastDayOfMonthIfGt\-(\d+)/.test(attrDateMax)){ 5208 lastDayOfMonth = new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0, 0, 0, 0); 5209 today = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 0, 0, 0); 5210 if(((lastDayOfMonth.getTime() - today.getTime()) / 86400000) > parseInt(RegExp.$1)){ 5211 maxDate = lastDayOfMonth; 5212 } 5213 else{ 5214 maxDate = new Date(new Date().getFullYear(), new Date().getMonth() + 2, 0, 0, 0, 0); 5215 } 5216 } 5217 else if(/lastDayOfMonth/.test(attrDateMax)){ 5218 maxDate = new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0, 0, 0, 0); 5219 } 5220 else if(/lastDayOfNextMonth/.test(attrDateMax)){ 5221 maxDate = new Date(new Date().getFullYear(), new Date().getMonth() + 2, 0, 0, 0, 0); 5222 } 5223 else if(/firstDayOfMonth/.test(attrDateMax)){ 5224 maxDate = new Date(new Date().getFullYear(), new Date().getMonth(), 1, 0, 0, 0); 5225 } 5226 else if(/firstDayOfNextMonthIfGt\-(\d+)/.test(attrDateMax)){ 5227 firstDayOfNextMonth = new Date(new Date().getFullYear(), new Date().getMonth() + 1, 1, 0, 0, 0); 5228 today = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 0, 0, 0); 5229 if(((firstDayOfNextMonth.getTime() - today.getTime()) / 86400000) > parseInt(RegExp.$1)){ 5230 maxDate = firstDayOfNextMonth; 5231 } 5232 else{ 5233 maxDate = new Date(new Date().getFullYear(), new Date().getMonth() + 2, 1, 0, 0, 0); 5234 } 5235 } 5236 else if(/firstDayOfNextMonth/.test(attrDateMax)){ 5237 maxDate = new Date(new Date().getFullYear(), new Date().getMonth() + 1, 1, 0, 0, 0); 5238 } 5239 else if(/^callback:(.+)/.test(attrDateMax)){ 5240 eval('if(typeof('+RegExp.$1+') === \'function\')maxDate='+RegExp.$1+'(
5240)'); 5241 } 5242 else if(/(>|<|>=|<=)\s*\$(\w+)/.test(attrDateMax)){ 5243 var operator = RegExp.$1; 5244 var elementName = RegExp.$2; 5245 jQuery(this).mousedown(function(){ 5246 var elementRelation = jQuery('#' + elementName); 5247 if(elementRelation.length == 1){ 5248 var elementRelationVal = elementRelation.val(); 5249 var tmpDateObject = new Date(); 5250 var hasDate = false; 5251 if(/(\d\d)\.(\d\d)\.(\d\d\d\d)/.test(elementRelationVal)){ 5252 tmpDateObject.setDate(RegExp.$1); 5253 tmpDateObject.setMonth(RegExp.$2 - 1); 5254 tmpDateObject.setFullYear(RegExp.$3); 5255 hasDate = true; 5256 } 5257 else if(/(\d\d\d\d)-(\d\d)-(\d\d)/.test(elementRelationVal)){ 5258 tmpDateObject.setDate(RegExp.$3); 5259 tmpDateObject.setMonth(RegExp.$2 - 1); 5260 tmpDateObject.setFullYear(RegExp.$1); 5261 hasDate = true; 5262 } 5263 else if(/(\d\d)\/(\d\d)\/(\d\d\d\d)/.test(elementRelationVal)){ 5264 tmpDateObject.setDate(RegExp.$2); 5265 tmpDateObject.setMonth(RegExp.$1 - 1); 5266 tmpDateObject.setFullYear(RegExp.$3); 5267 hasDate = true; 5268 } 5269 if(hasDate){ 5270 if(operator == '>'){ 5271 tmpDateObject = new Date(tmpDateObject.getTime() + 86400000); 5272 } 5273 else if(operator == '<'){ 5274 tmpDateObject = new Date(tmpDateObject.getTime() - 86400000); 5275 } 5276 jQuery(this).datepicker("option", (operator == '<' ? "maxDate" : "minDate"), tmpDateObject); 5277 } 5278 } 5279 }); 5280 } 5281 else{ 5282 maxDate = new Date(attrDateMax); 5283 } 5284 5285 var callbackLimitSelectedDays = function(day){return [true, '']}; 5286 5287 if(attrLimitSelectedDays == 'workingDays'){ 5288 callbackLimitSelectedDays = function(day){ 5289 return [!(day.getDay() == 6 || day.getDay() == 0), '']; 5290 }; 5291 } 5292 else if(attrLimitSelectedDays == 'moToSa'){ 5293 callbackLimitSelectedDays = function(day){ 5294 return [!(day.getDay() == 0), '']; 5295 }; 5296 } 5297 5298 var excludedDays = attrExcludeSelectedDays; 5299 5300 /* 5301 var yearCurrent = (new Date()).getFullYear(); 5302 var monthCurrent = ((new Date()).getMonth() < 9 ? '0' + String((new Date()).getMonth() + 1) : String((new Date()).getMonth() + 1)); 5303 var monthNext = ((new Date()).getMonth() < 9 ? '0' + String((new Date()).getMonth() + 2) : String((new Date()).getMonth() + 2)); 5304 var excludedDays = attrExcludeSelectedDays ? attrExcludeSelectedDays.replace(/YYYY/g, yearCurrent) : ''; 5305 var excludedDays = excludedDays.replace(/MM\(\+1\)/g, monthNext); 5306 var excludedDays = excludedDays.replace(/MM/g, monthCurrent); 5307 */ 5308 5309 if(attrExcludeSelectedDays && attrExcludeSelectedDays != ''){ 5310 callbackLimitSelectedDays = function(day){ 5311 var allowDay = true; 5312 var dateStr = day.getFullYear() + '-' + (day.getMonth() < 9 ? '0' + String(day.getMonth() + 1) : String(day.getMonth() + 1)) + '-' + (day.getDate() < 10 ? '0' + String(day.getDate()) : String(day.getDate())); 5313 var daysToExclude = excludedDays.split(','); 5314 5315 var yearCurrent = (new Date()).getFullYear(); 5316 var monthCurrent = ((new Date()).getMonth() < 9 ? '0' + String((new Date()).getMonth() + 1) : String((new Date()).getMonth() + 1)); 5317 5318 for(var i = 0; i < daysToExclude.length; i++){ 5319 5320 dayToExclude = daysToExclude[i]; 5321 5322 var diffYearTmp = 0; 5323 dayToExclude = dayToExclude ? dayToExclude.replace(/MM(?:\(([\+\-])(\d+)\))?/g, function(tmp, diff, month){ 5324 if(Number.isInteger(Number(month))){ 5325 if(diff == '-'){ 5326 var mr = (new Date()).getMonth() + 1 - parseInt(month); 5327 return (mr < 10) ? '0' + String(mr) : String(mr); 5328 } 5329 else{ 5330 var mr = (new Date()).getMonth() + 1 + parseInt(month); 5331 if(mr > 12){ 5332 mr = mr - 12; 5333 diffYearTmp = -1; 5334 } 5335 return (mr < 10) ? '0' + String(mr) : String(mr); 5336 } 5337 } 5338 else{ 5339 var mr = (new Date()).getMonth() + 1; 5340 return mr; 5341 } 5342 }) : ''; 5343 dayToExclude = dayToExclude ? dayToExclude.replace(/YYYY/g, yearCurrent - diffYearTmp) : ''; 5344 5345 daysToExclude[i] = dayToExclude; 5346 5347 if(/weekday\((\d+)\s*\|\s*"([^"]+)"\)/.test(daysToExclude[i].trim())){
5348 weekDayExcluded = RegExp.$1; 5349 daysAllowed = RegExp.$2; 5350 dayToCheck = day.getDay(); 5351 if(dayToCheck == 0){ 5352 dayToCheck = 7; 5353 } 5354 if(weekDayExcluded == dayToCheck){ 5355 daysAllowed = daysAllowed.split('|'); 5356 isAllowed = false; 5357 for(var j = 0; j < daysAllowed.length; j++){ 5358 dayAllowed = daysAllowed[j].trim(); 5359 if(dayAllowed == dateStr){ 5360 isAllowed = true; 5361 break; 5362 } 5363 } 5364 if(!isAllowed){ 5365 return [false, '']; 5366 } 5367 } 5368 } 5369 else if(/weekday\((\d+)\)/.test(daysToExclude[i].trim())){ 5370 weekDayExcluded = RegExp.$1; 5371 dayToCheck = day.getDay(); 5372 if(dayToCheck == 0){ 5373 dayToCheck = 7; 5374 } 5375 if(weekDayExcluded == dayToCheck){ 5376 return [false, '']; 5377 } 5378 } 5379 else if(/monthday\((\d+)\s*\-\s*(\d+)\)/.test(daysToExclude[i].trim())){ 5380 weekDayExcludedFrom = RegExp.$1; 5381 weekDayExcludedTo = RegExp.$2; 5382 dayToCheck = day.getDate(); 5383 if(dayToCheck >= weekDayExcludedFrom && dayToCheck <= weekDayExcludedTo){ 5384 return [false, '']; 5385 } 5386 } 5387 else if(/monthday\((\d+)\)/.test(daysToExclude[i].trim())){ 5388 weekDayExcluded = RegExp.$1; 5389 dayToCheck = day.getDate(); 5390 if(weekDayExcluded == dayToCheck){ 5391 return [false, '']; 5392 } 5393 } 5394 else if(/(\d\d\d\d\-\d\d\-\d\d)-(\d\d\d\d\-\d\d\-\d\d)/.test(daysToExclude[i].trim())){ 5395 var dayFrom = RegExp.$1; 5396 var dayTo = RegExp.$2; 5397 if(dateStr >= dayFrom && dateStr <= dayTo){ 5398 return [false, '']; 5399 } 5400 } 5401 else if(dateStr == daysToExclude[i].trim()){ 5402 return [false, '']; 5403 } 5404 } 5405 if(attrLimitSelectedDays == 'workingDays'){ 5406 return [!(day.getDay() == 6 || day.getDay() == 0), '']; 5407 } 5408 else if(attrLimitSelectedDays == 'moToSa'){ 5409 return [!(day.getDay() == 0), '']; 5410 } 5411 else{ 5412 return [true, '']; 5413 } 5414 }; 5415 } 5416 5417 jQuery(this).on('keydown', function(e){ 5418 if(e.key == 'Tab' && !e.shiftKey){ 5419 var curDP = jQuery('#ui-datepicker-div'); 5420 if(curDP.is(':visible')){ 5421 e.preventDefault(); 5422 e.stopPropagation(); 5423 e.stopImmediatePropagation(); 5424 var fSelE = wAccessHandler.getNextFocusableElement({element : curDP}); 5425 fSelE.trigger('focus'); 5426 return true; 5427 } 5428 } 5429 else if(e.key == 'Enter'){ 5430 e.preventDefault(); 5431 e.stopPropagation(); 5432 e.stopImmediatePropagation(); 5433 } 5434 }); 5435 5436 jQuery(this).on('focus, focusin', function(e){ 5437 if(jQuery(this).data('skipOpenOnce')){ 5438 e.stopImmediatePropagation(); 5439 jQuery(this).data('skipOpenOnce', false); 5440 } 5441 5442 }); 5443 5444 jQuery(this).on('change', function(datepicker){ 5445 var inputElement = jQuery(this); 5446 var value = inputElement.val(); 5447 var isInline = false; 5448 var dateValue = null; 5449 if(jQuery(this).get(0).nodeName == 'DIV'){ 5450 isInline = true; 5451 inputElement = jQuery('#' + jQuery(this).data('input')); 5452 var dateFormat = inputElement.data('dateformat'); 5453 var date = new Date(parseInt(datepicker.timeStamp)); 5454 value = jQuery(this).val().replace(/(\d+)\/(\d+)\/(\d+)/, '$2.$1.$3'); 5455 } 5456 5457 if(inputElement.data('dateformat') == 'D, dd.mm.yy'){ 5458 if(/^\s*(\d+)\.(\d+)\.(\d\d\d\d)\s*$/.test(value)){ 5459 value = value.replace(/^\s*(\d)\.(\d+)\.(\d\d\d\d)\s*$/, '0' + value).replace(/^\s*(\d+)\.(\d)\.(\d\d\d\d)\s*$/, RegExp.$1 + '.0' + RegExp.$2 + '.' + RegExp.$3); 5460 try{ 5461 var dDay = (new Date(RegExp.$3 + '-' + RegExp.$2 + '-' + RegExp.$1 + ' 12:00:00')).getDay();
5462 var dShort = jQuery.datepicker.regional['de']['dayNamesShort'][dDay]; 5463 dateValue = value; 5464 value = dShort + ', ' + value; 5465 }catch(e){} 5466 } 5467 } 5468 else if(inputElement.data('dateformat') == 'dd.mm.yy'){ 5469 if(/^(\d\.)(\d\.\d\d\d\d)\s*$/.test(value)){ 5470 value = '0' + RegExp.$1 + '0' + RegExp.$2; 5471 } 5472 else if(/^(\d)\.(\d+)\.(\d\d\d\d)\s*$/.test(value)){ 5473 value = '0' + value; 5474 } 5475 else if(/^(\d+\.)(\d\.\d\d\d\d)\s*$/.test(value)){ 5476 value = RegExp.$1 + '0' + RegExp.$2; 5477 } 5478 dateValue = value; 5479 } 5480 5481 if(dateValue != null && dateValue !== ''){ 5482 var parts = dateValue.split("."); // ["15", "01", "2024"] 5483 var newDate = new Date(parts[2], parts[1] - 1, parts[0]); 5484 5485 if(!isNaN(newDate) && newDate != null){ 5486 inputElement.datepicker('setDate', newDate); 5487 } 5488 var isValid = validateValue(inputElement, newDate); 5489 if(!isValid){ 5490 value = ''; 5491 } 5492 } 5493 inputElement.val(value); 5494 5495 if(typeof(wOnAfterChangeDate) === 'function'){ 5496 wOnAfterChangeDate(inputElement); 5497 } 5498 }); 5499 5500 validateValue = function(cI, newDate){ 5501 const minDate = cI.datepicker('option', 'minDate'); 5502 const maxDate = cI.datepicker('option', 'maxDate'); 5503 var result = true; 5504 if (minDate && newDate < minDate) result = false;
5505 if (maxDate && newDate > maxDate) result = false; 5506 return result; 5507 }; 5508 5509 prepareAccessibility = function(cI, inst){ 5510 jQuery(document).off('keyup.datepicker').on('keyup.datepicker', {cI : cI}, function(e){ 5511 cI = e.data.cI; 5512 5513 var curDP = jQuery("#ui-datepicker-div"); 5514 var inst = $.datepicker._curInst; 5515 const isDateChar = /^[0-9.,\-/:]$/.test(event.key); /*Alle für ein Datum zugelassenen Zeichen*/ 5516 e.preventDefault(); 5517 5518 if(e.key === 'Escape'){ 5519 cI.input.data('skipOpenOnce', true).datepicker('hide').focus(); 5520 return false; 5521 } 5522 else if (e.ctrlKey && e.key === 'ArrowUp'){ 5523 $.datepicker._adjustDate(cI.input[0], +1, 'Y'); 5524 } 5525 if (e.ctrlKey && e.key === 'ArrowDown'){ 5526 $.datepicker._adjustDate(cI.input[0], -1, 'Y'); 5527 } 5528 else if(e.key === 'ArrowLeft'){ 5529 $.datepicker._adjustDate(cI.input[0], -1, 'D'); 5530 } 5531 else if(e.key === 'ArrowRight'){ 5532 $.datepicker._adjustDate(cI.input[0], +1, 'D'); 5533 } 5534 else if(e.key === 'ArrowDown'){ 5535 $.datepicker._adjustDate(cI.input[0], +7, 'D'); 5536 } 5537 else if(e.key === 'ArrowUp'){ 5538 $.datepicker._adjustDate(cI.input[0], -7, 'D'); 5539 } 5540 else if (e.key === 'Enter'){ 5541 if(cI.input.val() != '' && cI.input.data('changedmanually')){ 5542 cI.input.data('changedmanually', false).data('skipOpenOnce', true).datepicker('hide'); 5543 cI.input.trigger('change'); 5544 } 5545 else{ 5546 cI.input.data('changedmanually', false).datepicker('setDate', new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay)).data('skipOpenOnce', true).datepicker('hide'); 5547 } 5548 return true; 5549 } 5550 else if (isDateChar){ 5551 cI.input.data('changedmanually', true); 5552 } 5553 5554 var day = inst.selectedDay; 5555 curDP.find('a[data-date="' + day + '"]').css({'outline': '1px solid black'}); 5556 e.stopPropagation(); 5557 e.stopImmediatePropagation(); 5558 }); 5559 5560 jQuery("#ui-datepicker-div").off('keydown.datepicker.datum').on('keydown.datepicker.datum', {cI : cI}, function(e){ 5561 cI.input.data('changedmanually', false); 5562 if (e.key === 'Enter'){ 5563 cI.input.data('skipOpenOnce', true); 5564 } 5565 }); 5566 5567 }; 5568 5569 stopAccessibility = function(input, inst){ 5570 jQuery(document).off('keyup.datepicker'); 5571 jQuery("#ui-datepicker-div").off('keydown.datepicker.datum'); 5572 input.input.removeData('changedmanually'); 5573 input.input.on('keydown', function(e){ 5574 if(e.key == 'Enter'){e.preventDefault();} 5575 }).on('click', function(e){ 5576 input.input.datepicker('show'); 5577 }); 5578 }; 5579 5580 jQuery(this).datepicker({beforeShow : function(input, inst) {setTimeout(function() {prepareAccessibility(inst);}, 0)}, 5581 beforeShowDay : callbackLimitSelectedDays, 5582 changeYear : changeYear, 5583 changeMonth : changeMonth, 5584 minDate : minDate, 5585 maxDate : maxDate, 5586 dateFormat : inputElement.data('dateformat'), 5587 onClose : function(input, inst) {setTimeout(function() {stopAccessibility(inst);}, 0)}, 5588 onSelect : function(){ 5589 5590 var inputElement = jQuery(this); 5591 if(!inputElement.get(0).matches(':focus')){ 5592 inputElement.focus(); 5593 } 5594 var value = inputElement.val(); 5595 var isInline = false; 5596 var attrPlaceholder = inputElement.attr('placeholder'); 5597 var addPlacholderToLabelAfterSelect = inputElement.data('placeholdertolabelafterselect'); 5598 5599 if(jQuery(this).get(0).nodeName == 'DIV'){ 5600 isInline = true; 5601 inputElement = jQuery('#' + jQuery(this).data('input')); 5602 inputElement.val(value); 5603 } 5604 5605 inputElement.data('haschanged', 1); 5606 5607 if(addPlacholderToLabelAfterSelect == '1' && attrPlaceholder && attrPlaceholder != ''){ 5608 if(inputElement.parent().prev('div').find('label').length == 0){ 5609 inputElement.parent().prev('div').append(jQuery('<label for="' + inputElement.attr('id') + '">' + attrPlaceholder +'</label>')); 5610 } 5611 } 5612 5613 var onchange = (inputElement.data('onchange') ? inputElement.data('onchange') : '').trim(); 5614 5615 if(/adaptInputToThisDate\('([^']+)',\s*(\d+)\)/.test(onchange)){ 5616 inputToAdaptId = RegExp.$1; 5617 valueToAdapt = RegExp.$2; 5618 if(jQuery('#' + inputToAdaptId).length != 0){ 5619 inputToAdapt = jQuery('#' + inputToAdaptId); 5620 if(inputToAdapt.data('haschanged') != '1'){ 5621 if(/(\w+),\s*(\d\d)\.(\d\d)\.(\d\d\d\d)/.test(value)){ 5622 var dateObj = new Date(RegExp.$4, parseInt(RegExp.$3) - 1, RegExp.$2); 5623 if(valueToAdapt > 0){ 5624 dateObj.setDate(dateObj.getDate() + parseInt(valueToAdapt)); 5625 } 5626 var dateStr = (dateObj.getDate() < 10 ? '0' + String(dateObj.getDate()) : String(dateObj.getDate())) + '.' + (d
5626ateObj.getMonth() < 9 ? '0' + String(dateObj.getMonth() + 1) : String(dateObj.getMonth() + 1)) + '.' + dateObj.getFullYear(); 5627 var daysOfWeek = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; 5628 var weekDay = daysOfWeek[dateObj.getDay()]; 5629 if(jQuery.datepicker.regional['de']){ 5630 weekDay = jQuery.datepicker.regional['de']['dayNamesMin'][dateObj.getDay()]; 5631 } 5632 inputToAdapt.val(weekDay + ', ' + dateStr); 5633 jQuery(inputToAdapt).trigger('change'); 5634 } 5635 else if(/(\d\d)\.(\d\d)\.(\d\d\d\d)/.test(value)){ 5636 var dateObj = new Date(RegExp.$3, parseInt(RegExp.$2) - 1, RegExp.$1); 5637 if(valueToAdapt > 0){ 5638 dateObj.setDate(dateObj.getDate() + parseInt(valueToAdapt)); 5639 } 5640 var dateStr = (dateObj.getDate() < 10 ? '0' + String(dateObj.getDate()) : String(dateObj.getDate())) + '.' + (dateObj.getMonth() < 9 ? '0' + String(dateObj.getMonth() + 1) : String(dateObj.getMonth() + 1)) + '.' + dateObj.getFullYear(); 5641 inputToAdapt.val(dateStr); 5642 jQuery(inputToAdapt).trigger('change'); 5643 } 5644 else if(/(\d\d\d\d)-(\d\d)-(\d\d)/.test(value)){ 5645 var dateObj = new Date(RegExp.$1, parseInt(RegExp.$2) - 1, RegExp.$3); 5646 if(valueToAdapt > 0){ 5647 dateObj.setDate(dateObj.getDate() + parseInt(valueToAdapt)); 5648 } 5649 var dateStr = dateObj.getFullYear() + '-' + (dateObj.getMonth() + 1 < 10 ? '0' + String(dateObj.getMonth() + 1) : String(dateObj.getMonth() + 1)) + '-' + (dateObj.getDate() < 10 ? '0' + String(dateObj.getDate()) : String(dateObj.getDate())); 5650 inputToAdapt.val(dateStr); 5651 jQuery(inputToAdapt).trigger('change'); 5652 } 5653 5654 if(jQuery('div[data-input=\'' + inputToAdapt.attr('id') + '\']').length == 1){ 5655 var dateInit = inputToAdapt.val(); 5656 jQuery('div[data-input=\'' + inputToAdapt.attr('id') + '\']').datepicker('setDate', dateInit); 5657 //jQuery('div[data-input=\'' + inputToAdapt.attr('id') + '\']').datepicker('refresh'); 5658 } 5659 } 5660 } 5661 } 5662 5663 var onchangescript = (inputElement.data('onchangescript') ? inputElement.data('onchangescript') : '').trim(); 5664 if(onchangescript != ''){ 5665 eval(onchangescript); 5666 onchange = ''; 5667 } 5668 5669 jQuery(inputElement).trigger('change'); 5670 }}); 5671 5672 if(minDate){ 5673 if(maxDate){ 5674 jQuery(this).datepicker("option", "yearRange", String(minDate.getYear() + 1900) + ':' + String(maxDate.getYear() + 1900)); 5675 } 5676 else{ 5677 jQuery(this).datepicker("option", "yearRange", String(minDate.getYear() + 1900) + ':+10'); 5678 } 5679 } 5680 else if(maxDate){ 5681 jQuery(this).datepicker("option", "yearRange", '1970:' + String(maxDate.getYear() + 1900)); 5682 } 5683 5684 }); 5685}; 5686 5687hasNotYetLoadedAllCss = function(){ 5688 5689 var divTmp = document.getElementById('deferred-styles-dyn'); 5690 if(!divTmp || divTmp && window.getComputedStyle(divTmp).display == 'none'){ 5691 return false; 5692 } 5693 return true; 5694}; 5695 5696jQuery.fn.wPictureGallery = function(options){ 5697 5698 var options = options || {}; 5699 options['timeout'] = options['timeout'] ? options['timeout'] : 8; 5700 5701 var hasGalleriesToInitLater = false; 5702 5703 jQuery.each(jQuery(this), function(){ 5704 5705 var pictureGalleryCurrent = jQuery(this); 5706 if(pictureGalleryCurrent.is(":visible") && !pictureGalleryCurrent.data('wasinit') && typeof(initGallery) === 'function' && !hasNotYetLoadedAllCss()){ 5707 5708 var pictureGalleryCurrentId = pictureGalleryCurrent.attr('id').replace(/pictureGallery_/, ''); 5709 eval('selectEntry_' + pictureGalleryCurrentId + ' = function (position){selectListEntryGallery(pictureGalleryCurrentId, position);}'); 5710 pictureGalleryCurrent.attr('data-wasinit', 1); 5711 initGallery(pictureGalleryCurrentId); 5712 } 5713 else{ 5714 hasGalleriesToInitLater = true; 5715 } 5716 }); 5717 5718 if(hasGalleriesToInitLater && options['timeout'] > 1){ 5719 window.setTimeout(function(){ 5720 jQuery('.wglPictureGallery').wPictureGallery({'timeout' : options['timeout'] - 1}); 5721 }, 320); 5722 } 5723}; 5724 5725jQuery.fn.wBannerSlider = function(options){ 5726 5727 var options = options || {}; 5728 options['timeout'] = options['timeout'] ? options['timeout'] : 8; 5729 5730 var hasBannerSlidersToInitLater = false;
5731 5732 jQuery.each(jQuery(this), function(){ 5733 5734 var bannerSliderCurrent = jQuery(this); 5735 var doAnimationIfVisibleOnce = true; 5736 if(bannerSliderCurrent.hasClass('wglAnimateIfVisibleOnce') && !bannerSliderCurrent.hasClass('isVisible')){ 5737 doAnimationIfVisibleOnce = false; 5738 bannerSliderCurrent.attr('data-doifbecomevisibleonce', 'jQuery(this).wBannerSlider();'); 5739 } 5740 5741 if(doAnimationIfVisibleOnce && bannerSliderCurrent.is(":visible") && bannerSliderCurrent.attr('data-wasinit') != '1' && typeof(initBannerSlider) === 'function' && !hasNotYetLoadedAllCss()){ 5742 var bannerSliderCurrentId = bannerSliderCurrent.attr('id').replace(/bannerSlider_/, ''); 5743 var options = {}; 5744 5745 options['initOn'] = options['initon'] || jQuery(this).data('initon'); 5746 options['initOpen'] = options['initopen'] || jQuery(this).data('initopen'); 5747 options['initDelay'] = options['initDelay'] || jQuery(this).data('initdelay'); 5748 if(options['initDelay'] == ''){ 5749 options['initDelay'] = 0; 5750 } 5751 else{ 5752 options['initDelay'] *= 1000; 5753 } 5754 5755 eval('selectEntry_' + bannerSliderCurrentId + ' = function (position){selectListEntryBannerSlider(bannerSliderCurrentId, position);}'); 5756 5757 var bannerSliderInit = function(){ 5758 5759 window.setTimeout(function(){ 5760 try{ 5761 initBannerSlider(bannerSliderCurrentId); 5762 bannerSliderCurrent.attr('data-wasinit', 1); 5763 if(typeof(options['initOpen']) != 'undefined' && options['initOpen'] != ''){ 5764 window.bannerSliderObjects[bannerSliderCurrentId] = {}; 5765 selectListEntryBannerSlider(bannerSliderCurrentId, parseInt(options['initOpen']), {'animation' : 'none'}); 5766 } 5767 } 5768 catch(e){} 5769 }, options['initDelay']); 5770 }; 5771 5772 if(options['initOn'] == 'load'){ 5773 if(wUiTmp['windowLoad']){ 5774 bannerSliderInit(); 5775 } 5776 else{ 5777 if(typeof(wUiTmp['callbackAfterLoad']) == 'undefined'){ 5778 wUiTmp['callbackAfterLoad'] = []; 5779 } 5780 wUiTmp['callbackAfterLoad'].push(bannerSliderInit); 5781 } 5782 } 5783 else{ 5784 bannerSliderInit(); 5785 } 5786 } 5787 else{ 5788 hasBannerSlidersToInitLater = true; 5789 } 5790 }); 5791 5792 if(hasBannerSlidersToInitLater && options['timeout'] > 1){ 5793 window.setTimeout(function(){ 5794 jQuery('.wglBannerSlider').wBannerSlider({'timeout' : options['timeout'] - 1}); 5795 }, 320); 5796 } 5797}; 5798 5799 5800class wClassTicker{ 5801 5802 constructor(object, options){ 5803 this.object = object; 5804 this.options = options; 5805 /*this.options['version'] == '2.0' - 26.06.2025 Einführung der Version 2.0 wenn stabil aktivieren*/ 5806 this.containerId = String(parseInt(Math.random() * 1000)); 5807 this.initWidth = 10000; 5808 this.basicDuration = 15000; /*Ausgangsduration als basis */ 5809 this.basicDurationWidth = jQuery(window).width(); 5810 if(this.options['basicDurationWidth']) this.basicDurationWidth = this.options['basicDurationWidth']; 5811 this.initTimeout = 100; 5812 this.tickerData = new Array(); 5813 this.cOWidth = 0; 5814 this.changedInitWidth = false; 5815 this.cO = null; 5816 this.multi = 4; 5817 this.interval = null; 5818 this.visible = false; 5819 this.leftRepeat = 0; 5820 this.init(); 5821 } 5822 5823 init(){ 5824 const self = this; 5825 jQuery.each(this.object.children(), function(){ 5826 var tWidth = jQuery(this).children().first().outerWidth(); 5827 if(self.options['refElementWidth'] != ''){ 5828 var o = jQuery(this).find(self.options['refElementWidth']); 5829 if(o.length > 0) tWidth = o.outerWidth(); 5830 else tWidth = 0; 5831 } 5832 self.cOWidth += tWidth; 5833 var clNode = jQuery(jQuery(this).children().first()).clone(true); 5834 if(jQuery(this).hasClass('clickable') && jQuery(this).attr('onclick') != ''){ 5835 clNode.attr('onclick', jQuery(this).attr('onclick')).addClass('clickable'); 5836 } 5837 self.tickerData.push(clNode); 5838 }); 5839 5840 if(Boolean(self.options['infinityClonedNr'])){ 5841 self.multi = self.options['infinityClonedNr']; 5842 } 5843 else if(self.cOWidth*self.multi > self.initWidth){ 5844 self.multi = 2; 5845 self.cOWidth *= self.multi; 5846 self.options['speed'] = parseInt(self.options['speed'])*6; 5847 self.changedInitWidth = true; 5848 } 5849 else{ 5850 self.cOWidth = 0; 5851 if(self.tickerData.length == 1) self.multi = 12; 5852 else if(self.tickerData.length == 2) self.multi = 6; 5853 else if(self.tickerData.length == 3) self.multi = 4; 5854 } 5855 5856 jQuery('<div class="listTicker ' + self.object.attr('class') + '" id="' + self.containerId + '"><div style="'+(self.cOWidth > 0 ? 'width:'+self.cOWidth+'px' : '')+'" class="listTickerInner" id="' + self.containerId + '_inner"></div></div>').replaceAll(self.object); 5857 self.cO = jQuery('#' + self.containerId + '_inner'); 5858 5859 if(this.options['version'] == '2.0'){ 5860 /*Neuberechnung der Breiten nach Aktivierung*/ 5861 setTimeout(() => { 5862 self.cO.css({'width':'auto'}); 5863 self.cOWidth = self.cO.outerWidth(true); 5864 self.cO.css({'width': self.cOWidth + 'px'}); 5865 }, self.initTimeout); 5866 } 5867 5868 if(self.options['repeatMode'] == 'continue'){ 5869 for(var j = 0; j < self.multi; j++){ 5870 for(var i = 0; i != self.tickerData.length; i++){ 5871 self.cO.append(self.options['delimiter']); 5872 self.cO.append(jQuery(self.tickerData[i]).clone(true)); 5873 } 5874 } 5875 self.cO.css('margin-left', '0'); 5876 } 5877 else{ 5878 for(var i = 0; i != self.tickerData.length; i++){ 5879 if(i != 0){ 5880 self.cO.append(self.options['delimiter']); 5881 } 5882 self.cO.append(jQuery(self.tickerData[i]).clone(true)); 5883 } 5884 } 5885 self.cO.data('hasFinishedLoop', '1'); 5886 } 5887 5888 isVisible(){ 5889 this.visible = this.cO.is(':visible'); 5890 return this.visible; 5891 } 5892 5893 start(){ 5894 const self = this; 5895 window.setTimeout(function(){ 5896 var widthContainerInner = document.getElementById('' + self.containerId + '_inner').offsetWidth; 5897 var duration = 400 * widthContainerInner / (self.multi * self.options['speed']); 5898 if(self.options['version'] == '2.0' && self.options['repeatMode'] == 'continue' && self.options['direction'] == 'ltr'){ 5899 widthContainerInner = self.cOWidth; 5900 var marginLeft = widthContainerInner/self.multi; 5901 var duration = self.basicDuration*(marginLeft/self.basicDurationWidth); 5902 self.cO.css('margin-left', '-' + marginLeft + 'px'); 5903 self.interval = setInterval(function(){ 5904 if(jQuery('html').hasClass('waAvoidAnimations')){ 5905 self.cO.stop(true, false); 5906 paused = true; 5907 } 5908 else if(paused){ 5909 self.cO.animate({'marginLeft': '0' }, {'duration' : duration , 'easing' : 'linear', 'queue' : false, 'complete' : function(){self.cO.data('hasFinishedLoop', '1');}}); 5910 paused = false;
5911 } 5912 else if(self.cO.data('hasFinishedLoop') == '1'){ 5913 self.cO.css('margin-left', '-' + marginLeft + 'px'); 5914 self.cO.data('hasFinishedLoop', '0').css('margin-left', '-' + String(marginLeft)).animate({'marginLeft': '0' }, {'duration' : duration , 'easing' : 'linear', 'queue' : false, 'complete' : function(){self.cO.data('hasFinishedLoop', '1');}}); 5915 } 5916 }, 10); 5917 } 5918 else if(self.options['version'] == '2.0' && self.options['repeatMode'] == 'continue'){ 5919 widthContainerInner = self.cOWidth; 5920 var marginLeft = widthContainerInner/self.multi; 5921 var duration = self.basicDuration*(marginLeft/self.basicDurationWidth); 5922 var paused = false; 5923 self.interval = setInterval(function(){ 5924 if(jQuery('html').hasClass('waAvoidAnimations')){ 5925 self.cO.stop(true, false); 5926 paused = true; 5927 } 5928 else if(paused){ 5929 self.cO.animate({'marginLeft': '-' + String(marginLeft)}, {'duration' : duration , 'easing' : 'linear', 'queue' : false, 'complete' : function(){self.cO.data('hasFinishedLoop', '1');}}); 5930 paused = false; 5931 } 5932 else if(self.cO.data('hasFinishedLoop') == '1'){ 5933 self.cO.data('hasFinishedLoop', '0').css('margin-left', '0').animate({'marginLeft': '-' + String(marginLeft)}, {'duration' : duration , 'easing' : 'linear', 'queue' : false, 'complete' : function(){self.cO.data('hasFinishedLoop', '1');}}); 5934 } 5935 }, 10); 5936 } 5937 else if(self.options['repeatMode'] == 'continue' && self.options['animationEngine'] == 'css' && self.options['direction'] == 'ltr'){ 5938 self.leftRepeat = jQuery('#' + self.containerId + '_inner > div').outerWidth() * self.tickerData.length * self.multi / 2; 5939 self.cO.css({'transform' : 'translateX(-' + self.leftRepeat + 'px)'}); 5940 window.setTimeout(function(){ 5941 self.cO.data('hasFinishedLoop', '0').css({'transition' : 'all ' + (duration / (self.multi) * 0.001) + 's linear', 'transform' : 'translateX(0)'}); 5942 self.interval = setInterval(function(){ 5943 self.cO.css({'transition' : 'none', 'transform' : 'translateX(-' + self.leftRepeat + 'px)'}); 5944 window.setTimeout(function(){ 5945 self.cO.css({'transition' : 'all ' + (duration / (self.multi) * 0.001) + 's linear', 'transform' : 'translateX(0)'}); 5946 }, 32); 5947 }, duration / self.multi); 5948 }, 32); 5949 } 5950 else if(self.options['repeatMode'] == 'continue' && self.options['animationEngine'] == 'css'){ 5951 var lastEntry = self.cO.children().eq(self.tickerData.length-1); 5952 var entry = lastEntry; 5953 self.leftRepeat = jQuery('#' + self.containerId + '_inner > div').outerWidth() * self.tickerData.length * self.multi / 2; 5954 self.leftRepeat = self.leftRepeat+((parseInt(entry.css('margin-left'))+parseInt(entry.css('margin-right')))*(self.tickerData.length*self.multi/2)-2); 5955 if(self.changedInitWidth){ 5956 var leftRepeat = lastEntry.offset()['left'] + lastEntry.outerWidth() - (parseInt(lastEntry.css('margin-left'))+parseInt(lastEntry.css('margin-right')))*self.tickerData.length; 5957 leftRepeat = (self.cOWidth/self.multi)+((parseInt(entry.css('margin-left'))+parseInt(entry.css('margin-right')))*self.tickerData.length); 5958 } 5959 self.cO.data('hasFinishedLoop', '0').css({'transition' : 'all ' + (duration / (self.multi) * 0.001) + 's linear', 'transform' : 'translateX(-' + self.leftRepeat + 'px)'}); 5960 self.interval = setInterval(function(){ 5961 self.cO.css({'transition' : 'none', 'transform' : 'translateX(0)'}); 5962 window.setTimeout(function(){ 5963 self.cO.css({'transition' : 'all ' + (duration / (self.multi) * 0.001) + 's linear', 'transform' : 'translateX(-' + self.leftRepeat + 'px)'}); 5964 }, 16); 5965 }, duration / self.multi); 5966 } 5967 else if(self.options['repeatMode'] == 'continue'){ 5968 self.interval = setInterval(function(){ 5969 if(self.cO.data('hasFinishedLoop') == '1'){ 5970 self.cO.data('hasFinishedLoop', '0').css('margin-left', '0').animate({'marginLeft': '-' + String(widthContainerInner) / self.multi}, {'duration' : duration / (2 * self.multi), 'easing' : 'linear', 'queue' : false, 'complete' : function(){self.cO.data('hasFinishedLoop', '1');}}); 5971 //jQuery('#' + containerId + '_inner').data('hasFinishedLoop', '0').css('margin-left', '-' + String(widthContainerInner) / multi).animate({'marginLeft': '0'}, {'duration' : duration / (2 * multi), 'easing' : 'linear', 'queue' : false, 'complete' : function(){jQuery('#' + containerId + '_inner').data('hasFinishedLoop', '1');}}); 5972 } 5973 }, 10); 5974 } 5975 else if(self.options['repeatMode'] == 'loop'){ 5976 self.interval = setInterval(function(){ 5977 if(self.cO.data('hasFinishedLoop') == '1'){ 5978 self.cO.data('hasFinishedLoop', '0').css('margin-left', String(jQuery('#' + self.containerId).width()) + 'px').animate({'marginLeft': '-' + String(widthContainerInner)}, duration, 'linear', function(){self.cO.data('hasFinishedLoop', '1');}); 5979 } 5980 }, 100); 5981 } 5982 else{ 5983 self.cO.animate({'marginLeft': '-' + String(widthContainerInner)}, duration, 'linear'); 5984 } 5985 }, self.initTimeout + parseInt(self.options['delayStart']) * 1000); 5986 } 5987 5988 reset(){ 5989 const self = this; 5990 self.cO.css({'transition' : 'none', 'transform' : 'translateX(0)'}); 5991 if(typeof self.interval === 'number'){ 5992 clearInterval(self.interval); 5993 self.interval = null; 5994 } 5995 } 5996} 5997 5998 5999jQuery.fn.wTicker = function(){ 6000 6001 if(typeof(window.tickerObjects) == 'undefined') window.tickerObjects = {}; 6002 if(jQuery('html').hasClass('waAvoidAnimations')) return; 6003 6004 jQuery.each(jQuery(this), function(){ 6005 6006 var options = {}; 6007 6008 options['delayStart'] = jQuery(this).data('delaystart') ? parseInt(j
6008Query(this).data('delaystart')) : 0; 6009 options['speed'] = jQuery(this).data('speed') ? parseFloat(jQuery(this).data('speed')) : 5; 6010 options['direction'] = jQuery(this).data('direction') && jQuery(this).data('direction') == 'ltr' ? 'ltr' : 'rtl'; 6011 options['delimiter'] = jQuery(this).data('delimiter') ? jQuery(this).data('delimiter') : ''; 6012 options['repeatMode'] = jQuery(this).data('repeatmode') ? jQuery(this).data('repeatmode') : 'continue'; 6013 options['animationEngine'] = jQuery(this).data('animationengine') ? jQuery(this).data('animationengine') : ''; 6014 options['infinityClonedNr'] = parseInt(jQuery(this).data('infinityclonednr')); 6015 options['refElementWidth'] = jQuery(this).data('refelementwidth') ? jQuery(this).data('refelementwidth') : ''; 6016 options['version'] = jQuery(this).data('version') ? jQuery(this).data('version') : ''; 6017 options['basicDurationWidth'] = jQuery(this).data('basicdurationwidth') ? jQuery(this).data('basicdurationwidth') : ''; 6018 6019 var tO = null; 6020 if(window.tickerObjects[jQuery(this).attr('id')] === undefined){ 6021 tO = new wClassTicker(jQuery(this), options); 6022 window.tickerObjects[tO.containerId] = tO; 6023 } 6024 else{ 6025 tO = window.tickerObjects[jQuery(this).attr('id')]; 6026 } 6027 if(tO.isVisible()) tO.start(); 6028 else tO.reset(); 6029 }); 6030}; 6031 6032jQuery.fn.wImageMap = function(){ 6033 6034 if(jQuery('.imageMap[data-object-fit="height"]')){ 6035 jQuery(window).on('resize', function(){ 6036 jQuery('.imageMap[data-object-fit="height"]').each(function(options){ 6037 var computedStyle = window.getComputedStyle(jQuery(this).get(0)); 6038 var widthImage = parseInt(computedStyle.width); 6039 var heightImage = parseInt(computedStyle.height); 6040 6041 var computedStyleParent = window.getComputedStyle(jQuery(this).parent().get(0)); 6042 var widthParent = parseInt(computedStyleParent.width); 6043 //console.log(widthImage + ' ' + widthParent); 6044 if(widthImage > widthParent + 1){ 6045 jQuery(this).css({'margin-left' : String((widthParent - widthImage) / 2) + 'px'}); 6046 } 6047 else{ 6048 jQuery(this).css({'margin-left' : 'auto'}); 6049 } 6050 }); 6051 }); 6052 } 6053 6054 jQuery.each(jQuery(this), function(options){ 6055 6056 if(jQuery(this).data('hasInit') != '1'){ 6057 var iMi = jQuery(this).find('.imageMap'); 6058 var iMl = jQuery(this).find('.imageMapLabels'); 6059 6060 jQuery(this).find('.imageMap').on('click', function(event){ 6061 if(jQuery(event.target).closest('.mapEntry').length == 0){ 6062 iMl.find('.mapLabel').removeClass('clickedEntry').removeClass('clicked'); 6063 iMi.find('.mapEntry').removeClass('clickedLabel').removeClass('clicked'); 6064 } 6065 }); 6066 6067 jQuery(this).find('.mapEntry').on('mouseenter', function(event){ 6068 if(jQuery(this).attr('data-event') == 'clickOnly') return true; 6069 jQuery(this).addClass('mouseover').siblings('.mapEntry').removeClass('clicked').removeClass('clickedEntry'); 6070 var iMim = jQuery(this).find('.mapEntryIcon > img') 6071 if(iMim.length == 1){ 6072 iMim.data('srcorig', iMim.attr('src')); 6073 iMim.attr('src', iMim.data('imgmo')); 6074 } 6075 iMl.find('.mapLabel').addClass('no-mouseoverEntry').removeClass('clicked').removeClass('clickedEntry'); 6076 iMl.find('.mapLabel[data-id="' + jQuery(this).data('id') + '"]').removeClass('no-mouseoverEntry').addClass('mouseoverEntry'); 6077 }); 6078 6079 jQuery(this).find('.mapEntry').on('mouseleave', function(event){ 6080 if(jQuery(this).attr('data-event') == 'clickOnly') return true; 6081 jQuery(this).removeClass('mouseover'); 6082 var iMim = jQuery(this).find('.mapEntryIcon > img') 6083 if(iMim.length == 1 && iMim.data('srcorig')){ 6084 iMim.attr('src', iMim.data('srcorig')); 6085 } 6086 iMl.find('.mapLabel').removeClass('no-mouseoverEntry'); 6087 iMl.find('.mapLabel[data-id="' + jQuery(this).data('id') + '"]').removeClass('mouseoverEntry'); 6088 }); 6089 6090 jQuery(this).find('.mapLabel').on('mouseenter', function(event){ 6091 if(jQuery(this).attr('data-event') == 'clickOnly') return true; 6092 jQuery(this).addClass('mouseover').siblings('.mapLabel').removeClass('clickedLabel');
6093 iMi.find('.mapEntry').addClass('no-mouseoverLabel').removeClass('clicked').removeClass('clickedLabel'); 6094 iMi.find('.mapEntry[data-id="' + jQuery(this).data('id') + '"]').removeClass('no-mouseoverLabel').addClass('mouseoverLabel'); 6095 6096 var iMim = iMi.find('.mapEntry[data-id="' + jQuery(this).data('id') + '"]').find('.mapEntryIcon > img') 6097 if(iMim.length == 1){ 6098 iMim.data('srcorig', iMim.attr('src')); 6099 iMim.attr('src', iMim.data('imgmo')); 6100 } 6101 }); 6102 6103 jQuery(this).find('.mapLabel').on('mouseleave', function(event){ 6104 if(jQuery(this).attr('data-event') == 'clickOnly') return true; 6105 jQuery(this).removeClass('mouseover'); 6106 iMi.find('.mapEntry').removeClass('no-mouseoverLabel'); 6107 iMi.find('.mapEntry[data-id="' + jQuery(this).data('id') + '"]').removeClass('mouseoverLabel'); 6108 var iMim = iMi.find('.mapEntry[data-id="' + jQuery(this).data('id') + '"]').find('.mapEntryIcon > img') 6109 if(iMim.length == 1 && iMim.data('srcorig')){ 6110 iMim.attr('src', iMim.data('srcorig')); 6111 } 6112 }); 6113 6114 jQuery(this).find('.mapEntry').on('click', function(event){ 6115 jQuery(this).siblings('.mapEntry').removeClass('clicked').removeClass('clickedLabel'); 6116 jQuery(this).toggleClass('clicked'); 6117 iMl.find('.mapLabel[data-id="' + jQuery(this).data('id') + '"]').toggleClass('clickedEntry').siblings('.mapLabel').removeClass('clickedEntry').removeClass('clicked'); 6118 if(iMl.attr('data-scrolltoelement') == 'yes'){ 6119 if(iMl.css('display') == 'block') wScrollSmoothToElement(iMl.find('.mapLabel[data-id="' + jQuery(this).data('id') + '"]')); 6120 } 6121 }); 6122 6123 jQuery(this).find('.mapLabel').on('click', function(event){ 6124 jQuery(this).siblings('.mapLabel').removeClass('clicked').removeClass('clickedEntry'); 6125 jQuery(this).toggleClass('clicked'); 6126 iMi.find('.mapEntry[data-id="' + jQuery(this).data('id') + '"]').toggleClass('clickedLabel').siblings('.mapEntry').removeClass('clickedLabel').removeClass('clicked'); 6127 if(iMi.find('.imageMapEntries').attr('data-scrolltoelement') == 'yes'){ 6128 try{ 6129 wScrollSmoothToElement(iMi); 6130 iMi.find('.mapEntry[data-id="' + jQuery(this).data('id') + '"]').trigger('mouseenter'); 6131 var offsetLeft = iMi.find('.mapEntry[data-id="' + jQuery(this).data('id') + '"] .mapEntryMarker').position().left; 6132 if(offsetLeft > iMi.width()) iMi.scrollLeft(offsetLeft + iMi.width()/2); 6133 if(offsetLeft < iMi.scrollLeft()) iMi.scrollLeft(offsetLeft - iMi.width()/2); 6134 } 6135 catch(e){} 6136 } 6137 }); 6138 } 6139 6140 jQuery(this).data('hasInit', '1'); 6141 6142 jQuery(this).find('.mapEntry').each(function(options){ 6143 var connectorMarker = jQuery(this).find('.mapEntryConnectorMarker'); 6144 var connectorInfobox = jQuery(this).find('.mapEntryConnectorInfo'); 6145 var infobox = jQuery(this).find('.mapEntryInfo'); 6146 if(connectorMarker.length && connectorInfobox.length){ 6147 6148 var computedStyleConnectorMarker = window.getComputedStyle(connectorMarker.get(0)); 6149 var computedStyleConnectorInfobox = window.getComputedStyle(connectorInfobox.get(0)); 6150 6151 var lm = parseFloat(connectorMarker[0].style.left); 6152 var tm = parseFloat(connectorMarker[0].style.top); 6153 var li = parseFloat(connectorInfobox[0].style.left); 6154 var ti = parseFloat(connectorInfobox[0].style.top); 6155 6156 var wi = infobox.outerWidth(); 6157 var hi = infobox.outerWidth(); 6158 6159 var mlm = computedStyleConnectorMarker['margin-left']; 6160 var mtm = computedStyleConnectorMarker['margin-top']; 6161 var mli = computedStyleConnectorInfobox['margin-left']; 6162 var mti = computedStyleConnectorInfobox['margin-top']; 6163 6164 var line1 = jQuery(this).find('.mapEntryLine-1'); 6165 var line2 = jQuery(this).find('.mapEntryLine-2'); 6166 var line3 = jQuery(this).find('.mapEntryLine-3'); 6167 6168 //console.log(lm + '/' + tm + ' : ' + li + '/' + ti); 6169 //console.log(mlm + '/' + mtm + ' : ' + mli + '/' + mti); 6170 //console.log('calc(' + String(lm) + '% + ' + mlm + ')'); 6171 6172 var lineWidth = 1; 6173 6174 if(ti <= tm && li >= lm && parseFloat(mtm) < 0){ 6175 line1.css({'left' : 'calc(' + String(lm) + '% + ' + mlm + ')', 'top' : 'calc(' + String(ti + (tm - ti) / 2) + '% + ' + mtm + ')', 'width' : String(lineWidth) + 'px', 'height' : String((tm - ti) / 2) + '%'}); 6176 line2.css({'left' : 'calc(' + String(lm) + '% + ' + mlm + ')', 'top' : 'calc(' + String(ti + (tm - ti) / 2) + '% + ' + mtm + ')', 'width' : 'calc(' + String(li - lm) + '% ' + '-' + ' ' + mlm + ' + ' + lineWidth + 'px)', 'height' : String(lineWidth) + 'px'}); 6177 line3.css({'left' : 'calc(' + String(li) + '% + ' + mli + ')', 'top' : String(ti) + '%', 'width' : String(lineWidth) + 'px', 'height' : 'calc(' + String((tm - ti) / 2) + '% + ' + mtm + ')'}); 6178 } 6179 else if(ti <= tm && li <= lm && parseFloat(mtm) < 0){ 6180 line1.css({'left' : 'calc(' + String(lm) + '% + ' + mlm + ')', 'top' : 'calc(' + String(ti + (tm - ti) / 2) + '% + ' + mtm + ')', 'width' : String(lineWidth) + 'px', 'height' : String((tm - ti) / 2) + '%'}); 6181 line2.css({'left' : 'calc(' + String(li) + '% + ' + mli + ')', 'top' : 'calc(' + String(ti + (tm - ti) / 2) + '% + ' + mtm + ')', 'width' : 'calc(' + String(lm - li) + '% ' + '-' + ' ' + mli + ' + ' + lineWidth + 'px)', 'height' : String(lineWidth) + 'px'}); 6182 line3.css({'left' : 'calc(' + String(li) + '% + ' + mli + ')', 'top' : String(ti) + '%', 'width' : String(lineWidth) + 'px', 'height' : 'calc(' + String((tm - ti) / 2) + '% + ' + mtm + ')'}); 6183 } 6184 else if(ti > tm && li > lm && parseFloat(mtm) > 0){ 6185 line1.css({'left' : 'calc(' + String(lm) + '% + ' + mlm + ')', 'top' : 'calc(' + String(tm) + '% + ' + mtm + ')', 'width' : String(lineWidth) + 'px', 'height' : String((ti - tm) / 2) + '%'}); 6186 line2.css({'left' : 'calc(' + String(lm) + '% + ' + mlm + ')', 'top' : 'calc(' + String(ti + (tm - ti) / 2) + '% + ' + mtm + ')', 'width' : 'calc(' + String(li - lm) + '% ' + '-' + ' ' + mlm + ' + ' + lineWidth + 'px)', 'height' : String(lineWidth) + 'px'}); 6187 line3.css({'left' : 'calc(' + String(li) + '% + ' + mli + ')', 'top' : 'calc(' + String(tm + (ti - tm) / 2) + '% + ' + mtm + ')', 'width' : String(lineWidth) + 'px', 'height' : 'calc(' + String((ti - tm) / 2) + '% ' + '-' + ' ' + mtm + ')'}); 6188 } 6189 else if(ti > tm && li < lm && parseFloat(mtm) > 0){ 6190 line1.css({'left' : 'calc(' + String(lm) + '% + ' + mlm + ')', 'top' : 'calc(' + String(tm) + '% + ' + mtm + ')', 'width' : String(lineWidth) + 'px', 'height' : String((ti - tm) / 2) + '%'}); 6191 line2.css({'left' : 'calc(' + String(li) + '% + ' + mli + ')', 'top' : 'calc(' + String(tm + (ti - tm) / 2) + '% + ' + mtm + ')', 'width' : 'calc(' + String(lm - li) + '% ' + '-' + ' ' + mlm + ' + ' + lineWidth + 'px)', 'height' : String(lineWidth) + 'px'}); 6192 line3.css({'left' : 'calc(' + String(li) + '% + ' + mli + ')', 'top' : 'calc(' + String(tm + (ti - tm) / 2) + '% + ' + mtm + ')', 'width' : String(lineWidth) + 'px', 'height' : 'calc(' + String((ti - tm) / 2) + '% ' + '-' + ' ' + mtm + ')'}); 6193 } 6194 else if(li >= lm && ti >= tm){ 6195 line1.css({'left' : 'calc(' + String(lm) + '% + ' + mlm + ')', 'top' : 'calc(' + String(tm) + '% + ' + mtm + ')', 'width' : 'calc(' + String((li - lm) / 2) + '% ' + '-' + ' ' + mlm + ')', 'height' : String(lineWidth) + 'px'}); 6196 line2.css({'left' : 'calc(' + String(lm + (li - lm) / 2) + '%)', 'top' : 'calc(' + String(tm) + '% + ' + mtm + ')', 'width' : String(lineWidth) + 'px', 'height' : 'calc(' + String(ti - tm) + '% ' + '-' + ' ' + mtm + ' + ' + lineWidth + 'px)'}); 6197 line3.css({'left' : 'calc(' + String(lm + (li - lm) / 2) + '%)', 'top' : 'calc(' + String(ti) + '% + ' + mti + ')', 'width' : String((li - lm) / 2) + '%', 'height' : String(lineWidth) + 'px'}); 6198 } 6199 else if(li >= lm && ti <= tm){ 6200 line1.css({'left' : 'calc(' + String(lm) + '% + ' + mlm + ')', 'top' : 'calc(' + String(tm) + '% + ' + mtm + ')', 'width' : 'calc(' + String((li - lm) / 2) + '% ' + '-' + ' ' + mlm + ')', 'height' : String(lineWidth) + 'px'}); 6201 line2.css({'left' : 'calc(' + String(lm + (li - lm) / 2) + '%)', 'top' : 'calc(' + String(ti) + '% + ' + mti + ')', 'width' : String(lineWidth) + 'px', 'height' : 'calc(' + String(tm - ti) + '% ' + '-' + ' ' + mti + ' + ' + lineWidth + 'px)'}); 6202 line3.css({'left' : 'calc(' + String(lm + (li - lm) / 2) + '%)', 'top' : 'calc(' + String(ti) + '% + ' + mti + ')', 'width' : String((li - lm) / 2) + '%', 'height' : String(lineWidth) + 'px'}); 6203 } 6204 else if(li < lm && ti > tm){ 6205 line1.css({'left' : 'calc(' + String(li + (lm - li) / 2) + '% + ' + 0 + 'px)', 'top' : 'calc(' + String(tm) + '% + ' + mtm + ')', 'width' : 'calc(' + String((lm - li) / 2) + '% + ' + mlm + ')', 'height' : String(lineWidth) + 'px'}); 6206 line2.css({'left' : 'calc(' + String(lm + (li - lm) / 2) + '%)', 'top' : 'calc(' + String(tm) + '% + ' + mtm + ')', 'width' : String(lineWidth) + 'px', 'height' : 'calc(' + String(ti - tm) + '% ' + '-' + ' ' + mtm + ' + ' + lineWidth + 'px)'}); 6207 line3.css({'left' : 'calc(' + String(li) + '% + ' + 0 + 'px)', 'top' : 'calc(' + String(ti) + '% + ' + mti + ')', 'width' : 'calc(' + String((lm - li) / 2) + '% + 0px)', 'height' : String(lineWidth) + 'px'}); 6208 } 6209 else if(li < lm && ti < tm){ 6210 line1.css({'left' : 'calc(' + String(li + (lm - li) / 2) + '% + ' + 0 + 'px)', 'top' : 'calc(' + String(tm) + '% + ' + mtm + ')', 'width' : 'calc(' + String((lm - li) / 2) + '% + ' + mlm + ')', 'height' : String(lineWidth) + 'px'}); 6211 line2.css({'left' : 'calc(' + String(lm + (li - lm) / 2) + '%)', 'top' : 'calc(' + String(ti) + '% + ' + mti + ')', 'width' : String(lineWidth) + 'px', 'height' : 'calc(' + String(tm - ti) + '% ' + '-' + ' ' + mti + ' + ' + lineWidth + 'px)'}); 6212 line3.css({'left' : 'calc(' + String(li) + '% + ' + 0 + 'px)', 'top' : 'calc(' + String(ti) + '% + ' + mti + ')', 'width' : 'calc(' + String((lm - li) / 2) + '% + 0px)', 'height' : String(lineWidth) + 'px'}); 6213 } 6214 } 6215 }); 6216 }); 6217}; 6218 6219jQuery.fn.wImageCompare = function(){ 6220 6221 jQuery.each(jQuery(this), function(options){ 6222 6223 if(jQuery(this).data('hasInit') != '1'){ 6224 jQuery(this).data('hasInit', '1'); 6225 var fg = jQuery(this); 6226 fg.append('<div class="wglImageCompareSlider"><div><span></span><span></span></div></div>'); 6227 var sl = fg.find('.wglImageCompareSlider'); 6228 6229 var pf = jQuery(this).find('picture:first-child'); 6230 var pl = jQuery(this).find('picture:nth-child(2)'); 6231 var po = []; 6232 var ps = -1; 6233 var ia = false;
6234 6235 var getSizes = function () { 6236 po = [fg.offset().left, fg.offset().top, pl.width(), pl.height()]; 6237 if (ps === -1) { 6238 ps = (po[2] / 2); 6239 if (ps === 0) { 6240 var visibleParent = fg.parents(':visible'); 6241 if(visibleParent.length > 0) { 6242 ps = visibleParent.width() / 2; 6243 } 6244 } 6245 } 6246 }; 6247 6248 var adaptSlider = function(){ 6249 pl.css('clip', 'rect(0, ' + ps + 'px, ' + po[3] + 'px, 0)'); 6250 sl.css({'left' : ps + 'px', 'height' : po[3] + 'px'}); 6251 }; 6252 6253 fg.on('mousedown touchstart', function(event){ 6254 event.preventDefault(); 6255 event.stopPropagation(); 6256 ia = true; 6257 }); 6258 6259 fg.on('mousemove touchmove', function(event){ 6260 event.stopPropagation(); 6261 if(ia){ 6262 var pageX = event.pageX ? event.pageX : event.touches[0].pageX; 6263 ps = pageX - po[0]; 6264 ps = ps < 0 ? 0 : (ps > po[2] ? po[2] : ps); 6265 adaptSlider(); 6266 } 6267 }); 6268 6269 fg.on('mouseup touchend', function(event){ 6270 ia = false; 6271 }); 6272 6273 jQuery(window).on('resize', function(){ 6274 getSizes(); 6275 adaptSlider(); 6276 }); 6277 6278 window.setTimeout(function(){ 6279 getSizes(); 6280 adaptSlider(); 6281 }, 200); 6282 window.setTimeout(function(){ 6283 getSizes(); 6284 adaptSlider(); 6285 }, 400); 6286 window.setTimeout(function(){ 6287 getSizes(); 6288 adaptSlider(); 6289 }, 800); 6290 6291 getSizes(); 6292 adaptSlider(); 6293 jQuery(this).addClass('hasInit'); 6294 } 6295 }); 6296}; 6297 6298jQuery.fn.wSearchSuggest = function(){ 6299 6300 jQuery.each(jQuery(this), function(index){ 6301 var cE = jQuery(this); 6302 cE.attr('autocomplete', 'off'); 6303 6304 cE.on('keydown', function(event){ 6305 if(event.keyCode == 27){ 6306 jQuery('#searchSuggestOuter').remove(); 6307 } 6308 else if(event.keyCode == 40 || event.keyCode == 38){ 6309 event.preventDefault(); 6310 6311 if(event.target.value == ''){ 6312 return false; 6313 } 6314 6315 var positionSuggestSelected = 0; 6316 if(event.target.getAttribute('data-positionsuggestedselected')){ 6317 positionSuggestSelected = positionSuggestSelected + parseInt(event.target.getAttribute('data-positionsuggestedselected')); 6318 } 6319 6320 positionSuggestSelected = event.keyCode == 40 ? positionSuggestSelected + 1 : positionSuggestSelected - 1; 6321 if(positionSuggestSelected > jQuery('#searchSuggestOuter .searchSuggestEntry').length){ 6322 positionSuggestSelected = jQuery('#searchSuggestOuter .searchSuggestEntry').length; 6323 } 6324 else if(positionSuggestSelected < 1){ 6325 positionSuggestSelected = 1; 6326 } 6327 6328 if(jQuery('#searchSuggestOuter .searchSuggestEntry:nth-child(' + positionSuggestSelected + ')').data('word')){ 6329 event.target.value = jQuery('#searchSuggestOuter .searchSuggestEntry:nth-child(' + positionSuggestSelected + ')').data('word'); 6330 event.target.setAttribute('data-positionsuggestedselected', positionSuggestSelected); 6331 } 6332 6333 jQuery('#searchSuggestOuter .searchSuggestEntry').removeClass('selected'); 6334 jQuery('#searchSuggestOuter .searchSuggestEntry:nth-child(' + positionSuggestSelected + ')').addClass('selected'); 6335 } 6336 }); 6337 6338 const debounceSuggest = typeof(wDebounceSuggest) != 'undefined' ? wDebounceSuggest : 300; 6339 6340 const debouncedHandler = wDebounce(wKeydownSuggest, debounceSuggest); 6341 6342 cE.on('keyup', function(event){ 6343 event.preventDefault(); 6344 if(event.keyCode == 40 || event.keyCode == 38){ 6345 event.preventDefault(); 6346 return; 6347 } 6348 6349 wUiTmp['wKeydownSuggestThis'] = jQuery(this); 6350 debouncedHandler(); 6351 }); 6352 6353 cE.on('blur', function(event){ 6354 event.preventDefault(); 6355 jQuery('#searchSuggestOuter').remove(); 6356 }); 6357 6358 cE.parent().on('mousedown', function(e){ 6359 if(jQuery(e.target).closest('.searchSuggestEntry').length){ 6360 jQuery(e.target).closest('#searchSuggestOuter').prev('input').val(jQuery(e.target).closest('.searchSuggestEntry').data('word')); 6361 jQuery(this).closest('form').submit(); 6362 jQuery('#searchSuggestOuter').remove(); 6363 } 6364 }); 6365 }); 6366}; 6367 6368wKeydownSuggest = function(){ 6369 6370 var cE = wUiTmp['wKeydownSuggestThis']; 6371 6372 var searchTerm = cE.val(); 6373 6374 if(typeof(wUiTmp['searchTermNumberResults']) == 'undefined'){ 6375 wUiTmp['searchTermNumberResults'] = {}; 6376 } 6377 6378 if(searchTerm != '' && searchTerm != wUiTmp['lastSearchTerm']){ 6379 6380 if(wUiTmp['lastSearchTerm'] && searchTerm.indexOf(wUiTmp['lastSearchTerm']) == 0 && wUiTmp['lastSearchTermNumberResults'] == 0){ 6381 return; 6382 } 6383 6384 if(wUiTmp['searchTermNumberResults'][searchTerm] && wUiTmp['searchTermNumberResults'][searchTerm] == 0){ 6385 return; 6386 } 6387 var project = location.pathname.replace(/[^\/]*$/, '').replace(/^(\/[^\/]*)[^\?]*/, '$1'); 6388 if(cE.data('project-search')){ 6389 projectSearch = cE.data('project-search'); 6390 if(project == '/'){ 6391 project = projectSearch.replace(/\s*\!important/, ''); 6392 } 6393 else if(projectSearch.indexOf('!important') != -1){ 6394 project = projectSearch.replace(/\s*\!important/, ''); 6395 } 6396 } 6397 var querystringToAdd = ''; 6398 if(cE.data('querystringtoadd')){ 6399 querystringToAdd = cE.data('querystringtoadd'); 6400 } 6401 var querystringSuggestPath = ''; 6402 if(cE.data('suggest-path')){ 6403 querystringSuggestPath = '&suggestPath=' + cE.data('suggest-path'); 6404 } 6405 var projectGlobal = wUiTmp['wGlobalProjectPath']; 6406 var search = 'default'; 6407 if(cE.data('id-search')){ 6408 search = cE.data('id-search'); 6409 } 6410 var url = projectGlobal + '/wGlobal/scripts/php/wSearchSuggest.php?searchTerm=' + encodeURIComponent(searchTerm) + '&project=' + project + '&search=' + search + querystringSuggestPath + querystringToAdd; 6411 if(cE.data('usecache') == '1'){ 6412 url = project + '/weblication/wSearchSuggest/searchTerm=' + encodeURIComponent(searchTerm).replace(/~/g, '_WT-IL_').replace(/%/g, '~').toLowerCase() + '.html'; 6413 } 6414 6415 jQuery.ajax({type: "GET", url: url, dataType: 'json', success: function(resultData){ 6416 var numberResults = 0; 6417 var innerHTMLSuggest = '<div id="searchSuggestOuter"><div id="searchSuggestInner">'; 6418 for(word in resultData){ 6419 innerHTMLSuggest += '<div class="searchSuggestEntry" data-word="' + word + '">' + word + '</div>'; 6420 numberResults++; 6421 } 6422 6423 wUiTmp['lastSearchTermNumberResults'] = numberResults; 6424 wUiTmp['searchTermNumberResults'][searchTerm] = numberResults; 6425 6426 innerHTMLSuggest += '</div></div>'; 6427 jQuery('#searchSuggestOuter').remove(); 6428 if(numberResults > 0){ 6429 cE.after(innerHTMLSuggest); 6430 } 6431 }}); 6432 } 6433 else if(searchTerm != wUiTmp['lastSearchTerm']){ 6434 jQuery('#searchSuggestOuter').remove(); 6435 } 6436 wUiTmp['lastSearchTerm'] = searchTerm; 6437}; 6438 6439jQuery.fn.wTabcontainer = function(data = {}){ 6440 6441 var maxHeightContent = 0; 6442 6443 jQuery.each(jQuery(this), function(){ 6444 6445 var tabcontainerCurrent = jQuery(this); 6446 6447 if(typeof(wOnBeforeInitTabcontainer) === 'function'){ 6448 var rtcEvent = wOnBeforeInitTabcontainer(tabcontainerCurrent); 6449 if(rtcEvent === false){ 6450 return false;
6451 } 6452 } 6453 6454 var tabcontainerID = tabcontainerCurrent.get(0).id.replace(/tabContainer_/, ''); 6455 var tabcontainerTabs = tabcontainerCurrent.find('> .tabsSmall, > .tabsSelectbox, > .tabs, > div > .tabs, > div > div > .tabs, > div > div > div > .tabs, > .containers, > div > .containers, > div > div > .containers'); 6456 var curHash = data['curHashId'] || location.hash; 6457 6458 var options = {}; 6459 options['initOpen'] = options['initOpen'] || jQuery(this).attr('data-initopen'); 6460 options['rememberSelected'] = options['rememberSelected'] || jQuery(this).data('rememberselected'); 6461 options['expandAll'] = options['expandAll'] || jQuery(this).attr('data-expandall'); 6462 var activeContent = options['initOpen'] || 0; 6463 6464 6465 if(/^\d+$/.test(activeContent)){ 6466 activeContent = parseInt(activeContent) - 1; 6467 } 6468 6469 if(options['rememberSelected'] == '1' || typeof(wEditor) != 'undefined'){ 6470 var checkCookieRegExp = new RegExp('registerTab_' + tabcontainerID + '=(\\d+)'); 6471 if(checkCookieRegExp.test(document.cookie)){ 6472 activeContent = RegExp.$1 - 1; 6473 } 6474 } 6475 6476 var jQueryHashIdOrig = curHash.replace(/\:/g, '\\:').replace(/\./g, '\\.').replace(/\//g, '\\/').replace(/\&/g, '').replace(/=/g, '').replace(/\[/g, '').replace(/\]/g, '').replace(/\?/g, ''); 6477 var jQueryHashId = jQueryHashIdOrig.replace('open_', 'anchor_'); 6478 6479 if(jQueryHashId != '' && jQueryHashId != '#' && /^#?tab_/.test(jQueryHashId) && jQuery(this).find(jQueryHashId).length > 0){ 6480 if(/_(\d+)$/.test(jQuery(jQueryHashId).attr('id'))){ 6481 activeContent = RegExp.$1 - 1; 6482 } 6483 else{ 6484 var containerIndex = jQuery(jQueryHashId).parents('.container, .containerInvisible').index(); 6485 if(containerIndex >= 0){ 6486 activeContent = containerIndex; 6487 } 6488 } 6489 } 6490 6491 if(jQueryHashId != '' && jQueryHashId != '#' && jQuery(this).find(jQueryHashIdOrig).length > 0){ 6492 if(jQuery(this).find(jQueryHashIdOrig).closest('.container').length > 0){ 6493 var closestId = jQuery(this).find(jQueryHashIdOrig).closest('.container').attr('id'); 6494 if(/_(\d+)$/.test(closestId)){ 6495 activeContent = !isNaN(parseInt(RegExp.$1)) && parseInt(RegExp.$1) >= 1 ? parseInt(RegExp.$1) - 1 : 0; 6496 } 6497 } 6498 } 6499 6500 if(options['initOpen'] !== 'false'){ 6501 if(options['expandAll'] == '1'){ 6502 tabcontainerCurrent.attr('data-initOpen', 'openAll'); 6503 tabcontainerCurrent.find('.containerTab').addClass('containerTabSelected').next('.container').addClass('containerSelected containerSelectedAfterInit').removeClass('containerInvisible'); 6504 } 6505 else if(typeof(wEditor) == 'undefined'){ 6506 tabcontainerCurrent.find('> .tabsOuter > .tabs > .tabSelected,> .tabs > .tabSelected').removeClass('tabSelected'); 6507 tabcontainerCurrent.find('> .tabsOuter > .tabs > .tab,> .tabs > .tab').eq(activeContent).addClass('tabSelected'); 6508 tabcontainerCurrent.find('> .containers > .containerTab,> div > .containers > .containerTab,> div > div > .containers > .activeContent').removeClass('containerTabSelected'); 6509 tabcontainerCurrent.find('> .containers > .containerTab,> div > .containers > .containerTab,> div > div > .containers > .activeContent').eq(activeContent).addClass('containerTabSelected'); 6510 tabcontainerCurrent.find('> .containers > .container,> div > .containers > .container,> div > div > .containers > .container').addClass('containerInvisible'); 6511 tabcontainerCurrent.find('> .containers > .container,> div > .containers > .container,> div > div > .containers > .container').eq(activeContent).removeClass('containerInvisible').addClass('containerSelected').addClass('containerSelectedAfterInit'); 6512 } 6513 else{ 6514 tabcontainerCurrent.find('> div > div > .tabsOuter > .tabs > .tabSelected,> div > div > .tabs > .tabSelected').removeClass('tabSelected'); 6515 tabcontainerCurrent.find('> div > div > .tabsOuter > .tabs > .tab,> div > div > .tabs > .tab').eq(activeContent).addClass('tabSelected'); 6516 tabcontainerCurrent.find('> div > div > .containers > .containerTab,> div > div > div > .containers > .containerTab,> div > div > div > div > .containers > .activeContent').removeClass('containerTabSelected'); 6517 tabcontainerCurrent.find('> div > div > .containers > .containerTab,> div > div > div > .containers > .containerTab,> div > div > div > div > .containers > .activeContent').eq(activeContent).addClass('containerTabSelected'); 6518 tabcontainerCurrent.find('> div > div > .containers > .container,> div > div > div > .containers > .container,> div > div > div > div > .containers > .container').addClass('containerInvisible'); 6519 tabcontainerCurrent.find('> div > div > .containers > .container,> div > div > div > .containers > .container,> div > div > div > div > .containers > .container').eq(activeContent).removeClass('containerInvisible').addClass('containerSelected').addClass('containerSelectedAfterInit'); 6520 } 6521 if(tabcontainerCurrent.attr('data-initopen') != 0) tabcontainerCurrent.attr('data-numberclicks', parseInt(tabcontainerCurrent.attr('data-numberclicks'))+1); 6522 } 6523 6524 var eventsOpen = 'click'; 6525 6526 if(tabcontainerTabs.data('selecttabonmouseover') == '1'){ 6527 eventsOpen = 'click mouseover'; 6528 } 6529 6530 if(typeof(wEditor) == 'undefined'){ 6531 /*Barrierefreiheit*/ 6532 aE = jQuery.extend(true, {element : tabcontainerCurrent}, wAccessEvents['containerTab']); 6533 wAccessHandler.addEvent(aE, {'idPrefix' : 'containerTab'}); 6534 } 6535 6536 tabcontainerTabs.children('.tab, .containerTab').on(eventsOpen, function(event){ 6537 event.preventDefault(); 6538 6539 var eventType = event.type; 6540 var headerSelected = jQuery(this); 6541 var tabcontainerSelected = headerSelected.get(0).id.replace(/.*_/, ''); 6542 var displayAccordeon = tabcontainerCurrent.hasClass('breakChildren'); 6543 var numberClicks = tabcontainerCurrent.attr('data-numberclicks'); 6544 var initState = tabcontainerCurrent.attr('data-initOpen'); 6545 var openMultiple = tabcontainerCurrent.attr('data-openmultiple'); 6546 var tabSelected = jQuery(this).hasClass('tabSelected'); 6547 6548 tabcontainerCurrent.attr('data-numberclicks', tabcontainerCurrent.attr('data-numberclicks') ? parseInt(tabcontainerCurrent.attr('data-numberclicks')) + 1 : 1); 6549 6550 if(eventType == 'mouseover' && headerSelected.get(0).className.indexOf('containerTab') != -1){ 6551 return false;
6552 } 6553 6554 if(eventType != 'mouseover' && headerSelected.attr('id') && headerSelected.parent().data('pushstateonselect') == '1'){ 6555 history.pushState({page: '#' + headerSelected.attr('id')}, '', '#' + headerSelected.attr('id')); 6556 } 6557 6558 var containers = jQuery(this).parent().parent().get(0).className.indexOf('tabsOuter') == 0 ? jQuery(this).parent().parent().parent().find('> .containers,> div > .containers,> div > div > .containers') : jQuery(this).parent().parent().find('> .containers,> div > .containers,> div > div > .containers'); 6559 6560 if(typeof(wOnBeforeClickTabcontainer) === 'function'){ 6561 var rtcEvent = wOnBeforeClickTabcontainer(headerSelected); 6562 if(rtcEvent === false){ 6563 return false; 6564 } 6565 } 6566 6567 containers.children('.containerTab').each(function(){ 6568 var currentContainerTab = this; 6569 (function(currentContainerTab){ 6570 if(currentContainerTab.id == 'containerTab_' + tabcontainerID + '_' + tabcontainerSelected){ 6571 if(initState == 'openAll'){ 6572 currentContainerTab.className = 'containerTab containerTabSelected'; 6573 } 6574 else if(tabSelected != 1 && displayAccordeon && numberClicks != 0 && currentContainerTab.className.indexOf('containerTabSelected') != -1 && currentContainerTab.className.indexOf('containerTabUnselectedAccordeon') == -1){ 6575 currentContainerTab.className = 'containerTab containerTabUnselectedAccordeon'; 6576 } 6577 else{ 6578 currentContainerTab.className = 'containerTab containerTabSelected'; 6579 } 6580 } 6581 else{ 6582 currentContainerTab.className = 'containerTab'; 6583 } 6584 })(currentContainerTab); 6585 }); 6586 6587 containers.children('.container, .containerSelected, .containerInvisible').each(function(){ 6588 var currentContainer = this; 6589 (function(currentContainer){ 6590 //console.log(currentContainer.id + ' == container_' + tabcontainerID + '_' + tabcontainerSelected); 6591 if(currentContainer.id == 'container_' + tabcontainerID + '_' + tabcontainerSelected){ 6592 if(initState == 'openAll'){ 6593 currentContainer.className = 'container containerSelected'; 6594 window.setTimeout(function(){jQuery(currentContainer).addClass('containerSelectedAfterInit')}, 32); 6595 } 6596 else if(tabSelected != 1 && displayAccordeon && numberClicks != 0 && currentContainer.className.indexOf('containerSelected') != -1 && currentContainer.className.indexOf('containerInvisibleAccordeon') == -1){ 6597 currentContainer.className = 'container containerInvisibleAccordeon'; 6598 } 6599 else{ 6600 currentContainer.className = 'container containerSelected'; 6601 window.setTimeout(function(){jQuery(currentContainer).addClass('containerSelectedAfterInit')}, 32); 6602 } 6603 } 6604 else{ 6605 if(openMultiple != '1' || !displayAccordeon){ 6606 currentContainer.className = 'container containerInvisible'; 6607 window.setTimeout(function(){jQuery(currentContainer).addClass('containerInvisibleAfterInit')}, 32); 6608 } 6609 } 6610 })(currentContainer); 6611 }); 6612 6613 var tabsOuter = jQuery(this).parent().parent(); 6614 6615 if(tabsOuter.hasClass('containersOuter')){ 6616 tabsOuter = tabsOuter.parent().find('.tabsOuter'); 6617 } 6618 6619 tabsOuter.find('> .tabsSmall, > .tabsSelectbox, > .tabs, > div > .tabs, > div > div > .tabs, > div > div > div > .tabs').children('.tab').each(function(){ 6620 if(this.id == 'tab_' + tabcontainerID + '_' + tabcontainerSelected){ 6621 jQuery(this).addClass('tabSelected').attr({'tabindex': -1, 'aria-selected': 'true'}); 6622 } 6623 else{ 6624 jQuery(this).removeClass('tabSelected').attr({'tabindex': 0, 'aria-selected': 'false'}); 6625 } 6626 }); 6627 6628 if(typeof(wEditor) != 'undefined' || options['rememberSelected'] == '1'){ 6629 document.cookie = 'registerTab_' + tabcontainerID + '=' + tabcontainerSelected + ';path=/;sameSite=Lax'; 6630 } 6631 6632 if(typeof(wOnAfterClickTabcontainer) === 'function'){ 6633 var rtcEvent = wOnAfterClickTabcontainer(headerSelected); 6634 if(rtcEvent === false){ 6635 return false;
6636 } 6637 } 6638 6639 if(eventType != 'mouseover'){ 6640 jQuery(window).trigger('resize'); 6641 } 6642 jQuery('.wglBannerSlider').wBannerSlider(); 6643 jQuery('.wglSmartSlider').wSmartSlider(); 6644 jQuery('.wglPictureGallery').wPictureGallery(); 6645 }); 6646 6647 if(typeof(wEditor) == 'undefined'){ 6648 jQuery(this).find('.container, .containerSelected, .containerInvisible').each(function(index){ 6649 if(jQuery(this).html() == ''){ 6650 tabcontainerCurrent.find('> .tabs > div:nth-child(' + (index + 1) + ')').remove(); 6651 } 6652 }); 6653 } 6654 }); 6655}; 6656 6657wOpenAllTabcontainer = function(id){ 6658 jQuery('.wglTabcontainer').attr('data-expandall', '1').attr('data-initopen', '0').wTabcontainer(); 6659}; 6660 6661wOnBreakChildrenTabContainer = function(el){ 6662 6663 var tabContainer = el.closest('.elementTabContainer'); 6664 if(!tabContainer.hasClass('breakChildren')){ 6665 if(wIsClassDefined('elementTabContainer')){ 6666 tabContainer.find('.tab:first-child').trigger('click'); 6667 } 6668 } 6669}; 6670 6671wIsClassDefined = function(name){ 6672 6673 [...document.styleSheets].some(sheet => { 6674 try { 6675 return [...sheet.cssRules].some(function check(r) { 6676 return r.selectorText?.split(',').some(s => s.trim().includes('.' + name)) 6677 || (r.cssRules && [...r.cssRules].some(check)); 6678 }); 6679 } catch { return false; } 6680 }); 6681}; 6682 6683jQuery.fn.wAccordion = function(){ 6684 6685 var maxHeightContent = 0; 6686 6687 jQuery.each(jQuery(this), function(){ 6688 6689 var $accordion = jQuery(this); 6690 6691 /* 6692 * Header und Inhalte unabhängig davon ermitteln, ob sie direkt unter 6693 * .wglAccordion liegen oder in einem .accordion-Wrapper / <details>. 6694 */ 6695 var $headers = $accordion.find('.accordionHeader').filter(function(){ 6696 return jQuery(this).closest('.wglAccordion')[0] === $accordion[0] && 6697 jQuery(this).next('.accordionContent').length > 0; 6698 }); 6699 6700 var $contents = $headers.map(function(){ 6701 return jQuery(this).next('.accordionContent')[0]; 6702 }); 6703 6704 /* 6705 * Bei <details> muss zusätzlich das native open-Attribut gepflegt werden. 6706 * Bei einem normalen div.accordion hat diese Funktion keine Auswirkung. 6707 */ 6708 function setDetailsOpen($content, isOpen){ 6709 $content.parent('details.accordion').prop('open', isOpen); 6710 } 6711 6712 var options = {}; 6713 6714 options['initOpen'] = options['initOpen'] || $accordion.data('initopen'); 6715 options['multiple'] = options['multiple'] || $accordion.data('multiple'); 6716 options['expandAll'] = options['expandAll'] || $accordion.data('expandall'); 6717 options['collapsible'] = options['collapsible'] || $accordion.data('collapsible'); 6718 options['group'] = options['group'] || $accordion.data('group'); 6719 options['rememberSelected'] = options['rememberSelected'] || $accordion.data('rememberselected'); 6720 options['addCloserContent'] = options['addCloserContent'] || $accordion.data('addclosercontent') || ''; 6721 options['slideMode'] = options['slideMode'] || $accordion.data('slidemode') || ''; 6722 options['slideUpDuration'] = options['slideUpDuration'] || $accordion.data('slideup-duration') || $accordion.data('slide-duration') || 400; 6723 options['slideDownDuration'] = options['slideDownDuration'] || $accordion.data('slidedown-duration') || $accordion.data('slide-duration') || 400; 6724 options['slideUpEasing'] = options['slideUpEasing'] || $accordion.data('slideup-easing') || $accordion.data('slide-easing') || 'swing'; 6725 options['slideDownEasing'] = options['slideDownEasing'] || $accordion.data('slidedown-easing') || $accordion.data('slide-easing') || 'swing'; 6726 6727 var slideDownOptions = { 6728 duration: options['slideUpDuration'], 6729 easing: options['slideUpEasing'] 6730 }; 6731 6732 var slideUpOptions = { 6733 duration: options['slideDownDuration'], 6734 easing: options['slideDownEasing'] 6735 }; 6736 6737 var accordionID = ($accordion.get(0).id || '').replace(/accordion_/, ''); 6738 6739 var activeContent = options['initOpen']; 6740 6741 if(/^\d+$/.test(activeContent)){ 6742 activeContent = parseInt(activeContent, 10) - 1; 6743 } 6744 6745 if(options['rememberSelected'] == '1'){ 6746 var checkCookieRegExp = new RegExp('accordionTab_' + accordionID + '=Accordion-(\\d+)'); 6747 6748 if(checkCookieRegExp.test(document.cookie)){ 6749 activeContent = RegExp.$1 - 1; 6750 } 6751 else{ 6752 checkCookieRegExp = new RegExp('accordionTab_' + accordionID + '=(\\d+)'); 6753 6754 if(checkCookieRegExp.test(document.cookie)){ 6755 activeContent = RegExp.$1 - 1; 6756 } 6757 } 6758 } 6759 6760 var jQueryHashId = decodeURIComponent( 6761 location.hash 6762 .replace(/\./g, '\\.') 6763 .replace(/\//g, '\\/') 6764 .replace('open_', 'anchor_') 6765 .replace(/\&/g, '') 6766 .replace(/=/g, '') 6767 ) 6768 .replace(/\[/g, '') 6769 .replace(/\]/g, '') 6770 .replace(/\?/g, ''); 6771 6772 options['active'] = options['active'] || activeContent; 6773 6774 ignoreFocusout = false;
6775 lastFocusOut = 0; 6776 6777 /* 6778 * Nicht mehr .children('.accordionContent'), da der Content auch 6779 * innerhalb von .accordion oder <details> liegen kann. 6780 */ 6781 $contents.each(function(index){ 6782 6783 if(options['addCloserContent'] == '1'){ 6784 jQuery(this).prepend('<div class="accordionCloserContent" tabindex="0"></div>'); 6785 6786 jQuery(this).find('.accordionCloserContent').on('click', function(event){ 6787 jQuery(this).parent().prev('.accordionHeader').trigger('click'); 6788 6789 wUiTmp['ignoreFocusout'] = true; 6790 6791 setTimeout(function(){ 6792 wUiTmp['ignoreFocusout'] = false; 6793 }, 500); 6794 }); 6795 6796 jQuery(this).find('.accordionCloserContent').keypress(function(event){ 6797 if(event.keyCode == 13 || event.keyCode == 32){ 6798 jQuery(this).trigger('click'); 6799 jQuery(this).parent().prev('.accordionHeader').focus(); 6800 6801 event.preventDefault(); 6802 6803 wUiTmp['ignoreFocusout'] = true; 6804 6805 setTimeout(function(){ 6806 wUiTmp['ignoreFocusout'] = false; 6807 }, 500); 6808 } 6809 }); 6810 6811 jQuery(this).on('focusin', function(event){ 6812 wUiTmp['ignoreFocusout'] = true; 6813 6814 setTimeout(function(){ 6815 wUiTmp['ignoreFocusout'] = false; 6816 }, 100); 6817 }); 6818 6819 jQuery(this).on('focusout', function(event){ 6820 setTimeout(() => { 6821 if( 6822 wUiTmp['lastActionSource'] !== 'mouse' && 6823 wUiTmp['lastKey'] !== 'Tab' && 6824 wUiTmp['lastKey'] !== 'Escape' 6825 ){ 6826 return false; 6827 } 6828 6829 if(wUiTmp['ignoreFocusout']){ 6830 return false; 6831 } 6832 6833 var container = jQuery(this).get(0); 6834 var active = document.activeElement; 6835 6836 if(!container.contains(active)){ 6837 jQuery(this).find('.accordionCloserContent').trigger('click'); 6838 6839 wUiTmp['ignoreClick'] = true; 6840 6841 setTimeout(function(){ 6842 wUiTmp['ignoreClick'] = false; 6843 }, 300); 6844 } 6845 }, 20); 6846 }); 6847 } 6848 6849 var heightContent = jQuery(this).height(); 6850 6851 if(heightContent > maxHeightContent){
6852 maxHeightContent = heightContent; 6853 } 6854 }); 6855 6856 var lastOpenedEntry = null; 6857 6858 /* 6859 * Header werden aus $headers gelesen. Damit funktionieren: 6860 * 6861 * .wglAccordion > .accordionHeader + .accordionContent 6862 * .wglAccordion > .accordion > .accordionHeader + .accordionContent 6863 * .wglAccordion > details.accordion > summary.accordionHeader + .accordionContent 6864 */ 6865 $headers.each(function(index){ 6866 6867 var $header = jQuery(this); 6868 var $content = $header.next('.accordionContent'); 6869 6870 if(typeof(wEditor) == 'undefined'){ 6871 $header.keypress(function(event){ 6872 if(event.keyCode == 13 || event.keyCode == 32){ 6873 $header.trigger('click'); 6874 event.preventDefault(); 6875 } 6876 }); 6877 } 6878 6879 var openCurrent = false; 6880 6881 if( 6882 jQueryHashId != '' && 6883 jQueryHashId != '#' && 6884 ( 6885 '#' + $header.attr('id') == jQueryHashId || 6886 $content.find(jQueryHashId).length > 0 6887 ) 6888 ){ 6889 if(/_Accordion-/.test(jQuery(jQueryHashId).attr('id'))){ 6890 options['active'] = index; 6891 6892 if(!options['multiple'] && lastOpenedEntry){ 6893 lastOpenedEntry 6894 .addClass('accordionHeaderHidden') 6895 .removeClass('accordionHeaderVisible'); 6896 6897 lastOpenedEntry 6898 .next('.accordionContent') 6899 .addClass('accordionContentHidden') 6900 .removeClass('accordionContentVisible') 6901 .hide(); 6902 6903 setDetailsOpen(lastOpenedEntry.next('.accordionContent'), false); 6904 6905 lastOpenedEntry = null; 6906 } 6907 6908 openCurrent = true; 6909 } 6910 else if(jQuery(jQueryHashId).parents('.accordionContent').length > 0){ 6911 options['active'] = index; 6912 } 6913 } 6914 else{ 6915 var jQueryHashIdAlt = jQueryHashId.replace(/_Accordion-\d+/, '_Accordion'); 6916 6917 if( 6918 jQueryHashIdAlt != '' && 6919 jQueryHashIdAlt != '#' && 6920 ( 6921 '#' + $header.attr('id') == jQueryHashIdAlt || 6922 $content.find(jQueryHashIdAlt).length > 0 6923 ) 6924 ){ 6925 if(/_Accordion-/.test(jQuery(jQueryHashIdAlt).attr('id'))){ 6926 options['active'] = index; 6927 6928 if(!options['multiple'] && lastOpenedEntry){ 6929 lastOpenedEntry 6930 .addClass('accordionHeaderHidden') 6931 .removeClass('accordionHeaderVisible'); 6932 6933 lastOpenedEntry 6934 .next('.accordionContent') 6935 .addClass('accordionContentHidden') 6936 .removeClass('accordionContentVisible') 6937 .hide(); 6938 6939 setDetailsOpen(lastOpenedEntry.next('.accordionContent'), false); 6940 6941 lastOpenedEntry = null; 6942 } 6943 6944 openCurrent = true; 6945 } 6946 else if(jQuery(jQueryHashIdAlt).parents('.accordionContent').length > 0){ 6947 options['active'] = index; 6948 } 6949 } 6950 } 6951 6952 if(options['collapsible']){ 6953 $header 6954 .addClass('accordionHeaderCollapsible') 6955 .removeClass('accordionHeaderNoneCollapsible'); 6956 } 6957 else{ 6958 $header 6959 .addClass('accordionHeaderNoneCollapsible') 6960 .removeClass('accordionHeaderCollapsible'); 6961 } 6962 6963 if( 6964 options['expandAll'] || 6965 typeof(options['active']) == 'number' && options['active'] == index 6966 ){ 6967 lastOpenedEntry = $header; 6968 6969 $header.attr('aria-expanded') 6970 ? $header.attr('aria-expanded', 'true') 6971 : $header.find('.accordionHeaderCaption').attr('aria-expanded', 'true'); 6972 6973 $header 6974 .addClass('accordionHeaderVisible') 6975 .removeClass('accordionHeaderHidden'); 6976 6977 setDetailsOpen($content, true); 6978 6979 $content 6980 .attr('aria-hidden', 'false') 6981 .addClass('accordionContentVisible') 6982 .removeClass('accordionContentHidden') 6983 .show(); 6984 } 6985 else{ 6986 $header.attr('aria-expanded') 6987 ? $header.attr('aria-expanded', 'false') 6988 : $header.find('.accordionHeaderCaption').attr('aria-expanded', 'false'); 6989 6990 $header 6991 .addClass('accordionHeaderHidden') 6992 .removeClass('accordionHeaderVisible'); 6993 6994 setDetailsOpen($content, false); 6995 6996 $content 6997 .attr('aria-hidden', 'true') 6998 .addClass('accordionContentHidden') 6999 .removeClass('accordionContentVisible') 7000 .hide(); 7001 } 7002 7003 if(options['heightStyle'] == 'auto'){ 7004 $content.css({'height': maxHeightContent}); 7005 } 7006 7007 $header.on('click', function(event, forceOpen){ 7008 event.preventDefault(); 7009 7010 wUiTmp['ignoreFocusout'] = true; 7011 7012 setTimeout(function(){ 7013 wUiTmp['ignoreFocusout'] = false;
7014 }, 500); 7015 7016 if( 7017 wUiTmp['ignoreClick'] && 7018 wUiTmp['lastAccordionOpen'] === accordionID + '_' + index 7019 ){ 7020 return false; 7021 } 7022 7023 var headerSelected = jQuery(this); 7024 var contentSelected = headerSelected.next('.accordionContent'); 7025 7026 /* 7027 * Alle zum aktuellen Accordion gehörenden Inhalte. 7028 * Funktioniert unabhängig von zusätzlichen Wrapper-Elementen. 7029 */ 7030 var accordionContents = $contents; 7031 7032 var hasEntryVisible = false; 7033 var hasEntryInvisible = false; 7034 7035 forceOpen = typeof(forceOpen) != 'undefined' ? forceOpen : false; 7036 7037 if(typeof(wOnBeforeClickAccordeon) === 'function'){ 7038 var rtcEvent = wOnBeforeClickAccordeon(headerSelected); 7039 7040 if(rtcEvent === false){ 7041 return false; 7042 } 7043 } 7044 7045 accordionContents.each(function(contentIndex){ 7046 7047 var $currentContent = jQuery(this); 7048 var $currentHeader = $currentContent.prev('.accordionHeader'); 7049 7050 if($currentContent.get(0) == contentSelected.get(0)){ 7051 7052 if($currentContent.hasClass('accordionContentVisible')){ 7053 hasEntryInvisible = true; 7054 } 7055 else{ 7056 hasEntryVisible = true; 7057 } 7058 7059 if($currentContent.hasClass('accordionContentVisible') && !forceOpen){ 7060 7061 if(options['collapsible']){ 7062 7063 $accordion.trigger('accordionbeforeactivate', { 7064 'newHeader': headerSelected 7065 }); 7066 7067 $currentHeader.attr('aria-expanded') 7068 ? $currentHeader.attr('aria-expanded', 'false') 7069 : $currentHeader.find('.accordionHeaderCaption').attr('aria-expanded', 'false'); 7070 7071 $currentHeader 7072 .addClass('accordionHeaderHidden') 7073 .removeClass('accordionHeaderVisible'); 7074 7075 $currentContent.removeClass('accordionContentVisible'); 7076 7077 if(options['slideMode'] === 'transition'){ 7078 $currentContent.hide(); 7079 7080 setDetailsOpen($currentContent, false); 7081 7082 $currentContent 7083 .addClass('accordionContentHidden') 7084 .attr('aria-hidden', 'true') 7085 .removeAttr('tabindex'); 7086 7087 $accordion.trigger('accordionchange', { 7088 'newHeader': headerSelected 7089 }); 7090 } 7091 else{ 7092 $currentContent.slideUp({ 7093 duration: slideUpOptions['duration'], 7094 easing: slideUpOptions['easing'], 7095 complete: function(){ 7096 jQuery(this) 7097 .addClass('accordionContentHidden') 7098 .attr('aria-hidden', 'true') 7099 .removeAttr('tabindex'); 7100 7101 setDetailsOpen(jQuery(this), false); 7102 7103 $accordion.trigger('accordionchange', { 7104 'newHeader': headerSelected 7105 }); 7106 } 7107 }); 7108 } 7109 } 7110 } 7111 else{ 7112 $currentHeader.attr('aria-expanded') 7113 ? $currentHeader.attr('aria-expanded', 'true') 7114 : $currentHeader.find('.accordionHeaderCaption').attr('aria-expanded', 'true'); 7115 7116 $currentHeader 7117 .addClass('accordionHeaderVisible') 7118 .removeClass('accordionHeaderHidden'); 7119 7120 if(options['collapsible']){ 7121 $currentHeader 7122 .addClass('accordionHeaderCollapsible') 7123 .removeClass('accordionHeaderNoneCollapsible'); 7124 } 7125 else{ 7126 $currentHeader 7127 .addClass('accordionHeaderNoneCollapsible') 7128 .removeClass('accordionHeaderCollapsible'); 7129 } 7130 7131 $currentContent.removeClass('accordionContentHidden'); 7132 7133 setDetailsOpen($currentContent, true); 7134 7135 if(options['slideMode'] === 'transition'){ 7136 $currentContent.show(); 7137 7138 wUiTmp['lastAccordionOpen'] = accordionID + '_' + index; 7139 7140 $currentContent 7141 .addClass('accordionContentVisible') 7142 .attr('aria-hidden', 'false') 7143 .attr('tabindex', '0') 7144 .focus()
7145 .css({'outline': 'none'}); 7146 7147 $currentContent.find('.accordionCloserContent').focus(); 7148 7149 $accordion.trigger('accordionchange', { 7150 'newHeader': headerSelected 7151 }); 7152 7153 $accordion.trigger('accordionactivate', { 7154 'newHeader': headerSelected 7155 }); 7156 } 7157 else{ 7158 $currentContent.slideDown({ 7159 duration: slideDownOptions['duration'], 7160 easing: slideDownOptions['easing'], 7161 complete: function(){ 7162 jQuery(this) 7163 .addClass('accordionContentVisible') 7164 .attr('aria-hidden', 'false') 7165 .attr('tabindex', '0') 7166 .focus() 7167 .css({'outline': 'none'}); 7168 7169 $accordion.trigger('accordionchange', { 7170 'newHeader': headerSelected 7171 }); 7172 7173 $accordion.trigger('accordionactivate', { 7174 'newHeader': headerSelected 7175 }); 7176 } 7177 }); 7178 } 7179 } 7180 } 7181 else{ 7182 7183 if(options['multiple'] == true || $accordion.attr('data-multiple') == '1'){ 7184 // Mehrfach geöffnet erlaubt: keine anderen Elemente schlieÃen. 7185 } 7186 else{ 7187 $currentHeader 7188 .addClass('accordionHeaderHidden') 7189 .removeClass('accordionHeaderVisible') 7190 .attr('aria-expanded', 'false'); 7191 7192 $currentContent.removeClass('accordionContentVisible'); 7193 7194 if(options['slideMode'] === 'transition'){ 7195 $currentContent.hide(); 7196 setDetailsOpen($currentContent, false); 7197 } 7198 else{ 7199 $currentContent.slideUp({ 7200 duration: slideUpOptions['duration'], 7201 easing: slideUpOptions['easing'], 7202 complete: function(){ 7203 jQuery(this) 7204 .addClass('accordionContentHidden') 7205 .attr('aria-hidden', 'true') 7206 .removeAttr('tabindex'); 7207 7208 setDetailsOpen(jQuery(this), false); 7209 } 7210 }); 7211 } 7212 } 7213 7214 if($currentContent.hasClass('accordionContentVisible')){ 7215 hasEntryVisible = true; 7216 } 7217 else{ 7218 hasEntryInvisible = true; 7219 } 7220 } 7221 }); 7222 7223 if(hasEntryInvisible){ 7224 jQuery('#accordionOpener' + accordionID).show(); 7225 jQuery('#accordionCloser' + accordionID).hide(); 7226 } 7227 else{ 7228 jQuery('#accordionOpener' + accordionID).hide(); 7229 jQuery('#accordionCloser' + accordionID).show(); 7230 } 7231 7232 if( 7233 options['multiple'] && 7234 accordionContents.filter('.accordionContentVisible').length > 0 7235 ){ 7236 jQuery('#accordionOpener' + accordionID).hide(); 7237 jQuery('#accordionCloser' + accordionID).show(); 7238 } 7239 7240 if(typeof(wOnAfterClickAccordeon) === 'function'){ 7241 wOnAfterClickAccordeon(headerSelected); 7242 } 7243 7244 try{ 7245 var resizeEvent = window.document.createEvent('UIEvents'); 7246 resizeEvent.initUIEvent('resize', true, false, window, 0); 7247 window.dispatchEvent(resizeEvent); 7248 } 7249 catch(e){} 7250 7251 jQuery('.wglBannerSlider').wBannerSlider(); 7252 jQuery('.wglSmartSlider').wSmartSlider(); 7253 jQuery('.wglPictureGallery').wPictureGallery(); 7254 7255 if(options['group'] && options['group'] != ''){ 7256 jQuery('.wglAccordion[data-group="' + options['group'] + '"]').each(function(){ 7257 var accordionInGroupID = (jQuery(this).get(0).id || '').replace(/accordion_/, ''); 7258 7259 if(accordionInGroupID != accordionID){ 7260 wCloseAllAccordions(accordionInGroupID); 7261 } 7262 }); 7263 } 7264 }); 7265 }); 7266 7267 $accordion.on('accordionactivate', function(event, ui){ 7268 7269 var headerE = jQuery(ui.newHeader[0]); 7270 7271 if(headerE.data('noaccactivate') === true){ 7272 $accordion.data('noaccactivate', false); 7273 return false;
7274 } 7275 7276 if(ui.newHeader[0] && $accordion.data('fitinscreen') != 'no'){ 7277 try{ 7278 var currentHeader = ui.newHeader; 7279 var offsetTopCurrentHeader = currentHeader.offset()['top']; 7280 var windowScrollTop = wUiTmp['lastScrollTop']; 7281 var scrollTopMax = offsetTopCurrentHeader - wGetScrollTopDiff(); 7282 7283 if($accordion.data('scrolltoponactivate') == 'always'){ 7284 var scrollTopDiff = wGetScrollTopDiff(); 7285 7286 jQuery('body, html').animate({ 7287 scrollTop: offsetTopCurrentHeader - scrollTopDiff 7288 }); 7289 } 7290 else if(offsetTopCurrentHeader < windowScrollTop){ 7291 var scrollTopDiff = wGetScrollTopDiff(); 7292 7293 jQuery('body, html').animate({ 7294 scrollTop: offsetTopCurrentHeader - scrollTopDiff 7295 }); 7296 } 7297 else{ 7298 var offsetBottomCurrentContent = 7299 jQuery(currentHeader).next('.accordionContent').offset()['top'] + 7300 jQuery(currentHeader).next('.accordionContent').outerHeight(); 7301 7302 var windowBottom = windowScrollTop + wUiTmp['lastWindowHeight']; 7303 7304 if(offsetBottomCurrentContent > windowBottom){ 7305 var scrollTopToFullvisibility = 7306 offsetBottomCurrentContent - windowBottom; 7307 7308 var scrollTopAdapt = 7309 windowScrollTop + scrollTopToFullvisibility; 7310 7311 scrollTopAdapt = 7312 scrollTopAdapt > scrollTopMax 7313 ? scrollTopMax 7314 : scrollTopAdapt; 7315 7316 jQuery('body, html').animate({ 7317 scrollTop: scrollTopAdapt 7318 }); 7319 } 7320 } 7321 } 7322 catch(e){} 7323 } 7324 }); 7325 7326 $accordion.on('accordionchange', function(event, ui){ 7327 7328 var eventTarget = event.target || event.srcElement; 7329 var id = (eventTarget.id || '').replace(/accordion_/, ''); 7330 var headerE = jQuery(ui.newHeader[0]); 7331 7332 if(headerE.data('noaccchange') === true){ 7333 $accordion.data('noaccchange', false); 7334 return false; 7335 } 7336 7337 if(ui.newHeader[0] && $accordion.data('pushstateonselect') == '1'){ 7338 if(ui.newHeader[0].className.indexOf('accordionHeaderHidden') == -1){ 7339 history.pushState( 7340 {page: '#' + ui.newHeader[0].id}, 7341 '', 7342 '#' + ui.newHeader[0].id 7343 ); 7344 7345 wUiTmp['lastPushStateAccordion'] = '#' + ui.newHeader[0].id; 7346 } 7347 else if('#' + ui.newHeader[0].id == wUiTmp['lastPushStateAccordion']){ 7348 var newState = location.href.replace(/#.*/, ''); 7349 7350 history.pushState( 7351 {page: newState}, 7352 '', 7353 newState 7354 ); 7355 } 7356 } 7357 7358 if(options['rememberSelected'] == '1'){ 7359 if(ui.newHeader[0]){ 7360 if(ui.newHeader[0].className.indexOf('accordionHeaderHidden') != -1){ 7361 document.cookie = 7362 'accordionTab_' + id + '=;path=/;sameSite=Lax'; 7363 } 7364 else{ 7365 document.cookie = 7366 'accordionTab_' + 7367 id + 7368 '=' + 7369 ( 7370 ui.newHeader[0].getAttribute('data-index') 7371 ? ui.newHeader[0].getAttribute('data-index') 7372 : ui.newHeader[0].id.replace(/.*_/, '') 7373 ) + 7374 ';path=/;sameSite=Lax'; 7375 } 7376 } 7377 } 7378 7379 jQuery(window).trigger('resize'); 7380 jQuery('.wglBannerSlider').wBannerSlider(); 7381 jQuery('.wglSmartSlider').wSmartSlider(); 7382 jQuery('.wglPictureGallery').wPictureGallery(); 7383 jQuery('.wglAccordion .wglTicker').wTicker(); 7384 }); 7385 }); 7386}; 7387 7388wOpenAllAccordions = function(id){ 7389 7390 var aE = jQuery('#accordion_' + id); 7391 var setMultiple = aE.attr('data-multiple') != '1' ? true : false; 7392 if(setMultiple) aE.attr('data-multiple', 1); 7393 jQuery('#accordion_' + id + ' .accordionHeaderHidden').trigger('click'); 7394 if(setMultiple) aE.removeAttr('data-multiple'); 7395 jQuery('#accordionOpener' + id).hide(); 7396 jQuery('#accordionCloser' + id).show(); 7397 jQuery(window).trigger('resize'); 7398 jQuery('.wglBannerSlider').wBannerSlider(); 7399 jQuery('.wglSmartSlider').wSmartSlider(); 7400 jQuery('.wglPictureGallery').wPictureGallery(); 7401 7402 if(location.hash == wUiTmp['lastPushStateAccordion']){ 7403 var newState = location.href.replace(/#.*/, ''); 7404 history.pushState({page: newState}, '', newState); 7405 } 7406 7407}; 7408 7409 7410wCloseAllAccordions = function(id){ 7411 7412 var aE = jQuery('#accordion_' + id); 7413 var setMultiple = aE.attr('data-multiple') != '1' ? true : false;
7414 if(setMultiple) aE.attr('data-multiple', 1); 7415 jQuery('#accordion_' + id + ' .accordionHeaderVisible').trigger('click'); 7416 if(setMultiple) aE.removeAttr('data-multiple'); 7417 7418 if(location.hash == wUiTmp['lastPushStateAccordion']){ 7419 var newState = location.href.replace(/#.*/, ''); 7420 history.pushState({page: newState}, '', newState); 7421 } 7422}; 7423 7424jQuery(window).on('hashchange', function(){ 7425 7426 window.setTimeout(function(){ 7427 wAdaptOnChangeHash({}); 7428 }, 10); 7429}); 7430 7431wAdaptOnChangeHash = function(options){ 7432 7433 var jQueryHashId = decodeURIComponent(location.hash.replace(/\./g, '\\.').replace(/\//g, '\\/').replace('open_', 'anchor_').replace(/\&/g, '').replace(/=/g, '')).replace(/\[/g, '').replace(/\]/g, '').replace(/\?/g, ''); 7434 7435 if(typeof wOnBeforeAdaptOnChangeHash === 'function') jQueryHashId = wOnBeforeAdaptOnChangeHash(jQueryHashId); 7436 7437 if(typeof wAddSelectedOnNavpointIfHashChanged != 'undefined' && wAddSelectedOnNavpointIfHashChanged){ 7438 jQuery("#blockPage a[href='" + location.hash + "'], #blockPage a[href='" + location.pathname + location.hash + "']").each(function(i, v){ 7439 jQuery(v).parent().parent().find('.selected').removeClass('selected'); 7440 jQuery(v).parent().addClass('selected'); 7441 }); 7442 } 7443 7444 var accordionOfHash = null; 7445 7446 if(/^#anchor_lightbox_([^_]+)_(\d+)/.test(jQueryHashId)){ 7447 if(jQuery('.wglLightbox[data-rel="' + RegExp.$1 + '"]').eq(parseInt(RegExp.$2) > 0 ? parseInt(RegExp.$2) - 1 : 0).length !== 0){ 7448 wLightbox(jQuery('.wglLightbox[data-rel="' + RegExp.$1 + '"]').eq(parseInt(RegExp.$2) > 0 ? parseInt(RegExp.$2) - 1 : 0), {}); 7449 } 7450 } 7451 7452 if(/^#\w/.test(jQueryHashId) && jQueryHashId != '#'){ 7453 if(jQuery(jQueryHashId).length > 0){ 7454 accordionOfHash = jQuery(jQueryHashId); 7455 } 7456 else if(jQuery(jQueryHashId.replace(/_Accordion-.*/, '')).length > 0){ 7457 accordionOfHash = jQuery(jQueryHashId.replace(/_Accordion-.*/, '')); 7458 } 7459 } 7460 7461 if(accordionOfHash && accordionOfHash.length > 0){ 7462 try{ 7463 if(/#anchor/.test(jQueryHashId) && accordionOfHash.parent().attr('id').indexOf('tab_') == 0){ 7464 document.location.hash = accordionOfHash.parent().attr('id'); 7465 jQueryHashId = '#' + accordionOfHash.parent().attr('id'); 7466 } 7467 }catch(e){} 7468 7469 if(/#tab_/.test(jQueryHashId)){ 7470 if(/tab_/.test(accordionOfHash.attr('id'))){ 7471 accordionOfHash.trigger('click', [true]); 7472 } 7473 else{ 7474 var containerIndex = accordionOfHash.parents('.containerInvisible').index(); 7475 if(containerIndex >= 0){ 7476 accordionOfHash.parents('.containerInvisible').parent().parent().find('> .tabs > .tab:nth-child(' + (containerIndex + 1) + ')').trigger('click', [true]); 7477 } 7478 } 7479 } 7480 else if(accordionOfHash.hasClass('accordionHeader')){ 7481 accordionOfHash.trigger('click', [true]); 7482 7483 var containerIndex = accordionOfHash.parents('.containerInvisible').index(); 7484 if(containerIndex >= 0){ 7485 accordionOfHash.parents('.containerInvisible').parent().parent().find('> .tabs > .tab:nth-child(' + (containerIndex + 1) + ')').trigger('click', [true]); 7486 } 7487 } 7488 else{ 7489 var containerIndex = accordionOfHash.parents('.containerInvisible').index(); 7490 if(containerIndex >= 0){ 7491 accordionOfHash.parents('.containerInvisible').parent().parent().find('> .tabs > .tab:nth-child(' + (containerIndex + 1) + ')').trigger('click', [true]); 7492 } 7493 accordionOfHash.parents('.accordionContent').prev('.accordionHeader').trigger('click', [true]); 7494 } 7495 } 7496 7497 window.setTimeout(function(){ 7498 if(/^#\w/.test(jQueryHashId) && jQueryHashId != '' && jQueryHashId != '#' && (/#(wFormErrorMessages|anchor_|tab_|_Accordion-)/.test(jQueryHashId) || jQuery(jQueryHashId).hasClass('elementSection'))){ 7499 var anchor = jQuery(jQueryHashId.replace(/\./, '\\.')); 7500 if(anchor.length == 0) anchor = jQuery('*[data-id=' +jQueryHashId.replace(/#/, '') +']'); 7501 if(anchor.length > 0){ 7502 wScrollSmoothToElement(anchor, !/#(wFormErrorMessages|_Accordion-)/.test(jQueryHashId) ? {'setFocusAfterScrolling' : true} : null); 7503 if(jQueryHashId === '#wFormErrorMessages'){ 7504 jQuery('#wFormErrorMessages').prepend('<div id="focusAncor" tabindex="0" style="width:1px"></div>'); 7505 jQuery('#focusAncor').focus(); 7506 } 7507 } 7508 } 7509 }, 120); 7510 if(typeof wOnAfterAdaptOnChangeHash === 'function') jQueryHashId = wOnAfterAdaptOnChangeHash(jQueryHashId); 7511}; 7512 7513wsmn = function(ml){ 7514 7515 var mln = ''; 7516 for(var i = 0; i < ml.length/3; i++){ 7517 mln = ml.substr(i * 3 + 1, 1) + mln; 7518 } 7519 7520 var pms = ''; 7521 if(/(\?.*)/.test(mln)){ 7522 pms = RegExp.$1; 7523 pms = pms.replace(/wApos/g, "'"); 7524 mln = mln.replace(/(\?.*)/, ''); 7525 } 7526 7527 mln = mln.replace(/a/g, '@').replace(/e/g, '.').replace(/\*/g, 'a').replace(/;/g, 'e').replace(/:/g, 'o').replace(/,/g, 'u').replace(/\!/g, 'i') + pms; 7528 7529 var rtc = true; 7530
7531 if(typeof(wOnBeforeClickSendMailNospam) == 'function'){ 7532 rtc = wOnBeforeClickSendMailNospam(mln, event); 7533 } 7534 7535 if(rtc){ 7536 top.location.href = 'mailto:' + mln; 7537 } 7538}; 7539 7540jQuery.fn.wMagnifier = function(options){ 7541 7542 if(typeof(wEditor) != 'undefined'){ 7543 return false; 7544 } 7545 7546 var wMagnifierElement = null; 7547 var wMagnifierImageElement = null; 7548 7549 jQuery.each(jQuery(this), function(){ 7550 7551 jQuery(this).on('mouseover', function(event){ 7552 7553 var srcMagnifier = jQuery(this).attr('data-src2x') ? jQuery(this).attr('data-src2x') : jQuery(this).get(0).currentSrc; 7554 var isPicture = false; 7555 7556 if(jQuery(this).prop('tagName') == 'PICTURE'){ 7557 isPicture = true; 7558 srcMagnifier = jQuery(this).find('source').attr('srcset').replace(/^[\w\W]*,\s*/, '').replace(/ [\w\W]*/, ''); 7559 if(/\.webp$/.test(srcMagnifier) && /Safari/i.test(navigator.userAgent)){ 7560 srcMagnifier = jQuery(this).find('source').next().attr('srcset').replace(/^[\w\W]*,\s*/, '').replace(/ [\w\W]*/, ''); 7561 } 7562 } 7563 else if(jQuery(this).parent().prop('tagName') == 'PICTURE'){ 7564 srcMagnifier = srcMagnifier.replace(/(\d+)(w(?:2x)?\.(?:jpe?g|web|avif|png|gif)+)/, function(matches, width, post){return String(width * 2) + post}); 7565 } 7566 7567 jQuery('.wMagnifier').remove(); 7568 jQuery('.wMagnifierMovingArea').remove(); 7569 7570 var objectCurrent = jQuery(this); 7571 objectCurrent.parent().css({'position' : 'relative', 'display' : jQuery(this).css('display') == 'inline-block' ? 'inline-block' : 'block'}); 7572 objectCurrent.parent().append('<div id="wMagnifierMovingArea" class="wMagnifierMovingArea" style="z-index:1000;cursor:none;position:absolute;top:0;left:0;width:100%;height:100%;"></div>'); 7573 objectCurrent.parent().append('<div id="wMagnifier" class="wMagnifier"></div>'); 7574 wMagnifierElement = jQuery('#wMagnifier'); 7575 wMagnifierMovingAreaElement = jQuery('#wMagnifierMovingArea'); 7576 wMagnifierImageElement = objectCurrent; 7577 7578 var offset = objectCurrent.offset(); 7579 objectCurrent.data('offsetLeft', parseInt(offset.left)); 7580 objectCurrent.data('offsetTop', parseInt(offset.top)); 7581 objectCurrent.data('zoomerWidth', wMagnifierElement.width()); 7582 objectCurrent.data('zoomerHeight', wMagnifierElement.height()); 7583 objectCurrent.data('imageWidth', isPicture ? objectCurrent.find('img').width() : objectCurrent.width()); 7584 objectCurrent.data('borderLeftWidth', parseInt(wMagnifierElement.css('border-left-width'))); 7585 objectCurrent.data('borderTopWidth', parseInt(wMagnifierElement.css('border-top-width'))); 7586 7587 //var scale = (isPicture ? objectCurrent.find('img').width() : objectCurrent.width()) / (typeof(objectCurrent.attr('width')) != 'undefined' ? objectCurrent.attr('width') : objectCurrent.attr('data-widthorig')); 7588 var ratio = 2 7589 7590 var posX = parseInt(typeof(event.pageX !== 'undefined') ? event.pageX : (event.clientX + document.documentElement.scrollLeft)) - wMagnifierImageElement.data('offsetLeft'); 7591 var posY = parseInt(typeof(event.pageY !== 'undefined') ? event.pageY : (event.clientY + document.documentElement.scrollTop)) - wMagnifierImageElement.data('offsetTop'); 7592 wMagnifierElement.css({'left' : posX - wMagnifierImageElement.data('borderLeftWidth') - wMagnifierImageElement.data('zoomerWidth') / 2, 'top' : posY - wMagnifierImageElement.data('borderTopWidth') - wMagnifierImageElement.data('zoomerHeight') / 2, 'background-position' : String(-posX * ratio + wMagnifierImageElement.data('zoomerWidth') / 2) + 'px ' + String(-posY * ratio + wMagnifierImageElement.data('zoomerHeight') / 2) + 'px'}); 7593 wMagnifierElement.css({'background-image' : 'url(' + srcMagnifier + ')', 'background-repeat' : 'no-repeat'}); 7594 wMagnifierElement.css({'background-size' : String((isPicture ? objectCurrent.find('img').width() : objectCurrent.width()) * 2) + 'px'}); 7595 7596 wMagnifierMovingAreaElement.on('mousemove', function(event){ 7597 var posX = parseInt(typeof(event.pageX !== 'undefined') ? event.pageX : (event.clientX + document.documentElement.scrollLeft)) - wMagnifierImageElement.data('offsetLeft'); 7598 var posY = parseInt(typeof(event.pageY !== 'undefined') ? event.pageY : (event.clientY + document.documentElement.scrollTop)) - wMagnifierImageElement.data('offsetTop'); 7599 wMagnifierElement.css({'left' : posX - wMagnifierImageElement.data('borderLeftWidth') - wMagnifierImageElement.data('zoomerWidth') / 2, 'top' : posY - wMagnifierImageElement.data('borderTopWidth') - wMagnifierImageElement.data('zoomerHeight') / 2, 'background-position' : String(-posX * ratio + wMagnifierImageElement.data('zoomerWidth') / 2) + 'px ' + String(-posY * ratio + wMagnifierImageElement.data('zoomerHeight') / 2) + 'px'}); 7600 }); 7601 wMagnifierMovingAreaElement.on('mouseout click', function(event){ 7602 jQuery('.wMagnifier').remove(); 7603 jQuery('.wMagnifierMovingArea').remove(); 7604 }); 7605 }); 7606 }); 7607}; 7608 7609jQuery.fn.wMaximizer = function(options){ 7610 jQuery.each(jQuery(this), function(){ 7611 jQuery(this).click(function(){ 7612 var objectCurrent = jQuery(this); 7613 return wMaximizer(objectCurrent, options); 7614 }); 7615 }); 7616}; 7617 7618wMaximizer = function(objectCurrent, options){ 7619 7620 var objectToMaximize = objectCurrent.parent(); 7621 var widthMaximized = objectToMaximize.parent().width(); 7622 7623 if(objectToMaximize.hasClass('wglMaximized')){ 7624 objectToMaximize.animate({'max-width' : String(objectToMaximize.data('widthDefault')) + 'px'}, 600, function(){ 7625 objectToMaximize.removeClass('wglMaximized'); 7626 }); 7627 } 7628 else{ 7629 objectToMaximize.data('widthDefault', objectToMaximize.width()); 7630 objectToMaximize.animate({'max-width' : String(widthMaximized) + 'px'}, 600, function(){ 7631 objectToMaximize.addClass('wglMaximized'); 7632 }); 7633 } 7634}; 7635 7636wToggleFavoriteURL = function(button, options){ 7637 7638 options = options || {}; 7639 var url = "/weblication/grid5/scripts/wPrivate.php?url="+button.getAttribute("data-url")+"&action="; 7640 if(button.getAttribute("data-hasfavoriteurl") == "1"){ 7641 url += "removeFavoriteURL"; 7642 } 7643 else{ 7644 url += "addFavoriteURL"; 7645 } 7646 jQuery.ajax({type: "GET", async: true, dataType: "json", url: url, 7647 success: function(result){ 7648 if(result == "1"){ 7649 button.setAttribute("data-hasfavoriteurl", button.getAttribute("data-hasfavoriteurl") == "1" ? "0" : "1"); 7650 if(options["onAfterToggle"]){ 7651 eval(options["onAfterToggle"]); 7652 } 7653 } 7654 } 7655 }); 7656}; 7657 7658jQuery.fn.wAutoheight = function(){ 7659 7660 jQuery.each(jQuery(this), function(index){ 7661 var ta = jQuery(this); 7662 7663 var height = ta.height(); 7664 var scrollHeight = ta.prop('scrollHeight');
7665 var diffHeight = Math.ceil(parseFloat(ta.css('paddingTop')) + parseFloat(ta.css('paddingBottom'))); 7666 7667 //console.log(height + ' ' + Math.ceil(ta.height()) + ' ' + diffHeight); 7668 if(ta.prop('scrollHeight') > Math.ceil(ta.height()) + diffHeight){ 7669 ta.height(ta.prop('scrollHeight')); 7670 } 7671 7672 ta.on('keyup change', function(){ 7673 var ta = jQuery(this); 7674 var height = ta.height(); 7675 var scrollHeight = ta.prop('scrollHeight'); 7676 var diffHeight = Math.ceil(parseFloat(ta.css('paddingTop')) + parseFloat(ta.css('paddingBottom'))); 7677 7678 //console.log(height + ' ' + Math.ceil(ta.height()) + ' ' + diffHeight); 7679 if(ta.prop('scrollHeight') > Math.ceil(ta.height()) + diffHeight){ 7680 ta.height(ta.prop('scrollHeight')); 7681 } 7682 }); 7683 }); 7684}; 7685 7686jQuery.fn.wInputRange = function(){ 7687 7688 jQuery.each(jQuery(this), function(index){ 7689 var i = jQuery(this); 7690 7691 i.on('input', function(){ 7692 if(jQuery('#' + jQuery(this).attr('id') + '_rangeValue').length != 0){ 7693 jQuery('#' + jQuery(this).attr('id') + '_rangeValue').find('.wglRangeValueValue').html(jQuery(this).val()); 7694 } 7695 }); 7696 }); 7697}; 7698 7699jQuery.fn.wSmartSlider = function(options){ 7700 jQuery.each(jQuery(this), function(){ 7701 wSmartSlider(jQuery(this), options); 7702 }); 7703}; 7704 7705class wClassSmartSlider{ 7706 7707 constructor(object, options){ 7708 this.sl = object; 7709 this.options = { 7710 slideronlymobile : '0', 7711 breakpoint : '765px', 7712 }; 7713 if(options != null){ 7714 this.options = options; 7715 for (var key in options) { 7716 if (this.options.hasOwnProperty(key)) { 7717 this.sl.attr('data-' + key, options[key]); 7718 } 7719 } 7720 } 7721 this.slt = {'sy' : null, 'sxc': null, 'syc' : null, 'dx' : null, 'dy' : null, 'dxp': null, 'dyp' : null}; 7722 this.curBKP = this.slw = this.slI = this.slIlinit = this.slI1 = this.slIw = this.slIr = this.slE = this.noP = this.noE = this.noCol = this.noColSlWidth = this.lastPOffset = this.curP = this.curE = null; 7723 this.pNavi = this.scrollBar = null; 7724 this.onafterslidermove = null; 7725 this.options.flip = this.options.animationRaster != null ? this.options.animationRaster : 'bannerWidth'; 7726 this.flip = this.options.flip; 7727 this.init(); 7728 this.onload = false; 7729 } 7730 7731 init(){ 7732 const self = this; 7733 7734 if(this.options.slideronlymobile === '1'){ 7735 if(!window.matchMedia("(max-width: " + this.options.breakpoint + ")").matches){ 7736 self.deactivate(); 7737 jQuery(window).on('resize', this.resize.bind(this)); 7738 self.sl.data('resize', 'binded'); 7739 return false; 7740 } 7741 } 7742 self.activate(); 7743 var tmpCol = self.noCol; 7744 this.setVar(true); 7745 self.sl.attr({ 'data-init' : '1'}); 7746 if(this.sl.attr('data-smartpagenavi') == 'scrollbar'){self.setScrollbar();self.setPageNav();} 7747 else if(this.sl.attr('data-smartpagenavi') == 'scrollbarOnly') self.setScrollbar(); 7748 else self.setPageNav(); 7749 self.sl.find('.sliderMoverBack').on('click', this.smartSliderMove.bind(this, '-', {'flip' : self.options.flip})); 7750 self.sl.find('.sliderMoverForward').on('click', this.smartSliderMove.bind(this, '+', {'flip' : self.options.flip})); 7751 //self.slI.on('touchstart', this.touch.bind(this)).on('touchmove', this.touch.bind(this)).on('touched', this.touch.bind(this)); 7752 //self.slI.on('mousedown', this.touch.bind(this)).on('mousemove', this.touch.bind(this)).on('mouseup', this.touch.bind(this)); 7753 //const events = 'touchstart touchmove touchend mousedown mousemove mouseup'; 7754 self.slI.get(0).addEventListener('touchstart', this.touch.bind(this), { passive: true }); 7755 self.slI.get(0).addEventListener('touchmove', this.touch.bind(this), { passive: true }); 7756 self.slI.on('mousedown', this.touch.bind(this)).on('touched', this.touch.bind(this)).on('mousemove', this.touch.bind(this)).on('mouseup', this.touch.bind(this)); 7757 if(self.sl.data('resize') != 'binded'){; 7758 jQuery(window).on('resize', this.resize.bind(this)); 7759 self.sl.data('resize', 'binded'); 7760 } 7761 7762 self.sl.find('img').on('dragstart', function(e){ 7763 e.preventDefault(); 7764 }); 7765 } 7766 7767 deactivate(){ 7768 const self = this; 7769 if(self.sl.attr('data-deactivated') == '0') { 7770 self.sl.attr('data-deactivated', '1'); 7771 var lE = self.sl.children('ul'); 7772 if(lE.length > 0){ 7773 lE.get(0).style.removeProperty('--cols'); 7774 lE.css({'margin-left' : 0}); 7775 } 7776 } 7777 } 7778 7779 activate(){ 7780 const self = this; 7781 if(self.sl.attr('data-deactivated') == null || self.sl.attr('data-deactivated') == '1') { 7782 self.sl.attr('data-deactivated', '0'); 7783 var lE = self.sl.children('ul'); 7784 if(lE.length > 0){ 7785 lE.get(0).style.setProperty('--cols', self.sl.attr('data-numberentries')); 7786 } 7787 } 7788 } 7789 7790 setPageNav(){ 7791 const self = this; 7792 var pNav = ''; 7793 7794 if(self.noP > 0){ 7795 pNav = '<div class="pageNavi">'; 7796 for(var i = 0; i < self.noP; i++) pNav += '<div class="page' + (i===0 ? ' selected' : '') + '"></div>'; 7797 pNav += '</div>'; 7798 } 7799 if(self.sl.find('.sliderMover').length === 0){ 7800 self.sl.append('<div class="sliderMover"><div data-accessevent="smartSlider.pageNavi(back)" class="sliderMoverBack"><span/><span/></div>' + pNav + '<div data-accessevent="smartSlider.pageNavi(forward)" class="sliderMoverForward"><span/><span/></div></div>'); 7801 } 7802 else if(self.pNavi != null && self.pNavi.html() !== pNav){ 7803 self.pNavi.replaceWith(pNav); 7804 } 7805 self.pNavi = self.sl.find('.pageNavi'); 7806 self.sl.find('.page').on('click', function() {var index = self.sl.find('.page').index(this);self.smartSliderMove(index+1, {'flip' : 'bannerWidth'});}); 7807 } 7808 7809 setScrollbar(){ 7810 const self = this; 7811 if(self.scrollBar == null){ 7812 self.sl.append('<div class="slider-container"><input type="range" id="slider" min="0" max="'+(self.slIw-self.lastPOffset)+'" value="
78120"></div>'); 7813 self.scrollBar = self.sl.find('.slider-container input'); 7814 self.scrollBar.on('input', function(){ 7815 self.slI.css({'marginLeft': '-' + jQuery(this).val() + 'px'}); 7816 //var p = Math.ceil(jQuery(this).val()/(100/self.noP)); 7817 //self.options['moveto'] = p = (p === 0 ? 1 : p); 7818 }); 7819 self.sl.on('keyup mouseup touchend', function(e){ 7820 if(e.target === self.scrollBar.get(0) && jQuery(e.target).attr('type') === 'range'){ 7821 var p = Math.ceil(self.scrollBar.val()/self.slw); 7822 var range = Math.ceil((self.scrollBar.val()%self.slw)*100/self.slw); 7823 if(range > 50) p++; 7824 if(self.scrollBar.val() == parseInt(self.scrollBar.attr('max'))) p = self.noP; 7825 if(self.sl.attr('data-moving') != '1') self.smartSliderMove((p), {'moveslider' : false, 'flip' : 'colWidth'}); 7826 else { 7827 self.onafterslidermove = function(pos) { 7828 self.smartSliderMove(pos, {'moveslider' : false, 'flip' : 'colWidth'}); 7829 }; 7830 } 7831 } 7832 }); 7833 } 7834 else { 7835 self.scrollBar.attr('max', self.slIw-self.lastPOffset); 7836 var val = (self.curP == 1) ? 0 : Math.ceil(self.curP*100/self.noP)/100*parseInt(self.scrollBar.attr('max')); 7837 self.scrollBar.val(val); 7838 } 7839 } 7840 7841 setVar(init){ 7842 const self = this; 7843 self.slE = self.sl.find('> div:first-child() > div, > ul:first-child() > li'); 7844 self.slw = self.sl.width(); 7845 if(self.flip == 'colWidth'){ 7846 self.slw = self.slE.first().outerWidth(); 7847 } 7848 7849 self.slI = self.sl.find('> div:first-child(), > ul:first-child()'); 7850 self.slIl = parseInt(self.slI.css('margin-left')); 7851 7852 if(self.slIlinit == null) self.slIlinit = self.slIl; 7853 self.slIw = self.slI.outerWidth(); 7854 self.slIr = parseInt(self.slIw) + self.slIl; 7855 self.noE = self.sl.find('> div:not(.sliderMover) > div, > ul > li').length; 7856 if(init){ 7857 self.curP = 1; 7858 self.curE = 1; 7859 self.sl.attr({'data-currententry' : self.curE , 'data-currentpage' : self.curP , 'data-isfirstentry' : '1', 7860 'data-islastentry': self.noE == 1 ? '1' : '0', 'data-numberentries': self.noE, 'data-marginleftinit' : self.slIlinit, 7861 'data-isvisiblefirstentry' : '1', 'data-isvisiblelastentry' : (self.slIl - self.slw + self.slIw < 8 ? '1' : '0'), 7862 'data-numberPages' : self.noP}); 7863 } 7864 7865 /*Anzahl der Spalten die geblättert werden, abhängig vom slw */ 7866 self.noCol = Math.ceil((self.slw/self.sl.find('.col, .listEntry').eq(self.curE-1).outerWidth()).toFixed(2)); 7867 7868 /*offset, um das letzte Seite nach vorne scrollt */ 7869 self.XOffset = self.noCol == 1 || self.flip=='colWidth' ? Math.ceil((self.sl.width()/self.sl.find('.col, .listEntry').eq(self.curE-1).outerWidth()).toFixed(2)) : 1; 7870 self.lastPOffset = self.XOffset*self.slw; 7871 var tmpP = self.noP; 7872 self.noP = Math.ceil(self.noE/self.noCol); /*Anzahl der Seiten*/ 7873 if(tmpP != self.noP && self.flip=='bannerWidth'){ 7874 var vh = 100*(self.curE%self.noCol)/self.noCol; 7875 self.curP = Math.ceil(self.curE/self.noCol); 7876 if(self.curP == self.noP) self.curE = self.noE; 7877 else self.curE = (self.curP-1)*self.noCol+1; 7878 } 7879 } 7880 7881 smartSliderMove(pos, options = {}){ 7882 const self = this; 7883 7884 if(options.flip != null) self.flip = options.flip; 7885 7886 var mL = '-'; 7887 if(self.sl.attr('data-moving') != '1'){ 7888 self.sl.attr('data-moving', '1'); 7889 this.setVar(); 7890 var ad = typeof(self.sl.data('animation-duration')) !== 'undefined' && !isNaN(self.sl.data('animation-duration')) ? parseInt(self.sl.data('animation-duration')) : 600; 7891 var ae = typeof(self.sl.data('animation-easing')) !== 'undefined' && /^\w+$/.test(self.sl.data('animation-easing')) ? self.sl.data('animation-easing') : 'linear'; 7892 var mwm = self.slw; 7893 var mw = 0; 7894 if(pos == '+' && self.slIr > self.slw){ 7895 mL = '-='; 7896 mw = (self.slIr - self.slw) < mwm ? (self.slIr - self.slw) : mwm; 7897 self.curP++; 7898 self.curE += self.noCol; 7899 } 7900 else if(pos == '-' && self.slIl < 0){ 7901 mL = '+='; 7902 mw = self.slIl < -mwm ? -mwm : self.slIl; 7903 self.curP--; 7904 self.curE -= self.noCol; 7905 if(mw < 0 ) mw = mw*(-1); 7906 } 7907 else if(pos !== '+' && pos !== '-'){ 7908 mw = (pos-1)*mwm; 7909 self.curP = pos; 7910 self.curE = self.curP*self.noCol; 7911 } 7912 if(self.curP == self.noP){ 7913 mw = self.slIw - self.lastPOffset; 7914 mL = '-'; 7915 } 7916 7917 if(self.curP == 1){ 7918 mw = 0; 7919 mL = '-'; 7920 } 7921 self.sl.attr('data-isvisiblelastentry', (self.noCol != 1 && self.curP == self.noP) ? '1' : '0'); 7922 self.sl.attr('data-isvisiblefirstentry', (self.curP == 1 || self.slIl - mw) > -8 ? '1' : '0'); 7923 if(self.sl.attr('data-onvisiblelastentry')){ 7924 if(self.sl.attr('data-onvisiblelastentry') == 'showNextElementLink'){ 7925 if(self.sl.attr('data-isvisiblelastentry') === '1') self.sl.next('.elementLink').removeClass('hideVisibleLast').addClass('showVisibleLast'); 7926 else self.sl.next('.elementLink').removeClass('showVisibleLast').addClass('hideVisibleLast'); 7927 } 7928 } 7929 7930 self.slI.animate({'marginLeft': mL + String(mw) + 'px'}, {duration : ad, easing: ae, complete : function(){ 7931 self.sl.attr({'data-moving' : '0', 'data-isfirstentry' : (self.curP == '1' ? '1' : '0'), 'data-islastentry' : (self.curP === (self.noE/self.noCol) ? '1' : '0')}); 7932 if(self.onafterslidermove !== null && typeof self.onafterslidermove == 'function'){ 7933 self.onafterslidermove(self.options['moveto']); 7934 self.onafterslidermove = null; 7935 } 7936 }}); 7937 self.sl.attr({'data-currententry' : self.curE, 'data-currentpage' : self.curP}); 7938 } 7939 7940 if(self.noP > 0 && self.pNavi !== null && self.pNavi.length > 0){ 7941 self.pNavi.children('.selected').removeClass('selected').end() 7942 .children().eq(self.curP-1).addClass('selected'); 7943 } 7944 if(options['moveslider'] !== false && self.scrollBar !== null && self.scrollBar.length > 0){
7945 var vhcP = Math.ceil((self.curP)*100/self.noP)/100; 7946 var vhprevP = Math.ceil((self.curP-1)*100/self.noP)/100; 7947 var vh = vhcP-vhprevP/2; 7948 var val = self.curP == 1 ? 0 : (self.curP == self.noP ? parseInt(self.scrollBar.attr('max')) : Math.ceil((self.curP-vh)*100/self.noP)/100*parseInt(self.scrollBar.attr('max'))); 7949 self.scrollBar.val(val); 7950 } 7951 } 7952 7953 touch(event) { 7954 const self = this; 7955 const original = event.originalEvent || event; 7956 const type = original.type; 7957 var listElement = self.sl.eq(0).find('ul')[0]; 7958 7959 if (type === 'touchstart' || type === 'mousedown') { 7960 const pageX = type === 'touchstart' ? original.touches[0].pageX : original.pageX; 7961 const pageY = type === 'touchstart' ? original.touches[0].pageY : original.pageY; 7962 self.slt['sx'] = pageX; 7963 self.slt['sy'] = pageY - jQuery(window).scrollTop(); 7964 self.slt['isClick'] = true; 7965 } 7966 else if (type === 'touchmove' || type === 'mousemove') { 7967 if (self.slt['sx'] != null && self.slt['sy'] != null) { 7968 const pageX = type === 'touchmove' ? original.touches[0].pageX : original.pageX; 7969 const pageY = type === 'touchmove' ? original.touches[0].pageY : original.pageY; 7970 self.slt['sxc'] = pageX; 7971 self.slt['syc'] = pageY - jQuery(window).scrollTop(); 7972 self.slt['dx'] = self.slt['sxc'] - self.slt['sx']; 7973 self.slt['dy'] = self.slt['syc'] - self.slt['sy']; 7974 self.slt['dxp'] = Math.abs(self.slt['dx']); 7975 self.slt['dyp'] = Math.abs(self.slt['dy']); 7976 7977 if (self.sl.attr('data-moving') !== '1' && self.slt['dxp'] > 10 && self.slt['dxp'] / self.slt['dyp'] > 1.4) { 7978 if (self.slt['dx'] < 0) { // Ãnderung hier 7979 self.smartSliderMove('+', {flip: this.options.flip}); // Fehler in option an options korrigiert 7980 } else { 7981 self.smartSliderMove('-', {flip: this.options.flip}); // Fehler in option an options korrigiert 7982 } 7983 self.slt['sx'] = self.slt['sy'] = null; 7984 self.slt['isClick'] = false; 7985 } 7986 7987 if (typeof self.slt['clickhandler'] != 'function') { 7988 self.slt['clickhandler'] = function(e) { 7989 e.stopPropagation(); // Click nicht weitergeben 7990 e.preventDefault(); // Standard-Verhalten verhindern 7991 }; 7992 } 7993 7994 //damit klick-Event auf Listeneintrag verhindert wird. 7995 if(listElement.length > 0) listElement.addEventListener('click', self.slt['clickhandler'], true); 7996 } 7997 } 7998 else if (type === 'touchend' || type === 'mouseup') { 7999 if (!self.slt['isClick']) self.sl.attr('data-istouched', true); 8000 else self.sl.attr('data-istouched', false); 8001 self.slt['sx'] = self.slt['sy'] = null; 8002 self.setVar(); 8003 if(listElement.length > 0) listElement.removeEventListener('click', self.slt['clickhandler'], true); 8004 } 8005 event.stopPropagation(); 8006 event.stopImmediatePropagation(); 8007 } 8008 8009 resize(event){ 8010 const self = this; 8011 var doResize = true; 8012 if(self.slI == null) doResize = false; 8013 if(self.options.slideronlymobile === '1' && !window.matchMedia("(max-width: " + self.options.breakpoint + ")").matches){ 8014 if(self.sl.attr('data-init') === undefined){ 8015 self.init(); 8016 doResize = false; 8017 } 8018 else{ 8019 self.deactivate(); 8020 doResize = false; 8021 } 8022 } 8023 else if(self.options.slideronlymobile === '1' && window.matchMedia("(max-width: " + self.options.breakpoint + ")").matches){ 8024 if(self.sl.attr('data-init') === undefined){ 8025 self.init(); 8026 doResize = false; 8027 } 8028 self.activate(); 8029 } 8030 8031 if(!doResize) return false; 8032 8033 var bkpRaster = [415, 576, 768, 992, 1200]; 8034 var curBKP = bkpRaster.reduce((acc, bp) => jQuery(window).width() >= bp ? bp : acc, 0); 8035 8036 if(!self.onload && self.slI.outerWidth() != self.slIw){ 8037 self.setVar(true); 8038 self.onload = true; 8039 if(this.sl.attr('data-smartpagenavi') == 'scrollbar'){self.setScrollbar();self.setPageNav();} 8040 else if(this.sl.attr('data-smartpagenavi') == 'scrollbarOnly') self.setScrollbar(); 8041 else self.setPageNav(); 8042 } 8043 else if(self.curBKP != null && self.curBKP != curBKP){ 8044 if(typeof event.originalEvent != 'undefined' && event.originalEvent.isTrusted){ 8045 self.sl.find('> div, > ul').css({'margin-left' : 0}); 8046 self.setVar(true); 8047 if(this.sl.attr('data-smartpagenavi') == 'scrollbar'){self.setScrollbar();self.setPageNav();} 8048 else if(this.sl.attr('data-smartpagenavi') == 'scrollbarOnly') self.setScrollbar(); 8049 else self.setPageNav(); 8050 } 8051 } 8052 self.curBKP = curBKP; 8053 } 8054} 8055 8056wSmartSlider = function(sl, options){ 8057 if(typeof(window.smartSliderObjects) == 'undefined') window.smartSliderObjects = {};
8058 if(!sl.attr('data-slid')){ 8059 sl.attr('data-slid', Math.random().toString(36).substr(2,9)); 8060 } 8061 var slId = sl.attr('data-slid'); 8062 var slO = null; 8063 if(window.smartSliderObjects[slId] === undefined){ 8064 slO = new wClassSmartSlider(sl, options); 8065 window.smartSliderObjects[slId] = slO; 8066 } 8067 else slO = window.smartSliderObjects[slId]; 8068}; 8069 8070jQuery.fn.wLightbox = function(optionsLightbox){ 8071 8072 jQuery.each(jQuery(this), function(){ 8073 if(jQuery(this).prop("tagName") == 'A' && jQuery(this).closest('li[data-target*="box"]').length > 0){ 8074 jQuery(this).on('click', function(){ 8075 jQuery(this).closest('li[data-target*="box"]').trigger('click'); 8076 return false; 8077 }); 8078 } 8079 else{ 8080 if(jQuery(this).attr('target') != 'embedBody' && jQuery(this).attr('data-hasinitlightbox') != '1'){ 8081 jQuery(this).attr('data-hasinitlightbox', '1'); 8082 jQuery(this).on('click', function(){ 8083 return wLightbox(jQuery(this), typeof(optionsLightbox) != 'undefined' ? optionsLightbox : {}); 8084 }); 8085 jQuery(this).on('submit', function(){ 8086 return wLightbox(jQuery(this), typeof(optionsLightbox) != 'undefined' ? optionsLightbox : {}); 8087 }); 8088 } 8089 } 8090 8091 if(typeof(wEditor) == 'undefined' && jQuery(this).prop("tagName") == 'PICTURE'){ 8092 jQuery(this).attr('tabindex', 0); 8093 jQuery(this).keypress(function(event){ 8094 if(event.keyCode == 13 || event.keyCode == 32 ){ 8095 jQuery(this).trigger("click"); 8096 event.preventDefault(); 8097 } 8098 }); 8099 } 8100 8101 }); 8102}; 8103 8104wLightbox = function(objectCurrent, options){ 8105 8106 if(typeof(wEditor) != 'undefined'){ 8107 return false; 8108 } 8109 8110 var elementCurrent, src, alt = '', queryString = '', srcOrig, rel, optionsInit = options; 8111 8112 var openPointerType = ''; 8113 8114 if(typeof(event) !== 'undefined'){ 8115 if(typeof(event.pointerType) !== 'undefined'){ 8116 openPointerType = event.pointerType; 8117 } 8118 8119 wLightboxOpener = event.target; 8120 } 8121 8122 options = options || {}; 8123 8124 options['objectCurrent'] = objectCurrent; 8125 8126 if(typeof(objectCurrent.jquery) == 'undefined'){ 8127 options = typeof(optionsInit) != 'undefined' ? options : objectCurrent; 8128 } 8129 else if(objectCurrent.attr('data-isinactivelightbox') == '1'){ 8130 return false; 8131 } 8132 8133 lwd = {}; 8134 lwd['box'] = {class : 'default', postfix : 'viewmode=blank&linkback=no'}; 8135 lwd['boxPicture'] = {class : 'image', scrollIfToHeight : false, imitSizeIfPicture : true, addCopyrightElement : true, addPlayer : false, playerDuration : 5000, allowFullscreen : false}; 8136 lwd['boxGallery'] = {class : 'imageFull', scrollIfToHeight : false, limitSizeIfPicture : true, addCopyrightElement : true, addPlayer : true, playerDuration : 5000, showPlayerProgress : true, showEntryPosition : true, animation : 'slidefrombeside' /*[fadein|slidefrombeside|slideout|overlapfrombeside]*/ , allowFullscreen : true, allowTouchSlide : true, animationOverflow : 'visible'}; 8137 lwd['boxPdfViewer'] = {class : 'pdfViewer', scrollIfToHeight : false, limitSizeIfPicture : true, addCopyrightElement : false, showEntryPosition : true, showEntriesSelectable : true, showEntriesSelectableThumbnail : true, animation : 'overlapfrombeside' /*[fadein|slidefrombeside|slideout|overlapfrombeside]*/ , allowFullscreen : false, allowTouchSlide : true, animationOverflow : 'visible', allowFullscreen : false, allowZoom : true, animationOverflow : 'hidden', closeOnClickBackground : false}; 8138 lwd['boxVideo'] = {class : 'video'}; 8139 lwd['boxYoutube'] = {class : 'youtube'}; 8140 lwd['boxContent'] = {class : 'content', postfix : 'viewmode=blank&linkback=no'}; 8141 lwd['boxForm'] = {class : 'form', postfix : 'viewmode=blank&linkback=no'}; 8142 lwd['boxCard'] = {class : 'card', postfix : 'viewmode=blank&linkback=no'}; 8143 lwd['boxCart'] = {class : 'cart', postfix : 'viewmode=blank&linkback=no'}; 8144 8145 if(typeof(wLightboxVariants) != 'undefined'){ 8146 if(!options['variant']){ 8147 if(objectCurrent.attr('data-variant')){ 8148 options['variant'] = objectCurrent.attr('data-variant'); 8149 } 8150 else if(objectCurrent.prop('tagName') == 'A' && objectCurrent.attr('target') && objectCurrent.attr('target').indexOf('box') != -1){ 8151 options['variant'] = objectCurrent.attr('target'); 8152 } 8153 else if(objectCurrent.prop('tagName') == 'FORM' && objectCurrent.attr('data-target') && objectCurrent.attr('data-target').indexOf('box') != -1){ 8154 options['variant'] = objectCurrent.attr('data-target'); 8155 } 8156 else if(objectCurrent.prop('tagName') == 'PICTURE' || objectCurrent.attr('class') && objectCurrent.attr('class').indexOf('picture') != -1){ 8157 if(objectCurrent.closest('.listPictureGallery').length != 0 && wLightboxVariants['boxGallery']){ 8158 options['variant'] = 'boxGallery'; 8159 } 8160 else{ 8161 options['variant'] = 'boxPicture'; 8162 } 8163 } 8164 else { 8165 options['variant'] = 'box'; 8166 } 8167 if(/(box\w+)/.test(objectCurrent.get(0).className)){ 8168 options['variant'] = RegExp.$1; 8169 } 8170 } 8171 8172 if(typeof(objectCurrent.jquery) != 'undefined' && objectCurrent.attr('data-copyright-lightbox') && objectCurrent.attr('data-onlypicturecopyright-lightbox') != '1'){ 8173 options['copyrightText'] = objectCurrent.attr('data-copyright-lightbox'); 8174 } 8175 8176 if(typeof wLightboxVariants[options['variant']] === 'undefined'){ 8177 if(typeof lwd[options['variant']] !== 'undefined'){ 8178 wLightboxVariants[options['variant']] = lwd[options['variant']]; 8179 } 8180 } 8181 8182 if(wLightboxVariants[options['variant']]){ 8183 if(wLightboxVariants[options['variant']]['class'] && !options['class']){ 8184 options['class'] = wLightboxVariants[options['variant']]['class']; 8185 } 8186 if(wLightboxVariants[options['variant']]['width'] && !options['width']){ 8187 options['width'] = wLightboxVariants[options['variant']]['width']; 8188 } 8189 if(wLightboxVariants[options['variant']]['height'] && !options['height']){ 8190 options['height'] = wLightboxVariants[options['variant']]['height']; 8191 } 8192 if(wLightboxVariants[options['variant']]['postfix'] && !options['postfix']){ 8193 options['postfix'] = wLightboxVariants[options['variant']]['postfix']; 8194 } 8195 if(wLightboxVariants[options['variant']]['scrollIfToHeight'] && !options['scrollIfToHeight']){ 8196 options['scrollIfToHeight'] = wLightboxVariants[options['variant']]['scrollIfToHeight']; 8197 } 8198 if(wLightboxVariants[options['variant']]['limitSizeIfPicture'] && !options['limitSizeIfPicture']){ 8199 options['limitSizeIfPicture'] = wLightboxVariants[options['variant']]['limitSizeIfPicture']; 8200 } 8201 if(typeof wLightboxVariants[options['variant']]['closeOnClickBackgroun
8201d'] !== 'undefined'){ 8202 options['closeOnClickBackground'] = wLightboxVariants[options['variant']]['closeOnClickBackground']; 8203 } 8204 if(typeof wLightboxVariants[options['variant']]['type'] !== 'undefined'){ 8205 options['type'] = wLightboxVariants[options['variant']]['type']; 8206 } 8207 if(typeof wLightboxVariants[options['variant']]['pushState'] !== 'undefined'){ 8208 options['pushState'] = wLightboxVariants[options['variant']]['pushState']; 8209 } 8210 } 8211 } 8212 8213 if(typeof(objectCurrent.jquery) == 'undefined'){ 8214 src = options['href'] ? options['href'] : objectCurrent; 8215 rel = ''; 8216 objectCurrent = jQuery('<a href="' + src + '" target=""></a>'); 8217 } 8218 else if(typeof(options['href']) != 'undefined' && /\//.test(options['href'])){ 8219 src = options['href']; 8220 if(objectCurrent.get(0) instanceof Window) objectCurrent = jQuery('<a href="' + src + '" target=""></a>'); 8221 rel = objectCurrent.attr('data-rel') ? objectCurrent.attr('data-rel') : ''; 8222 elementCurrent = objectCurrent.get(0); 8223 objectCurrent = jQuery('<a href="' + src + '" target=""></a>'); 8224 } 8225 else{ 8226 elementCurrent = objectCurrent.get(0); 8227 if(objectCurrent.prop('tagName') == 'FORM'){ 8228 src = objectCurrent.attr('action'); 8229 objectCurrent.find('input').each(function(){ 8230 var add = true; 8231 if((jQuery(this).attr('type') == 'radio' || jQuery(this).attr('type') == 'checkbox') && !jQuery(this).prop('checked')) add = false; 8232 if(add) queryString += (queryString == '' ? '?' : '&') + jQuery(this).attr('name') + '=' + encodeURIComponent(jQuery(this).val()); 8233 }); 8234 src += queryString; 8235 } 8236 else{ 8237 src = objectCurrent.attr('data-href') ? objectCurrent.attr('data-href') : objectCurrent.attr('href'); 8238 alt = objectCurrent.find('img').attr('alt') ? objectCurrent.find('img').attr('alt') : ''; 8239 8240 if(!src){ 8241 currentImage = objectCurrent.find('img'); 8242 rel = objectCurrent.attr('rel'); 8243 if(currentImage){ 8244 if(currentImage.parent().prop('tagName') == 'PICTURE' && objectCurrent.parent().attr('data-src')){ 8245 src = objectCurrent.parent().attr('data-src'); 8246 if(objectCurrent.parent().attr('data-rel')){ 8247 rel = objectCurrent.parent().attr('data-rel'); 8248 } 8249 } 8250 else if(currentImage.parent().prop('tagName') == 'PICTURE'){ 8251 src = objectCurrent.attr('data-src'); 8252 } 8253 else{ 8254 src = objectCurrent.find('img').attr('src'); 8255 } 8256 } 8257 } 8258 if(!src){ 8259 src = options['href']; 8260 } 8261 8262 if(options['limitSizeIfPicture'] && objectCurrent.find('source').length != 0 && objectCurrent.attr('data-lightboxequal') == '1'){ 8263 var srcs = [], srcToCheck = '', widthSrcToCheck = 0, srcToUse = '', widthSrcToUse = 10000, windowWidth = parseInt(jQuery(window).width()); 8264 objectCurrent.find('source').each(function(){ 8265 try{ 8266 srcs = jQuery(this).attr('srcset').split(','); 8267 for(var i = 0; i < srcs.length; i++){ 8268 srcToCheck = srcs[i].replace(/\s+\w+/, '').trim(); 8269 if(/@(\d+)w/.test(srcToCheck)){ 8270 widthSrcToCheck = RegExp.$1; 8271 if(widthSrcToCheck >= windowWidth * devicePixelRatio && widthSrcToCheck < widthSrcToUse){ 8272 src = srcToCheck; 8273 widthSrcToUse = widthSrcToCheck; 8274 } 8275 } 8276 } 8277 }catch(e){} 8278 }); 8279 } 8280 } 8281 if(!rel){ 8282 rel = objectCurrent.attr('data-rel'); 8283 } 8284 } 8285 8286 srcOrig = src; 8287 8288 if(options['postfix']){ 8289 if(/(.*)(#.*)$/.test(src)){ 8290 src = RegExp.$1; 8291 var anchor = RegExp.$2; 8292 src += /\?/.test(src) ? '&' + options['postfix'] + anchor : '?' + options['postfix'] + anchor; 8293 } 8294 else{ 8295 src += /\?/.test(src) ? '&' + options['postfix'] : '?' + options['postfix']; 8296 } 8297 } 8298 8299 if(/^https?\:\/\/([^\/]+)/.test(src) && !/\.(png|jpe?g|gif|webp)$/i.test(src)){ 8300 var removeBlank = true; 8301 if(RegExp.$1 == location.host){ 8302 removeBlank = false;
8303 } 8304 if(typeof(wHostsAllowViewmodeBlank) !== 'undefined' && wHostsAllowViewmodeBlank != ''){ 8305 var regExpAllowViewmmodeBlank = new RegExp(wHostsAllowViewmodeBlank.replace(/\./g, '\\.')); 8306 if(regExpAllowViewmmodeBlank.test(src)){ 8307 removeBlank = false; 8308 } 8309 } 8310 if(removeBlank){ 8311 src = src.replace('viewmode=blank', '').replace('linkback=no', ''); 8312 src = src.replace(/[\?\&]+$/, ''); 8313 } 8314 } 8315 8316 var externalRessourceToConfirm = ''; 8317 if(/youtu\.be\/([^\&\?]+)/.test(src) || /youtube(?:-nocookie)?\.com\/watch\?v=([^\&\?]+)/.test(src) || /youtube(?:-nocookie)?\.com\/embed\/([^\&\?]+)/.test(src) || /youtube(?:-nocookie)?\.com\/shorts\/([^\&\?]+)/.test(src)){ 8318 options['class'] = 'youtube'; 8319 var vu = 'https://www.youtube-nocookie.com/embed/' + RegExp.$1; 8320 var vqs = ''; 8321 if(/(start=\d+)/.test(src)){ 8322 vqs += (vqs == '' ? '?' : '&') + RegExp.$1; 8323 } 8324 else if(/(t=\d+)/.test(src)){ 8325 vqs += (vqs == '' ? '?' : '&') + 'star' + RegExp.$1; 8326 } 8327 if(/(end=\d+)/.test(src)){ 8328 vqs += (vqs == '' ? '?' : '&') + RegExp.$1; 8329 } 8330 vqs += (vqs == '' ? '?' : '&') + 'autoplay=1&rel=0'; 8331 src = vu + vqs; 8332 externalRessourceToConfirm = 'youtube'; 8333 } 8334 else if(/vimeo.com\/(?:video\/)?([\w]+)/.test(src)){ 8335 options['class'] = 'youtube'; 8336 var vu = 'https://player.vimeo.com/video/' + RegExp.$1; 8337 var vqs = ''; 8338 if(/[\?&](h=\w+)/.test(src)){ 8339 vqs += (vqs == '' ? '?' : '&') + RegExp.$1; 8340 } 8341 if(/(start=\d+)/.test(src)){ 8342 vqs += (vqs == '' ? '?' : '&') + RegExp.$1; 8343 } 8344 if(/(end=\d+)/.test(src)){ 8345 vqs += (vqs == '' ? '?' : '&') + RegExp.$1; 8346 } 8347 vqs += (vqs == '' ? '?' : '&') + 'autoplay=1'; 8348 src = vu + vqs; 8349 externalRessourceToConfirm = 'vimeo'; 8350 } 8351 8352 if(typeof(wConfirmExternVideosInLightbox) != 'undefined' && wConfirmExternVideosInLightbox === false){ 8353 externalRessourceToConfirm = ''; 8354 } 8355 8356 var lightboxClassName = 'wLightbox-' + (options['class'] ? options['class'] : 'default'); 8357 8358 var contentWidth = 0; 8359 var contentHeight = 0; 8360 8361 var elementsRel = jQuery("*[data-rel = '" + rel + "']:not([data-isinactivelightbox='1'])"); 8362 var numberRel = elementsRel.length; 8363 var positionRel = 1; 8364 8365 for(i = 0; i < numberRel; i++){ 8366 if(elementCurrent && elementsRel[i] == elementCurrent){ 8367 positionRel = i + 1; 8368 break; 8369 } 8370 } 8371 8372 var classPrev = 'wLightboxMoverBack' + (numberRel > 1 && positionRel > 1 ? ' wLightboxMoverBackAvailable' : ''); 8373 var classNext = 'wLightboxMoverForward' + (numberRel > 1 && positionRel < numberRel ? ' wLightboxMoverForwardAvailable' : ''); 8374 8375 if(options['pushState'] && positionRel > 0){ 8376 let pushStateHash = '#anchor_lightbox_' + rel + '_' + positionRel; 8377 history.pushState({page: pushStateHash}, '', pushStateHash); 8378 } 8379 8380 var boxWasOpened = true; 8381 var lightboxType = 'iframe'; 8382 var titleInnerHTML = ''; 8383
8384 if(options['type'] == 'inline' || objectCurrent && objectCurrent.attr('data-lightboxtype') == 'inline'){ 8385 lightboxType = 'inline'; 8386 } 8387 else if(options['type'] == 'ajax' || objectCurrent && objectCurrent.attr('data-lightboxtype') == 'ajax'){ 8388 lightboxType = 'inline'; 8389 options['type'] = 'ajax'; 8390 } 8391 else if(/\.(jpe?g|gif|webp|png|svg)$/i.test(src.replace(/\?.*/, '')) || options['type'] == 'image' || objectCurrent && objectCurrent.attr('data-lightboxtype') == 'image'){ 8392 lightboxType = 'image'; 8393 } 8394 else if(/\.(mpeg|mp4|m4v|webm)(\?[^\/]*)*$/i.test(src) || options['type'] == 'video' ||objectCurrent && objectCurrent.attr('data-lightboxtype') == 'video'){ 8395 lightboxType = 'video'; 8396 } 8397 8398 if(typeof(wOnBeforeOpenLightbox) === 'function'){ 8399 if(wOnBeforeOpenLightbox(src, options) == false){ 8400 return false; 8401 } 8402 } 8403 var lE = jQuery('.wLightbox'); 8404 8405 if(jQuery('#wLightbox').length == 0){ 8406 if(lightboxType == 'inline'){ 8407 options['content'] = options['content'] || ''; 8408 options['allowTouchStart'] = typeof(options['allowTouchStart']) != 'undefined' ? options['allowTouchStart'] : false; 8409 jQuery('<div id="wLightbox" data-type="' + lightboxType + '" class="wLightbox wLightbox-' + options['type'] + ' ' + lightboxClassName + '" data-src="' + src + '"><div class="wLightboxBackground"></div><div class="wLightboxOuter"><div class="wLightboxInner" ' + (!options['allowTouchStart'] ? ' ontouchstart="event.preventDefault();"' : '') + (!options['allowMouseDown'] ? ' onmousedown="event.preventDefault();"' : '') + '><div class="wLightboxCloser" role="button" aria-label="'+wGetText('close')+'"></div>' + options['content'] + '<div class="wLightboxTitle"></div></div></div></div>').appendTo('body'); 8410 } 8411 else if(lightboxType == 'image'){ 8412 if(typeof(wAddRandomIdToImagesInLightbox) != 'undefined' && wAddRandomIdToImagesInLightbox){ 8413 src = src + (src.indexOf('?') == -1 ? '?' : '') + String(parseInt(Math.random() * 1000000)); 8414 } 8415 8416 jQuery('<div id="wLightbox" data-type="' + lightboxType + '" ' + (wLightboxVariants[options['variant']]['showPlayerProgress'] ? ' data-showplayerprogress="1"' : '')+ (wLightboxVariants[options['variant']]['showEntryPosition'] && numberRel > 1 ? ' data-showentryposition="1"' : '') + ' class="wLightbox wLightbox-image ' + lightboxClassName + '" data-src="' + src + '"' + (wLightboxVariants[options['variant']]['allowFullscreen'] ? ' data-allowfullscreen="1"' : '') + '><div class="wLightboxBackground"></div><div class="wLightboxOuter"><div class="wLightboxInner">' + (wLightboxVariants[options['variant']]['showEntryPosition'] && numberRel > 1 ? '<div class="wLightboxEntries"><div class="wLightboxEntryPosition">' + positionRel + ' / ' + numberRel + '</div><div class="wLightboxEntriesSelectable"></div><div class="wLightboxEntriesSelectableOpener"></div></div>' : '') + (wLightboxVariants[options['variant']]['allowDownload'] && objectCurrent.attr('data-downloadpath') && objectCurrent.attr('data-downloadpath') != '' ? '<div class="wLightboxDownload"><span></span><span></span></div>' : '') + (wLightboxVariants[options['variant']]['allowZoom'] && numberRel > 1 ? '<div class="wLightboxZoom"><span></span><span></span></div>' : '') + (wLightboxVariants[options['variant']]['addPlayer'] && numberRel > 1 ? '<div class="wLightboxPlayer"><span></span><span></span></div>' : '') + (wLightboxVariants[options['variant']]['allowFullscreen'] ? '<div class="wLightboxFullscreen"><span></span><span></span></div>' : '') + '<div class="wLightboxCloser" role="button" aria-label="'+wGetText('close')+'"><span></span><span></span></div><div aria-label="'+wGetText('button_back')+'" class="' + classPrev + '"><span></span><span></span></div><div aria-label="'+wGetText('button_next')+'" role="button" class="' + classNext + '"><span></span><span></span></div><div class="wLightboxImageOuter"><img class="wLightboxImage" src="' + src + '" alt="' + alt + '"/>' + (wLightboxVariants[options['variant']]['addCopyrightElement'] && options['copyrightText'] ? '<div class="wLightboxCopyright">' + options['copyrightText'] + '</div>' : '') + '</div><div class="wLightboxFooter"><div class="wLightboxTitle">' + titleInnerHTML + '</div><div class="wLightboxDescription">' + titleInnerHTML + '</div></div>' + (wLightboxVariants[options['variant']]['showPlayerProgress'] ? ' <div class="wLightboxPlayerProgress"></div>' : '') + '</div></div></div>').appendTo('body'); 8417 8418 if(elementsRel.length > 1 && elementsRel[1].getAttribute('data-src')){ 8419 var imgPreload = new Image(); 8420 imgPreload.src = elementsRel[1].getAttribute('data-src'); 8421 } 8422 if(elementsRel.length > 1 && wLightboxVariants[options['variant']]['showEntriesSelectable'] && numberRel > 1 ){ 8423 jQuery('.wLightboxEntries').on('click', function(){ 8424 jQuery('.wLightboxEntriesSelectable').toggleClass('open'); 8425 }); 8426 8427 var thumbnailsRel = []; 8428 8429 if(wLightboxVariants[options['variant']]['showEntriesSelectableThumbnail'] && jQuery(elementsRel[0]).closest('.listInner').length === 1){ 8430 thumbnailsRel = jQuery(elementsRel[0]).closest('.listInner').find('.listEntriesPreview img'); 8431 } 8432 8433 for(var j = 0; j < elementsRel.length; j++){ 8434 var thumbnailElement = ''; 8435 if(thumbnailsRel[j]){ 8436 thumbnailElement = '<img class="wLightboxEntrySelectableThumbnail" src="' + thumbnailsRel[j].getAttribute('src') + '" alt="" />'; 8437 } 8438 jQuery('.wLightboxEntriesSelectable').append('<div class="wLightboxEntriesSelectablePage' + (j === positionRel - 1 ? ' selected' : '') + '" data-pageid="' + (j + 1) + '">' + thumbnailElement + '<span class="wLightboxEntrySelectablePageId">' + (j + 1) + '</span></div>'); 8439 } 8440 8441 jQuery('.wLightboxEntriesSelectablePage').on('click', function(){ 8442 jQuery('.wLightboxEntriesSelectablePage.selected').removeClass('selected'); 8443 jQuery('.wLightboxEntriesSelectablePage').eq(jQuery(this).data('pageid') - 1).addClass('selected'); 8444 jQuery(elementsRel[jQuery(this).data('pageid') - 1]).trigger('click'); 8445 }); 8446 } 8447 } 8448 else if(lightboxType == 'video'){ 8449 var mimeTypeVideo = 'video/mp4'; 8450 jQuery('<div id="wLightbox" data-type="' + lightboxType + '" class="wLightbox wLightbox-video ' + lightboxClassName + '" data-src="' + src + '">
8450<div class="wLightboxBackground"></div><div class="wLightboxOuter"><div class="wLightboxInner" ontouchstart="event.preventDefault();" onmousedown="event.preventDefault();"><div class="wLightboxCloser"></div><div class="' + classPrev + '"><span></span><span></span></div><div class="' + classNext + '"><span></span><span></span></div><video controls="controls" autoplay="autoplay" style="max-width:100%;width:auto;height:auto;"><source src="' + src + '" type="' + mimeTypeVideo + '" /></video><div class="wLightboxFooter"><div class="wLightboxTitle">' + titleInnerHTML + '</div></div></div></div></div>').appendTo('body'); 8451 } 8452 else{ 8453 var srcIframe = src; 8454 if(document.cookie.indexOf('allowLoadExternRessources=1') == -1 && (externalRessourceToConfirm == 'youtube' || externalRessourceToConfirm == 'vimeo')){ 8455 srcIframe = 'about:blank'; 8456 if(externalRessourceToConfirm == 'vimeo'){ 8457 var urlConfirmExternalRessource = wProjectPath + '/wGlobal/content/privacy/vimeo-start-notice-iframe.php?viewmode=blank'; 8458 } 8459 else{ 8460 var urlConfirmExternalRessource = wProjectPath + '/wGlobal/content/privacy/youtube-start-notice-iframe.php?viewmode=blank'; 8461 } 8462 jQuery.ajax({type: "GET", url: urlConfirmExternalRessource, 8463 success: function(result){ 8464 jQuery('#wLightboxIframe').on("load", function(){ 8465 var videoStart = (jQuery('#wLightboxIframe').contents().find("#startVideo").length > 0 ? jQuery('#wLightboxIframe').contents().find("#startVideo") : jQuery('#wLightboxIframe').contents().find("html")); 8466 videoStart.on('click', function(){parent.jQuery('#wLightboxIframe').attr('src', parent.jQuery('#wLightboxIframe').data('srcx'));return false;}); 8467 }); 8468 jQuery('#wLightboxIframe').attr('src', urlConfirmExternalRessource); 8469 }, 8470 error: function (xhr, ajaxOptions, thrownError){ 8471 if(xhr.status == 404){ 8472 jQuery('#wLightboxIframe').attr('src', jQuery('#wLightboxIframe').data('srcx')) 8473 } 8474 } 8475 }); 8476 } 8477 var lightboxHTML = '<div id="wLightbox" data-type="' + lightboxType + '" class="wLightbox wLightbox-iframe ' + lightboxClassName + '" data-src="' + src + '"><div class="wLightboxBackground"></div><div class="wLightboxOuter"><div class="wLightboxInner"><div class="wLightboxCloser"></div><div class="' + classPrev + '"><span></span><span></span></div><div class="' + classNext + '"><span></span><span></span></div><iframe id="wLightboxIframe" class="wLightboxIframe" data-openpointertype="' + openPointerType + '" allow="autoplay" allowfullscreen="true" data-srcx="' + src + '" src="' + srcIframe + '"></iframe><div class="wLightboxTitle"></div></div></div></div>'; 8478 jQuery(lightboxHTML).appendTo('body'); 8479 } 8480 lE = jQuery('#wLightbox'); 8481 8482 jQuery('.wLightboxCloser, .wLightboxBackground').on('click touchend', function(event){ 8483 if(jQuery(event.target).hasClass('wLightboxBackground') && options['closeOnClickBackground'] === false){ 8484 return false; 8485 } 8486 wLightboxClose(event); 8487 }); 8488 8489 jQuery('.wLightboxFullscreen').on('click', function(){ 8490 event.stopPropagation(); 8491 if(jQuery('#wLightbox').attr('data-fullscreenstatus') != 'full'){ 8492 jQuery('#wLightbox').attr('data-fullscreenstatus', 'full'); 8493 if(typeof jQuery('.wLightbox').get(0).requestFullScreen === 'function'){ 8494 jQuery('.wLightbox').get(0).mozRequestFullScreen(); 8495 } 8496 else if(typeof jQuery('.wLightbox').get(0).mozRequestFullScreen === 'function'){ 8497 jQuery('.wLightbox').get(0).mozRequestFullScreen(); 8498 } 8499 else if(typeof jQuery('.wLightbox').get(0).webkitRequestFullScreen === 'function'){ 8500 jQuery('.wLightbox').get(0).webkitRequestFullScreen(); 8501 } 8502 } 8503 else{ 8504 jQuery('#wLightbox').attr('data-fullscreenstatus', ''); 8505 document.exitFullscreen(); 8506 } 8507 }); 8508 8509 jQuery('.wLightboxZoom').on('click', function(){ 8510 event.stopPropagation(); 8511 if(jQuery('#wLightbox').attr('data-zoom') != '1'){ 8512 jQuery('#wLightbox').attr('data-zoom', '1'); 8513 } 8514 else{ 8515 jQuery('#wLightbox').attr('data-zoom', ''); 8516 } 8517 }); 8518 8519 jQuery('.wLightboxDownload').on('click', function(){ 8520 event.stopPropagation(); 8521 window.open(objectCurrent.attr('data-downloadpath')); 8522 }); 8523 8524 jQuery('.wLightboxPlayer').on('click', function(){ 8525 event.stopPropagation(); 8526 if(jQuery('#wLightbox').attr('data-playerstatus') != 'play'){ 8527 8528 var playerDuration = typeof wLightboxVariants[options['variant']]['playerDuration'] != 'undefined' ? wLightboxVariants[options['variant']]['playerDuration'] : 5000; 8529 8530 jQuery('.wLightboxPlayerProgress').get(0).style.setProperty('--wLightboxPlayerDuration', String(playerDuration / 1000) + 's'); 8531 8532 jQuery('#wLightbox').attr('data-playerstatus', 'play'); 8533 8534 if(jQuery('#wLightbox').attr('data-showplayerprogress') == '1'){ 8535 jQuery('#wLightbox').attr('data-playerprogress', 'play'); 8536 } 8537 8538 if(elementsRel[jQuery('.wLightboxMoverForward').data('entry') + 1]){ 8539 var imgPreload = new Image(); 8540 imgPreload.src = elementsRel[jQuery('.wLightboxMoverForward').data('entry') + 1].getAttribute('data-src'); 8541 } 8542 8543 intervallLightboxPlayer = window.setInterval(function(){ 8544 if(jQuery('.wLightboxMoverForwardAvailable').length != 0){ 8545 8546 if(elementsRel[jQuery('.wLightboxMoverForward').data('entry') + 1]){ 8547 var imgPreload = new Image(); 8548 imgPreload.src = elementsRel[jQuery('.wLightboxMoverForward').data('entry') + 1].getAttribute('data-src'); 8549 } 8550 8551 jQuery('.wLightboxMoverForwardAvailable').trigger('click'); 8552 8553 if(jQuery('#wLightbox').attr('data-showplayerprogress') == '1'){ 8554 jQuery('#wLightbox').attr('data-playerprogress', ''); 8555 window.setTimeout(function(){ 8556 jQuery('#wLightbox').attr('data-playerprogress', 'play'); 8557 }, 32); 8558 } 8559 } 8560 else{ 8561 jQuery('#wLightbox').attr('data-playerstatus', 'pause'); 8562 jQuery('#wLightbox').attr('data-playerprogress', ''); 8563 jQuery('.wLightboxPlayer').hide(); 8564 window.clearInterval(intervallLightboxPlayer); 8565 } 8566 }, playerDuration); 8567 } 8568 else{ 8569 jQuery('#wLightbox').attr('data-playerstatus', 'pause'); 8570 jQuery('#wLightbox').attr('data-playerprogress', ''); 8571 window.clearInterval(intervallLightboxPlayer); 8572 } 8573 }); 8574 8575 if(!wUiTmp['hasAEF']){ 8576 wUiTmp['hasAEF'] = true; 8577 document.addEventListener('fullscreenchange', function(){ 8578 if(!document.fullscreenElement){ 8579 jQuery('.wLightboxFullscreen').show(); 8580 } 8581 }); 8582 } 8583 8584 boxWasOpened = false;
8585 jQuery('.wLightbox').addClass('wLightboxStatusLoading'); 8586 //wUiTmp['wLightboxOuterWidth'] = jQuery('.wLightboxOuter').width(); 8587 //wUiTmp['wLightboxOuterHeight'] = jQuery('.wLightboxOuter').height(); 8588 } 8589 else if(lightboxType != lE.data('type')){ 8590 if(lightboxType == 'inline'){ 8591 options['content'] = options['content'] || ''; 8592 lE.data('type', lightboxType) 8593 .data('src', src) 8594 .attr('class', 'wLightbox wLightbox-' + options['type'] + ' ' + lightboxClassName) 8595 .html('<div class="wLightboxBackground"></div><div class="wLightboxOuter"><div class="wLightboxInner"' + (!options['allowTouchStart'] ? ' ontouchstart="event.preventDefault();"' : '') + (!options['allowMouseDown'] ? ' onmousedown="event.preventDefault();"' : '') + '><div class="wLightboxCloser"></div>' + options['content'] + '<div class="wLightboxTitle"></div></div></div></div>'); 8596 } 8597 else if(lightboxType == 'image'){ 8598 lE.data('type', lightboxType) 8599 .data('src', src) 8600 .attr('class', 'wLightbox wLightbox-image ' + lightboxClassName) 8601 .html('<div class="wLightboxBackground"></div><div class="wLightboxOuter"><div class="wLightboxInner"><div class="wLightboxCloser"><span></span><span></span></div><div class="' + classPrev + '"><span></span><span></span></div><div class="' + classNext + '"><span></span><span></span></div><div class="wLightboxImageOuter"><img class="wLightboxImage" src="' + src + '" alt="' + alt + '"/>' + (wLightboxVariants[options['variant']]['addCopyrightElement'] && options['copyrightText'] ? '<div class="wLightboxCopyright">' + options['copyrightText'] + '</div>' : '') + '</div><div class="wLightboxFooter"><div class="wLightboxTitle">' + titleInnerHTML + '</div><div class="wLightboxDescription">' + titleInnerHTML + '</div></div></div></div></div>'); 8602 } 8603 else if(lightboxType == 'video'){ 8604 var mimeTypeVideo = 'video/mp4'; 8605 lE.data('type', lightboxType) 8606 .data('src', src) 8607 .attr('class', 'wLightbox wLightbox-video ' + lightboxClassName) 8608 .html('<div class="wLightboxBackground"></div><div class="wLightboxOuter"><div class="wLightboxInner" ontouchstart="event.preventDefault();" onmousedown="event.preventDefault();"><div class="wLightboxCloser"></div><div class="' + classPrev + '"><span></span><span></span></div><div class="' + classNext + '"><span></span><span></span></div><video controls="controls" autoplay="autoplay" style="max-width:100%;width:auto;height:auto;"><source src="' + src + '" type="' + mimeTypeVideo + '" /></video><div class="wLightboxFooter"><div class="wLightboxTitle">' + titleInnerHTML + '</div></div></div></div></div>'); 8609 } 8610 else{ 8611 lE.data('type', lightboxType) 8612 .data('src', src) 8613 .attr('class', 'wLightbox wLightbox-iframe ' + lightboxClassName) 8614 .html('<div class="wLightboxBackground"></div><div class="wLightboxOuter"><div class="wLightboxInner"><div class="wLightboxCloser"></div><div class="' + classPrev + '"><span></span><span></span></div><div class="' + classNext + '"><span></span><span></span></div><iframe id="wLightboxIframe" class="wLightboxIframe" data-openpointertype="' + openPointerType + '" allowfullscreen="true" src="' + src + '"></iframe><div class="wLightboxTitle"></div></div></div></div>'); 8615 } 8616 boxWasOpened = false; 8617 jQuery('.wLightboxCloser, .wLightboxBackground').on('click touchend', function(){ 8618 if(jQuery(event.target).hasClass('wLightboxBackground') && options['closeOnClickBackground'] === false){ 8619 return false; 8620 } 8621 wLightboxClose(event); 8622 }); 8623 lE.removeClass('wLightboxStatusLoaded').addClass('wLightboxStatusChanging').addClass('wLightboxStatusChanging'); 8624 } 8625 else{ 8626 lE.removeClass('wLightboxStatusLoaded').addClass('wLightboxStatusChanging').addClass('wLightboxStatusChanging'); 8627 } 8628 8629 if(jQuery('.wLightboxEntryPosition').length != 0){ 8630 jQuery('.wLightboxEntryPosition').html(positionRel + ' / ' + elementsRel.length); 8631 } 8632 8633 if(lightboxType == 'inline'){ 8634 8635 if(options['type'] == 'ajax'){ 8636 if(!options['width']){ 8637 options['width'] = 'content'; 8638 } 8639 if(!options['height']){ 8640 options['height'] = 'content'; 8641 } 8642 } 8643 var heightTitle = 0; 8644 8645 if(elementCurrent && elementCurrent.getAttribute('title') && elementCurrent.getAttribute('title') != ''){ 8646 jQuery('.wLightboxTitle').show().html(elementCurrent.getAttribute('title')); 8647 } 8648 else{ 8649 jQuery('.wLightboxTitle').hide(); 8650 } 8651 8652 heightTitle = jQuery('.wLightboxTitle').outerHeight(); 8653 8654 var maxWidthBox = (window.innerWidth ? window.innerWidth : (document.documentElement ? document.documentElement.offsetWidth : document.body.clientWidth)) - (parseInt(j
8654Query('.wLightboxOuter').css('padding-left')) + parseInt(jQuery('.wLightboxInner').css('border-left-width'))) * 2; 8655 var maxHeightBox = (window.innerHeight ? window.innerHeight : (document.documentElement ? document.documentElement.offsetHeight : document.body.clientHeight)) - (parseInt(jQuery('.wLightboxOuter').css('padding-top')) + parseInt(jQuery('.wLightboxInner').css('border-top-width'))) * 2 - heightTitle; 8656 8657 if(/^(\d+)px$/.test(options['width'])){ 8658 maxWidthBox = parseInt(RegExp.$1); 8659 } 8660 else if(/^(\d+)%$/.test(options['width'])){ 8661 maxWidthBox = parseInt(jQuery(window).width()) * RegExp.$1 / 100; 8662 } 8663 8664 if(/^(\d+)px$/.test(options['height'])){ 8665 maxHeightBox = parseInt(RegExp.$1); 8666 } 8667 else if(/^(\d+)%$/.test(options['height'])){ 8668 maxHeightBox = parseInt(jQuery(window).height()) * RegExp.$1 / 100; 8669 } 8670 8671 contentWidth = options && options['width'] && /^\d+(.\d+)?$/.test(options['width']) ? options['width'] : maxWidthBox; 8672 contentHeight = options && options['height'] && /^\d+(.\d+)?$/.test(options['height']) ? options['height'] : contentHeight = maxHeightBox; 8673 8674 var pageRatio = maxWidthBox / maxHeightBox; 8675 var contentRatio = contentWidth / contentHeight; 8676 var lightboxWidth = contentWidth; 8677 var lightboxHeight = contentHeight + heightTitle; 8678 8679 if(contentWidth > maxWidthBox || contentHeight > maxHeightBox){ 8680 if(contentRatio > pageRatio){ 8681 lightboxWidth = maxWidthBox; 8682 lightboxHeight = Math.round(maxWidthBox / contentRatio) + heightTitle; 8683 } 8684 else{ 8685 lightboxWidth = Math.round(maxHeightBox * contentRatio); 8686 lightboxHeight = maxHeightBox + heightTitle; 8687 } 8688 } 8689 8690 widthAttrib = String(lightboxWidth) + 'px'; 8691 heightAttrib = String(lightboxHeight) + 'px'; 8692 8693 if(options['height'] == 'content'){ 8694 jQuery('.wLightboxOuter').css({'max-height' : '100%'}); 8695 } 8696 else{ 8697 jQuery('.wLightboxOuter').css({'height' : heightAttrib}); 8698 } 8699 8700 if(options['width'] == 'content'){ 8701 jQuery('.wLightboxInner').css({'max-width' : '100%'}); 8702 } 8703 else{ 8704 jQuery('.wLightboxInner').css({'width' : widthAttrib}); 8705 } 8706 8707 jQuery('.wLightboxPrev').data('entry', positionRel - 2); 8708 jQuery('.wLightboxNext').data('entry', positionRel); 8709 8710 if(boxWasOpened){ 8711 jQuery('.wLightboxMoverBack').attr('class', classPrev); 8712 jQuery('.wLightboxMoverForward').attr('class', classNext); 8713 jQuery('.wLightbox').addClass('wLightboxStatusLoaded').removeClass('wLightboxStatusLoading'); 8714 } 8715 else{ 8716 jQuery('.wLightbox').addClass('wLightboxStatusLoaded').removeClass('wLightboxStatusLoading'); 8717 jQuery('.wLightboxInner').on('click touchend', function(event){ 8718 event.stopPropagation(); 8719 }); 8720 jQuery('.wLightboxCloser, .wLightboxOuter').on('click touchend', function(event){ 8721 if(jQuery(event.target).hasClass('wLightboxBackground') && options['closeOnClickBackground'] === false){ 8722 return false; 8723 } 8724 wLightboxClose(event); 8725 }); 8726 jQuery('.wLightboxMoverBack, .wLightboxMoverForward').on('click', function(event){ 8727 jQuery('.wLightbox').removeClass('wLightboxStatusLoaded').addClass('wLightboxStatusLoading'); 8728 jQuery(elementsRel[jQuery(this).data('entry')]).trigger('click'); 8729 event.stopPropagation(); 8730 }); 8731 } 8732 8733 if(options['type'] == 'ajax'){ 8734 jQuery.ajax({type: "GET", url: src, success: function(result){ 8735 jQuery('.wLightboxCloser').after('<div class="wLightboxContent">' + result + '</div>'); 8736 if(options['height'] == 'content'){ 8737 jQuery('.wLightboxContent').css({'max-height' : String(lightboxHeight) + 'px'}); 8738 } 8739 }}); 8740 } 8741 } 8742 else if(lightboxType == 'image'){ 8743 var image = new Image(); 8744 image.onload = function(){ 8745 window.setTimeout(function(){ 8746 if(false && /\.(svg)$/i.test(srcOrig)){ 8747 } 8748 else{ 8749 var imageRatio = image.width / image.height; 8750 var lightboxWidth = image.width; 8751 var lightboxHeight = image.height; 8752 var lEInner = jQuery('.wLightboxInner'); 8753 var lEOuter = jQuery('.wLightboxOuter'); 8754 var lETitle = jQuery('.wLightboxTitle'); 8755 8756 var widthInnerBefore = 0; 8757 var heightInnerBefore = 0; 8758 var widthInnerCurrent = 0; 8759 var heightInnerCurrent= 0; 8760 var widthImageBefore = 0; 8761 var heightImageBefore = 0; 8762 var diffWidthInner = 0; 8763 var diffHeightInner = 0; 8764 8765 widthInnerBefore = lEInner.width(); 8766 heightInnerBefore = lEInner.height(); 8767 widthInnerCurrent = lEInner.width(); 8768 heightInnerCurrent = lEInner.height(); 8769 widthImageBefore = jQuery('.wLightboxImage').width(); 8770 heightImageBefore = jQuery('.wLightboxImage').height(); 8771 8772 lEInner.css({'width' : 'auto', 'height' : 'auto', 'max-height' : 'none', 'opacity' : '1'}); 8773 8774 var widthArea = lEOuter.width(); 8775 var heightArea = lEOuter.height(); 8776 8777 if(/^(\d+)px$/.test(options['width'])){ 8778 widthArea = widthArea < parseInt(RegExp.$1) ? widthArea : parseInt(RegExp.$1); 8779 } 8780 else if(/^(\d+)%$/.test(options['width'])){
8781 widthArea = widthArea < parseInt(jQuery(window).width()) * RegExp.$1 / 100 ? widthArea : parseInt(jQuery(window).width()) * RegExp.$1 / 100; 8782 } 8783 8784 var computedStyle = window.getComputedStyle(lEInner.get(0)); 8785 8786 widthArea = parseInt(computedStyle['max-width']) < widthArea ? parseInt(computedStyle['max-width']) : widthArea; 8787 heightArea = parseInt(computedStyle['max-height']) < heightArea ? parseInt(computedStyle['max-height']) : heightArea; 8788 8789 widthArea -= (lEInner.outerWidth() - lEInner.width()); 8790 heightArea -= (lEInner.outerHeight() - lEInner.height()); 8791 8792 jQuery('.wLightboxFooter').css({'max-width' : String(lEInner.width()) + 'px'}); 8793 8794 var areaRatio = widthArea / heightArea; 8795 8796 if(elementCurrent && elementCurrent.getAttribute('data-title') && elementCurrent.getAttribute('data-title') != ''){ 8797 lETitle.show().html(elementCurrent.getAttribute('data-title')); 8798 } 8799 else if(elementCurrent && elementCurrent.getAttribute('title') && elementCurrent.getAttribute('title') != ''){ 8800 lETitle.show().html(elementCurrent.getAttribute('title')); 8801 } 8802 else{ 8803 lETitle.hide(); 8804 } 8805 8806 if(elementCurrent && elementCurrent.getAttribute('data-description') != ''){ 8807 jQuery('.wLightboxDescription').show(); 8808 var diffWidthDescription = parseInt(jQuery('.wLightboxInner').width() - jQuery('.wLightboxDescription').width()); 8809 jQuery('.wLightboxDescription').css({'width' : widthArea - diffWidthDescription, 'visibility' : 'hidden'}).show().html(elementCurrent.getAttribute('data-description')); 8810 } 8811 else{ 8812 jQuery('.wLightboxDescription').hide(); 8813 } 8814 8815 if(wLightboxVariants[options['variant']] && wLightboxVariants[options['variant']]['addCopyrightElement'] && options['copyrightText']){ 8816 if(jQuery('.wLightboxCopyright').length == 0){ 8817 jQuery('.wLightboxImageOuter').append('<div class="wLightboxCopyright"/>'); 8818 } 8819 jQuery('.wLightboxCopyright').show(); 8820 jQuery('.wLightboxCopyright').html(options['copyrightText']); 8821 } 8822 else{ 8823 jQuery('.wLightboxCopyright').hide(); 8824 } 8825 8826 if(objectCurrent && objectCurrent.attr('data-lightboxdownloadable') == '1'){ 8827 jQuery('.wLightboxDownload').remove(); 8828 var srcDownload = src; 8829 if(objectCurrent.attr('data-srcdownload')){ 8830 srcDownload = objectCurrent.attr('data-srcdownload'); 8831 } 8832 jQuery('.wLightboxFooter').addClass('wLightboxFooterHasDownload').append('<div class="wLightboxDownload" data-src="' + srcDownload + '" title="Download"></div>'); 8833 jQuery('.wLightboxDownload').on('click', function (event){ 8834 window.open(jQuery(this).data('src')); 8835 }); 8836 } 8837 else{ 8838 jQuery('.wLightboxFooter').removeClass('wLightboxFooterHasDownload'); 8839 } 8840 8841 jQuery('.wLightboxDescription').css({'width' : '', 'height' : '', 'max-height' : '', 'visibility' : ''}); 8842 if(lEInner.height() >= jQuery(window).height()){ 8843 jQuery('.wLightboxDescription').css({'max-height' : '200px', 'overflow-y' : 'auto'}); 8844 } 8845 heightFooter = jQuery('.wLightboxFooter').outerHeight(); 8846 diffHeight = lEInner.outerHeight() - lEInner.height(); 8847 8848 if(image.width > widthArea || image.height > heightArea){ 8849 if(imageRatio > areaRatio){ 8850 lightboxWidth = widthArea; 8851 lightboxHeight = Math.round(widthArea / imageRatio) + heightFooter; 8852 } 8853 else{ 8854 lightboxWidth = Math.round((heightArea - heightFooter) * imageRatio); 8855 lightboxHeight = heightArea; 8856 } 8857 lEInner.css({'width' : String(lightboxWidth) + 'px', 'height' : String(lightboxHeight) + 'px', 'max-height' : String(lightboxHeight + diffHeight) + 'px'}); 8858 } 8859 else{ 8860 lightboxWidth = image.width; 8861 lightboxHeight = image.height + heightFooter; 8862 lEInner.css({'width' : String(lightboxWidth) + 'px', 'height' : String(lightboxHeight) + 'px', 'max-height' : String(lightboxHeight + diffHeight) + 'px'}); 8863 } 8864 8865 heightFooter = jQuery('.wLightboxFooter').outerHeight(); 8866 8867 var widthArea = lEOuter.width(); 8868 var heightArea = lEOuter.height(); 8869 widthInnerCurrent = lEInner.width(); 8870 heightInnerCurrent = lEInner.height(); 8871 8872 if(/^(\d+)px$/.test(options['width'])){ 8873 widthArea = widthArea < parseInt(RegExp.$1) ? widthArea : parseInt(RegExp.$1); 8874 } 8875 else if(/^(\d+)%$/.test(options['width'])){
8876 widthArea = widthArea < parseInt(jQuery(window).width()) * RegExp.$1 / 100 ? widthArea : parseInt(jQuery(window).width()) * RegExp.$1 / 100; 8877 } 8878 8879 try{ 8880 var computedStyle = window.getComputedStyle(lEInner.get(0)); 8881 8882 widthArea = parseInt(computedStyle['max-width']) < widthArea ? parseInt(computedStyle['max-width']) : widthArea; 8883 heightArea = parseInt(computedStyle['max-height']) < heightArea ? parseInt(computedStyle['max-height']) : heightArea; 8884 8885 widthArea -= (lEInner.outerWidth() - lEInner.width()); 8886 heightArea -= (lEInner.outerHeight() - lEInner.height()); 8887 8888 var areaRatio = widthArea / heightArea; 8889 if(image.width > widthArea || image.height > heightArea){ 8890 if(imageRatio > areaRatio){ 8891 lightboxWidth = widthArea; 8892 lightboxHeight = Math.round(widthArea / imageRatio) + heightFooter; 8893 } 8894 else{ 8895 lightboxWidth = Math.round((heightArea - heightFooter) * imageRatio); 8896 lightboxHeight = heightArea; 8897 } 8898 lEInner.css({'width' : String(lightboxWidth) + 'px', 'height' : String(lightboxHeight) + 'px', 'max-height' : String(lightboxHeight + diffHeight) + 'px'}); 8899 } 8900 else{ 8901 lightboxHeight = image.height + heightFooter; 8902 } 8903 }catch(e){} 8904 8905 jQuery('.wLightboxMoverBack').data('entry', positionRel - 2); 8906 jQuery('.wLightboxMoverForward').data('entry', positionRel); 8907 8908 lEInner.on('transitionend', function(event){ 8909 if(lEInner.data('transisionended') != '1'){ 8910 lEInner.data('transisionended', '1'); 8911 8912 heightFooter = jQuery('.wLightboxFooter').outerHeight(); 8913 8914 var widthArea = jQuery('.wLightboxOuter').width(); 8915 var heightArea = jQuery('.wLightboxOuter').height(); 8916 8917 if(/^(\d+)px$/.test(options['width'])){ 8918 widthArea = widthArea < parseInt(RegExp.$1) ? widthArea : parseInt(RegExp.$1); 8919 } 8920 else if(/^(\d+)%$/.test(options['width'])){ 8921 widthArea = widthArea < parseInt(jQuery(window).width()) * RegExp.$1 / 100 ? widthArea : parseInt(jQuery(window).width()) * RegExp.$1 / 100; 8922 } 8923 8924 var computedStyle = window.getComputedStyle(lEInner.get(0)); 8925 8926 widthArea = parseInt(computedStyle['max-width']) < widthArea ? parseInt(computedStyle['max-width']) : widthArea; 8927 heightArea = parseInt(computedStyle['max-height']) < heightArea ? parseInt(computedStyle['max-height']) : heightArea; 8928 8929 widthArea -= (lEInner.outerWidth() - lEInner.width()); 8930 heightArea -= (lEInner.outerHeight() - lEInner.height()); 8931 8932 var areaRatio = widthArea / heightArea; 8933 8934 if(image.width > widthArea || image.height > heightArea){ 8935 if(imageRatio > areaRatio){ 8936 lightboxWidth = widthArea; 8937 lightboxHeight = Math.round(widthArea / imageRatio) + heightFooter; 8938 } 8939 else{ 8940 lightboxWidth = Math.round((heightArea - heightFooter) * imageRatio); 8941 lightboxHeight = heightArea; 8942 } 8943 lEInner.css({'width' : String(lightboxWidth) + 'px', 'height' : String(lightboxHeight) + 'px', 'max-height' : String(lightboxHeight + diffHeight) + 'px'}); 8944 } 8945 else{ 8946 lightboxHeight = image.height + heightFooter; 8947 } 8948 } 8949 }); 8950 } 8951 8952 if(boxWasOpened){ 8953 jQuery('.wLightboxMoverBack').attr('class', classPrev); 8954 jQuery('.wLightboxMoverForward').attr('class', classNext); 8955 8956 var animationOverflow = typeof wLightboxVariants[options['variant']]['animationOverflow'] !== 'undefined' ? wLightboxVariants[options['variant']]['animationOverflow'] : 'hidden'; 8957 var animationDistFactorDefault = 120; 8958 var animationDurationDefault = 600; 8959 var animationEasingDefault = 'linear'; 8960 8961 var animationDistFactorIn = typeof wLightboxVariants[options['variant']]['animationDistFactor'] !== 'undefined' ? (typeof wLightboxVariants[options['variant']]['animationDistFactorIn'] !== 'undefined' ? wLightboxVariants[options['variant']]['animationDistFactorIn'] : wLightboxVariants[options['variant']]['animationDistFactor']) : animationDistFactorDefault; 8962 var animationDistFactorOut = typeof wLightboxVariants[options['variant']]['animationDistFactor'] !== 'undefined' ? (typeof wLightboxVariants[options['variant']]['animationDistFactorOut'] !== 'undefined' ? wLightboxVariants[options['variant']]['animationDistFactorOut'] : wLightboxVariants[options['variant']]['animationDistFactor']) : animationDistFactorDefault; 8963 var animationDurationIn = typeof wLightboxVariants[options['variant']]['animationDuration'] !== 'undefined' ? (typeof wLightboxVariants[options['variant']]['animationDurationIn'] !== 'undefined' ? wLightboxVariants[options['variant']]['animationDurationIn'] : wLightboxVariants[options['variant']]['animationDuration']) : animationDurationDefault; 8964 var animationDurationOut = typeof wLightboxVariants[options['variant']]['animationDuration'] !== 'undefined' ? (typeof wLightboxVariants[options['variant']]['animationDurationOut'] !== 'undefined' ? wLightboxVariants[options['variant']]['animationDurationOut'] : wLightboxVariants[options['variant']]['animationDuration']) : animationDurationDefault; 8965 var animationEasingIn = typeof wLightboxVariants[options['variant']]['animationEasing'] !== 'undefined' ? (typeof wLightboxVariants[options['variant']]['animationEasingIn'] !== 'undefined' ? wLightboxVariants[options['variant']]['animationEasingIn'] : wLightboxVariants[options['variant']]['animationEasing']) : animationEasingDefault; 8966 var animationEasingOut = typeof wLightboxVariants[options['variant']]['animationEasing'] !== 'undefined' ? (typeof wLightboxVariants[options['variant']]['animationEasingOut'] !== 'undefined' ? wLightboxVariants[options['variant']]['animationEasingOut'] : wLightboxVariants[options['variant']]['animationEasing']) : animationEasingDefault; 8967 8968 var lastDirection = jQuery('.wLightbox').attr('data-lastdirection'); 8969 var animation = wLightboxVariants[options['variant']]['animation'] ? wLightboxVariants[options['variant']]['animation'].toLowerCase() : ''; 8970 8971 if(animation == 'slidefrombeside'){ 8972 animation = lastDirection == 'back' ? 'slidefromleft' : 'slidefromright'; 8973 } 8974 else if(animation == 'overlapfrombeside'){ 8975 animation = lastDirection == 'back' ? 'overlapfromleft' : 'overlapfromright'; 8976 } 8977 else if(animation == 'slideout'){ 8978 animation = lastDirection == 'back' ? 'slideoutright' : 'slideoutleft'; 8979 } 8980 8981 diffWidthInner = Math.round((widthInnerBefore - lEInner.width()) * 1000) / 1000; 8982 diffHeightInner = Math.round((heightInnerBefore - lEInner.height()) * 1000) / 1000; 8983 8984 if(animation == 'fadein'){ 8985 8986 if(jQuery('.wLightboxInner').data('entryactive') == '1'){ 8987 return; 8988 } 8989 8990 jQuery('.wLightboxInner').data('entryactive', '1'); 8991 8992 if(animationOverflow == 'visible'){ 8993 animationDistFactorDefault = 150; 8994 animationDurationDefault = 600; 8995 animationEasingDefault = 'wEaseOut'; 8996 jQuery('.wLightboxInner').css({'overflow' : 'visible'}); 8997 } 8998 8999 var lightboxImageNew = jQuery('.wLightboxImage').attr('id', 'wLightboxImageCurrent').clone(); 9000 var widthBefore = widthImageBefore > 0 ? widthImageBefore : jQuery('#wLightboxImageCurrent').width(); 9001 var heightBefore = heightImageBefore > 0 ? heightImageBefore : jQuery('#wLightboxImageCurrent').height(); 9002
9003 var diffMarginLeft = String(-diffWidthInner / 2) + 'px'; 9004 var diffMarginTop = String(-diffHeightInner / 2) + 'px'; 9005 9006 if(widthInnerBefore > widthInnerCurrent + 1){ 9007 animationDistFactorOut = animationDistFactorOut * widthInnerBefore / widthInnerCurrent; 9008 } 9009 9010 lightboxImageNew.attr('id', 'wLightboxImageNew').attr('src', src).attr('alt', alt).css({'z-index' : '1', 'position' : 'relative', 'opacity' : '0'}).insertBefore("#wLightboxImageCurrent"); 9011 var heightNew = lightboxImageNew.height(); 9012 var leftCurrent = diffMarginLeft; 9013 var topCurrent = diffMarginTop; 9014 jQuery('#wLightboxImageCurrent').css({'z-index' : '0', position : 'absolute', width : widthBefore, height : heightBefore, top : topCurrent, 'margin-left' : leftCurrent, 'max-height' : 'none', 'max-width' : 'none'}); 9015 jQuery('#wLightboxImageCurrent').animate({'opacity': '0.5'}, {duration : animationDurationIn, easing : animationEasingIn, complete : function(){ 9016 jQuery('.wLightboxInner').data('entryactive', ''); 9017 jQuery('#wLightboxImageNew').attr('id', ''); 9018 jQuery('#wLightboxImageCurrent').remove(); 9019 }}); 9020 lightboxImageNew.animate({'opacity': '1'}, {duration : animationDurationOut, easing : animationEasingOut, complete : function(){}}); 9021 } 9022 else if(animation == 'slideoutleft' ||Â animation == 'slideoutright'){ 9023 9024 if(jQuery('.wLightboxInner').data('entryactive') == '1'){ 9025 return; 9026 } 9027 9028 jQuery('.wLightboxInner').data('entryactive', '1'); 9029 9030 if(animationOverflow == 'visible'){ 9031 animationDistFactorDefault = 150; 9032 animationDurationDefault = 600; 9033 animationEasingDefault = 'wEaseOut'; 9034 jQuery('.wLightboxInner').css({'overflow' : 'visible'}); 9035 } 9036 9037 var lightboxImageNew = jQuery('.wLightboxImage').attr('id', 'wLightboxImageCurrent').clone(); 9038 var widthBefore = widthImageBefore > 0 ? widthImageBefore : jQuery('#wLightboxImageCurrent').width(); 9039 var heightBefore = heightImageBefore > 0 ? heightImageBefore : jQuery('#wLightboxImageCurrent').height(); 9040 9041 var diffMarginLeft = String(-diffWidthInner / 2) + 'px'; 9042 var diffMarginTop = String(-diffHeightInner / 2) + 'px'; 9043 9044 if(widthInnerBefore > widthInnerCurrent + 1){ 9045 animationDistFactorOut = animationDistFactorOut * widthInnerBefore / widthInnerCurrent; 9046 } 9047 9048 var marginLeftInit = String(animationDistFactorIn) + '%'; 9049 var marginLeftCurrentOut = '-' + String(animationDistFactorOut) + '%'; 9050 9051 if(animation == 'slideoutleft'){ 9052 marginLeftInit = 'calc(' + String(animationDistFactorIn) + '% + ' + String(diffWidthInner / 2) + 'px)'; 9053 } 9054 else{ 9055 marginLeftInit = 'calc(-' + String(animationDistFactorIn) + '% ' + ' - ' + ' ' + String(diffWidthInner / 2) + 'px)'; 9056 } 9057 9058 lightboxImageNew.attr('id', 'wLightboxImageNew').attr('src', src).attr('alt', alt).insertBefore("#wLightboxImageCurrent"); 9059 var heightNew = lightboxImageNew.height(); 9060 var leftCurrent = diffMarginLeft; 9061 var topCurrent = diffMarginTop; 9062 jQuery('#wLightboxImageCurrent').css({position : 'absolute', width : widthBefore, height : heightBefore, top : topCurrent, 'margin-left' : leftCurrent, 'max-height' : 'none', 'max-width' : 'none'}); 9063 jQuery('#wLightboxImageCurrent').animate({'left': (animation == 'slideoutleft' ? marginLeftCurrentOut : String(animationDistFactorOut) + '%')}, {duration : animationDurationIn, easing : animationEasingIn, complete : function(){ 9064 jQuery('.wLightboxInner').data('entryactive', ''); 9065 jQuery('#wLightboxImageNew').attr('id', ''); 9066 jQuery('#wLightboxImageCurrent').remove(); 9067 }}); 9068 //lightboxImageNew.animate({'margin-left': '0'}, {duration : animationDurationOut, easing : animationEasingOut, complete : function(){}}); 9069 } 9070 else if(animation == 'overlapfromleft' ||Â animation == 'overlapfromright'){ 9071 9072 if(jQuery('.wLightboxInner').data('entryactive') == '1'){ 9073 return; 9074 } 9075 9076 jQuery('.wLightboxInner').data('entryactive', '1'); 9077 9078 if(animationOverflow == 'visible'){ 9079 animationDistFactorDefault = 150; 9080 animationDurationDefault = 600; 9081 animationEasingDefault = 'wEaseOut'; 9082 jQuery('.wLightboxInner').css({'overflow' : 'visible'}); 9083 } 9084 9085 var lightboxImageNew = jQuery('.wLightboxImage').attr('id', 'wLightboxImageCurrent').clone(); 9086 var widthBefore = widthImageBefore > 0 ? widthImageBefore : jQuery('#wLightboxImageCurrent').width(); 9087 var heightBefore = heightImageBefore > 0 ? heightImageBefore : jQuery('#wLightboxImageCurrent').height(); 9088
9089 var diffMarginLeft = String(-diffWidthInner / 2) + 'px'; 9090 var diffMarginTop = String(-diffHeightInner / 2) + 'px'; 9091 9092 if(widthInnerBefore > widthInnerCurrent + 1){ 9093 animationDistFactorOut = animationDistFactorOut * widthInnerBefore / widthInnerCurrent; 9094 } 9095 9096 var marginLeftInit = String(animationDistFactorIn) + '%'; 9097 9098 if(animation == 'overlapfromright'){ 9099 marginLeftInit = 'calc(' + String(animationDistFactorIn) + '% + ' + String(diffWidthInner / 2) + 'px)'; 9100 } 9101 else{ 9102 marginLeftInit = 'calc(-' + String(animationDistFactorIn) + '% ' + ' - ' + ' ' + String(diffWidthInner / 2) + 'px)'; 9103 } 9104 9105 lightboxImageNew.attr('id', 'wLightboxImageNew').attr('src', src).attr('alt', alt).css({'z-index' : '1', 'position' : 'relative', 'margin-left' : marginLeftInit}).insertBefore("#wLightboxImageCurrent"); 9106 var heightNew = lightboxImageNew.height(); 9107 var leftCurrent = diffMarginLeft; 9108 var topCurrent = diffMarginTop; 9109 jQuery('#wLightboxImageCurrent').css({'z-index' : '0', position : 'absolute', width : widthBefore, height : heightBefore, top : topCurrent, 'margin-left' : leftCurrent, 'max-height' : 'none', 'max-width' : 'none'}); 9110 jQuery('#wLightboxImageCurrent').animate({'opacity': '0.5'}, {duration : animationDurationIn, easing : animationEasingIn, complete : function(){ 9111 jQuery('.wLightboxInner').data('entryactive', ''); 9112 jQuery('#wLightboxImageNew').attr('id', ''); 9113 jQuery('#wLightboxImageCurrent').remove(); 9114 }}); 9115 lightboxImageNew.animate({'margin-left': '0'}, {duration : animationDurationOut, easing : animationEasingOut, complete : function(){}}); 9116 } 9117 else if(animation == 'slidefromright' ||Â animation == 'slidefromleft'){ 9118 9119 if(jQuery('.wLightboxInner').data('entryactive') == '1'){ 9120 return; 9121 } 9122 9123 jQuery('.wLightboxInner').data('entryactive', '1'); 9124 9125 if(animationOverflow == 'visible'){ 9126 animationDistFactorDefault = 150; 9127 animationDurationDefault = 600; 9128 animationEasingDefault = 'wEaseOut'; 9129 jQuery('.wLightboxInner').css({'overflow' : 'visible'}); 9130 } 9131 9132 var lightboxImageNew = jQuery('.wLightboxImage').attr('id', 'wLightboxImageCurrent').clone(); 9133 var widthBefore = widthImageBefore > 0 ? widthImageBefore : jQuery('#wLightboxImageCurrent').width(); 9134 var heightBefore = heightImageBefore > 0 ? heightImageBefore : jQuery('#wLightboxImageCurrent').height(); 9135 9136 var diffMarginLeft = String(-diffWidthInner / 2) + 'px'; 9137 var diffMarginTop = String(-diffHeightInner / 2) + 'px'; 9138 9139 if(widthInnerBefore > widthInnerCurrent + 1){ 9140 animationDistFactorOut = animationDistFactorOut * widthInnerBefore / widthInnerCurrent; 9141 } 9142 9143 var marginLeftInit = String(animationDistFactorIn) + '%'; 9144 var marginLeftCurrentOut = '-' + String(animationDistFactorOut) + '%'; 9145 9146 if(animation == 'slidefromright'){ 9147 marginLeftInit = 'calc(' + String(animationDistFactorIn) + '% + ' + String(diffWidthInner / 2) + 'px)'; 9148 } 9149 else{ 9150 marginLeftInit = 'calc(-' + String(animationDistFactorIn) + '% ' + ' - ' + ' ' + String(diffWidthInner / 2) + 'px)'; 9151 } 9152 9153 lightboxImageNew.attr('id', 'wLightboxImageNew').attr('src', src).attr('alt', alt).css({'margin-left' : marginLeftInit}).insertBefore("#wLightboxImageCurrent"); 9154 var heightNew = lightboxImageNew.height(); 9155 var leftCurrent = diffMarginLeft; 9156 var topCurrent = diffMarginTop; 9157 jQuery('#wLightboxImageCurrent').css({position : 'absolute', width : widthBefore, height : heightBefore, top : topCurrent, 'margin-left' : leftCurrent, 'max-height' : 'none', 'max-width' : 'none'}); 9158 jQuery('#wLightboxImageCurrent').animate({'left': (animation == 'slidefromright' ? marginLeftCurrentOut : String(animationDistFactorOut) + '%')}, {duration : animationDurationIn, easing : animationEasingIn, complete : function(){ 9159 jQuery('.wLightboxInner').data('entryactive', ''); 9160 jQuery('#wLightboxImageNew').attr('id', ''); 9161 jQuery('#wLightboxImageCurrent').remove(); 9162 }}); 9163 lightboxImageNew.animate({'margin-left': '0'}, {duration : animationDurationOut, easing : animationEasingOut, complete : function(){}}); 9164 } 9165 else{ 9166 jQuery('.wLightboxImage').attr('src', src); 9167 } 9168 } 9169 else{ 9170 9171 var animation = wLightboxVariants[options['variant']]['animation'] ? wLightboxVariants[options['variant']]['animation'].toLowerCase() : ''; 9172 var allowTouchSlide = false;
9173 9174 if(animation == 'slidefrombeside' ||Â animation == 'slideout'){ 9175 if(wLightboxVariants[options['variant']]['allowTouchSlide'] !== false){ 9176 allowTouchSlide = true; 9177 } 9178 } 9179 else if(wLightboxVariants[options['variant']]['allowTouchSlide'] === true){ 9180 allowTouchSlide = true; 9181 } 9182 9183 if(allowTouchSlide){ 9184 9185 var sl = jQuery('.wLightboxOuter'); 9186 var slI = jQuery('.wLightboxInner'); 9187 9188 slI.on('touchstart', function(event){ 9189 wUiTmp['sltsx'] = typeof(event.originalEvent.touches) != 'undefined' ? event.originalEvent.touches[0].pageX : event.pageX; 9190 wUiTmp['sltsy'] = (typeof(event.originalEvent.touches) != 'undefined' ? event.originalEvent.touches[0].pageY : event.pageY) - jQuery(window).scrollTop(); 9191 }); 9192 9193 slI.on('touchmove', function(event){ 9194 if(!isNaN(wUiTmp['sltsx']) && !isNaN(wUiTmp['sltsy']) && wUiTmp['sltsx'] && wUiTmp['sltsy']){ 9195 wUiTmp['sltsxc'] = typeof(event.originalEvent.touches) != 'undefined' ? event.originalEvent.touches[0].pageX : event.pageX; 9196 wUiTmp['sltsyc'] = (typeof(event.originalEvent.touches) != 'undefined' ? event.originalEvent.touches[0].pageY : event.pageY) - jQuery(window).scrollTop(); 9197 wUiTmp['sltdx'] = wUiTmp['sltsxc'] - wUiTmp['sltsx']; 9198 wUiTmp['sltdy'] = wUiTmp['sltsyc'] - wUiTmp['sltsy']; 9199 wUiTmp['sltdxp'] = Math.sqrt(Math.pow(parseInt(wUiTmp['sltdx']), 2)); 9200 wUiTmp['sltdyp'] = Math.sqrt(Math.pow(parseInt(wUiTmp['sltdy']), 2)); 9201 9202 if(sl.attr('data-moving') != '1' && wUiTmp['sltdxp'] > 10 && wUiTmp['sltdxp'] / wUiTmp['sltdyp'] > 1.4){ 9203 if(wUiTmp['sltdx'] > 0){ 9204 wUiTmp['sltsx'] = null; 9205 wUiTmp['sltsy'] = null; 9206 jQuery('.wLightboxMoverBackAvailable').trigger('click'); 9207 } 9208 else if(wUiTmp['sltdx'] < 0){ 9209 wUiTmp['sltsx'] = null; 9210 wUiTmp['sltsy'] = null; 9211 jQuery('.wLightboxMoverForwardAvailable').trigger('click'); 9212 } 9213 } 9214 } 9215 }); 9216 9217 slI.on('touchend', function(event){ 9218 wUiTmp['sltsx'] = null; 9219 wUiTmp['sltsy'] = null; 9220 }); 9221 } 9222 jQuery('.wLightboxOuter, .wLightboxBackground').on('click touchend', function(event){ 9223 if(jQuery(event.target).hasClass('wLightboxBackground') && options['closeOnClickBackground'] === false){ 9224 return false; 9225 } 9226 wLightboxClose(event); 9227 }); 9228 jQuery('.wLightboxInner').on('click touchend', function(event){ 9229 event.stopPropagation(); 9230 }); 9231 jQuery('.wLightboxMoverBack, .wLightboxMoverForward').on('click', function(event){ 9232 var lastDirection = event.target.closest('.wLightboxMoverBack') ? 'back' : 'next'; 9233 9234 jQuery('.wLightbox').attr('data-lastdirection', lastDirection); 9235 9236 jQuery('.wLightbox').removeClass('wLightboxStatusLoaded').addClass('wLightboxStatusLoading'); 9237 9238 if(event.originalEvent && event.originalEvent.isTrusted){ 9239 if(jQuery('.wLightboxPlayer').length != 0 && jQuery('#wLightbox').attr('data-playerstatus') == 'play'){ 9240 jQuery('.wLightboxPlayer').trigger('click'); 9241 } 9242 9243 if(elementsRel[jQuery('.wLightboxMoverForward').data('entry') + 1]){ 9244 var imgPreload = new Image(); 9245 imgPreload.src = elementsRel[jQuery('.wLightboxMoverForward').data('entry') + 1].getAttribute('data-src'); 9246 } 9247 } 9248 jQuery(elementsRel[jQuery(this).data('entry')]).trigger('click'); 9249 event.stopPropagation(); 9250 }); 9251 } 9252 9253 jQuery('.wLightbox').addClass('wLightboxStatusLoaded').removeClass('wLightboxStatusLoading').removeClass('wLightboxStatusChanging'); 9254 9255 if(typeof(wOnAfterInitLightbox) === 'function'){ 9256 wOnAfterInitLightbox(objectCurrent, elementsRel); 9257 } 9258 }, 32); 9259 }; 9260 image.src = src; 9261 } 9262 else if(lightboxType == 'video'){ 9263 9264 var videoWidth = 0, videoHeight = 0, videoRatio = 0; 9265 9266 if(elementCurrent && elementCurrent.getAttribute('title') && elementCurrent.getAttribute('title') != ''){ 9267 jQuery('.wLightboxTitle').show().html(elementCurrent.getAttribute('title')); 9268 } 9269 else{ 9270 jQuery('.wLightboxTitle').hide(); 9271 } 9272 9273 if(objectCurrent && objectCurrent.attr('data-lightboxdownloadable') == '1'){ 9274 jQuery('.wLightboxDownload').remove(); 9275 jQuery('.wLightboxFooter').addClass('wLightboxFooterHasDownload').append('<div class="wLightboxDownload" data-src="' + src + '" title="Download"></div>'); 9276 jQuery('.wLightboxDownload').on('click', function (event){ 9277 window.open(jQuery(this).data('src')); 9278 }); 9279 } 9280 else{ 9281 jQuery('.wLightboxFooter').removeClass('wLightboxFooterHasDownload'); 9282 } 9283 9284 var heightFooter = jQuery('.wLightboxFooter').outerHeight(); 9285 9286 var maxWidthBox = (window.innerWidth ? window.innerWidth : (document.documentElement ? document.documentElement.offsetWidth : document.body.clientWidth)) - (parseInt(j
9286Query('.wLightboxOuter').css('padding-left')) + parseInt(jQuery('.wLightboxInner').css('border-left-width'))) * 2; 9287 var maxHeightBox = (window.innerHeight ? window.innerHeight : (document.documentElement ? document.documentElement.offsetHeight : document.body.clientHeight)) - (parseInt(jQuery('.wLightboxOuter').css('padding-top')) + parseInt(jQuery('.wLightboxInner').css('border-top-width'))) * 2 - heightFooter; 9288 9289 if(/^(\d+)px$/.test(options['width'])){ 9290 maxWidthBox = parseInt(RegExp.$1); 9291 } 9292 else if(/^(\d+)%$/.test(options['width'])){ 9293 maxWidthBox = parseInt(jQuery(window).width()) * RegExp.$1 / 100; 9294 } 9295 9296 var pageRatio = maxWidthBox / maxHeightBox; 9297 9298 if(boxWasOpened){ 9299 jQuery('.wLightbox source').attr('src', src); 9300 jQuery('.wLightbox video').get(0).load(); 9301 } 9302 9303 jQuery('.wLightbox video').on('loadedmetadata', function(event){ 9304 videoWidth = jQuery(this).get(0).videoWidth; 9305 videoHeight = jQuery(this).get(0).videoHeight; 9306 9307 videoRatio = videoWidth / videoHeight; 9308 lightboxWidth = videoWidth; 9309 lightboxHeight = videoHeight; 9310 9311 if(videoWidth > maxWidthBox || videoHeight > maxHeightBox){ 9312 if(videoRatio > pageRatio){ 9313 lightboxWidth = maxWidthBox; 9314 lightboxHeight = Math.round(maxWidthBox / videoRatio) + heightFooter; 9315 } 9316 else if(videoHeight > maxHeightBox){ 9317 lightboxHeight = maxHeightBox - 32; 9318 lightboxWidth = Math.round(lightboxHeight * videoRatio); 9319 } 9320 else{ 9321 lightboxWidth = Math.round(maxHeightBox * videoRatio); 9322 lightboxHeight = maxHeightBox + heightFooter; 9323 } 9324 } 9325 else{ 9326 lightboxHeight = lightboxHeight + heightFooter; 9327 } 9328 9329 widthAttrib = String(lightboxWidth) + 'px'; 9330 heightAttrib = String(lightboxHeight) + 'px'; 9331 9332 jQuery('.wLightboxInner').css({'height' : heightAttrib}); 9333 jQuery('.wLightboxInner').css({'width' : widthAttrib}); 9334 9335 jQuery('.wLightboxMoverBack').data('entry', positionRel - 2); 9336 jQuery('.wLightboxMoverForward').data('entry', positionRel); 9337 9338 if(boxWasOpened){ 9339 jQuery('.wLightboxMoverBack').attr('class', classPrev); 9340 jQuery('.wLightboxMoverForward').attr('class', classNext); 9341 jQuery('.wLightbox').addClass('wLightboxStatusLoaded').removeClass('wLightboxStatusLoading'); 9342 } 9343 else{ 9344 jQuery('.wLightbox').addClass('wLightboxStatusLoaded').removeClass('wLightboxStatusLoading'); 9345 jQuery('.wLightboxOuter, .wLightboxBackground').on('click touchend', function(event){ 9346 if(jQuery(event.target).hasClass('wLightboxBackground') && options['closeOnClickBackground'] === false){ 9347 return false; 9348 } 9349 wLightboxClose(event); 9350 }); 9351 jQuery('.wLightboxInner').on('click touchend', function(event){ 9352 event.stopPropagation(); 9353 }); 9354 jQuery('.wLightboxMoverBack, .wLightboxMoverForward').on('click', function(event){ 9355 jQuery('.wLightbox').removeClass('wLightboxStatusLoaded').addClass('wLightboxStatusLoading'); 9356 jQuery(elementsRel[jQuery(this).data('entry')]).trigger('click'); 9357 event.stopPropagation(); 9358 }); 9359 } 9360 }); 9361 if(typeof(wOnAfterInitLightbox) === 'function'){ 9362 wOnAfterInitLightbox(); 9363 } 9364 } 9365 else{ 9366 9367 var heightTitle = 0; 9368 9369 if(elementCurrent && elementCurrent.getAttribute('title') != ''){ 9370 jQuery('.wLightboxTitle').show().html(elementCurrent.getAttribute('title')); 9371 } 9372 else{ 9373 jQuery('.wLightboxTitle').hide(); 9374 } 9375 9376 heightTitle = jQuery('.wLightboxTitle').outerHeight(); 9377 9378 var setSize = false; 9379 9380 var maxWidthBox = (window.innerWidth ? window.innerWidth : (document.documentElement ? document.documentElement.offsetWidth : document.body.clientWidth)) - (parseInt(jQuery('.wLightboxOuter').css('padding-left')) + parseInt(jQuery('.wLightboxInner').css('border-left-width'))) * 2; 9381 var maxHeightBox = (window.innerHeight ? window.innerHeight : (document.documentElement ? document.documentElement.offsetHeight : document.body.clientHeight)) - (parseInt(j
9381Query('.wLightboxOuter').css('padding-top')) + parseInt(jQuery('.wLightboxInner').css('border-top-width'))) * 2 - heightTitle; 9382 9383 if(/^(\d+)px$/.test(options['width'])){ 9384 maxWidthBox = parseInt(RegExp.$1); 9385 setSize = true; 9386 } 9387 else if(/^(\d+)%$/.test(options['width'])){ 9388 maxWidthBox = parseInt(jQuery(window).width()) * RegExp.$1 / 100; 9389 setSize = true; 9390 } 9391 9392 if(/^(\d+)px$/.test(options['height'])){ 9393 maxHeightBox = parseInt(RegExp.$1); 9394 setSize = true; 9395 } 9396 else if(/^(\d+)%$/.test(options['height'])){ 9397 maxHeightBox = parseInt(jQuery(window).height()) * RegExp.$1 / 100; 9398 setSize = true; 9399 } 9400 9401 if(options['width'] && /^\d+(.\d+)?$/.test(options['width'])){ 9402 contentWidth = options['width']; 9403 setSize = true; 9404 } 9405 else{ 9406 contentWidth = maxWidthBox; 9407 } 9408 9409 if(options['height'] && /^\d+(.\d+)?$/.test(options['height'])){ 9410 contentHeight = options['height']; 9411 setSize = true; 9412 } 9413 else{ 9414 contentHeight = maxHeightBox; 9415 } 9416 9417 if(setSize){ 9418 var pageRatio = maxWidthBox / maxHeightBox; 9419 var contentRatio = contentWidth / contentHeight; 9420 9421 var lightboxWidth = contentWidth; 9422 var lightboxHeight = contentHeight + heightTitle; 9423 9424 if(contentWidth > maxWidthBox || contentHeight > maxHeightBox){ 9425 if(contentRatio > pageRatio){ 9426 lightboxWidth = maxWidthBox; 9427 lightboxHeight = Math.round(maxWidthBox / contentRatio) + heightTitle; 9428 } 9429 else{ 9430 lightboxWidth = Math.round(maxHeightBox * contentRatio); 9431 lightboxHeight = maxHeightBox + heightTitle; 9432 } 9433 } 9434 9435 widthAttrib = String(lightboxWidth) + 'px'; 9436 heightAttrib = String(lightboxHeight) + 'px'; 9437 9438 jQuery('.wLightboxInner').css({'height' : heightAttrib}); 9439 jQuery('.wLightboxInner').css({'width' : widthAttrib}); 9440 } 9441 9442 jQuery('.wLightboxMoverBack').data('entry', positionRel - 2); 9443 jQuery('.wLightboxMoverForward').data('entry', positionRel); 9444 9445 if(boxWasOpened){ 9446 jQuery('.wLightboxMoverBack').attr('class', classPrev); 9447 jQuery('.wLightboxMoverForward').attr('class', classNext); 9448 jQuery('.wLightboxIframe').attr('src', src); 9449 } 9450 else{ 9451 jQuery('.wLightboxOuter, .wLightboxBackground').on('click touchend', function(event){ 9452 if(jQuery(event.target).hasClass('wLightboxBackground') && options['closeOnClickBackground'] === false){ 9453 return false; 9454 } 9455 wLightboxClose(event); 9456 }); 9457 jQuery('.wLightboxInner').on('click touchend', function(event){ 9458 event.stopPropagation(); 9459 }); 9460 jQuery('.wLightboxMoverBack, .wLightboxMoverForward').on('click', function(event){ 9461 jQuery('.wLightbox').removeClass('wLightboxStatusLoaded').addClass('wLightboxStatusLoading'); 9462 jQuery(elementsRel[jQuery(this).data('entry')]).trigger('click'); 9463 event.stopPropagation(); 9464 }); 9465 } 9466 9467 jQuery('.wLightbox').addClass('wLightboxStatusLoaded').removeClass('wLightboxStatusLoading').removeClass('wLightboxStatusChanging'); 9468 9469 if(typeof(wOnAfterInitLightbox) === 'function'){ 9470 wOnAfterInitLightbox(); 9471 } 9472 } 9473 9474 if(typeof(wOnAfterInitLightbox) === 'function'){ 9475 wOnAfterInitLightbox(); 9476 } 9477 jQuery('html').addClass('wglBox'); 9478 jQuery('body').addClass('wglBox'); 9479 9480 /*Barrierefreiheit Lightbox*/ 9481 if(typeof(wAccessibility) !== 'undefined' && wAccessibility['accessEventHandler'] != null && wAccessibility['accessEventHandler'].active && (lightboxType == 'iframe' || lightboxType == 'image' || lightboxType == 'video')){ 9482 aEKey = (lightboxType == 'iframe') ? 'wLightboxIframe' : (lightboxType == 'video' ? 'wLightboxVideo' : 'wLightbox'); 9483 var aEObject = Object.assign({}, wAccessEvents[aEKey], { 9484 element: jQuery('html.wglBox'), 9485 elementsRel: elementsRel, 9486 openedByElement: objectCurrent, 9487 }); 9488 wAccessHandler.addEvent(aEObject); 9489 } 9490 else{ 9491 jQuery('.wLightboxCloser, .wLightboxMoverBack, .wLightboxMoverForward').attr('tabindex', 0); 9492 lE.get(0).focus({preventScroll : true}); 9493 lE.attr('tabindex', 0); 9494 9495 jQuery('html.wglBox').on('keydown', function(e){ 9496 9497 var lE = jQuery('.wLightbox'); 9498 var cE = jQuery(e.target); 9499 var last = lE.find('[role=button]:visible:last'); 9500 var move = ''; 9501 var moveObject = { next : jQuery('.wLightboxMoverForward'), back : jQuery('.wLightboxMoverBack')}; 9502 9503 if(e.keyCode == 9 && (!jQuery(lE).is('#wLightbox') || !jQuery(cE).is('#wLightbox *') || last.length > 0 && cE.get(0) === last.get(0))){ 9504 lE.attr('tabindex', 0).focus(); 9505 } 9506 else if(e.keyCode == 39 || e.keyCode == 13 && cE.is('.wLightboxMoverForward')){ 9507 move = 'next'; 9508 } 9509 else if(e.keyCode == 37 || e.keyCode == 13 && cE.is('.wLightboxMoverBack')){ 9510 move = 'back'; 9511 } 9512 else if(e.keyCode == 27 || e.keyCode == 13 && cE.is('.wLightboxCloser')){ 9513 wLightboxClose(event); 9514 } 9515 9516 if(move != ''){ 9517 jQuery(elementsRel[parseInt(moveObject[move].data('entry'))]).trigger('click'); 9518 lE.attr('data-lastdirection', move); 9519 moveObject[move].focus(); 9520 } 9521 e.stopPropagation(); 9522 e.stopImmediatePropagation(); 9523 9524 }); 9525 } 9526 return false;
9527}; 9528 9529wLightboxClose = function(event){ 9530 9531 if(typeof event !== 'undefined'){ 9532 event.preventDefault(); 9533 event.stopPropagation(); 9534 } 9535 9536 if(typeof(wOnBeforeCloseLightbox) === 'function'){ 9537 if(wOnBeforeCloseLightbox(event) == false) { 9538 return; 9539 } 9540 } 9541 9542 var lE = jQuery('.wLightbox'); 9543 if(lE.length === 0){ 9544 return false; 9545 } 9546 var triggeredO = jQuery('html picture[data-src^="' + lE.attr('data-src').split('?')[0] + '"]'); 9547 if(triggeredO.length == 0) triggeredO = jQuery('html picture[data-href^="' + lE.attr('data-src').split('?')[0] + '"]'); 9548 if(triggeredO.length == 1) triggeredO.get(0).focus(); 9549 9550 lE.remove(); 9551 jQuery('html').removeClass('wglBox'); 9552 jQuery('body').removeClass('wglBox'); 9553 jQuery(document).off('keydown'); 9554 9555 if(typeof intervallLightboxPlayer != 'undefined'){ 9556 window.clearInterval(intervallLightboxPlayer); 9557 } 9558 9559 if(typeof(wOnAfterCloseLightbox) === 'function'){ 9560 wOnAfterCloseLightbox(event); 9561 } 9562}; 9563 9564wStartReadingText = function(element, readerPanelEmbed, options){ 9565 //console.log('wStartReadingText'); 9566 9567 var tmp = ''; 9568 var options = options || {}; 9569 9570 var elementsAll = document.querySelectorAll('*[data-hasconsideredreader="1"]'); 9571 for(var i = 0; i < elementsAll.length; i++){ 9572 elementsAll[i].removeAttribute('data-hasconsideredreader'); 9573 } 9574 9575 if(readerPanelEmbed && readerPanelEmbed.className.indexOf('wReaderPanelEmbed') != -1){ 9576 readerPanelEmbed.className = 'wReaderPanelEmbed isReading'; 9577 } 9578 else if(readerPanelEmbed && readerPanelEmbed.className.indexOf('wAiReader') != -1){ 9579 readerPanelEmbed.className = 'wAiReader isReading'; 9580 jQuery('.wAiReader .wAiReaderPauseReading').focus(); 9581 } 9582 9583 jQuery('html').addClass('isReading'); 9584 9585 var elementToReadRoot = element; 9586 var textOfElementToRead = ''; 9587 var elementsToReadAll = elementToReadRoot.querySelectorAll('*'); 9588 9589 for(var i = elementsToReadAll.length - 1; i >= 0; i--){ 9590 tmp = elementsToReadAll[i]; 9591 if(!(tmp.offsetWidth || tmp.offsetHeight || tmp.getClientRects().length)){ 9592 tmp.setAttribute('data-ignoreinreader', '1'); 9593 } 9594 if(tmp.elementName == 'SUP'){ 9595 tmp.setAttribute('data-unwrapinreader', '1'); 9596 } 9597 if(tmp.className && typeof tmp.className === 'string' && tmp.className.indexOf('wglButton') !== -1){ 9598 tmp.setAttribute('data-ignoreinreader', '1'); 9599 } 9600 9601 } 9602 9603 //var textToRead = (elementToReadRoot.getAttribute('data-readertextpre') ? elementToReadRoot.getAttribute('data-readertextpre') : '') + textOfElementToRead; 9604 9605 var elementsToReadAll = elementToReadRoot.querySelectorAll('*'); 9606 var elementsToRead = []; 9607 for(var i = 0; i < elementsToReadAll.length; i++){ 9608 tmp = elementsToReadAll[i]; 9609 var hasTextNodes = 0; 9610 for(var j = 0; j < tmp.childNodes.length; j++){ 9611 if(tmp.childNodes[j].nodeType == 3){ 9612 hasTextNodes = 1; 9613 break; 9614 } 9615 } 9616 if(/(wglButton)/.test(tmp.className)){ 9617 } 9618 else if(/(elementSection|elementBox|elementContainer|sectionInner|elementList|listDefault|listEntryInner)/.test(tmp.className)){ 9619 } 9620 else if(tmp.firstChild && /(element)/.test(tmp.firstChild.className)){ 9621 } 9622 else if(tmp.firstChild && tmp.firstChild == tmp.lastChild && tmp.firstChild.nodeType === 1){ 9623 } 9624 else if(tmp.nodeName == 'FIGURE' && !tmp.closest('*[data-hasconsideredreader="1"]') && tmp.getAttribute('data-ignoreinreader') != '1'){ 9625 if(jQuery(tmp).find('figcaption').length !== 0){ 9626 jQuery(tmp).find('figcaption > *:not([data-ignoreinreader=1])').each(function() { 9627 elementsToRead.push(this); 9628 }); 9629 } 9630 else{ 9631 elementsToRead.push(tmp); 9632 } 9633 } 9634 else if(tmp.nodeName == 'IMG' && !tmp.closest('*[data-hasconsideredreader="1"]') && tmp.getAttribute('data-ignoreinreader') != '1'){ 9635 elementsToRead.push(tmp); 9636 } 9637 else if(hasTextNodes && !tmp.closest('*[data-hasconsideredreader="1"]') && tmp.getAttribute('data-ignoreinreader') != '1'){ 9638 elementsToRead.push(tmp); 9639 tmp.setAttribute('data-hasconsideredreader', '1'); 9640 } 9641 } 9642 9643 for(var i = 0; i < elementsToRead.length; i++){ 9644 if(!jQuery(elementsToRead[i]).attr('data-read-pos')){ 9645 jQuery(elementsToRead[i]).on('click', function(){ 9646 wReadTextElementPos(jQuery(this).attr('data-read-pos')); 9647 }); 9648 } 9649 jQuery(elementsToRead[i]).addClass('wglElementCanBeRead').attr('data-read-pos', String(i)); 9650 } 9651 9652 wUiTmp['readerPanelEmbed'] = readerPanelEmbed; 9653 wUiTmp['elementsToReadStack'] = elementsToRead; 9654 9655 //for(var i = elementsToReadAll.length - 1; i >= 0; i--){ 9656 // tmp = elementsToReadAll[i]; 9657 //} 9658 9659 wUiTmp['elementsToReadStackOptions'] = options; 9660 9661 wReadTextElementNext(); 9662}; 9663 9664wReadTextElementPos = function(position){ 9665 //console.log('wReadTextElementPos(' + position + ')'); 9666 9667 readerPanelEmbed = wUiTmp['readerPanelEmbed']; 9668 9669 if(readerPanelEmbed && readerPanelEmbed.className.indexOf('wReaderPanelEmbed') != -1){ 9670 readerPanelEmbed.className = 'wReaderPanelEmbed isReading'; 9671 } 9672 else if(readerPanelEmbed && readerPanelEmbed.className.indexOf('wAiReader') != -1){ 9673 readerPanelEmbed.className = 'wAiReader isReading'; 9674 jQuery('.wAiReader .wAiReaderPauseReading').focus(); 9675 } 9676 9677 jQuery('.wglElementIsBeingRead').removeClass('wglElementIsBeingRead'); 9678 9679 if(wUiTmp['elementsToReadStack']){ 9680 var options = wUiTmp['elementsToReadStackOptions']; 9681 9682 wUiTmp['elementsToReadStackPosition'] = parseInt(position); 9683 9684 if(wUiTmp['elementsToReadStackPosition'] < wUiTmp['elementsToReadStack'].length){ 9685 jQuery('.wglTextIsBeingRead').removeClass('wglTextIsBeingRead'); 9686 9687 if(window.speechSynthesis && window.speechSynthesis.speaking){ 9688 window.speechSynthesis.cancel(); 9689 } 9690 wUiTmp['forceElementReader'] = true; 9691 window.setTimeout(function(){ 9692 wUiTmp['forceElementReader'] = false;
9693 wReadTextOfElement(wUiTmp['elementsToReadStack'][wUiTmp['elementsToReadStackPosition']], options); 9694 }, 800); 9695 } 9696 } 9697}; 9698 9699wReadTextElementNext = function(){ 9700 //console.log('wReadTextElementNext'); 9701 9702 jQuery('.wglElementIsBeingRead').removeClass('wglElementIsBeingRead'); 9703 9704 if(wUiTmp['elementsToReadStack']){ 9705 var options = wUiTmp['elementsToReadStackOptions']; 9706 9707 if(window.speechSynthesis && window.speechSynthesis.paused){ 9708 } 9709 else{ 9710 wUiTmp['elementsToReadStackPosition'] = wUiTmp['elementsToReadStackPosition'] >= 0 ? wUiTmp['elementsToReadStackPosition'] + 1 : 0; 9711 } 9712 if(wUiTmp['elementsToReadStackPosition'] < wUiTmp['elementsToReadStack'].length){ 9713 wReadTextOfElement(wUiTmp['elementsToReadStack'][wUiTmp['elementsToReadStackPosition']], options); 9714 } 9715 else{ 9716 wUiTmp['elementsToReadStack'] = null; 9717 wUiTmp['elementsToReadStackPosition'] = -1; 9718 jQuery('.wglElementCanBeRead').removeClass('wglElementCanBeRead'); 9719 9720 readerPanelEmbed = wUiTmp['readerPanelEmbed']; 9721 9722 if(readerPanelEmbed && readerPanelEmbed.className.indexOf('wReaderPanelEmbed') != -1){ 9723 readerPanelEmbed.className = 'wReaderPanelEmbed'; 9724 } 9725 else if(readerPanelEmbed && readerPanelEmbed.className.indexOf('wAiReader') != -1){ 9726 readerPanelEmbed.className = 'wAiReader'; 9727 jQuery('.wAiReader .wAiReaderStartReading').focus(); 9728 } 9729 } 9730 } 9731}; 9732 9733wReadTextOfElement = function(element, options){ 9734 //console.log(element); 9735 9736 var textOfElementToRead = ''; 9737 var elementToRead = element.cloneNode(true); 9738 var lastElementToReadType = ''; 9739 9740 wUiTmp['lastElementToReadType'] = wUiTmp['lastElementToReadType'] ?? ''; 9741 wUiTmp['lastElementToReadText'] = wUiTmp['lastElementToReadText'] ?? ''; 9742 9743 if(elementToRead.getAttribute('data-ignoreinreader') == '1'){ 9744 //console.log('ignore'); 9745 } 9746 //else if(element.closest('*[data-hasconsideredreader="1"]')){ 9747 //console.log(element); 9748 //} 9749 else if(elementToRead.nodeName == 'IMG'){ 9750 var documentLang = document.documentElement.lang.toLowerCase(); 9751 documentLang = /^\w+$/.test(documentLang) ? documentLang + '-' + documentLang : documentLang; 9752 textOfElementToRead = (documentLang.substr(0, 2) == 'de' ? 'Bild: ' : '') + elementToRead.getAttribute('alt'); 9753 lastElementToReadType = 'img'; 9754 } 9755 else{ 9756 textOfElementToRead = elementToRead.innerHTML; 9757 lastElementToReadType = 'element'; 9758 9759 var strArray = textOfElementToRead.split(/<script[^>]*>/); 9760 if(strArray.length > 1){ 9761 var tmp = ''; 9762 for(var i = 0; i < strArray.length; i++){ 9763 //console.log(strArray[i].length); 9764 strArray[i] = strArray[i].replace(/[\s\S]*<\/script[^>]*>/, ''); 9765 tmp += strArray[i]; 9766 } 9767 textOfElementToRead = tmp; 9768 } 9769 9770 textOfElementToRead = textOfElementToRead.replace(/<sup>(®|©|â¢)<\/sup>/gi, ""); 9771 textOfElementToRead = textOfElementToRead.replace(/<img[^>]*alt="([^"]+)"[^>]*>/gi, "<p>\n$1\n</p>"); 9772 textOfElementToRead = textOfElementToRead.replace(/<\/?sup>/gi, ""); 9773 textOfElementToRead = textOfElementToRead.replace(/\n/gi, " "); 9774 textOfElementToRead = textOfElementToRead.replace(/&/gi, "&"); 9775 textOfElementToRead = textOfElementToRead.replace(/&(nbsp|lt|gt|quot|apos);/gi, " "); 9776 textOfElementToRead = textOfElementToRead.replace(/ +/gi, " "); 9777 textOfElementToRead = textOfElementToRead.replace(/<\/p>/gi, "\n\n"); 9778 textOfElementToRead = textOfElementToRead.replace(/(<div[^>]*class="element)/gi, "\n$1"); 9779 textOfElementToRead = textOfElementToRead.replace(/<\/div>/gi, "\n"); 9780 textOfElementToRead = textOfElementToRead.replace(/<[^>]*>/g, " "); 9781 textOfElementToRead = textOfElementToRead.replace(/ +/gi, " "); 9782 textOfElementToRead = textOfElementToRead.replace(/\n\s+\n/gi, "\n\n"); 9783 textOfElementToRead = textOfElementToRead.replace(/\n +/gi, "\n"); 9784 9785 textOfElementToRead = textOfElementToRead.trim(); 9786 } 9787 9788 //console.log(textOfElementToRead); 9789
9790 if(wUiTmp['lastElementToReadType'] === 'img'){ 9791 if(wUiTmp['lastElementToReadText'].replace(/^\w+\:/, '').trim() === textOfElementToRead.trim()){ 9792 textOfElementToRead = ''; 9793 } 9794 } 9795 9796 wUiTmp['lastElementToReadType'] = lastElementToReadType; 9797 wUiTmp['lastElementToReadText'] = textOfElementToRead; 9798 9799 if(textOfElementToRead != ''){ 9800 jQuery(element).addClass('wglElementIsBeingRead'); 9801 var scrollTopOffset = 80; 9802 var winHeight = window.innerHeight; 9803 var elementHeight = jQuery(element).height(); 9804 if(winHeight > 640){ 9805 if(winHeight > elementHeight + 160){ 9806 scrollTopOffset = parseInt((winHeight - elementHeight) / 2); 9807 } 9808 } 9809 wScrollSmoothToElement(element, {'scrollTopOffset' : scrollTopOffset}); 9810 wReadText(textOfElementToRead, options); 9811 } 9812 else{ 9813 if(wUiTmp['elementsToReadStack'].length > wUiTmp['elementsToReadStackPosition'] - 1){ 9814 if(!wUiTmp['forceElementReader']){ 9815 wReadTextElementNext(); 9816 } 9817 } 9818 } 9819}; 9820 9821wReadText = function(textToRead, options){ 9822 //console.log(textToRead); 9823 9824 if(window.speechSynthesis){ 9825 if(!window.speechSynthesis.speaking){ 9826 var textToSpeak = new SpeechSynthesisUtterance(textToRead); 9827 if(options['rate']){ 9828 textToSpeak.rate = options['rate']; 9829 } 9830 9831 var documentLang = document.documentElement.lang; 9832 if(documentLang != ''){ 9833 documentLang = /^\w+$/.test(documentLang) ? documentLang + '-' + documentLang : documentLang.toLowerCase(); 9834 documentLang = documentLang.replace('en-en', 'en-us'); 9835 textToSpeak.lang = documentLang; 9836 9837 var synth = window.speechSynthesis; 9838 var voices = synth.getVoices(); 9839 9840 for(var i = 0; i < voices.length; i++){ 9841 if(documentLang == voices[i].lang.toLowerCase() && !/(synthesis|eloquence)/.test(voices[i].voiceURI)){ 9842 //console.log(voices[i].voiceURI); 9843 textToSpeak.voice = voices[i]; 9844 textToSpeak.lang = voices[i].lang; 9845 break; 9846 } 9847 } 9848 } 9849 9850 textToSpeak.onend = function(event){ 9851 window.setTimeout(function(){ 9852 if(!wUiTmp['forceElementReader']){ 9853 wReadTextElementNext(); 9854 } 9855 }, 300); 9856 }; 9857 9858 window.speechSynthesis.speak(textToSpeak); 9859 } 9860 else if(window.speechSynthesis.paused){ 9861 window.speechSynthesis.resume(); 9862 } 9863 } 9864 else{ 9865 alert('Die Vorlesefunktion wird von Ihrem Browser leider nicht unterstützt!'); 9866 } 9867}; 9868 9869wPauseReadingText = function(element, readerPanelEmbed){ 9870 9871 if(readerPanelEmbed && readerPanelEmbed.className.indexOf('wReaderPanelEmbed') != -1){ 9872 readerPanelEmbed.className = 'wReaderPanelEmbed pauseReading'; 9873 } 9874 else if(readerPanelEmbed && readerPanelEmbed.className.indexOf('wAiReader') != -1){ 9875 readerPanelEmbed.className = 'wAiReader pauseReading'; 9876 jQuery('.wAiReader .wAiReaderStartReading').focus(); 9877 } 9878 9879 jQuery('html').addClass('pauseReading'); 9880 9881 if(window.speechSynthesis){ 9882 window.speechSynthesis.pause(); 9883 } 9884}; 9885 9886wStopReadingText = function(element, readerPanelEmbed){ 9887 9888 if(readerPanelEmbed && readerPanelEmbed.className.indexOf('wReaderPanelEmbed') != -1){ 9889 readerPanelEmbed.className = 'wReaderPanelEmbed'; 9890 } 9891 else if(readerPanelEmbed && readerPanelEmbed.className.indexOf('wAiReader') != -1){ 9892 readerPanelEmbed.className = 'wAiReader'; 9893 jQuery('.wAiReader .wAiReaderStartReading').focus(); 9894 } 9895 9896 jQuery('.wglTextIsBeingRead').removeClass('wglTextIsBeingRead'); 9897 jQuery('.wglElementCanBeRead').removeClass('wglElementCanBeRead'); 9898 9899 jQuery('html').removeClass('isReading').removeClass('pauseReading'); 9900 9901 if(window.speechSynthesis && window.speechSynthesis.speaking){ 9902 window.speechSynthesis.cancel(); 9903 } 9904 9905 wUiTmp['elementsToReadStack'] = null; 9906 wUiTmp['elementsToReadStackPosition'] = -1; 9907}; 9908 9909var rwids = {}; 9910 9911jQuery(window).on('load', function(){ 9912 9913 if(location.search.indexOf('wContentToDisplay=draft') != -1){ 9914 return; 9915 } 9916 9917 if(typeof wDoNotFeedbackImageSizes !== 'undefined' && wDoNotFeedbackImageSizes){ 9918 9919 } 9920 else if(typeof(wBrowseEditMode) == 'undefined'){ 9921 9922 var elementSizesStr = ''; 9923 var simulationWidth = 0; 9924 var winWidth = wUiTmp['lastWindowWidth'] ?? jQuery(window).width(); 9925 var winWidthSim = ''; 9926 var imageElement = null; 9927 9928 const groups = {}; 9929 9930 jQuery('[data-htgr="1"][data-rwid]').each(function () { 9931 const rwid = this.dataset.rwid; 9932 (groups[rwid] = groups[rwid] || []).push(this); 9933 }); 9934 9935 function getArea(el) { 9936 const rect = el.getBoundingClientRect(); 9937 let w = rect.width; 9938 let h = rect.height; 9939 9940 if (!w || !h) {
9941 w = el.naturalWidth || parseInt(el.getAttribute('width'), 10) || 0; 9942 h = el.naturalHeight || parseInt(el.getAttribute('height'), 10) || 0; 9943 } 9944 return w * h; 9945 } 9946 9947 jQuery.each(groups, function (_, els) { 9948 if (els.length < 2) return; 9949 9950 let largest = els[0]; 9951 let maxArea = getArea(largest); 9952 9953 for (let i = 1; i < els.length; i++) { 9954 const area = getArea(els[i]); 9955 if (area > maxArea) { 9956 maxArea = area; 9957 largest = els[i]; 9958 } 9959 } 9960 9961 els.forEach(el => { 9962 if (el !== largest) el.setAttribute('data-htgr', '0'); 9963 }); 9964 }); 9965 9966 jQuery('*[data-htgr="1"]').each(function(){ 9967 9968 var i, sources = [], url = '', pathCSS = '', cssTags = null, mediaSizeType = ''; widthMedia = 0, minHeight = '', element = jQuery(this).get(0), rwid = '', elementWidth = 0, elementHeight = 0, pictureRatio = 0, outerElement = null, outerWidth = 0, breakpointRanges = {}, breakpoint; 9969 9970 try{ 9971 rwid = element.getAttribute('data-rwid'); 9972 if(!rwids[rwid]){ 9973 rwids[rwid] = true; 9974 sources = element.getElementsByTagName('source'); 9975 9976 wSimulationElementWidthOffest = typeof wSimulationElementWidthOffest != 'undefined' ? wSimulationElementWidthOffest : 0; 9977 9978 for(i = 0; i < sources.length; i++){ 9979 if(/(min|max)-width\:\s*(\d+)px/.test(sources[i].getAttribute('media'))){ 9980 mediaSizeType = RegExp.$1; 9981 widthMedia = RegExp.$2; 9982 breakpointRanges[mediaSizeType + ' ' + widthMedia] = {}; 9983 if(mediaSizeType == 'max'){ 9984 breakpointRanges[mediaSizeType + ' ' + widthMedia]['type'] = 'max'; 9985 breakpointRanges[mediaSizeType + ' ' + widthMedia]['min'] = 0; 9986 breakpointRanges[mediaSizeType + ' ' + widthMedia]['max'] = parseInt(widthMedia); 9987 } 9988 else{ 9989 breakpointRanges[mediaSizeType + ' ' + widthMedia]['type'] = 'min'; 9990 breakpointRanges[mediaSizeType + ' ' + widthMedia]['min'] = parseInt(widthMedia); 9991 } 9992 } 9993 } 9994 9995 for(i = 0; i < sources.length; i++){ 9996 if(/(min|max)-width\:\s*(\d+)px/.test(sources[i].getAttribute('media'))){ 9997 mediaSizeType = RegExp.$1; 9998 widthMedia = RegExp.$2; 9999 smallestMin = 16000; 10000 if(mediaSizeType == 'min'){ 10001 for(key in breakpointRanges){ 10002 if(breakpointRanges[key]['min'] > widthMedia && breakpointRanges[key]['min'] < smallestMin){ 10003 smallestMin = breakpointRanges[key]['min']; 10004 } 10005 } 10006 breakpointRanges['min ' + widthMedia]['max'] = parseInt(smallestMin) - 1; 10007 } 10008 } 10009 } 10010 10011 //console.log(breakpointRanges); 10012 10013 for(i = 0; i < sources.length; i++){ 10014 if(sources[i].getAttribute('data-sp') && /(min|max)-width\:\s*(\d+)px/.test(sources[i].getAttribute('media'))){ 10015 mediaSizeType = RegExp.$1; 10016 widthMedia = RegExp.$2; 10017 10018 var breakpoint = breakpointRanges[mediaSizeType + ' ' + widthMedia]; 10019 if(breakpoint && winWidth >= breakpoint['min'] && winWidth <= breakpoint['max']){ 10020 10021 simulationWidth = sources[i].getAttribute('data-sp'); 10022 var hasMaxwidth = false; 10023 10024 document.documentElement.style.maxWidth = 'none'; 10025 document.documentElement.style.width = String(simulationWidth) + 'px'; 10026 document.body.style.maxWidth = 'none'; 10027 document.body.style.width = String(simulationWidth) + 'px'; 10028 10029 if(element.nodeName == 'PICTURE'){ 10030 imageElement = (element.getElementsByTagName('img'))[0]; 10031 10032 if(element.parentNode.nodeName == 'FIGURE' && document.defaultView.getComputedStyle(element.parentNode, null).getPropertyValue('display') == 'inline-block'){ 10033 boundingClientRect = imageElement.getBoundingClientRect();
10034 elementWidth = Math.ceil(boundingClientRect.width) + wSimulationElementWidthOffest; 10035 elementHeight = Math.ceil(boundingClientRect.height); 10036 elementRatio = elementWidth / elementHeight; 10037 outerElement = element.parentNode.parentNode; 10038 if(element.parentNode.parentNode.nodeName == 'A' && document.defaultView.getComputedStyle(element.parentNode.parentNode, null).getPropertyValue('display') == 'inline'){ 10039 outerElement = element.parentNode.parentNode.parentNode; 10040 } 10041 if(typeof(window.getComputedStyle(element.parentNode)['max-width']) !== 'undefined' && window.getComputedStyle(element.parentNode)['max-width'] !== '100%'){ 10042 hasMaxwidth = true; 10043 } 10044 } 10045 else{ 10046 boundingClientRect = imageElement.getBoundingClientRect(); 10047 elementWidth = Math.ceil(boundingClientRect.width) + wSimulationElementWidthOffest; 10048 elementHeight = Math.ceil(boundingClientRect.height); 10049 elementRatio = elementWidth / elementHeight; 10050 outerElement = element.parentNode; 10051 if(typeof(window.getComputedStyle(element)['max-width']) !== 'undefined' && window.getComputedStyle(element)['max-width'] !== '100%'){ 10052 hasMaxwidth = true; 10053 } 10054 } 10055 10056 if(imageElement.currentSrc){ 10057 if(document.defaultView.getComputedStyle(imageElement, null).getPropertyValue('object-fit') == 'cover'){ 10058 minHeight = elementHeight; 10059 } 10060 } 10061 } 10062 else{ 10063 imageElement = element; 10064 boundingClientRect = element.getBoundingClientRect(); 10065 elementWidth = Math.ceil(boundingClientRect.width) + wSimulationElementWidthOffest; 10066 elementHeight = Math.ceil(boundingClientRect.height); 10067 outerElement = element.parentNode.parentNode; 10068 } 10069 10070 if(elementWidth < 8 && outerElement.offsetWidth < 16){ 10071 var hasHideIfViewport, anc = outerElement.parentNode, to = 32; 10072 while(anc && anc.parentNode && to > 0){ 10073 if(anc.className.indexOf('hideIfViewport') != -1){ 10074 to = 0; 10075 hasHideIfViewport = true; 10076 outerElement = anc.parentNode; 10077 } 10078 anc = anc.parentNode; 10079 to--; 10080 } 10081 if(!hasHideIfViewport){ 10082 document.documentElement.style.maxWidth = ''; 10083 document.documentElement.style.width = ''; 10084 document.body.style.maxWidth = ''; 10085 document.body.style.width = ''; 10086 continue; 10087 } 10088 } 10089 10090 if(hasMaxwidth){ 10091 } 10092 else if(outerElement.offsetWidth > elementWidth){ 10093 pictureRatio = elementWidth / elementHeight; 10094 elementWidth = Math.ceil(outerElement.offsetWidth) + wSimulationElementWidthOffest; 10095 elementHeight = elementWidth / pictureRatio; 10096 } 10097 10098 if(typeof wMaxWidthImages != 'undefined' && !isNaN(wMaxWidthImages) && wMaxWidthImages > 0 && elementWidth > wMaxWidthImages){ 10099 elementWidth = wMaxWidthImages; 10100 } 10101 10102 //console.log(imageElement.clone(true).getOwnPropertyNames()); 10103 //console.log(imageElement.complete); 10104 if(elementWidth > 0 && elementHeight > 0){ 10105 winWidthSim = document.body.offsetWidth; 10106 elementSizesStr += (elementSizesStr == '' ? '' : ';') + rwid + ':w' + elementWidth + ',h' + elementHeight + (minHeight != '' && !isNaN(minHeight) ? ',mh' + minHeight : ''); 10107 document.documentElement.style.maxWidth = ''; 10108 document.documentElement.style.width = ''; 10109 document.body.style.maxWidth = ''; 10110 document.body.style.width = ''; 10111 return; 10112 } 10113 document.documentElement.style.maxWidth = ''; 10114 document.documentElement.style.width = ''; 10115 document.body.style.maxWidth = ''; 10116 document.body.style.width = ''; 10117 } 10118 } 10119 } 10120 } 10121 } 10122 catch(e){ 10123 document.documentElement.style.maxWidth = ''; 10124 document.documentElement.style.width = ''; 10125 document.body.style.maxWidth = ''; 10126 document.body.style.width = ''; 10127 } 10128 }); 10129 10130 //console.log(elementSizesStr); 10131 10132 if(elementSizesStr != '' && imageElement){ 10133 cssTags = jQuery("link[href*='/optimized/']"); 10134 if(cssTags.length > 0){ 10135 pathCSS = cssTags.get(0).getAttribute('href').replace(/\/optimized\/.*/, '') + '/design.css'; 10136 10137 var variantCSS = jQuery('picture[data-htgr="1"]').attr('data-csn'); 10138 10139 if(variantCSS && /^\w+$/.test(variantCSS)){ 10140 pathCSS = pathCSS.replace(/\.css$/, '_var' + variantCSS + '.css'); 10141 } 10142 10143 var imgTmp = new Image(); 10144 imgTmp.src = imageElement.src; 10145 10146 imgTmp.onload = function(){ 10147 if(imgTmp.width > 8){ 10148 url = '/weblication/grid5/scripts/wImage.php?path=' + pathCSS + '&referrer=' + encodeURIComponent(location.href.replace(/[\?\&]createImageRaster=1/, '')) + '&action=feedbackImageSizes&sw=' + simulationWidth + '&vw=' + winWidth + '(' + winWidthSim + ')' + '&sizes=' + elementSizesStr; 10149 jQuery.ajax({type: "GET", url: url, dataType: 'json', success: function(resultData){}}); 10150 } 10151 }; 10152 } 10153 } 10154 } 10155}); 10156 10157wAddFieldsetMultiple = function (fs){ 10158 10159 var fs = jQuery(fs); 10160 var p = fs.parent(); 10161 var a = fs.closest('form').attr('action'); 10162 var cfs = fs.clone(); 10163 10164 if(typeof(wOnBeforeAddFieldsetMultiple) == 'function'){ 10165 var cfsTmp = wOnBeforeAddFieldsetMultiple(fs, cfs); 10166 if(cfsTmp !== undefined && cfsTmp !== null) { 10167 cfs = cfsTmp; 10168 } 10169 } 10170 10171 var ep = cfs.attr('data-entrypos') ? parseInt(cfs.attr('data-entrypos')) + 1 : 1; 10172 var nem = cfs.attr('data-numberentriesmax') ? parseInt(cfs.attr('data-numberentriesmax')) : 64; 10173 var ai = cfs.attr('data-updateindex') == '1'; 10174 var ka = cfs.attr('data-keepdataonadd') == '1'; 10175 var n = []; 10176 10177 fs.find('input, select, textarea').each(function(i){ 10178 if(jQuery(this).attr('name') != 'wFormToken'){ 10179 n.push(jQuery(this).attr('name').replace(/\-\d+(\[\])?$/, '$1')); 10180 } 10181 }); 10182 10183 n = [...new Set(n)]; 10184 10185 if(!ka){ 10186 jQuery(cfs).find('input, select, textarea').each(function(i){ 10187 if(jQuery(this).attr('name') == 'wFormToken'){ 10188 jQuery(this).remove(); 10189 } 10190 else{ 10191 var posNew = ai ? (Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000) : ep 10192 10193 if(jQuery(this).attr('id') && jQuery(this).attr('id') != ''){ 10194 jQuery(this).attr('id', (jQuery(this).attr('id').replace(/\-\d+(\[\])?$/, '$1') + '-' + posNew).replace(/(\[\])(\-\d)/, '$2$1')); 10195 } 10196 jQuery(this).attr('name', (jQuery(this).attr('name').replace(/\-\d+(\[\])?$/, '$1') + '-' + posNew).replace(/(\[\])(\-\d)/, '$2$1')); 10197 10198 if(jQuery(this).attr('type') == 'checkbox'){ 10199 jQuery(this).prop("checked", false); 10200 } 10201 else if(jQuery(this).attr('type') == 'radio'){ 10202 jQuery(this).prop("checked", false); 10203 } 10204 else if(jQuery(this).prop('nodeName') == 'SELECT'){ 10205 jQuery(this).val(''); 10206 jQuery(this).attr('value', ''); 10207 } 10208 else if(jQuery(this).prop('nodeName') == 'INPUT'){ 10209 jQuery(this).val(''); 10210 jQuery(this).attr('value', ''); 10211 } 10212 else{ 10213 jQuery(this).val(''); 10214 jQuery(this).attr('value', ''); 10215 jQuery(this).html(''); 10216 } 10217 } 10218 }); 10219 } 10220 10221 cfs.find('.wglErrorMessageInline').remove(); 10222 cfs.find('.wglValidationStatusOK').remove(); 10223 cfs.find('.wglContainsErrorMessageInline').removeClass('wglContainsErrorMessageInline'); 10224 cfs.find('.wglContainsErrorMessageInline').removeClass('wglContainsErrorMessageInline'); 10225 cfs.find('.wglIsInvalid').removeClass('wglIsInvalid'); 10226 cfs.find('.hasDatepicker').removeClass('hasDatepicker'); 10227 10228 fs.after(cfs); 10229 10230 wFormElement(cfs); 10231 10232 jQuery(cfs).find('input, textarea, select').each(function(){ 10233 if(jQuery(this).attr('data-validators') && jQuery(this).attr('data-validators') != '' && jQuery(this).attr('name') != 'captchaInput'){ 10234 wAddInlineValidator(jQuery(this)); 10235 } 10236 }); 10237 10238 cfs.find('.wglUploaderForm').each(function(){ 10239 var srcIframe = jQuery(this).attr('src'); 10240 10241 if(/&element=([^&]+)/.test(srcIframe)){ 10242 var nameNew = (RegExp.$1.replace(/\-\d+(\[\])?$/, '$1') + '-' + ep).replace(/(\[\])(\-\d)/, '$2$1'); 10243 srcIframe = srcIframe.replace(/&element=([^&]+)/, '&element=' + nameNew); 10244 } 10245 jQuery(this).attr('src', srcIframe); 10246 }); 10247 10248 //jQuery(cfs).find('.wglDatepicker').wDatepicker(); 10249 10250 var url = a + '?action=ce&ep=' + ep + '&ai=' + (ai ? '1' : '0') + '&en=' + n.join('|'); 10251 10252 jQuery.ajax({type: "GET", async: true, dataType: "json", url: url, success: function(r){ 10253 if(typeof(wOnAfterAddFieldsetMultiple) === 'function'){ 10254 wOnAfterAddFieldsetMultiple(cfs, ep); 10255 } 10256 }}); 10257 10258 var ne = p.find('.containerFormElementsMultiple').length; 10259 10260 cfs.attr('data-allowadd', ne < nem ? '1' : '0'); 10261 10262 var csids = {}, hasCsids = false;
10263 10264 p.find('.containerFormElementsMultiple').each(function(i){ 10265 csids[jQuery(this).data('containermultiplesid')] = true; 10266 hasCsids = true; 10267 }); 10268 10269 if(!hasCsids){ 10270 csids['wNoCsid'] = true; 10271 } 10272 10273 for(csid in csids){ 10274 10275 var entries = p.find(csid == 'wNoCsid' ? '.containerFormElementsMultiple' : '.containerFormElementsMultiple[data-containermultiplesid="' + csid + '"]'); 10276 10277 for(var j = entries.length - 1; j >= 0; j--){ 10278 10279 var entry = jQuery(entries[j]); 10280 10281 var ene = p.find(csid == 'wNoCsid' ? '.containerFormElementsMultiple' : '.containerFormElementsMultiple[data-containermultiplesid="' + csid + '"]').length; 10282 var enem = entry.attr('data-numberentriesmax') ? parseInt(entry.attr('data-numberentriesmax')) : 64; 10283 10284 if(j >= 1){ 10285 var additionalentryId = j + 1; 10286 entry.attr('data-entrypos', additionalentryId); 10287 entry.attr('data-islast', additionalentryId == ne ? '1' : '0'); 10288 entry.attr('data-allowadd', (ene < enem) ? '1' : '0'); 10289 entry.attr('data-allowdelete', (ai || additionalentryId == ene) ? '1' : '0'); 10290 10291 if(ai){ 10292 10293 entry.find('label').each(function(i){ 10294 if(jQuery(this).attr('for') && jQuery(this).attr('for') != ''){ 10295 jQuery(this).attr('for', (jQuery(this).attr('for').replace(/\-\d+(\[\])?$/, '$1') + '-' + additionalentryId).replace(/(\[\])(\-\d)/, '$2$1')); 10296 } 10297 }); 10298 10299 entry.find('input, textarea, select').each(function(){ 10300 if(jQuery(this).attr('id') && jQuery(this).attr('id') != ''){ 10301 jQuery(this).attr('id', (jQuery(this).attr('id').replace(/\-\d+(\[\])?$/, '$1') + '-' + additionalentryId).replace(/(\[\])(\-\d)/, '$2$1')); 10302 } 10303 jQuery(this).attr('name', (jQuery(this).attr('name').replace(/\-\d+(\[\])?$/, '$1') + '-' + additionalentryId).replace(/(\[\])(\-\d)/, '$2$1')); 10304 }); 10305 } 10306 10307 entry.find('buttonFormElementsMultipleDelete').each(function(){ 10308 jQuery(this).html(jQuery(this).html().replace(/<!--wPlaceholderFieldsetMultiple:position-->\d*<\!--\/wPlaceholderFieldsetMultiple:position-->/g, '<!--wPlaceholderFieldsetMultiple:position-->' + String(additionalentryId) + '<!--/wPlaceholderFieldsetMultiple:position-->')); 10309 }); 10310 entry.find('buttonFormElementsMultipleAdd').each(function(){ 10311 jQuery(this).html(jQuery(this).html().replace(/<!--wPlaceholderFieldsetMultiple:position-->\d*<\!--\/wPlaceholderFieldsetMultiple:position-->/g, '<!--wPlaceholderFieldsetMultiple:position-->' + String(additionalentryId) + '<!--/wPlaceholderFieldsetMultiple:position-->')); 10312 }); 10313 entry.find('label').each(function(){ 10314 jQuery(this).html(jQuery(this).html().replace(/<!--wPlaceholderFieldsetMultiple:position-->\d*<\!--\/wPlaceholderFieldsetMultiple:position-->/g, '<!--wPlaceholderFieldsetMultiple:position-->' + String(additionalentryId) + '<!--/wPlaceholderFieldsetMultiple:position-->')); 10315 }); 10316 } 10317 else{ 10318 entry.attr('data-entrypos', '1'); 10319 entry.attr('data-islast', ene < 2 ? '1' : '0'); 10320 entry.attr('data-allowadd', (ene < enem) ? '1' : '0'); 10321 entry.attr('data-allowdelete', '0'); 10322 10323 entry.find('buttonFormElementsMultipleDelete').each(function(){ 10324 jQuery(this).html(jQuery(this).html().replace(/<!--wPlaceholderFieldsetMultiple:position-->\d*<\!--\/wPlaceholderFieldsetMultiple:position-->/g, '<!--wPlaceholderFieldsetMultiple:position-->' + String(1) + '<!--/wPlaceholderFieldsetMultiple:position-->')); 10325 }); 10326 entry.find('buttonFormElementsMultipleAdd').each(function(){ 10327 jQuery(this).html(jQuery(this).html().replace(/<!--wPlaceholderFieldsetMultiple:position-->\d*<\!--\/wPlaceholderFieldsetMultiple:position-->/g, '<!--wPlaceholderFieldsetMultiple:position-->' + String(1) + '<!--/wPlaceholderFieldsetMultiple:position-->')); 10328 }); 10329 entry.find('label').each(function(){ 10330 jQuery(this).html(jQuery(this).html().replace(/<!--wPlaceholderFieldsetMultiple:position-->\d*<\!--\/wPlaceholderFieldsetMultiple:position-->/g, '<!--wPlaceholderFieldsetMultiple:position-->' + String(1) + '<!--/wPlaceholderFieldsetMultiple:position-->')); 10331 }); 10332 } 10333 entry.find('.wglDatepicker').wDatepicker(); 10334 } 10335 } 10336}; 10337 10338wRemoveFieldsetMultiple = function (fs){ 10339 10340 var fs = jQuery(fs); 10341 var p = fs.parent(); 10342 var a = fs.closest('form').attr('action'); 10343 var cfs = fs; 10344 var ep = cfs.attr('data-entrypos') ? parseInt(cfs.attr('data-entrypos')) : 1; 10345 var nem = cfs.attr('data-numberentriesmax') ? parseInt(cfs.attr('data-numberentriesmax')) : 64; 10346 var ai = cfs.attr('data-updateindex') == '1'; 10347 var n = []; 10348 var ne = p.find('.containerFormElementsMultiple').length; 10349 10350 if(typeof(wOnBeforeRemoveFieldsetMultiple) == 'function'){ 10351 wOnBeforeRemoveFieldsetMultiple(fs); 10352 } 10353 10354 if(ne == 1){ 10355 fs.find('input, textarea, select').each(function(){ 10356 if(jQuery(this).attr('name') !== 'wFormToken'){ 10357 if(jQuery(this).attr('type') === 'checkbox' ||Â jQuery(this).attr('type') === 'radio'){ 10358 jQuery(this).prop('checked', false); 10359 } 10360 else{ 10361 jQuery(this).val(''); 10362 } 10363 } 10364 }); 10365 return; 10366 } 10367 else{ 10368 fs.find('input, select, textarea').each(function(i){ 10369 if(jQuery(this).attr('name') === 'wFormToken'){ 10370 jQuery(this).closest('form').prepend(jQuery(this)); 10371 } 10372 n.push(jQuery(this).attr('name').replace(/\-\d+(\[\])?$/, '$1')); 10373 }); 10374 10375 fs.remove(); 10376 10377 var url = a + '?action=re&ep=' + ep + '&ai=' + (ai ? '1' : '0') + '&en=' + n.join('|') ; 10378 10379 jQuery.ajax({type: "GET", async: true, dataType: "json", url: url, success: function(r){ 10380 jQuery(fs).remove(); 10381 if(typeof(wOnAfterRemoveFieldsetMultiple) === 'function'){ 10382 wOnAfterRemoveFieldsetMultiple(p, ep); 10383 } 10384 }}); 10385 } 10386 10387 ne = p.find('.containerFormElementsMultiple').length; 10388 10389 cfs.attr('data-allowadd', ne < nem ? '1' : '0'); 10390 10391 var csids = {}, hasCsids = false;
10392 10393 p.find('.containerFormElementsMultiple').each(function(i){ 10394 csids[jQuery(this).data('containermultiplesid')] = true; 10395 hasCsids = true; 10396 }); 10397 10398 if(!hasCsids){ 10399 csids['wNoCsid'] = true; 10400 } 10401 10402 for(csid in csids){ 10403 10404 var i = 0; 10405 10406 p.find(csid == 'wNoCsid' ? '.containerFormElementsMultiple' : '.containerFormElementsMultiple[data-containermultiplesid="' + csid + '"]').each(function(i){ 10407 10408 var ene = p.find(csid == 'wNoCsid' ? '.containerFormElementsMultiple' : '.containerFormElementsMultiple[data-containermultiplesid="' + csid + '"]').length; 10409 var enem = jQuery(this).attr('data-numberentriesmax') ? parseInt(jQuery(this).attr('data-numberentriesmax')) : 64; 10410 10411 if(i >= 1){ 10412 var additionalentryId = i + 1; 10413 jQuery(this).attr('data-entrypos', additionalentryId); 10414 jQuery(this).attr('data-islast', additionalentryId == ene ? '1' : '0'); 10415 jQuery(this).attr('data-allowadd', (ai || additionalentryId == ene) ? '1' : '0'); 10416 jQuery(this).attr('data-allowdelete', (ai || additionalentryId == ene) ? '1' : '0'); 10417 10418 if(ai){ 10419 10420 jQuery(this).find('label').each(function(i){ 10421 if(jQuery(this).attr('for') && jQuery(this).attr('for') != ''){ 10422 jQuery(this).attr('for', (jQuery(this).attr('for').replace(/\-\d+(\[\])?$/, '$1') + '-' + additionalentryId).replace(/(\[\])(\-\d)/, '$2$1')); 10423 } 10424 }); 10425 10426 jQuery(this).find('input, textarea, select').each(function(){ 10427 if(jQuery(this).attr('id') && jQuery(this).attr('id') != ''){ 10428 jQuery(this).attr('id', (jQuery(this).attr('id').replace(/\-\d+(\[\])?$/, '$1') + '-' + additionalentryId).replace(/(\[\])(\-\d)/, '$2$1')); 10429 } 10430 jQuery(this).attr('name', (jQuery(this).attr('name').replace(/\-\d+(\[\])?$/, '$1') + '-' + additionalentryId).replace(/(\[\])(\-\d)/, '$2$1')); 10431 }); 10432 } 10433 jQuery(this).find('buttonFormElementsMultipleDelete').each(function(){ 10434 jQuery(this).html(jQuery(this).html().replace(/<!--wPlaceholderFieldsetMultiple:position-->\d*<\!--\/wPlaceholderFieldsetMultiple:position-->/g, '<!--wPlaceholderFieldsetMultiple:position-->' + String(additionalentryId) + '<!--/wPlaceholderFieldsetMultiple:position-->')); 10435 }); 10436 jQuery(this).find('buttonFormElementsMultipleAdd').each(function(){ 10437 jQuery(this).html(jQuery(this).html().replace(/<!--wPlaceholderFieldsetMultiple:position-->\d*<\!--\/wPlaceholderFieldsetMultiple:position-->/g, '<!--wPlaceholderFieldsetMultiple:position-->' + String(additionalentryId) + '<!--/wPlaceholderFieldsetMultiple:position-->')); 10438 }); 10439 jQuery(this).find('label').each(function(){ 10440 jQuery(this).html(jQuery(this).html().replace(/<!--wPlaceholderFieldsetMultiple:position-->\d*<\!--\/wPlaceholderFieldsetMultiple:position-->/g, '<!--wPlaceholderFieldsetMultiple:position-->' + String(additionalentryId) + '<!--/wPlaceholderFieldsetMultiple:position-->')); 10441 }); 10442 } 10443 else{ 10444 jQuery(this).attr('data-entrypos', '1'); 10445 jQuery(this).attr('data-islast', ene < 2 ? '1' : '0'); 10446 jQuery(this).attr('data-allowadd', ai || ene < 2 ? '1' : '0'); 10447 jQuery(this).attr('data-allowdelete', '0'); 10448 10449 if(ai){ 10450 jQuery(this).find('input, textarea, select').each(function(){ 10451 if(jQuery(this).attr('id') && jQuery(this).attr('id') != ''){ 10452 jQuery(this).attr('id', (jQuery(this).attr('id').replace(/\-\d+(\[\])?$/, '$1'))); 10453 } 10454 jQuery(this).attr('name', (jQuery(this).attr('name').replace(/\-\d+(\[\])?$/, '$1'))); 10455 }); 10456 } 10457 10458 jQuery(this).find('buttonFormElementsMultipleDelete').each(function(){ 10459 jQuery(this).html(jQuery(this).html().replace(/<!--wPlaceholderFieldsetMultiple:position-->\d*<\!--\/wPlaceholderFieldsetMultiple:position-->/g, '<!--wPlaceholderFieldsetMultiple:position-->' + String(1) + '<!--/wPlaceholderFieldsetMultiple:position-->')); 10460 }); 10461 jQuery(this).find('buttonFormElementsMultipleAdd').each(function(){ 10462 jQuery(this).html(jQuery(this).html().replace(/<!--wPlaceholderFieldsetMultiple:position-->\d*<\!--\/wPlaceholderFieldsetMultiple:position-->/g, '<!--wPlaceholderFieldsetMultiple:position-->' + String(1) + '<!--/wPlaceholderFieldsetMultiple:position-->')); 10463 }); 10464 jQuery(this).find('label').each(function(){ 10465 jQuery(this).html(jQuery(this).html().replace(/<!--wPlaceholderFieldsetMultiple:position-->\d*<\!--\/wPlaceholderFieldsetMultiple:position-->/g, '<!--wPlaceholderFieldsetMultiple:position-->' + String(1) + '<!--/wPlaceholderFieldsetMultiple:position-->')); 10466 }); 10467 } 10468 }); 10469 } 10470}; 10471 10472showNoticeExternalLinks = function (){ 10473 10474 if(typeof(wEditor) === 'undefined'){ 10475 if(typeof wShowNoticeExternalLinks !== 'undefined' && wShowNoticeExternalLinks === true && (wcsrft)){ 10476 10477 var pathNotice = wProjectPath + '/wGlobal/content/privacy/externallink-notice.php'; 10478 var excludedUrls = []; 10479 if(typeof wExcludeExternalUrlFromNotice !== 'undefined' && wExcludeExternalUrlFromNotice !== ''){ 10480 excludedUrls = wExcludeExternalUrlFromNotice.split('|'); 10481 } 10482 10483 var links = jQuery('a'); 10484 links.each(function (){ 10485 10486 var curLink = jQuery(this); 10487 var curLinkHref = curLink.attr('href'); 10488 10489 if(curLinkHref && curLinkHref.length > 0){ 10490 var isExternal = curLinkHref.match(/^(http[s]?:\/\/)/g);
10491 var isExcluded = curLink.attr('data-excludeExternalUrl') === '1'; 10492 10493 for(var e = 0; e < excludedUrls.length; e++ ){ 10494 var excludedUrl = excludedUrls[e]; 10495 var re = new RegExp(excludedUrl, 'g'); 10496 if(curLinkHref.match(re)){ 10497 isExcluded = true; 10498 } 10499 } 10500 10501 10502 if(isExternal && isExcluded === false){ 10503 curLink.on('click', function (e){ 10504 e.preventDefault(); 10505 var targetUrl = pathNotice + '?l=' + encodeURIComponent(curLinkHref) + '&wcsrf=' + wcsrft; 10506 //window.location.href = targetUrl; 10507 var clickObj = jQuery('<a href="'+targetUrl+'" target="box"></a>'); 10508 clickObj.wLightbox(); 10509 clickObj.trigger('click'); 10510 }) 10511 } 10512 } 10513 10514 }); 10515 } 10516 } 10517}; 10518 10519var dFactor1 = 0.0; 10520var sDefaults = '|admin|weblication|cms|user|root|system|test|tester|testa|testo|testi|testu|asdf|abcdefg|abcdef|abcde|abcd|abc|123|1234|12345|login|demo|qwer|qwert|qwerz|qwery|qwertz|qwerty|'; 10521var sTypeAlphaL = 'abcdefghijklmnopqrstuvwxyz'; 10522var sTypeAlphaU = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; 10523var sTypeNumeric = '0123456789'; 10524 10525wGetPwdQuality = function(sPwd, userName){ 10526 10527 if(sPwd == '[$WPASSWORD]'){ 10528 sPwd = '' 10529 } 10530 if(sPwd){ 10531 var sDefaultsTmp = sDefaults; 10532 if(userName.length > 3){ 10533 sDefaultsTmp += userName.toLowerCase() + '|'; 10534 } 10535 10536 sPwd = sPwd.replace(/20(10|11|12|13|14|15|16|17|18|19|20)$/, ''); 10537 10538 sDefaultsTmp = sDefaultsTmp.replace(/^\|/, '').replace(/\|$/, ''); 10539 10540 defaultRegExpStrict = new RegExp('^('+ sDefaultsTmp + ')$'); 10541 defaultRegExp = new RegExp('('+ sDefaultsTmp + ')'); 10542 10543 sPwd = sPwd.replace(defaultRegExp, ''); 10544 10545 var lTypeAlphaL = 0; 10546 var lTypeAlphaU = 0; 10547 var lTypeNumeric = 0; 10548 var lTypeSpecial = 0; 10549 var sChars = ''; 10550 for(var nCount = 0; nCount < sPwd.length; nCount++){ 10551 var sChar = sPwd.substring(nCount, nCount + 1); 10552 if((sChar == ' ')){ 10553 10554 } 10555 else{ 10556 if(sChars.indexOf(sChar) < 0){ 10557 sChars += sChar; 10558 } 10559 if(sTypeAlphaL.indexOf(sChar) >= 0){ 10560 lTypeAlphaL += 1; 10561 } 10562 else if(sTypeAlphaU.indexOf(sChar) >= 0){ 10563 lTypeAlphaU += 1; 10564 } 10565 else if(sTypeNumeric.indexOf(sChar) >= 0){ 10566 lTypeNumeric += 1; 10567 } 10568 else{ 10569 lTypeSpecial += 1; 10570 } 10571 } 10572 } 10573 10574 var a = lTypeAlphaL * 6; 10575 var b = lTypeAlphaU * 8; 10576 var c = lTypeNumeric * 9; 10577 var d = lTypeSpecial * 12; 10578 10579 var tmp = parseInt((((a + b + c + d) * Math.pow(10, 1)) + 0.5)) / Math.pow(10, 1); 10580 10581 if(lTypeAlphaL == 0){ 10582 tmp -= 5; 10583 } 10584 if(lTypeAlphaU == 0){ 10585 tmp -= 5; 10586 } 10587 if(lTypeNumeric == 0){ 10588 tmp -= 5; 10589 } 10590 if(lTypeSpecial == 0){ 10591 tmp -= 5; 10592 } 10593 10594 if(defaultRegExp.test(sPwd.toLowerCase())){ 10595 tmp = parseInt(tmp / 2) - 32; 10596 if(tmp < 0){ 10597 tmp = -1; 10598 } 10599 } 10600 10601 if(lTypeAlphaL == 0){ 10602 tmp -= 5; 10603 } 10604 if(lTypeAlphaU == 0){ 10605 tmp -= 5; 10606 } 10607 if(lTypeNumeric == 0){ 10608 tmp -= 5; 10609 } 10610 if(lTypeSpecial == 0){ 10611 tmp -= 5; 10612 } 10613 10614 if(tmp < 0){ 10615 tmp = 0; 10616 } 10617 10618 return tmp; 10619 } 10620 else{ 10621 return '0'; 10622 } 10623}; 10624 10625jQuery.fn.wAddSelectAndClickableWithReturn = function(options){ 10626 jQuery.each(jQuery(this), function(){ 10627 if(jQuery(this).attr('aria-hidden') !== 'true'){ 10628 jQuery(this).attr('tabindex', '0'); 10629 } 10630 jQuery(this).on('keydown', function(event){if(event.key === "Enter"){jQuery(this).click()}}); 10631 }); 10632}; 10633 10634jQuery.fn.wRemoveSelectAndClickableWithReturn = function(options){ 10635 jQuery.each(jQuery(this), function(){ 10636 jQuery(this).removeAttr('tabindex'); 10637 jQuery(this).off('keydown', function(){}); 10638 }); 10639}; 10640 10641wToggleWaiMenu = function(){ 10642 if(typeof(wEditor) == 'undefined'){ 10643 if(!jQuery('#wAiMenu').hasClass('open')){ 10644 wOpenWaiMenu(); 10645 } 10646 else{ 10647 wCloseWaiMenu(); 10648 } 10649 } 10650}; 10651 10652wOpenWaiMenu = function(){ 10653 10654 if(typeof(wEditor) == 'undefined'){ 10655 if(typeof(wHasTextsEasyLanguage) !== 'undefined' && wHasTextsEasyLanguage){ 10656 jQuery('#wAiSectionEasyLanguage').show(); 10657 } 10658 else{ 10659 jQuery('#wAiSectionEasyLanguage').hide(); 10660 } 10661 10662 jQuery('#wAiMenu').addClass('open'); 10663 jQuery('#wAiMenu *[onclick]').wAddSelectAndClickableWithReturn(); 10664 window.setTimeout(function(){ 10665 jQuery('.wAiMenuCloser').focus(); 10666 }, 100); 10667 10668 wEventEscWaiMenu = function(e){ 10669 if(e.key === 'Escape'){ 10670 event.preventDefault(); 10671 jQuery(document).off('keydown', wEventEscWaiMenu); 10672 wCloseWaiMenu(); 10673 } 10674 }; 10675 10676 wEventKeydownWaiMenu = function(e){ 10677 if(wAccessHandler.isLastFocusableElement({element : jQuery('#wAiMenu')}, jQuery(e.target))){ 10678 jQuery(document).off('keydown', wEventEscWaiMenu); 10679 wCloseWaiMenu(); 10680 } 10681 }; 10682 10683 jQuery(document).on('keydown', wEventEscWaiMenu); 10684 jQuery('#wAiMenu').on('keydown', wEventKeydownWaiMenu); 10685 10686 jQuery('.wAiIcon').focus(); 10687 } 10688}; 10689 10690wCloseWaiMenu = function(setFocus = true){ 10691 if(typeof(wEditor) == 'undefined'){ 10692 jQuery('#wAiMenu').removeClass('open'); 10693 jQuery('#wAiMenu *[onclick]').wRemoveSelectAndClickableWithReturn(); 10694 jQuery('#wAiMenu *[onclick]').on('keydown', function(){}); 10695 if(setFocus) jQuery('.wAiIcon').focus(); 10696 } 10697}; 10698 10699wPersonalizeAccessibility = function(name, value, options){ 10700 //console.log('wPersonalizeAccessibility(' + name + ', ' + value + ')'); 10701 10702 if(typeof(name) !== 'undefined' && typeof wOnBeforeChangeAccessibility === 'function'){ 10703 wOnBeforeChangeAccessibility(name, value, options); 10704 } 10705 10706 var options = options || ''; 10707 10708 if(name == 'fontSize'){ 10709 if(value == 'toggle'){ 10710 value = /waFontSize=(l|xl)/.test(document.cookie) ? '' : 'l'; 10711 } 10712 document.cookie = 'waFontSize=' + value + (options != '' ? ',' + options : '') + ';path=/;sameSite=Lax'; 10713 } 10714 else if(name == 'contrast'){ 10715 if(value == 'toggle'){ 10716 value = /waContrast=l/.test(document.cookie) ? '' : 'l'; 10717 } 10718 if(options.indexOf('onSelectContrastResetDarkMode:1') != -1){ 10719 if(/waDarkMode=1,type:js/.test(document.cookie)){ 10720 document.cookie = 'waDarkMode=0,type:js;path=/;sameSite=Lax'; 10721 } 10722 else{ 10723 document.cookie = 'waDarkMode=0;path=/;sameSite=Lax'; 10724 } 10725 } 10726 document.cookie = 'waContrast=' + value + (options != '' ? ',' + options : '') + ';path=/;sameSite=Lax'; 10727 } 10728 else if(name == 'darkMode'){ 10729 if(value == 'toggle'){ 10730 value = /waDarkMode=1/.test(document.cookie) ? '0' : '1'; 10731 } 10732 if(options.indexOf('onSelectDarkModeResetContrast:1') != -1){ 10733 if(/waContrast=1,type:js/.test(document.cookie)){ 10734 document.cookie = 'waContrast=0,type:js;path=/;sameSite=Lax'; 10735 } 10736 else{ 10737 document.cookie = 'waContrast=0;path=/;sameSite=Lax'; 10738 } 10739 } 10740 document.cookie = 'waDarkMode=' + value + (options != '' ? ',' + options : '') + ';path=/;sameSite=Lax'; 10741 } 10742 else if(name == 'hideImages'){ 10743 if(value == 'toggle'){ 10744 value = /waHideImages=1/.test(document.cookie) ? '0' : '1'; 10745 } 10746 document.cookie = 'waHideImages=' + value + (options != '' ? ',' + options : '') + ';path=/;sameSite=Lax'; 10747 } 10748 else if(name == 'avoidAnimations'){ 10749 if(value == 'toggle'){ 10750 value = /waAvoidAnimations=1/.test(document.cookie) ? '0' : '1'; 10751 } 10752 document.cookie = 'waAvoidAnimations=' + value + (options != '' ? ',' + options : '') + ';path=/;sameSite=Lax'; 10753 } 10754 else if(name == 'easyLanguageMode'){ 10755 if(value == 'toggle'){ 10756 value = /waEasyLanguageMode=1/.test(document.cookie) ? '0' : '1'; 10757 } 10758 document.cookie = 'waEasyLanguageMode=' + value + (options != '' ? ',' + options : '') + ';path=/;sameSite=Lax'; 10759 wSetParameterAndReload('easyLanguageMode', value == '1' ? '1' : '0'); 10760 return; 10761 } 10762 10763 if(/easyLanguageMode=1/.test(location.search) && !/waEasyLanguageMode=1/.test(document.cookie)){ 10764 document.cookie = 'waEasyLanguageMode=1;path=/;sameSite=Lax'; 10765 } 10766 10767 wConsiderPesonalizeAccessibility(); 10768 10769 if(typeof(name) !== 'undefined' && typeof wOnAfterChangeAccessibility === 'function'){ 10770 wOnAfterChangeAccessibility(name, value, options); 10771 } 10772}; 10773 10774wConsiderPesonalizeAccessibility = function(){ 10775 10776 if(typeof(wEditor) != 'undefined'){ 10777 return; 10778 } 10779 10780 var waFontSize = ''; 10781 var waContrast = ''; 10782 var waDarkMode = ''; 10783 var waHideImages = ''; 10784 var waAvoidAnimations = ''; 10785 var waEasyLanguageMode = ''; 10786 var styleSheet = null; 10787 10788 for(var i = 0; i < document.styleSheets.length; i++) { 10789 styleSheet = document.styleSheets[i]; 10790 try{if(styleSheet.cssRules !== undefined && styleSheet.href !== undefined && styleSheet.href !== null) break;} 10791 catch(e){} 10792 } 10793 10794 if(/waFontSize=(\w*)/.test(document.cookie)){ 10795 waFontSize = RegExp.$1; 10796 if(waFontSize != ''){ 10797 jQuery('html').addClass('waFontSize-' + waFontSize); 10798 } 10799 var computedStyle = window.getComputedStyle(document.documentElement); 10800 var fontSize = computedStyle.fontSize; 10801 if(typeof wUiTmp['waFontSizeOrig'] === 'undefined'){ 10802 wUiTmp['waFontSizeOrig'] = fontSize; 10803 } 10804 if(waFontSize == 'l'){ 10805 document.documentElement.style.fontSize = '21px'; 10806 jQuery('html').removeClass('waFontSize-xl'); 10807 } 10808 else if(waFontSize == 'xl'){ 10809 document.documentElement.style.fontSize = '23px'; 10810 jQuery('html').removeClass('waFontSize-l'); 10811 } 10812 else if(typeof wUiTmp['waFontSizeOrig'] !== 'undefined'){ 10813 jQuery('html').removeClass('waFontSize-l').removeClass('waFontSize-xl'); 10814 document.documentElement.style.fontSize = wUiTmp['waFontSizeOrig']; 10815 } 10816 } 10817 else if(typeof wUiTmp['waFontSizeOrig'] !== 'undefined'){ 10818 jQuery('html').removeClass('waFontSize-l').removeClass('waFontSize-xl'); 10819 document.documentElement.style.fontSize = wUiTmp['waFontSizeOrig']; 10820 } 10821 10822 jQuery('span[data-wafontsize]').each(function(){ 10823 if(jQuery(this).data('wafontsize') == waFontSize){ 10824 jQuery(this).addClass('wAiRangeSelected'); 10825 } 10826 else{ 10827 jQuery(this).removeClass('wAiRangeSelected'); 10828 } 10829 }); 10830 10831 if(/waContrast=l/.test(document.cookie) || /waContrast=l/.test(location.href)){ 10832 jQuery('html').addClass('waContrast-l'); 10833 waContrast = 'l'; 10834 if(!wUiTmp['hasAddWaContrastRules']){ 10835 if(styleSheet){ 10836 var rules = styleSheet.cssRules; 10837 for(var i = 0; i < rules.length; i++){ 10838 if(rules[i].type === CSSRule.MEDIA_RULE && rules[i].conditionText.indexOf("prefers-contrast") != -1){ 10839 rules[i].media.mediaText = "(min-width: 17px)"; 10840 } 10841 } 10842 } 10843 } 10844 wUiTmp['hasAddWaContrastRules'] = true; 10845 if(/waContrast=l,type:js/.test(document.cookie)){ 10846 jQuery(typeof(wSelectorsAddContrast) !== 'undefined' && wSelectorsAddContrast !== '' ? wSelectorsAddContrast : '#blockMain, #blockHeader, #blockBody, #blockFooter').css({'filter' : 'contrast(1.2)'}); 10847 } 10848 } 10849 else if(/waContrast=/.test(document.cookie)){ 10850 jQuery('html').removeClass('waContrast-l'); 10851 if(styleSheet){ 10852 var rules = styleSheet.cssRules; 10853 for(var i = 0; i < rules.length; i++){ 10854 if(rules[i].type === CSSRule.MEDIA_RULE && rules[i].conditionText.indexOf("17px") != -1){ 10855 rules[i].media.mediaText = "(prefers-contrast: more)"; 10856 } 10857 } 10858 if(/waContrast=0?,type:js/.test(document.cookie)){ 10859 jQuery(typeof(wSelectorsAddContrast) !== 'undefined' && wSelectorsAddContrast !== '' ? wSelectorsAddContrast : '#blockMain, #blockHeader, #blockBody, #blockFooter').css({'filter' : ''}); 10860 } 10861 } 10862 wUiTmp['hasAddWaContrastRules'] = false; 10863 document.cookie = 'waContrast=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/;sameSite=lax'; 10864 } 10865 10866 jQuery('span[data-wacontrast]').each(function(){ 10867 if(jQuery(this).data('wacontrast') == waContrast){ 10868 jQuery(this).addClass('wAiRangeSelected'); 10869 } 10870 else{ 10871 jQuery(this).removeClass('wAiRangeSelected'); 10872 } 10873 }); 10874
10875 if(/waDarkMode=1/.test(document.cookie)){ 10876 waDarkMode = '1'; 10877 jQuery('html').addClass('waDarkMode-1').addClass('waDarkmode-1'); 10878 if(!wUiTmp['hasAddWaDarkmodeRules']){ 10879 if(styleSheet){ 10880 var rules = styleSheet.cssRules; 10881 for(var i = 0; i < rules.length; i++){ 10882 if(rules[i].type === CSSRule.MEDIA_RULE && rules[i].conditionText.indexOf("prefers-color-scheme") != -1){ 10883 rules[i].media.mediaText = "(min-width: 18.1px)"; 10884 } 10885 } 10886 } 10887 } 10888 wUiTmp['hasAddWaDarkmodeRules'] = true; 10889 10890 if(/waDarkMode=1,type:js/.test(document.cookie)){ 10891 document.body.style.filter = 'invert(1)'; 10892 jQuery('img').css({'filter' : 'invert(1)'}); 10893 } 10894 else if(/waDarkMode=1,type:js1/.test(document.cookie)){ 10895 var styleSheet = document.styleSheets[0].href ? document.styleSheets[0] : document.styleSheets[1]; 10896 var rulesTmp = []; 10897 if(styleSheet){ 10898 var rules = styleSheet.cssRules; 10899 for(var i = 0; i < rules.length; i++){ 10900 if(rules[i].type === window.CSSRule.MEDIA_RULE){ 10901 var mediaRules = rules[i].cssRules || rules[i].rules; 10902 for(var j = 0; j < mediaRules.length; j++){ 10903 if(mediaRules[j].style){ 10904 rulesTmp.push(mediaRules[j]); 10905 } 10906 } 10907 } 10908 else if(rules[i].style){ 10909 rulesTmp.push(rules[i]); 10910 } 10911 } 10912 } 10913 10914 rules = rulesTmp; 10915 10916 for(var i = 0; i < rules.length; i++){ 10917 if(typeof(rules[i].style) !== 'undefined'){ 10918 10919 if(rules[i].style.color){ 10920 rules[i].style.color = '#ffffff'; 10921 } 10922 if(rules[i].style.background){ 10923 rules[i].style.backgroundColor = '#000000'; 10924 } 10925 if(rules[i].style.backgroundColor){ 10926 rules[i].style.backgroundColor = '#000000'; 10927 } 10928 if(rules[i].style.opacity){ 10929 rules[i].style.opacity = '1'; 10930 } 10931 if(rules[i].style.boxShadow){ 10932 rules[i].style.boxShadow = 'none'; 10933 } 10934 if(rules[i].style.borderColor){ 10935 rules[i].style.borderColor = '#ffffff'; 10936 } 10937 } 10938 } 10939 } 10940 } 10941 else if(/waDarkMode=/.test(document.cookie)){ 10942 jQuery('html').removeClass('waDarkMode-1').removeClass('waDarkmode-1'); 10943 if(styleSheet){ 10944 var rules = styleSheet.cssRules; 10945 for(var i = 0; i < rules.length; i++){ 10946 if(rules[i].type === CSSRule.MEDIA_RULE && rules[i].conditionText.indexOf("18.1px") != -1){ 10947 rules[i].media.mediaText = "(prefers-color-scheme: dark)"; 10948 } 10949 } 10950 } 10951 10952 if(/waDarkMode=0?,type:js/.test(document.cookie)){ 10953 document.body.style.filter = ''; 10954 jQuery('img').css({'filter' : ''}); 10955 document.cookie = 'waDarkMode=;path=/;sameSite=Lax'; 10956 } 10957 wUiTmp['hasAddWaDarkmodeRules'] = false; 10958 document.cookie = 'waDarkMode=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/;sameSite=lax'; 10959 } 10960 10961 jQuery('span[data-wadarkmode]').each(function(){ 10962 if(jQuery(this).data('wadarkmode') == waDarkMode){ 10963 jQuery(this).addClass('wAiRangeSelected'); 10964 } 10965 else{ 10966 jQuery(this).removeClass('wAiRangeSelected'); 10967 } 10968 }); 10969 10970 if(/waHideImages=1/.test(document.cookie)){ 10971 jQuery('html').addClass('waHideImages'); 10972 waHideImages = '1'; 10973 if(!wUiTmp['hasAddWaHideImages']){ 10974 jQuery('#blockBody img').each(function(){ 10975 jQuery(this).attr('data-wahashide', '1'); 10976 jQuery(this).css({'opacity' : '0'}); 10977 var eA = jQuery('<div class="wglWaHiddenImageAlt"></div>').text(jQuery(this).attr('alt')); 10978 var eB = jQuery(this).parent().is('picture') ? jQuery(this).parent() : jQuery(this); 10979 eA.css({'max-width' : String(eB.parent().innerWidth()) + 'px'}) 10980 eB.before(eA); 10981 }); 10982 jQuery('#blockBody .elementVideo, #blockBody .listEntry[data-hasvideo="1"] .listEntryInner').each(function(){ 10983 var tmpHasHideE = jQuery(this).find('.listEntryVideo'); 10984 var hashHideE = jQuery(this); 10985 if(jQuery(this).hasClass('listEntryInner') && tmpHasHideE.length > 0){ 10986 hashHideE = tmpHasHideE; 10987 } 10988 hashHideE.attr('data-wahashide', '1').attr('data-waopacitybefore', hashHideE.css('opacity')).css({'opacity' : '0'}); 10989 });
10990 if(typeof(wAiHideImagesBackground) === 'undefined' || wAiHideImagesBackground){ 10991 window.setTimeout(function(){ 10992 jQuery('#blockBody *').each(function(){ 10993 var currentBackground = jQuery(this).css('background-image'); 10994 if(currentBackground !== 'none'){ 10995 jQuery(this).attr('data-wobg', currentBackground); 10996 jQuery(this).css('background-image', 'none'); 10997 } 10998 }); 10999 }, 50); 11000 window.setTimeout(function(){ 11001 jQuery('#blockBody *').each(function(){ 11002 var currentBackground = jQuery(this).css('background-image'); 11003 if(currentBackground !== 'none'){ 11004 jQuery(this).attr('data-wobg', currentBackground); 11005 jQuery(this).css('background-image', 'none'); 11006 } 11007 }); 11008 }, 200); 11009 } 11010 } 11011 wUiTmp['hasAddWaHideImages'] = true; 11012 } 11013 else if(/waHideImages=/.test(document.cookie)){ 11014 jQuery('html').removeClass('waHideImages'); 11015 jQuery('#blockBody img[data-wahashide="1"], #blockBody .elementVideo, #blockBody .listEntry[data-hasvideo="1"] .listEntryInner').each(function(){ 11016 var tmpHasHideE = jQuery(this).find('.listEntryVideo'); 11017 var hashHideE = jQuery(this); 11018 if(jQuery(this).hasClass('listEntryInner') && tmpHasHideE.length > 0){ 11019 hashHideE = tmpHasHideE; 11020 } 11021 hashHideE.removeAttr('data-wahashide').css({'opacity' : (hashHideE.attr('data-waopacitybefore') ? hashHideE.attr('data-waopacitybefore') : '1')}); 11022 jQuery('.wglWaHiddenImageAlt').remove(); 11023 }); 11024 if(typeof(wAiHideImagesBackground) === 'undefined' || wAiHideImagesBackground){ 11025 jQuery('#blockBody *[data-wobg]').each(function(){ 11026 var originalBackground = jQuery(this).attr('data-wobg'); 11027 jQuery(this).removeAttr('data-wobg'); 11028 jQuery(this).css('background-image', originalBackground); 11029 }); 11030 } 11031 wUiTmp['hasAddWaHideImages'] = false; 11032 document.cookie = 'waHideImages=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/;sameSite=lax'; 11033 } 11034 11035 jQuery('span[data-wahideimages]').each(function(){ 11036 if(jQuery(this).data('wahideimages') == waHideImages){ 11037 jQuery(this).addClass('wAiRangeSelected'); 11038 } 11039 else{ 11040 jQuery(this).removeClass('wAiRangeSelected'); 11041 } 11042 }); 11043 11044 if(/waAvoidAnimations=1/.test(document.cookie)){ 11045 waAvoidAnimations = '1'; 11046 if(!wUiTmp['hasAddWaAvoidAnimations']){ 11047 jQuery('html').addClass('waAvoidAnimations'); 11048 if(typeof bannerSliderPauseAnimationAll == 'function'){ 11049 bannerSliderPauseAnimationAll(); 11050 } 11051 11052 if(styleSheet){ 11053 var rules = styleSheet.cssRules; 11054 for(var i = 0; i < rules.length; i++){ 11055 if(rules[i].type === CSSRule.MEDIA_RULE && rules[i].conditionText.indexOf("prefers-reduced-motion") != -1){ 11056 rules[i].media.mediaText = "(min-width: 18.1px)"; 11057 } 11058 } 11059 } 11060 } 11061 11062 wUiTmp['hasAddWaAvoidAnimations'] = true; 11063 } 11064 else if(/waAvoidAnimations=/.test(document.cookie)){ 11065 jQuery('html').removeClass('waAvoidAnimations'); 11066 11067 if(typeof bannerSliderResumeAnimationAll == 'function'){ 11068 bannerSliderResumeAnimationAll(); 11069 } 11070 11071 if(styleSheet){ 11072 var rules = styleSheet.cssRules; 11073 for(var i = 0; i < rules.length; i++){ 11074 if(rules[i].type === CSSRule.MEDIA_RULE && rules[i].conditionText.indexOf("18.1px") != -1){ 11075 rules[i].media.mediaText = "(prefers-reduced-motion: reduce)"; 11076 } 11077 } 11078 } 11079 11080 wUiTmp['hasAddWaAvoidAnimations'] = false; 11081 document.cookie = 'waAvoidAnimations=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/;sameSite=lax'; 11082 } 11083 11084 jQuery('span[data-waavoidanimations]').each(function(){ 11085 if(jQuery(this).data('waavoidanimations') == waAvoidAnimations){ 11086 jQuery(this).addClass('wAiRangeSelected'); 11087 } 11088 else{ 11089 jQuery(this).removeClass('wAiRangeSelected'); 11090 } 11091 }); 11092 11093 if(/waEasyLanguageMode=1/.test(document.cookie)){ 11094 waEasyLanguageMode = '1'; 11095 if(/waEasyLanguageMode=1,addClassHtml:1/.test(document.cookie)){ 11096 document.documentElement.className = document.documentElement.className.replace(' wEasyLanguageMode', '') + ' wEasyLanguageMode'; 11097 } 11098 window.setTimeout(function(){wArrangeAdditionalPictureWai();}, 320); 11099 window.setTimeout(function(){wGetMissingEasyLanguages();}, 128); 11100 } 11101 11102 jQuery('span[data-waeasylanguagemode]').each(function(){ 11103 if(jQuery(this).data('waeasylanguagemode') == waEasyLanguageMode){ 11104 jQuery(this).addClass('wAiRangeSelected'); 11105 } 11106 else{ 11107 jQuery(this).removeClass('wAiRangeSelected'); 11108 } 11109 }); 11110 11111 if(waFontSize != '' || waContrast != '' || waDarkMode != '' || waEasyLanguageMode != '' || waHideImages != '' || waAvoidAnimations != ''){ 11112 jQuery('.wAiIcon').addClass('hasMadeSelection'); 11113 } 11114 else{ 11115 jQuery('.wAiIcon').removeClass('hasMadeSelection'); 11116 } 11117}; 11118 11119wGetMissingEasyLanguages = function(){ 11120 11121 if(typeof wUiTmp['hasGetEl'] === 'undefined'){ 11122 11123 var rootEasyLanguages = '#blockContent'; 11124 11125 wUiTmp['elcpids'] = []; 11126 jQuery((rootEasyLanguages != '' ? rootEasyLanguages + ' ' : '') + '*[data-elcpid]').each(function(){ 11127 wUiTmp['elcpids'].push(jQuery(this).data('elcpid')); 11128 }); 11129 wUiTmp['hasGetEl'] = true; 11130 } 11131 11132 if(wUiTmp['elcpids'].length != 0){ 11133 var elcpid = wUiTmp['elcpids'].shift(); 11134 var ajaxURL = '/weblication/grid5/scripts/wContent.php?action=getTextEasyLanguage&id=' + elcpid + (jQuery('*[data-elcpid="' + elcpid + '"]').hasClass('elementHeadline') || jQuery('*[data-elcpid="' + elcpid + '"]').attr('data-isheadline') === '1' ? '&type=headline' : ''); 11135 var buttonQe = jQuery('*[data-elcpid="' + elcpid + '"]').find('.wglButtonEditEmbedElement'); 11136 11137 buttonQe.addClass('elprogress'); 11138 buttonQe = buttonQe.clone(); 11139 11140 jQuery.ajax({type: "GET", url: ajaxURL, dataType: 'json', async: true, success: function(result){ 11141 buttonQe = jQuery('*[data-elcpid="' + elcpid + '"]').find('.wglButtonEditEmbedElement'); 11142 if(result['status'] == 'ok'){ 11143 if(jQuery('*[data-elcpid="' + elcpid + '"]').hasClass('elementHeadline')){ 11144 jQuery('*[data-elcpid="' + elcpid + '"]').find('h1, h2, h3, h4, h5, h6, .he').html(result['text']).attr('data-wait', '1'); 11145 } 11146 else{ 11147 jQuery('*[data-elcpid="' + elcpid + '"]').html(result['text']).attr('data-wait', '1'); 11148 } 11149 jQuery('*[data-elcpid="' + elcpid + '"]').append('<div class="wglInfoAiGeneratedText" aria-hidden="true"></div>'); 11150 } 11151 if(buttonQe.length != 0){ 11152 jQuery('*[data-elcpid="' + elcpid + '"]').prepend(buttonQe); 11153 buttonQe.removeClass('elprogress').addClass('wglButtonEditEmbedElementHasWaiTextAvailableOnTheFly'); 11154 buttonQe.find('.wglButtonEditEmbedElementExtended').attr('title', 'Der Text wird von der KI generiert in Leichter Sprache zur Verfügung gestellt. Klicken Sie hier, um den Modus Leichte Sprache zu verlassen.'); 11155 buttonQe.parent().attr('data-wais', '1'); 11156 } 11157 if(wUiTmp['elcpids'].length != 0){ 11158 window.setTimeout(function(){wGetMissingEasyLanguages();}, 20); 11159 } 11160 }}); 11161 } 11162}; 11163 11164wArrangeAdditionalPictureWai = function(){ 11165 11166 jQuery('#blockContent .elementText').each(function(index){ 11167 11168 var bai = 0, pe = null, he = 0, hp = false, otlb = 0, pb = '', et = jQuery(this); 11169 11170 if(et.find('.additionalPictureWai').length > 0){ 11171 11172 pb = et.css('position'); 11173 et.css({'position' : 'relative'}); 11174 11175 pe = et.find('.additionalPictureWai').parent().parent(); 11176 11177 et.find('.additionalPictureWai[data-pos]:not([data-pos=""])').each(function(index){ 11178 hp = true; 11179 var pi = jQuery(this).data('pos'); 11180 var pit = jQuery(this).offset()['top']; 11181 if(/^\d+$/.test(pi)){ 11182 var pp = pe.find('p:nth-of-type(' + pi + ')'); 11183 if(pp.length === 1){ 11184 ppt = pp.offset()['top']; 11185 if(ppt > pit){ 11186 jQuery(this).css({'margin-top' : String(ppt - pit) + 'px'}); 11187 } 11188 else{ 11189 otlb = jQuery(this).offset()['top']; 11190 pp.css({'padding-top' : String(otlb - ppt) + 'px'}); 11191 } 11192 } 11193 } 11194 }); 11195 11196 et.find('.additionalPictureWai').each(function(index){ 11197 var bi = jQuery(this).position().top + jQuery(this).height(); 11198 bai = bi; 11199 he = pe.height(); 11200 }); 11201 11202 if(bai > he){ 11203 pe.css({'padding-bottom' : String(parseInt(bai - he)) + 'px'}); 11204 } 11205 et.css({'position' : pb}); 11206 } 11207 }); 11208}; 11209 11210wGetText = function(id){ 11211 id = typeof(id) !== 'undefined' ? id : ''; 11212 if(typeof wTexts == 'undefined') wTexts = {}; 11213 return (wTexts[id] != null && wUiTmp['lang'] != null && wTexts[wUiTmp['lang']][id] != null) ? wTexts[wUiTmp['lang']][id] : ((wTexts[id] != null && wUiTmp['lang'] != null && wTexts[id][wUiTmp['lang']]) ? wTexts[id][wUiTmp['lang']] : (wTexts[id] != null ? wTexts[id] : id)); 11214}; 11215 11216wSubmitFormAjax = function(){ 11217 11218 var currentForm = event.target; 11219 var formData = new FormData(currentForm); 11220 11221 formData.append('wSubmitFormAjax', '1'); 11222 11223 jQuery.ajax({ 11224 url:currentForm.getAttribute('action'), 11225 type:currentForm.getAttribute('method'), 11226 data:formData, 11227 dataType:'json', 11228 processData:false, 11229 contentType:false, 11230 success: function(response){ 11231 if(typeof(wOnAfterSubmitFormAjaxSuccess) === 'function'){ 11232 wOnAfterSubmitFormAjaxSuccess(response); 11233 } 11234 else{ 11235 if(response['redirect']){ 11236 location.href = location.href !== response['redirect'] ? response['redirect'] : wSetParameter(response['redirect'], 'wfr', new Date().getTime()); 11237 } 11238 } 11239 }, 11240 error: function(xhr, status, error){ 11241 if(typeof(wOnAfterSubmitFormAjaxError) === 'function'){ 11242 var errorData = {'xhrStatus' : status, 'xhrError' : status}; 11243 wOnAfterSubmitFormAjaxError(errorData); 11244 } 11245 else{ 11246 alert('Es ist ein Fehler aufgetreten. Ggf. ist die Netzwerkverbinung gerade unterbrochen. Prüfen Sie die Netzwerkverbindung und versuchen Sie es anschlieÃend noch einmal.'); 11247 } 11248 } 11249 }); 11250 11251 return false;
11252}; 11253 11254wLoadScript = function(src, callbackOnLoad, cO, options){ 11255 let scriptObj = document.createElement('script'); 11256 scriptObj.src = src; 11257 if(options['defer'] != undefined) scriptObj.setAttribute('defer', 'defer'); 11258 scriptObj.onload = function(){ 11259 if(typeof window[callbackOnLoad] == 'function') window[callbackOnLoad](cO, options); 11260 }; 11261 document.head.appendChild(scriptObj); 11262}; 11263 11264jQuery(document).on('mousedown', function(e){ 11265 wUiTmp['lastActionSource'] = 'mouse'; 11266}); 11267 11268jQuery(document).on('keydown', function(e){ 11269 11270 if(e.key === 'Escape'){ 11271 if(jQuery('#cookieNotice').is(':visible')){ 11272 event.preventDefault(); 11273 if(typeof closeCookieNotice === 'function'){ 11274 closeCookieNotice(); 11275 } 11276 else{ 11277 jQuery('#cookieNotice').hide(); 11278 } 11279 } 11280 else if(jQuery('.accordionCloserContent').is(':visible')){ 11281 event.preventDefault(); 11282 jQuery('.accordionCloserContent:visible').parent().prev('.accordionHeader').focus(); 11283 } 11284 } 11285 11286 wUiTmp['lastActionSource'] = 'keyboard'; 11287 wUiTmp['lastKey'] = e.key; 11288}); 11289 11290/*Klasse für die Barrierefreiheit in der design.js wird die Funktion aktiviert über 11291 wAccessibility['accessEventHandler'] = {active : true}; 11292*/ 11293class wClassAccessHandler { 11294 11295 constructor(options){ 11296 this.objects = []; 11297 this.objGroups = []; 11298 this.idCount = 0; 11299 this.activeListenerObjects = []; 11300 this.listenerObjects = []; 11301 11302 window.addEventListener('DOMContentLoaded', function() { 11303 const focusId = sessionStorage.getItem('accessHandlerFocusId'); 11304 if (focusId) { 11305 const el = document.getElementById(focusId); 11306 if (el) el.focus(); 11307 sessionStorage.removeItem('accessHandlerFocusId'); // aufräumen 11308 } 11309 }); 11310 11311 }; 11312 /* 11313 Fügt dem Eventhandler ein AccessEvent hinzu 11314 options accessibilityRules [standard,strict] - Berücksichtigung der Barrierefreiheit-Regeln 11315 idPrefix 11316 */ 11317 addEvent(cO, options = []){ 11318 11319 var self = this; 11320 var add = true; 11321 var idPrefix = options['idPrefix'] != null ? options['idPrefix'] : 'accessEvent'; 11322 11323 if(cO.id == null) cO.id = idPrefix + '_' + self.idCount; 11324 if(cO.id in self.objects && self.objects[cO.id] != null) add = false; 11325 if(cO.element == null){ 11326 console.log('The Event has no Element: ' + cO.id); 11327 add = false; 11328 } 11329 else if(cO.accessibilityRules != null){ 11330 /*aria-label*/ 11331 if(cO.element.attr('aria-label') == null) cO.element.attr('aria-label', cO.element.attr('data-aria-label')); 11332 cO.element.removeAttr('data-aria-label'); 11333 /*Falls die Barrierefreiheit-Regeln den Code automatisch bereinigen sollen*/ 11334 var accessRules = options['accessibilityRules'] != null ? options['accessibilityRules'] : {active : false}; 11335 /*a-tags*/ 11336 if(accessRules.active && (accessRules.type != null || accessRules.links != null)){ 11337 self.accessiblityRulesLinks(cO, accessRules); 11338 } 11339 } 11340 //console.log('addEvent: ' + add + " id: " + cO.id + " cleanup " + cO.cleanUp); 11341 if(add){ 11342 var eventStatus = true; 11343 if(cO.onready != null) eventStatus = cO.onready(cO); 11344 if(cO.onresize != null) jQuery(window).on('resize', function(e){cO.onresize(cO);}); 11345 if(eventStatus){ 11346 var events = ["onkeyup", "onkeydown", "onleave", "onclick", "onmouseout", "onmouseover", "onfocusout", "onfocusin"]; 11347 events.forEach(event => { 11348 if(cO[event] != null && typeof self[event] === "function"){ 11349 self[event](cO); 11350 } 11351 }); 11352 } 11353 cO.init = true; 11354 self.objects[cO.id] = cO; 11355 if(self.objGroups[idPrefix] == null) self.objGroups[idPrefix] = []; 11356 self.objGroups[idPrefix].push(cO); 11357 } 11358 self.idCount++; 11359 } 11360 11361 accessiblityRulesLinks(cO, accessRules){ 11362 cO.element.find('a').each(function(){ 11363 var cE = jQuery(this); 11364 var linkRules = accessRules.links != null ? accessRules.links : (accessRules.type === 'strict' ? 'redundantTitle|filetypes|unterlinedText' : 'redundantTitle' ); 11365 if(linkRules.indexOf('redundantTitle') !== -1 && cE.attr('title') == cE.text()) cE.removeAttr('title'); /*Redundant title text*/ 11366 if(linkRules.indexOf('filetypes') !== -1 && cE.attr('href') != undefined){ 11367
11368 var baseHref = cE.attr('href').indexOf('wLinkDetailsSource') !== -1 ? cE.attr('href').split('wLinkDetailsSource=')[1] : cE.attr('href'); 11369 baseHref = baseHref !== -1 ? baseHref.split('?')[0] : baseHref; 11370 if(baseHref.indexOf('.') === -1) baseHref = ''; 11371 var excludeStr = ['#wEmpty', 'http://', 'https://', '#']; 11372 if(excludeStr.some(extStr => baseHref.indexOf(extStr) !== -1)) baseHref = ''; 11373 var exclude = ['.svg', '.html', '.php', '/']; 11374 if(exclude.some(ext => baseHref.endsWith(ext))) baseHref = ''; 11375 11376 if(baseHref != ''){ 11377 var tmpExt = baseHref.split('.'); 11378 if(tmpExt.length > 1){ 11379 var ext = tmpExt.pop().toLowerCase(); 11380 var txtE = cE; 11381 if(cE.find('*[data-aeListEntryText="1"]').length > 0) txtE = cE.find('*[data-aeListEntryText="1"]'); 11382 else if(cE.children('span.linkEntryText').length > 0) txtE = cE.children('span.linkEntryText'); 11383 if(txtE.text().toLowerCase().indexOf(ext) === -1) txtE.text(txtE.text().trim() + ' (' + ext.toUpperCase() + ')'); 11384 } 11385 }; 11386 } 11387 if(linkRules.indexOf('underlinedText') !== -1){ /*Underlined text*/ 11388 if(cE[0].attributes.length > 0 && cE.attr('href') != '#wEmpty' && cE.css('text-decoration').includes('underline') && cE.first('span').length == 1) cE.text(cE.first('span').text()); 11389 } 11390 }); 11391 } 11392 11393 /*Gibt ein einzelnes Event zurück*/ 11394 getEvent(id){ 11395 return this.objects[id] != null ? this.objects[id] : {}; 11396 } 11397 11398 /*Gibt ein eine Gruppe von Events zurück*/ 11399 getEventGroup(id){ 11400 return this.objGroups[id] != null ? this.objGroups[id] : []; 11401 } 11402 11403 /* Initalisiert das onkeydown-Event, Unterstützt alle Keys */ 11404 onkeydown(cO){ 11405 var self = this; 11406 var evtO = cO.onkeydown; 11407 cO.element.attr('tabindex', cO.onkeydown.tabindex != null ? cO.onkeydown.tabindex : '0'); 11408 cO.element.on('keydown.' + cO.id, function(e){ 11409 /*Setzt Status zurück*/ 11410 self.reset(cO); 11411 const keyEvent = 'key' + (e.key == ' ' ? 'Space' : e.key) + (e.shiftKey ? 'Shift' : ''); 11412 11413 /*trigger : 'onclick'*/ 11414 if(keyEvent && typeof evtO[keyEvent] === 'object' && evtO[keyEvent].trigger == 'onclick') { 11415 /*Setzt leave auf true, zB. i.V.m Escape*/ 11416 cO.element.data('leave', evtO[keyEvent].leave); 11417 11418 if(evtO[keyEvent].element !== undefined) evtO[keyEvent].element.trigger('click'); 11419 else cO.element.trigger('click'); 11420 11421 //Callback 11422 if(typeof evtO[keyEvent].onafterclick === 'function') evtO[keyEvent].onafterclick(cO, e); 11423 evtO[keyEvent].clicked = evtO[keyEvent].clicked === undefined ? true : !evtO[keyEvent].clicked; 11424 } 11425 11426 /*Falls für einen key eine Funktion definiert wurde*/ 11427 if (keyEvent && typeof evtO[keyEvent] === 'function') {evtO[keyEvent](cO, e);} 11428 if(typeof evtO.onafterkeydown == 'function') evtO.onafterkeydown(cO, e); 11429 }); 11430 } 11431 11432 /* Initalisiert das onkeyup-Event, Unterstützt alle Keys */ 11433 onkeyup(cO){ 11434 var self = this; 11435 var evtO = cO.onkeyup; 11436 cO.element.attr('tabindex', cO.onkeydown.tabindex != null ? cO.onkeydown.tabindex : '0'); 11437 cO.element.on('keyup.' + cO.id, function(e){ 11438 /*Setzt Status zurück*/ 11439 self.reset(cO); 11440 const keyEvent = 'key' + (e.key == ' ' ? 'Space' : e.key) + (e.shiftKey ? 'Shift' : ''); 11441 11442 /*trigger : 'onclick'*/ 11443 if(keyEvent && typeof evtO[keyEvent] === 'object' && evtO[keyEvent].trigger == 'onclick') { 11444 /*Setzt leave auf true, zB. i.V.m Escape*/ 11445 cO.element.data('leave', evtO[keyEvent].leave); 11446 11447 if(evtO[keyEvent].element !== undefined) evtO[keyEvent].element.trigger('click'); 11448 else cO.element.trigger('click'); 11449 11450 //Callback 11451 if(typeof evtO[keyEvent].onafterclick === 'function') evtO[keyEvent].onafterclick(cO, e); 11452 evtO[keyEvent].clicked = evtO[keyEvent].clicked === undefined ? true : !evtO[keyEvent].clicked; 11453 } 11454 11455 /*Falls für einen key eine Funktion definiert wurde*/ 11456 if (keyEvent && typeof evtO[keyEvent] === 'function') {evtO[keyEvent](cO, e);} 11457 if(typeof evtO.onafterkeyup == 'function') evtO.onafterkeyup(cO, e); 11458 }); 11459 } 11460 11461 /* Die Funktion wird ausgeführt wenn ein Element verlassen (keydown, mouseout, blur) wird. */ 11462 onleave(cO){ 11463 var self = this; 11464 var events = ''; 11465 const eventNames = ['keydown', 'mouseout', 'blur']; 11466 for (const eventName of eventNames) { 11467 if(!cO.onleave.events ||cO.onleave.events[eventName] === undefined ||cO.onleave.events[eventName]) events += ' '+eventName + '.' + cO.id; 11468 } 11469 cO.element.on(events, function(e){
11470 //console.log(cO.id + 'onleave hasLeft' + cO.hasleft); 11471 var leave = false; 11472 var off = cO.onleave.off !== undefined ? cO.onleave.off : false; 11473 if(cO.onleave.element == null) cO.onleave.element = cO.element; 11474 if((e.key == 'Tab' || e.key == 'Escape' || e.key === undefined) && (!cO.hasLeft || cO.hasleft !== true)) leave = true; 11475 //console.log('leave --> ' + cO.id + ' leave --> ' + leave + " hasLeft " + (!cO.hasLeft || cO.hasleft !== true)); 11476 if(leave){ 11477 cO.hasleft = true; 11478 cO.onleave.element.data('leave', cO.hasleft); 11479 //Falls eine Funktion definiert wurde 11480 if(typeof cO.onleave == 'function') cO.onleave(cO, e); 11481 //Falls das Click Event angestossen werden soll definiert wurde 11482 else if(typeof cO.onleave === 'object' && typeof cO.onleave.function == 'function') cO.onleave.function(cO, e); 11483 else if(typeof cO.onleave === 'object' && cO.onleave.trigger == 'onclick') { 11484 cO.onleave.element.trigger('click'); 11485 } 11486 //Ausschalten des Events 11487 if(off) cO.element.off(events); 11488 //Stoppt Propagation 11489 if(cO.onleave.stop === true){ 11490 e.stopPropagation(); 11491 e.stopImmediatePropagation(); 11492 e.preventDefault(); 11493 cO.onleave.element.data('stop', true); 11494 } 11495 } 11496 }); 11497 } 11498 11499 /*Führt onclick aus*/ 11500 onclick(cO){ 11501 var self = this; 11502 var events = ''; 11503 const eventNames = cO.onclick != null && cO.onclick.events != null ? cO.onclick.events : ['click']; 11504 var passivListener = ''; 11505 for (const eventName of eventNames) { 11506 if(eventName === 'touchstart'){ 11507 passivListener += eventName; 11508 } 11509 else events += ' '+eventName + '.' + cO.id; 11510 } 11511 if(passivListener !== ''){ 11512 cO.element.get(0).addEventListener('touchstart', function(e){ 11513 cO.leave = cO.element.data('leave'); /*Element wurde verlassen*/ 11514 cO.stop = cO.element.data('stop'); /*Funktion wurde gestoppt*/ 11515 if(typeof cO.onclick == 'function') cO.onclick(cO, e); 11516 else if(typeof cO.onclick === 'object' && typeof cO.onclick.function == 'function') cO.onclick.function(cO, e); 11517 self.reset(cO); 11518 }, { passive: true }); 11519 } 11520 if(events != ''){ 11521 cO.element.on(events, function(e){ 11522 cO.leave = cO.element.data('leave'); /*Element wurde verlassen*/ 11523 cO.stop = cO.element.data('stop'); /*Funktion wurde gestoppt*/ 11524 if(typeof cO.onclick == 'function') cO.onclick(cO, e); 11525 else if(typeof cO.onclick === 'object' && typeof cO.onclick.function == 'function') cO.onclick.function(cO, e); 11526 self.reset(cO); 11527 }); 11528 } 11529 }; 11530 11531 /*Führt onmouseout aus*/ 11532 onmouseout(cO){ 11533 var self = this; 11534 cO.element.on('mouseout.' + cO.id, function(e){ 11535 if(typeof cO.onmouseout == 'function'){ 11536 cO.onmouseout(cO, e); 11537 } 11538 }); 11539 }; 11540 11541 /*Führt onmouseover aus*/ 11542 onmouseover(cO){ 11543 var self = this; 11544 cO.element.on('mouseover.' + cO.id, function(e){ 11545 if(typeof cO.onmouseover == 'function'){ 11546 cO.onmouseover(cO, e); 11547 } 11548 }); 11549 }; 11550 11551 /*Führt onfocusout aus*/ 11552 onfocusout(cO){ 11553 var self = this; 11554 cO.element.on('focusout.' + cO.id, function(e){ 11555 if(typeof cO.onfocusout == 'function'){ 11556 setTimeout(() => { 11557 const active = document.activeElement; 11558 if (!jQuery(this).get(0).contains(active)) { 11559 cO.onfocusout(cO, e); 11560 } 11561 }, 0); 11562 } 11563 }); 11564 }; 11565 11566 /*Führt onfocusin aus*/ 11567 onfocusin(cO){ 11568 var self = this; 11569 cO.element.on('focusin.' + cO.id, function(e){ 11570 if(typeof cO.onfocusin == 'function'){ 11571 setTimeout(() => { 11572 const active = document.activeElement; 11573 if(jQuery(this).get(0).contains(active)) { 11574 cO.onfocusin(cO, e); 11575 } 11576 }, 0); 11577 } 11578 }); 11579 }; 11580 11581 /*Deaktivert für alle focusierbaren Unter-Elemente den Tabindex*/ 11582 deactivateTabindex(element){ 11583 var focusable = 'input, textarea, select, button, a[href], [tabindex], [aria-role="button"]'; 11584 jQuery(element).find(focusable).attr('tabindex', -1); 11585 } 11586 11587 /*Aktivert für alle focusierbaren Unter-Elemente den Tabindex*/ 11588 activateTabindex(element){ 11589 var focusable = 'input, textarea, select, button, a[href], [tabindex], [aria-role="button"]'; 11590 jQuery(element).find(focusable).attr('tabindex', 0); 11591 } 11592 11593 /*Setzt auf ein Element den Focus wenn es nicht dem document.activeElement entspricht*/ 11594 setFocusToCurElement(elementTarget, options = {}){ 11595 var self = this; 11596 var curFocusedE = jQuery(document.activeElement); 11597 var setFocus = false 11598 if(curFocusedE !== elementTarget && jQuery('#blockPageInner').find(elementTarget).length > 0) setFocus = true; 11599 if(setFocus){ 11600 var focusElement = null 11601 if(self.isFocusableElement(elementTarget)) focusElement = elementTarget; 11602 else focusElement = self.getNextFocusableElement({element: elementTarget}); 11603 focusElement.data('tabindex', focusElement.attr('tabindex'));
11604 if(focusElement.length == 1) focusElement.attr('tabindex', 0).focus(); 11605 focusElement.data('tabindex') == undefined ? focusElement.removeAttr('tabindex') : focusElement.attr('tabindex', focusElement.data('tabindex')); 11606 } 11607 } 11608 11609 /*Prüft ob eine element focussierbar ist*/ 11610 isFocusableElement(element){ 11611 var curE = jQuery(element); 11612 if(curE.length === 0 || curE == null) return false; 11613 var result = true; 11614 if(curE.is(':hidden') || curE.css('visiblity') === 'hidden') result = false; 11615 var nodeName = curE[0].nodeName.toLowerCase(); 11616 var tabIndex = curE.attr('tabindex'); 11617 const focusableTags = ['input', 'select', 'textarea', 'button', 'object', 'a']; 11618 if(focusableTags.indexOf(nodeName) !== -1){ 11619 if(curE.disabled) result = false; 11620 if(nodeName === "a" && !curE.get(0).hasAttribute('href')) result = false; 11621 } 11622 if(tabIndex != null && tabIndex === '-1') result = false; 11623 return result; 11624 } 11625 11626 /*Setzt wichtige Status zurück*/ 11627 reset(cO){ 11628 cO.element.data({'leave' : false, 'stop' : false}); 11629 cO.leave = false; 11630 cO.stop = false; 11631 } 11632 11633 setFocusOnReload(id){ 11634 sessionStorage.setItem('accessHandlerFocusId', id); 11635 } 11636 11637 /*Prüft ob ein Element das letzte Focussierbare Element in einem Baum ist*/ 11638 isLastFocusableElement(cO, element){ 11639 var self = this; 11640 var focusable = 'input, textarea, select, button, a[href], [tabindex="0"], [aria-role="button"], video[controls=controls]'; 11641 var fE = cO.element.find(focusable).filter(':visible'); 11642 var lastFE = fE.last(); 11643 if(lastFE.is(element)) return true; 11644 return false; 11645 } 11646 11647 /*Prüft ob ein Element das erste focussierbare Element in einem Baum ist*/ 11648 isFirstFocusableElement(cO, element){ 11649 var self = this; 11650 var focusable = 'input, textarea, select, button, a[href], [tabindex="0"], [aria-role="button"], video[controls=controls]'; 11651 var fE = cO.element.find(focusable).filter(':visible'); 11652 var firstFE = fE.first(); 11653 if(firstFE.is(element)) return true; 11654 return false; 11655 } 11656 11657 /*Gibt das nächste fokussierbare Element einer Baum-Struktur zurück*/ 11658 getNextFocusableElement(cO, ancestors = '', noSelf = false){ 11659 var self = this; 11660 var focusable = 'input, textarea, select, button, a[href], [tabindex="0"], [aria-role="button"]'; 11661 var result = cO.element; 11662 var nextElements = cO.element.find(focusable); 11663 if(!noSelf && nextElements.length > 0){ 11664 result = nextElements.first(); 11665 } 11666 else{ 11667 ancestors = Array.isArray(ancestors.split("|")) ? ancestors.split('|') : [ancestors]; 11668 for (let i = 0; i < ancestors.length; i++) { 11669 var nextElement = cO.element.closest(ancestors[i]).next(); 11670 if(nextElement.length > 0 && !wAccessHandler.isFocusableElement(nextElement)){ 11671 var nextElements = nextElement.find(focusable); 11672 if(nextElements.length !== 0){ 11673 result = nextElements.first(); 11674 break; 11675 } 11676 } 11677 else if(nextElement.length > 0){ 11678 result = nextElement; 11679 break; 11680 } 11681 } 11682 } 11683 return result; 11684 } 11685 11686 /*Aktiviert den LayerListener, der auf Events hört auÃerhalb eines Layers*/ 11687 activateLayerListener(cO, e){ 11688 var layerE = cO.element; 11689 var id = cO.id; 11690 var self = this; 11691 var eventObject = jQuery(document); 11692 var focusAfterOpen = null; 11693 11694 if(self.activeListenerObjects != null && self.activeListenerObjects.indexOf(id) === -1) self.activeListenerObjects.push(id); 11695 if(self.listenerObjects[id] == null) self.listenerObjects[id] = cO; 11696 if(self.activeListenerObjects.indexOf(id) !== -1){ 11697 window.setTimeout(function(){ 11698 eventObject.off('keydown.layerListener click.keydown.layerListener').on('keydown.layerListener click.keydown.layerListener', {id : id}, function(e){ 11699 11700 /*Lese hier die Id aus und suche dann das passende LayerObject*/ 11701 var layerO = wAccessHandler.listenerObjects[e.data.id]; 11702 var close = false; 11703 var target = jQuery(e.target); 11704 var isDesc = layerO.element.find(target).length > 0; 11705 var isToggler = target.is(layerO.toggler); 11706 var isWall = layerO.isWall != null ? layerO.isWall : false;
11707 var closeOnClickList = Array.isArray(layerO.closeOnClick) ? layerO.closeOnClick : [layerO.closeOnClick]; 11708 11709 /*Diese Deklaration ist notwendig, um zu verhindern, dass der Layer über andere Events (zb Blättern des Banners) geschlossen wird */ 11710 var closeOnClick = false; 11711 closeOnClickList.forEach(function(closeOnClickE){ 11712 if(closeOnClickE != null && closeOnClickE.is(target)) closeOnClick = true; 11713 }); 11714 11715 if(!isWall && e.type == 'click' && !closeOnClick && !isToggler) close = false; 11716 else if(!isWall && e.type === 'click' && (!isDesc||isToggler|closeOnClick)) close = true; 11717 else if(!isWall && e.key === 'Enter' && isToggler) close = true; 11718 else if(!isWall && e.key === 'Escape'){ close = true; } 11719 else if(e.key === 'Tab'){ 11720 var focus = false; 11721 if(!isDesc) focus = true; 11722 else if(wAccessHandler.isLastFocusableElement(layerO, target)) focus = true; 11723 if(focus){ 11724 e.preventDefault(); 11725 if(cO.focusAfterOpen != null) cO.focusAfterOpen.focus(); 11726 else layerE.attr('tabindex', '0').focus(); 11727 e.stopPropagation(); 11728 e.stopImmediatePropagation(); 11729 } 11730 } 11731 11732 if(close){ 11733 /*Auf objekteigene SchlieÃenfunktionen prüfen und ausführen*/ 11734 if(typeof cO.closeLayer === 'function') cO.closeLayer(cO, e); 11735 else if(cO.toggler != null){ 11736 self.deactivateLayerListener(cO, e); 11737 cO.toggler.trigger('click'); 11738 } 11739 } 11740 11741 e.stopPropagation(); 11742 e.stopImmediatePropagation(); 11743 }); 11744 }, 10); 11745 } 11746 } 11747 11748 /*deactiviert den LayerListener, der auf Events hört auÃerhalb eines Layers*/ 11749 deactivateLayerListener(cO, e){ 11750 var self = this; 11751 var eventObject = jQuery(document); 11752 self.activeListenerObjects = self.activeListenerObjects.filter(item => item !== cO.id); 11753 eventObject.off('keydown.layerListener click.keydown.layerListener'); 11754 if(self.activeListenerObjects.length > 0){ 11755 self.activateLayerListener(self.listenerObjects[self.activeListenerObjects[self.activeListenerObjects.length-1]], e); 11756 } 11757 } 11758 11759}; 11760 11761var wAccessHandler = new wClassAccessHandler(); 11762var wAccessEvents = []; 11763 11764if(wTexts == null) var wTexts = []; 11765if(wTexts['de'] == null) wTexts['de'] = []; 11766if(wTexts['en'] == null) wTexts['en'] = []; 11767 11768/* 11769 wAccessEvents, werden dem wAccessHandler über addEvent hinzugefügt. 11770 Können zum Beispiel direkt zugewiesen werden oder über data-accessevent="id" 11771*/ 11772 11773/*Suche im Kopfbereich */ 11774wAccessEvents['searchbox'] = { 11775 id : 'searchbox', 11776 element : jQuery('.searchBoxLabel'), 11777 11778 onclick : function(cO, e){ 11779 if(cO.leave || cO.stop) cO.element.closest('.searchBoxContainer').removeClass('open'); 11780 else cO.element.closest('.searchBoxContainer').addClass('open'); 11781 }, 11782 11783 onkeydown : { 11784 keyEscape : {trigger: 'onclick', leave : true}, 11785 keyEnter : {trigger: 'onclick'} 11786 } 11787}; 11788 11789wAccessEvents['searchinput'] = { 11790 id : 'searchinput', 11791 element : jQuery('.searchBoxContainer').find('input.searchTerm'), 11792 onleave : {trigger: 'onclick', stop : true, element : jQuery('.searchBoxLabel'), events: {mouseout : false}} 11793}; 11794 11795/* 11796 global.Select 11797 Wird als Grundlage für Elemente verwendet, die über ein individuelles Selectfeld verfügen, 11798 wie zB. den LanguageSelector verwendet. 11799*/ 11800 11801wAccessEvents['global.select'] = { 11802 id : 'global.selector', 11803 element : null, 11804 containerOptions : [], 11805 isOpened : false, 11806 11807 onclick : function(cO, e){ 11808 var target = jQuery(e.target); 11809 if(!cO.isOpened && cO.containerOptions.find(target).length === 0) cO.open(cO, e); 11810 else cO.close(cO, e); 11811 11812 if(cO.isOpened){ 11813 cO.element.on('mouseout', function(e){ 11814 cO.close(cO, e); 11815 }); 11816 } 11817 }, 11818 11819 onkeydown : { 11820 keyEnter : { trigger : 'onclick' }, 11821 keyTab : function(cO, e){ 11822 var target = jQuery(e.target); 11823 var close = false; 11824 /*Target ist innerhalb der EntriesListe */ 11825 if(cO.containerOptions.find(target).length > 0){ 11826 if(wAccessHandler.isLastFocusableElement({element : cO.containerOptions}, target)) close = true; 11827 } 11828 if(close){ 11829 cO.close(cO, e); 11830 } 11831 }, 11832 11833 keyEscape : function(cO, e){ 11834 cO.close(cO, e); 11835 } 11836 } 11837}; 11838 11839/* Event für den LanguageSelector - basierend auf global.select */ 11840/* Event für den LanguageSelector - basierend auf global.select */ 11841wAccessEvents['languageSelector'] = Object.assign(wAccessEvents['global.select'], { 11842 id : 'languageSelector', 11843 11844 onready : function (cO, e){ 11845 var langSel = cO.element.find('#languageSelected'); 11846 if(langSel.length > 0){ 11847 langSel.attr('tabindex', 0).find('span.opener').removeAttr('tabindex'); 11848 } 11849 11850 var langSelectable = cO.element.find('#languageSelectable'); 11851 cO.containerOptions = langSelectable; 11852 11853 cO.onkeydown.tabindex = -1; 11854 return true; 11855 }, 11856
11857 open : function(cO, e){ 11858 cO.isOpened = true; 11859 cO.element.addClass('open'); 11860 }, 11861 11862 close : function (cO, e){ 11863 cO.isOpened = false; 11864 cO.element.removeClass('open'); 11865 } 11866}); 11867 11868 11869/*Layer- Events */ 11870 11871/*Event für die CookieNotice */ 11872wAccessEvents['cookieNotice'] = { 11873 element : jQuery('#cookieNotice'), 11874 //listener : wAccessEvents['layerListener'], 11875 toggler : jQuery('#cookieNotice').find('#cookieNoticeCloser'), 11876 closeOnClick : [jQuery('#cookieNotice').find('div#cookieNoticeInner')], 11877 focusAfterOpen : jQuery('#cookieNotice').find('div#cookieNoticeInner'), 11878 isActive : undefined, /*undefined zur Abfrage ob geöffnet*/ 11879 11880 activate : function(cO, options = [], e) { 11881 cO.isActive = true; 11882 cO.isWall = options['isWall'] != null ? options['isWall'] : false; 11883 var focusElement = jQuery('#cookieNoticeCloser'); 11884 if(!wAccessHandler.isFocusableElement(focusElement)) focusElement = wAccessHandler.getNextFocusableElement({element : focusElement.next()}, cO.focusOpen); 11885 cO.focusAfterOpen = focusElement; 11886 wAccessHandler.activateLayerListener(cO, e); 11887 }, 11888 11889 deactivate : function(cO,e){ 11890 cO.isActive = false; 11891 wAccessHandler.deactivateLayerListener(cO, e); 11892 } 11893 11894}; 11895 11896/*Event für die Inhaltsboxen als Hinweislayer */ 11897wAccessEvents['container.box.infoLayerWithToggler'] = { 11898 toggler : null, 11899 cookieSet : false, 11900 11901 onready: function(cO, e){ 11902 var id = cO.element.attr('data-infoid') != null ? cO.element.attr('data-infoid') : cO.id; 11903 var curE = cO.element; 11904 curE.prepend('<div class="boxInnerToggler" tabindex="0"></div>'); 11905 cO.cookieId = 'hasShownInfo' + id; 11906 cO.showOnlyOnce = curE.attr('data-showonlyonce') != null ? curE.attr('data-showonlyonce') : ''; 11907 cO.timeToHideAuto = curE.attr('data-timehideauto') != null ? curE.attr('data-timehideauto') * 1000 : 0; 11908 cO.classToAddAfterTime = curE.attr('data-classtoaddaftertime') != null ? curE.attr('data-classtoaddaftertime') : 'isOpen'; 11909 cO.classToRemoveAfterTime = curE.attr('data-classtoremoveaftertime') != null ? curE.attr('data-classtoremoveaftertime') : 'isClosed'; 11910 cO.animateAfterTime = curE.attr('data-animateaftertime') != null ? curE.attr('data-animateaftertime') * 1000 : 0; 11911 if(typeof(wEditor) == 'undefined' && document.cookie.indexOf(cO.cookieId + '=1') != -1){ 11912 curE.attr('data-hasshownonce', '1'); 11913 } 11914 11915 if(cO.animateAfterTime !== 0 && (cO.showOnlyOnce !== '1' || document.cookie.indexOf(cO.cookieId + '=1') == -1)){ 11916 window.setTimeout(function(){ 11917 cO.openLayer(cO); 11918 }, cO.animateAfterTime); 11919 } 11920 else cO.openLayer(cO); 11921 11922 if(cO.timeToHideAuto !== 0){ 11923 window.setTimeout(function(){ 11924 cO.closeLayer(cO); 11925 }, cO.timeToHideAuto); 11926 } 11927 11928 return true; 11929 }, 11930 11931 onclick: function(cO, e){ 11932 cO.setCookie(cO, e); 11933 }, 11934 11935 openLayer : function(cO, e) { 11936 self = this; 11937 cO.element.addClass(cO.classToAddAfterTime).removeClass(cO.classToRemoveAfterTime); 11938 cO.toggler = cO.element.find('.boxInnerToggler'); 11939 cO.setCookie(cO, e); 11940 wAccessHandler.activateLayerListener(cO, e); 11941 }, 11942 11943 closeLayer : function (cO, e){ 11944 cO.element.removeClass(cO.classToAddAfterTime).addClass(cO.classToRemoveAfterTime); 11945 cO.setCookie(cO, e); 11946 wAccessHandler.deactivateLayerListener(cO, e); 11947 }, 11948 11949 setCookie : function(cO, e){ 11950 var self = this; 11951 var executeCookieSet = function() { 11952 if(typeof(wEditor) === 'undefined' && !self.cookieSet && !wAccessEvents['cookieNotice'].isActive) { 11953 document.cookie = cO.cookieId + '=1;path=/;sameSite=lax'; 11954 self.cookieSet = true; 11955 } 11956 }; 11957 if(jQuery('#cookieNotice').length > 0) { 11958 var waitForCookieNotice = function() { 11959 if(typeof wAccessEvents['cookieNotice'].isActive === 'undefined') { 11960 setTimeout(waitForCookieNotice, 100); 11961 return; 11962 } 11963 executeCookieSet(); 11964 }; 11965 waitForCookieNotice(); 11966 } 11967 else executeCookieSet(); 11968 } 11969}; 11970 11971/* 11972 global.listEntry 11973 Wird als Grundlage für Listeeinträge verwendet 11974 11975*/ 11976 11977wAccessEvents['global.listEntry'] = { 11978 accessibilityRules : 'standard', 11979 11980 onready : function(cO){ 11981 if(typeof cO.onBeforeReady == 'function') cO.onBeforeReady(cO); 11982 if(cO.element.find('[href="'+cO.element.attr('data-url')+'"]').length > 0){ 11983 cO.element.removeAttr('aria-label').on('click', function(e){ 11984 cO.onclick(cO, e); 11985 }); 11986 return false;
11987 } 11988 else if(cO.element.find('a').length == 0) cO.element.attr('role', 'link'); 11989 return true; 11990 }, 11991 11992 onclick : function(cO, e){ 11993 if (e.target.tagName === 'A') return false; 11994 wOpenURL(cO.element.attr('data-url'), cO.element.attr('data-target'), typeof cO.getOpenUrlElement === 'function' ? cO.getOpenUrlElement(cO) : cO.element.get(0)); 11995 return false; 11996 }, 11997 11998 onkeydown: { 11999 keyEnter: { trigger: 'onclick' } 12000 } 12001}; 12002 12003/*Event für Standard-Listen*/ 12004wAccessEvents['default.listEntry'] = Object.assign({ 12005 onBeforeReady : function(cO){ 12006 if(cO.element.find('[data-accessevent="default.listEntry"]').length == 0) cO.element.removeAttr('onclick'); 12007 }, 12008 12009 getOpenUrlElement : function(cO){ 12010 return cO.element.hasClass('listEntryInner') ? cO.element.parent().get(0) : cO.element.get(0); 12011 } 12012}, wAccessEvents['global.listEntry']); 12013 12014/*Event für Banner-Listen*/ 12015wAccessEvents['bannerSlider.listEntry'] = Object.assign({ 12016 onBeforeReady : function(cO){ 12017 if(cO.element.find('[data-accessevent="bannerSlider.listEntry"]').length == 0) cO.element.removeAttr('onclick').removeAttr('onkeyup').removeAttr('tabindex'); 12018 }, 12019 12020}, wAccessEvents['global.listEntry']); 12021 12022wAccessEvents['container.box.standard'] = { 12023 accessibilityRules : 'standard', 12024 12025 onready : function(cO){ 12026 var result = true; 12027 if(cO.element.find('[data-accessevent="container.box.standard"]').length == 0) cO.element.removeAttr('onclick').removeAttr('onkeyup').removeAttr('tabindex'); 12028 if(cO.element.find('[href="'+cO.element.attr('data-url')+'"]').length > 0){ 12029 cO.element.removeAttr('aria-label').on('click', function(e){cO.onclick(cO, e);}); 12030 result = false;
12031 } 12032 else if(cO.element.find('a').length == 0) cO.element.attr('role', 'link'); 12033 return result; 12034 }, 12035 12036 onclick : function(cO, e){ 12037 wOpenURL(cO.element.attr('data-url'), cO.element.attr('data-target'), cO.element.get(0)); 12038 return false; 12039 }, 12040 12041 onkeydown: { 12042 keyEnter: { trigger: 'onclick' } 12043 } 12044}; 12045 12046wAccessEvents['linkList.listEntry'] = {accessibilityRules : 'standard'}; 12047wAccessEvents['link.standard'] = {accessibilityRules : 'standard'}; 12048 12049wTexts['de']['smartSliderAria_forward'] = 'Vorwärts blättern'; 12050wTexts['de']['smartSliderAria_back'] = 'Zurück blättern'; 12051 12052wAccessEvents['smartSlider.pageNavi'] = { 12053 onresize : function(cO){ 12054 cO.element.attr('aria-label', wGetText('smartSliderAria_' + (cO.param != null ? cO.param[0] : ''))); 12055 var eCS = cO.element.closest('.elementContainerStandard'); 12056 if(eCS.attr('data-numberpages') != '1') cO.element.attr('tabindex', 0); 12057 else cO.element.removeAttr('tabindex'); 12058 }, 12059 12060 onkeydown :{ 12061 keyEnter: { 12062 trigger: 'onclick', 12063 tabindex: '-1', 12064 onafterclick : function(cO, e){ 12065 var eCS = cO.element.closest('.elementContainerStandard'); 12066 if(eCS.length > 0){ 12067 const cI = setInterval(function() { 12068 if(cO.param == null) clearInterval(cI); 12069 if (eCS.attr('data-moving') != 1){ 12070 if(cO.param[0] == 'forward' && eCS.attr('data-islastentry') == 1) eCS.find('[data-accessevent="smartSlider.pageNavi(back)"]').focus(); 12071 if(cO.param[0] == 'back' && eCS.attr('data-isfirstentry') == 1) eCS.find('[data-accessevent="smartSlider.pageNavi(forward)"]').focus(); 12072 clearInterval(cI); 12073 }}, 200); 12074 setTimeout(function() {clearInterval(cI);}, 800); 12075 } 12076 } 12077 } 12078 } 12079}; 12080 12081/*AccessEvent Lightbox */ 12082wAccessEvents['wLightbox'] = { 12083 element : jQuery('html.wglBox'), 12084 openedByElement : null, 12085 elementsRel : null, 12086 parent : null, 12087 12088 onready : function(cO, e){ 12089 cO.lightbox = jQuery('.wLightbox'); 12090 cO.lightbox.attr('tabindex', 0).focus().removeAttr('tabindex'); 12091 cO.moveObject = { next : jQuery('.wLightboxMoverForward'), back : jQuery('.wLightboxMoverBack')}; 12092 cO.element.find('.wLightboxPlayer, .wLightboxFullscreen, .wLightboxCloser, .wLightboxMoverBack, .wLightboxMoverForward').attr('tabindex', 0); 12093 cO.closer = cO.element.find('.wLightboxCloser'); 12094 return true; 12095 }, 12096 12097 onkeydown : { 12098 keyTab : function(cO, e){ 12099 if(wAccessHandler.isLastFocusableElement({element : cO.lightbox}, jQuery(e.target))){ 12100 cO.closer.focus(); 12101 event.stopPropagation(); 12102 event.stopImmediatePropagation(); 12103 event.preventDefault(); 12104 } 12105 }, 12106 keyArrowLeft: function(cO, e){ if(cO.moveObject.back.length > 0) cO.move(cO, 'back')}, 12107 keyArrowRight: function(cO, e){ if(cO.moveObject.next.length > 0) cO.move(cO, 'next')}, 12108 keyEnter : function(cO,e){ 12109 var target = jQuery(e.target); 12110 if(target.is('.wLightboxMoverForward')) cO.move(cO, 'next'); 12111 else if(target.is('.wLightboxMoverBack')) cO.move(cO, 'back'); 12112 else if(target.is('.wLightboxPlayer')) target.trigger('click').focus(); 12113 else if(target.is('.wLightboxFullscreen')) target.trigger('click').focus(); 12114 else if(target.is('.wLightboxCloser')) cO.closeLightbox(cO, e); 12115 }, 12116 keyEscape : function(cO, e){ 12117 if(cO.parent != null){ 12118 cO.parent.get(0).postMessage({ action: 'closeLightbox' }, '*'); 12119 } 12120 else cO.closeLightbox(cO, e); 12121 } 12122 }, 12123 12124 move : function(cO, move){ 12125 var curE = jQuery(cO.elementsRel[parseInt(cO.moveObject[move].data('entry'))]); 12126 if(curE.length > 0){ 12127 curE.trigger('click'); 12128 cO.lightbox.attr('data-lastdirection', move); 12129 cO.moveObject[move].focus(); 12130 } 12131 }, 12132 12133 closeLightbox : function(cO, e){ 12134 wLightboxClose(e); 12135 if(cO.openedByElement != null && cO.openedByElement.length > 0) cO.openedByElement.focus(); 12136 } 12137}; 12138 12139wAccessEvents['wLightboxImage'] = jQuery.extend(true, {}, wAccessEvents['wLightbox']); 12140 12141/*Video -- erstelle Deep-Copy von wLightbox und überlagert Funktionen*/ 12142wAccessEvents['wLightboxVideo'] = jQuery.extend(true, {}, wAccessEvents['wLightbox']); 12143 12144wAccessEvents['wLightboxVideo'].onkeydown.keyTab = function(cO, e){ 12145 var target = jQuery(e.target); 12146 if(cO.lightbox.find('video[controls=controls]').length > 0){ 12147 if(e.target.nodeName === 'VIDEO' && wAccessHandler.isLastFocusableElement({element : cO.lightbox}, jQuery(e.target))){ 12148 /*Künstlich eingefügtes Element, falls hinter video kein fokussierbares Element enthalten ist.*/ 12149 cO.lightbox.find('video').next().prepend('<div style="visiblity:hidden;opacity:0;height:0;width:0;" tabindex="0"></div>'); 12150 } 12151 cO.lightbox.find('video').off('focusout').on('focusout', {event : e, cO : cO}, function(e){ 12152 e.preventDefault(); 12153 cO.closer.focus(); 12154 }); 12155 } 12156}; 12157 12158/*Iframe -- erstelle Deep-Copy von wLightbox und überlagert Funktionen*/ 12159wAccessEvents['wLightboxIframe'] = jQuery.extend(true, {}, wAccessEvents['wLightbox']); 12160 12161wAccessEvents['wLightboxIframe'].onready = function(cO, e){ 12162 /*Innerhalb des Iframes*/ 12163 if(parent != self){ 12164 cO.parent = jQuery(window.parent); 12165 } 12166 else{ 12167 cO.lightbox = jQuery('.wLightbox'); 12168 cO.lightbox.attr('tabindex', 0).focus().removeAttr('tabindex'); 12169 cO.moveObject = { next : jQuery('.wLightboxMoverForward'), back : jQuery('.wLightboxMoverBack')}; 12170 cO.element.find('.wLightboxCloser, .wLightboxMoverBack, .wLightboxMoverForward').attr('tabindex', 0); 12171 cO.closer = cO.element.find('.wLightboxCloser'); 12172 12173 /*Anmelden Event das auf Message aus der Lightbox hört*/ 12174 jQuery(window).on('message.lightbox', {cO : cO}, function(e){ 12175 var data = e.originalEvent.data; 12176 var cO = e.data.cO; 12177 if(data.action == 'focusCloser') cO.closer.attr('tabindex', '0').focus(); 12178 else if(data.action == 'closeLightbox') cO.closeLightbox(cO, e); 12179 }); 12180 cO.closer.focus(); 12181 } 12182 return true; 12183}; 12184 12185wAccessEvents['wLightboxIframe'].onkeydown.keyTab = function(cO, e){ 12186 /*Innerhalb des Iframes*/ 12187 if(cO.parent != null && wAccessHandler.isLastFocusableElement(cO, jQuery(e.target))){ 12188 cO.parent.get(0).postMessage({ action: 'focusCloser' }, '*'); 12189 event.stopPropagation(); 12190 event.stopImmediatePropagation(); 12191 event.preventDefault(); 12192 } 12193}; 12194 12195wAccessEvents['wLightboxIframe'].closeLightbox = function(cO, e){ 12196 wLightboxClose(e); 12197 if(cO.openedByElement != null && cO.openedByElement.length > 0) cO.openedByElement.focus(); 12198 jQuery(window).off('message.lightbox'); 12199}; 12200 12201/*Container mit Registerlaschen */ 12202wAccessEvents['containerTab'] = { 12203 activate : 'auto', /*[default|auto] - aktiviert das tab-Elemente automatisch sobald focus [auto] oder per enter [default]*/ 12204 12205 onready : function(cO){ 12206 cO.element.find('.tabs').children('.tab').each(function(){ 12207 aE = jQuery.extend(true, {element : jQuery(this)}, wAccessEvents['containerTab.tab']); 12208 aE.activate = cO.activate; 12209 wAccessHandler.addEvent(aE, {'idPrefix' : 'containerTab.tab'}); 12210 }); 12211 12212 cO.element.find('.containers').children('.container').each(function(){ 12213 aE = jQuery.extend(true, {element : jQuery(this)}, wAccessEvents['containerTab.container']); 12214 aE.activate = cO.activate; 12215 wAccessHandler.addEvent(aE, {'idPrefix' : 'containerTab.container'}); 12216 }); 12217 return true; 12218 }, 12219
12220 onfocusin : function(cO, e){ 12221 console.log('focusIn ' + cO.element.data('focusedout')); 12222 if(cO.element.data('focusedout') == null || cO.element.data('focusedout') == '1'){ 12223 var currTab = cO.element.find('.tabSelected'); 12224 currTab.attr('tabindex', '0').attr('aria-selected', 'true').focus(); 12225 currTab.siblings().attr('tabindex', '-1').attr('aria-selected', 'false'); 12226 //todelete 12.2026 if(cO.element.data('focusedoutlast') == '1') cO.element.find('.tab').last().focus(); 12227 wAccessHandler.activateTabindex(cO.element.find('.containerSelected')); 12228 cO.element.data('focusedout', '0'); 12229 //todelete 12.2026 cO.element.data('focusedout', '0').data('focusedoutlast', '0'); 12230 } 12231 }, 12232 12233 onfocusout : function(cO, e){ 12234 cO.element.data('focusedout', '1'); 12235 /*todelete 12.2026 var lastTab = cO.element.find('.tab').last(); 12236 if(jQuery(e.target).attr('id') == lastTab.attr('id')) cO.element.data('focusedoutlast', '1');*/ 12237 wAccessHandler.deactivateTabindex(cO.element.find('.containerSelected')); 12238 } 12239}; 12240 12241/*Events die nur für den Tab-Elemente eines Tab-Containers gelten, initalisiert von containerTab*/ 12242wAccessEvents['containerTab.tab'] = { 12243 container : null, 12244 tabContainer : null, 12245 activate : null, /*wird gesetzt von containerTab */ 12246 12247 onready : function(cO){ 12248 var id = cO.element.attr('id').replace('tab_', 'container_'); 12249 //todelete 12.2026 if(!cO.element.hasClass('.tabSelected')) cO.element.attr('tabindex', '-1'); 12250 cO.tabContainer = cO.element.closest('.elementTabContainer'); 12251 cO.container = cO.tabContainer.find('#' + id); 12252 cO.element.data('aeid', cO.id); 12253 return true; 12254 }, 12255 12256 moveFocus : function(cE, pos, activate){ 12257 var nE = pos == '+' ? cE.next() : cE.prev(); 12258 if(pos == '+' && nE.length == 0){ 12259 nE = cE.siblings().first(); 12260 } 12261 else if(pos == '-' && nE.length == 0){ 12262 nE = cE.siblings().last(); 12263 } 12264 else if(pos == 'HOME'){ 12265 console.log('HOME'); 12266 if(cE.prev().length == 0) nE = cE; 12267 else nE = cE.siblings().first(); 12268 } 12269 else if(pos == 'END'){ 12270 if(cE.next().length == 0) nE = cE; 12271 else nE = cE.siblings().last(); 12272 } 12273 cE.siblings().attr('tabindex', '-1'); 12274 nE.attr('tabindex', '0').get(0).focus(); 12275 if(activate == 'auto') nE.trigger('click'); 12276 }, 12277 12278 onkeydown : { 12279 keyEnter : function(cO, e) { /*Enter Aktiviert den fokussierten Tab*/ cO.element.trigger('click'); }, 12280 keySpace : function(cO, e) { /*Space ktiviert den fokussierten Tab*/ cO.element.trigger('click'); }, 12281 keyArrowLeft : function(cO, e){ cO.moveFocus(cO.element, '-', cO.activate); }, 12282 keyArrowRight : function(cO, e){ cO.moveFocus(cO.element, '+', cO.activate); }, 12283 keyTab : function(cO, e){ 12284 //console.log('keyTab Springt in die Tab-Leiste - beim nächsten Tab in den aktuell aktivierten Tab-Inhalt!'); 12285 var nextE = null; 12286 if(cO.element.hasClass('tabSelected')){ 12287 nextE = cO.container; 12288 } 12289 /*todelete 12.2026 else if(cO.element.next('.tabSelected').length > 0){ 12290 nextE = wAccessHandler.getEvent(cO.element.next('.tabSelected').data('aeid')); 12291 nextE = nextE.container; 12292 } 12293 else if(cO.element.next('.tab').length === 0 && !cO.element.hasClass('.tabSelected')){ 12294 nextE = cO.tabContainer.next(); 12295 } 12296 */ 12297 if(nextE !== null){ 12298 var nextFE = wAccessHandler.getNextFocusableElement({element : nextE}); 12299 if(wAccessHandler.isFocusableElement(nextFE)){ 12300 nextFE.focus(); 12301 e.preventDefault(); 12302 e.stopPropagation(); 12303 } 12304 } 12305 } 12306 } 12307}; 12308 12309/*Events die nur für den Inhaltscontainer eines Tab-Containers gelten, initalisiert von containerTab*/ 12310wAccessEvents['containerTab.container'] = { 12311 tab : null, 12312 activate : null, /*wird gesetzt von containerTab */ 12313 12314 onready : function(cO){ 12315 var id = cO.element.attr('id').replace('container_', 'tab_'); 12316 cO.tab = cO.element.closest('.elementTabContainer').find('#' + id); 12317 cO.element.data('aeid', cO.id); 12318 return true; 12319 }, 12320 12321 onfocusout : function(cO, e){ 12322 if(cO.tab.data('preventFocusOut') == "1") cO.tab.data('preventFocusOut', "0").focus(); 12323 }, 12324
12325 onkeydown : { 12326 tabindex : '-1', 12327 keyTabShift : function(cO, e){ 12328 var isFirstFE = wAccessHandler.isFirstFocusableElement(cO, jQuery(e.target)); 12329 if(isFirstFE) cO.tab.data('preventFocusOut', "1") 12330 }, 12331 12332 keyHome : function(cO, e){ 12333 var aE = wAccessHandler.getEvent(cO.tab.data('aeid')); 12334 aE.moveFocus(cO.tab, 'HOME', cO.activate); 12335 }, 12336 12337 keyEnd : function(cO, e){ 12338 var aE = wAccessHandler.getEvent(cO.tab.data('aeid')); 12339 aE.moveFocus(cO.tab, 'END', cO.activate); 12340 } 12341 } 12342 12343}; 12344 12345wAccessEvents['video.intern'] = { 12346 videoControls : null, 12347 isOn : false, 12348 shiftKey : false, 12349 12350 onready : function(cO, e){ 12351 cO.videoControls = cO.element.find('.videoControls'); 12352 //cO.element.find('video').attr('tabindex', '-1'); 12353 return true; 12354 }, 12355 12356 on : function(cO, e){ 12357 cO.init = true; 12358 cO.element.find('*[data-tabindex]').each(function(){ 12359 jQuery(this).attr('tabindex', jQuery(this).attr('data-tabindex')); 12360 }); 12361 12362 jQuery(document).off('keydown click').on('keydown click', {cO : cO}, function(e){ 12363 var cO = e.data.cO; 12364 var target = e.target; 12365 var reset = false; 12366 if(e.type == 'keydown' && e.key == 'Tab'){ 12367 if(e.shiftKey && wAccessHandler.isFirstFocusableElement(cO, target)) reset = true; 12368 else if(!e.shiftKey && wAccessHandler.isLastFocusableElement(cO, target)) reset = true; 12369 } 12370 else if(cO.element.find(target).length == 0) reset = true; 12371 if(reset) cO.off(cO, e); 12372 }); 12373 12374 }, 12375 12376 off : function (cO, e){ 12377 cO.isOn = false; 12378 cO.shiftKey = e.key != null && e.shiftKey ? true : false; 12379 cO.element.data('initTabindex', false).find('*[data-tabindex]').attr('tabindex', '0'); 12380 jQuery(document).off('keydown click'); 12381 }, 12382 12383 onfocusin : function(cO, e){ 12384 if(cO.videoControls.length > 0 && !cO.isOn) cO.on(cO, e); 12385 }, 12386 12387 onfocusout : function(cO, e){ 12388 //focusout steuert nur den focus - der DOM-Baum wird im on-Event zurückgesetzt. 12389 if(cO.videoControls.length > 0){ 12390 var next = null; 12391 if(cO.shiftKey) next = wAccessHandler.getPrevFocusableElement(cO); 12392 else next = wAccessHandler.getNextFocusableElement(cO, '.elementBox|.elementSection', true, true); 12393 next.get(0).focus(); 12394 } 12395 } 12396}; 12397 12398/* 12399 AccessEventHandler 12400 Meldet für HTML-Elemente die über data-accessevent-Definitionen verfügen, 12401 die zugehötigen AccessEvents beim AccessHandler an. 12402 */ 12403jQuery.fn.wAccessEventHandler = function(){ 12404 12405 if(typeof(wAccessibility) !== 'undefined' && wAccessibility['accessEventHandler'] != null && wAccessibility['accessEventHandler'].active === true){ 12406 jQuery(this).each(function(){ 12407 var eventId = jQuery(this).attr('data-accessevent'); 12408 var param = []; 12409 if(eventId.indexOf('(') !== -1){ 12410 var tmp = eventId.match(/\(([^)]*)\)/)?.[1] ?? ''; 12411 param = tmp.split('|'); 12412 eventId = eventId.split('(')[0]; 12413 } 12414 if(wAccessEvents[eventId] != null){ 12415 var aeO = Object.assign({}, wAccessEvents[eventId]); 12416 aeO.element = jQuery(this); 12417 if(param.length > 0){ 12418 aeO.param = param; 12419 } 12420 var options = { 12421 'idPrefix' : eventId, 12422 'accessibilityRules' : wAccessibility['accessEventHandler'] && wAccessibility['accessEventHandler'].accessibilityRules ? wAccessibility['accessEventHandler'].accessibilityRules : 'standard' 12423 }; 12424 wAccessHandler.addEvent(aeO, options); 12425 } 12426 }); 12427 } 12428}; 12429 12430function wDebounce(func, wait){ 12431 let timeout; 12432 12433 return function (...args){ 12434 const context = this; 12435 12436 clearTimeout(timeout); 12437 timeout = setTimeout(() => { 12438 func.apply(context, args); 12439 }, wait); 12440 }; 12441} 12442 12443function wSetObserverOptions(element){ 12444 if(jQuery(element).height()/window.innerHeight > 2){ 12445 wObserverOptions = {threshold: [0, 0.01, 0.05, 0.5]}; 12446 } 12447} 12448 12449/* 12450//////////////////////////////////////////////////////////////// 12451// 12452// Allgemeine JavaScript Funktionen 12453// 12454// Weblication CMS BASE 12455// erstellt durch Scholl Communications AG, 77694 Kehl, www.scholl.de 12456// erstellt mit Weblication Content Management Server, www.weblication.de 12457// 12458//////////////////////////////////////////////////////////////// 12459*/ 12460 12461/* 12462//////////////////////////////////////////////////////////////// 12463// 12464// Allgemeine JavaScript Funktionen 12465// 12466// Weblication CMS BASE 12467// erstellt durch Scholl Communications AG, 77694 Kehl, www.scholl.de 12468// erstellt mit Weblication Content Management Server, www.weblication.de 12469// 12470//////////////////////////////////////////////////////////////// 12471*/ 12472 12473wAllowMinimize = true; 12474 12475wLightboxVariants = {}; 12476 12477//Formatieren lassen sich die Lightboxen unter styles/includes/lightbox.scss 12478 12479wLightboxVariants['box'] = {class : 'default', postfix : 'viewmode=blank&linkback=no'}; 12480wLightboxVariants['boxPicture'] = {class : 'image', scrollIfToHeight : false, limitSizeIfPicture : true, addCopyrightElement : true, addPlayer : false, playerDuration : 5000, allowFullscreen : false}; 12481wLightboxVariants['boxGallery'] = {class : 'imageFull', scrollIfToHeight : false, limitSizeIfPicture : true, addCopyrightElement : true, addPlayer : true, playerDuration : 5000, showPlayerProgress : true, showEntryPosition : true, animation : 'slidefrombeside' /*[fadein|slidefrombeside|slideout|overlapfrombeside]*/ , allowFullscreen : true, allowTouchSlide : true, animationOverflow : 'visible'}; 12482wLightboxVariants['boxPdfViewer'] = {class : 'pdfViewer', scrollIfToHeight : false, limitSizeIfPicture : true, addCopyrightElement : false, showEntryPosition : true, showEntriesSelectable : true, showEntriesSelectableThumbnail : true, animation : 'overlapfrombeside' /*[fadein|slidefrombeside|slideout|overlapfrombeside]*/ , allowFullscreen : false, allowTouchSlide : true, animationOverflow : 'visible', allowFullscreen : false, allowDownload : true, allowZoom : true, animationOverflow : 'hidden', closeOnClickBackgroun
12482d : false, pushState : false, animationDuration : 400}; 12483wLightboxVariants['boxVideo'] = {class : 'video'}; 12484wLightboxVariants['boxYoutube'] = {class : 'youtube'}; 12485wLightboxVariants['boxContent'] = {class : 'content', postfix : 'viewmode=blank&linkback=no'}; 12486wLightboxVariants['boxForm'] = {class : 'form', postfix : 'viewmode=blank&linkback=no'}; 12487wLightboxVariants['boxCard'] = {class : 'card', postfix : 'viewmode=blank&linkback=no'}; 12488wLightboxVariants['boxCart'] = {class : 'cart', postfix : 'viewmode=blank&linkback=no'}; 12489 12490wAccessibility = {}; 12491wAccessibility['navigationTogglerDynamic'] = {active : false, class : 'sub-toggler'}; 12492wAccessibility['accessEventHandler'] = {active : false, accessibilityRules : {active : true, links : 'redundantTitleText|filetypes'}}; 12493wAccessibility['navigation'] = {active : true, toggler : {addData : 'eventInfo'}, dropdown : {allowHrefOnDesktop : true}}; 12494 12495wDoNotFireOnLoadBeforeReady = true; //Falls das onload-Ereignis auf jeden Fall nach dem onready-Ereignis gefeuert werden soll 12496wChangeScrollstatusOnAutoscrolling = false; //Falls beim automatischen Scrollen der Scrollstatus angepasst werden soll 12497wScrollSmoothToElementForceScroll = true; //Falls das Scrollen beim automatischen Scrollen zu einem Element erzwungen werden soll 12498wScrollSmoothToElementEasing = 'wEaseIn'; //Easing Funktion beim automatischen Scrollen zu einem Element 12499wAddEmptyInputValidators = true; //Falls auch leere Validatoren ergänzt werden sollen, um den Status durch Inline-Validierung zu erhalten 12500wResetConditionalFormdataOnHide = true; //Falls beim Ausblenden bedingter Formularfelder die Werte zurückgesetzt werden sollen 12501wResetConditionalFormdataOnHideIfTypeHidden = true; //Falls das Hiddenfeld innerhalb eines bedingten Formularkontainers die Werte löschen soll; wResetConditionalFormdataOnHide muss true sein. 12502wKeepNavigationSectionsIfNoTitle = true; //Falls Inhaltsbereiche ohne Titel die Auswahl der Bereichsnavigation nicht beeinflussen sollen 12503wSimulateBreakpointsInEmbededPage = true; //Falls die BildgröÃen zusätzlich auch in eingebetteten Seiten ermittelt werden sollen 12504wExecuteJsInEmbededPage = true; //Falls JavaScript in eingebetteten Seiten ausgeführt werden soll 12505wKeepIDsInEmbededPage = true; //Falls IDs in eingebetteten Seiten erhalten bleiben sollen 12506wHighlightBlockRoot = 'blockContentInner'; //Wurzelelement beim Hervorheben über den Highlight-Parameter 12507wCookieNoticeVar = ''; //Variante des Datenschutzhinweises. Falls sich dieser geändert hat, kann über einen anderen Wert das erneute Anzeigen erreicht werden. 12508wMinEnlargementToShowPictureZoomer = 1.2; //Das Zoom-Icon, um ein Bild zu vergröÃern wird nur dann angezeigt, wenn die VergröÃerung mindestens dem angegebenen Faktor entspricht. 12509wTrimInputsBeforeValidateOnBlur = true; //Falls Leerzeichen vor und nach dem Eingeabwert bei der Inline-Validierung gelöscht werden sollen. 12510wAddRandomIdToImagesInLightbox = true; //Falls durch eine Zufalls-ID sichergestellt werden soll, dass Bilder in der Lightbox immer neu geladen werden 12511wAddSelectedOnClickNavpoint = false; //Falls ein Navigationspunkt beim Klick sofort die Klasse selected ergänzt bekommen soll 12512wAddSelectedOnNavpointIfHashChanged = false; //Falls ein Navigationspunkt beim Ãndern des URL-Hashes die Klasse selected ergänzt bekommen soll 12513wToggleOnClickNavpointInMenu = false; //In der Menünavigation werden Unterpunkte beim Klick auf einen Navigationspunkt geöffnet, falls diese nicht sichtbar sind 12514wToggleOnClickNavpointMainInMenu = false; //In der Menünavigation werden Unterpunkte der Hauptpunkte beim Klick auf einen Navigationspunkt geöffnet, falls diese nicht sichtbar sind 12515wAddAccessDocumentOnPdfsIfAndroid = true; //Falls PDFs beim Einsatz von Android über das accessDocument-Skript geladen werden sollen 12516wTryToKeepDirectionOfNavlayers = true; //Falls ein Navigations-Layer nach Links ausgeklappt wird, werden die weiteren Navigations-Layer, sofern genügend Platz zur Verfügung steht, auch links angezeigt
12517wConfirmExternVideosInLightbox = true; //Falls beim Ãffnen von externen Videos in der Lightbox eine Bestätigung zum Laden abgefragt werden soll 12518wDoNotAdjustHeightMaxAfterLazyLoad = false; //Falls nach dem Lazy-Loading die automatische Höhenanpassung nicht ausgeführt werden soll 12519wHandleObserveVisible = true; //Falls Lazy-Loading und Animationseffekte ausschlieÃlich über den JS-Observer überwacht werden sollen 12520wMaxWidthImages = 0; //MaximalgröÃe für zu generierende Bilder 12521wDoNotFeedbackImageSizes = false; //Falls fehlende BildgröÃen nicht durch Besucher ermittelt werden sollen 12522wHostsAllowViewmodeBlank = ''; //Hosts (z.B. domain1.dd|domain2.dd erlaubt domain1.dd, domain2.dd, sub.domain2.dd), bei denen die viewmode=blank Parameter erlaubt sind, um in Lightboxen nur den Inhalt anzuzeigen 12523wMaskAutofillIfConditionalHidden = true; //Falls bedingt ausgeblendete Eingabefelder für die Autofill-Funktion deaktiviert werden sollen 12524wMaskAutofillIfConditionalHiddenIfTypeHidden = false; //Falls bedingt ausgeblendete Hinnden-Felder für die Autofill-Funktion deaktiviert werden sollen 12525wSelectorsAddContrast = ''; //Falls die Kontrastfilter auf spezielle Selektoren angewendet werden sollen 12526wLogPageHide = false; //Falls Interaktionen beim Verlassen einer Seite protokolliert werden sollen 12527wDebounceSuggest = 300; //Falls die Suggest-Funktion der Suche nicht zu oft augerufen werden soll, kann hier eine Verzögerung in Millisekunden angegeben werden 12528 12529//Falls der Cookiehinweis nicht angezeigt werden soll, wenn die Seite in einem iFrame eingebunden ist 12530//if(top != self){doNotShowCookieNotice = true;} 12531 12532const rootFontSize = window.getComputedStyle(document.documentElement).fontSize; 12533 12534if(typeof wEditor !== 'undefined'){ 12535 wBlockChangeScrollstatus = true; 12536} 12537 12538//////////////////////////////////////////////////////////////// 12539// 12540// Initialisieren der Seite 12541// 12542//////////////////////////////////////////////////////////////// 12543 12544jQuery(document).ready(function(){ 12545 12546 if(typeof wInitBrowseEdit === 'function'){ 12547 wInitBrowseEdit(); 12548 } 12549 12550 if(typeof wEditor === 'undefined'){ 12551 addLinkTargets(); 12552 if(typeof wUiTmp['wHasWa'] !== 'undefined' && wUiTmp['wHasWa']){ 12553 addInteractionTracking(); 12554 } 12555 } 12556 12557 12558 12559}); 12560 12561//////////////////////////////////////////////////////////////// 12562// 12563// Passt die Linkziele für Lightboxen, AJAX-Aufrufe etc. an 12564// 12565//////////////////////////////////////////////////////////////// 12566 12567addLinkTargets = function(root){ 12568 12569 root = root || document.body; 12570 12571 if(!jQuery('html').hasClass('isInLightbox')){ 12572 jQuery(root).find("a.box, a.boxOnly, a.boxPicture, a.boxPictureOnly, a.boxVideo, a.boxVideoOnly, a[target='wLightbox'], a[target='box'], a[target='boxContent'], a[target='boxForm'], a[target='boxCard'], a[target='boxPicture'], a[target='boxVideo'], form[data-target='boxCart']").wLightbox(); 12573 } 12574 else{ 12575 jQuery(root).find("a.box, a.boxOnly, a.boxPicture, a.boxPictureOnly, a.boxVideo, a.boxVideoOnly, a[target='wLightbox'], a[target='box'], a[target='boxContent'], a[target='boxForm'], a[target='boxCard'], a[target='boxPicture'], a[target='boxVideo']").each(function(){ 12576 var thisHref = jQuery(this).attr('href'); 12577 if(/youtu\.be\/([^\&\?]+)/.test(thisHref) || /youtube\.com\/watch\?v=([^\&\?]+)/.test(thisHref) || /vimeo.com\/(?:video\/)?([\w]+)/.test(thisHref)){ 12578 jQuery(this).wLightbox(); 12579 } 12580 else { 12581 jQuery(this).attr('target', '_self').wSetViewmode('blank'); 12582 } 12583 }); 12584 } 12585 12586 jQuery(root).find("a[target='embedBody'], a[target='embedListNextRow']").on('click', function(event){ 12587 var aTag = jQuery(event.target).closest('a'); 12588 if(aTag){ 12589 //aTag.attr('data-embedRoot', '#blockContentInner'); 12590 var url = aTag.attr('href') || ''; 12591 let [query, hash] = url.split('#'); 12592 wOpenURL(query + (query.indexOf('?') != -1 ? '&' : '?') + 'viewmode=blank&linkback=no' + (hash !== undefined ? '#' +hash : ''), aTag.attr('target'), aTag.get(0)); 12593 return false;
12594 } 12595 }); 12596 12597 if(root == document.body && typeof ga !== 'undefined'){ 12598 jQuery("a.pdf, a.download").wAddAnalytics(); 12599 jQuery("div[data-url*='.pdf']").wAddAnalytics(); 12600 } 12601 12602 jQuery("#navigationMain li > a").first().attr('id', 'navpoint_firstNavpointMain'); 12603 12604 //Verhindert, dass interne Links in der History erscheinen 12605 /* 12606 document.body("a[href*='#']").click(function(event){ 12607 event.target.setAttribute('data-preventpushstate', '1'); 12608 location.replace(event.target.href); 12609 return false; 12610 }); 12611 */ 12612}; 12613 12614//////////////////////////////////////////////////////////////// 12615// 12616// Ergänzt Interaktions-Tracking 12617// 12618//////////////////////////////////////////////////////////////// 12619 12620addInteractionTracking = function(root){ 12621 12622 jQuery('a[href*="http"]').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).attr('href')}, category : 'extern'}); 12623 jQuery('a.mail, a.wpst').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).text()}, category : 'mail'}); 12624 jQuery('a.phone').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).text()}, category : 'phone'}); 12625 jQuery('a.ical').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).text()}, category : 'ical'}); 12626 jQuery('a.buttonDownload').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).html()}, category : 'zip'}); 12627 jQuery('a[target="embedBody"]').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).first().text()}, category : 'layer'}); 12628 12629 jQuery('a[data-previewlink]').wAnalyzeEvents({event : 'click', label : 'Megadropdown', category : 'requestLayer'}); 12630 12631 jQuery('video').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).attr('src') ? jQuery(this).attr('src') : jQuery(this).find('source').attr('src')}, category : 'video'}); 12632 12633 jQuery('.tab').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).children('div').first().html()}, category : 'tab'}); 12634 jQuery('.accordionHeader').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).first().text()}, category : 'accordion'}); 12635 12636 jQuery('.listBannerSlider .listMoverBack').wAnalyzeEvents({event : 'click', label : 'Back', category : 'bannerSelect'}); 12637 jQuery('.listBannerSlider .listMoverForward').wAnalyzeEvents({event : 'click', label : 'Forward', category : 'bannerSelect'}); 12638 jQuery('.listBannerSlider .listEntriesPreview .listEntry').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).closest('.listBannerSlider').find('.listEntry .listEntryTitle').eq(jQuery(this).index()).text()}, category : 'bannerSelect'}); 12639 jQuery('.listBannerSlider .listEntry.clickable').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).find('.listEntryTitle').text()}, category : 'banner'}); 12640 jQuery('.listBannerSlider .listEntry:not(.clickable) .listEntryLink').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).find('a').text()}, category : 'banner'}); 12641}; 12642 12643//////////////////////////////////////////////////////////////// 12644// 12645// Ermittelt die Höhe des fixen Kopfbereiches 12646// 12647//////////////////////////////////////////////////////////////// 12648 12649getOffsetTopFixed = function(options){ 12650 //console.log('getOffsetTopFixed'); 12651 12652 options = options || {}; 12653 12654 var offsetTopFixed = 0; 12655 12656 if(jQuery('#blockHeader').length == 0 || jQuery('#blockHeader').css('display') == 'none'){ 12657 return 0; 12658 } 12659 else if (jQuery('#blockHeader').css('position') == 'fixed'){ 12660 var transformTop = 0; 12661 12662 offsetTopFixed = jQuery('#blockHeader').height() + jQuery('#blockHeader').offset().top - jQuery(window).scrollTop(); 12663 12664 //if(/(\-?\w+(?:\.\w+)?)\)/.test(jQuery('#blockHeader').css('transform'))){ 12665 // offsetTopFixed -= parseInt(RegExp.$1); 12666 //} 12667 12668 if(jQuery('#blockHeader').height() >= 300){ 12669 return 0; 12670 } 12671 } 12672 12673 if(options['considerWglContainerInsideTopOnScroll'] !== false){ 12674 jQuery('.wglContainerInsideTopOnScroll').each(function(){ 12675 offsetTopFixed += jQuery(this).height(); 12676 }); 12677 } 12678 12679 return offsetTopFixed; 12680}; 12681 12682//////////////////////////////////////////////////////////////// 12683// 12684// Ãffnet den Cookie-, Datenschutzhinweis 12685// 12686//////////////////////////////////////////////////////////////// 12687 12688openCookieNotice = function(e){ 12689 jQuery('#cookieNotice').addClass('hasOpenedByClick'); 12690 jQuery('#cookieNotice').attr('style', 'display:block !important'); 12691 wAccessEvents['cookieNotice'].activate(wAccessEvents['cookieNotice']); 12692 12693 /*window.setTimeout(function(){ 12694 jQuery('#cookieNoticeCloser').focus(); 12695 }, 100); */ 12696}; 12697 12698//////////////////////////////////////////////////////////////// 12699// 12700// SchlieÃt den Cookie-, Datenschutzhinweis 12701// 12702//////////////////////////////////////////////////////////////// 12703
12704closeCookieNotice = function(){ 12705 jQuery('#cookieNotice').attr('style', 'display:none'); 12706 wAccessEvents['cookieNotice'].deactivate(wAccessEvents['cookieNotice']); 12707}; 12708 12709//////////////////////////////////////////////////////////////// 12710// 12711// Zeigt den Hinweis zur deaktivierten Aktivitätsverfolgung im Browser (do not track) an. 12712// 12713//////////////////////////////////////////////////////////////// 12714 12715showDntNotice = function(){ 12716 12717 var timeDisplay = 8000; 12718 12719 setTimeout(function(){ 12720 jQuery('#dntNotice').css({'display' : 'block'}); 12721 }, 1800); 12722 12723 setTimeout(function(){ 12724 jQuery('#dntNotice').addClass('isVisible'); 12725 setTimeout(function(){ 12726 jQuery('#dntNotice').removeClass('isVisible'); 12727 setTimeout(function(){ 12728 jQuery('#dntNotice').css({'display' : 'none'}); 12729 }, 1000); 12730 }, timeDisplay); 12731 }, 2000); 12732 12733 document.cookie = 'allowTracking=0;path=/;sameSite=lax'; 12734 document.cookie = 'allowLoadExternRessources=0;path=/;sameSite=lax'; 12735 document.cookie = 'hideCookieNotice=1;path=/;sameSite=lax'; 12736}; 12737 12738//////////////////////////////////////////////////////////////// 12739// 12740// Nach dem vollständigen Laden der Seite und der Bilder etc. 12741// 12742//////////////////////////////////////////////////////////////// 12743 12744//jQuery(window).on('load', function(){ 12745 //jQuery("img:not([data-src2x])").removeAttr('height'); 12746 12747 //window.setTimeout(function(){ 12748 // wScrollSmoothToElement('.wglHighlightWord'); 12749 //}, 500); 12750//}); 12751 12752//////////////////////////////////////////////////////////////// 12753// 12754// Beim Ãndern der FenstergröÃe 12755// 12756//////////////////////////////////////////////////////////////// 12757 12758//jQuery(window).on('resize', function(){ 12759 //var windowWidth = jQuery(this).width(); 12760 //var windowHeight = jQuery(this).height(); 12761 //console.log(windowWidth + ' / ' + windowHeight); 12762//}); 12763 12764//////////////////////////////////////////////////////////////// 12765// 12766// Beim Scrollen 12767// 12768//////////////////////////////////////////////////////////////// 12769 12770//jQuery(window).on('scroll', function(){ 12771 //var scrollTop = jQuery(this).scrollTop(); 12772 //var scrollLeft = jQuery(this).scrollLeft(); 12773 //console.log(scrollLeft + ' / ' + scrollTop); 12774//}); 12775 12776//////////////////////////////////////////////////////////////// 12777// 12778// Callback, das nach der Auswahl innerhalb des Cookie-Banners 12779// 12780//////////////////////////////////////////////////////////////// 12781 12782wOnAfterSetPrivacysetting = function(){ 12783 //console.log('wOnAfterSetPrivacysetting'); 12784 12785 var acceptSettings = jQuery('#cookiesTracking').prop('checked') ? 'acceptCookiesTracking' : 'declineCookiesTracking'; 12786 acceptSettings += (acceptSettings != '' ? ',' : '') + (jQuery('#loadExternRessources').prop('checked') ? 'acceptExternRessources' : 'declineExternRessources'); 12787 12788 var url = '/wGlobal/wGlobal/scripts/php/privacyConsentStatus.php?s=' + acceptSettings; 12789 12790 jQuery.ajax({ 12791 type: 'GET', 12792 url: url, 12793 async: true, 12794 success: function(result){ 12795 if(acceptSettings.indexOf('accept') !== -1){ 12796 document.location.reload(true); 12797 } 12798 wAccessEvents['cookieNotice'].deactivate(wAccessEvents['cookieNotice']); 12799 } 12800 }); 12801}; 12802 12803//////////////////////////////////////////////////////////////// 12804// 12805// Callback, das nach dem Ablehnen innerhalb des Cookie-Banners angewandt wird 12806// 12807//////////////////////////////////////////////////////////////// 12808 12809//wOnAfterAcceptExternalRessources = function(){ 12810 //console.log('wOnAfterAcceptExternalRessources'); 12811 12812 //document.location.reload(true); 12813//}; 12814 12815//////////////////////////////////////////////////////////////// 12816// 12817// Callback, das nach dem Ablehnen innerhalb des Cookie-Banners 12818// 12819//////////////////////////////////////////////////////////////// 12820 12821//wOnAfterDeclineExternalRessources = function(){ 12822 //console.log('wOnAfterDeclineExternalRessources'); 12823 12824 //document.location.reload(true); 12825//}; 12826 12827//////////////////////////////////////////////////////////////// 12828// 12829// Callback, das vor dem Einfügen einer Seite per AJAX aufgerufen wird 12830// 12831//////////////////////////////////////////////////////////////// 12832 12833//wOnBeforeEmbedPage = function(htmlToEmbed){ 12834 //console.log(htmlToEmbed); 12835//}; 12836 12837//////////////////////////////////////////////////////////////// 12838// 12839// Callback, das nach dem Einfügen einer Seite per AJAX aufgerufen wird 12840// 12841//////////////////////////////////////////////////////////////// 12842 12843wOnAfterEmbedPage = function(elementTarget, url){ 12844 //console.log(elementTarget); 12845 addLinkTargets(elementTarget); 12846 12847 if(typeof sbi === 'function'){ 12848 sbi(wSetParameter(wSetParameter(wSetParameter(url, 'linkback', ''), 'viewmode', ''), 'wTarget', 'embed')); 12849 } 12850}; 12851 12852//////////////////////////////////////////////////////////////// 12853// 12854// Callback, das nach dem Erscheinen eines Elementes aufgerufen wird 12855// 12856//////////////////////////////////////////////////////////////// 12857 12858//wOnAfterAnimateIfVisible = function(element){ 12859// console.log('wOnAfterAnimateIfVisible');
12860// console.log(element); 12861//}; 12862 12863//////////////////////////////////////////////////////////////// 12864// 12865// Callback, das nach dem Verschwinden eines Elementes aufgerufen wird 12866// 12867//////////////////////////////////////////////////////////////// 12868 12869//wOnAfterAnimateIfInvisible = function(element){ 12870// console.log('wOnAfterAnimateIfInvisible'); 12871// console.log(element); 12872//}; 12873 12874//////////////////////////////////////////////////////////////// 12875// 12876// Callback, das nach der Auswahl eines Banners aufgerufen wird 12877// 12878//////////////////////////////////////////////////////////////// 12879 12880//wOnAfterSelectListEntryBannerSlider = function(listId){ 12881// if(typeof(reloadFunction83941731) === 'function'){ 12882// if(jQuery('#bannerSlider_' + listId).data('currententry') == jQuery('#bannerSlider_' + listId).data('numberentries')){ 12883// window.setTimeout(reloadFunction83941731, jQuery('#bannerSlider_' + listId).data('fadetime') * 1000); 12884// } 12885// } 12886//}; 12887 12888//////////////////////////////////////////////////////////////// 12889// 12890// Callback, das beim Klick auf eine Akkordeon-Element aufgerufen wird 12891// 12892//////////////////////////////////////////////////////////////// 12893 12894//wOnBeforeClickAccordeon = function(headerClicked){ 12895 //console.log(headerClicked.data('index')); 12896//}; 12897 12898//////////////////////////////////////////////////////////////// 12899// 12900// Callback, das nach dem Klick auf eine Akkordeon-Element aufgerufen wird 12901// 12902//////////////////////////////////////////////////////////////// 12903 12904//wOnAfterClickAccordeon = function(headerClicked){ 12905 //console.log(headerClicked.data('index')); 12906//}; 12907 12908//////////////////////////////////////////////////////////////// 12909// 12910// Callback, das beim Initalisieren des Tab-Containers aufgerufen werden soll 12911// 12912//////////////////////////////////////////////////////////////// 12913 12914//wOnBeforeInitTabcontainer = function(tabContainer){ 12915 12916//}; 12917 12918//////////////////////////////////////////////////////////////// 12919// 12920// Callback, das beim Klick auf einen Tab-Container aufgerufen wird 12921// 12922//////////////////////////////////////////////////////////////// 12923 12924//wOnBeforeClickTabcontainer = function(headerClicked){ 12925 //console.log(headerClicked.data('index')); 12926//}; 12927 12928//////////////////////////////////////////////////////////////// 12929// 12930// Callback, das nach dem Klick auf einen Tab-Container aufgerufen wird 12931// 12932//////////////////////////////////////////////////////////////// 12933 12934//wOnAfterClickTabcontainer = function(headerClicked){ 12935 //console.log(headerClicked.data('index')); 12936//}; 12937 12938//////////////////////////////////////////////////////////////// 12939// 12940// Callback, das nach dem Ãffnen einer Lightbox aufgerrufen wird 12941// 12942//////////////////////////////////////////////////////////////// 12943 12944//wOnAfterInitLightbox = function(){ 12945//}; 12946 12947//////////////////////////////////////////////////////////////// 12948// 12949// Callback, das vor dem SchlieÃen einer Lightbox aufgerrufen wird 12950// 12951//////////////////////////////////////////////////////////////// 12952 12953//wOnBeforeCloseLightbox = function(event){ 12954 //console.log(event.target); 12955//}; 12956 12957//////////////////////////////////////////////////////////////// 12958// 12959// Callback, das nach dem Laden eines Bildes über Lazyloading aufgerufen wird 12960// 12961//////////////////////////////////////////////////////////////// 12962 12963//wOnAfterLazyLoading = function(image){ 12964 //console.log(image); 12965//}; 12966 12967//////////////////////////////////////////////////////////////// 12968// 12969// Callback, das vor dem Laden eines Bildes über Lazyloading aufgerufen wird 12970// 12971//////////////////////////////////////////////////////////////// 12972 12973//wOnBeforeScrollSmoothToTarget = function(elementTarget){ 12974 //console.log(elementTarget); 12975//}; 12976 12977//////////////////////////////////////////////////////////////// 12978// 12979// Callback, das nach dem Laden eines Bildes über Lazyloading aufgerufen wird 12980// 12981//////////////////////////////////////////////////////////////// 12982 12983//wOnAfterScrollSmoothToTarget = function(elementTarget){ 12984 //console.log(elementTarget); 12985//}; 12986 12987//////////////////////////////////////////////////////////////// 12988// 12989// @method void wOnAfterAppendEntriesToList(listId, options) 12990// 12991// @desc Wird als Callback nach dem dynamischen Nachladen von Listeneinträgen aufgerufen 12992// 12993// @return void 12994// 12995//////////////////////////////////////////////////////////////// 12996 12997//wOnAfterAppendEntriesToList = function(listId, options){ 12998// 12999// var listElement = jQuery('#list_' + listId); 13000//
13001// if(jQuery('#list_' + listId).find('.listLoaderMore').length == 0 && jQuery('#list_' + listId).find('.listLoaderMoreReset').length == 0){ 13002// listElement.append('<div class="linkButton listLoaderMoreReset" onclick="removeAppendEntriesFromList(\'' + listId + '\')">Zurücksetzen</div>'); 13003// } 13004//} 13005 13006//wOnBeforeScrollSmoothToTarget = function(elementTarget){ 13007 //console.log(elementTarget); 13008//}; 13009 13010//////////////////////////////////////////////////////////////// 13011// 13012// Callback, das vor dem Aufruf einer verkrypteten E-Mail aufgerufen wird 13013// 13014//////////////////////////////////////////////////////////////// 13015 13016//function wOnBeforeClickSendMailNospam(mail, event){ 13017// console.log(event.target); 13018 13019// return confirm('E-Mail senden an: ' + mail); 13020//}; 13021 13022//////////////////////////////////////////////////////////////// 13023// 13024// Callback nach dem erfolgreichen Ãbertragen eines Formulares über AJAX 13025// 13026//////////////////////////////////////////////////////////////// 13027 13028//wOnAfterSubmitFormAjaxSuccess = function(response){ 13029// console.log(response); 13030//}; 13031 13032//////////////////////////////////////////////////////////////// 13033// 13034// Callback nach dem fehlgeschlagenen Ãbertragen eines Formulares über AJAX 13035// 13036//////////////////////////////////////////////////////////////// 13037 13038//wOnAfterSubmitFormAjaxError = function(errorData){ 13039// console.log(errorData); 13040//}; 13041 13042//////////////////////////////////////////////////////////////// 13043// 13044// Callback, überlagert das Klick-Event auf einem Marker der openStreetMap 13045// 13046//////////////////////////////////////////////////////////////// 13047 13048//wOnBeforeClickOSMObject = function(obj){ 13049// console.log(obj); 13050// return false; 13051//} 13052 13053//////////////////////////////////////////////////////////////// 13054// 13055// Callback, das nach dem Ãndern einer Barrierefreieinstellung aufgerufen wird 13056// 13057//////////////////////////////////////////////////////////////// 13058 13059//wOnAfterChangeAccessibility = function(name, value, options){ 13060// console.log('wOnAfterChangeAccessibility'); 13061// console.log(name + ', ' + value);console.log(options); 13062//}; 13063 13064//////////////////////////////////////////////////////////////// 13065// 13066// Beim Aktivieren bzw. Deaktivieren von Media Queries 13067// 13068//////////////////////////////////////////////////////////////// 13069 13070//mediaquery_viewport_xs_min_onactivate = function(){ 13071 //console.log('mediaquery_viewport_xs_min_onactivate'); 13072//}; 13073 13074//mediaquery_viewport_xs_min_ondeactivate = function(){ 13075 //console.log('mediaquery_viewport_xs_min_ondeactivate'); 13076//}; 13077 13078//mediaquery_viewport_xs_max_onactivate = function(){ 13079 //console.log('mediaquery_viewport_xs_max_onactivate'); 13080//}; 13081 13082//mediaquery_viewport_xs_max_ondeactivate = function(){ 13083 //console.log('mediaquery_viewport_xs_max_ondeactivate'); 13084//}; 13085 13086//mediaquery_viewport_s_min_onactivate = function(){ 13087 //console.log('mediaquery_viewport_s_min_onactivate'); 13088//}; 13089 13090//mediaquery_viewport_s_min_ondeactivate = function(){ 13091 //console.log('mediaquery_viewport_s_min_ondeactivate'); 13092//}; 13093 13094//mediaquery_viewport_s_max_onactivate = function(){ 13095 //console.log('mediaquery_viewport_s_max_onactivate'); 13096//}; 13097 13098//mediaquery_viewport_s_max_ondeactivate = function(){ 13099 //console.log('mediaquery_viewport_s_max_ondeactivate'); 13100//}; 13101 13102//mediaquery_viewport_m_min_onactivate = function(){ 13103 //console.log('mediaquery_viewport_m_min_onactivate'); 13104//}; 13105 13106//mediaquery_viewport_m_min_ondeactivate = function(){ 13107 //console.log('mediaquery_viewport_m_min_ondeactivate'); 13108//}; 13109 13110//mediaquery_viewport_m_max_onactivate = function(){ 13111 //console.log('mediaquery_viewport_m_max_onactivate'); 13112//}; 13113 13114//mediaquery_viewport_m_max_ondeactivate = function(){ 13115 //console.log('mediaquery_viewport_m_max_ondeactivate'); 13116//}; 13117 13118//mediaquery_viewport_l_min_onactivate = function(){ 13119 //console.log('mediaquery_viewport_l_min_onactivate'); 13120//}; 13121 13122//mediaquery_viewport_l_min_ondeactivate = function(){ 13123 //console.log('mediaquery_viewport_l_min_ondeactivate'); 13124//}; 13125 13126//mediaquery_viewport_l_max_onactivate = function(){ 13127 //console.log('mediaquery_viewport_l_max_onactivate'); 13128//}; 13129 13130//mediaquery_viewport_l_max_ondeactivate = function(){ 13131 //console.log('mediaquery_viewport_l_max_ondeactivate'); 13132//}; 13133 13134//mediaquery_viewport_xl_min_onactivate = function(){ 13135 //console.log('mediaquery_viewport_xl_min_onactivate'); 13136//}; 13137 13138//mediaquery_viewport_xl_min_ondeactivate = function(){ 13139 //console.log('mediaquery_viewport_xl_min_ondeactivate'); 13140//}; 13141 13142//mediaquery_viewport_xl_max_onactivate = function(){ 13143 //console.log('mediaquery_viewport_xl_max_onactivate'); 13144//}; 13145 13146//mediaquery_viewport_xl_max_ondeactivate = function(){ 13147 //console.log('mediaquery_viewport_xl_max_ondeactivate'); 13148//}; 13149 13150/* 13151//////////////////////////////////////////////////////////////// 13152// 13153// JavaScript Funktionen für die Navigation 13154// 13155// Weblication CMS BASE 13156// erstellt durch Scholl Communications AG, 77694 Kehl, www.scholl.de 13157// erstellt mit Weblication Content Management Server, www.weblication.de 13158// 13159///////////////////////////////////////////////////////////////f/ 13160*/ 13161 13162/* 13163//////////////////////////////////////////////////////////////// 13164// 13165// JavaScript Funktionen für die Navigation 13166// 13167// Weblication CMS BASE 13168// erstellt durch Scholl Communications AG, 77694 Kehl, www.scholl.de 13169// erstellt mit Weblication Content Management Server, www.weblication.de 13170// 13171///////////////////////////////////////////////////////////////f/ 13172*/ 13173 13174wAllowMinimize = true; 13175 13176var megadropdownTimerOpen; 13177var megadropdownTimerClose; 13178var maxSizeNavigationmenu = 0; 13179var delayOpen = 0; 13180var delayClose = 0; 13181var navigationlayeropentype = ''; 13182var accessEventActive = false;
13183 13184//////////////////////////////////////////////////////////////// 13185// 13186// Beim Initialisieren der Seite 13187// 13188//////////////////////////////////////////////////////////////// 13189 13190jQuery(document).ready(function(){ 13191 13192 if(typeof(wEditor) == 'object'){ 13193 return false; 13194 } 13195 var windowWidth = jQuery(window).width(); 13196 navigationlayeropentype = jQuery('html').data('navigationlayeropentype') ? jQuery('html').data('navigationlayeropentype') : 'mouseenter'; 13197 maxSizeNavigationmenu = jQuery('html').data('widthnavigationmainmenumax') ? jQuery('html').data('widthnavigationmainmenumax').replace(/px/, '') : 992; 13198 var headerNavigation = jQuery('#navigationMain'); 13199 13200 if(headerNavigation.attr('data-aenavigation') === '1' && typeof wAccessibility != 'undefined' && wAccessibility['navigation'] != null && wAccessibility['navigation'].active){ 13201 /*Für die Navigation werden dynamisch AccessEvents Pro NavPoint, Toggler, Dropdown etc. angemeldet */ 13202 accessEventActive = true; 13203 var mobileMenu = jQuery(window).width() >= maxSizeNavigationmenu ? false : true; 13204 var navigationDefault = headerNavigation.attr('data-aenavigationdefault') != null ? headerNavigation.attr('data-aenavigationdefault') : 'toggler|dropdown|listener'; 13205 var navigationDefaultO = navigationDefault.split('|'); 13206 var navigationMobile = headerNavigation.attr('data-aenavigationmobile') != null ? headerNavigation.attr('data-aenavigationmobile') : 'toggler|listener'; 13207 var navigationMobileO = navigationMobile.split('|'); 13208 13209 wAccessEvents['navigation.navigationMainToggler'].element = jQuery('#navigationMainToggler, .navigationMainToggler'); 13210 wAccessHandler.addEvent(wAccessEvents['navigation.navigationMainToggler']); 13211 13212 var navLis = headerNavigation.attr('data-aenavlistener') != null ? headerNavigation.attr('data-aenavlistener') : ''; 13213 wAccessEvents['navigation.listener'].type = navLis.indexOf("closeClick") !== -1 ? "closeClick" : "closeMouseout"; 13214 13215 jQuery('nav a').each(function(e){ 13216 if(navigationDefault.indexOf('dropdown') !== -1 && !mobileMenu && jQuery(this).attr('data-previewlink') != null){ 13217 var aE = Object.assign({}, wAccessEvents['navigation.navPointDropdown']); 13218 aE.typeDefault = navigationDefaultO; 13219 aE.typeMobile = navigationMobileO; 13220 aE.element = jQuery(this); 13221 wAccessHandler.addEvent(aE, {'idPrefix' :'nPDropdown'}); 13222 } 13223 else{ 13224 /*ggf. probleme bei reload??*/ 13225 var aE = Object.assign({}, wAccessEvents['navigation.navPoint']); 13226 aE.element = jQuery(this); 13227 aE.typeDefault = navigationDefaultO; 13228 aE.typeMobile = navigationMobileO; 13229 wAccessHandler.addEvent(aE, {'idPrefix' : 'nP'}); 13230 } 13231 jQuery(this).get(0).addEventListener("MSHoldVisual", function(e){e.preventDefault()}, false); 13232 jQuery(this).get(0).addEventListener("contextmenu", function(e){if(e.which != 3) e.preventDefault()}, false); 13233 13234 }); 13235 13236 jQuery('#navigationMain ul, #navigationMain > nav > div > ul > li > div ul').each(function(){ 13237 13238 if(jQuery(this).attr('data-addtitle') == '1' && jQuery(this).data('hasAddTitle') != '1'){ 13239 var elementTitle = jQuery('<li class="navlayerTitle"><span>' + (jQuery(this).parent().find(' > a').html() ? jQuery(this).parent().find(' > a').html() : '') + '</span></li>'); 13240 jQuery(this).prepend(elementTitle); 13241 jQuery(this).data('hasAddTitle', '1'); 13242 } 13243 13244 if(jQuery(this).attr('data-addbacktitle') == '1' && jQuery(this).data('hasAddBacktitle') != '1'){ 13245 var elementBackTitle = jQuery('<li class="navlayerBackTitle"></span><span class="navlayerBackTitleText">' + (jQuery(this).parent().find(' > a').text() ? jQuery(this).parent().find(' > a').text() : '') + '</span><span class="navlayerBackTitleCloser"></li>'); 13246 jQuery(this).prepend(elementBackTitle); 13247 elementBackTitle.on('click', function(){jQuery(this).parent().parent().find('> span.navpointToggler').trigger('click')}); 13248 jQuery(this).data('hasAddBacktitle', '1'); 13249 } 13250 13251 if(jQuery(this).attr('data-addbackparenttitle') == '1' && jQuery(this).data('hasAddBackparenttitle') != '1'){ 13252 var elementBackParentTitle = jQuery('<li class="navlayerBackParentTitle"><span>' + (jQuery(this).parent().parent().parent().find(' > a').html() ? jQuery(this).parent().parent().parent().find(' > a').html() : '') + '</span></li>'); 13253 jQuery(this).prepend(elementBackParentTitle); 13254 elementBackParentTitle.on('click', function(){jQuery(this).parent().parent().find('> span.navpointToggler').trigger('click')}); 13255 jQuery(this).data('hasAddBackparenttitle', '1'); 13256 } 13257 13258 if(jQuery(this).attr('data-addcloser') == '1' && jQuery(this).data('hasAddCloser') != '1'){ 13259 var elementCloser = jQuery('<li class="navlayerCloser"></li>'); 13260 jQuery(this).prepend(elementCloser); 13261 elementCloser.on('click', function(){jQuery(this).parent().parent().find('> span.navpointToggler').trigger('click')}); 13262 jQuery(this).data('hasAddCloser', '1'); 13263 } 13264 }); 13265 13266 jQuery('body').on('click touchstart', function(event){ 13267 if(window['wglTouchStartedNavlayers']){ 13268 var timeTouchstartBody = new Date().getTime(); 13269 var timeDiffTouch = timeTouchstartBody - window['wglTouchStartedNavlayers']; 13270 if(timeDiffTouch > 100){ 13271 jQuery('a[data-has-already-touched="1"]').attr('data-has-already-touched', ''); 13272 } 13273 } 13274 }); 13275 13276 jQuery(window).on('resize', function(){ 13277 adaptSizeNavigation(); 13278 adjustNavlayer(null, true); 13279 }); 13280 adaptSizeNavigation(); 13281 13282 jQuery('body').append('<div id="navlayer-background"/>'); 13283 return true; 13284 } 13285 else{ 13286 /*Diese Syntax und die Funktionen accessisbility_... fallen weg, falls die Navigation über AccessEvents aktiviert wird*/ 13287 /*Navigationshandling ohne Barrierefreiheit*/ 13288 jQuery('nav a').each(function(){ 13289 13290 if(!jQuery('html').hasClass('navlayer-open')){ 13291 jQuery('#navigationMain navpointToggler.open').each(function(){jQuery(this).removeClass('open');}); 13292 } 13293 /*Megadropdowns*/ 13294 if(jQuery(this).attr('data-previewlink') !== undefined){ 13295 jQuery(this).parent().addClass('hasMegaDropdown'); 13296 var id = jQuery(this).attr('id').replace(/navpoint_/, ''); 13297 var megaDropdownEmbedMode = jQuery(this).closest('ul[data-embedmode]').attr('data-embedmode'); 13298 var megaDropdownAddNavId = jQuery(this).closest('ul[data-addnavid]').attr('data-addnavid'); 13299 var openMegaDropdownType = jQuery(this).closest('ul[data-type]').attr('data-type') ? jQuery(this).closest('ul[data-type]').attr('data-type') : (jQuery('html').data('megadropdownopentype') ? jQuery('html').data('megadropdownopentype')
13299: 'mouseenter'); 13300 var closeMegaDropdownType = jQuery(this).closest('ul[data-type]').attr('data-type') ? jQuery(this).closest('ul[data-type]').attr('data-type') : (jQuery('html').data('megadropdownclosetype') ? jQuery('html').data('megadropdownclosetype') : 'mouseenter'); 13301 var megaDropdownPreload = jQuery(this).closest('ul[data-preload]').attr('data-preload') ? jQuery(this).closest('ul[data-preload]').attr('data-preload') : (jQuery('html').data('megadropdownpreload') ? jQuery('html').data('megadropdownpreload') : 'yes'); 13302 13303 /*opentype click*/ 13304 if(openMegaDropdownType == 'click'){ 13305 var windowWidth = jQuery(window).width(); 13306 if(windowWidth >= maxSizeNavigationmenu){ 13307 /*Klick-event auf a-tag oder keydown == 13*/ 13308 jQuery(this).on('click touchstart', function(event){ 13309 if(event.target.className.indexOf('navpointEmbedToggler') != -1){ 13310 if(jQuery(event.target).attr('aria-pressed') == 'true'){ 13311 jQuery(event.target).attr('aria-pressed', 'false'); 13312 closeMegaDropdown(); 13313 return; 13314 } 13315 else{ 13316 jQuery(event.target).attr('aria-pressed', 'true'); 13317 } 13318 } 13319 event.preventDefault(); 13320 /*Wenn Megadropdown noch nicht geöffnet*/ 13321 if(!jQuery('html').hasClass('megadropdown-open')){ 13322 jQuery(this).parent().siblings().removeClass('hover'); 13323 openMegaDropdown(id, jQuery(this).attr('data-previewlink'), {'mode' : megaDropdownEmbedMode, 'addNavId' : megaDropdownAddNavId}); 13324 13325 } 13326 /*Wenn Megadropdown bereits geöffnet*/ 13327 else{ 13328 closeMegaDropdown(id, true); 13329 if(id != wUiTmp['openMegaDropdownid']){ 13330 openMegaDropdown(id, jQuery(this).attr('data-previewlink'), {'mode' : megaDropdownEmbedMode, 'addNavId' : megaDropdownAddNavId}); 13331 } 13332 } 13333 /*SchlieÃen bestehender Navigationspunkte*/ 13334 if(jQuery(wUiTmp['currentNavpoint']).closest('li').hasClass('clicked')){ 13335 navpoint_onclick(wUiTmp['currentNavpoint'], null, event); 13336 wUiTmp['currentNavpoint'] = null; 13337 } 13338 return false; 13339 }); 13340 jQuery(this).get(0).addEventListener("MSHoldVisual", function(e){e.preventDefault()}, false); 13341 jQuery(this).get(0).addEventListener("contextmenu", function(e){if(e.which != 3) e.preventDefault()}, false); 13342 } 13343 } 13344 /*opentype mousenter*/ 13345 else{ 13346 jQuery(this).parent().on('mouseenter click', function(event){ 13347 if(event.target.className.indexOf('navpointEmbedToggler') != -1){ 13348 if(jQuery(event.target).attr('aria-pressed') == 'true'){ 13349 jQuery(event.target).attr('aria-pressed', 'false'); 13350 closeMegaDropdown(); 13351 return; 13352 } 13353 else{ 13354 jQuery(event.target).attr('aria-pressed', 'true'); 13355 } 13356 } 13357 openMegaDropdown(id, jQuery(this).attr('data-previewlink'), {'mode' : megaDropdownEmbedMode, 'addNavId' : megaDropdownAddNavId}); 13358 }); 13359 /*SchlieÃe geöffnete Navpoints*/ 13360 jQuery(this).on('keyup', function(e){ 13361 if(e.key === 'Tab'){ 13362 accessibility_navPoint_mouseenter(jQuery(this), e, {'close':true}); 13363 jQuery(this).parent().trigger('click'); 13364 } 13365 }); 13366 13367 jQuery(this).on('mousemove', function(event){ 13368 if(jQuery(this).parent().hasClass('selected') && !jQuery('html').hasClass('megadropdown-open')){ 13369 jQuery(this).parent().trigger('click'); 13370 } 13371 }); 13372 } 13373 13374 if(megaDropdownPreload != 'no'){ 13375 if(jQuery(window).width() >= maxSizeNavigationmenu){ 13376 loadMegaDropdown(id, jQuery(this).attr('data-previewlink'), {'mode' : megaDropdownEmbedMode, 'addNavId' : megaDropdownAddNavId, 'initToPreload' : true}); 13377 } 13378 } 13379 } 13380 /*Navpoint*/ 13381 else if(jQuery(this).attr('data-previewlink') === undefined){ 13382 jQuery(this).on('keyup', function(event){ 13383 if(navigationlayeropentype != 'click' && event.key == 'Tab'){ 13384 accessibility_navPoint_mouseenter(jQuery(this), event); 13385 event.stopPropagation(); 13386 event.stopImmediatePropagation(); 13387 } 13388 }); 13389 } 13390 }); 13391 13392 jQuery('#navigationMain ul, #navigationMain > nav > div > ul > li > div ul').each(function(){ 13393 13394 if(jQuery(this).attr('data-addtitle') == '1' && jQuery(this).data('hasAddTitle') != '1'){ 13395 var elementTitle = jQuery('<li class="navlayerTitle"><span>' + (jQuery(this).parent().find(' > a').html() ? jQuery(this).parent().find(' > a').html() : '') + '</span></li>'); 13396 jQuery(this).prepend(elementTitle); 13397 jQuery(this).data('hasAddTitle', '1'); 13398 } 13399 13400 if(jQuery(this).attr('data-addbacktitle') == '1' && jQuery(this).data('hasAddBacktitle') != '1'){ 13401 var elementBackTitle = jQuery('<li class="navlayerBackTitle"></span><span class="navlayerBackTitleText">' + (jQuery(this).parent().find(' > a').text() ? jQuery(this).parent().find(' > a').text() : '') + '</span><span class="navlayerBackTitleCloser"></li>'); 13402 jQuery(this).prepend(elementBackTitle); 13403 elementBackTitle.on('click', function(){jQuery(this).parent().parent().find('> span.navpointToggler').trigger('click')}); 13404 jQuery(this).data('hasAddBacktitle', '1'); 13405 } 13406 13407 if(jQuery(this).attr('data-addbackparenttitle') == '1' && jQuery(this).data('hasAddBackparenttitle') != '1'){ 13408 var elementBackParentTitle = jQuery('<li class="navlayerBackParentTitle"><span>' + (jQuery(this).parent().parent().parent().find(' > a').html() ? jQuery(this).parent().parent().parent().find(' > a').html() : '') + '</span></li>'); 13409 jQuery(this).prepend(elementBackParentTitle); 13410 elementBackParentTitle.on('click', function(){jQuery(this).parent().parent().find('> span.navpointToggler').trigger('click')}); 13411 jQuery(this).data('hasAddBackparenttitle', '1'); 13412 } 13413 13414 if(jQuery(this).attr('data-addcloser') == '1' && jQuery(this).data('hasAddCloser') != '1'){ 13415 var elementCloser = jQuery('<li class="navlayerCloser"></li>'); 13416 jQuery(this).prepend(elementCloser); 13417 elementCloser.on('click', function(){jQuery(this).parent().parent().find('> span.navpointToggler').trigger('click')}); 13418 jQuery(this).data('hasAddCloser', '1'); 13419 } 13420 }); 13421 13422 jQuery('#navigationMain li > a').each(function(){ 13423 jQuery(this).get(0).addEventListener("MSHoldVisual", function(e){e.preventDefault()}, false); 13424 jQuery(this).get(0).addEventListener("contextmenu", function(e){if(e.which != 3) e.preventDefault()}, false); 13425 13426 if(jQuery(this).siblings('ul, div').length > 0){ 13427 jQuery(this).attr('aria-haspopup', 'true'); 13428 } 13429 }); 13430 13431 13432 wToggleOnClickNavpointInMenu = jQuery('#navigationMain > nav > div > ul').data('toggleonclicknavpointinmenu') == '1' ? true : false;
13433 wToggleOnClickNavpointMainInMenu = jQuery('#navigationMain > nav > div > ul').data('toggleonclicknavpointmaininmenu') == '1' ? true : false; 13434 13435 if(maxSizeNavigationmenu > 0 && windowWidth <= maxSizeNavigationmenu && typeof(wToggleOnClickNavpointInMenu) != 'undefined' && wToggleOnClickNavpointInMenu){ 13436 jQuery('.navpointToggler').each(function(){ 13437 if(jQuery(this).siblings('a').length > 0){ 13438 jQuery(this).siblings('a').on('click', function(){ 13439 var attHref = jQuery(this).attr('href'); 13440 if(!jQuery(this).next().hasClass('open') || attHref == '' || attHref == '#'){ 13441 jQuery(this).attr('data-donotclose', 1); 13442 event.stopPropagation(); 13443 jQuery(this).next().trigger('click'); 13444 return false; 13445 } 13446 }); 13447 } 13448 }); 13449 } 13450 else if(maxSizeNavigationmenu > 0 && windowWidth <= maxSizeNavigationmenu && typeof(wToggleOnClickNavpointMainInMenu) != 'undefined' && wToggleOnClickNavpointMainInMenu){ 13451 jQuery('ul[data-navlevel="1"] > li > .navpointToggler').each(function(){ 13452 if(jQuery(this).siblings('a').length > 0){ 13453 jQuery(this).siblings('a').on('click', function(){ 13454 var attHref = jQuery(this).attr('href'); 13455 if(!jQuery(this).next().hasClass('open') || attHref == '' || attHref == '#'){ 13456 jQuery(this).attr('data-donotclose', 1); 13457 event.stopPropagation(); 13458 jQuery(this).next().trigger('click'); 13459 return false; 13460 } 13461 }); 13462 } 13463 }); 13464 } 13465 else{ 13466 jQuery('.navpointToggler').each(function(){ 13467 var navToggler = jQuery(this); 13468 if(jQuery(this).siblings('a').length > 0){ 13469 if(jQuery(this).siblings('a').width()*(-1) > parseInt(navToggler.css('left'))) navToggler.attr('tabindex', '-1'); 13470 jQuery(this).siblings('a').on('click', function(event){ 13471 var attHref = jQuery(this).attr('href'); 13472 if(attHref == '' || attHref == '#'){ 13473 jQuery(this).attr('data-donotclose', 1); 13474 event.stopPropagation(); 13475 if(jQuery(this).siblings('div.submenu').length != 1 && jQuery(this).siblings().attr('data-wrapifnavigationfull') !== '1'){ 13476 event.stopImmediatePropagation(); 13477 } 13478 if(navigationlayeropentype === 'click'){ 13479 var toggler = jQuery(this).next(); 13480 var ontoggle = toggler.attr('data-ontoggle'); 13481 if(jQuery(window).width() > maxSizeNavigationmenu && (jQuery(this).attr['data-previewlink'] !== undefined && jQuery(this).attr['data-previewlink'] != '')) toggler.attr('data-ontoggle', 'none'); 13482 toggler.trigger('click'); 13483 toggler.attr('data-ontoggle', ontoggle); 13484 } 13485 return false; 13486 } 13487 }); 13488 } 13489 }); 13490 } 13491 13492 var windowWidth = jQuery(window).width(); maxSizeNavigationmenu 13493 13494 jQuery('#navigationMainToggler, .navigationMainToggler').on('click', function(){ 13495 navigationToggler_onclick(this); 13496 }); 13497 13498 jQuery('.navpointToggler').on('click', function(){ 13499 navpointToggler_onclick(this); 13500 }); 13501 13502 jQuery('.navpointToggler').on('keyup', function(e){ 13503 if(e.originalEvent.key === 'Enter'){ 13504 navpointToggler_onclick(this); 13505 e.preventDefault(); 13506 } 13507 }); 13508 13509 jQuery('#navigationMain li > a').on('click', function(event){ 13510 navpoint_onclick(this, jQuery(this).parent().parent().data('navlevel'), event); 13511 }); 13512 13513 jQuery('#navigationMain li > a').each(function(){ 13514 var el = this; 13515 el.addEventListener('touchstart', function(){ 13516 navpoint_onclick(el, jQuery(el).parent().parent().data('navlevel'), event); 13517 el}, {passive: true}); 13518 }); 13519 13520 jQuery('#navigationMain li').on('mouseenter', function(event){ 13521 if(!(jQuery(this).children('div.submenu').length > 0 || jQuery(this).closest('div.submenu').length > 0)){ 13522 navpoint_onmouseenter(this, jQuery(this).parent().data('navlevel'), event); 13523 } 13524 else{ 13525 accessibility_navPoint_open(jQuery(this), event); 13526 } 13527 }); 13528 13529 jQuery('#navigationMain li').on('mouseleave', function(event){ 13530 if(!(jQuery(this).children('div.submenu').length > 0 || jQuery(this).closest('div.submenu').length > 0)){ 13531 navpoint_onmouseleave(this, jQuery(this).parent().data('navlevel'), event); 13532 } 13533 else{ 13534 accessibility_navPoint_close(jQuery(this), event); 13535 } 13536 }); 13537 13538 jQuery('body').on('click touchstart', function(event){ 13539 if(window['wglTouchStartedNavlayers']){ 13540 var timeTouchstartBody = new Date().getTime(); 13541 var timeDiffTouch = timeTouchstartBody - window['wglTouchStartedNavlayers']; 13542 if(timeDiffTouch > 100){ 13543 jQuery('a[data-has-already-touched="1"]').attr('data-has-already-touched', ''); 13544 } 13545 } 13546 }); 13547 13548 /*Barrierefreiheit*/ 13549 var nMTE = jQuery('#navigationMainToggler'); 13550 var nMTEInit = function(){ 13551 jQuery("nav .navpointToggler:not(.open)").attr('aria-expanded', "false"); 13552 jQuery("nav .navpointToggler.open").attr('aria-expanded', jQuery('nav .navpointToggler.open').siblings('ul').is(':hidden') ? 'true' : 'false'); 13553 if(nMTE.length > 0 && nMTE.is(':visible')){ 13554 //nMTE.siblings('nav').find('ul li a, .navpointToggler').attr('tabindex', nMTE.attr('aria-expanded') === 'false' ? '-1' : ''); 13555 nMTE.on('keyup',function(e){ 13556 if(e.originalEvent.key === 'Enter'){ 13557 nMTE.trigger('click'); 13558 if(nMTE.hasClass('open')){ 13559 jQuery(document).off('keydown.closeNavigationToggler').on('keydown.closeNavigationToggler', function(e){ 13560 if(e.key === 'Escape'){ 13561 nMTE.trigger('click'); 13562 jQuery(document).off('keydown.closeNavigationToggler'); 13563 } 13564 }); 13565 } 13566 e.preventDefault(); 13567 e.stopImmediatePropagation(); 13568 } 13569 nMTE.siblings('nav').find('ul li a, .navpointToggler').attr('tabindex', nMTE.attr('aria-expanded') !== "fal
13569se" ? '0' : '-1'); 13570 }); 13571 } 13572 }; 13573 nMTEInit(); 13574 jQuery(window).on('resize', function(){ 13575 nMTEInit(); 13576 }); 13577 13578 jQuery('html #blockPageInner').on('keyup', function(e){ 13579 if((jQuery('html').hasClass('navlayer-open') || jQuery('html').hasClass('megadropdown-open')) && e.originalEvent.key === 'Tab'){ 13580 var cE = jQuery(e.originalEvent.target); 13581 var navigation = cE.closest('#navigationMain'); 13582 var nP = jQuery('#navpoint_' + wUiTmp['openMegaDropdownid']).closest('li'); 13583 nP.css({'outline': 'none'}); 13584 //auÃerhalb der navigation 13585 if(navigation.length == 0 && navigation.find('#navigationMainToggler.open').length == 0){ 13586 var nPNext = nP.next(); 13587 if(nP.length > 0 && nP.siblings().length > 0 && nPNext.length > 0){ 13588 var e = new KeyboardEvent("keyup", {key : 9, 'code' : 'focusonnextnavpoint', bubbles : false, cancelable : true}); 13589 if(nPNext.length > 0){ 13590 nPNext.find('a').focus(); 13591 accessibility_navPoint_open(nPNext, e); 13592 } 13593 closeMegaDropdown(undefined, true); 13594 } 13595 else{ 13596 closeMegaDropdown(undefined, true); 13597 var li = jQuery('#navigationMain').find(navigationlayeropentype != 'click' ? 'li' : 'li.clicked'); 13598 li.each(function(){ 13599 if(e.originalEvent.key === 'Tab' && wUiTmp['currentNavpoint'] !== undefined){ 13600 navpoint_onclick(wUiTmp['currentNavpoint'], null, e); 13601 } 13602 accessibility_navPoint_close(jQuery(this)); 13603 }); 13604 } 13605 } 13606 else if(navigation.length > 0 && jQuery('html').hasClass('megadropdown-open') && cE.closest('.navLevelEmbed').length === 0 && 'navpoint_'+ wUiTmp['openMegaDropdownid'] != cE.attr('id')){ 13607 closeMegaDropdown(wUiTmp['openMegaDropdownid'], true); 13608 } 13609 else if(navigation.length > 0 && wUiTmp['currentNavpoint'] != undefined){ 13610 //wenn CE kein UnterKnoten von currentNavPoint dann -- CLose 13611 var isdesc = cE.parents().is(jQuery(wUiTmp['currentNavpoint']).closest('li')); 13612 if(!isdesc){ 13613 navpoint_onclick(wUiTmp['currentNavpoint'], null, e); 13614 } 13615 } 13616 else{ 13617 e.stopPropagation(); 13618 e.stopImmediatePropagation(); 13619 } 13620 } 13621 else if(jQuery('html').hasClass('navlayer-open') && e.originalEvent.key == 'Escape'){ 13622 } 13623 else{ 13624 if(jQuery(e.originalEvent.target).closest('#navigationMain').length === 0){ 13625 if(nMTE.hasClass('open')) nMTE.focus(); 13626 } 13627 } 13628 }); 13629 13630 accessibility_navPoint_mouseenter = function(element, event, options){ 13631 13632 if(nMTE.length > 0 && nMTE.is(':visible') && !nMTE.hasClass('open')){ 13633 var event = jQuery.Event('keyup', event); 13634 nMTE.trigger(event); 13635 return true; 13636 } 13637 var a = jQuery(element); 13638 var li = a.parent(); 13639 var isdesc = a.parents('li').is(jQuery(wUiTmp['currentNavpointME'])); 13640 var close = options != undefined && options['close'] === true ? true : false; 13641 var curNPME = jQuery(wUiTmp['currentNavpointME']); 13642 if(close){ 13643 if(curNPME.length > 0 && curNPME.closest('li').hasClass('clicked')){ 13644 accessibility_navPoint_close(curNPME); 13645 wUiTmp['currentNavpointME'] = undefined; 13646 return false; 13647 } 13648 } 13649 if(wUiTmp['currentNavpointME'] != undefined && !isdesc){ 13650 accessibility_navPoint_close(curNPME); 13651 } 13652 if(a.attr('data-previewlink') != undefined && windowWidth > maxSizeNavigationmenu) return false; 13653 13654 if(li.parent().attr('data-navlevel') == '1'){ 13655 wUiTmp['currentNavpointME'] = li; 13656 } 13657 13658 var liS = li.siblings(); 13659 var navpointToggler = nT = a.next('.navpointToggler'); 13660 13661 if(typeof(wAccessibility) !== 'undefined' && wAccessibility.navigationTogglerDynamic && wAccessibility.navigationTogglerDynamic.active){ 13662 if(navpointToggler.length > 0){ 13663 nT.attr('tabindex', '0'); 13664 if(wAccessibility.navigationTogglerDynamic.class){ 13665 var nTClass = wAccessibility.navigationTogglerDynamic.class; 13666 if(nTClass != ''){ 13667 nT.on('focus', function(e) {jQuery(this).addClass(nTClass)}) 13668 .on('blur', function(e) {jQuery(this).removeClass(nTClass)}); 13669 } 13670 } 13671 } 13672 else{ 13673 jQuery("nav .navpointToggler:not(.open)").attr('aria-expanded', "false"); 13674 jQuery("nav .navpointToggler.open").attr('aria-expanded', jQuery('nav .navpointToggler.open').siblings('ul').is(':hidden') ? 'true' : 'false'); 13675 } 13676 } 13677 else if(navpointToggler.length > 0){ 13678 navpointToggler.attr('tabindex', '-1'); 13679 /*Korrigieren wenn ausgewählter navpoint*/ 13680 if(!jQuery('html').hasClass('navlayer-open') && navpointToggler.hasClass('open'))navpointToggler.removeClass('open'); 13681 if(event.type == 'keyup') navpointToggler.attr('data-openedby', 'key' + (event.key != null ? event.key : '')); 13682 accessibility_navPoint_open(li); 13683 } 13684 else{ 13685 liS.each(function(){
13686 var cE = jQuery(this).css({'outline': 'none'}); 13687 var avoidToggle = cE.hasClass('selected') && !jQuery('html').hasClass('navlayer-open'); 13688 if(!avoidToggle && cE.children('.navpointToggler.open').length > 0){ 13689 accessibility_navPoint_close(cE); 13690 } 13691 }); 13692 } 13693 }; 13694 13695 accessibility_navPoint_close = function(nP){ 13696 navpoint_onmouseleave(nP, nP.parent().data('navlevel'), event); 13697 nP.children('.navpointToggler.open').each(function(){ 13698 jQuery(this).removeAttr('data-openedby'); 13699 navpointToggler_onclick(jQuery(this), {'status':'close'}); 13700 }); 13701 }; 13702 13703 accessibility_navPoint_open = function(nP, event){ 13704 navpoint_onmouseenter(nP, nP.parent().data('navlevel'), event); 13705 nP.children('.navpointToggler').each(function(){ 13706 navpointToggler_onclick(jQuery(this), {'status':'open'}); 13707 }); 13708 jQuery(document).on('keydown.closeNavpoint', function(e){ 13709 if(e.key === 'Escape'){ 13710 e.preventDefault(); 13711 if(nMTE.length > 0 && nMTE.is(':visible')){ 13712 closeNavigationMenu(); 13713 } 13714 else{ 13715 accessibility_navPoint_close(nP); 13716 nP.focus(); 13717 } 13718 jQuery(document).off('keydown.closeNavpoint'); 13719 } 13720 }); 13721 }; 13722 13723 jQuery(window).on('resize', adaptSizeNavigation); 13724 adaptSizeNavigation(); 13725 13726 jQuery('body').append('<div id="navlayer-background"/>'); 13727 } 13728}); 13729 13730//////////////////////////////////////////////////////////////// 13731// 13732// @method void showMegadropdown(id, url, mode) 13733// 13734// @desc Ãffnet einen eingebetteten Navigationspunkt als Mega Dropdown 13735// 13736// @return void 13737// 13738//////////////////////////////////////////////////////////////// 13739 13740loadMegaDropdown = function(id, url, options){ 13741 //console.log('mageDropdownLoad(' + id + ', ' + url + ')'); 13742 13743 options = options || {}; 13744 13745 var windowWidth = jQuery(window).width(); 13746 13747 var mode = options['mode']; 13748 var addNavId = options['addNavId']; 13749 var initToPreload = options['initToPreload']; 13750 13751 var navPoint = jQuery('#navpoint_' + id); 13752 13753 var navigationTogglerOnClick = jQuery('html').data('navigationtoggleronclick') ? jQuery('html').data('navigationtoggleronclick') : ''; 13754 13755 if(navigationTogglerOnClick == 'toggleFirstMegaDropdownIfFullWidth' && windowWidth >= maxSizeNavigationmenu){ 13756 navPoint = jQuery('#navigationMainToggler'); 13757 } 13758 13759 if(navPoint.data('hasLoaded') == '1'){ 13760 } 13761 else if(navPoint.data('loading') == '1'){ 13762 } 13763 else if(mode != 'iframe'){ 13764 13765 var navLevelEmbed = jQuery('<div class="navLevelEmbed" id="navEmbed_' + id + '"><div></div></div>'); 13766 13767 var wMegadropdownInsertPos = ''; 13768 try{wMegadropdownInsertPos = jQuery('#navigationMain').css('--wMegadropdownInsertPos');}catch(e){} 13769 //console.log(wMegadropdownInsertPos); 13770 13771 if(/append-(\w+)/.test(wMegadropdownInsertPos)){ 13772 var elementToAppend = jQuery('#' + RegExp.$1); 13773 elementToAppend.append(navLevelEmbed); 13774 elementToAppend.addClass('hasMegaDropdown'); 13775 } 13776 else if(/insertBefore-(\w+)/.test(wMegadropdownInsertPos)){ 13777 var elementToAppend = jQuery('#' + RegExp.$1); 13778 elementToAppend.before(navLevelEmbed); 13779 elementToAppend.addClass('hasMegaDropdown'); 13780 } 13781 else{ 13782 var elementToAppend = navPoint.parent(); 13783 //var elementToAppend = jQuery('#blockHeader'); 13784 elementToAppend.append(navLevelEmbed); 13785 elementToAppend.addClass('hasMegaDropdown'); 13786 } 13787 13788 url += (typeof url === 'string' && url.indexOf('?') == -1 ? '?' : '&') + 'viewmode=embed'; 13789 13790 if(addNavId != 'no'){ 13791 if(typeof(wNavidStandard) != 'undefined' && wNavidStandard != ''){ 13792 url += '&navid=' + wNavidStandard; 13793 } 13794 } 13795 url = url.replace('[URL]', location.pathname + location.search); 13796 13797 navPoint.data('loading', '1'); 13798 13799 jQuery.ajax({ 13800 type: "GET", 13801 url: url, 13802 async: true, 13803 success: function(result){ 13804 result = result.replace(/\n/g, '_wNL-'); 13805 result = result.replace(/(\s+id=")([^"]+)(")/gi, function(matches, p1, p2, p3){ 13806 if(!document.getElementById(p2)){ 13807 return ' data-replacedid="' + p2 + '"' + p1 + p2 + p3; 13808 } 13809 return ' data-replacedid="' + p2 + '"'; 13810 });
13811 result = result.replace(/^.*<!--\s*CONTENT:START\s*-->/im, ''); 13812 result = result.replace(/<!--\s*CONTENT:STOP\s*-->.*$/im, ''); 13813 result = result.replace(/_wNL-/g, "\n"); 13814 13815 navLevelEmbed.find('> div').html(result); 13816 13817 navLevelEmbed.find('> div').on('mouseenter', function(event){ 13818 openMegaDropdown(id); 13819 }); 13820 13821 var closeMegaDropdownType = jQuery(this).closest('ul[data-type]').attr('data-type') ? jQuery(this).closest('ul[data-type]').attr('data-type') : (jQuery('html').data('megadropdownclosetype') ? jQuery('html').data('megadropdownclosetype') : 'mouseleave'); 13822 13823 if(closeMegaDropdownType == 'click'){ 13824 } 13825 else if(!accessEventActive){ 13826 navLevelEmbed.find('> div').on('mouseleave', function(event){ 13827 wUiTmp['donotcloseMegadropdown'] = false; 13828 closeMegaDropdown(id, false, 300); 13829 }).on('mouseenter', function(event){ 13830 wUiTmp['donotcloseMegadropdown'] = true; 13831 }); 13832 } 13833 13834 navPoint.data('hasLoaded', '1'); 13835 navPoint.data('loading', ''); 13836 if(wUiTmp['megaDropdownShowAfterLoading'] ||Â options['openAfterLoad']){ 13837 openMegaDropdown(id); 13838 wUiTmp['megaDropdownShowAfterLoading'] = false; 13839 } 13840 13841 if(jQuery('#navigationMain[data-addMegadropdownCloser]').length > 0 && jQuery('#navigationMegadropdownCloser').length == 0){ 13842 jQuery('#navigationMain > nav').after('<div id="navigationMegadropdownCloser" class="close"><div/></div>'); 13843 } 13844 } 13845 }); 13846 } 13847 else{ 13848 13849 var elementToAppend = navPoint.parent(); 13850 elementToAppend.append('<div class="navLevelEmbed" id="navEmbed_' + id + '"></div>'); 13851 elementToAppend.addClass('hasMegaDropdown'); 13852 13853 url = url.indexOf('?') == -1 ? url + '?parentIframeId=navEmbedIframe_'+id : url + '&parentIframeId=navEmbedIframe_'+id; 13854 url = url.indexOf('dropdown') == -1 ? url + '&viewmode=blank' : url; 13855 url = url.replace('[URL]', location.pathname + location.search); 13856 13857 navPoint.data('hasLoaded', '1'); 13858 13859 var iframeEmbed = document.createElement('iframe'); 13860 13861 iframeEmbed.id = 'navEmbedIframe_' + id; 13862 iframeEmbed.className = 'navLevel1Embed'; 13863 iframeEmbed.frameBorder = '0'; 13864 iframeEmbed.scrolling = 'no'; 13865 iframeEmbed.src = url; 13866 13867 elementToAppend.find('.navLevelEmbed').append(iframeEmbed); 13868 navPoint.data('hasLoaded', '1'); 13869 13870 if(jQuery('#navigationMain[data-addMegadropdownCloser]').length > 0 && jQuery('#navigationMegadropdownCloser').length == 0){ 13871 jQuery('#navigationMain > nav').after('<div id="navigationMegadropdownCloser" class="close"><div/></div>'); 13872 } 13873 } 13874}; 13875 13876 13877//////////////////////////////////////////////////////////////// 13878// 13879// @method void showMegadropdown(id, url, mode) 13880// 13881// @desc Ãffnet einen eingebetteten Navigationspunkt als Mega Dropdown 13882// 13883// @return void 13884// 13885//////////////////////////////////////////////////////////////// 13886 13887openMegaDropdown = function(id, url, options){ 13888 //console.log('openMegaDropdown(' + id + ' ' + url + ')'); 13889 13890 wUiTmp['openMegaDropdownTime'] = typeof wUiTmp['openMegaDropdownTime'] !== 'undefined' ? wUiTmp['openMegaDropdownTime'] : {}; 13891 wUiTmp['openMegaDropdownTime'][id] = Date.now(); 13892 13893 if(!accessEventActive){ 13894 jQuery(document).off('keydown.closeMegadropdown').on('keydown.closeMegadropdown', function(e){ 13895 if(e.key === 'Escape' || e.key == 'Tab' && e.shiftKey){ 13896 closeMegaDropdown(id, true, options); 13897 jQuery('#navpoint_' + id).focus(); 13898 jQuery(document).off('keydown.closeMegadropdown'); 13899 } 13900 }); 13901 } 13902 13903 var navPoint = jQuery('#navpoint_' + id); 13904 var bodyE = jQuery('body'); 13905 var htmlE = jQuery('html'); 13906 13907 if(htmlE.hasClass('navmenu-open') && navPoint.parent().attr('data-allownavlevelembed') != '1'){ 13908 return false; 13909 } 13910 13911 options = options || {}; 13912 13913 var windowWidth = jQuery(window).width(); 13914 13915 if(windowWidth < maxSizeNavigationmenu){ 13916 return false; 13917 } 13918 13919 var mode = options['mode']; 13920 var addNavId = options['addNavId']; 13921 var initToPreload = options['initToPreload']; 13922 13923 var navEmbedId = '#navEmbed_' + id; 13924 var navEmbed = jQuery(navEmbedId); 13925 var nav = navPoint.closest('ul[data-navlevel=1]'); 13926 var onToggle = nav.attr('data-ontoggledropdown') ? nav.attr('data-ontoggledropdown') : (options['ontoggle'] ? options['ontoggle'] : ''); 13927 13928 13929 var navigationTogglerOnClick = htmlE.data('navigationtoggleronclick') ? htmlE.data('navigationtoggleronclick') : ''; 13930 13931 13932 if(navigationTogglerOnClick == 'toggleFirstMegaDropdownIfFullWidth' && windowWidth >= maxSizeNavigationmenu){ 13933 navPoint = jQuery('#navigationMainToggler'); 13934 } 13935 13936 if(navPoint.data('loading') == '1'){ 13937 wUiTmp['megaDropdownShowAfterLoading'] = true; 13938 return; 13939 } 13940 else if(navPoint.data('hasLoaded') != '1'){ 13941 options['openAfterLoad'] = true; 13942 loadMegaDropdown(id, url, options); 13943 return; 13944 } 13945 13946 if(!accessEventActive && wUiTmp['openMegaDropdownid'] != null && id != wUiTmp['openMegaDropdownid']){ 13947 closeMegaDropdown(wUiTmp['openMegaDropdownid'], true); 13948 } 13949 if(id === wUiTmp['openMegaDropdownid']) wUiTmp['donotcloseMegadropdown'] = true; 13950 13951 wUiTmp['openMegaDropdownid'] = id; 13952 13953 if(onToggle == 'toggleClass'){ 13954 var tClass = 'displayDropdown'; 13955 jQuery('.navLevelEmbed:not(' + navEmbedId +')').removeClass(tClass); 13956 navEmbed.addClass(tClass); 13957 } 13958 else{ 13959 jQuery('.navLevelEmbed:not(' + navEmbedId +')').hide({'duration' : 0, 'queue' : false}); 13960 navEmbed.fadeIn({'duration' : 0, 'queue' : false}); 13961 } 13962 13963 if(jQuery('#navlayer-background').length == 0){ 13964 bodyE.append('<div id="navlayer-background"/>'); 13965 } 13966 13967 htmlE.addClass('megadropdown-open'); 13968 13969 if(navPoint.data('haspreparedmagadropdown') != '1'){ 13970 var openMegaDropdownType = htmlE.data('megadropdownopentype') ? htmlE.data('megadropdownopentype')
13970: 'mouseenter'; 13971 var closeMegaDropdownType = htmlE.data('megadropdownclosetype') ? htmlE.data('megadropdownclosetype') : 'mouseenter'; 13972 var navigationTogglerOnClick = htmlE.data('navigationtoggleronclick') ? htmlE.data('navigationtoggleronclick') : ''; 13973 if(!accessEventActive){ 13974 if(openMegaDropdownType == 'click' || navigationTogglerOnClick == 'toggleFirstMegaDropdownIfFullWidth'){ 13975 if(bodyE.data('hasAddCloseEventMegadropdown') != '1'){ 13976 bodyE.on('click', function(event){ 13977 var isTrusted = event.originalEvent && event.originalEvent.isTrusted || event.isTrusted; 13978 if(isTrusted && jQuery(event.target).closest('.navLevelEmbed > div').length == 0 && bodyE.data('canCloseMegadropdown') == '1'){ 13979 closeMegaDropdown(undefined, true); 13980 } 13981 }); 13982 bodyE.data('hasAddCloseEventMegadropdown', '1'); 13983 } 13984 } 13985 else{ 13986 if(bodyE.data('hasAddCloseEventMegadropdown' + id) != '1'){ 13987 navEmbed.parent().on('mouseleave', function(event){ 13988 if(bodyE.data('canCloseMegadropdown') == '1'){ 13989 closeMegaDropdown(); 13990 } 13991 }); 13992 bodyE.data('hasAddCloseEventMegadropdown' + id, '1'); 13993 } 13994 } 13995 } 13996 /*Anmelden Keydownhandler*/ 13997 if(!accessEventActive){ 13998 var navEmbedE = navEmbed.children().first().attr('tabindex', 0); 13999 jQuery(document).off('keydown.onceKeyHandler').on('keydown.onceKeyHandler', function(e){ 14000 if(htmlE.hasClass('megadropdown-open') && e.key == 'Tab'){ 14001 navEmbedE.focus(); 14002 jQuery(document).off('keydown.onceKeyHandler'); 14003 } 14004 }); 14005 } 14006 14007 bodyE.data('canCloseMegadropdown', '1'); 14008 navEmbed.find('.wglBannerSlider').wBannerSlider(); 14009 navEmbed.find('.wglPictureGallery').wPictureGallery(); 14010 navEmbed.find('.wglTabcontainer').wTabcontainer(); 14011 navEmbed.find('.wglAccordion').wAccordion(); 14012 14013 navPoint.data('haspreparedmagadropdown', '1'); 14014 } 14015 else{ 14016 window.setTimeout(function(){ 14017 bodyE.data('canCloseMegadropdown', '1'); 14018 }, 100); 14019 } 14020 14021 jQuery(window).trigger('resize'); 14022}; 14023 14024 14025//////////////////////////////////////////////////////////////// 14026// 14027// @method void showMegadropdown(id, url, mode) 14028// 14029// @desc Ãffnet einen eingebetteten Navigationspunkt als Mega Dropdown 14030// 14031// @return void 14032// 14033//////////////////////////////////////////////////////////////// 14034 14035closeMegaDropdown = function(id, force, delayClose){ 14036 //console.log('closeMegaDropdown(' + id + ', ' + force + ')'); 14037 14038 id = id || wUiTmp['openMegaDropdownid']; 14039 jQuery(document).off('keydown.closeMegadropdown'); 14040 14041 var navPoint = jQuery('#navpoint_' + id); 14042 var navEmbed = jQuery('#navEmbed_' + id); 14043 var nav = navPoint.closest('ul[data-navlevel=1]'); 14044 var onToggle = nav.attr('data-ontoggledropdown') ? nav.attr('data-ontoggledropdown') : ''; 14045 var tClass = 'displayDropdown'; 14046 14047 if(typeof id === 'undefined' || typeof wUiTmp['openMegaDropdownTime'] === 'undefined'){ 14048 return; 14049 } 14050 14051 if(force){ 14052 if(onToggle == 'toggleClass') navEmbed.removeClass(tClass); 14053 else navEmbed.hide({'duration' : 0, 'queue' : false}); 14054 jQuery('html').removeClass('megadropdown-open'); 14055 } 14056 14057 window.setTimeout(function(){ 14058 if(wUiTmp['donotcloseMegadropdown'] || Date.now() - wUiTmp['openMegaDropdownTime'][id] < 10 + 16){ 14059 wUiTmp['openMegaDropdownTime'][id] = 0; 14060 return; 14061 } 14062 14063 if(onToggle == 'toggleClass') navEmbed.removeClass(tClass); 14064 else navEmbed.hide({'duration' : 0, 'queue' : false}); 14065 14066 megadropdownTimerClose = null; 14067 var removeClass = true; 14068 14069 //deleteable 0726 if(jQuery('#navigationMain div[id^=navEmbed]').is(':visible') && jQuery('#navigationMain div[id^=navEmbed]').css('display') != 'block') removeClass = false; 14070 if(jQuery('#navigationMain div[id^=navEmbed]').is(':visible')) removeClass = false; 14071 if(removeClass){ 14072 jQuery('html').removeClass('megadropdown-open'); 14073 wUiTmp['openMegaDropdownid'] = undefined; 14074 } 14075 if(id == wUiTmp['openMegaDropdownid']) jQuery('body').data('canCloseMegadropdown', '0'); 14076 }, (delayClose !== undefined ? delayClose : 16)); 14077 14078}; 14079 14080//////////////////////////////////////////////////////////////// 14081// 14082// @method void toggleFirstMegaDropdown() 14083// 14084// @desc Ãffnet bzw. schlieÃt das erste Mega Dropdown 14085// 14086// @return void 14087// 14088//////////////////////////////////////////////////////////////// 14089 14090megaDropdownToggleFirst = function(){ 14091 14092 return; 14093 /* 14094 if(!jQuery('html').hasClass('megadropdown-open')){ 14095 if(jQuery('nav a[data-previewlink]').length != 0){ 14096 var previewlink = jQuery('nav a[data-previewlink]'); 14097 var firstNavLevelEmbedID = previewlink.attr('id').replace('navpoint_', ''); 14098 var url = previewlink.attr('data-previewlink'); 14099 megaDrodownOpen(firstNavLevelEmbedID, url, {}); 14100 } 14101 } 14102 else{ 14103 closeMegaDropdown(); 14104 } 14105 */ 14106}; 14107 14108//////////////////////////////////////////////////////////////// 14109// 14110// @method void closeNavigationMenu() 14111// 14112// @desc SchlieÃt die Menünavigation 14113// 14114// @return void 14115// 14116//////////////////////////////////////////////////////////////// 14117 14118closeNavigationMenu = function(){ 14119 14120 jQuery('html').removeClass('navmenu-open'); 14121 jQuery('#navigationMain').removeClass('open'); 14122 jQuery(wUiTmp['elementNavigationToggler']).removeClass('open'); 14123}; 14124 14125//////////////////////////////////////////////////////////////// 14126// 14127// Beim Klicken auf den Toggler, um die mobile Navigation ein- und auszublenden 14128// 14129//////////////////////////////////////////////////////////////// 14130 14131navigationToggler_onclick = function(element){ 14132 // console.log('navigationToggler_onclick'); 14133 14134 var windowWidth = jQuery(window).width(); 14135 14136 var navigationTogglerOnClick = jQuery('html').data('navigationtoggleronclick') ? jQuery('html').data('navigationtoggleronclick') : ''; 14137 var besideNavigationOnClick = jQuery('#navigationMain').data('onlickbesidenavigation') ? jQuery('#navigationMain').data('onlickbesidenavigation') : ''; 14138 var keepSubmenuesOpenOnClose = jQuery('#navigationMainToggler').data('keepsubmenuesopenonclose') ? jQuery('#navigationMainToggler').data('keepsubmenuesopenonclose') : ''; 14139 14140 if(navigationTogglerOnClick == 'toggleFirstMegaDropdownIfFullWidth' && windowWidth >= maxSizeNavigationmenu){ 14141 toggleFirstMegaDropdown(); 14142 return; 14143 } 14144 14145 wUiTmp['elementNavigationToggler'] = element; 14146 jQuery(element).toggleClass('open'); 14147 14148 if(jQuery('#navlayer-background').length == 0){ 14149 jQuery('body').append('<div id="navlayer-background"/>'); 14150 } 14151 14152 if(jQuery('#navigationMenuCloser').length == 0){ 14153 jQuery('#navigationMain > nav > div').prepend('<div id="navigationMenuCloser" class="open"><div/></div>'); 14154 if(!accessEventActive){ 14155 jQuery('#navigationMenuCloser').on('click', function(){navigationToggler_onclick(jQuery(this))}); 14156 } 14157 else{ 14158 wAccessEvents['navigation.navigationMenuCloser'].element = jQuery('#navigationMenuCloser'); 14159 wAccessEvents['navigation.navigationMenuCloser'].active = true; 14160 wAccessHandler.addEvent(wAccessEvents['navigation.navigationMenuCloser']); 14161 } 14162 } 14163 14164 if(jQuery('#navigationMenuPre').length != 0 && jQuery('#navigationMain > nav > div > #navigationMenuPre').length == 0){ 14165 jQuery('#navigationMain > nav > div').prepend(jQuery('#navigationMenuPre')); 14166 if(jQuery('#navigationMain > nav > div').attr('data-preventclickchildren') === '1'){ 14167 jQuery('#navigationMenuPre').on('click', function(){event.stopPropagation()}); 14168 } 14169 jQuery('#navigationMenuPre').append(jQuery('*[data-appendnavigationmenupre="1"]').show()); 14170 } 14171 14172 if(jQuery('#navigationMenuPost').length != 0 && jQuery('#navigationMain > nav > div > #navigationMenuPost').length == 0){ 14173 jQuery('#navigationMain > nav > div').append(jQuery('#navigationMenuPost')); 14174 if(jQuery('#navigationMain > nav > div').attr('data-preventclickchildren') === '1'){ 14175 jQuery('#navigationMenuPost').on('click', function(){event.stopPropagation()}); 14176 } 14177 if(jQuery('*[data-appendnavigationmenupost="1"]').is(':visible')){ 14178 jQuery('#navigationMenuPost').append(jQuery('*[data-appendnavigationmenupost="1"]').clone().show()); 14179 } 14180 } 14181 14182 if(!jQuery('html').hasClass('navmenu-open')){ 14183 wCloseWaiMenu(); 14184 jQuery('html').addClass('navmenu-open'); 14185 jQuery('#navigationMain').addClass('open'); 14186 jQuery(element).attr('aria-expanded', 'true'); 14187 } 14188 else{ 14189 jQuery('html').removeClass('navmenu-open'); 14190 jQuery('#navigationMain').removeClass('open'); 14191 jQuery(element).attr('aria-expanded', 'false'); 14192 if(keepSubmenuesOpenOnClose != '1'){ 14193 jQuery('nav li.displaySub').removeClass('displaySub'); 14194 } 14195 } 14196 14197 if(!wUiTmp['hasAddEventToRestoreNavigationToggler']){ 14198 jQuery(window).on('resize', function(event){ 14199 if(event.isTrigger && jQuery('html').hasClass('navmenu-open')){ 14200 var windowWidth = jQuery(window).width(); 14201 try{ 14202 if(windowWidth >= maxSizeNavigationmenu && wDocument.element('#navigationMainToggler') && window.getComputedStyle(wDocument.element('#navigationMainToggler')).getPropertyValue('display') == 'none'){ 14203 closeNavigationMenu(); 14204 } 14205 } 14206 catch(e){} 14207 } 14208 }); 14209 14210 if(besideNavigationOnClick == 'closeNavigation'){ 14211 jQuery('#navigationMain').on('click', function(event){event.stopPropagation();}); 14212 14213 jQuery(window).on('click', function(event){ 14214 if(!event.isTrigger && jQuery('html').hasClass('navmenu-open') && jQuery(event.originalEvent.target).closest('.navigationMainToggler').length != 1){
14215 if(jQuery('div#navigationMain').find(jQuery(event.target)).length === 0) closeNavigationMenu(); 14216 } 14217 }); 14218 } 14219 14220 wUiTmp['hasAddEventToRestoreNavigationToggler'] = true; 14221 } 14222 jQuery(element).siblings('nav').find('ul li a, .navpointToggler').attr('tabindex', jQuery(element).attr('aria-expanded') !== "false" ? '0' : '-1'); 14223 14224}; 14225 14226//////////////////////////////////////////////////////////////// 14227// 14228// Beim Ãffnen von Unterpunkte per Klick, wie es z.B. in der mobilen Navigation der Fall ist 14229// 14230//////////////////////////////////////////////////////////////// 14231 14232navpointToggler_onclick = function(element, options = []){ 14233 //console.log('navpointToggler_onclick(' + element + ')'); 14234 14235 var windowWidth = jQuery(window).width(); 14236 var onToggle = jQuery(element).attr('data-ontoggle') ? jQuery(element).attr('data-ontoggle') : (options['ontoggle'] ? options['ontoggle'] : ''); 14237 var animation = jQuery(element).next('ul').attr('data-animation') ? jQuery(element).next('ul').attr('data-animation') : (options['animation'] ? options['animation'] : 'height'); 14238 14239 if(options['status'] && options['status'] == 'open'){ 14240 jQuery(element).addClass('open').attr('aria-expanded', true); 14241 animation = options['animation'] !== undefined ? options['animation'] : 'open'; 14242 } 14243 else if(options['status'] && options['status'] == 'close'){ 14244 jQuery(element).removeClass('open').attr('aria-expanded', false); 14245 animation = options['animation'] !== undefined ? options['animation'] : 'close'; 14246 } 14247 else{ 14248 jQuery(element).toggleClass('open').attr('aria-expanded', jQuery(element).attr('aria-expanded') == 'true' ? 'false' : 'true'); 14249 } 14250 14251 if(onToggle.indexOf('|') != -1){ 14252 var onToggles = onToggle.split('|'); 14253 onToggle = onToggles[0]; 14254 if(/(\w+)\(min(\d+)px\)/.test(onToggles[1]) && windowWidth >= parseInt(RegExp.$2)){ 14255 onToggle = RegExp.$1; 14256 } 14257 } 14258 14259 if(animation.indexOf('|') != -1){ 14260 var animations = animation.split('|'); 14261 animation = animations[0]; 14262 if(/(\w+)\(min(\d+)px\)/.test(animations[1]) && windowWidth >= parseInt(RegExp.$2)){ 14263 animation = RegExp.$1; 14264 } 14265 } 14266 var cEParent = jQuery(element).parent(); 14267 var cEParentSiblings = cEParent.siblings(); 14268 14269 if(onToggle == 'toggleClassNavpoint'){ 14270 cEParent.toggleClass('displaySub'); 14271 } 14272 else if(onToggle == 'toggleClassNavpointCloseSiblings'){ 14273 cEParentSiblings.children('.navpointToggler').removeClass('open'); 14274 cEParent.find('ul .navpointToggler').removeClass('open'); 14275 cEParentSiblings.removeClass('displaySub').addClass('hideSub'); 14276 cEParent.find('li').removeClass('displaySub').addClass('hideSub'); 14277 cEParent.toggleClass('displaySub'); 14278 } 14279 else if(onToggle == 'showOnlyCurrent'){ 14280 cEParentSiblings.children('.navpointToggler').removeClass('open'); 14281 cEParentSiblings.removeClass('displaySub').addClass('hideSub'); 14282 14283 window.setTimeout(function(){ 14284 cEParent.removeClass('hideSub').addClass('displaySub'); 14285 }, 120); 14286 } 14287 else if(onToggle == 'closeSiblings'){ 14288 cEParentSiblings.children('.navpointToggler').removeClass('open').removeClass('displaySub').addClass('hideSub'); 14289 //nicht ausführen wenn aktuelles Element geschlossen wird! 14290 if(animation != 'close'){ 14291 if(animation == 'display'){ 14292 cEParentSiblings.children('ul').hide({'duration' : 0}); 14293 } 14294 else if(animation == 'fadeInOut'){ 14295 cEParentSiblings.children('ul').fadeOut(); 14296 } 14297 else if(animation == 'toggle'){ 14298 cEParentSiblings.children('ul').animate({animation : 'hide'}); 14299 } 14300 else if(animation == 'toggleClass'){ 14301 cEParentSiblings.children('ul').animate({animation : 'hide'}); 14302 } 14303 else{ 14304 cEParentSiblings.children('ul').animate({height : 'hide'}); 14305 } 14306 } 14307 window.setTimeout(function(){ 14308 14309 if(animation == 'display'){ 14310 jQuery(element).next('ul').toggle({'duration' : 0}); 14311 } 14312 else if(animation == 'fadeInOut'){ 14313 jQuery(element).next('ul').fadeToggle(); 14314 } 14315 else if(animation == 'toggle'){ 14316 jQuery(element).next('ul').toggle(); 14317 } 14318 else if(animation == 'toggleClass'){ 14319 jQuery(element).next('ul').toggle(); 14320 window.setTimeout(function(){ 14321 jQuery(element).parent().toggleClass('displaySub'); 14322 }, 32); 14323 } 14324 else if(animation == 'open'){ 14325 jQuery(element).next('ul').stop(true,true).animate({height: 'show'}, 0); 14326 } 14327 else if(animation == 'close'){ 14328 jQuery(element).next('ul').stop(true,true).animate({height : 'hide'}, 0); 14329 } 14330 else{ 14331 jQuery(element).next('ul').animate({height : 'toggle'}); 14332 } 14333 }, animation == 'display' ? 0 : 120); 14334 } 14335 else if(onToggle == 'none'){ 14336 } 14337 else{ 14338 if(animation == 'open'){ 14339 jQuery(element).next('ul').stop(true,true).animate({height: 'show'}, 0); 14340 } 14341 else if(animation == 'close'){ 14342 jQuery(element).next('ul').stop(true,true).animate({height : 'hide'}, 0); 14343 } 14344 else{ 14345 jQuery(element).next('ul').animate({height : 'toggle'}); 14346 } 14347 } 14348}; 14349 14350//////////////////////////////////////////////////////////////// 14351// 14352// Beim Klick eines Navigationspunktes, um dabei z.B. die Menünavigation zu schlieÃen 14353// 14354//////////////////////////////////////////////////////////////// 14355 14356navpoint_onclick = function(element, level, event){ 14357 //console.log('navpoint_onclick '); 14358 14359 wUiTmp['currentNavpoint'] = element; 14360 var openMegaDropdownType = jQuery('html').data('megadropdownopentype') ? jQuery('html').data('megadropdownopentype')
14360: 'mouseenter'; 14361 14362 if(openMegaDropdownType == 'click' && !jQuery(element).attr('data-previewLink')){ 14363 closeMegaDropdown(); 14364 } 14365 14366 var navPoint = jQuery(element).parent(); 14367 14368 adjustNavlayer(navPoint); 14369 14370 var windowWidth = jQuery(window).width(); 14371 var preventedClick = false; 14372 var doNotClose = jQuery(element).attr('data-donotclose') == '1'; 14373 var preventCloseNavmenuIfHasChilds = jQuery(element).attr('data-preventclosenavmenuifhaschilds') == '1'; 14374 14375 jQuery(element).attr('data-donotclose', 0); 14376 14377 //Wurde für das A-Tag ein HREF # angegeben, so wird die GröÃenangabe ingoriert 14378 //wNavigationIgnoreHash = false; // globaler Schalter zum berücksichtigen über design.js 14379 var ignoreHash = (typeof wNavigationIgnoreHash == 'undefined' || !wNavigationIgnoreHash) ? true : false; 14380 var isHash = !ignoreHash && jQuery(element).attr('href') == '#'; 14381 var hasHash = jQuery(element).attr('href').indexOf('#') != -1; 14382 //Ausschalten der Prüfung auf 1. Ebene der Navigation. Macht Sinn in Verbindung mit ignoreHash 14383 //wNavigationIgnoreNavLevel = true; 14384 var ignoreNavLevel = (typeof wNavigationIgnoreNavLevel == 'undefined' || !wNavigationIgnoreNavLevel) ? false : true; 14385 14386 if(typeof wAddSelectedOnClickNavpoint != 'undefined' && wAddSelectedOnClickNavpoint){ 14387 navPoint.parent().find('.selected').removeClass('selected'); 14388 navPoint.addClass('selected'); 14389 } 14390 if(windowWidth >= maxSizeNavigationmenu || !ignoreHash){ 14391 if(jQuery(element).parent('.open, .openSelected, .openDescendantSelected').find('> ul, > div').length > 0){ 14392 14393 if(jQuery(element).siblings('div.submenu').length > 0){ 14394 //jQuery(element).parent('.open, .openSelected, .openDescendantSelected').find('> div').on('click', function(){ 14395 jQuery(element).siblings('div.submenu').addClass('tmp'); 14396 jQuery(element).parent().parent().find('> li > div.submenu.open:not(.tmp)').removeClass('open'); 14397 jQuery(element).siblings('div.submenu').toggleClass('open').removeClass('tmp'); 14398 //}); 14399 } 14400 if(event != undefined && event.type == 'touchstart'){ 14401 window['wglTouchStartedNavlayers'] = new Date().getTime(); 14402 if(jQuery(element).attr('data-has-already-touched') != '1'){ 14403 jQuery(element).attr('data-has-just-touched', '1'); 14404 window.setTimeout(function(){jQuery(element).attr('data-has-just-touched', '0');}, 300); 14405 14406 jQuery(element).parent().parent().find('> li > a').attr('data-has-already-touched', ''); 14407 jQuery(element).attr('data-has-already-touched', '1'); 14408 preventedClick = true; 14409 } 14410 } 14411 else{ 14412 //var navigationLayerOpenType = jQuery('html').data('navigationlayeropentype') ? jQuery('html').data('navigationlayeropentype') : 'mouseenter'; 14413 //Ergänzt durch Prüfung auf attr href des a-Tags 14414 if(navigationlayeropentype == 'click' && (jQuery(element).parent().parent().data('navlevel') == '1' || ignoreNavLevel) && (ignoreHash || isHash)){ 14415 event.preventDefault(); 14416 14417 jQuery(element).parent().siblings().removeClass('clicked'); 14418 if(!jQuery(element).parent().hasClass('clicked')){ 14419 jQuery(element).parent().addClass('clicked'); 14420 jQuery('html').addClass('navlayer-open'); 14421 } 14422 else{ 14423 jQuery(element).parent().removeClass('clicked') ; 14424 jQuery('html').removeClass('navlayer-open'); 14425 } 14426 14427 //Ergänzt Aufurf des navpointToggler_onclick wenn span-Tag als Sibling existiert 14428 //if(jQuery(element).siblings('span.navpointToggler').length == '1' && jQuery(element).siblings('span.navpointToggler').css('display') != 'none'){ 14429 //navpointToggler_onclick(jQuery(element).siblings('span.navpointToggler')); 14430 //} 14431 if(jQuery('body').data('hasAddCloserNavigationOnClick') != '1'){ 14432 jQuery('body').on('click', function(event){ 14433 if(event.originalEvent && event.target.parentNode.className.indexOf('clicked') == -1){ 14434 jQuery('nav li.clicked').removeClass('clicked'); 14435 jQuery('html').removeClass('navlayer-open'); 14436 } 14437 }); 14438 } 14439 jQuery('body').data('hasAddCloserNavigationOnClick', '1'); 14440 } 14441 else if(jQuery(element).attr('data-has-already-touched') == '1'){ 14442 if(jQuery(element).attr('data-has-just-touched') == '1'){ 14443 event.preventDefault(); 14444 return false;
14445 } 14446 } 14447 return false; 14448 } 14449 } 14450 } 14451 14452 if(!preventedClick && jQuery('html').hasClass('navmenu-open')){ 14453 if(event.type != 'touchstart'){ 14454 window.setTimeout(function(){ 14455 if(!doNotClose && !preventCloseNavmenuIfHasChilds){ 14456 closeNavigationMenu(); 14457 } 14458 }, 320); 14459 } 14460 } 14461}; 14462 14463//////////////////////////////////////////////////////////////// 14464// 14465// Beim Ãberfahren eines Navigationspunktes, um dabei z.B. Untermenüs auszurichten 14466// 14467//////////////////////////////////////////////////////////////// 14468 14469navpoint_onmouseenter = function(element, level){ 14470 //console.log('navpoint_onmouseenter(' + element + ', ' + level + ')'); 14471 14472 var navPoint = jQuery(element); 14473 var id = (navPoint.find('a').attr('id') || '').replace('navpoint_', ''); 14474 if(wUiTmp['openMegaDropdownid'] !== undefined && wUiTmp['openMegaDropdownid'] !== null && id != wUiTmp['openMegaDropdownid']){ 14475 closeMegaDropdown(wUiTmp['openMegaDropdownid'], false); 14476 } 14477 else if(navPoint.hasClass('hasMegaDropdown')) wUiTmp['donotcloseMegadropdown'] = true; 14478 14479 if(jQuery('html').data('megadropdownopentype') == 'click'){ 14480 return; 14481 } 14482 14483 adjustNavlayer(navPoint); 14484 14485 if(!jQuery('html').hasClass('navmenu-open')){ 14486 14487 var layersSub = navPoint.find('> ul'); 14488 // Falls Unterpunkte bestehen 14489 if(layersSub.length != 0 && level == 1){ 14490 jQuery('html').addClass('navlayer-open'); 14491 } 14492 } 14493 14494}; 14495 14496//////////////////////////////////////////////////////////////// 14497// 14498// Beim Ãberfahren eines Navigationspunktes, dabei z.B. Untermenüs auszurichten 14499// 14500//////////////////////////////////////////////////////////////// 14501 14502navpoint_onmouseleave = function(element, level, event){ 14503 //console.log('navpoint_onmouseleave(' + element + ', ' + level + ')'); 14504 14505 var closeMegaDropdownType = jQuery(this).closest('ul[data-type]').attr('data-type') ? jQuery(this).closest('ul[data-type]').attr('data-type') : (jQuery('html').data('megadropdownclosetype') ? jQuery('html').data('megadropdownclosetype') : 'mouseleave'); 14506 14507 if(closeMegaDropdownType == 'click'){ 14508 return; 14509 } 14510 14511 var navPoint = jQuery(element); 14512 var layersSub = navPoint.find('> ul'); 14513 var id = (navPoint.find('a').attr('id') || '').replace('navpoint_', ''); 14514 14515 if(level == 1){ 14516 jQuery('html').removeClass('navlayer-open'); 14517 } 14518 14519 if(closeMegaDropdownType == 'mouseleave'){ 14520 var delay = undefined; 14521 if(id === wUiTmp['openMegaDropdownid']){ 14522 wUiTmp['donotcloseMegadropdown'] = false; 14523 delay = 300; 14524 } 14525 if(navPoint.hasClass('hasMegaDropdown')){ 14526 closeMegaDropdown(id, false, delay); 14527 event.stopPropagation(); 14528 } 14529 } 14530 14531 if(typeof wNavpointOnMouseLeave == 'function'){ 14532 wNavpointOnMouseLeave(element, level); 14533 } 14534}; 14535 14536//////////////////////////////////////////////////////////////// 14537// 14538// Beim Ãndern der BildschirmgröÃe 14539// 14540//////////////////////////////////////////////////////////////// 14541 14542adaptSizeNavigation = function(){ 14543 14544 var windowWidth = jQuery(window).width(); 14545 14546 if(windowWidth >= maxSizeNavigationmenu){ 14547 jQuery('nav').find('li > ul[data-wrapifnavigationfull="1"]').wrap('<div class="submenu"></div>'); 14548 } 14549 else{ 14550 jQuery('nav').find('div > ul[data-wrapifnavigationfull="1"]').unwrap(); 14551 } 14552}; 14553 14554//////////////////////////////////////////////////////////////// 14555// 14556// Passt den Navigations-Layer an 14557// 14558//////////////////////////////////////////////////////////////// 14559 14560adjustNavlayer = function(navPoint, reset = false){ 14561 14562 var windowWidth = jQuery(window).width(); 14563 if(windowWidth >= maxSizeNavigationmenu && navPoint != null){ 14564 var offsetRightParent = null; 14565 navPoint.find('ul[data-addisrightcol="1"] > li').each(function(){ 14566 offsetRightParent = offsetRightParent != null ? offsetRightParent : jQuery(this).parent().offset().left + jQuery(this).parent().width(); 14567 if(offsetRightParent - (jQuery(this).offset().left + jQuery(this).width()) < 32){ 14568 jQuery(this).attr('data-isrightcol', '1'); 14569 } 14570 else{ 14571 jQuery(this).removeAttr('data-isrightcol'); 14572 } 14573 }); 14574 14575 if(navPoint.closest('ul[data-adaptlayer="1"]').length != 0){ 14576 if(navPoint.find('> ul').length > 0){ 14577 14578 var limitNavigationArea = jQuery(window).width(); 14579 14580 if(navPoint.closest('.wglNavigationLayerLimitArea').length > 0){ 14581 limitNavigationArea = navPoint.closest('.wglNavigationLayerLimitArea').offset().left + navPoint.closest('.wglNavigationLayerLimitArea').width(); 14582 }
14583 var diffWidthLayer = limitNavigationArea - navPoint.find('ul').offset().left - navPoint.find('ul').outerWidth(); 14584 var diffWidthLayerSub = navPoint.find('ul').outerWidth(); 14585 14586 if(navPoint.parent().data('navlevel') == '1'){ 14587 14588 // Breite der Unterpunkte anpassen 14589 widthMain = Math.round(navPoint[0].getBoundingClientRect().width * 2) / 2; 14590 widthSub = navPoint.find('ul').width(); 14591 14592 if(widthSub <= widthMain){ 14593 navPoint.find('> ul').css({'width' : String(widthMain) + 'px'}); 14594 } 14595 14596 //if(jQuery(window).height() - navPoint.offset().top - navPoint.height() + jQuery(window).scrollTop() - navPoint.find('ul').height() < 20){ 14597 // navPoint.find('ul').css({'max-height' : String(jQuery(window).height() - navPoint.offset().top - navPoint.height() + jQuery(window).scrollTop() - 20) + 'px'}); 14598 //} 14599 14600 if(diffWidthLayer < 0){ 14601 navPoint.find('> ul').css({'margin-left' : diffWidthLayer}); 14602 navPoint.find('> ul').addClass('subleftside'); 14603 } 14604 else if(diffWidthLayer < diffWidthLayerSub){ 14605 navPoint.find('> ul').addClass('subleftside'); 14606 } 14607 else{ 14608 navPoint.find('> ul').addClass('subrightside'); 14609 } 14610 } 14611 else{ 14612 var hasSubLeftSide = navPoint.closest('ul').hasClass('subleftside') ; 14613 if(typeof(wTryToKeepDirectionOfNavlayers) != 'undefined' && wTryToKeepDirectionOfNavlayers && hasSubLeftSide){ 14614 var navPointCheckWidth = navPoint.find('> ul > li'); 14615 if(navPointCheckWidth.length == 0 || navPointCheckWidth.width() == 0){ 14616 navPointCheckWidth = navPoint; 14617 } 14618 var leftAfterOpen = parseInt(navPoint.offset().left - navPointCheckWidth.width() * 2); 14619 if(leftAfterOpen > 32){ 14620 navPoint.find('> ul').css({'margin-left' : diffWidthLayer}); 14621 navPoint.find('> ul').addClass('subleftside'); 14622 } 14623 else{ 14624 navPoint.find('> ul').addClass('subrightside'); 14625 } 14626 } 14627 else{ 14628 var leftAfterOpen = hasSubLeftSide ? parseInt(navPoint.offset().left + navPoint.width() * 1 - 4) : parseInt(navPoint.offset().left + navPoint.width() * 3 - 4); 14629 if(leftAfterOpen > parseInt(jQuery(window).width())){ 14630 navPoint.find('> ul').css({'margin-left' : diffWidthLayer}); 14631 navPoint.find('> ul').addClass('subleftside'); 14632 } 14633 else{ 14634 navPoint.find('> ul').addClass('subrightside'); 14635 } 14636 } 14637 var diffTop = navPoint.offset().top - jQuery(window).scrollTop(); 14638 14639 var diffBottom = jQuery(window).height() + jQuery(window).scrollTop() - navPoint.offset().top - navPoint.find('ul').height(); 14640 if(diffBottom < 20){ 14641 var diffMargin = (-diffBottom > diffTop ? -diffTop + 20: diffBottom - 20); 14642 navPoint.find('> ul').css({'margin-top' : String(diffMargin) + 'px'}); 14643 } 14644 } 14645 } 14646 } 14647 } 14648 else if(windowWidth < maxSizeNavigationmenu && reset) { 14649 jQuery('ul.subleftside').each(function(){ 14650 var cE = jQuery(this); 14651 cE.css({'margin-left' : ''}).removeClass('subleftside'); 14652 }) 14653 } 14654}; 14655 14656//////////////////////////////////////////////////////////////// 14657// 14658// Prüft ob die Darstellung der Navigation mobil ist 14659// 14660//////////////////////////////////////////////////////////////// 14661 14662const isMobileNavigation = function(){ 14663 return jQuery(window).width() >= maxSizeNavigationmenu ? false : true; 14664}; 14665 14666//////////////////////////////////////////////////////////////// 14667// 14668// Liest Optionen für die Navigation aus, abhängig von den data-Attributen 14669// Beispiel: 14670// html[data-navigationlayeropentype] für Desktop 14671// html[data-navigationlayeropentypemobile] für Mobile darstellung 14672// 14673// @param id - id der option ohne mobile - das wird automatisch hinzugefügt 14674// 14675// @param standard - Wert der angenommen werden soll wenn er nicht gefunden wird 14676// 14677// @param node - Knoten in dem das Attribut gesucht werden soll, standard html-Element. 14678// 14679//////////////////////////////////////////////////////////////// 14680 14681const getNavigationOptions = function(id, standard = '', node = null) { 14682 if (node == null) node = jQuery('html'); 14683 if (node.length === 0) return standard; 14684 const useMobile = isMobileNavigation(); 14685 let data = useMobile ? node.attr('data-' + id + 'mobile') : node.attr('data-' + id); 14686 if (data == null || data === '') data = useMobile ? node.data(id + 'mobile') : node.data(id); 14687 return data != null && data !== '' ? data : standard; 14688}; 14689 14690/*Event für den navigationMenuCloser*/ 14691wAccessEvents['navigation.navigationMenuCloser'] = { 14692 id : 'navigationMenuCloser', 14693 active : false, 14694 focusAfterOpen : true, 14695 14696 onclick : function(cO, e){ 14697 navigationToggler_onclick(cO.element); 14698 cO.closeNavigation(cO); 14699 }, 14700 14701 closeNavigation : function(cO){ 14702 var navMain = cO.element.closest('#navigationMain');
14703 if(jQuery('html.navmenu-open').length == 1) navMain.data('aeisopen', 'yes'); 14704 else{ 14705 navMain.find('#navigationMainToggler').removeClass('open').focus(); 14706 navMain.data('aeisopen', 'no'); 14707 } 14708 }, 14709 14710 onkeydown : { 14711 keyEnter: { trigger: 'onclick', stop : true }, 14712 keyEscape : function(cO, e){ 14713 //if(jQuery('html.navmenu-open').length == 1) navigationToggler_onclick(cO.element); 14714 cO.closeNavigation(cO); 14715 }, 14716 onafterkeydown : function(cO, e){ 14717 if(cO.element.closest('#navigationMain').data('aeisopen') == 'no' && (e.key == "Enter" || e.key === 'Escape')) jQuery('#navigationMainToggler').focus(); 14718 } 14719 } 14720}; 14721 14722/*Event für den NavigationMegadropdownCloser*/ 14723wAccessEvents['navigation.navigationEmbedCloser'] = { 14724 id : 'navigationEmbedCloser', 14725 curNavPointEmbed : null, 14726 14727 onclick : function(cO, e){ 14728 cO.closeNavigation(cO); 14729 }, 14730 14731 closeNavigation : function(cO){ 14732 this.curNavPointEmbed.navPointClose(this.curNavPointEmbed); 14733 this.toggleNavigation('close'); 14734 this.curNavPointEmbed.element.focus(); 14735 }, 14736 14737 toggleNavigation : function(status){ 14738 if(status == 'close') this.element.removeClass('open').addClass('close'); 14739 else this.element.removeClass('close').addClass('open'); 14740 }, 14741 14742 onkeydown : { 14743 keyTab: function(cO, e){ 14744 if(cO.curNavPointEmbed != null && cO.curNavPointEmbed.aENavLevelEmbed != null && cO.curNavPointEmbed.aENavLevelEmbed.element.length > 0){ 14745 var el = wAccessHandler.getNextFocusableElement(cO.curNavPointEmbed.aENavLevelEmbed); 14746 requestAnimationFrame(() => {el[0].focus();}); 14747 } 14748 }, 14749 keyEnter: function(cO, e){ 14750 cO.closeNavigation(cO); 14751 e.stopPropagation(); 14752 e.stopImmediatePropagation(); 14753 e.preventDefault(); 14754 }, 14755 14756 keyEscape : function(cO, e){ 14757 cO.closeNavigation(cO); 14758 } 14759 } 14760}; 14761 14762/*Event für den navigationMaintoggler*/ 14763wAccessEvents['navigation.navigationMainToggler'] = { 14764 14765 active : false, 14766 id : 'navigationMainToggler', 14767 14768 onready : function(cO){ 14769 var navMain = cO.element.closest('#navigationMain'); 14770 navMain.data('aemaintogglerid', cO.id); 14771 return true; 14772 }, 14773 14774 onclick : function(cO, e){ 14775 navigationToggler_onclick(cO.element); 14776 var navMain = cO.element.closest('#navigationMain'); 14777 navMain.data('aetoggledbytoggler', true); 14778 if(jQuery('html.navmenu-open').length == 1){ 14779 navMain.data('aeisopen', 'yes'); 14780 wAccessHandler.activateTabindex(cO.element.next('nav')); 14781 var navListenerId = jQuery('#navigationMain').data('aenavlistener'); 14782 cO.navListener = wAccessHandler.getEvent(navListenerId); 14783 /*Die Root des NavListeners muss verändert werden, da der Toggler in der Regel im header steht nicht in der navigationMain*/ 14784 cO.tmpRoot = cO.navListener.root; 14785 cO.navListener.root = jQuery('html').find('header'); 14786 cO.navListener.active = true; 14787 cO.navListener.navMainToggler = cO; 14788 cO.navListener.on(cO.navListener); 14789 var closer = cO.element.closest('#navigationMain').find('#navigationMenuCloser'); 14790 if(closer.length > 0 && wAccessEvents['navigation.navigationMenuCloser'].focusAfterOpen) closer.focus(); 14791 cO.active = true; 14792 } 14793 else{ 14794 navMain.data('isopen', 'no'); 14795 wAccessHandler.deactivateTabindex(cO.element.next('nav')); 14796 cO.navListener.off(cO.navListener); 14797 cO.active = false; 14798 } 14799 }, 14800 14801 closeToggler : function(cO){ 14802 var navMain = cO.element.closest('#navigationMain'); 14803 if(navMain.data('aeisopen') === 'yes') navigationToggler_onclick(cO.element); 14804 navMain.data('aeisopen', 'no'); 14805 wAccessHandler.deactivateTabindex(cO.element.next('nav')); 14806 cO.element.removeClass('open').focus(); 14807 if(cO.navListener != null) cO.navListener.off(cO.navListener); 14808 cO.active = false; 14809 cO.navListener.root = cO.tmpRoot; 14810 }, 14811
14812 onkeydown : { 14813 keyEnter: { trigger: 'onclick', stop : true }, 14814 keyEscape : function(cO, e){ if(jQuery('html.navmenu-open').length == 1) navigationToggler_onclick(cO.element); 14815 cO.element.closest('#navigationMain').data('aeisopen', 'no'); 14816 }, 14817 onafterkeydown : function(cO, e){ 14818 var navMain = cO.element.closest('#navigationMain'); 14819 if((navMain.data('aeisopen') == null || navMain.data('aeisopen') == 'no') && e.key == 'Tab' && !e.shiftKey && e.key != "Shift") { 14820 navMain.data('aeisopen', 'no'); 14821 wAccessHandler.deactivateTabindex(cO.element.next('nav')); 14822 var nextElement = wAccessHandler.getNextFocusableElement(cO, '.headerElementNavigation|.headerArea|.headerElementSection|#blockHeader'); 14823 if(nextElement == cO.element) cO.element.closest('#blockHeader').next().attr('tabindex', 0).focus().remove('tabindex'); 14824 else nextElement.focus(); 14825 } 14826 } 14827 } 14828}; 14829 14830/*Event für den das Megadropdown*/ 14831wAccessEvents['navigation.navPointNavlevelEmbed'] = { 14832 /*cO:Element == navLevelEmbed*/ 14833 active : false, 14834 14835 onclick : function(cO, e){ 14836 var target = jQuery(e.target); 14837 if(target.hasClass('navLevelEmbed')) cO.navPointClose(cO, e); 14838 }, 14839 14840 onkeydown : { 14841 tabindex : -1, 14842 keyEscape : function(cO, e){cO.navPointClose(cO, e);}, 14843 keyTab : function(cO, e){ 14844 var target = jQuery(e.target); 14845 if(cO.element.find(target).length > 0 && wAccessHandler.isLastFocusableElement({element : cO.element}, target)){ 14846 cO.navPointClose(cO); 14847 } 14848 }, 14849 keyTabShift : function(cO, e){ 14850 var target = jQuery(e.target); 14851 var isFirst = wAccessHandler.isFirstFocusableElement(cO, target); 14852 if(isFirst){ 14853 cO.navPoint.element.data('focusleftonce', '1'); 14854 cO.navPointClose(cO, e); 14855 e.preventDefault(); 14856 e.stopPropagation(); 14857 e.stopImmediatePropagation(); 14858 } 14859 } 14860 }, 14861 14862 onmouseout : function(cO, e){ 14863 if(cO.navPoint.element.data('aeclosemegadropdowntype') != 'click'){ 14864 var $rt = jQuery(e.relatedTarget); 14865 /* wenn dropdown verlassen wird verlassen wird und rt ein navPoint ist */ 14866 if (e.relatedTarget && cO.element.find($rt).length === 0 && !$rt.attr('id')) { 14867 cO.navPointClose(cO, e); 14868 } 14869 } 14870 else cO.navPoint.navListener.type = 'closeClick'; 14871 }, 14872 14873 onmouseover : function(cO, e){ 14874 cO.navPoint.element.attr('data-donotclose', '1'); 14875 }, 14876 14877 navPointClose: function(cO, e){ 14878 var navPoint = cO.navPoint; 14879 navPoint.navPointClose(cO.navPoint, e); 14880 if(e != null && e.type == 'keydown') navPoint.element.focus(); 14881 } 14882}; 14883 14884/*Event für den Toggler eines Navpoints (mit Megadropdown)*/ 14885wAccessEvents['navigation.navPointDropDownToggler'] = { 14886 /*cO:Element == navPointToggler*/ 14887 active : false, 14888 14889 onready : function(cO, e){ 14890 var togglerOptions = wAccessibility['navigation'] != null && wAccessibility['navigation'].toggler != null ? wAccessibility['navigation'].toggler : {}; 14891 if(togglerOptions.addData == null) togglerOptions.addData = ''; 14892 cO.togglerOptions = togglerOptions; 14893 cO.onkeydown.tabindex = 0; 14894 if (cO.element.css('display') == 'none') cO.onkeydown.tabindex = -1; 14895 else if(cO.element.length > 0){ 14896 var togglerRect = cO.element.get(0).getBoundingClientRect(); 14897 var navPointRect = cO.element.parent().get(0).getBoundingClientRect(); 14898 const isInParent = ( 14899 togglerRect.top >= navPointRect.top && // Oberkante des inneren Divs ist nicht oberhalb des äuÃeren Divs 14900 togglerRect.left >= navPointRect.left && // Linke Kante des inneren Divs ist nicht links vom äuÃeren Div 14901 togglerRect.bottom <= navPointRect.bottom && // Unterkante des inneren Divs ist nicht unterhalb des äuÃeren Divs 14902 togglerRect.right <= navPointRect.right // Rechte Kante des inneren Divs ist nicht rechts vom äuÃeren Div 14903 ); 14904 if(!isInParent) cO.onkeydown.tabindex = -1; 14905 } 14906 cO.element.on('focus', function(e) {jQuery(this).addClass('sub-toggler')}) 14907 .on('blur', function(e) {jQuery(this).removeClass('sub-toggler')}); 14908 return true; 14909 }, 14910
14911 onclick : function(cO, e){ 14912 if(cO.element.hasClass('open')) cO.navPointClose(cO, e); 14913 else cO.navPointOpen(cO, e); 14914 }, 14915 14916 onkeydown : { 14917 keyEnter : {trigger : 'onclick'}, 14918 keyEscape : function(cO, e){ cO.navPointClose(cO); } 14919 }, 14920 14921 navPointOpen : function(cO, e){ 14922 if(!cO.active) return false; 14923 cO.setData(cO, e); 14924 jQuery('html').removeClass('navmenu-open'); 14925 var navPoint = cO.navPoint.element; 14926 openMegaDropdown(navPoint.data('aenavpointid'), navPoint.attr('data-previewlink'), {'mode' : navPoint.data('megaDropdownEmbedMode'), 'addNavId' : navPoint.data('megaDropdownAddNavId')}); 14927 }, 14928 14929 navPointClose : function(cO, e){ 14930 if(!cO.active) return false; 14931 cO.setData(cO, e, 'close'); 14932 var navPoint = cO.navPoint.element; 14933 closeMegaDropdown(navPoint.data('aenavpointid'), true, (cO.delayClose != null ? cO.delayClose : null)); 14934 }, 14935 14936 setData: function(cO, e, status){ 14937 if(status === 'close'){ 14938 cO.element.removeClass('open').attr('aria-expanded', false); 14939 var addData = cO.togglerOptions.addData; 14940 if(addData.indexOf('eventInfo') !== -1) cO.element.removeAttr('data-openedby'); 14941 } 14942 else{ 14943 var addData = cO.togglerOptions.addData; 14944 if(addData.indexOf('eventInfo') !== -1 && e != null){ 14945 if(e.type == 'keyup') cO.element.attr('data-openedby', 'key' + (e.key != null ? e.key : '')); 14946 else cO.element.attr('data-openedby', e.type); 14947 } 14948 cO.element.addClass('open').attr('aria-expanded', true); 14949 } 14950 } 14951}; 14952 14953/*Event Navpoints (mit Megadropdown)*/ 14954wAccessEvents['navigation.navPointDropdown'] = { 14955 /*cO:Element == a-data-previewlink*/ 14956 onready : function(cO){ 14957 var navPoint = cO.element; 14958 var li = navPoint.closest('li'); 14959 var id = navPoint.attr('id').replace(/navpoint_/, ''); 14960 var megaDropdownPreload = navPoint.closest('ul[data-preload]').attr('data-preload') ? navPoint.closest('ul[data-preload]').attr('data-preload') : (jQuery('html').data('megadropdownpreload') ? jQuery('html').data('megadropdownpreload') : 'yes'); 14961 var megaDropdownEmbedMode = navPoint.closest('ul[data-embedmode]').attr('data-embedmode'); 14962 var megaDropdownAddNavId = navPoint.closest('ul[data-addnavid]').attr('data-addnavid'); 14963 var openMegaDropdownType = navPoint.closest('ul[data-type]').attr('data-type') ? navPoint.closest('ul[data-type]').attr('data-type') : (jQuery('html').data('megadropdownopentype') ? jQuery('html').data('megadropdownopentype') : 'mouseenter'); 14964 var closeMegaDropdownType = navPoint.closest('ul[data-type]').attr('data-type') ? navPoint.closest('ul[data-type]').attr('data-type') : (jQuery('html').data('megadropdownclosetype') ? jQuery('html').data('megadropdownclosetype') : 'mouseenter'); 14965 var megaDropdownPreload = navPoint.closest('ul[data-preload]').attr('data-preload') ? navPoint.closest('ul[data-preload]').attr('data-preload') : (jQuery('html').data('megadropdownpreload') ? jQuery('html').data('megadropdownpreload') : 'yes'); 14966 var mobileMenu = jQuery(window).width() >= maxSizeNavigationmenu ? false : true; 14967 cO.navLevel = li.closest('ul').attr('data-navlevel'); 14968 14969 cO.layerOpenType = getNavigationOptions('navigationlayeropentype', 'mouseenter'); 14970 14971 14972 navPoint.get(0).addEventListener("MSHoldVisual", function(e){e.preventDefault()}, false); 14973 navPoint.get(0).addEventListener("contextmenu", function(e){if(e.which != 3) e.preventDefault()}, false); 14974 navPoint.data({'aenavpointid' : id, 'aenavpointembedid' : 'navEmbed_' + id, 'aeclosemegadropdowntype' : closeMegaDropdownType, 'aeopenmegadropdowntype' : openMegaDropdownType, 'aemegaDropdownEmbedMode' : megaDropdownEmbedMode, 'aemegaDropdownAddNavId' : megaDropdownAddNavId}); 14975 navPoint.attr({'data-aenavpointid' : cO.id}); 14976 navPoint.data('aeisopen', 'no'); 14977 14978 if(navPoint.closest('li').hasClass('selected')) navPoint.attr('aria-current', "page"); 14979 14980 /*Anmelden des navigation.listeners */ 14981 var navListener = wAccessEvents['navigation.listener']; 14982 wAccessHandler.addEvent(navListener, {'idPrefix' : 'navigation.listener'}); 14983 cO.navListener = navListener; 14984 14985 cO.navPointClose = function(cO, e){ 14986 var navPoint = cO.element; 14987 var li = navPoint.closest('li'); 14988 var level = navPoint.closest('ul').attr('data-navlevel'); 14989 /*navpoint_mouseleave führt delay aus, zB. zu verhindern, dass das Dropdown geschlossen wird, wenn zum Erreichen 14990 des Dropdowns über einen anderen Navigationspunkt gefahren wird*/ 14991 if(cO.toggler != null){ 14992 if(e != null && e.type != null && e.type === 'mouseleave'){ 14993 navpoint_onmouseleave(li, li.closest('ul').data('navlevel'), e); 14994 cO.toggler.setData(cO.toggler, e, 'close'); 14995 } 14996 else{ 14997 cO.toggler.navPointClose(cO.toggler, e); 14998 } 14999 } 15000 navPoint.data('aeisopen', 'no'); 15001 var deactivate = true 15002 if(navPoint.closest('ul[data-navlevel="1"]').find('a[data-previewlink]').each(function(){ 15003 if(jQuery(this).data('aeisopen') == 'yes') deactivate = false;
15004 })); 15005 if(cO.embedCloser != null) cO.embedCloser.toggleNavigation('close'); 15006 cO.navListener.off(cO.navListener); 15007 }; 15008 15009 cO.navPointOpen = function(cO, e){ 15010 var navPoint = cO.element; 15011 var li = cO.element.closest('li'); 15012 var mobileMenu = jQuery(window).width() >= maxSizeNavigationmenu ? false : true; 15013 var nType = mobileMenu ? cO.typeMobile : cO.typeDefault; 15014 15015 /*Anmeldung an navlistener */ 15016 cO.navListener.active = nType.indexOf('listener') !== -1 ? true : false; 15017 if(cO.navLevel === '1'){ 15018 cO.navListener.navPoints.push(cO); 15019 cO.navListener.on(cO.navListener); 15020 } 15021 15022 /*Objekt zu AE für NavigationToggler hinzufügen - 15023 Beachte: Megadropdowns die mit # definiert sind haben im HTML keinen toggler! */ 15024 if(cO.toggler == null){ 15025 var aeType = !mobileMenu ? 'navigation.navPointDropDownToggler' : 'navigation.navPointToggler'; 15026 var aE = Object.assign({}, wAccessEvents[aeType]); 15027 aE.element = navPoint.next('.navpointToggler'); 15028 wAccessHandler.addEvent(aE, {'idPrefix' : 'navPointToggler'}); 15029 aE.element.prev('a').attr('data-aetogglerid', aE.id); 15030 aE.navPoint = cO; 15031 cO.toggler = aE; 15032 cO.toggler.active = nType.indexOf('toggler') !== -1 ? true : false; 15033 } 15034 15035 /*EmbedCloser sofern aktiviert*/ 15036 if(jQuery('#navigationMegadropdownCloser').length > 0){ 15037 if(cO.embedCloser == null){ 15038 var aE = wAccessEvents['navigation.navigationEmbedCloser']; 15039 aE.element = jQuery('#navigationMegadropdownCloser'); 15040 /*darf nur einmal initalisiert werden*/ 15041 if(wAccessEvents['navigation.navigationEmbedCloser'].initalized == null){ 15042 wAccessHandler.addEvent(aE, {'idPrefix' : 'navigationEmbedCloser'}); 15043 } 15044 wAccessEvents['navigation.navigationEmbedCloser'].initalized = true; 15045 cO.embedCloser = aE; 15046 } 15047 cO.embedCloser.curNavPointEmbed = cO; 15048 } 15049 15050 /*Objekt zu AE für Megadropdown hinzufügen*/ 15051 if(cO.aENavLevelEmbed == null){ 15052 var aE = Object.assign({}, wAccessEvents['navigation.navPointNavlevelEmbed']); 15053 var navEmbed = cO.element.closest('#navigationMain').find('#' + cO.element.data('aenavpointembedid')); 15054 aE.element = navEmbed; 15055 aE.navPoint = cO; 15056 wAccessHandler.addEvent(aE, {'idPrefix' : 'navPointNavlevelEmbed'}); 15057 cO.aENavLevelEmbed = aE; 15058 cO.aENavLevelEmbed.active = nType.indexOf('dropwdown') !== -1 ? true : false; 15059 } 15060 15061 /*Ãffnen des Megadropdowns*/ 15062 if(!(cO.layerOpenType === 'click' && e.type != 'click')){ 15063 if(cO.embedCloser != null) cO.embedCloser.toggleNavigation('open'); 15064 cO.toggler.navPointOpen(cO.toggler, e); 15065 navPoint.data('aeisopen', 'yes'); 15066 15067 /*schlieÃe alle offnen Navpoints*/ 15068 li.siblings('li').find('span[aria-expanded="true"]').each(function(e){ 15069 var nPaEid = jQuery(this).closest('li').attr('data-aetopid'); 15070 var toggler = wAccessHandler.getEvent(nPaEid); 15071 if(typeof toggler.navPointClose === 'function') toggler.navPointClose(toggler); 15072 }); 15073 15074 if(navPoint.closest('ul[data-navlevel="1"]').find('a[data-previewlink]').each(function(){ 15075 if(navPoint.attr('id') != jQuery(this).attr('id')) jQuery(this).data('aeisopen', 'no'); 15076 })); 15077 } 15078 }; 15079 15080 if(!mobileMenu){ 15081 if(megaDropdownPreload != 'no') loadMegaDropdown(id, navPoint.attr('data-previewlink'), {'mode' : megaDropdownEmbedMode, 'addNavId' : megaDropdownAddNavId, 'initToPreload' : true}); 15082 navPoint.parent().addClass('hasMegaDropdown'); 15083 } 15084 return true; 15085 }, 15086 15087 onclick : { 15088 events : ['click', 'touchstart'], 15089 function: function(cO, e){ 15090 var mobileMenu = jQuery(window).width() >= maxSizeNavigationmenu ? false : true; 15091 if(cO.toggler != null && cO.element.attr('href') !== '#' && !mobileMenu) e.preventDefault(); 15092 /*ignoreHrefIfDesktop wurde wg. unklarer Bezeichnung zu allowHrefOnDesktop*/ 15093 var ignoreHrefIfDesktop = wAccessibility['navigation'] != null && wAccessibility['navigation'].dropdown != null ? wAccessibility['navigation'].dropdown.ignoreHrefIfDesktop != null ? wAccessibility['navigation'].dropdown.ignoreHrefIfDesktop : false : false;
15094 var allowHrefOnDesktop = wAccessibility['navigation'] != null && wAccessibility['navigation'].dropdown != null ? wAccessibility['navigation'].dropdown.allowHrefOnDesktop != null ? wAccessibility['navigation'].dropdown.allowHrefOnDesktop : ignoreHrefIfDesktop : ignoreHrefIfDesktop; 15095 if(cO.layerOpenType == 'click'){ 15096 allowHrefOnDesktop = false; 15097 e.preventDefault(); 15098 } 15099 if((cO.toggler == null || !allowHrefOnDesktop) && (!mobileMenu && cO.element.attr('href') !== '#' && cO.element.attr('data-previewlink') !== '')) {e.preventDefault();} 15100 if(allowHrefOnDesktop){ 15101 wOpenURL(cO.element.attr('href'), cO.element.attr('data-target')); 15102 } 15103 else if(cO.element.data('aeisopen') == 'yes') cO.navPointClose(cO, e); 15104 else cO.navPointOpen(cO,e); 15105 } 15106 }, 15107 15108 onmouseout : function(cO, e) { 15109 var timeMovement = Date.now() - cO.onmousestart; 15110 if(timeMovement < cO.delayClose) cO.openonmouseover = false; 15111 if(cO.element.data('aeclosemegadropdowntype') != 'click'){ 15112 var target = jQuery(e.target); 15113 window.setTimeout(function(){ 15114 if(cO.element.attr('data-donotclose') != '1'){ 15115 if(!target.hasClass('hasMegaDropdown')) e.type = 'mouseleave'; 15116 cO.navPointClose(cO, e); 15117 } 15118 }, (cO.delayClose !== undefined ? cO.delayClose : 16)); 15119 } 15120 }, 15121 15122 onmouseover : function(cO, e){ 15123 cO.delayClose = 200; 15124 cO.onmousestart = Date.now()+cO.delayClose; 15125 cO.openonmouseover = true; 15126 15127 if(cO.layerOpenType !== 'click'){ 15128 window.setTimeout(function(){ 15129 if(cO.openonmouseover){ 15130 cO.navPointOpen(cO, e); 15131 cO.element.closest('#navigationMain').on('mouseout.' + cO.id, cO, function(e){ 15132 var relatedTarget = jQuery(e.relatedTarget); 15133 if(relatedTarget.length > 0 && relatedTarget.hasClass('headerArea')){ 15134 jQuery(this).find('a[data-donotclose]').attr('data-donotclose', 0); 15135 cO.navListener.closeNavigation(cO, e); 15136 jQuery(this).off('mouseout.' + cO.id); 15137 } 15138 }); 15139 15140 } 15141 }, (cO.delayClose !== undefined ? cO.delayClose : 16)); 15142 } 15143 }, 15144 15145 onkeyup : { 15146 keyTab : function(cO, e){ 15147 if(cO.element.data('focusleftonce') != '1') { 15148 cO.navPointOpen(cO, e); 15149 } 15150 cO.element.data('focusleftonce', '0'); 15151 } 15152 }, 15153 15154 onkeydown : { 15155 keyEscape : {trigger:'onclick'}, 15156 keyTab : function(cO, e){ 15157 if(cO.element.data('aeisopen') == 'yes'){ 15158 if(cO.embedCloser != null){ 15159 cO.embedCloser.element.focus(); 15160 } 15161 else{ 15162 var sel = '#'+cO.element.data('aenavpointembedid'); 15163 var result = wAccessHandler.getNextFocusableElement({element : jQuery(sel)}, sel); 15164 result.focus(); 15165 } 15166 e.stopPropagation(); 15167 e.stopImmediatePropagation(); 15168 e.preventDefault(); 15169 15170 15171 } 15172 }, 15173 15174 keyTabShift : function(cO, e){ 15175 cO.navListener.closeNavigation(cO.navListener); 15176 e.stopPropagation(); 15177 e.stopImmediatePropagation(); 15178 } 15179 } 15180}; 15181 15182/*Event Listener, wenn die navigation über navPoint geöffnet wurde - orgnisiert die Events auÃerhalb der Navigation*/ 15183wAccessEvents['navigation.listener'] = { 15184 active : false, 15185 navPoints : [], 15186 type : [], 15187 element : jQuery('html #blockPageInner'), 15188 isOn : false, 15189 15190 onready : function(cO){ 15191 jQuery('#navigationMain').data('aenavlistener', cO.id); 15192 cO.navMainToggler = wAccessHandler.getEvent(jQuery('#navigationMain').data('aemaintogglerid')); 15193 cO.layerOpenType = getNavigationOptions('navigationlayeropentype', 'mouseenter'); 15194 cO.onEvent = cO.layerOpenType === 'click' ? 'click.' + cO.id : 'click.' + cO.id + ', mouseover.' + cO.id; 15195 //console.log('listeneronEvent --> ' + cO.onEvent); 15196 return true; 15197 }, 15198 15199 off : function(cO){ 15200 cO.isOn = false; 15201 cO.element.off(cO.onEvent); 15202 jQuery(document).off('keydown.' + cO.id); 15203 }, 15204 15205 closeNavigation : function(cO, e){ 15206 try{ 15207 if(!cO.active) return false; 15208 if(cO.navMainToggler.active && cO.navMainToggler != null){ 15209 cO.navMainToggler.closeToggler(cO.navMainToggler); 15210 }
15211 cO.navPoints.forEach(function(nP){ 15212 if(typeof nP.navPointClose == 'function') nP.navPointClose(nP, e); 15213 }); 15214 cO.navPoints = []; 15215 } 15216 catch(emsg){console.log(emsg);} 15217 cO.off(cO); 15218 }, 15219 15220 on : function(cO){ 15221 var root = jQuery('html').find('#navigationMain'); 15222 var listenerElement = root.attr('data-aenavlistenerelement'); 15223 if(listenerElement != null && listenerElement != '' && jQuery(listenerElement).length > 0) cO.element = jQuery(listenerElement); 15224 if(!cO.active) cO.off(cO); 15225 if(!cO.isOn){ 15226 cO.isOn = true; 15227 cO.element.on(cO.onEvent, cO, function(e){ 15228 var cO = e.data; 15229 var root = cO.root != null && cO.root.length !== 0 ? cO.root : jQuery('html').find('#navigationMain'); 15230 var target = jQuery(e.target); 15231 var close = false; 15232 if(target.attr('id') === 'navlayer-background'){ 15233 if(jQuery(document.activeElement).next('span').attr('data-openedby') === 'keyTab' && jQuery(document.activeElement).closest('ul').attr('data-navlevel') === '1') close = false; 15234 else if(root.find(target).length === 0) close = true; 15235 if(cO.type.indexOf('closeClick') === -1){ 15236 setTimeout(function() { 15237 if (target.is(':hover')) { 15238 cO.closeNavigation(cO, e); 15239 } 15240 }, 300); 15241 } 15242 } 15243 else if(target.closest('#navigationMain').length > 0) close = false; 15244 else if(!jQuery.contains(root[0], target[0])) close = true; 15245 /*AusschlieÃen von Animationen zb. banner etc*/ 15246 if(e.type == 'click' && target.hasClass('listMoverForward')) close = false; 15247 var onclickbesidenavigation = root.attr('data-onlickbesidenavigation'); 15248 15249 var mobileMenu = jQuery(window).width() >= maxSizeNavigationmenu ? false : true; 15250 if(cO.type.indexOf('closeClick') !== -1 && e.type === 'mouseover') close = false; 15251 if(mobileMenu && onclickbesidenavigation === 'closeNavigation' && e.type === 'mouseover') close = false; 15252 if(close){ 15253 cO.closeNavigation(cO, e); 15254 } 15255 }); 15256 15257 /*FÃR keyevents auÃerhalb der Navigation Achtung Mousover wird über ein css-hover gesteuert es ist mit escape nicht zu deaktivieren*/ 15258 jQuery(document).on('keydown.' + cO.id, cO, function(e){ 15259 var cO = e.data; 15260 var root = cO.root != null && cO.root.length !== 0 ? cO.root : jQuery('html').find('#navigationMain'); 15261 var target = jQuery(e.target); 15262 /*Erster Navigationpunkt */ 15263 if(e.key === 'Tab' && e.shiftKey && jQuery(e.target).closest('li').is(root.find('ul[data-navlevel="1"] li').first())) cO.closeNavigation(cO); 15264 /*AuÃerhalb der navigation und Excape */ 15265 else if(!jQuery.contains(root[0], target[0])) { 15266 if(e.key === 'Escape') cO.closeNavigation(cO, e); 15267 } 15268 /*Innerhalb der navigation */ 15269 else if(cO.navMainToggler != null){ 15270 var close = false; 15271 if(e.key === 'Escape' && jQuery(e.target).hasClass('navpointToggler')) close = false; 15272 else if(e.key === 'Escape') close = true; 15273 else if(e.key === 'Tab' && wAccessHandler.isLastFocusableElement({element : jQuery('div#navigationMain div')}, jQuery(e.target))) close = true; 15274 if(close) cO.closeNavigation(cO, e); 15275 } 15276 /*Achtung kein generelle StopPropagation oder preventDefault*/ 15277 }); 15278 } 15279 } 15280}; 15281 15282/*Event für den Toggler eines Navpoints (ohneMegadropdown)*/ 15283wAccessEvents['navigation.navPointToggler'] = { 15284 active : false, 15285 15286 onready : function(cO, e){ 15287 var togglerOptions = wAccessibility['navigation'] != null && wAccessibility['navigation'].toggler != null ? wAccessibility['navigation'].toggler : {}; 15288 if(togglerOptions.addData == null) togglerOptions.addData = ''; 15289 cO.togglerOptions = togglerOptions; 15290 cO.element.on('focus', function(e) {jQuery(this).addClass('sub-toggler')}) 15291 .on('blur', function(e) {jQuery(this).removeClass('sub-toggler')}); 15292 cO.onkeydown.tabindex = 0; 15293 if(cO.navPoint.navLevel == '1' && cO.navPoint.layerOpenType !== 'togglerOnly'){ 15294 if (cO.element.css('display') == 'none') cO.onkeydown.tabindex = -1; 15295 else{ 15296 var togglerRect = cO.element.get(0).getBoundingClientRect(); 15297 var navPointRect = cO.element.parent().get(0).getBoundingClientRect(); 15298 const isInParent = ( 15299 togglerRect.top >= navPointRect.top && // Oberkante des inneren Divs ist nicht oberhalb des äuÃeren Divs 15300 togglerRect.left >= navPointRect.left && // Linke Kante des inneren Divs ist nicht links vom äuÃeren Div 15301 togglerRect.bottom <= navPointRect.bottom && // Unterkante des inneren Divs ist nicht unterhalb des äuÃeren Divs 15302 togglerRect.right <= navPointRect.right // Rechte Kante des inneren Divs ist nicht rechts vom äuÃeren Div 15303 ); 15304 if(!isInParent) cO.onkeydown.tabindex = -1; 15305 } 15306 } 15307 return true; 15308 }, 15309
15310 onclick : function(cO, e){ 15311 var mobileMenu = jQuery(window).width() >= maxSizeNavigationmenu ? false : true; 15312 var nType = mobileMenu ? cO.navPoint.typeMobile : cO.navPoint.typeDefault; 15313 cO.active = nType.indexOf('toggler') !== -1 ? true : false; 15314 if(cO.element.hasClass('open')) cO.navPointClose(cO, e); 15315 else cO.navPointOpen(cO, e); 15316 }, 15317 15318 onkeydown : { 15319 keyEnter : {trigger : 'onclick'}, 15320 keyEscape : function(cO, e){ 15321 if(!cO.element.hasClass('open')){ 15322 cO.navPoint.navListener.closeNavigation(cO.navPoint.navListener, e); 15323 }else{ 15324 cO.navPointClose(cO); 15325 } 15326 }, 15327 keyTab : function(cO, e){ 15328 if(!cO.element.hasClass('open') && cO.element.closest('li').next().length === 0){ 15329 cO.navPoint.navListener.closeNavigation(cO.navPoint.navListener, e); 15330 } 15331 } 15332 }, 15333 15334 navPointOpen : function(cO, e){ 15335 if(!cO.active) return false; 15336 var addData = cO.togglerOptions.addData; 15337 if(addData.indexOf('eventInfo') !== -1 && e != null){ 15338 if(e.type == 'keyup') cO.element.attr('data-openedby', 'key' + (e.key != null ? e.key : '')); 15339 else cO.element.attr('data-openedby', e.type); 15340 } 15341 navpointToggler_onclick(cO.element, {'status':'open'}); 15342 cO.element.addClass('open').attr('aria-expanded', true); 15343 }, 15344 15345 navPointClose : function(cO, e){ 15346 if(!cO.active) return false; 15347 cO.element.removeAttr('data-openedby'); 15348 navpointToggler_onclick(cO.element, {'status':'close'}); 15349 cO.element.removeClass('open').attr('aria-expanded', false); 15350 } 15351 15352}; 15353 15354/*Event für Navigation Sub*/ 15355wAccessEvents['navigation.navigationSub'] = { 15356 onkeydown : { 15357 keyTab : function(cO, e){ 15358 if(wAccessHandler.isLastFocusableElement(cO, jQuery(e.target))){ 15359 if(cO.element.data('active')) cO.rootNavPoint.element.focus(); 15360 cO.element.data('active', false); 15361 cO.element.removeAttr('tabindex'); 15362 wAccessHandler.deactivateTabindex(cO.element); 15363 } 15364 } 15365 } 15366}; 15367 15368/*Event der Navpoint (ohne Megadropdown)*/ 15369wAccessEvents['navigation.navPoint'] = { 15370 onready : function(cO){ 15371 var navPoint = cO.element; 15372 var li = navPoint.closest('li'); 15373 var id = cO.id; 15374 var mobileMenu = isMobileNavigation() 15375 var nType = mobileMenu ? cO.typeMobile : cO.typeDefault; 15376 var toggler = navPoint.next('.navpointToggler'); 15377 cO.navLevel = li.closest('ul').attr('data-navlevel'); 15378 cO.layerOpenType = getNavigationOptions('navigationlayeropentype', 'mouseenter'); 15379 cO.layerCloseType = getNavigationOptions('navigationlayerclosetype', 'mouseleave'); 15380 15381 /*Barrierfreihe Regeln*/ 15382 if(li.hasClass('selected')) navPoint.attr('aria-current', "page"); 15383 15384 if(mobileMenu && li.hasClass('selected')) cO.element.data('aeisopen', 'yes'); 15385 else cO.element.data('aeisopen', 'no'); 15386 15387 /*Aktivieren des navigation.listener für Events auÃerhalb der navigation*/ 15388 var navListener = wAccessEvents['navigation.listener']; 15389 navListener.root = navPoint.closest('#navigationMain'); 15390 wAccessHandler.addEvent(navListener, {'idPrefix' : 'navigation.listener'}); 15391 cO.navListener = navListener; 15392 15393 var navigationSub = nType.indexOf('navigationSub') !== -1 ? true : false; 15394 if(navigationSub && li.hasClass('selected')){ 15395 var navigationSub = jQuery('#navigationSub'); 15396 cO.hasNavigationSub = wAccessHandler.isFocusableElement(navigationSub) ? true : false; 15397 var aE = Object.assign({}, wAccessEvents['navigation.navigationSub']); 15398 aE.element = navigationSub; 15399 aE.rootNavPoint = cO; 15400 wAccessHandler.addEvent(aE, {'idPrefix' : 'navigationSub'}); 15401 cO.navigationSub = aE; 15402 } 15403 15404 if(toggler.length > 0){ 15405 if(cO.navLevel === '1'){ 15406 li.attr('data-aetopid', cO.id); 15407 } 15408 var aE = Object.assign({}, wAccessEvents['navigation.navPointToggler']); 15409 aE.element = toggler; 15410 aE.active = nType.indexOf('toggler') !== -1 ? true : false; 15411 aE.navPoint = cO; 15412 wAccessHandler.addEvent(aE, {'idPrefix' : 'navPointToggler'});
15413 li.attr('data-aetogglerid', aE.id); 15414 cO.toggler = aE; 15415 cO.element.on('focus', {cO : cO}, function(e) {cO.toggler.element.addClass('sub-toggler')}) 15416 .on('blur', function(e) {cO.toggler.element.removeClass('sub-toggler')}); 15417 } 15418 cO.ancestors = cO.element.parentsUntil('ul[data-navlevel="1"]'); 15419 cO.element.attr({'data-aenavpointid' : id}); 15420 15421 cO.navPointClose = function(cO, e){ 15422 /*Zurücksetzen aller Toggler innerhalb */ 15423 var nP = cO.element; 15424 var li = nP.closest('li'); 15425 var tAeId = cO.element.attr('data-aetogglerid'); 15426 if(cO.toggler != null){ 15427 cO.toggler.navPointClose(cO.toggler, e); 15428 nP.data('aeisopen', 'no'); 15429 } 15430 if(cO.navLevel === '1') jQuery('html').removeClass('navlayer-open'); 15431 if(typeof cO.onAfterCloseNavPoint == 'function') cO.onAfterCloseNavPoint(cO, e); 15432 }; 15433 15434 cO.navPointCloseAll = function(cO, e){ 15435 var navPointLevel1 = cO.element.closest('li[data-aetopid]'); 15436 var subNavPoints = navPointLevel1.find('li a[data-aenavpointid]'); 15437 15438 subNavPoints.each(function(){ 15439 var nPaEid = jQuery(this).attr('data-aenavpointid'); 15440 var nP = wAccessHandler.getEvent(nPaEid); 15441 if(typeof nP.navPointClose === 'function') nP.navPointClose(nP, e); 15442 }); 15443 cO.navPointClose(cO, e); 15444 cO.navListener.closeNavigation(cO.navListener, e); //ggf für letztes element?? 15445 cO.navListener.off(cO.navListener); 15446 }; 15447 15448 cO.navPointOpen = function(cO, e){ 15449 15450 var mobileMenu = jQuery(window).width() >= maxSizeNavigationmenu ? false : true; 15451 var nType = mobileMenu ? cO.typeMobile : cO.typeDefault; 15452 var nP = cO.element; 15453 var li = nP.closest('li'); 15454 15455 /*Anmeldung an navlistener */ 15456 cO.navListener.active = nType.indexOf('listener') !== -1 ? true : false; 15457 if(cO.navLevel === '1'){ 15458 cO.navListener.navPoints.push(cO); 15459 cO.navListener.on(cO.navListener); 15460 } 15461 15462 /*SchlieÃen offener Navigationspunkte der Unterebenen Ebene*/ 15463 var closeSiblings = li.siblings('li').find('span[aria-expanded="true"]').prev('a'); 15464 if(cO.navLevel === '1' && closeSiblings.length === 0){ 15465 closeSiblings = li.children('ul').find('li').find('span[aria-expanded="true"]').prev('a'); 15466 } 15467 closeSiblings.each(function(){ 15468 var nPaEid = jQuery(this).attr('data-aenavpointid'); 15469 var nP = wAccessHandler.getEvent(nPaEid); 15470 if(typeof nP.navPointClose === 'function') nP.navPointClose(nP, e); 15471 }); 15472 15473 /*Ãffnen des Layers*/ 15474 if(!(cO.layerOpenType === 'click' && e.type !== 'click') && (e.type != 'mousenter' || cO.layerOpenType !== 'togglerOnly') && cO.toggler != null){ 15475 cO.toggler.navPointOpen(cO.toggler, e); 15476 jQuery('html').addClass('navlayer-open'); 15477 navpoint_onmouseenter(li, e); 15478 cO.toggler.active = nType.indexOf('toggler') !== -1 ? true : false; 15479 nP.data('aeisopen', 'yes'); 15480 } 15481 if(typeof cO.onAfterOpenNavPoint == 'function') cO.onAfterOpenNavPoint(cO, e); 15482 }; 15483 15484 return true; 15485 }, 15486 15487 onclick : function(cO, e){ 15488 if(getNavigationOptions('linkmode', '', cO.element) == 'headline') e.preventDefault(); 15489 if(cO.toggler != null && cO.element.data('aeisopen') == 'no') cO.navPointOpen(cO, e); 15490 else if (cO.element.data('closeAll') === 'yes') cO.navPointCloseAll(cO, e); 15491 else cO.navPointClose(cO, e); 15492 }, 15493 15494 onmouseout : function(cO, e) { 15495 //Achtung in Verbindung mit Layer-Navigation unerwünscht, falls wieder aktiviert, darauf achten. 15496 var timeMovement = Date.now() - cO.onmousestart; 15497 if(timeMovement < cO.delayClose) cO.openonmouseover = false; 15498 if(cO.navListener.element.attr('id') == 'navlayer-background' && cO.navListener.type != 'closeClick' && cO.layerCloseType !== 'click'){ 15499 var relatedTarget = jQuery(e.relatedTarget); 15500 if(relatedTarget.closest('#navigationMain').length == 0 || relatedTarget.attr('id') == 'navlayer-background' ) cO.navPointClose(cO, e); 15501 } 15502 }, 15503 15504 onmouseover : function(cO, e){ 15505 var li = cO.element.closest('li'); 15506 var dropdownSibling = li.next().hasClass('hasMegaDropdown') || li.prev().hasClass('hasMegaDropdown'); 15507 cO.delayClose = this.delayClose != undefined ? this.delayClose : (dropdownSibling ? 200 : 0); 15508 cO.onmousestart = Date.now()+cO.delayClose; 15509 cO.openonmouseover = true; 15510 if(cO.layerOpenType !== 'click'){ 15511 if(!isMobileNavigation()){ 15512 window.setTimeout(function(){ 15513 if(cO.openonmouseover){ 15514 cO.navPointOpen(cO, e); 15515 } 15516 }, (cO.delayClose !== undefined ? cO.delayClose : 16)); 15517 } 15518 } 15519 }, 15520 15521 onkeyup : { 15522 keyTab : function(cO, e){ 15523 //console.log('open' + cO.element.data('avoidopenkeyuponce') + " " + (Date.now() - cO.element.data('avoidTimestamp'))); 15524 if(cO.element.data('avoidopenkeyuponce') !== 1 || Date.now() - cO.element.data('avoidTimestamp') > 500){ 15525 cO.navPointOpen(cO, e); 15526 } 15527 cO.element.data('avoidopenkeyuponce', 0); 15528 } 15529 }, 15530 15531 onkeydown : { 15532 keyEscape : function(cO, e){ 15533 if(cO.element.closest('#navigationBreadcrumb').length > 0) cO.element.blur(); 15534 else if(cO.navLevel === '2') cO.navListener.closeNavigation(cO.navListener, e); 15535 else if(cO.navLevel !== '1'){ 15536 var nPaEid = cO.element.closest('ul').closest('li').attr('data-aetoggleri
15536d'); 15537 var toggler = wAccessHandler.getEvent(nPaEid); 15538 if(typeof toggler.navPointClose === 'function') toggler.navPointClose(toggler, e); 15539 e.stopPropagation(); 15540 e.stopImmediatePropagation(); 15541 } 15542 }, 15543 15544 keyEnter : function(cO, e){ 15545 if(cO.toggler === null) cO.element.data('closeAll', 'yes'); 15546 }, 15547 15548 keyTab : function(cO, e){ 15549 /*Wenn der NavPoint angezeigt hat*/ 15550 if(cO.hasNavigationSub){ 15551 cO.navigationSub.element.data('active', true); 15552 wAccessHandler.activateTabindex(cO.navigationSub.element); 15553 cO.navigationSub.element.attr('tabindex', 0).focus(); 15554 } 15555 /*Ist von einem Navpoint der letzte NavigationToggler erreicht, dann schlieÃe den Navigationpunkt*/ 15556 else if(!isMobileNavigation() && wAccessHandler.isLastFocusableElement({element : cO.ancestors.last()}, jQuery(e.target))){ 15557 cO.navPointCloseAll(cO, e); 15558 } 15559 /*Wenn am Ende eines Unternavigationspunktes angekomen*/ 15560 else if(wAccessHandler.isLastFocusableElement({element : cO.element.closest('ul')}, jQuery(e.target))){ 15561 var nPaEid = cO.element.closest('ul').closest('li').attr('data-aetogglerid'); 15562 var toggler = wAccessHandler.getEvent(nPaEid); 15563 if(toggler != null && typeof toggler.navPointClose === 'function') toggler.navPointClose(toggler, e); 15564 } 15565 }, 15566 15567 keyTabShift : function(cO, e){ 15568 //console.log('keyTabShift'); 15569 var navLevel = parseInt(cO.navLevel) 15570 var parentNav = cO.element.closest('ul'); 15571 var isFirst = wAccessHandler.isFirstFocusableElement({element : parentNav}, jQuery(e.target)); 15572 var hasToggler = cO.element.next('.navpointToggler').length > 0; 15573 if(navLevel == 2 && isFirst && hasToggler){ 15574 var togglerId = parentNav.closest('li').find('> a[data-aenavpointid]').attr('data-aenavpointid'); 15575 var aEvent = wAccessHandler.getEvent(togglerId); 15576 aEvent.navPointClose(aEvent, e); 15577 aEvent.element.data('avoidopenkeyuponce', 1).data('avoidTimestamp', Date.now()); 15578 } 15579 else if(navLevel > 2 && isFirst){ 15580 e.preventDefault(); 15581 var togglerId = parentNav.closest('li').find('> a[data-aenavpointid]').attr('data-aenavpointid'); 15582 var aEvent = wAccessHandler.getEvent(togglerId); 15583 aEvent.navPointClose(aEvent, e); 15584 aEvent.element.data('avoidopenkeyuponce', 1).data('avoidTimestamp', Date.now()).focus(); 15585 } 15586 else if(navLevel > 1){ 15587 e.preventDefault(); 15588 cO.element.closest('li').prev('li').find('a').focus(); 15589 } 15590 else if(navLevel == 1){ 15591 cO.navPointClose(cO, e); 15592 } 15593 e.stopPropagation(); 15594 e.stopImmediatePropagation(); 15595 } 15596 } 15597}; 15598/* 15599//////////////////////////////////////////////////////////////// 15600// 15601// JavaScript Funktionen für Listen 15602// 15603// Weblication CMS BASE 15604// erstellt durch Scholl Communications AG, 77694 Kehl, www.scholl.de 15605// erstellt mit Weblication Content Management Server, www.weblication.de 15606// 15607//////////////////////////////////////////////////////////////// 15608*/ 15609 15610/* 15611//////////////////////////////////////////////////////////////// 15612// 15613// JavaScript Funktionen für Listen 15614// 15615// Weblication CMS BASE 15616// erstellt durch Scholl Communications AG, 77694 Kehl, www.scholl.de 15617// erstellt mit Weblication Content Management Server, www.weblication.de 15618// 15619//////////////////////////////////////////////////////////////// 15620*/ 15621 15622wAllowMinimize = true; 15623wLoadingStack = {}; 15624 15625//////////////////////////////////////////////////////////////// 15626// 15627// @method void appendEntriesToList(id, options) 15628// 15629// @desc Fügt neue Listenelemente zur Liste hinzu 15630// 15631// @return void 15632// 15633//////////////////////////////////////////////////////////////// 15634 15635appendEntriesToList = function(listId, options){ 15636 15637 if(wUiTmp['doNotAppendList'] == true){ 15638 return false; 15639 } 15640 15641 if(typeof(wEditor) != 'undefined'){ 15642 return; 15643 } 15644 15645 if(typeof(options) == 'undefined' || !options['querystring']){ 15646 options['querystring'] = (location.search.substr(1) != '' ? '&' : '') + location.search.substr(1); 15647 } 15648 15649 var url = '/weblication/grid5/scripts/wList.php?action=createListAjaxOfData&listId=' + listId + '&project=' + options['project'] + '&data=' + options['ajaxId'] + options['querystring']; 15650 url = wSetParameter(url, 'pageId', options['pageId']); 15651 15652 if(typeof(wLoadingStack[url]) != 'undefined'){ 15653 return; 15654 } 15655 wLoadingStack[url] = null; 15656 15657 var prefixId = '#list_'; 15658 15659 if(typeof(wKeepIDsInEmbededPage) == 'undefined' || !wKeepIDsInEmbededPage){ 15660 if(listElement.length == 0){ 15661 prefixId = prefixId.replace('#', '#embed_'); 15662 } 15663 } 15664 15665 var listElement = jQuery(prefixId + listId); 15666 var hasQuickfilter = false;
15667 15668 if(typeof(listElement) !== 'undefined' && listElement.length){ 15669 if(jQuery('html').hasClass('appendLoading')){ 15670 //return false; 15671 } 15672 jQuery('html').addClass('appendLoading'); 15673 listElement.addClass('appendLoading') 15674 .find('> ul').addClass('appendLoading'); 15675 hasQuickfilter = listElement.find('> ul').data('quickfilter') == '1'; 15676 15677 lastAdaptedQuickfilterBy = listElement.find('> ul').data('lastadaptedquickfilterby'); 15678 } 15679 15680 jQuery.ajax({type: "GET", url: url, dataType: 'html', success: function(resultHTML){ 15681 15682 if(listElement.length){ 15683 jQuery('html').removeClass('appendLoading'); 15684 listElement.removeClass('appendLoading').addClass('appendLoaded') 15685 .find('> ul').removeClass('appendLoading').addClass('appendLoaded'); 15686 } 15687 15688 var parsedHTML = jQuery(resultHTML); 15689 //var listElement = jQuery(prefixId + listId); 15690 15691 var listEntriesContainerO = listElement.find('> ul'); 15692 15693 if(listEntriesContainerO.length == 0){ 15694 listEntriesContainerO = listElement.find(".listEntries .listEntriesInner > div"); 15695 } 15696 15697 var elementTargetFocus = null; 15698 15699 var listEntriesO = parsedHTML.find('> ul > li'); 15700 15701 if (listEntriesO.length === 0) listEntriesO = parsedHTML.find('> li'); 15702 if (listEntriesO.length === 0) listEntriesO = parsedHTML.find('li'); 15703 if (listEntriesO.length === 0) listEntriesO = parsedHTML.find('.listEntries .listEntry'); 15704 15705 listEntriesO.each(function(index){ 15706 15707 var entryToAppend = jQuery(this); 15708 if(index === 0) elementTargetFocus = entryToAppend; 15709 15710 listEntriesContainerO.append(entryToAppend); 15711 entryToAppend.addClass('append appendInit appendInitDelay'); 15712 window.setTimeout(function(){ 15713 entryToAppend.removeClass('appendInit'); 15714 }, 10); 15715 window.setTimeout(function(){ 15716 entryToAppend.removeClass('appendInitDelay'); 15717 }, 10 + 100 * index); 15718 15719 }); 15720 15721 var newListLoaderMore = parsedHTML.filter(".listLoaderMore"); 15722 15723 if(listElement.find(".listLoaderMore").length > 0 && !listElement.attr('data-listLoaderMoreInit')){ 15724 listElement.attr('data-listLoaderMoreInit', listElement.find(".listLoaderMore").get(0).outerHTML); 15725 } 15726 15727 if(newListLoaderMore.length > 0){ 15728 listElement.find(".listLoaderMore").replaceWith(newListLoaderMore); 15729 } 15730 else{ 15731 listElement.find(".listLoaderMore").remove(); 15732 } 15733 15734 if(typeof(lastAdaptedQuickfilterBy) != 'undefined' && typeof(lastAdaptedQuickfilterBy.nodeName) != 'undefined'){ 15735 if(lastAdaptedQuickfilterBy.nodeName == 'SPAN'){ 15736 jQuery(lastAdaptedQuickfilterBy).removeClass("selected").trigger('click'); 15737 } 15738 } 15739 15740 wPrepareHTML(listElement); 15741 15742 var delays = [100, 500, 1000]; 15743 delays.forEach(function(delay) { 15744 window.setTimeout(function() { 15745 jQuery(window).trigger('resize'); 15746 }, delay); 15747 }); 15748 15749 var pageIdExtension = typeof(options['pageIdExtension']) !== 'undefined' ? options['pageIdExtension'] : listId; 15750 var regExpCurrentLoadId = new RegExp('&?moreId' + pageIdExtension + '=\\d+'); 15751 var newLocationSearch = location.search.replace(regExpCurrentLoadId, ''); 15752 15753 newLocationSearch += (newLocationSearch.indexOf('?') == -1 ? '?' : '&') + 'moreId' + pageIdExtension + '=' + options['pageId']; 15754 newLocationSearch = newLocationSearch.replace('?&', '?'); 15755 history.pushState({page: location.pathname + newLocationSearch + location.hash}, '', location.pathname + newLocationSearch + location.hash); 15756 15757 jQuery(prefixId + listId).find('.wglAccordion').wAccordion(); 15758 15759 if(typeof(wAccessibility) !== 'undefined' && wAccessibility['accessEventHandler'] != null && wAccessibility['accessEventHandler'].active){ 15760 wAccessHandler.setFocusToCurElement(elementTargetFocus); 15761 } 15762 15763 if(typeof(wOnAfterAppendEntriesToList) == 'function'){ 15764 wOnAfterAppendEntriesToList(listId, options); 15765 } 15766 }}); 15767}; 15768 15769//////////////////////////////////////////////////////////////// 15770// 15771// @method void removeAppendEntriesFromList(listId) 15772// 15773// @desc Löscht hinzugefügte Listenelemente 15774// 15775// @return void 15776// 15777//////////////////////////////////////////////////////////////// 15778 15779removeAppendEntriesFromList = function(listId){ 15780 15781 if(jQuery('#list_' + listId).length){ 15782 15783 var listElement = jQuery('#list_' + listId); 15784 15785 jQuery('#list_' + listId + ' li.append').each(function(index){ 15786 15787 var entryToRemove = jQuery(this); 15788 15789 entryToRemove.addClass('remove').addClass('removeInit'); 15790 window.setTimeout(function(){ 15791 entryToRemove.removeClass('removeInit'); 15792 }, 10); 15793 window.setTimeout(function(){ 15794 entryToRemove.remove(); 15795 }, 10 + 100 * index); 15796 }); 15797 15798 window.setTimeout(function(){ 15799 jQuery(window).trigger('resize'); 15800 }, 100); 15801 15802 listElement.append(listElement.attr('data-listLoaderMoreInit')); 15803 15804 jQuery('#list_' + listId).find('.listLoaderMoreReset').remove(); 15805 15806 var regExpCurrentLoadId = new RegExp('&?moreId' + listId + '=\\d+'); 15807 var newLocationSearch = location.search.replace(regExpCurrentLoadId, ''); 15808 newLocationSearch = newLocationSearch.replace('?&', '?').replace(/\?$/, ''); 15809 history.pushState({page: location.pathname + newLocationSearch + location.hash}, '', location.pathname + newLocationSearch + location.hash); 15810 } 15811}; 15812 15813//////////////////////////////////////////////////////////////// 15814//
15815// @method void filterCategory(category, categoryName) 15816// 15817// @desc Ruft die Seite mit einem Kategorienfilter auf 15818// 15819// @return void 15820// 15821//////////////////////////////////////////////////////////////// 15822 15823filterCategory = function(category, categoryName){ 15824 15825 var regExpReplace = new RegExp(categoryName + '(\\[\\])?=\\w+'); 15826 location.href = location.pathname + (location.search.replace(regExpReplace, '') + (location.search.indexOf('?') == -1 ? '?' : '&') + categoryName + '[]=' + category).replace(/\&+/, '&').replace(/\?\&/, '?') + location.hash; 15827}; 15828 15829//////////////////////////////////////////////////////////////// 15830// 15831// @method void reloadListAjax(listId, options) 15832// 15833// @desc Aktualisiert eine AJAX-Liste 15834// 15835// @return void 15836// 15837//////////////////////////////////////////////////////////////// 15838 15839reloadListAjax = function(listId){ 15840 15841 listId = listId.replace('list_', ''); 15842 var ajaxIdP = jQuery('*[data-listid=' + listId + ']').data('ajaxid'); 15843 if(ajaxIdP && ajaxIdP != ''){ 15844 loadListAjax(listId, {ajaxId : ajaxIdP, project : wProjectPath}); 15845 } 15846}; 15847 15848//////////////////////////////////////////////////////////////// 15849// 15850// @method void loadListAjax(listId, options) 15851// 15852// @desc Lädt eine AJAX-Liste 15853// 15854// @return void 15855// 15856//////////////////////////////////////////////////////////////// 15857 15858loadListAjax = function(listId, options){ 15859 15860 if(typeof(wEditor) != 'undefined'){ 15861 return; 15862 } 15863 15864 if(typeof(options) == 'undefined' || !options['querystring']){ 15865 options['querystring'] = '&' + location.search.substr(1); 15866 } 15867 15868 if(typeof options['pageId'] == 'undefined'){ 15869 options['pageId'] = '1'; 15870 } 15871 15872 var url = '/weblication/grid5/scripts/wList.php?action=createListAjaxOfData&listId=' + listId + '&project=' + options['project'] + '&data=' + options['ajaxId'] + (typeof options['pageId'] != 'undefined' ? '&pageId=' + options['pageId'] : '') + options['querystring']; 15873 15874 var prefixId = '#list_'; 15875 if(typeof(wKeepIDsInEmbededPage) == 'undefined' || !wKeepIDsInEmbededPage){ 15876 if(jQuery(prefixId + listId).length == 0){ 15877 prefixId = prefixId.replace('#', '#embed_'); 15878 } 15879 } 15880 15881 var hasQuickfilter = false; 15882 15883 if(jQuery(prefixId + listId).length){ 15884 jQuery('html').addClass('adaptLoading'); 15885 jQuery(prefixId + listId).addClass('adaptLoading'); 15886 jQuery(prefixId + listId).find('> ul').addClass('adaptLoading'); 15887 hasQuickfilter = jQuery(prefixId + listId).find('> ul').data('quickfilter') == '1'; 15888 15889 lastAdaptedQuickfilterBy = jQuery(prefixId + listId).find('> ul').data('lastadaptedquickfilterby'); 15890 } 15891 15892 jQuery.ajax({type: "GET", url: url, dataType: 'html', success: function(resultHTML){ 15893 15894 if(jQuery(prefixId + listId).length){ 15895 jQuery('html').removeClass('adaptLoading'); 15896 jQuery(prefixId + listId).removeClass('adaptLoading').addClass('adaptLoaded'); 15897 jQuery(prefixId + listId).find('> ul').removeClass('adaptLoading').addClass('adaptLoaded'); 15898 } 15899 15900 var parsedHTML = jQuery(resultHTML); 15901 15902 /* Kommentarknoten und leere Textknoten werden aus dem parsedHTML String gelöscht */ 15903 parsedHTML = parsedHTML.filter(function() { 15904 return !(this.nodeType === Node.TEXT_NODE && this.nodeValue === "\n") && this.nodeType !== Node.COMMENT_NODE; 15905 }); 15906 15907 var listOuter = jQuery('#list_' + listId); 15908 var listElement = jQuery(prefixId + listId); 15909 15910 if(parsedHTML.attr('data-listresulttype') == 'jsonly'){ 15911 15912 if(typeof(lastAdaptedQuickfilterBy) != 'undefined' && typeof(lastAdaptedQuickfilterBy.nodeName) != 'undefined'){ 15913 if(lastAdaptedQuickfilterBy.nodeName == 'SPAN'){ 15914 jQuery(lastAdaptedQuickfilterBy).removeClass("selected") 15915 jQuery(lastAdaptedQuickfilterBy).trigger('click'); 15916 } 15917 } 15918 15919 if(typeof(wOnAfterLoadListAjax) == 'function'){ 15920 wOnAfterLoadListAjax(listId, options); 15921 } 15922 listElement.html(resultHTML); 15923 } 15924 else{ 15925 15926 var hasEntries = parsedHTML.attr('data-numberentries') !== undefined; 15927 15928 var listEntriesContainerO = listElement.find('> ul'); 15929 if(listEntriesContainerO.length == 0){ 15930 listEntriesContainerO = listElement.find(".listEntries .listEntriesInner > div"); 15931 } 15932 15933 var listEntriesO = parsedHTML.find("li"); 15934 if(listEntriesO.length == 0){ 15935 listEntriesO = parsedHTML.find(".listEntries .listEntry"); 15936 } 15937 15938 listElement.find('*[data-removeonreloadlistbyajax="1"]').remove(); 15939 15940 if(listEntriesO.length == 0){ 15941 listEntriesO = parsedHTML; 15942 listEntriesContainerO.html(''); 15943 listEntriesContainerO = listElement; 15944 } 15945 else{ 15946 listEntriesContainerO.html(''); 15947 if(hasEntries === false){ 15948 listEntriesO = parsedHTML; 15949 } 15950 } 15951 15952 listEntriesContainerO.attr('data-numbervisible', parsedHTML.attr('data-numbervisible') ? parsedHTML.attr('data-numbervisible') : 0); 15953 15954 listEntriesO.each(function(index){ 15955 jQuery(this).attr('data-removeonreloadlistbyajax', '1'); 15956 listEntriesContainerO.append(jQuery(this)); 15957 wLoadingStack = {}; 15958 }); 15959
15960 if(listOuter.find(".pageNaviList").length > 0){ 15961 var pageNaviListHTML = ''; 15962 parsedHTML.each(function(){ 15963 if(jQuery(this).hasClass('pageNaviList')){ 15964 pageNaviListHTML = jQuery(this).html(); 15965 } 15966 }); 15967 listOuter.find(".pageNaviList").each(function(){ 15968 jQuery(this).get(0).innerHTML = pageNaviListHTML; 15969 }); 15970 } 15971 15972 var newListLoaderMore = parsedHTML.filter(".listLoaderMore"); 15973 15974 if(listElement.find(".listLoaderMore").length > 0 && !listElement.attr('data-listLoaderMoreInit')){ 15975 listElement.attr('data-listLoaderMoreInit', listElement.find(".listLoaderMore").get(0).outerHTML); 15976 } 15977 15978 if(newListLoaderMore.length > 0){ 15979 if(listElement.find(".listLoaderMore").length > 0){ 15980 listElement.find(".listLoaderMore").replaceWith(newListLoaderMore); 15981 } 15982 else{ 15983 listElement.append(newListLoaderMore); 15984 } 15985 } 15986 else{ 15987 listElement.find(".listLoaderMore").remove(); 15988 } 15989 15990 if(typeof(lastAdaptedQuickfilterBy) != 'undefined' && typeof(lastAdaptedQuickfilterBy.nodeName) != 'undefined'){ 15991 if(lastAdaptedQuickfilterBy.nodeName == 'SPAN'){ 15992 jQuery(lastAdaptedQuickfilterBy).removeClass("selected") 15993 jQuery(lastAdaptedQuickfilterBy).trigger('click'); 15994 } 15995 } 15996 15997 if(typeof(wOnAfterLoadListAjax) == 'function'){ 15998 options['parsedHTML'] = parsedHTML; 15999 wOnAfterLoadListAjax(listId, options); 16000 } 16001 16002 jQuery(prefixId + listId).find('.wglAccordion').wAccordion(); 16003 } 16004 16005 wPrepareHTML(jQuery(prefixId + listId)); 16006 window.setTimeout(function(){ 16007 jQuery(window).trigger('resize'); 16008 }, 100); 16009 window.setTimeout(function(){ 16010 jQuery(window).trigger('resize'); 16011 }, 500); 16012 window.setTimeout(function(){ 16013 jQuery(window).trigger('resize'); 16014 }, 1000); 16015 }}); 16016}; 16017 16018wWaVersion = '1.0.11'; 16019wAllowMinimize = false; 16020 16021if(location.pathname.indexOf('/weblication/documents') === -1 && typeof(wUiTmp['wGlobalProjectPath']) != 'undefined' && typeof wEditor === 'undefined' && typeof navigator.sendBeacon === 'function'){ 16022 16023 wUiTmp['wHasWa'] = true; 16024 wUiTmp['wHasSb'] = false; 16025 wUiTmp['wTl'] = performance.now(); 16026 16027 if(document.cookie.indexOf('wDisableWaNextRequest=1') != -1){ 16028 document.cookie = 'wDisableWaNextRequest=;path=/;sameSite=Lax'; 16029 wUiTmp['wHasSb'] = true; 16030 } 16031 16032 if(location.search.indexOf('wContentToDisplay=draft') !== -1){ 16033 wUiTmp['wHasSb'] = true; 16034 } 16035 16036 if(location.search.indexOf('createImageRaster=1') !== -1){ 16037 } 16038 else if(typeof wUserType === 'undefined' || wUserType == 'public'){ 16039 if(typeof(PerformanceObserver) === 'function'){ 16040 try{ 16041 function pOberserCallback(list, observer){ 16042 var oEntries = list.getEntries(); 16043 for(var i = 0; i < oEntries.length; i++){ 16044 wUiTmp['wLCP'] = oEntries[i].startTime; 16045 } 16046 } 16047 var pObserver = new PerformanceObserver(pOberserCallback); 16048 pObserver.observe({type:'largest-contentful-paint', buffered: true}); 16049 } 16050 catch(e){} 16051 } 16052 16053 var sb = function(et){ 16054 var url = wUiTmp['wGlobalProjectPath'] + '/wGlobal/scripts/php/wa.php'; 16055 var fd = new FormData(); 16056 fd.append('sr', String(window.screen.availWidth) + 'x' + String(window.screen.availHeight)); 16057 fd.append('cs', /waDarkMode=1/.test(document.cookie) ||Â window.matchMedia && window.matchMedia('(prefers-color-scheme:dark)').matches ? 'd' : 'l'); 16058 fd.append('cm', /waContrast=l/.test(document.cookie) ||Â window.matchMedia && window.matchMedia('(prefers-contrast:more)').matches ? 'm' : ''); 16059 fd.append('el', /waEasyLanguageMode=1/.test(document.cookie) ? '1' : ''); 16060 fd.append('ln', navigator.language); 16061 fd.append('dnt', typeof navigator.doNotTrack !== 'undefined' ? navigator.doNotTrack : ''); 16062 fd.append('et', et); 16063 16064 if(typeof performance.getEntriesByType("navigation")[0] !== 'undefined'){ 16065 var na = performance.getEntriesByType("navigation")[0]; 16066 fd.append('ps', String(parseInt(na.responseEnd - na.connectStart))); 16067 fd.append('pl', String(parseInt(na.loadEventEnd - na.connectStart))); 16068 } 16069 else if(typeof performance.timing === 'object'){ 16070 var pt = performance.timing; 16071 fd.append('ps', String(parseInt(pt.responseEnd - pt.connectStart))); 16072 fd.append('pl', String(parseInt(pt.loadEventEnd - pt.connectStart))); 16073 } 16074 if(typeof(wUiTmp['wLCP']) != 'undefined'){ 16075 fd.append('lcp', String(parseInt(wUiTmp['wLCP']))); 16076 } 16077 if(typeof(navigator.connection) != 'undefined' && typeof(navigator.connection.effectiveType) == 'string'){ 16078 fd.append('nc', navigator.connection.effectiveType); 16079 } 16080 if(/ project-([\w\-]+) /.test(document.documentElement.className)){ 16081 fd.append('rc', RegExp.$1); 16082 } 16083 if(document.referrer && document.referrer != ''){ 16084 fd.append('r', document.referrer); 16085 } 16086 navigator.sendBeacon(url, fd); 16087 }; 16088 16089 var sbi = function(u, e, c){ 16090 var url = wUiTmp['wGlobalProjectPath'] + '/wGlobal/scripts/php/wa.php'; 16091 var fd = new FormData(); 16092 fd.append('u', u); 16093 if(typeof e !== 'undefined' && e != ''){ 16094 fd.append('e', e); 16095 } 16096 if(typeof c !== 'undefined' && c != ''){ 16097 fd.append('c', c); 16098 } 16099 navigator.sendBeacon(url, fd); 16100 }; 16101 16102 window.addEventListener('load', function(){ 16103 window.setTimeout(function(){ 16104 if(!wUiTmp['wHasSb']){sb('ld')} 16105 wUiTmp['wHasSb'] = true; 16106 var u = location.pathname, w = document.querySelectorAll('*[data-wa-event]'); 16107 for(var i = 0; i < w.length; i++){ 16108 w[i].addEventListener(w[i].getAttribute('data-wa-event') ? w[i].getAttribute('data-wa-event') : 'click', function(event){ 16109 if(event.isTrusted){ 16110 var el = event.currentTarget, n = el.getAttribute('data-wa-label'), c = el.getAttribute('data-wa-category'); 16111 if(c == 'requestLayer'){ 16112 if(n == 'Megadropdown'){ 16113 u = el.getAttribute('data-previewlink'); 16114 } 16115 else{ 16116 u = el.getAttribute('href'); 16117 } 16118 } 16119 if(el.getAttribute('data-wa-expired') !== '1'){ 16120 if(!n){ 16121 n = el.getAttribute('data-title') ? el.getAttribute('data-title') : el.getAttribute('title'); 16122 } 16123 if(!n){ 16124 n = el.innerText.replace(/\n.*/s, '').substr(0, 128); 16125 } 16126 if(n != ''){ 16127 sbi(u, n, c); 16128 } 16129 } 16130 if(el.getAttribute('data-wa-multiple') !== '1'){ 16131 el.setAttribute('data-wa-expired', '1'); 16132 } 16133 } 16134 }); 16135 } 16136 }, 320); 16137 }); 16138 16139 if(typeof wLogPageHide !== 'undefined' && wLogPageHide){ 16140 window.addEventListener('pagehide', function(){ 16141 let url = wUiTmp['wGlobalProjectPath'] + '/wGlobal/scripts/php/wa.php'; 16142 let fd = new FormData(); 16143 fd.append('e', 'pagehide'); 16144 fd.append('ht', Math.round((performance.now() - wUiTmp['wTl']) / 100) / 10); 16145 let vs = ''; 16146 jQuery('video').each(function(){ 16147 if(jQuery(this).attr('data-duration') && jQuery(this).attr('data-maxplayed') && parseFloat(jQuery(this).attr('data-maxplayed')) > 0.1){ 16148 vs += (vs !== '' ? ';' : '') + 'src=' + jQuery(this).attr('src').replace(/^https?\:\/\/[^\/]+/, '') + ',d=' + jQuery(this).attr('data-duration') + ',m=' + jQuery(this).attr('data-maxplayed'); 16149 } 16150 }); 16151 if(vs !== ''){ 16152 fd.append('vs', vs); 16153 } 16154 if(jQuery('#blockBody').length !== 0 && jQuery('#blockHeader').length !== 0){ 16155 let blockBodyBottom = jQuery('#blockHeader').height() + jQuery('#blockBody').height(); 16156 let sb = 'vm=' + (typeof(wUiTmp['viewContentMax']) !== 'undefined' ? wUiTmp['viewContentMax'] : '0') + ',sm=' + (typeof(wUiTmp['scrollMax']) !== 'undefined' ? wUiTmp['scrollMax'] : '0') + ',mh=' + Math.round(jQuery('#blockHeader').height() + jQuery('#blockBody').height()); 16157 fd.append('sb', sb); 16158 } 16159 navigator.sendBeacon(url, fd); 16160 }); 16161 } 16162 16163 document.addEventListener('visibilitychange', function(){ 16164 if(!wUiTmp['wHasSb']){sb('vc')} 16165 wUiTmp['wHasSb'] = true; 16166 }); 16167 } 16168} 16169 16170jQuery.fn.wAnalyzeEvents = function(parameters){ 16171 jQuery.each(jQuery(this), function(){ 16172 var label = typeof parameters['label'] === 'function' ? parameters['label'].call(jQuery(this).get(0)) : parameters['label']; 16173 jQuery(this).attr('data-wa-event', parameters['event']); 16174 jQuery(this).attr('data-wa-label', label); 16175 jQuery(this).attr('data-wa-category', parameters['category']); 16176 }); 16177};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.