tous les résultats'; $('
  • ' + catTitle + "
  • ").appendTo( activeUl ); } // display results full width, if no cms results are found if(!foundcms && !stateproducts){ $(".ui-autocomplete .left-container").css('width', '100%').css('border-right', '0'); } // insert dummy padding before $('
  • ').insertBefore('.ui-autocomplete-category-margin'); }, _renderItem: function (ul, item) { var markUp = ''; var keyWords = $("#sitesearch").val().toLowerCase().replace('script','').replace(/\u00E4\u00F6\u00FC\u00E8\u00E9\u00EA\u00E0\u00E1\u00E2\u00F4\W+/g, " ").split(" "); var lcPhrase = item.label.toLowerCase(); var origPhrase = item.label; // B.Terzi: auf ca. 150 Zeichen beschraenken if (origPhrase.length > 180) { var destLen = origPhrase.substring(0,180).lastIndexOf(' '); if (destLen < 150) { destLen = 150; } origPhrase = origPhrase.substring(0,destLen)+'...'; } for (var i = 0; i < keyWords.length; i++) { var keyWord = keyWords[i]; if (keyWord == "") continue; var start = lcPhrase.indexOf(keyWord); // check if keyword is in the tag (example: keyword "b") if(''.indexOf(keyWord) < 0 || i == 0){ while (start >= 0) { lcPhrase = lcPhrase.substr(0, start) + '' + lcPhrase.substr(start, keyWord.length) + "" + lcPhrase.substr(start + keyWord.length); origPhrase = origPhrase.substr(0, start) + '' + origPhrase.substr(start, keyWord.length) + "" + origPhrase.substr(start + keyWord.length); start = lcPhrase.indexOf(keyWord, start + ''.length + 1); } } } if (item.category == 0) { if(ul.parent().parent().hasClass('typeahead_products')){ markUp += ""; } else { markUp += ""; } markUp += "
    "; if ((item.image !== '' && item.image != null) && (item.image.substring(0,4) !== 'http')){ markUp +=""; }else{ if(item.image === ''){ // output placeholder markUp += '
    DA
    '; } } markUp += "
    "; markUp += "
    "; markUp += "
    "; markUp += item.productnumber; markUp += "
    "; markUp += origPhrase; markUp += "
    "; markUp += "
    "; markUp += "
    "; // BG (20151204): konfiguratoren } else if(item.category == 50){ markUp += ""; markUp += "
    "; if (item.image !== ''){ markUp +=""; } markUp += "
    "; markUp += "
    "; markUp += "
    "; markUp += item.label; markUp += "
    "; markUp += "
    "; markUp += item.productnumber; markUp += "
    "; markUp += "
    "; markUp += "
    "; } else if (item.category === 4) { var openlinkin = ''; if(item.url.indexOf('.pdf') >= 0){ openlinkin = 'target="_blank"'; } markUp += ""; markUp += origPhrase; markUp += ""; } else if (item.category === 33){ var url = location.origin + '/productlist.cfm?query=' + $("#sitesearch").val(); // add facet topchapter_s //url += '&fcactive=attributesFR.topchapter_s' + '%23' + encodeURI(origPhrase); url += '&fcactive=S_topchapter' + '%23' + encodeURI(origPhrase); markUp += ""; markUp += origPhrase; markUp += ""; } else { if(ul.parent().parent().hasClass('typeahead_products')){ markUp += ""; } else { markUp += ""; } markUp += origPhrase; markUp += ""; } if (item.category == 0) { markUp += '
    '; } return $('
  • ').addClass('ui-ac-'+item.category) .append(markUp) .appendTo(ul); } }); function autocompleteUrl(item){ if (item.productnumber != '') { if (item.fremdcat == 0) { if(item.isMaster){ myURL = '/product.cfm?CFID=53392544&CFTOKEN=7887294a2213346c-28A4B90A-F493-8D1E-FB85AEBC3A8B4E84&id='+item.masterid+'&ParentID=0'; }else{ myURL = '/product.cfm?CFID=53392544&CFTOKEN=7887294a2213346c-28A4B90A-F493-8D1E-FB85AEBC3A8B4E84&dim='+item.productnumber+'&query='+item.productnumber; } } else { myURL = '/productlist.cfm?CFID=53392544&CFTOKEN=7887294a2213346c-28A4B90A-F493-8D1E-FB85AEBC3A8B4E84&fremdcat='+item.fremdcat+'&dim='+item.productnumber; } }else if(item.category === 33 || item.category === 2){ myURL = '/productlist.cfm?CFID=53392544&CFTOKEN=7887294a2213346c-28A4B90A-F493-8D1E-FB85AEBC3A8B4E84&query='+item.value; }else{ myURL = ''; } return myURL; } $( document ).ready(function() { $("#sitesearch").dkmautocomplete({ minLength: 1, source: function(request, response){ var that = this; // AC nur wenn Suche im Shop... if ($('input[name=searcharea]:checked').val() == 'shop') { // URL fuer die Suche theURL = '/includes/searchproxy.cfm?CFID=53392544&CFTOKEN=7887294a2213346c-28A4B90A-F493-8D1E-FB85AEBC3A8B4E84&q='+encodeURI(request.term.replace('script',''))+'&slim=1&ts='+ new Date().getTime(); $.ajax({ url: theURL, dataType: "jsonp", success: function(data,textStatus,jqXHR) { var myData = []; // productfinder title (only if finder is present!) if(data.konfiguratoren.items.length){ myData.push({ label: 'productfinder', value: data.konfiguratoren.items.length, itemid: 'itemcounter', productnumber: '', fremdcat: '', category: 49, image: '', facet: '', url: '', isMaster: false, masterid : 0 }); // BG (20151204): Produktfinder $.map(data.konfiguratoren.items, function(item){ myData.push({ label: item.title, value: item.link, itemid: '', productnumber: item.text, fremdcat: '', category: 50, image: item.image, facet: '', url: '', isMaster: false, masterid : 0 }); }); } // count result (product) myData.push({ label: 'products', value: data.products.grouped.id_parent.ngroups, itemid: 'itemcounter', productnumber: '', fremdcat: '', category: 100, image: '', facet: '', url: '', isMaster: false, masterid : 0 }); $.map(data.products.grouped.id_parent.doclist.docs, function( item ) { var myLbl = item.bezeichnung1f + ' ' + item.bezeichnung2f; myData.push({ label: myLbl, value: myLbl, itemid: item.id, productnumber: item.produktnummer, fremdcat: item.fremdcatid, category: 0, image: item.bild }); }); // terms title if(data.terms.response.numFound > 0){ myData.push({ label: 'terms', value: data.terms.response.numFound, itemid: 'itemcounter', productnumber: '', fremdcat: '', category: 3, image: '', facet: '', url: '', isMaster: false, masterid : 0 }); // Jetzt noch die Daten fuer die Terms anfuegen $.map(data.terms.response.docs, function( item ) { var myLbl = item.phrase; var myVal = item[0]; if (item.phrase.toLowerCase() != request.term.toLowerCase()) { myData.push({ label: item.phrase, value: item.phrase, itemid: item.id, productnumber: item.productnumber, fremdcat: item.extcat, category: item.type, image: item.image, facet: '', url: '', isMaster: false, masterid : 0 }); } }); } // count result (cms) if(data.website.response.docs.length){ myData.push({ label: 'cms', value: data.website.response.numFound, itemid: 'itemcounter', productnumber: '', fremdcat: '', category: 5, image: '', facet: '', url: '', isMaster: false, masterid : 0 }); // website result $.map(data.website.response.docs, function(item) { myData.push({ label: item.title_s, value: item.content_title_s, itemid: '', productnumber: '', fremdcat: '', category: 4, image: item.image_s, facet: '', url: item.url_s, isMaster: false, masterid : 0 }); }); } response(myData); } }); } else { return {}; } }, open: function() { var siteSearchWidth = $("#sitesearch").width(), acUl = $('#ui-id-1'); acUl.width(siteSearchWidth+24); var pLeft = $("#ui-id-1").offset().left; pLeft = pLeft - 8; acUl.css({left:pLeft}); // SiteSearch+24-100-10-10 var textWidth = siteSearchWidth + 24 - 100 - 10 - 10; $(".acproducttext").width(textWidth); $("img.lazytah").lazyload({skip_invisible : false}); // sync height var leftContainer = acUl.find('.left-container'), rightContainer = acUl.find('.right-container'), heightLeft = leftContainer.height(), heightRight = rightContainer.height(), maxHeight = Math.max(heightLeft, heightRight); // init leftContainer.css('height', ''); rightContainer.css('height', ''); if(maxHeight > 0 && $(window).width() >= 600){ leftContainer.css('height', maxHeight); rightContainer.css('height', maxHeight); } }, focus: function (event, ui) { if (typeof event.keyCode === 'undefined' || event.keyCode == 0) { isHoverSelect = true; } else { isHoverSelect = false; } }, select: function (event,ui) { var trulyClick = false; if (event.originalEvent.originalEvent.type == "click") { trulyClick = true; } if (trulyClick == false && (event.keyCode == 9 || (isHoverSelect == true && typeof event.keyCode != 'undefined' && event.keycode != 0))) { $(".search").click(); } else { var myURL = ''; if (ui.item.productnumber != '') { if (ui.item.fremdcat == 0) { myURL = '/product.cfm?CFID=53392544&CFTOKEN=7887294a2213346c-28A4B90A-F493-8D1E-FB85AEBC3A8B4E84&dim='+ui.item.productnumber+'&Query='+ui.item.value; } else { myURL = '/productlist.cfm?CFID=53392544&CFTOKEN=7887294a2213346c-28A4B90A-F493-8D1E-FB85AEBC3A8B4E84&fremdcat='+ui.item.fremdcat+'&dim='+ui.item.productnumber; } }else if(ui.item.category == 50){ myURL = ui.item.value; }else{ myURL = '/productlist.cfm?CFID=53392544&CFTOKEN=7887294a2213346c-28A4B90A-F493-8D1E-FB85AEBC3A8B4E84&sitesearch='+ui.item.value; } if(myURL != ''){ document.location.href = myURL; } } } }); $("#searchscopecms").click(function() { // URL des Forms anpassen... $("#searchscopecmslabel").addClass("checked"); $("#searchscopeshoplabel").removeClass("checked"); $("#searchscopejobslabel").removeClass("checked"); $("#sitesearchform").attr('action','http://stage.metallservice.ch/websitelist.cfm'); }); $("#searchscopeshop").click(function() { // URL des Forms anpassen... $("#searchscopecmslabel").removeClass("checked"); $("#searchscopeshoplabel").addClass("checked"); $("#searchscopejobslabel").removeClass("checked"); $("#sitesearchform").attr('action','/productlist.cfm?CFID=53392544&CFTOKEN=7887294a2213346c-28A4B90A-F493-8D1E-FB85AEBC3A8B4E84'); }); $("#searchscopejobs").click(function() { // URL des Forms anpassen... $("#searchscopecmslabel").removeClass("checked"); $("#searchscopeshoplabel").removeClass("checked"); $("#searchscopejobslabel").addClass("checked"); $("#sitesearchform").attr('action','https://recruitingapp-2750.umantis.com/Jobs/All'); }); }); // get text for "found" header getFoundText = function(max, found){ var counttext = ''; if(found <= 0){ counttext = '0 résultats' }else{ counttext = '5 résultats sur ' + found + ' résultats'; if(max > found && found != 0){ counttext = found + " résultats sur " + found + ' résultats'; } } return counttext; }

    Enregistration



    {Sie sind nicht angemeldet oder Ihre Sitzung ist abgelaufen.
    Bitte melden Sie sich erneut an!
    }



    Formulardaten übermitteln