326 |
body.stream h1, body.stream h2, body.stream h3, body.stream p { |
= |
326 |
body.stream h1, body.stream h2, body.stream h3, body.stream p { |
327 |
color: #fff; |
|
327 |
color: #fff; |
328 |
} |
|
328 |
} |
329 |
a.grey { |
|
329 |
a.grey { |
330 |
color: #808080; |
|
330 |
color: #808080; |
331 |
} |
|
331 |
} |
332 |
#search_container { |
<> |
|
|
333 |
position: relative; |
|
|
|
334 |
} |
|
332 |
|
335 |
#sayt_results { |
|
|
|
336 |
list-style-type: none; |
|
|
|
337 |
margin: 0; |
|
|
|
338 |
position: absolute; |
|
|
|
339 |
z-index: 999999; |
|
|
|
340 |
width: 100%; |
|
|
|
341 |
} |
|
|
|
342 |
#sayt_results li { |
|
|
|
343 |
background-color: #ffffff; |
|
|
|
344 |
border-right: 1px solid #cccccc; |
|
|
|
345 |
border-left: 1px solid #cccccc; |
|
|
|
346 |
border-bottom: 1px solid #cccccc; |
|
|
|
347 |
padding: 1px; |
|
|
|
348 |
color: #222222; |
|
|
|
349 |
display: flex; |
|
|
|
350 |
flex-direction: row; |
|
|
|
351 |
align-items: center; |
|
|
|
352 |
height: 63px; |
|
|
|
353 |
} |
|
|
|
354 |
#sayt_results li:hover { |
|
|
|
355 |
background-color: #F8F8F8 |
|
|
|
356 |
} |
|
|
|
357 |
#sayt_results li a { |
|
|
|
358 |
text-overflow: ellipsis; |
|
|
|
359 |
overflow: hidden; |
|
|
|
360 |
white-space: nowrap; |
|
|
|
361 |
width: 100%; |
|
|
|
362 |
} |
|
|
|
363 |
#sayt_results li a span { |
|
|
|
364 |
float: left; |
|
|
|
365 |
width: 70px; |
|
|
|
366 |
display: block; |
|
|
|
367 |
text-align: center; |
|
|
|
368 |
} |
|
|
|
369 |
#sayt_results li img { |
|
|
|
370 |
max-height: 60px; |
|
|
|
371 |
max-width: 60px; |
|
|
|
372 |
margin-right: 0.5rem; |
|
|
|
373 |
} |
|
|
|
374 |
@media only screen and (max-width: 52.0625em) { |
= |
333 |
@media only screen and (max-width: 52.0625em) { |
375 |
#checkout_actions .button { |
|
334 |
#checkout_actions .button { |
376 |
padding-left:0.3125em; |
|
335 |
padding-left:0.3125em; |
377 |
padding-right:0.3125em; |
|
336 |
padding-right:0.3125em; |
378 |
} |
|
337 |
} |
379 |
} |
|
338 |
} |
128 |
$('#review_read').hide(); |
= |
128 |
$('#review_read').hide(); |
129 |
$('#review_write').slideDown(); |
|
129 |
$('#review_write').slideDown(); |
130 |
return false; |
|
130 |
return false; |
131 |
}); |
|
131 |
}); |
132 |
$(".show-small-search").click(function() { |
|
132 |
$(".show-small-search").click(function() { |
133 |
$('#small-search').slideToggle(); |
|
133 |
$('#small-search').slideToggle(); |
134 |
$('#small-search .search_input').focus(); |
+- |
|
|
135 |
return; |
= |
134 |
return; |
136 |
}); |
|
135 |
}); |
137 |
$(".hide_skin_selector").click(function(e) { |
|
136 |
$(".hide_skin_selector").click(function(e) { |
138 |
e.preventDefault(); |
|
137 |
e.preventDefault(); |
139 |
$('.skin_selector').fadeOut(); |
|
138 |
$('.skin_selector').fadeOut(); |
140 |
return; |
|
139 |
return; |
|
309 |
var url = $(this).val(); |
= |
308 |
var url = $(this).val(); |
310 |
if (url) { |
|
309 |
if (url) { |
311 |
window.location = url; |
|
310 |
window.location = url; |
312 |
} |
|
311 |
} |
313 |
return false; |
|
312 |
return false; |
314 |
}); |
|
313 |
}); |
315 |
var selector = ($(window).width() < 640) ? '#small-search .search_input' : '.search_input'; |
+- |
|
|
316 |
var sayt = $(selector); |
|
|
|
317 |
|
= |
|
|
318 |
sayt.click(function(event) { |
<> |
314 |
$(".search_input").click(function(event) { |
319 |
$.removeCookie('ccScroll', null); |
= |
315 |
$.removeCookie('ccScroll', null); |
320 |
}); |
|
316 |
}); |
321 |
var keyDelay = sayt.hasClass("es") ? 0 : 500; |
+- |
|
|
322 |
sayt.keyup(input_delay(function (e) { |
|
|
|
323 |
saytGo(); |
|
|
|
324 |
}, keyDelay)); |
|
|
|
325 |
|
= |
|
|
326 |
function input_delay(callback, ms) { |
+- |
|
|
327 |
var timer = 0; |
|
|
|
328 |
return function() { |
|
|
|
329 |
var context = this, args = arguments; |
|
|
|
330 |
clearTimeout(timer); |
|
|
|
331 |
timer = setTimeout(function () { |
|
|
|
332 |
callback.apply(context, args); |
|
|
|
333 |
}, ms || 0); |
|
|
|
334 |
}; |
|
|
|
335 |
} |
|
|
|
336 |
|
= |
|
|
337 |
function matchCase(text, pattern) { |
+- |
|
|
338 |
var result = ''; |
|
|
|
339 |
for(var i = 0; i < text.length; i++) { |
|
|
|
340 |
var c = text.charAt(i); |
|
|
|
341 |
var p = pattern.charCodeAt(i); |
|
|
|
342 |
if(p >= 65 && p < 65 + 26) { |
|
|
|
343 |
result += c.toUpperCase(); |
|
|
|
344 |
} else { |
|
|
|
345 |
result += c.toLowerCase(); |
|
|
|
346 |
} |
|
|
|
347 |
} |
|
|
|
348 |
return result; |
|
|
|
349 |
} |
|
|
|
350 |
function toBold(text){ |
|
|
|
351 |
var bold = /\*(.*?)\*/gm; |
|
|
|
352 |
var html = text.replace(bold, '<strong>$1</strong>'); |
|
|
|
353 |
return html; |
|
|
|
354 |
} |
|
|
|
355 |
|
= |
|
|
356 |
function saytGo() { |
+- |
|
|
357 |
if(!sayt.hasClass("es")) { |
|
|
|
358 |
return false; |
|
|
|
359 |
} |
|
|
|
360 |
var search_term = sayt.val(); |
|
|
|
361 |
if(!$('#sayt_results').length) { |
|
|
|
362 |
$('<ul id="sayt_results">').insertAfter(sayt); |
|
|
|
363 |
} |
|
|
|
364 |
$(document).keyup(function(e) { |
|
|
|
365 |
if (e.key === "Escape") { |
|
|
|
366 |
sayt.val(''); |
|
|
|
367 |
$('#sayt_results li').remove(); |
|
|
|
368 |
} |
|
|
|
369 |
}); |
|
|
|
370 |
if(search_term.length==0) { |
|
|
|
371 |
$('#sayt_results li').remove(); |
|
|
|
372 |
} else { |
|
|
|
373 |
var amount = sayt.attr("data-amount"); |
|
|
|
374 |
var url = '?_e=es&q='+search_term+'&a='+amount; |
|
|
|
375 |
$.ajax({ |
|
|
|
376 |
async: true, |
|
|
|
377 |
url: url, |
|
|
|
378 |
cache: true, |
|
|
|
379 |
complete: function(response) { |
|
|
|
380 |
$('#sayt_results li').remove(); |
|
|
|
381 |
var products = $.parseJSON(response.responseText); |
|
|
|
382 |
if(Array.isArray(products)) { |
|
|
|
383 |
search_term.replace('*',''); |
|
|
|
384 |
const splitted = search_term.split(' '); |
|
|
|
385 |
for(var k in products) { |
|
|
|
386 |
var product_name = products[k]['name']; |
|
|
|
387 |
splitted.forEach( |
|
|
|
388 |
function(split) { |
|
|
|
389 |
if(split == '' || split == '*') { |
|
|
|
390 |
return; |
|
|
|
391 |
} |
|
|
|
392 |
var regexp = new RegExp('('+split+')', 'ig'); |
|
|
|
393 |
product_name = product_name.replace(regexp, function(match) { return '*'+matchCase(split, match)+'*'}) |
|
|
|
394 |
} |
|
|
|
395 |
); |
|
|
|
396 |
var image = (sayt.attr("data-image")=='true' && products[k]['thumbnail']!=='') ? "<span><img src=\""+products[k]['thumbnail']+"\" title=\""+products[k]['name']+"\"></span>" : "<span> </span>"; |
|
|
|
397 |
$("#sayt_results").append("<li><a href='?_a=product&product_id="+products[k]['product_id']+"'>"+image+toBold(product_name)+"</a></li>"); |
|
|
|
398 |
} |
|
|
|
399 |
} else { |
|
|
|
400 |
$('#sayt_results').append('<li class="status">No results found</li>'); |
|
|
|
401 |
} |
|
|
|
402 |
} |
|
|
|
403 |
}); |
|
|
|
404 |
} |
|
|
|
405 |
} |
|
|
|
406 |
$("#ccScroll").on( "click", ".ccScroll-next", function(event) { |
= |
317 |
$("#ccScroll").on( "click", ".ccScroll-next", function(event) { |
407 |
event.preventDefault(); |
|
318 |
event.preventDefault(); |
408 |
$(this).hide(); |
|
319 |
$(this).hide(); |
409 |
$("#loading").show(); |
|
320 |
$("#loading").show(); |
410 |
window.location.hash = $(this).attr("data-next-page"); |
|
321 |
window.location.hash = $(this).attr("data-next-page"); |
411 |
|
|
322 |
|
9 |
* Email: [email protected] |
= |
9 |
* Email: [email protected] |
10 |
* License: GPL-3.0 https://www.gnu.org/licenses/quick-guide-gplv3.html |
|
10 |
* License: GPL-3.0 https://www.gnu.org/licenses/quick-guide-gplv3.html |
11 |
*} |
|
11 |
*} |
12 |
<div> |
|
12 |
<div> |
13 |
<form action="{$STORE_URL}/search{$CONFIG.seo_ext}" class="search_form" method="get"> |
|
13 |
<form action="{$STORE_URL}/search{$CONFIG.seo_ext}" class="search_form" method="get"> |
14 |
<div class="row collapse"> |
|
14 |
<div class="row collapse"> |
15 |
<div class="small-10 large-11 columns search_container"> |
<> |
15 |
<div class="small-10 large-11 columns"> |
16 |
<input name="search[keywords]" type="text" data-image="true" data-amount="15" class="search_input nomarg{if $CONFIG.elasticsearch=='1'} es{/if}" autocomplete="off" placeholder="{$LANG.search.input_default}" required><small><a href="{$STORE_URL}/search{$CONFIG.seo_ext}">{$LANG.search.advanced}</a></small> |
|
16 |
<input name="search[keywords]" type="text" class="search_input nomarg" placeholder="{$LANG.search.input_default}" required><small><a href="{$STORE_URL}/search{$CONFIG.seo_ext}">{$LANG.search.advanced}</a></small> |
17 |
</div> |
= |
17 |
</div> |
18 |
<div class="small-2 large-1 columns"> |
|
18 |
<div class="small-2 large-1 columns"> |
19 |
<button class="button postfix nomarg nopad" type="submit" value="{$LANG.common.search}"><svg class="icon"><use xlink:href="#icon-search"></use></svg></button> |
|
19 |
<button class="button postfix nomarg nopad" type="submit" value="{$LANG.common.search}"><svg class="icon"><use xlink:href="#icon-search"></use></svg></button> |
20 |
</div> |
|
20 |
</div> |
21 |
</div> |
|
21 |
</div> |
22 |
<input type="hidden" name="_a" value="category"> |
|
22 |
<input type="hidden" name="_a" value="category"> |
23 |
</form> |
|
23 |
</form> |
24 |
<div class="hide validate_search">{$LANG.search.enter_search_term}</div> |
|
24 |
<div class="hide validate_search">{$LANG.search.enter_search_term}</div> |
25 |
</div> |
|
25 |
</div> |