From 03248c292f3024b82930b7937ad0b474b87b108a Mon Sep 17 00:00:00 2001 From: Papoteur Date: Fri, 10 Nov 2023 13:03:01 +0100 Subject: Adding or refreshing draklive in ru --- draklive/9/ru/content/nwSearchFnt.js | 608 +++++++++++++++++++++++++++++++++++ 1 file changed, 608 insertions(+) create mode 100644 draklive/9/ru/content/nwSearchFnt.js (limited to 'draklive/9/ru/content/nwSearchFnt.js') diff --git a/draklive/9/ru/content/nwSearchFnt.js b/draklive/9/ru/content/nwSearchFnt.js new file mode 100644 index 00000000..afbb5b93 --- /dev/null +++ b/draklive/9/ru/content/nwSearchFnt.js @@ -0,0 +1,608 @@ +/*---------------------------------------------------------------------------- + * JavaScript for webhelp search + * updated by neodoc + *---------------------------------------------------------------------------- + This file is part of the webhelpsearch plugin for DocBook WebHelp + Copyright (c) 2007-2008 NexWave Solutions All Rights Reserved. + www.nexwave.biz Nadege Quaine + http://kasunbg.blogspot.com/ Kasun Gajasinghe + */ + +/* global txt_browser_not_supported, txt_enter_at_least_1_char, indexerLanguage, w, txt_results_for, fil, txt_no_results_for */ + +//string initialization +var htmlfileList = "htmlFileList.js"; +var htmlfileinfoList = "htmlFileInfoList.js"; +var useCJKTokenizing = false; + +/* Cette fonction verifie la validite de la recherche entrre par l utilisateur */ +function Verifie(ditaSearch_Form) { + + // Check browser compatibitily + if (navigator.userAgent.indexOf("Konquerer") > -1) { + + alert(txt_browser_not_supported); + return; + } + + + var expressionInput = document.ditaSearch_Form.textToSearch.value; + //Set a cookie to store the searched keywords + $.cookie('textToSearch', ""); + + + if (expressionInput.length < 1) { + + // expression is invalid + alert(txt_enter_at_least_1_char); + // reactive la fenetre de search (utile car cadres) + document.ditaSearch_Form.textToSearch.focus(); + } + else { + + // Effectuer la recherche + Effectuer_recherche(expressionInput); + + // reactive la fenetre de search (utile car cadres) + document.ditaSearch_Form.textToSearch.focus(); + } +} + +var stemQueryMap = new Array(); // A hashtable which maps stems to query words + +/* This function parses the search expression, loads the indices and displays the results*/ +function Effectuer_recherche(expressionInput) { + var expressionInputMem = expressionInput ; +// â à ç ë é ê è ï î ô û ù + expressionInput = expressionInput.replace( /â/g , 'a'); + expressionInput = expressionInput.replace( /à/g , 'a'); + expressionInput = expressionInput.replace( /ç/g , 'c'); + expressionInput = expressionInput.replace( /ë/g , 'e'); + expressionInput = expressionInput.replace( /é/g , 'e'); + expressionInput = expressionInput.replace( /è/g , 'e'); + expressionInput = expressionInput.replace( /ê/g , 'e'); + expressionInput = expressionInput.replace( /ï/g , 'i'); + expressionInput = expressionInput.replace( /î/g , 'i'); + expressionInput = expressionInput.replace( /ô/g , 'o'); + expressionInput = expressionInput.replace( /û/g , 'u'); + expressionInput = expressionInput.replace( /ù/g , 'u'); + + /* Display a waiting message */ + //DisplayWaitingMessage(); + + /*data initialisation*/ + var searchFor = ""; // expression en lowercase et sans les caracte res speciaux + //w = new Object(); // hashtable, key=word, value = list of the index of the html files + scriptLetterTab = new Scriptfirstchar(); // Array containing the first letter of each word to look for + var wordsList = new Array(); // Array with the words to look for + var finalWordsList = new Array(); // Array with the words to look for after removing spaces + var linkTab = new Array(); + var fileAndWordList = new Array(); + var txt_wordsnotfound = ""; + + + /*nqu: expressionInput, la recherche est lower cased, plus remplacement des char speciaux*/ + searchFor = expressionInput.toLowerCase().replace(/<\//g, "_st_").replace(/\$_/g, "_di_").replace(/\.|%2C|%3B|%21|%3A|@|\/|\*/g, " ").replace(/(%20)+/g, " ").replace(/_st_/g, "= 0; i--) { + if (fileAndWordList[i] !== undefined) { + linkTab.push("

" + txt_results_for + " " + "" + fileAndWordList[i][0].motslisteDisplay + "" + "

"); + + linkTab.push(""); + } + } + } + + var results = ""; + if (linkTab.length > 0) { + /*writeln ("

" + txt_results_for + " " + "" + cleanwordsList + "" + "
"+"

");*/ + results = "

"; + //write("