1$(() => { 2 var mobile = $('#mobile-hidden').is(':hidden'); 3 var ajaxloader = $('#joAjaxloader'); 4 5 var headerimg = $('.header_fullscreen .header_img'); 6 var hc = $('.hc'); 7 if (headerimg.length && !mobile) { 8 $(document).scroll(function() { 9 headerimg.css({ 10 transform: 'translate3d(0px, ' + ($(this).scrollTop() / 5) + 'px, 0px)', 11 }); 12 if (hc.length) { 13 hc.css({ 14 transform: 'translate3d(0px, ' + ($(this).scrollTop() / 2) + 'px, 0px)', 15 }); 16 } 17 }); 18 } 19 20 var $divider = $('.joControls .divider'); 21 22 if ($divider.length) { 23 $divider.each(function() { 24 var $that = $(this); 25 if ($that.next().length && $that.next().hasClass('divider')) { 26 $that.hide(); 27 $that.next().css('border-right', 'none'); 28 } 29 }); 30 } 31 32 $('a[href*="#"]:not(.c_button)').on('click', function(e) { 33 var linkArr = ($(this).attr('href')).split('#'); 34 35 var id = ''; 36 if (linkArr[0] == '' || window.location.pathname == linkArr[0] || (window.location.pathname + window.location.search) == linkArr[0]) { 37 id = '#' + linkArr[1]; 38 39 if ($(id).length) { 40 e.preventDefault(); 41 42 // kann irgendwie nicht richtig berechnen 43 // var scrollTop = $(id).position().top - $('.joTop').outerHeight(); 44 var scrollTop = $(id).position().top + 150; 45 46 $('html, body').scrollTop(scrollTop); 47 } 48 } 49 }); 50 51 // Prevent Formload on history-back 52 if (window.history.replaceState) window.history.replaceState(null, null, window.location.href); 53 54 function resizeMap() { 55 var $themap = $('#mapdiv'); 56 if ($themap.length) { 57 var map = $themap.data('map'); 58 setTimeout(() => { 59 map.updateSize(); 60 }, 200); 61 } 62 } 63 64 $('#sidebarCollapse').on('click', function () { 65 $(this).toggleClass('active'); 66 $('#sidebar').toggleClass('active'); 67 resizeMap(); 68 }); 69 70 $('.search_wrap').on('click', '.searchcontrols a.active.show', function() { 71 var that = $(this); 72 setTimeout(() => { 73 that.removeClass('active show'); 74 var id = that.attr('href').substring(1); 75 $(document.getElementById(id)).removeClass('active show'); 76 }, 100); 77 }); 78 79 $('.search_wrap .searchcontrols a').click(() => { 80 setTimeout(() => { 81 var tab_active = $('.tab-pane.active.show'); 82 if (tab_active.length) { 83 var container = tab_active.find('.f-g-item'); 84 if (container.length) { 85 var height = container.height(); 86 $('.f-g-con').css('height', height + 'px'); 87 $('.f-g-con').css('maxHeight', height + 'px'); 88 } 89 } 90 }, 100); 91 }); 92 93 $('.search_wrap').on('click', '.f-g-con .load_more .f_item', function(e) { 94 e.preventDefault(); 95 var $that = $(this); 96 var href = $that.attr('href'); 97 var container = $(this).parent().parent(); 98 if (container.next().length) { 99 var height = container.next().height(); 100 container.animate({top: '-=' + container.height() + 'px'}, 'slow'); 101 $('.f-g-con').css('height', height + 'px'); 102 $('.f-g-con').css('maxHeight', height + 'px'); 103 104 if (container.next().find('.load_more').length == 1) { 105 container.next().animate({top: '-=' + height + 'px'}, 'slow'); 106 } else { 107 container.next().animate({top: '-=' + container.height() + 'px'}, 'slow'); 108 } 109 $('body,html').animate({ 110 scrollTop: $('.search_wrap').offset().top 111 }, 500); 112 } else { 113 ajaxloader.show(); 114 var href = $(this).attr('href'); 115 116 if (href) { 117 $.post(href, (data, suc) => { 118 if (suc == 'success') { 119 ajaxloader.hide(); 120 121 var item = $(data).find('.f-g-item'); 122 item.hide(); 123 container.after(item); 124 var height = container.next().height(); 125 126 container.next().css('top', height + 'px'); 127 $('.f-g-con').css('height', height + 'px'); 128 $('.f-g-con').css('maxHeight', height + 'px'); 129 item.show(); 130 131 container.animate({top: '-=' + container.height() + 'px'}, 'slow'); 132 container.next().animate({top: '-=' + height + 'px'}, 'slow'); 133 134 $('body,html').animate({
135 scrollTop: $('.search_wrap').offset().top 136 }, 500); 137 } 138 }).fail(errorFunc); 139 } else errorFunc(); 140 } 141 }); 142 143 $('.search_wrap').on('click', '.joAjaxLoadPrev', function(e) { 144 e.preventDefault(); 145 var container = $(this).parent().parent(); 146 var height = container.prev().height(); 147 //container.animate({top: '+=' + container.height() + 'px'}, 'slow'); 148 // container.animate({top: '+=' + height + 'px'}, 'slow'); 149 if (container.find('.load_more .f_item').length == 1) { 150 container.animate({top: '+=' + container.height() + 'px'}, 'slow'); 151 } else { 152 container.animate({top: '+=' + height + 'px'}, 'slow'); 153 } 154 155 $('.f-g-con').css('height', height + 'px'); 156 $('.f-g-con').css('maxHeight', height + 'px'); 157 container.prev().animate({top: '+=' + height + 'px'}, 'slow'); 158 }); 159 160 /* 161 $('.bigimg_wrap .img_item a').click(function(e) { 162 e.preventDefault(); 163 }); 164 */ 165 166 /* Bild per Klick vergröÃern / verkleinern */ 167 $('.bigimg_wrap .img_item a').click(function(e) { 168 e.preventDefault(); 169 170 if (mobile) return false; 171 172 var $that = $(this).parent(); 173 174 var $gp = $that.parent(); 175 var children_count = $gp.children().length; 176 177 var is_activ = $that.hasClass('zoomable'); 178 179 if (is_activ) { 180 if (children_count > 1) $that.removeClass('col-md-10').addClass('col-md'); 181 $that.removeClass('zoomable'); 182 $('.img_zoom_in').fadeOut(); 183 $('.img_zoom_out').fadeOut(); 184 185 $that.parent().removeClass('active'); 186 } else { 187 if (children_count > 1) $that.addClass('col-md-10').removeClass('col-md'); 188 $that.addClass('zoomable'); 189 $('.img_zoom_in').fadeIn(); 190 $('.img_zoom_out').fadeIn(); 191 192 $that.parent().addClass('active'); 193 } 194 195 var $img = $that.find('img'); 196 $img.css('height', '100%').css('width', '100%').css('left', '0').css('top', '0').data('scr_pos', 0); 197 198 if ($img.data('ui-draggable')) { 199 if (is_activ) $img.draggable('disable'); 200 else $img.draggable('enable'); 201 } 202 else if (!is_activ) $img.draggable(); 203 204 $that.parent().children().not($that).removeClass('col-md-10 active').addClass('col-md').find('img').css('height', '100%').css('width', '100%').css('left', '0').css('top', '0').data('scr_pos', 0).promise().done(function(e) { 205 if ($(this).data('ui-draggable')) $(this).draggable('disable'); 206 }); 207 208 }); 209 210 var zoom = 0; 211 function zoomImg($container, delta, e) { 212 var $img = $container.find('img'); 213 var deep = $img.data('scr_pos'); 214 215 if (typeof deep == 'undefined' || deep < 1 || deep > 11) deep = 1; 216 217 var width = $img.width(); 218 var height = $img.height(); 219 220 if (delta > 1) { 221 if (deep < 11) { 222 if (deep > 6 && typeof $img.data('img_reloaded') == 'undefined') { 223 ajaxloader.show(); 224 var src = $img.attr('src'); 225 src = src.replace('full/500,/0', 'full/3000,/0'); 226 $img.load(() => { 227 ajaxloader.hide(); 228 }).error(() => { 229 ajaxloader.hide(); 230 }).attr('src', src); 231 $img.data('img_reloaded', 'finished'); 232 } 233 var calcwidth = width + (width * 0.1); 234 var calcheight = height + (height * 0.1); 235 236 $img.width(calcwidth); 237 $img.height(calcheight); 238 239 var parentHeight = $img.parent().height(); 240 var parentWidth = $img.parent().width(); 241 242 var top = (parentHeight / 2) - (calcheight / 2); 243 var left = (parentWidth / 2) - (calcwidth / 2); 244 245 $img.css('top', top); 246 $img.css('left', left); 247 248 $img.data('scr_pos', deep+1); 249 } 250 } else { 251 if (deep > 1) { 252 var calcwidth = width - (width * 0.1); 253 var calcheight = height - (height * 0.1); 254 255 $img.width(calcwidth);
256 $img.height(calcheight); 257 258 var parentHeight = $img.parent().height(); 259 var parentWidth = $img.parent().width(); 260 261 var top = (parentHeight / 2) - (calcheight / 2); 262 var left = (parentWidth / 2) - (calcwidth / 2); 263 264 $img.css('top', top); 265 $img.css('left', left); 266 267 $img.data('scr_pos', deep-1); 268 } 269 } 270 } 271 272 $('.bigimg_wrap').on('wheel', '.img_big .img_item.zoomable', function(e) { 273 e.preventDefault(); 274 275 var delta = e.originalEvent.deltaY; 276 277 /* 278 var delta = e.delta || e.originalEvent.wheelDelta; 279 if (delta === undefined) { 280 //we are on firefox 281 delta = e.originalEvent.detail; 282 } 283 */ 284 285 zoomImg($(this), delta, e); 286 }); 287 288 $('.img_zoom_in').click((e) => { 289 zoomImg($('.img_big .img_item.zoomable'), 10, e); 290 }); 291 292 $('.img_zoom_out').click((e) => { 293 zoomImg($('.img_big .img_item.zoomable'), -10, e); 294 }); 295 296 297 /* 298 function enterFullscreen(element) { 299 if (element.requestFullscreen) { 300 element.requestFullscreen(); 301 } else if (element.msRequestFullscreen) { 302 element.msRequestFullscreen(); 303 } else if (element.webkitRequestFullscreen) { 304 element.webkitRequestFullscreen(); 305 } 306 } 307 308 function closeFullscreen() { 309 if (document.exitFullscreen) { 310 document.exitFullscreen(); 311 } else if (document.webkitExitFullscreen) { 312 document.webkitExitFullscreen(); 313 } else if (document.msExitFullscreen) { 314 document.msExitFullscreen(); 315 } 316 } 317 318 $('.togglefullscreen').click(function(e) { 319 $that = $(this); 320 $main_content = $('.content_wrap'); 321 if ($that.hasClass('in_fullscreen')) { 322 closeFullscreen(); 323 } else { 324 enterFullscreen($main_content[0]); 325 } 326 }); 327 328 // ESC close fullscreen 329 document.addEventListener('fullscreenchange', changeHandler); 330 document.addEventListener('webkitfullscreenchange', changeHandler); 331 document.addEventListener('mozfullscreenchange', changeHandler); 332 document.addEventListener('MSFullscreenChange', changeHandler); 333 334 function changeHandler() { 335 console.log('change'); 336 $('.togglefullscreen').toggleClass('in_fullscreen'); 337 $('body #content').toggleClass('fullHeight'); 338 resizeMap(); 339 } 340 */ 341 342 $('.collapse_all_p').click(function() { 343 var $meta = $('#sidebar'); 344 var $collapse = $meta.find('h3[data-toggle="collapse"]'); 345 if ($collapse.length) { 346 $collapse.each(function(i, v) { 347 var $that = $(this); 348 if ($that.attr('aria-expanded') == 'false') { 349 $that.removeClass('collapsed').attr('aria-expanded', true).data('aria-expanded', true); 350 var $target = $($(this).data('target')); 351 if ($target.length && !$target.hasClass('show')) { 352 $target.slideDown(400, () => { 353 $target.addClass('collapse show').removeAttr('style'); 354 }); 355 } 356 } 357 }); 358 } 359 }); 360 361 $('.collapse_all_m').click(function() { 362 var $meta = $('#sidebar'); 363 var $collapse = $meta.find('h3[data-toggle="collapse"]'); 364 if ($collapse.length) { 365 $collapse.each(function(i, v) { 366 var $that = $(this); 367 if ($that.attr('aria-expanded') == 'true') { 368 $that.addClass('collapsed').attr('aria-expanded', false).data('aria-expanded', false); 369 var $target = $($(this).data('target')); 370 if ($target.length && $target.hasClass('show')) { 371 $target.slideUp(400, () => { 372 $target.removeClass('show').removeAttr('style'); 373 }); 374 } 375 } 376 }); 377 } 378 }); 379 380 381 382 383 /* 384 * josticky alternative zu css lösungen, da diese nicht überall umsetzbar sind 385 * Element scrollt mit normalem scroll mit in einem definierten bereich 386 * 387 * @parent element, wonach sich das Top richtet 388 * @gr element, welche die Höhe beschränkt, also wo das sticky drinnen bleiben/mit scrollen soll 389 * @header element, header offset 390 * 391 */ 392 $.fn.josticky = function($parent, $gp, $header = []) { 393 var $that = this; 394 if ($parent.length && $gp.length) { 395 var orig_top = $parent.offset().top; 396 397 var header_height = 0; 398 if ($header.length) { 399 header_height = $header.height(); 400 } 401 402 var el_height = $that.height(); 403 404 $(window).scroll(function(e) { 405 if (mobile) return false;
406 407 var gp_height = $gp.height(); 408 var scroll = $(this).scrollTop(); 409 410 // scroll stopp wenn man oben ist 411 if ((scroll + header_height) > orig_top) { 412 var new_top = scroll; 413 414 // scroll stopp beim übersteigen der höhe des gp elements 415 if (new_top + el_height > gp_height) { 416 new_top = gp_height - el_height; 417 $that.css('top', new_top + 'px'); 418 } else { 419 $that.css('top', new_top + 'px'); 420 } 421 422 } else { 423 $that.css('top', ''); 424 } 425 }); 426 } 427 428 return this; 429 }; 430 431 var $joToSticky = $('.joDetail .detailimage_con'); 432 if ($joToSticky.length) { 433 $joToSticky.josticky($('.joDetail .detailimage'), $('.joDetail .detailimage').parent(), $('.joTop')); 434 } 435 436 // create map overlay 437 var $themap = $('#mapdiv'); 438 if ($themap.length) {
439 var $map_overlay = $('<div class="map_overlay"><div class="map_overlay_text">Zum Zoomen der Karte bitte drauf klicken.</div></div>'); 440 $map_overlay.click(function() { 441 $(this).fadeOut(); 442 }); 443 $themap.append($map_overlay); 444 } 445 446 447 var sbar = $('#joMaps-container .joScrollWrap'); 448 if (sbar.length && !mobile) { 449 // new SimpleBar(sbar[0]); 450 sbar.niceScroll({cursorcolor:"rgba(52,102,103,0.5)", zindex:'2000'}); 451 //sbar.each((i, v) => new SimpleBar(v)); 452 } 453 454 $('.sub_btn').click(function() { 455 $(this).toggleClass('active'); 456 $(this).next().toggle(); 457 }); 458 459 $('.navbar-toggler-container').click(function() { 460 $('body').toggleClass('overflow-hidden'); 461 }); 462 463 464 $detail_img = $('.map-image'); 465 if ($detail_img && $detail_img.length == 2) { 466 var imgInterval = []; 467 468 $detail_img.addClass('hideArrows'); 469 470 var $div = $('<div class="img-overlay"><div class="img-overlay-text">Zum Benutzen des Bilder bitte darauf klicken.</div></div>'); 471 472 $div.click(function(e) { 473 //$('.img-overlay').removeClass('hidden'); 474 //$(this).addClass('hidden'); 475 $('.img-overlay').show(); 476 $('.map-image .ol-zoom').fadeOut(); 477 $('.map-image.is-active').removeClass('is-active'); 478 $(this).fadeOut(); 479 480 $('.map-image').each(function(i, v) { 481 var map = $(this).data('map'); 482 483 /* 484 setTimeout(function() { 485 map.updateSize(); 486 map.getLayers().forEach(function(layer) { 487 if(layer instanceof ol.layer.Image) { 488 map.getView().fit(layer.getSource().getImageExtent()); 489 } 490 if(layer instanceof ol.layer.Tile) { 491 map.getView().fit(layer.getSource().getTileGrid().getExtent()); 492 } 493 }); 494 }, 500); 495 */ 496 497 var num = 0; 498 imgInterval[i] = setInterval(function() { 499 map.updateSize(); 500 501 map.getLayers().forEach(function(layer) { 502 if(layer instanceof ol.layer.Image) { 503 map.getView().fit(layer.getSource().getImageExtent(), {padding: [30,30,30,30]}); 504 } 505 if(layer instanceof ol.layer.Tile) { 506 map.getView().fit(layer.getSource().getTileGrid().getExtent(), {padding: [30,30,30,30]}); 507 } 508 }); 509 510 if (num >= 50) { 511 clearInterval(imgInterval[i]); 512 } 513 num++; 514 }, 10); 515 516 }); 517 518 $(this).parent().addClass('is-active').find('.ol-zoom').fadeIn(); 519 }); 520 521 $detail_img.append($div); 522 } 523});
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.