Törpe nyulak

Állatok Budapest - Pest megye, HU 6 éve

Hirdetés leírás

Törpe nyuszik elvihetők 1000ft
Tom
Regisztrált 7 éve
HU"; var currentRegion = "1"; var currentCity = ""; // On first click initiate loading /* $('body').on('click', '.loc-picker .term', function() { if( !termClicked ) { $(this).keyup(); } termClicked = true; }); */ // Create delay var delay = (function(){ var timer = 0; return function(callback, ms){ clearTimeout (timer); timer = setTimeout(callback, ms); }; })(); $(document).ajaxSend(function(evt, request, settings) { var url = settings.url; if (url.indexOf("ajaxLoc") >= 0) { $(".loc-picker, .location-picker").addClass('searching'); } }); $(document).ajaxStop(function() { $(".loc-picker, .location-picker").removeClass('searching'); }); $('body').on('keyup', '.loc-picker .term', function(e) { delay(function(){ var min_length = 1; var elem = $(e.target); var term = encodeURIComponent(elem.val()); // If comma entered, remove characters after comma including if(term.indexOf(',') > 1) { term = term.substr(0, term.indexOf(',')); } // If comma entered, remove characters after - including (because city is shown in format City - Region) if(term.indexOf(' - ') > 1) { term = term.substr(0, term.indexOf(' - ')); } var block = elem.closest('.loc-picker'); var shower = elem.closest('.loc-picker').find('.shower'); shower.html(''); if(term != '' && term.length >= min_length) { // Combined ajax for country, region & city $.ajax({ type: "POST", url: baseAjaxUrl + "&ajaxLoc=1&term=" + term, dataType: 'json', success: function(data) { var length = data.length; var result = ''; var result_first = ''; var countCountry = 0; var countRegion = 0; var countCity = 0; if(shower.find('.service.min-char').length <= 0) { for(key in data) { // Prepare location IDs var id = ''; var country_code = ''; if( data[key].country_code ) { country_code = data[key].country_code; id = country_code; } var region_id = ''; if( data[key].region_id ) { region_id = data[key].region_id; id = region_id; } var city_id = ''; if( data[key].city_id ) { city_id = data[key].city_id; id = city_id; } // Count cities, regions & countries if (data[key].type == 'city') { countCity = countCity + 1; } else if (data[key].type == 'region') { countRegion = countRegion + 1; } else if (data[key].type == 'country') { countCountry = countCountry + 1; } // Find currently selected element var selectedClass = ''; if( data[key].type == 'country' && parseInt(currentCountry) == parseInt(data[key].country_code) || data[key].type == 'region' && parseInt(currentRegion) == parseInt(data[key].region_id) || data[key].type == 'city' && parseInt(currentCity) == parseInt(data[key].city_id) ) { selectedClass = ' selected'; } // For cities, get region name var nameTop = ''; if(data[key].name_top ) { nameTop = ' ' + data[key].name_top + ''; } if(data[key].type != 'city_more') { // When classic city, region or country in loop and same does not already exists if(shower.find('div[data-code="' + data[key].type + data[key].id + '"]').length <= 0) { result += '
' + data[key].name + '' + nameTop + '
'; } } else { // When city counter and there is more than 12 cities for search /* if(shower.find('.more-city').length <= 0) { if( parseInt(data[key].name) > 0 ) { result += '
... ' + (data[key].name) + ' több város, adja meg a helyét
'; } } */ } } // No city, region or country found /* if( countCountry == 0 && shower.find('.empty-country').length <= 0 && shower.find('.service.min-char').length <= 0) { shower.find('.option.country').remove(); result_first += '
Nincs ország a megadott kritériumok alapján
'; } if( countRegion == 0 && shower.find('.empty-region').length <= 0 && shower.find('.service.min-char').length <= 0) { shower.find('.option.region').remove(); result_first += '
Nincs megye a megadott kritériumok alapján
'; } if( countCity == 0 && shower.find('.empty-city').length <= 0 && shower.find('.service.min-char').length <= 0) { shower.find('.option.city').remove(); result_first += '
Nincs város a megadott kritériumok alapján
'; } */ if( countCity == 0 && countRegion == 0 && countCountry == 0 && shower.find('.empty-loc').length <= 0 && shower.find('.service.min-char').length <= 0) { shower.find('.option').remove(); result_first += '
Nincs helység a megadott kritériumok alapján
'; } } shower.html(result_first + result); } }); } else { // Term is not length enough, show default content //shower.html('
Adja meg legalább ' + (min_length - term.length) + ' további levelek
'); shower.html('
Magyarország
Bács-Kiskun megyeMagyarország
Baranya megyeMagyarország
Békés megyeMagyarország
Borsod-Abaúj-ZemplénMagyarország
Budapest - Pest megyeMagyarország
Csongrád megyeMagyarország
egész MagyarországMagyarország
Fejér megyeMagyarország
Győr-Moson-SopronMagyarország
Hajdú-Bihar megyeMagyarország
Heves megyeMagyarország
Jász-Nagykun-SzolnokMagyarország
Komárom-EsztergomMagyarország
Nógrád megyeMagyarország
Pest megyeMagyarország
Szabolcs-Szatmár-BeregMagyarország
Tolna megyeMagyarország
Vas megyeMagyarország
Veszprém megyeMagyarország
Zala megyeMagyarország
'); } }, 500 ); }); });