1/*! 2 * Name: Geiger 2016 Scripts v1.0.0 3 * Desc: custom scripts 4 Geiger Release 2016 4 * Author: Sergej Kutschin/SK 5 * Author: Dennis Thanner/DT 6 * Date: 03.03.2016 7 * 8 * Copyright 2016 Fabrique D'Images ebusiness GmbH (http://www.fdi.de) 9 */ 10/* 11 * ChangeLog: 12 * 1.0.0 Initial Release 13 */ 14 15const MD_BREAKPOINT = 900, 16 LG_BREAKPOINT = 1100; 17 18if (!vConfig.debug) { 19 if (!window.console) window.console = {}; 20 var methods = ["log", "debug", "warn", "info"]; 21 for (var i = 0; i < methods.length; i++) { 22 console[methods[i]] = function () {}; 23 } 24} 25 26if (!vConfig.debug) { 27 if (!window.console) window.console = {}; 28 var methods = ["log", "debug", "warn", "info"]; 29 for (var i = 0; i < methods.length; i++) { 30 console[methods[i]] = function () {}; 31 } 32} 33 34function isTouchSupported() { 35 var touchSupported = 'ontouchstart' in document.documentElement; 36 return touchSupported; 37} 38 39$(function () { 40 $(window).scroll(function () { 41 data = {}; 42 _this = $(this); 43 button = $('#top-button'); 44 breakRatio = 0.5; 45 data.topPosition = _this.scrollTop(); 46 data.vh = _this.height(); 47 data.contentHeight = $(document).height(); 48 data.ratio = data.topPosition / data.vh; 49 50 if (data.contentHeight / data.vh > 3) 51 breakRatio = 1; 52 53 if (data.ratio > breakRatio) { 54 button.fadeIn(); 55 } else { 56 button.fadeOut(); 57 } 58 }); 59}); 60 61$(function () { 62 if (isTouchSupported()) { 63 $("#head-slider").swiperight(function () { 64 $(this).carousel('prev'); 65 }); 66 $("#head-slider").swipeleft(function () { 67 $(this).carousel('next'); 68 }); 69 } 70}); 71 72 73$(function () { 74 $('a[href^="#"]').click(function (e) { 75 e.preventDefault(); 76 $this = this; 77 var offset_in_css = 4.0625 * parseInt($("html").css("font-size")); /* height of ".jumptarget:before */ 78 var animation_time = 700; 79 80 if (location.pathname.replace(/^\//, '') == $this.pathname.replace(/^\//, '') && location.hostname == $this.hostname) { 81 if($this.hash == "#carouselExampleIndicators"){ 82 83 } else if ($this.hash === '#' || $this.hash === '') { /* DO NOTHING!! */} else if ($this.hash === '#' || $this.hash === '' || $this.hash === '#top') { 84 $('html,body').stop(true, true).animate({ 85 scrollTop: 0 86 }, animation_time); 87 } else if ($this.hash === '#main-content') { 88 var target = $('#head-slider'); 89 if (target.length) { 90 $('html,body').stop(true, true).animate({ 91 scrollTop: target.offset().top + target.outerHeight() - $("nav").outerHeight() 92 }, animation_time); 93 } 94 } else { 95 var target = $($this.hash); 96 target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 97 if (target.length) { 98 var offsetTop = 0; 99 if (target.offset().top != 0) { 100 offsetTop = target.offset().top + offset_in_css - $("nav").outerHeight() 101 } 102 $('html,body').stop(true, true).animate({ 103 scrollTop: offsetTop 104 }, animation_time); 105 } 106 } 107 } 108 }); 109}); 110 111$(function () { 112 $('#nav-content-mobile .nav-item .hidden-lg-up.is-dropdown,#nav-content-mobile .nav-item .has-next-level.hidden-lg-up, #nav-content-mobile .back-mainmenu').click(function (e) { 113 e.preventDefault(); 114 var secondlvlmenu; 115 if ($(this).is("#nav-content-mobile .back-mainmenu")) { 116 secondlvlmenu = $($(this).parents()[1]); 117 } else { 118 secondlvlmenu = $(this).parent(); 119 } 120 121 $("#nav-content-mobile .nav.navbar-nav").toggleClass("show"); 122 if (secondlvlmenu.hasClass("show")) { 123 // animation quickfix on hide second level 124 setTimeout(function () { 125 secondlvlmenu.toggleClass("show"); 126 }, 700); 127 } else { 128 secondlvlmenu.toggleClass("show"); 129 } 130 131 }); 132}); 133 134$(function () { 135 $("#nav-content-mobile .dropdown-menu-col-header-toggle-dropdown, #nav-content-mobile .back-parentmenu").click(function (e) { 136 e.preventDefault(); 137 var $this = $(this); 138 var secondlvlmenu, thirdlvlmenu; 139 if ($this.is("#nav-content-mobile .back-parentmenu")) { 140 thirdlvlmenu = $($this.parents()[2]); 141 secondlvlmenu = $($this.parents()[5]); 142 } else { 143 thirdlvlmenu = $($this.parents()[1]); 144 secondlvlmenu = $($this.parents()[4]); 145 } 146 147 secondlvlmenu.toggleClass("hide"); 148 if (thirdlvlmenu.hasClass("show")) { 149 setTimeout(function () { 150 thirdlvlmenu.toggleClass("show"); 151 }, 700); 152 } else { 153 thirdlvlmenu.toggleClass("show"); 154 } 155 156 }); 157}); 158 159$(function () { 160 function toggleMobileNavbar() { 161 $("#nav-content-mobile").toggleClass("closed"); 162 $(".nav-overlay").fadeToggle({ 163 duration: 700, 164 ease: "ease-in-out" 165 }); 166 if ($("#nav-content-mobile").hasClass("closed")) { 167 //Navbar reset on close 168 setTimeout(function () { 169 $("#nav-content-mobile .nav.navbar-nav").addClass("show") 170 .find(".nav-item").removeClass("show") 171 .find(".dropdown-menu.dropdown-navbar").removeClass("hide") 172 .find(".dropdown-menu-col").removeClass("show"); 173 }, 700); 174 } 175 } 176 177 $("#mobile-navbar-toggle-open, #mobile-navbar-toggle-close").click(function (e) { 178 e.preventDefault(); 179 toggleMobileNavbar(); 180 }); 181 182 $(".nav-overlay").click(function () { 183 toggleMobileNavbar(); 184 }); 185}); 186 187$(function () { 188 if (window.innerWidth >= 1100) { 189 $('.dropdown').on('show.bs.dropdown', function (e) { 190 $(this).find('.dropdown-menu').first().stop(true, true).fadeIn(); 191 }); 192 193 $('.dropdown').on('hide.bs.dropdown', function (e) { 194 $(this).find('.dropdown-menu').first().stop(true, true).fadeOut(); 195 }); 196 } 197}); 198 199$(function () { 200 var form = $("#kontakt"); 201 if (form.length > 0) { 202 form.validate({ 203 rules: { 204 field3t: { 205 required: true, 206 minlength: 3 207 }, 208 field5t: { 209 required: true, 210 minlength: 3 211 }, 212 field6t: { 213 required: true, 214 number: true, 215 minlength: 4 216 }, 217 field7t: { 218 required: true, 219 minlength: 3 220 }, 221 field9t: { 222 required: true, 223 email: true 224 }, 225 field12t: { 226 required: true, 227 minlength: 3 228 }, 229 field31c: { 230 required: true 231 }, 232 captcha: { 233 required: true, 234 captcha: true 235 }, 236 }, 237 errorPlacement: function (error, element) { 238 var parentDiv = $(element).parent('div'), 239 parentLabel = $(element).parent('label'); 240 if (!parentDiv.hasClass('has-error')) { 241 parentDiv.find('.help-block').remove(); 242 var field = parentDiv.parent('div').find('label').text().replace(/\*|:/gi, "").trim(); 243 if ($(element).attr("id") == "captcha") { // Captcha wird automatisch generiert und hat kein Label das man verwenden könnte 244 field = "Captcha"; 245 } 246 if ($(element).attr("id") == "agb") { 247 parentLabel.addClass("has-error"); 248 parentLabel.append('<div class="help-block text-danger small"><i class="fa fa-exclamation-triangle"></i> Nutzungsbedingungen sind erforderlich</div>'); 249 } 250 parentDiv.append('<div class="help-block text-danger small"><i class="fa fa-exclamation-triangle"></i> ' + field + ' ist erforderlich</div>'); 251 } 252 parentDiv.addClass('has-error'); 253 parentDiv.addClass('has-feedback'); 254 parentDiv.find('label').addClass('control-label'); 255 parentDiv.removeClass('has-success'); 256 }, 257 success: function (error, element) { 258 var parentDiv = $(element).parent('div'), 259 parentLabel = $(element).parent('label'); 260 if (!parentDiv.hasClass('has-success')) { 261 parentDiv.find('.help-block').remove(); 262 // parentDiv.append('<span class="form-control-feedback" aria-hidden="true"><i class="fa fa-check"></i></span>'); 263 } 264 265 if ($(element).attr("id") == "agb") { 266 parentLabel.removeClass("has-error"); 267 parentLabel.find('.help-block').remove(); 268 } 269 parentDiv.addClass('has-success'); 270 parentDiv.addClass('has-feedback'); 271 parentDiv.removeClass('has-error'); 272 parentDiv.find('label').removeClass('control-label'); 273 } 274 }); 275 } 276}); 277 278$(function () { 279 $('#projekt-map').height($('#projekt-data-table').height()); 280}); 281 282$(function () { 283 $('#nav-search').on('shown.bs.dropdown', function () { 284 $('#primary-search-input-field').focus(); 285 }); 286}); 287 288 289$(function() { 290 var teaserAdjustMedia = window.matchMedia("(min-width:" + LG_BREAKPOINT + "px)"); 291 if (teaserAdjustMedia.matches) { 292 $('#main-menu a[data-toggle="dropdown"]').click(function(e) { 293 e.stopPropagation(); 294 e.preventDefault(); 295 }); 296 $('#main-menu li.dropdown').mouseenter(function() { 297 $(this).find('a[data-toggle="dropdown"]').attr('aria-expanded', 'true'); 298 $(this).addClass('open'); 299 }).mouseleave(function() { 300 $(this).find('a[data-toggle="dropdown"]').attr('aria-expanded', 'false'); 301 $(this).removeClass('open'); 302 }) 303 } 304}); 305 306 307$('.nav-link').hover(function(){ 308 $(this).closest('.nav').addClass('hide-nav-preview'); 309 }, 310 function () { 311 $(this).closest('.nav').removeClass('hide-nav-preview'); 312 }); 313 314 315$(document).ready(function () { 316 $(".breadcrumb-item").last().addClass("active"); 317 $(".breadcrumb-item").last().html($(".breadcrumb-item.active a").html()); 318 //Navigation 319 $('#mobile-navbar-toggle').click(function (e) { 320 e.preventDefault(); 321 $('.nav-overlay').fadeToggle({ 322 duration: 700 323 , ease: "ease-in-out" 324 }); 325 $('#search').hide(); 326 $('#search-navbar-toggle').removeClass('active'); 327 $('#nav-content-mobile,#language-selection').show('slow'); 328 });
329 330 function toggleMenu(aim, lvl, bStatus) { 331 var $this = $(aim).parents('li').children(lvl); 332 $(lvl).not($this).hide('slow'); 333 $this.clearQueue(); 334 $this.stop(); 335 336 if ($(window).width() < 992) { 337 if( $this.find('.back-parentmenu').length === 0) { 338 $this.prepend('<li class="nav-item hidden-lg-up"><a class="nav-link back-parentmenu" href="#"><i class="fa fa-angle-left fa-left"></i></a></li>'); 339 } 340 } 341 342 if(bStatus === true) { 343 $this.show('slow'); 344 } else { 345 $this.hide('slow'); 346 } 347 } 348 // Falls Submenu über den Bildschirmrand gehen sollte -> Submenu nach links setzen 349 function checkThirdLevelPosition(aim) { 350 var off = $(aim).offset(); 351 var left = off.left; 352 var secondLevelWidth = $(aim).parent().width(); 353 var thirdLevelWidth = 200; // Hier eigentlich die Länge von dem Element (aim.width()) 354 var docWidth = $(window).width(); 355 var isVisible = (left + secondLevelWidth + thirdLevelWidth <= docWidth) 356 if (!isVisible) { 357 $(aim).siblings('ul').addClass('toLeft'); 358 } 359 else { 360 $(aim).siblings('ul').removeClass('toLeft'); 361 } 362 } 363 function relativeClickPositionToElement(element, event) { 364 var pos = { 365 x: (event.pageX - $(element).offset().left), 366 y: (event.pageY - $(element).offset().top) 367 }; 368 return pos; 369 } 370 function onClickNav(e,aim,lvl, bStatus) { 371 if ($(window).width() > 991) return; 372 if(bStatus === false) { 373 e.preventDefault(); 374 toggleMenu(aim, lvl, bStatus); 375 } else { 376 var pos = relativeClickPositionToElement(aim, e); 377 if (pos.x > 300) { // Teilt einen Menüeintrag auf: linke Seite = Link - rechte Seite = Untermenü 378 e.preventDefault(); 379 toggleMenu(aim, lvl, bStatus); 380 } 381 } 382 } 383 384 $('.openSecondLevel').parent().hover( 385 function (e) { 386 if ($(window).width() < 992) return; 387 e.preventDefault(); 388 toggleMenu($(this).children('a'), '.secondLevel', true); 389 }, 390 function (e) { 391 if ($(window).width() < 992) return; 392 e.preventDefault(); 393 toggleMenu($(this).children('a'), '.secondLevel', false); 394 } 395 ); 396 $('.openSecondLevel').click(function (e) { 397 onClickNav(e,this,'.secondLevel', true); 398 }); 399 $(document).on("click", ".back-parentmenu", function (e) { 400 onClickNav(e,this,'.secondLevel', false); 401 }); 402 403 $('.openThirdLevel').parent().hover( 404 function (e) { 405 if ($(window).width() < 992) return; 406 e.preventDefault(); 407 checkThirdLevelPosition($(this).children('a')); 408 toggleMenu($(this).children('a'), '.thirdLevel', true); 409 }, 410 function (e) { 411 if ($(window).width() < 992) return; 412 e.preventDefault(); 413 checkThirdLevelPosition($(this).children('a')); 414 toggleMenu($(this).children('a'), '.thirdLevel', false); 415 } 416 417 ); 418 $('.openThirdLevel').click(function (e) { 419 onClickNav(e,this,'.thirdLevel'); 420 }); 421 $('.back-parentmenu').click(function (e) { 422 e.preventDefault(); 423 $(this).closest('ul').hide('slow'); 424 }); 425 $('#search-navbar-toggle').click(function (e) { 426 e.preventDefault(); 427 if ($(this).hasClass('active')) { 428 $(this).removeClass('active'); 429 $('#search').hide(); 430 } 431 else { 432 $(this).addClass("active"); 433 $('#search').show(); 434 }; 435 }); 436 $('#close-nav-content-mobile, .nav-overlay').click(function (e) { 437 e.preventDefault(); 438 $('.secondLevel, .thirdLevel').hide('slow'); 439 $('#nav-content-mobile').hide('slow'); 440 $('.nav-overlay,#language-selection').hide('slow'); 441 }); 442 //Same height for teasers 443 $(function () { 444 $('.teaser').matchHeight({ 445 byRow: true 446 }); 447 $('.teaser-border').matchHeight({ 448 byRow: true 449 }); 450 }); 451 //Carousel 452 $(function () { 453 $('#carousel').carousel({ 454 interval: 2000 455 }); 456 });
457 //Scroll-to-top button 458 $(window).scroll(function () { 459 if ($(this).scrollTop() > 100) { 460 $('#to-top').fadeIn(); 461 } 462 else { 463 $('#to-top').fadeOut(); 464 } 465 }); 466 $('#toTop').click(function () { 467 $('body,html').animate({ 468 scrollTop: 0 469 }, 800); 470 return false; 471 }); 472});
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.