define('PLUGIN_SEARCH2_RESULT_RECORD_LIMIT', 500);
define('PLUGIN_SEARCH2_RESULT_RECORD_LIMIT_START', 100);
+define('PLUGIN_SEARCH2_SEARCH_WAIT_MILLISECONDS', 1000);
// Show a search box on a page
function plugin_search2_convert()
}
$_search2_result_notfound = htmlsc($_msg_notfoundresult);
$_search2_result_found = htmlsc($_msg_andresult);
+ $_search2_search_wait_milliseconds = PLUGIN_SEARCH2_SEARCH_WAIT_MILLISECONDS;
$result_page_panel =<<<EOD
<div id="_plugin_search2_search_status"></div>
<div id="_plugin_search2_message"></div>
<input type="hidden" id="_plugin_search2_msg_searching" value="$_search_searching">
<input type="hidden" id="_plugin_search2_msg_result_notfound" value="$_search2_result_notfound">
<input type="hidden" id="_plugin_search2_msg_result_found" value="$_search2_result_found">
+<input type="hidden" id="_search2_search_wait_milliseconds" value="$_search2_search_wait_milliseconds">
EOD;
if ($h_search_text == '') {
$result_page_panel = '';
var aroundLines = 2;
var maxResultLines = 20;
var minBlockLines = 5;
- var searchWaitMilliseconds = 100;
+ var minSearchWaitMilliseconds = 100;
function escapeHTML (s) {
if(typeof s !== 'string') {
s = '' + s;
ul.appendChild(fragment);
});
if (!obj.search_done && obj.next_start_index) {
+ var waitE = document.querySelector('#_search2_search_wait_milliseconds');
+ var interval = minSearchWaitMilliseconds;
+ try {
+ interval = parseInt(waitE.value);
+ } catch (e) {
+ interval = minSearchWaitMilliseconds;
+ }
+ if (interval < minSearchWaitMilliseconds) {
+ interval = minSearchWaitMilliseconds;
+ }
setTimeout(function(){
doSearch(searchText, session, obj.next_start_index);
- }, searchWaitMilliseconds);
+ }, interval);
}
}
function textToRegex(searchText) {