diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 2b040c13d9..36fe9bea82 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -101,7 +101,8 @@ if ($config['menu_type'] == 'classic') { if ($acl_head_search) { // Search bar. - $search_bar = '
'; + $search_bar = ''; + ''; if (!isset($config['search_keywords'])) { $search_bar .= ''; } else { @@ -112,7 +113,7 @@ if ($config['menu_type'] == 'classic') { } } - $search_bar .= ''; + $search_bar .= 'type="search" onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');" + onkeyup="showinterpreter()" class="search_input"/>'; $search_bar .= '
'; @@ -636,10 +637,52 @@ if ($config['menu_type'] == 'classic') { var new_chat = ; function showinterpreter(){ + + if(event.keyCode == 1 && $("#result_items li.active").length != 0 ) + { + window.location = $('#result_items').find("li.active a").attr('href'); + } + var code = event.key; + switch (code){ + case 'ArrowDown': + if($("#result_items li.active").length!=0) + { + var storeTarget = $('#result_items').find("li.active").next(); + $("#result_items li.active").removeClass("active"); + storeTarget.focus().addClass("active"); + + } + else + { + $('#result_items').find("li:first").focus().addClass("active"); + } + return; + + case 'ArrowUp': + if($("#result_items li.active")) + { + var storeTarget = $('#result_items').find("li.active").prev(); + $("#result_items li.active").removeClass("active"); + storeTarget.focus().addClass("active"); + } + else + { + $('#result_items').find("li:first").focus().addClass("active"); + } + return; + + case 'ArrowRight': + return; + case 'ArrowLeft': + return; + + } + if( $('#keywords').val() === ''){ $('#keywords').addClass('search_input'); $('#keywords').removeClass('results-found'); $('#result_order').hide(); + $('#keywords').attr('placeholder','Enter keywords to search'); }else { $.ajax({ type: "POST", @@ -651,7 +694,6 @@ if ($config['menu_type'] == 'classic') { text: $('#keywords').val(), }, success: function (data) { - console.log(data); $('#result_order').html(data); }, error: function (data) { diff --git a/pandora_console/include/class/OrderInterpreter.class.php b/pandora_console/include/class/OrderInterpreter.class.php index f0d0a62d13..93cb3f4d01 100644 --- a/pandora_console/include/class/OrderInterpreter.class.php +++ b/pandora_console/include/class/OrderInterpreter.class.php @@ -247,7 +247,7 @@ class OrderInterpreter extends Wizard if ($text !== '') { echo '
'; - echo '
+ + '.$more_results.' results found