1/* 2 * vmf - vioma mobility framework 3 * some parts from jQTouch, thx to David Kaneda 4 */ 5document.write = function( data ){ 6 var data = jQuery( data ), 7 content = data.find( ':not(script[src])' ), 8 scripts = data.find( 'script[src]' ); 9 10 jQuery( '<div class="hidden write_helper" />' ) 11 .html( content ) 12 .appendTo( 'body:first' ); 13} 14 15var vmf = function(){}; 16 17vmf.anchor_get = function( anchor ) { 18 var hash = anchor || window.location.hash; 19 20 if ( hash.indexOf( ';' ) != -1 ) { 21 hash = hash.substring( 0, hash.indexOf( ';' ) ); 22 } 23 24 hash = hash.split(',')[0]; 25 26 return hash; 27} 28 29vmf.position = false; 30vmf.history = [ '#menu' ]; 31vmf.settings = {}; 32vmf.site_settings = {}; 33vmf.backward = false; 34vmf.effect = 'slide'; 35vmf.anchor = vmf.anchor_get(); 36vmf.anchor_full = window.location.hash; 37vmf.map_markers = []; 38vmf.click_counter = 0; 39 40vmf.iphone = RegExp("iPhone").test(navigator.userAgent); 41vmf.ipad = vmf.iphone ? false : RegExp("iPad").test(navigator.userAgent); 42vmf.ios = { is: false }; 43 44if ( vmf.ipad || vmf.iphone ) { 45 vmf.ios.is = true; 46 vmf.ios.name = vmf.ipad || vmf.iphone; 47 vmf.ios.version = navigator.userAgent.match( /OS ([0-9])/ )[1]; 48} 49 50vmf.mobile = vmf.ios.is || RegExp(" Mobile/").test(navigator.userAgent); 51vmf.bookmarked = vmf.ios.is ? window.navigator.standalone : true; 52 53/* fix wrong tao_capmaign-parameters.. 54 * original: http://m.wellnesshotel.com/?gclid=CL3Qkfa6uKMCFRArDgod8Dx2bA#page-100009/?tao_campaign=ck5k9u2at5 55 * rewritten: http://m.wellnesshotel.com/?gclid=CL3Qkfa6uKMCFRArDgod8Dx2bA&tao_campaign=ck5k9u2at5#page-100009 56 */ 57if ( vmf.anchor.indexOf( '/' ) != -1 ) { 58 var uri_pathname = window.location.pathname, 59 uri_search = window.location.search, 60 anchor = vmf.anchor.substring( 0, vmf.anchor.indexOf( '/' ) ), 61 anchor_search = uri_search == '' ? '?' : '&' + vmf.anchor.substring( vmf.anchor.indexOf( '/' ) + 2 ); 62 63 window.location = uri_pathname + uri_search + anchor_search + anchor; 64} 65 66vmf.random = function( min, max ){ 67 if( min > max ) return( -1 ); 68 if( min == max ) return( min ); 69 70 return( min + parseInt( Math.random() * ( max - min + 1 ) ) ); 71} 72 73vmf.init = function( options ){ 74 if ( options ) { 75 vmf.settings = jQuery.extend( true, vmf.settings, options ); 76 } 77 78 vmf.head = jQuery( 'head:first' ); 79 vmf.body = jQuery( 'body:first' ); 80 81 if ( vmf.anchor.length < 2 ) { 82 window.location.hash = 'menu'; 83 } 84 85 if ( vmf.anchor != '#menu' ) { 86 vmf.site_init( jQuery( '#menu' ) ); 87 vmf.site_settings_init( '#menu' ); 88 } 89 90 vmf.body 91 .bind('orientationchange', vmf.orientation_update) 92 .trigger('orientationchange'); 93 94 if ( typeof vjg2 && !(vmf.ios.is && vmf.ios.version < 5 ) ) { 95 jQuery.each( vjg2.insts, function( i, inst ){ 96 if ( inst.mode == 'background' ) { 97 vmf.body.addClass( 'fixed' ); 98 jQuery( '.main', vmf.body ).height( jQuery( window ).height() ); 99 return false; 100 } 101 }); 102 } 103 104 vmf.hash_init(); 105 vmf.orientation_update(); 106 vmf.goto_site_current(); 107 vmf.site_init(); 108 vmf.site_settings_init( vmf.anchor ); 109 vmf.watcher_start(); 110 111 window.setTimeout(function(){ 112 vmf.scroll(); 113 }, 500 ); 114} 115 116vmf.bookmark_info_show = function(){ 117 if ( vmf.bookmarked || !vmf.ios.is ) return false; 118 119 vmf.bookmarked = true; 120 121 window.setTimeout(function(){ 122 var layer = jQuery('#bookmark_info_wrapper'), 123 top = layer.css('top'); 124 125 layer 126 .css({ 127 top: vmf.ipad ? -200 : 500 128 }) 129 .removeAttr( 'class' ) 130 .animate({ top: top }, { duration: 500, complete: function(){ 131 layer.removeAttr( 'style' ) 132 133 jQuery( '#bookmark_info_close' ).bind( 'click', function(){ 134 jQuery('#bookmark_info_wrapper' ).remove(); 135 }); 136 }}); 137 }, 1000 ); 138} 139 140vmf.scroll = function( selector ){ 141 var scrollTop = 0; 142 143 if ( typeof selector == 'number' ) { 144 scrollTop = selector; 145 } 146 else if ( typeof selector != 'undefined' ) { 147 scrollTop = jQuery( selector ).offset().top; 148 } 149 150 window.setTimeout(function(){ 151 window.scrollTo( 0, scrollTop ); 152 }, 1); 153} 154 155vmf.goto_site_before = function() { 156 var hash = '#menu'; 157 vmf.backward = true; 158 159 if ( vmf.history.length > 2 ) { 160 vmf.history.pop(); 161 162 if ( vmf.history.length > 1 ) { 163 vmf.anchor_before = vmf.history[ vmf.history.length - 1 ]; 164 vmf.anchor_before_full = vmf.anchor_get( vmf.anchor_before ); 165 } 166 167 window.history.go( -1 ); 168 } 169 else { 170 hash = vmf.anchor_fallback || hash; 171 window.location.hash = hash; 172 } 173} 174 175vmf.hash_init = function(){ 176 // beim reload wieder auf die buchungsstrecke 177 if( vmf.cst_book_hash_check() ){ 178 window.location.hash = '#book' 179 } 180} 181
182vmf.cst_book_hash_check = function(){ 183 if( vmf.anchor.indexOf('cst-book-') != -1 || vmf.anchor.indexOf('cst-dbox-') != -1 ){ 184 return true; 185 } else { 186 return false; 187 } 188} 189 190vmf.goto_site_current = function() { 191 if( !vmf.anchor || vmf.cst_book_hash_check() ) return false; 192 193 if ( vmf.site_current ) { 194 jQuery( window ).trigger( 'unload.vmf' ); 195 } 196 197 vmf.site_create(function( site ){ 198 vmf.site_before = vmf.site_current; 199 vmf.site_current = site; 200 201 if ( !vmf.backward && vmf.history[ vmf.history.length - 1 ] != vmf.anchor_full ) { 202 vmf.history.push( vmf.anchor_full ); 203 } 204 205 var effect = vmf.site_settings[ vmf.anchor_full ] ? vmf.site_settings[ vmf.anchor_full ].effect : vmf.effect; 206 207 if ( vmf.backward && vmf.anchor_before && vmf.site_settings[ vmf.anchor_before_full ] ) { 208 effect = vmf.site_settings[ vmf.anchor_before_full ].effect; 209 } 210 211 if ( vmf.anchor != vmf.anchor_before ) { 212 if ( vmf.site_before && vmf.site_before[0] ) { 213 var callback = function(){ 214 vmf.site_before 215 .removeClass('current out reverse ' + effect) 216 .trigger('pageAnimationEnd', { 217 direction: 'out' 218 }) 219 .find( 'li.active' ) 220 .removeClass( 'load' ); 221 222 vmf.site_current 223 .addClass('current') 224 .removeClass('in reverse ' + effect) 225 .trigger('pageAnimationEnd', { 226 direction: 'in' 227 }) 228 .find( '~ .current' ) 229 .removeClass( 'current' ) 230 .end() 231 .find( 'li.active' ) 232 .removeClass( 'active' ); 233 }; 234 235 vmf.site_before.trigger('pageAnimationStart', { 236 direction: 'out' 237 }); 238 239 vmf.site_current.trigger('pageAnimationStart', { 240 direction: 'in' 241 }); 242 243 if (vmf.site_before[0] && jQuery.support.WebKitAnimationEvent) { 244 vmf.site_current 245 .one('webkitAnimationEnd', callback) 246 .addClass(effect + ' in current ' + (vmf.backward ? ' reverse' : '')); 247 248 vmf.site_before.addClass(effect + ' out' + (vmf.backward ? ' reverse' : '')); 249 } 250 else { 251 callback(); 252 } 253 } 254 else { 255 vmf.site_current.addClass( 'current' ); 256 } 257 258 jQuery( window ).trigger( 'load.vmf' ); 259 } 260 261 vmf.backward = false; 262 vmf.scroll(); 263 }); 264} 265 266vmf.site_load = function ( fn ) { 267 var container = jQuery( vmf.anchor_get() ); 268 vmf.anchor_fallback = undefined; 269 270 if ( vmf.anchor_before == vmf.anchor || vmf.anchor != vmf.anchor_full || container.attr('cacheable') != 'true' ) { 271 jQuery.ajax({ 272 url: vmf.uri_generate( vmf.anchor_full ), 273 dataType: 'html', 274 dataFilter: jQuery_ajaxSetup_dataFilter, 275 success: function(response){ 276 container 277 .attr('cacheable', response.result.find('input[type="hidden"][name="cacheable"]').remove().val() || 'true') 278 .empty() 279 .append( response.result.html() ); 280 281 vmf.site_init( container ); 282 vmf.site_settings_init( vmf.anchor_full, 'loaded:true' ); 283 284 if ( container.find( '#gallery' )[ 0 ] ) { 285 vmf.gallery( container ); 286 } 287 288 vmf.head.append( response.sources ); 289 290 window.setTimeout(function(){ 291 this.fn( this.container ); 292 }.bind({fn:fn,container:container}), 250 ); 293 }, 294 error: function(XMLHttpRequest, textStatus, errorThrown){ 295 console.log(XMLHttpRequest, textStatus, errorThrown); 296 } 297 }); 298 299 return true; 300 } 301 else { 302 fn( container ); 303 } 304 305 return false; 306} 307 308vmf.site_create = function ( fn ) { 309 var container = jQuery( vmf.anchor_get() ); 310 311 if ( !container[0] ) { 312 container = jQuery( 'body > div.main:first' ) 313 .clone() 314 .empty() 315 .attr( 'class', 'main' ) 316 .attr( 'id', vmf.anchor_get().substr( 1 ) ) 317 .attr( 'cacheable', 'false' ) 318 .appendTo( vmf.body ); 319 } 320 321 vmf.site_load( fn ); 322} 323 324vmf.site_init = function ( parent ) { 325 if ( !parent ) parent = parent || vmf.body.children( vmf.anchor ); 326 327 vmf.forms_init( parent ); 328 329 jQuery( 'a', parent ) 330 .bind( 'click', function( event ){ 331 if ( typeof tao_event_click == 'function' ) { 332 tao_event_click( event ); 333 } 334 // telefon tracking.. 335 if ( typeof goog_report_conversion == 'function' && this.href && this.href.substr( 0, 4 ) == 'tel:' ) { 336 goog_report_conversion( this.href ); 337 } 338 }) 339 .filter( '[href^="http"]' ) 340 .attr( 'target', '_blank' ) 341 .end() 342 .filter( ':not([href^="http"])' ) 343 .removeAttr( 'target' ) 344 .filter( '[href^="/"]' ) 345 .each(function(){ 346 var link = jQuery( this ); 347 348 if ( link.parent().hasClass( 'languages' ) ) { 349 return true; 350 } 351 352 link 353 .attr( 'onclick', 'this.href=\'' + vmf.settings.external_link_prefix + link.attr( 'href' ) + '\'' ) 354 .attr( 'target', '_blank' ); 355 }) 356 .end() 357 .filter( '.back' ) 358 .click(function(){ 359 vmf.goto_site_before(); 360 return false;
361 }) 362 .end() 363 .filter( '.toolbar_link' ) 364 .each(function(){ 365 var link = jQuery( this ), 366 href = link.attr( 'href' ); 367 368 if ( href.substring( 0, 2 ) == '#%' ) { 369 link.attr( 'href', vmf.anchor + href.substring( href.indexOf( ';' ) ) ); 370 } 371 372 link 373 .attr( 'class', 'button' ) 374 .appendTo( vmf.body.children( vmf.anchor ).children( '.toolbar' ) ); 375 }) 376 .end() 377 .filter( '[href^="#"][href!="#"]' ) 378 .each(function(){ 379 var link = jQuery( this ); 380 381 vmf.site_settings_init( link.attr('href'), link.attr( 'rel' ) ); 382 }) 383 .filter(function(){ 384 return this.parentNode.tagName == 'LI'; 385 }) 386 .bind( 'click', function(){ 387 var link = jQuery( this ), 388 li = link.parent(); 389 390 if ( vmf.site_settings[ link.attr( 'href' ) ] && !vmf.site_settings[ link.attr( 'href' ) ].loaded ) { 391 li 392 .addClass( 'active load' ) 393 .append( '<div class="site_loading"><div class="bar1"></div><div class="bar2"></div><div class="bar3"></div><div class="bar4"></div><div class="bar5"></div><div class="bar6"></div><div class="bar7"></div><div class="bar8"></div><div class="bar9"></div><div class="bar10"></div><div class="bar11"></div><div class="bar12"></div></div>' ); 394 } 395 else { 396 li.addClass( 'active' ); 397 } 398 399 vmf.click_counter++; 400 }); 401 402 if ( vmf.click_counter == 4 ) { 403 vmf.bookmark_info_show(); 404 } 405} 406 407vmf.site_settings_init = function( name, options ) { 408 var site_settings = {}, 409 tmp = {}, 410 site_settings_default = { 411 effect: 'slide' 412 }; 413 414 if ( !options ) { 415 tmp = { 416 href: options, 417 effect: vmf.effect 418 }; 419 } 420 else if( options.indexOf( ':' ) != -1 ) { 421 var parts = options.split( ';' ) || [ options ], 422 length = parts.length; 423 424 for( var i = 0; i < length; i++ ) { 425 var cur = parts[i].split( ':' ); 426 427 if ( !cur[0] || !cur[1] ) continue; 428 429 cur[0] = cur[0].replace(/^\s+/, '').replace(/\s+$/, ''); 430 cur[1] = cur[1].replace(/^\s+/, '').replace(/\s+$/, ''); 431 432 tmp[cur[0]] = cur[1]; 433 } 434 } 435 436 if ( tmp.href && tmp.href.indexOf( '/' ) != -1 ) { 437 var parts = tmp.href.split( '/' ); 438 tmp.href = parts[parts.length-1]; 439 } 440 441 if ( vmf.site_settings[ name ] ) { 442 vmf.site_settings[ name ] = jQuery.extend( true, vmf.site_settings[ name ], tmp ); 443 } 444 else { 445 vmf.site_settings[ name ] = jQuery.extend( true, site_settings_default, tmp ); 446 } 447} 448 449vmf.watcher_start = function () { 450 vmf.watcher_timer = setInterval(function() { 451 /* check if the anchor has changed */ 452 if ( !window.location.hash || window.location.hash == '#' ) { 453 window.location.hash = '#menu'; 454 } 455 456 if ( vmf.anchor_full != window.location.hash ) { 457 vmf.anchor_before = vmf.anchor; 458 vmf.anchor_before_full = vmf.anchor_full; 459 vmf.anchor_full = window.location.hash; 460 vmf.anchor = vmf.anchor_get(); 461 462 if ( vmf.history.length > 1 && vmf.history[ vmf.history.length - 2 ] && vmf.history[ vmf.history.length - 2 ] == vmf.anchor_full ) { 463 vmf.backward = true; 464 vmf.history.pop(); 465 } 466 467 vmf.goto_site_current(); 468 } 469 }, 100 ); 470}; 471 472vmf.uri_generate = function( anchor, container ){ 473 var uri = '', 474 url_param = ''; 475 476 if ( anchor.indexOf( ';' ) != -1 ) { 477 var parts = anchor.split( ';' ), 478 special = parts[1]; 479 480 anchor = parts[0]; 481 } 482 483 if( anchor.indexOf( ',' ) != -1 ){ 484 param_split = anchor.split( ',' ); 485 anchor = param_split[0] 486 url_param = param_split[1]; 487 } 488 489 var type = anchor.substring( 1 ); 490 491 if ( anchor.indexOf( '-' ) != -1 ) { 492 anchor = anchor.split( '-' ); 493 type = anchor[0].substring( 1 ); 494 } 495 496 switch( type ) { 497 case 'page': 498 uri = '/(cms)/module/pass/3/redir-page/' + anchor[1] + '/?cms_redir_options=' + escape( url_param ).replace(/=/, '%3D'); 499 break; 500 501 case 'struct': 502 // adler thermae: qr-codes fuer diese struct umleiten 503 if ( anchor[1] == 72300 ) { 504 anchor[1] = 72811; 505 } 506 507 uri = '/(cms)/module/pass/3/redir-struct/' + anchor[1] + '/' + vmf.settings.language + '/?cms_redir_options=' + escape( url_param ).replace(/=/, '%3D'); 508 break; 509 510 default: 511 uri = '/' + vmf.settings.language + '/cst-mobile/'; 512 break; 513 } 514 515 switch( special || type ) { 516 case 'hotel': 517 uri += 'hotel-detail.php?id=' + anchor[1]; 518 break; 519 520 case 'hotels': 521 uri += 'hotel-list.php?sys_layout=full'; 522 break; 523 524 case 'hotelmap': 525 uri += 'hotel-list.php?cms_redir_options=sys_layout=small'; 526 break; 527 528 case 'roomtype':
529 uri += 'room-type-detail.php?id=' + anchor[1]; 530 break; 531 532 case 'roomtypes': 533 uri += 'hotel-room-list.php'; 534 535 if ( anchor[1] ) { 536 uri += '?hotel=' + anchor[1]; 537 } 538 break; 539 540 case 'roomtype_groups': 541 uri += 'hotel-room-list.php'; 542 543 if ( anchor[1] ) { 544 uri += '?c[id_list_room_groups]=' + [ anchor[1], url_param ].join(); 545 } 546 break; 547 548 case 'package': 549 uri += 'offer-detail.php?id=' + anchor[1]; 550 break; 551 552 case 'packages': 553 uri += 'offer-list.php'; 554 555 if ( anchor[1] ) { 556 uri += '?c[ids_hotels][]=' + anchor[1]; 557 } 558 break; 559 560 case 'package_indicators': 561 uri += 'offer-list.php'; 562 563 if ( anchor[1] ) { 564 uri += '?c[id_list_package_indicators]=' + [ anchor[1], url_param ].join(); 565 } 566 break; 567 568 case 'routing': 569 uri += 'hotel-detail-routing.php'; 570 571 if ( anchor[1] ) { 572 uri += '?id=' + anchor[1]; 573 } 574 break; 575 576 case 'agb': 577 uri += 'hotel-detail-agb.php'; 578 579 if ( anchor[1] ) { 580 uri += '?id=' + anchor[1]; 581 } 582 break; 583 584 case 'gallery': 585 uri += 'hotel-detail-gallery-list.php?hotel=' + anchor[1]; 586 break; 587 588 case 'request': 589 var settings = vmf.site_settings[anchor]; 590 if (settings && settings.href) { 591 uri += '' + settings.href; 592 } 593 else { 594 uri += 'request.php?page=5.page1'; 595 } 596 break; 597 598 case 'book': 599 uri += 'search.php?c[mode]=mobile&' + url_param; 600 //window.location.hash = 'cst-book-10'; 601 break; 602 603 default: 604 var settings = vmf.site_settings[anchor]; 605 if (settings) { 606 uri = settings.href; 607 } 608 break; 609 } 610 611 /* when no uri can be specified go to menu */ 612 if ( !uri.length ) { 613 window.location.hash = '#menu'; 614 return false; 615 } 616 617 uri += ( uri.indexOf( '?' ) == -1 ? '?' : ( uri.substring( uri.length - 1 ) == '&' ? '' : '&') ) + 'lang=' + vmf.settings.language + '&set_language=' + vmf.settings.language; 618 uri = location.protocol + '//' + location.hostname + uri; 619 620 return uri; 621} 622 623vmf.datepicker = function ( element, fn ) { 624 if ( !element ) return false; 625 626 element = jQuery( element ); 627 628 if ( jQuery( element ).attr( 'vmf_datepicker' ) == 'open' ) return false; 629 630 element.attr( 'vmf_datepicker', 'open' ); 631 632 var selections = []; 633 var now = new Date(); 634 var days = [ '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31' ]; 635 var months = [ '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12' ]; 636 var years = []; 637 638 for( i = now.getFullYear(); i <= now.getFullYear()+2; i++ ) { 639 years[i] = i; 640 } 641 642 if ( element.val().length > 0 ) { 643 selections = element.val().split( '.' ); 644 } 645 646 if ( selections.length != 3 ) { 647 selections = [ now.getDate(), now.getMonth() + 1, now.getFullYear() ] ; 648 } 649 650 SpinningWheel.addSlot( days, 'right', selections[0] ); 651 SpinningWheel.addSlot( months, 'right', selections[1] ); 652 SpinningWheel.addSlot( years, 'right', selections[2] ); 653 654 SpinningWheel.setCancelAction(function(){ 655 element.removeAttr( 'vmf_datepicker' ); 656 }); 657 658 SpinningWheel.setDoneAction(function(){ 659 element.removeAttr( 'vmf_datepicker' ); 660 element.val( SpinningWheel.getSelectedValues().values.join('.') ); 661 662 if ( fn ) fn(); 663 }); 664 665 SpinningWheel.open(); 666}; 667 668vmf.forms_init = function( parent ) { 669 jQuery( 'form:not([rel="ajax:no"])', parent ).bind( 'submit', function(){ 670 vmf.form_submit( this ); 671 return false 672 }); 673} 674 675vmf.form_data_get = function ( form ) { 676 var params = {}; 677 678 form 679 .find( 'input[type="submit"]' ) 680 .attr( 'disabled', true ) 681 .end() 682 .find( 'input:checked, input[type="text"], input[type="hidden"], input[type="password"], input[type="submit"], option:selected, textarea' ) 683 .each(function() { 684 var name = this.name || this.id || this.parentNode.name || this.parentNode.id; 685 686 if( name.substr( -2 ) == '[]' ) { 687 name = name.substr( 0, name.length - 2 ); 688 689 if ( !( name in params ) ) { 690 params[ name ] = []; 691 } 692 } 693 694 if ( params[ name ] instanceof Array ) { 695 params[ name ].push( this.value ); 696 } 697 else { 698 params[ name ] = this.value; 699 } 700 }); 701 702 return params; 703}; 704 705vmf.form_submit = function ( form ) { 706 if ( !form ) return false;
707 708 form = jQuery( form ); 709 710 if ( form.is( ':not(form)' ) ) { 711 form = jQuery( form ).parents( 'form:first' ); 712 } 713 714 if ( form.attr( 'target' ) == '_blank' ) { 715 form.submit(); 716 return true; 717 }; 718 719 var params = vmf.form_data_get( form ); 720 721 jQuery.ajax({ 722 type: form.attr( 'method' ).toUpperCase() ||Â 'POST', 723 dataType: 'html', 724 dataFilter: jQuery_ajaxSetup_dataFilter, 725 url: form.attr( 'action' ), 726 data: params, 727 complete: function(){ 728 scrollTo(0,0); 729 }, 730 success: function( response ){ 731 var parent = jQuery( vmf.anchor ) 732 .attr('cacheable', response.result.find('input[type="hidden"][name="cacheable"]').remove().val() || 'true') 733 .empty() 734 .append( response.result.children() ); 735 736 jQuery( 'head' ).prepend( response.sources ); 737 738 vmf.forms_init( parent ); 739 }, 740 error: function( XMLHttpRequest, textStatus, errorThrown ) { 741 console.log( XMLHttpRequest, textStatus, errorThrown ); 742 } 743 }); 744}; 745 746vmf.geo_location_get = function( fn ){ 747 navigator.geolocation.getCurrentPosition( 748 function( position ){ 749 vmf.position = { 750 latitude: position.coords.latitude, 751 longitude: position.coords.longitude 752 }; 753 754 if ( fn ) fn(); 755 }, 756 function(){ 757 vmf.position = 'forbidden'; 758 759 if ( fn ) fn(); 760 } 761 ); 762}; 763 764vmf.geo_location_insert = function( element, fn ){ 765 if ( !element ) return false; 766 767 vmf.geo_location_get(function(){ 768 jQuery( element ).val( vmf.position.latitude + ', ' + vmf.position.longitude ); 769 if ( fn ) fn(); 770 }); 771} 772 773vmf.orientation_update = function() { 774 vmf.orientation = Math.abs( window.orientation ) == 90 ? 'landscape' : 'profile'; 775 776 var classname = vmf.orientation + ' ' + vmf.settings.language; 777 778 if( vmf.ipad ) { 779 classname += ' ipad'; 780 } 781 782 vmf.body 783 .removeClass('profile landscape ipad') 784 .addClass( classname ) 785 786 vmf.scroll(); 787} 788 789vmf.gallery = function( container ){ 790 if ( !container[ 0 ] ) return; 791 792 vmf.gallery_holder = container.find( '#gallery-image-holder' ); 793 vmf.gallery_items = container.find( '#gallery' ).find( 'img' ); 794 795 if ( !vmf.gallery_holder[0] ) return; 796 797 vmf.gallery_holder 798 .find( 'img' ) 799 .click(function(){ 800 vmf.gallery_item_show( 'next' ); 801 }); 802 803 vmf.gallery_items.click(function(){ 804 vmf.gallery_item_show( vmf.gallery_items.index( this ) ); 805 }); 806} 807 808vmf.gallery_item_show = function( index ){ 809 switch( index ) { 810 case 'next': 811 index = vmf.gallery_items.index( vmf.gallery_items.filter( '.active:first' ) ); 812 index = index < vmf.gallery_items.length - 1 ? ++index : 0; 813 break; 814 815 case 'prev': 816 index = vmf.gallery_items.index( vmf.gallery_items.filter( '.active:first' ) ); 817 index = index > 0 ? --index : vmf.gallery_items.length - 1; 818 break; 819 } 820 821 var element = vmf.gallery_items 822 .removeClass( 'active' ) 823 .removeAttr( 'style' ) 824 .eq( index ) 825 .addClass( 'active' ); 826 827 vmf.gallery_holder 828 .show() 829 .find( 'img:first' ) 830 .attr( 'src', element.attr( 'rel' ) || element.attr('src') ); 831 832 vmf.scroll( vmf.gallery_holder ); 833} 834 835vmf.map_init = function( options ){ 836 // http://code.google.com/intl/de-DE/apis/maps/documentation/javascript/overlays.html#SimpleIcons 837 if ( typeof google == 'undefined' ) { 838 window.setTimeout(function(){ 839 vmf.map_init( this ); 840 }.bind( options ), 250 ); 841 } 842 else { 843 window.setTimeout(function(){ 844 vmf.map = new google.maps.Map( 845 document.getElementById( 'map_canvas' ), 846 { 847 zoom: vmf.ipad ? 8 : 6, 848 center: new google.maps.LatLng( options.lat, options.lng ), 849 disableDefaultUI: true, 850 scaleControl: false, 851 mapTypeControl: false, 852 navigationControl: true, 853 navigationControlOptions: { 854 style: google.maps.NavigationControlStyle.SMALL 855 } 856 } 857 ); 858 var open = vmf.random( 0, vmf.map_markers.length - 1 ), 859 mapType = new google.maps.StyledMapType( 860 vmf.map_style(), 861 { 862 map: vmf.map, 863 name: "Mobile" 864 } 865 ); 866 867 vmf.map.mapTypes.set('vmf', mapType); 868 vmf.map.setMapTypeId('vmf'); 869 vmf.map_marker = { 870 image: new google.maps.MarkerImage( '/%28cms%29/module/static/default/content/libs/js/vmf/google_maps_icon.png', 871 new google.maps.Size(20, 23), 872 new google.maps.Point(0,0), 873 new google.maps.Point(0, 23) 874 ), 875 shadow: new google.maps.MarkerImage('/%28cms%29/module/static/default/content/libs/js/vmf/google_maps_icon_shadow.png', 876 new google.maps.Size(32, 23), 877 new google.maps.Point(0,0), 878 new google.maps.Point(0, 23) 879 ), 880 shape: { 881 coord: [1, 1, 1, 20, 18, 20, 18 , 1], 882 type: 'poly' 883 } 884 }; 885 886 for( var i in vmf.map_markers ) { 887 vmf.map_markers[i] = vmf.map_mark( vmf.map_markers[i] ); 888 889 if ( i == open ) { 890 vmf.map_markers[i].infowindow.open( vmf.map, vmf.map_markers[i].marker ); 891 } 892 } 893 }, 250 ); 894 } 895} 896 897vmf.map_mark = function( item ){ 898 if ( item.infowindow && item.marker ) return item; 899 900 var infowindow = new google.maps.InfoWindow({ 901 content: document.getElementById( item.details ).innerHTML 902 }), 903 marker = new google.maps.Marker({ 904 position: new google.maps.LatLng( item.lat, item.lng ), 905 map: vmf.map, 906 title: item.title, 907 icon: vmf.map_marker.image, 908 shadow: vmf.map_marker.shadow, 909 shape: vmf.map_marker.shape 910 }); 911 912 google.maps.event.addListener(marker, 'click', function() { 913 for( var i in vmf.map_markers ) { 914 vmf.map_markers[i].infowindow.close( vmf.map, vmf.map_markers[i].marker ); 915 } 916 917 infowindow.open( vmf.map, marker ); 918 }); 919 920 return { 921 marker: marker, 922 infowindow: infowindow 923 }; 924} 925 926vmf.map_style = function(){ 927 return [ 928 { 929 featureType: "administrative.neighborhood", 930 elementType: "all", 931 stylers: [ 932 { saturation: -91 }, 933 { visibility: "on" } 934 ] 935 },{ 936 featureType: "landscape", 937 elementType: "all", 938 stylers: [ 939 { saturation: -97 }, 940 { visibility: "off" } 941 ] 942 },{ 943 featureType: "poi", 944 elementType: "all", 945 stylers: [ 946 { saturation: -98 }, 947 { visibility: "off" } 948 ] 949 },{ 950 featureType: "road", 951 elementType: "all", 952 stylers: [ 953 { saturation: -97 }, 954 { hue: "#0800ff" }, 955 { visibility: "off" } 956 ] 957 },{ 958 featureType: "transit", 959 elementType: "all", 960 stylers: [ 961 { saturation: -99 } 962 ] 963 },{ 964 featureType: "water", 965 elementType: "all", 966 stylers: [ 967 968 ] 969 },{ 970 featureType: "administrative.neighborhood", 971 elementType: "all", 972 stylers: [ 973 { visibility: "off" } 974 ] 975 },{ 976 featureType: "administrative.province", 977 elementType: "all", 978 stylers: [ 979 { visibility: "off" } 980 ] 981 },{ 982 featureType: "administrative.locality", 983 elementType: "all", 984 stylers: [ 985 { visibility: "on" } 986 ] 987 },{ 988 featureType: "administrative.land_parcel", 989 elementType: "all", 990 stylers: [ 991 { visibility: "off" } 992 ] 993 },{ 994 featureType: "water", 995 elementType: "all", 996 stylers: [ 997 998 ] 999 } 1000 ]; 1001} 1002 1003jQuery.support.WebKitCSSMatrix = (typeof WebKitCSSMatrix == "object"); 1004jQuery.support.WebKitAnimationEvent = (typeof WebKitTransitionEvent == "object"); 1005 1006function jQuery_ajaxSetup_dataFilter( rawdata ){ 1007 var response = jQuery( rawdata ), 1008 result = [], 1009 sources = []; 1010 1011 jQuery.each( response, function(k,v){ 1012 if ( typeof v.tagName == 'undefined' ) { 1013 delete response[k]; 1014 }
1015 else if ( ( v.tagName == 'SCRIPT' || v.tagName == 'LINK' ) && v.getAttribute( 'rev' ) != 'ignore' ) { 1016 sources.push( v ); 1017 delete response[k]; 1018 } 1019 else if ( v.tagName == 'DIV' ) { 1020 result.push( v ); 1021 } 1022 }); 1023 1024 return { result: jQuery( result ), sources: sources }; 1025}
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.