$(document).ready(function() { ///////////////////////////////////////////////////////////////////////// // Der Suche eine Reihe von Suchfeldern hinzufügen ///////////////////////////////////////////////////////////////////////// $('.addSearchFieldsRow').live('click', function() { var xthis = this; if ( $('.addSearchFieldsRow').length <= 10) { // die Zeile clonen var newTr = $(xthis).parent().parent().clone(); // im geclonten die Felder zurücksetzen $(newTr).find('.elementID').prop('selectedIndex', 0); $(newTr).find('.elementIDText').val(''); // im geclonten einen "Minus-Button" hinzufügen, damit man die Zeile auch wieder löschen kann // wenn in der Zeile noch kein Minusbutton ist.. if ( $('.addSearchFieldsRow').length >= 1 ) { if ( $(xthis).parent().parent().find('.deleteSearchFieldsRow').length == 0 ) { $(newTr).find('.addSearchFieldsRow').after('
'); } } // und wieder einfügen $(xthis).parent().parent().after(newTr); } }); ///////////////////////////////////////////////////////////////////////// // Der Suche eine Reihe von Suchfeldern entfernen ///////////////////////////////////////////////////////////////////////// $('.deleteSearchFieldsRow').live('click', function() { // die Zeile entfernen $(this).parent().parent().fadeOut(250, function() { $(this).remove(); }); }); ///////////////////////////////////////////////////////////////////////// // Listenansicht: Die Tabs aktivieren ///////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////// // Tabs Objektsuche //When page loads... $(".tab_content").hide(); //Hide all content // Wenn das erste Tab keine Suchergebnisse enthält, dann stattdessen das zweite Tab öffnen... if ( $('#withPic').length > 0 ) { var withPicCount = $('#withPic').html(); if (withPicCount.indexOf(": 0") == -1 ) { $("ul.tabs li:first").addClass("active").show(); // ersten Tab aktivieren $(".tab_content:first").show(); // und anzeigen } else { $("ul.tabs li:eq(1)").addClass("active").show(); // ersten Tab aktivieren $(".tab_content:eq(1)").show(); // und anzeigen } } // Wenn der Tab für die Objekte ohne Bilder unsichtbar ist if ( $('#withPic').length == 0 ) { $("ul.tabs li:first").addClass("active").show(); // ersten Tab aktivieren $(".tab_content:first").show(); // und anzeigen } //On Click Event $("ul.tabs li").live('click', function() { if ($(this).find("a").attr("href")) { $("ul.tabs li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content $(activeTab).fadeIn(200); //Fade in the active ID content } return false; }); //////////////////////////////////////////////// // Tabs Einzelobjektansicht //When page loads... $(".tab_contentSingleView").hide(); //Hide all content $("ul.tabsSingleView li:first").addClass("active").show(); //Activate first tab $(".tab_contentSingleView:first").show(); //Show first tab content //On Click Event $("ul.tabsSingleView li").live('click', function() { if ($(this).find("a").attr("href")) { $("ul.tabsSingleView li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_contentSingleView").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content $(activeTab).fadeIn(200); //Fade in the active ID content } return false; }); //////////////////////////////////////////////// // Tabs EinzelMuseumansicht //When page loads... $(".tab_contentSingleViewMuseum").hide(); //Hide all content $("ul.tabsSingleViewMuseum li:first").addClass("active").show(); //Activate first tab $(".tab_contentSingleViewMuseum:first").show(); //Show first tab content //On Click Event $("ul.tabsSingleViewMuseum li").live('click', function() { if ($(this).find("a").attr("href")) { $("ul.tabsSingleViewMuseum li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_contentSingleViewMuseum").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content $(activeTab).fadeIn(200, function() { // wenn der Tab mit dem Iframe der Openstreetmap gefunden wird, dann muss der neu geladen werden, damit die Karte angezeigt wird if ( $('#frameOpenstreetmap').length != 0 ) { // $('#frameOpenstreetmap'). $('#frameOpenstreetmap').attr("src", $('#frameOpenstreetmap').attr("src")); } //frameOpenstreetmap }); //Fade in the active ID content } return false; }); ///////////////////////////////////////////////////////////////////////// // Listenansicht: Die Endlosergänzung verarbeiten ///////////////////////////////////////////////////////////////////////// var objectsShowMoreHitsActive = 0; // bei Klick auf Navigation $('#objectsShowMoreHits-objekte-mitBild, #objectsShowMoreHits-objekte-ohneBild').live('click', function() { // doppelklick verhindern... if (objectsShowMoreHitsActive == 0) { objectsShowMoreHitsActive = 1; // page, searchterm etc (suchvariablen) abholen. Die stehen im attribut "rel" des Naviseitenbuttons var vars = $(this).attr("data-rel"); var vars = decodeURI(vars); // da hängt noch der aktuelle Tabname mit dran (bild ja/nein) var varsArray = vars.split("|"); var x = varsArray.length -2; var aktTab = varsArray[x]; aktTab = '#' + aktTab; // Hintergrundbild für "mehr Ergebnisse-Button" festlegen, was Ladezeichen ist $(this).html(''); $(this).css('background-image', 'url(/instances//images/ajax-loaderMedium.gif)'); var thisX = this; var pfad = '/morehitsobjects' + encodeURI(vars); pfad = str_replace('%7C', '|', pfad); // neue Seite laden und wenn das fertig ist wirds automatisch eingeblendet $.ajax({ url: pfad, complete: function(data){ $(thisX).fadeOut(350, function() { $(thisX).remove(); // alten "weiter"-Button raus, der neue kommt mit den neuen Einträgen! $('#showMoreHitsWrapper').remove(); $(aktTab + ' .searchList').append(data.responseText); objectsShowMoreHitsActive = 0; }); } }); } }); ///////////////////////////////////////////////////////////////////////// // CLICK irgendwo ///////////////////////////////////////////////////////////////////////// $('body').live('click', function() { $('.suggestBoxKeyWordContainer').fadeOut(250, function() { //$(this).remove(); }); }); });