1 2jQuery(document).ready(function ($) { 3 4 5 jQuery(window).on("orientationchange", function () { 6 document.activeElement.blur(); 7 jQuery("input").blur(); 8 jQuery("select").blur(); 9 jQuery("textarea").blur(); 10 }); 11 12 13 //do things that are only reasonable on desktops (non touch clients) 14 if (!Modernizr.touch) { 15 16 //show toltips 17 jQuery('.tooltip').live('mouseover', function () { 18 this.tooltip().show(); 19 }) 20 21 //show toltips 22 jQuery('*[data-quickpage]').mouseover(function () { 23 this.quickpage({onInitShow: true}); 24 }) 25 26 } 27 28 jQuery('#wrapper').append('<img src="/images/placeholder.png" width="620" height="250" class="placeholder" />'); 29 30 31 //move the singles box to the top 32 jQuery('.startpage .singles_box').clone().insertAfter('.startpage .yui-main > .yui-b .slideshow') 33 34 //move the events box to the top 35 jQuery('.startpage .events_box').clone().insertAfter('.startpage .yui-main > .yui-b .slideshow') 36 37 38 39 40 41 //pin the scrollbar to the top instead of scrolling it offscreen 42 var _navBar = jQuery('#navigation'); 43 jQuery(document).on('touchmove scroll', function () { 44 var offset = jQuery(window).scrollTop(); 45 if (offset > 110) { 46 _navBar.addClass('fixedbar'); 47 } else { 48 _navBar.removeClass('fixedbar'); 49 } 50 }) 51 52 53 54 55 if (jQuery(window).width() <= 620) { 56 jQuery("#szene1TopSearch").appendTo("#mobile-navigation"); 57 } 58 59 /** 60 * duplicate the navbar for the mobile navigation 61 * 62 */ 63 var duplicatedNavigation = jQuery("#nav").clone(); 64 duplicatedNavigation.attr('id', 'mobile-nav'); 65 duplicatedNavigation.appendTo(jQuery('#mobile-navigation')); 66 67 68 69 70 /** 71 * if there is a carousel (eg: singles) 72 * adapt the width of the slides on screen resize (also includes orientation changes) 73 */ 74 if (jQuery('#carousel-wrapper').length >= 1 && typeof Singles !== undefined) { 75 $(window).resize(function () { 76 77 var carouselWidth = jQuery('#carousel-wrapper').width(); 78 jQuery('#carousel-wrapper .slide').width(carouselWidth); 79 var current = Singles.carousel.current; 80 Singles.carousel.moveTo(current); 81 }); 82 } 83 84 85 //bugfix load timeline via ajax 86 jQuery('#tab-panel-wall-tabs .wall-tab.active a').click(); 87 88 //show and hide the menu 89 jQuery('#menu-button').click(function (e) { 90 e.preventDefault(); 91 jQuery('body').toggleClass('mobile-navigation-visible'); 92 jQuery("#menu-help-bubble").hide() 93 }) 94 jQuery('#navigation-logo').click(function (e) { 95 e.preventDefault(); 96 jQuery('body').toggleClass('mobile-navigation-visible'); 97 jQuery("#menu-help-bubble").hide() 98 }) 99 100 101 // add a cover layer to close the menu by clicking on th rightside content 102 var closeMenuLayer = jQuery("<div id='closeMenuLayer' style='display: none;'></div>"); 103 closeMenuLayer.appendTo(jQuery('body')); 104 closeMenuLayer.click(function (e) { 105 e.preventDefault(); 106 jQuery('body').toggleClass('mobile-navigation-visible'); 107 }) 108 109 110 111 112 113 jQuery('.vcard .box-dropdown').each(function (index, el) { 114 var _el = jQuery(el); 115 _el.css('overflow', 'hidden'); 116 117 if (el.offsetHeight < el.scrollHeight) { 118 _el.after('<div class="show-more"><a href="#" >Alles anzeigen</a></div>'); 119 jQuery('.show-more').click(function (el) { 120 _el.height('auto'); 121 jQuery('.show-more').hide(); 122 return false; 123 }); 124 } 125 126 127 }) 128 129 130 131 132 133 134 135 jQuery('.expandable').each(function (index, el) { 136 var _el = jQuery(el) 137 var contentBox = _el.children('.expandable-content') 138 var handle = _el.children('.expandable-handle') 139 var label = _el.children('.expandable-label') 140 label.click(function () { 141 jQuery(contentBox).toggle('slow'); 142 _el.toggleClass('open'); 143 }) 144 }) 145 146 147 /* 148 149 // Create the swipe object, and assign the callbacks 150 jQuery('body').swipe({ 151 swipeLeft: function(event, distance, duration, fingerCount) { 152 hideNavigation(); 153 }, 154 swipeRight: function(event, distance, duration, fingerCount) { 155 showNavigation(); 156 }, 157 }) 158 */ 159 160 161 /* 162 * Scroll the navigation with javascript because android < 3 163 * can't handle scolling on divs with overflow 164 */ 165 var ua = navigator.userAgent; 166 if (ua.indexOf("Android") >= 0) 167 { 168 var androidversion = parseFloat(ua.slice(ua.indexOf("Android") + 8)); 169 if (androidversion < 3.0) 170 { 171 touchScroll($('.mobile-navigation')) 172 } 173 } 174 175 176 177 if (jQuery(window).width() <= 620) { 178 //show menu helper 179 var menuHelperClicked = jQuery.cookie('menuHelperClicked'); 180 if (!menuHelperClicked) {
181 var timesMenuHelperSeen = parseInt(jQuery.cookie('menuHelperSeenXTimes')); 182 if (!timesMenuHelperSeen) 183 timesMenuHelperSeen = 1; 184 if (timesMenuHelperSeen < 3) { 185 jQuery.cookie('menuHelperSeenXTimes', timesMenuHelperSeen + 1, {expires: 1, path: '/'}); 186 jQuery("#menu-help-bubble").show().delay(10000).fadeOut('slow'); 187 } 188 jQuery("#menu-help-bubble .close-button").click(function () { 189 jQuery.cookie('menuHelperClicked', 1, {expires: 365, path: '/'}); 190 jQuery("#menu-help-bubble").hide(); 191 return false; 192 }); 193 } 194 } 195 196 197 198 199 if (jQuery(window).width() <= 980) { 200 jQuery('#responsive-toggle').show(); 201 } 202 203 jQuery('#responsive-toggle .desktop-link').click(function (event) { 204 jQuery.cookie('disableResponsive', 1, {expires: 365, path: '/'}); 205 event.preventDefault(); 206 location.reload(true); 207 return false; 208 }); 209 210 211 jQuery('#responsive-toggle .mobile-link').click(function (event) { 212 jQuery.cookie('disableResponsive', 0, {expires: 365, path: '/'}); 213 event.preventDefault(); 214 location.reload(true); 215 return false; 216 }); 217 218 /** 219 * some photos need a timeout? 220 * 221 */ 222 setTimeout(function () { 223 jQuery('img.lazy-load').unveil(300); 224 }, 400); 225 226 jQuery('img.lazy-load').unveil(300); 227 228 229 230 231 232 var scroller = jQuery('.location-images '); 233 if (scroller.length > 0) { 234 scroller.find('img').load(function () { 235 if (typeof scroller.updateButtons !== 'undefined') { 236 scroller.updateButtons(); 237 } 238 }); 239 240 241 242 var scrollWrapper = scroller.find('#scroller'); 243 ; 244 var scrollPane = scroller.find('ul'); 245 var prev = scroller.find('.prev'); 246 var next = scroller.find('.next'); 247 scrollWrapper.scrollLeft(0); 248 scroller.page = 0; 249 scroller.stops = []; 250 251 scroller.gotoNextPage = function (page) { 252 var width = scrollWrapper.width(); 253 var scrollX = scrollWrapper.scrollLeft(); 254 255 scroller.stops.push(scrollX); 256 257 258 259 var firstObscuredElement = null; 260 scrollPane.find('li').each(function (index) { 261 if (firstObscuredElement === null) { 262 var image = jQuery(this); 263 var offsetOfRightEdge = image.position().left + image.width(); 264 if (offsetOfRightEdge > (width)) { 265 firstObscuredElement = image; 266 } 267 } 268 269 }); 270 if (firstObscuredElement) { 271 272 var scrollPX = firstObscuredElement.position().left + scrollX; 273 //scrollWrapper.scrollLeft(firstObscuredElement.position().left + scrollX); 274 275 scrollWrapper.animate({scrollLeft: scrollPX}, 1000, 'swing', scroller.updateButtons); 276 277 278 } 279 280 scroller.updateButtons() 281 } 282 283 scroller.gotoPrevPage = function (page) { 284 285 var lastStop = scroller.stops.pop(); 286 if (lastStop) { 287 scrollWrapper.animate({scrollLeft: lastStop}, 1000, 'swing', scroller.updateButtons); 288 //scrollWrapper.scrollLeft(lastStop); 289 } else { 290 scroller.stops = []; 291 //scrollWrapper.scrollLeft(0); 292 scrollWrapper.animate({scrollLeft: 0}, 1000, 'swing', scroller.updateButtons); 293 } 294 295 //scroller.updateButtons() 296 } 297 298 scroller.updateButtons = function () { 299 300 var mayScrollLeft = (scrollWrapper.scrollLeft() >= 5); 301 302 var mayScrollRight = false; 303 304 var lastImage = scrollPane.find('li:last-child') 305 var rightEdge = lastImage.width() + lastImage.position().left; 306 307 mayScrollRight = rightEdge > (scrollWrapper.width() + 15); 308 309 310 if (mayScrollLeft) { 311 prev.show(); 312 } else { 313 prev.hide(); 314 } 315 316 if (mayScrollRight) { 317 next.show(); 318 } else { 319 next.hide(); 320 } 321 } 322 next.click(function () { 323 scroller.gotoNextPage() 324 }) 325 prev.click(function () { 326 scroller.gotoPrevPage() 327 }) 328 329 330 331 scroller.updateButtons() 332 333 } 334 335 336}); 337 338 339 340 341function touchScroll(selector) { 342 var scrollStartPos = 0; 343 $(selector).live('touchstart', function (event) { 344 //event.preventDefault(); 345 scrollStartPos = this.scrollTop + event.originalEvent.touches[0].pageY; 346 }); 347 $(selector).live('touchmove', function (event) { 348 event.preventDefault(); 349 this.scrollTop = scrollStartPos - event.originalEvent.touches[0].pageY; 350 }); 351 352} 353 354 355 356
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.