1/** 2* 2007-2021 PrestaShop 3* 4* NOTICE OF LICENSE 5* 6* This source file is subject to the Academic Free License (AFL 3.0) 7* that is bundled with this package in the file LICENSE.txt. 8* It is also available through the world-wide-web at this URL: 9* http://opensource.org/licenses/afl-3.0.php 10* If you did not receive a copy of the license and are unable to 11* obtain it through the world-wide-web, please send an email 12* to [email protected] so we can send you a copy immediately. 13* 14* DISCLAIMER 15* 16* Do not edit or add to this file if you wish to upgrade PrestaShop to newer 17* versions in the future. If you wish to customize PrestaShop for your 18* needs please refer to http://www.prestashop.com for more information. 19* 20* @author PrestaShop SA <[email protected]> 21* @copyright 2007-2021 PrestaShop SA 22* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 23* International Registered Trademark & Property of PrestaShop SA 24* 25* Don't forget to prefix your containers with your own identifier 26* to avoid any conflicts with others containers. 27*/ 28 29$(document).ready(function () { 30 $("#search_widget input[type=text]").on("keyup", function(e) { 31 var $searchWidget = $('#search_widget'); 32 var $searchBox = $searchWidget.find('input[type=text]'); 33 var searchURL = $searchWidget.attr('data-search-controller-url'); 34 35 var query = $(this).val(); 36 if(query.length >= 3){ 37 $.ajax({ 38 data: {s: query, resultsPerPage: 10}, 39 type: "POST", 40 dataType: "json", 41 url: searchURL, 42 }) 43 .done(function( data, textStatus, jqXHR ) { 44 if (parseInt(data.pagination.total_items) >= parseInt(data.pagination.items_shown_to)){ 45 var link_search = '<a href="' + data.current_url + '?controller=search&s=' + query + '">Ver todos</a>'; 46 var btn_search = '<a class="btn btn-primary" href="' + data.current_url + '?controller=search&s=' + query + '">Ver todos</a>'; 47 48 $('#content_search').addClass('open'); 49 $('#search_widget.search-widget form').addClass('open_mobile'); 50 $('#content_search .header_searchbar .searchbar_items .items_show').html(data.pagination.items_shown_to); 51 $('#content_search .header_searchbar .searchbar_items .total_items').html(data.pagination.total_items); 52 $('#content_search .header_searchbar .searchbar_items .link_allresult').html(link_search); 53 $('#content_search .allresult_searchbar').html(btn_search); 54 $('#content_search .result_searchbar').html(data.rendered_products); 55 } else { 56 $('#content_search').removeClass('open'); 57 $('#search_widget.search-widget form').removeClass('open_mobile'); 58 } 59 }) 60 .fail(function( jqXHR, textStatus, errorThrown ) { 61 $('#content_search').removeClass('open'); 62 $('#search_widget.search-widget form').removeClass('open_mobile'); 63 }); 64 } 65 66 }); 67 68 $("#content_search .header_searchbar .close").click(function(e) { 69 $("#search_widget .dbsearchbar-input").val(""); 70 $('#content_search').removeClass('open'); 71 $('#search_widget.search-widget form').removeClass('open_mobile'); 72 }); 73});
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.