diff options
author | Claire Revillet <grenoya@mageia.org> | 2012-07-09 16:04:10 +0000 |
---|---|---|
committer | Claire Revillet <grenoya@mageia.org> | 2012-07-09 16:04:10 +0000 |
commit | 125fc7e671ab4f305e5ef2937708e945e64060f6 (patch) | |
tree | 1208c5bcf861d6a0920844105e65ce800b829276 /installer | |
parent | 39451af644929d2210b19673ef57e917e2f8b00a (diff) | |
download | doc-125fc7e671ab4f305e5ef2937708e945e64060f6.tar doc-125fc7e671ab4f305e5ef2937708e945e64060f6.tar.gz doc-125fc7e671ab4f305e5ef2937708e945e64060f6.tar.bz2 doc-125fc7e671ab4f305e5ef2937708e945e64060f6.tar.xz doc-125fc7e671ab4f305e5ef2937708e945e64060f6.zip |
- update EN pages
Diffstat (limited to 'installer')
27 files changed, 1047 insertions, 1047 deletions
diff --git a/installer/2/en/content/acceptLicense.html b/installer/2/en/content/acceptLicense.html index 7d3b4b93..16f6612a 100644 --- a/installer/2/en/content/acceptLicense.html +++ b/installer/2/en/content/acceptLicense.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>3. License and Release Notes</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="selectLanguage.html" title="2. Please choose a language to use"/><link rel="next" href="setupSCSI.html" title="4. Setup SCSI"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/addUser.html b/installer/2/en/content/addUser.html index daf39c64..2b7b3790 100644 --- a/installer/2/en/content/addUser.html +++ b/installer/2/en/content/addUser.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>15. User and Superuser Management</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="choosePackages.html" title="14. Choosing Packages to be Installed"/><link rel="next" href="setupX.html" title="16. Set up X, graphic card and monitor configuration"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/ask_mntpoint_s.html b/installer/2/en/content/ask_mntpoint_s.html index d7d7e4ca..733ef0dd 100644 --- a/installer/2/en/content/ask_mntpoint_s.html +++ b/installer/2/en/content/ask_mntpoint_s.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>11. Choose the mount points</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="takeOverHdConfirm.html" title="10. Confirm hard disk to be formatted"/><link rel="next" href="diskdrake.html" title="12. Custom disk partitioning with DiskDrake"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/choosePackages.html b/installer/2/en/content/choosePackages.html index 63bc9ce2..39749194 100644 --- a/installer/2/en/content/choosePackages.html +++ b/installer/2/en/content/choosePackages.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>14. Choosing Packages to be Installed</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="formatPartitions.html" title="13. Formatting"/><link rel="next" href="addUser.html" title="15. User and Superuser Management"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/diskdrake.html b/installer/2/en/content/diskdrake.html index e19f52ae..9cfaa9fa 100644 --- a/installer/2/en/content/diskdrake.html +++ b/installer/2/en/content/diskdrake.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>12. Custom disk partitioning with DiskDrake</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="ask_mntpoint_s.html" title="11. Choose the mount points"/><link rel="next" href="formatPartitions.html" title="13. Formatting"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/doPartitionDisks.html b/installer/2/en/content/doPartitionDisks.html index 68cd63d8..bcce1b33 100644 --- a/installer/2/en/content/doPartitionDisks.html +++ b/installer/2/en/content/doPartitionDisks.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>7. Partitioning</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="selectKeyboard.html" title="6. Keyboard"/><link rel="next" href="resizeFATChoose.html" title="8. Resize Windows® partition"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/exitInstall.html b/installer/2/en/content/exitInstall.html index c30cac88..4695a5fc 100644 --- a/installer/2/en/content/exitInstall.html +++ b/installer/2/en/content/exitInstall.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>22. Congratulations</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="installUpdates.html" title="21. Updates"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/favicon.png b/installer/2/en/content/favicon.png Binary files differnew file mode 100644 index 00000000..5868d96b --- /dev/null +++ b/installer/2/en/content/favicon.png diff --git a/installer/2/en/content/formatPartitions.html b/installer/2/en/content/formatPartitions.html index e89f289c..fc65b680 100644 --- a/installer/2/en/content/formatPartitions.html +++ b/installer/2/en/content/formatPartitions.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>13. Formatting</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="diskdrake.html" title="12. Custom disk partitioning with DiskDrake"/><link rel="next" href="choosePackages.html" title="14. Choosing Packages to be Installed"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/images/dx2-summaryBottom.png b/installer/2/en/content/images/dx2-summaryBottom.png Binary files differnew file mode 100644 index 00000000..c00e4036 --- /dev/null +++ b/installer/2/en/content/images/dx2-summaryBottom.png diff --git a/installer/2/en/content/index.html b/installer/2/en/content/index.html index 76ac7638..41ba78b6 100644 --- a/installer/2/en/content/index.html +++ b/installer/2/en/content/index.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>Installation with DrakX</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="next" href="installer.html" title="1. DrakX, the Mageia Installer"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/installUpdates.html b/installer/2/en/content/installUpdates.html index af58f008..a64522d2 100644 --- a/installer/2/en/content/installUpdates.html +++ b/installer/2/en/content/installUpdates.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>21. Updates</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="selectMouse.html" title="20. Select mouse"/><link rel="next" href="exitInstall.html" title="22. Congratulations"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/installer.html b/installer/2/en/content/installer.html index b5abcf38..90ad101f 100644 --- a/installer/2/en/content/installer.html +++ b/installer/2/en/content/installer.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>1. DrakX, the Mageia Installer</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="index.html" title="Installation with DrakX"/><link rel="next" href="selectLanguage.html" title="2. Please choose a language to use"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/misc-params.html b/installer/2/en/content/misc-params.html index e5cb744f..c4b639c6 100644 --- a/installer/2/en/content/misc-params.html +++ b/installer/2/en/content/misc-params.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>19. Summary of miscellaneous parameters</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="setupBootloaderExpert.html" title="18. Bootloader expert use"/><link rel="next" href="selectMouse.html" title="20. Select mouse"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/nwSearchFnt.js b/installer/2/en/content/nwSearchFnt.js index fc12d113..15980bb8 100644 --- a/installer/2/en/content/nwSearchFnt.js +++ b/installer/2/en/content/nwSearchFnt.js @@ -1,513 +1,513 @@ -/*----------------------------------------------------------------------------
- * JavaScript for webhelp search
- *----------------------------------------------------------------------------
- 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
- */
-
-//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', expressionInput);
-
-
- 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) {
-
- /* 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, "</").replace(/_di_/g, "%24_");
-
- searchFor = searchFor.replace(/ +/g, " ");
- searchFor = searchFor.replace(/ $/, "").replace(/^ /, "");
-
- wordsList = searchFor.split(" ");
- wordsList.sort();
-
- //set the tokenizing method
- if(typeof indexerLanguage != "undefined" && (indexerLanguage=="zh" || indexerLanguage=="ja" ||indexerLanguage=="ko")){
- useCJKTokenizing=true;
- } else {
- useCJKTokenizing=false;
- }
- //If Lucene CJKTokenizer was used as the indexer, then useCJKTokenizing will be true. Else, do normal tokenizing.
- // 2-gram tokenizinghappens in CJKTokenizing,
- if(useCJKTokenizing){
- finalWordsList = cjkTokenize(wordsList);
- } else {
- finalWordsList = tokenize(wordsList);
- }
-
- //load the scripts with the indices: the following lines do not work on the server. To be corrected
- /*if (IEBrowser) {
- scriptsarray = loadTheIndexScripts (scriptLetterTab);
- } */
-
- /**
- * Compare with the indexed words (in the w[] array), and push words that are in it to tempTab.
- */
- var tempTab = new Array();
- for (var t in finalWordsList) {
- if (w[finalWordsList[t].toString()] == undefined) {
- txt_wordsnotfound += finalWordsList[t] + " ";
- } else {
- tempTab.push(finalWordsList[t]);
- }
- }
- finalWordsList = tempTab;
-
- if (finalWordsList.length) {
-
- //search 'and' and 'or' one time
- fileAndWordList = SortResults(finalWordsList);
-
- var cpt = fileAndWordList.length;
- for (var i = cpt - 1; i >= 0; i--) {
- if (fileAndWordList[i] != undefined) {
- linkTab.push("<p>" + txt_results_for + " " + "<span class=\"searchExpression\">" + fileAndWordList[i][0].motslisteDisplay + "</span>" + "</p>");
-
- linkTab.push("<ul class='searchresult'>");
- for (t in fileAndWordList[i]) {
- //DEBUG: alert(": "+ fileAndWordList[i][t].filenb+" " +fileAndWordList[i][t].motsliste);
- //linkTab.push("<li><a href=\"../"+fl[fileAndWordList[i][t].filenb]+"\">"+fl[fileAndWordList[i][t].filenb]+"</a></li>");
- var tempInfo = fil[fileAndWordList[i][t].filenb];
- var pos1 = tempInfo.indexOf("@@@");
- var pos2 = tempInfo.lastIndexOf("@@@");
- var tempPath = tempInfo.substring(0, pos1);
- var tempTitle = tempInfo.substring(pos1 + 3, pos2);
- var tempShortdesc = tempInfo.substring(pos2 + 3, tempInfo.length);
-
- //file:///home/kasun/docbook/WEBHELP/webhelp-draft-output-format-idea/src/main/resources/web/webhelp/installation.html
- var linkString = "<li><a href=" + tempPath + ">" + tempTitle + "</a>";
- // var linkString = "<li><a href=\"installation.html\">" + tempTitle + "</a>";
- if ((tempShortdesc != "null")) {
- linkString += "\n<div class=\"shortdesclink\">" + tempShortdesc + "</div>";
- }
- linkString += "</li>";
- linkTab.push(linkString);
- }
- linkTab.push("</ul>");
- }
- }
- }
-
- var results = "";
- if (linkTab.length > 0) {
- /*writeln ("<p>" + txt_results_for + " " + "<span class=\"searchExpression\">" + cleanwordsList + "</span>" + "<br/>"+"</p>");*/
- results = "<p>";
- //write("<ul class='searchresult'>");
- for (t in linkTab) {
- results += linkTab[t].toString();
- }
- results += "</p>";
- } else {
- results = "<p>" + txt_no_results_for + "<span class=\"searchExpression\">" + txt_wordsnotfound + "</span>" + "</p>";
- }
- //alert(results);
- document.getElementById('searchResults').innerHTML = results;
-}
-
-function tokenize(wordsList){
- var stemmedWordsList = new Array(); // Array with the words to look for after removing spaces
- var cleanwordsList = new Array(); // Array with the words to look for
- for(var j in wordsList){
- var word = wordsList[j];
- if(typeof stemmer != "undefined" ){
- stemQueryMap[stemmer(word)] = word;
- } else {
- stemQueryMap[word] = word;
- }
- }
- //stemmedWordsList is the stemmed list of words separated by spaces.
- for (var t in wordsList) {
- wordsList[t] = wordsList[t].replace(/(%22)|^-/g, "");
- if (wordsList[t] != "%20") {
- scriptLetterTab.add(wordsList[t].charAt(0));
- cleanwordsList.push(wordsList[t]);
- }
- }
-
- if(typeof stemmer != "undefined" ){
- //Do the stemming using Porter's stemming algorithm
- for (var i = 0; i < cleanwordsList.length; i++) {
- var stemWord = stemmer(cleanwordsList[i]);
- stemmedWordsList.push(stemWord);
- }
- } else {
- stemmedWordsList = cleanwordsList;
- }
- return stemmedWordsList;
-}
-
-//Invoker of CJKTokenizer class methods.
-function cjkTokenize(wordsList){
- var allTokens= new Array();
- var notCJKTokens= new Array();
- var j=0;
- for(j=0;j<wordsList.length;j++){
- var word = wordsList[j];
- if(getAvgAsciiValue(word) < 127){
- notCJKTokens.push(word);
- } else {
- var tokenizer = new CJKTokenizer(word);
- var tokensTmp = tokenizer.getAllTokens();
- allTokens = allTokens.concat(tokensTmp);
- }
- }
- allTokens = allTokens.concat(tokenize(notCJKTokens));
- return allTokens;
-}
-
-//A simple way to determine whether the query is in english or not.
-function getAvgAsciiValue(word){
- var tmp = 0;
- var num = word.length < 5 ? word.length:5;
- for(var i=0;i<num;i++){
- if(i==5) break;
- tmp += word.charCodeAt(i);
- }
- return tmp/num;
-}
-
-//CJKTokenizer
-function CJKTokenizer(input){
- this.input = input;
- this.offset=-1;
- this.tokens = new Array();
- this.incrementToken = incrementToken;
- this.tokenize = tokenize;
- this.getAllTokens = getAllTokens;
- this.unique = unique;
-
- function incrementToken(){
- if(this.input.length - 2 <= this.offset){
- // console.log("false "+offset);
- return false;
- }
- else {
- this.offset+=1;
- return true;
- }
- }
-
- function tokenize(){
- //document.getElementById("content").innerHTML += x.substring(offset,offset+2)+"<br>";
- return this.input.substring(this.offset,this.offset+2);
- }
-
- function getAllTokens(){
- while(this.incrementToken()){
- var tmp = this.tokenize();
- this.tokens.push(tmp);
- }
- return this.unique(this.tokens);
-// document.getElementById("content").innerHTML += tokens+" ";
-// document.getElementById("content").innerHTML += "<br>dada"+sortedTokens+" ";
-// console.log(tokens.length+"dsdsds");
- /*for(i=0;i<tokens.length;i++){
- console.log(tokens[i]);
- var ss = tokens[i] == sortedTokens[i];
-
-// document.getElementById("content").innerHTML += "<br>dada"+un[i]+"- "+stems[i]+" "+ ss;
- document.getElementById("content").innerHTML += "<br>"+sortedTokens[i];
- }*/
- }
-
- function unique(a)
- {
- var r = new Array();
- o:for(var i = 0, n = a.length; i < n; i++)
- {
- for(var x = 0, y = r.length; x < y; x++)
- {
- if(r[x]==a[i]) continue o;
- }
- r[r.length] = a[i];
- }
- return r;
- }
-}
-
-
-/* Scriptfirstchar: to gather the first letter of index js files to upload */
-function Scriptfirstchar() {
- this.strLetters = "";
- this.add = addLettre;
-}
-
-function addLettre(caract) {
-
- if (this.strLetters == 'undefined') {
- this.strLetters = caract;
- } else if (this.strLetters.indexOf(caract) < 0) {
- this.strLetters += caract;
- }
-
- return 0;
-}
-/* end of scriptfirstchar */
-
-/*main loader function*/
-/*tab contains the first letters of each word looked for*/
-function loadTheIndexScripts(tab) {
-
- //alert (tab.strLetters);
- var scriptsarray = new Array();
-
- for (var i = 0; i < tab.strLetters.length; i++) {
-
- scriptsarray[i] = "..\/search" + "\/" + tab.strLetters.charAt(i) + ".js";
- }
- // add the list of html files
- i++;
- scriptsarray[i] = "..\/search" + "\/" + htmlfileList;
-
- //debug
- for (var t in scriptsarray) {
- //alert (scriptsarray[t]);
- }
-
- tab = new ScriptLoader();
- for (t in scriptsarray) {
- tab.add(scriptsarray[t]);
- }
- tab.load();
- //alert ("scripts loaded");
- return (scriptsarray);
-}
-
-/* ScriptLoader: to load the scripts and wait that it's finished */
-function ScriptLoader() {
- this.cpt = 0;
- this.scriptTab = new Array();
- this.add = addAScriptInTheList;
- this.load = loadTheScripts;
- this.onScriptLoaded = onScriptLoadedFunc;
-}
-
-function addAScriptInTheList(scriptPath) {
- this.scriptTab.push(scriptPath);
-}
-
-function loadTheScripts() {
- var script;
- var head;
-
- head = document.getElementsByTagName('head').item(0);
-
- //script = document.createElement('script');
-
- for (var el in this.scriptTab) {
- //alert (el+this.scriptTab[el]);
- script = document.createElement('script');
- script.src = this.scriptTab[el];
- script.type = 'text/javascript';
- script.defer = false;
-
- head.appendChild(script);
- }
-
-}
-
-function onScriptLoadedFunc(e) {
- e = e || window.event;
- var target = e.target || e.srcElement;
- var isComplete = true;
- if (typeof target.readyState != undefined) {
-
- isComplete = (target.readyState == "complete" || target.readyState == "loaded");
- }
- if (isComplete) {
- ScriptLoader.cpt++;
- if (ScriptLoader.cpt == ScriptLoader.scripts.length) {
- ScriptLoader.onLoadComplete();
- }
- }
-}
-
-/*
-function onLoadComplete() {
- alert("loaded !!");
-} */
-
-/* End of scriptloader functions */
-
-// Array.unique( strict ) - Remove duplicate values
-function unique(tab) {
- var a = new Array();
- var i;
- var l = tab.length;
-
- if (tab[0] != undefined) {
- a[0] = tab[0];
- }
- else {
- return -1
- }
-
- for (i = 1; i < l; i++) {
- if (indexof(a, tab[i], 0) < 0) {
- a.push(tab[i]);
- }
- }
- return a;
-}
-function indexof(tab, element, begin) {
- for (var i = begin; i < tab.length; i++) {
- if (tab[i] == element) {
- return i;
- }
- }
- return -1;
-
-}
-/* end of Array functions */
-
-
-/*
- Param: mots= list of words to look for.
- This function creates an hashtable:
- - The key is the index of a html file which contains a word to look for.
- - The value is the list of all words contained in the html file.
-
- Return value: the hashtable fileAndWordList
- */
-function SortResults(mots) {
-
- var fileAndWordList = new Object();
- if (mots.length == 0) {
- return null;
- }
-
- for (var t in mots) {
- // get the list of the indices of the files.
- var listNumerosDesFicStr = w[mots[t].toString()];
- //alert ("listNumerosDesFicStr "+listNumerosDesFicStr);
- var tab = listNumerosDesFicStr.split(",");
-
- //for each file (file's index):
- for (var t2 in tab) {
- var temp = tab[t2].toString();
- if (fileAndWordList[temp] == undefined) {
-
- fileAndWordList[temp] = "" + mots[t];
- } else {
-
- fileAndWordList[temp] += "," + mots[t];
- }
- }
- }
-
- var fileAndWordListValuesOnly = new Array();
-
- // sort results according to values
- var temptab = new Array();
- for (t in fileAndWordList) {
- tab = fileAndWordList[t].split(',');
-
- var tempDisplay = new Array();
- for (var x in tab) {
- if(stemQueryMap[tab[x]] != undefined){
- tempDisplay.push(stemQueryMap[tab[x]]); //get the original word from the stem word.
- } else {
- tempDisplay.push(tab[x]); //no stem is available. (probably a CJK language)
- }
- }
- var tempDispString = tempDisplay.join(", ");
-
- temptab.push(new resultPerFile(t, fileAndWordList[t], tab.length, tempDispString));
- fileAndWordListValuesOnly.push(fileAndWordList[t]);
- }
-
-
- //alert("t"+fileAndWordListValuesOnly.toString());
-
- fileAndWordListValuesOnly = unique(fileAndWordListValuesOnly);
- fileAndWordListValuesOnly = fileAndWordListValuesOnly.sort(compare_nbMots);
- //alert("t: "+fileAndWordListValuesOnly.join(';'));
-
- var listToOutput = new Array();
-
- for (var j in fileAndWordListValuesOnly) {
- for (t in temptab) {
- if (temptab[t].motsliste == fileAndWordListValuesOnly[j]) {
- if (listToOutput[j] == undefined) {
- listToOutput[j] = new Array(temptab[t]);
- } else {
- listToOutput[j].push(temptab[t]);
- }
- }
- }
- }
- return listToOutput;
-}
-
-function resultPerFile(filenb, motsliste, motsnb, motslisteDisplay) {
- this.filenb = filenb;
- this.motsliste = motsliste;
- this.motsnb = motsnb;
- this.motslisteDisplay= motslisteDisplay;
-}
-
-function compare_nbMots(s1, s2) {
- var t1 = s1.split(',');
- var t2 = s2.split(',');
- //alert ("s1:"+t1.length + " " +t2.length)
- if (t1.length == t2.length) {
- return 0;
- } else if (t1.length > t2.length) {
- return 1;
- } else {
- return -1;
- }
- //return t1.length - t2.length);
+/*---------------------------------------------------------------------------- + * JavaScript for webhelp search + *---------------------------------------------------------------------------- + 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 + */ + +//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', expressionInput); + + + 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) { + + /* 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, "</").replace(/_di_/g, "%24_"); + + searchFor = searchFor.replace(/ +/g, " "); + searchFor = searchFor.replace(/ $/, "").replace(/^ /, ""); + + wordsList = searchFor.split(" "); + wordsList.sort(); + + //set the tokenizing method + if(typeof indexerLanguage != "undefined" && (indexerLanguage=="zh" || indexerLanguage=="ja" ||indexerLanguage=="ko")){ + useCJKTokenizing=true; + } else { + useCJKTokenizing=false; + } + //If Lucene CJKTokenizer was used as the indexer, then useCJKTokenizing will be true. Else, do normal tokenizing. + // 2-gram tokenizinghappens in CJKTokenizing, + if(useCJKTokenizing){ + finalWordsList = cjkTokenize(wordsList); + } else { + finalWordsList = tokenize(wordsList); + } + + //load the scripts with the indices: the following lines do not work on the server. To be corrected + /*if (IEBrowser) { + scriptsarray = loadTheIndexScripts (scriptLetterTab); + } */ + + /** + * Compare with the indexed words (in the w[] array), and push words that are in it to tempTab. + */ + var tempTab = new Array(); + for (var t in finalWordsList) { + if (w[finalWordsList[t].toString()] == undefined) { + txt_wordsnotfound += finalWordsList[t] + " "; + } else { + tempTab.push(finalWordsList[t]); + } + } + finalWordsList = tempTab; + + if (finalWordsList.length) { + + //search 'and' and 'or' one time + fileAndWordList = SortResults(finalWordsList); + + var cpt = fileAndWordList.length; + for (var i = cpt - 1; i >= 0; i--) { + if (fileAndWordList[i] != undefined) { + linkTab.push("<p>" + txt_results_for + " " + "<span class=\"searchExpression\">" + fileAndWordList[i][0].motslisteDisplay + "</span>" + "</p>"); + + linkTab.push("<ul class='searchresult'>"); + for (t in fileAndWordList[i]) { + //DEBUG: alert(": "+ fileAndWordList[i][t].filenb+" " +fileAndWordList[i][t].motsliste); + //linkTab.push("<li><a href=\"../"+fl[fileAndWordList[i][t].filenb]+"\">"+fl[fileAndWordList[i][t].filenb]+"</a></li>"); + var tempInfo = fil[fileAndWordList[i][t].filenb]; + var pos1 = tempInfo.indexOf("@@@"); + var pos2 = tempInfo.lastIndexOf("@@@"); + var tempPath = tempInfo.substring(0, pos1); + var tempTitle = tempInfo.substring(pos1 + 3, pos2); + var tempShortdesc = tempInfo.substring(pos2 + 3, tempInfo.length); + + //file:///home/kasun/docbook/WEBHELP/webhelp-draft-output-format-idea/src/main/resources/web/webhelp/installation.html + var linkString = "<li><a href=" + tempPath + ">" + tempTitle + "</a>"; + // var linkString = "<li><a href=\"installation.html\">" + tempTitle + "</a>"; + if ((tempShortdesc != "null")) { + linkString += "\n<div class=\"shortdesclink\">" + tempShortdesc + "</div>"; + } + linkString += "</li>"; + linkTab.push(linkString); + } + linkTab.push("</ul>"); + } + } + } + + var results = ""; + if (linkTab.length > 0) { + /*writeln ("<p>" + txt_results_for + " " + "<span class=\"searchExpression\">" + cleanwordsList + "</span>" + "<br/>"+"</p>");*/ + results = "<p>"; + //write("<ul class='searchresult'>"); + for (t in linkTab) { + results += linkTab[t].toString(); + } + results += "</p>"; + } else { + results = "<p>" + txt_no_results_for + "<span class=\"searchExpression\">" + txt_wordsnotfound + "</span>" + "</p>"; + } + //alert(results); + document.getElementById('searchResults').innerHTML = results; +} + +function tokenize(wordsList){ + var stemmedWordsList = new Array(); // Array with the words to look for after removing spaces + var cleanwordsList = new Array(); // Array with the words to look for + for(var j in wordsList){ + var word = wordsList[j]; + if(typeof stemmer != "undefined" ){ + stemQueryMap[stemmer(word)] = word; + } else { + stemQueryMap[word] = word; + } + } + //stemmedWordsList is the stemmed list of words separated by spaces. + for (var t in wordsList) { + wordsList[t] = wordsList[t].replace(/(%22)|^-/g, ""); + if (wordsList[t] != "%20") { + scriptLetterTab.add(wordsList[t].charAt(0)); + cleanwordsList.push(wordsList[t]); + } + } + + if(typeof stemmer != "undefined" ){ + //Do the stemming using Porter's stemming algorithm + for (var i = 0; i < cleanwordsList.length; i++) { + var stemWord = stemmer(cleanwordsList[i]); + stemmedWordsList.push(stemWord); + } + } else { + stemmedWordsList = cleanwordsList; + } + return stemmedWordsList; +} + +//Invoker of CJKTokenizer class methods. +function cjkTokenize(wordsList){ + var allTokens= new Array(); + var notCJKTokens= new Array(); + var j=0; + for(j=0;j<wordsList.length;j++){ + var word = wordsList[j]; + if(getAvgAsciiValue(word) < 127){ + notCJKTokens.push(word); + } else { + var tokenizer = new CJKTokenizer(word); + var tokensTmp = tokenizer.getAllTokens(); + allTokens = allTokens.concat(tokensTmp); + } + } + allTokens = allTokens.concat(tokenize(notCJKTokens)); + return allTokens; +} + +//A simple way to determine whether the query is in english or not. +function getAvgAsciiValue(word){ + var tmp = 0; + var num = word.length < 5 ? word.length:5; + for(var i=0;i<num;i++){ + if(i==5) break; + tmp += word.charCodeAt(i); + } + return tmp/num; +} + +//CJKTokenizer +function CJKTokenizer(input){ + this.input = input; + this.offset=-1; + this.tokens = new Array(); + this.incrementToken = incrementToken; + this.tokenize = tokenize; + this.getAllTokens = getAllTokens; + this.unique = unique; + + function incrementToken(){ + if(this.input.length - 2 <= this.offset){ + // console.log("false "+offset); + return false; + } + else { + this.offset+=1; + return true; + } + } + + function tokenize(){ + //document.getElementById("content").innerHTML += x.substring(offset,offset+2)+"<br>"; + return this.input.substring(this.offset,this.offset+2); + } + + function getAllTokens(){ + while(this.incrementToken()){ + var tmp = this.tokenize(); + this.tokens.push(tmp); + } + return this.unique(this.tokens); +// document.getElementById("content").innerHTML += tokens+" "; +// document.getElementById("content").innerHTML += "<br>dada"+sortedTokens+" "; +// console.log(tokens.length+"dsdsds"); + /*for(i=0;i<tokens.length;i++){ + console.log(tokens[i]); + var ss = tokens[i] == sortedTokens[i]; + +// document.getElementById("content").innerHTML += "<br>dada"+un[i]+"- "+stems[i]+" "+ ss; + document.getElementById("content").innerHTML += "<br>"+sortedTokens[i]; + }*/ + } + + function unique(a) + { + var r = new Array(); + o:for(var i = 0, n = a.length; i < n; i++) + { + for(var x = 0, y = r.length; x < y; x++) + { + if(r[x]==a[i]) continue o; + } + r[r.length] = a[i]; + } + return r; + } +} + + +/* Scriptfirstchar: to gather the first letter of index js files to upload */ +function Scriptfirstchar() { + this.strLetters = ""; + this.add = addLettre; +} + +function addLettre(caract) { + + if (this.strLetters == 'undefined') { + this.strLetters = caract; + } else if (this.strLetters.indexOf(caract) < 0) { + this.strLetters += caract; + } + + return 0; +} +/* end of scriptfirstchar */ + +/*main loader function*/ +/*tab contains the first letters of each word looked for*/ +function loadTheIndexScripts(tab) { + + //alert (tab.strLetters); + var scriptsarray = new Array(); + + for (var i = 0; i < tab.strLetters.length; i++) { + + scriptsarray[i] = "..\/search" + "\/" + tab.strLetters.charAt(i) + ".js"; + } + // add the list of html files + i++; + scriptsarray[i] = "..\/search" + "\/" + htmlfileList; + + //debug + for (var t in scriptsarray) { + //alert (scriptsarray[t]); + } + + tab = new ScriptLoader(); + for (t in scriptsarray) { + tab.add(scriptsarray[t]); + } + tab.load(); + //alert ("scripts loaded"); + return (scriptsarray); +} + +/* ScriptLoader: to load the scripts and wait that it's finished */ +function ScriptLoader() { + this.cpt = 0; + this.scriptTab = new Array(); + this.add = addAScriptInTheList; + this.load = loadTheScripts; + this.onScriptLoaded = onScriptLoadedFunc; +} + +function addAScriptInTheList(scriptPath) { + this.scriptTab.push(scriptPath); +} + +function loadTheScripts() { + var script; + var head; + + head = document.getElementsByTagName('head').item(0); + + //script = document.createElement('script'); + + for (var el in this.scriptTab) { + //alert (el+this.scriptTab[el]); + script = document.createElement('script'); + script.src = this.scriptTab[el]; + script.type = 'text/javascript'; + script.defer = false; + + head.appendChild(script); + } + +} + +function onScriptLoadedFunc(e) { + e = e || window.event; + var target = e.target || e.srcElement; + var isComplete = true; + if (typeof target.readyState != undefined) { + + isComplete = (target.readyState == "complete" || target.readyState == "loaded"); + } + if (isComplete) { + ScriptLoader.cpt++; + if (ScriptLoader.cpt == ScriptLoader.scripts.length) { + ScriptLoader.onLoadComplete(); + } + } +} + +/* +function onLoadComplete() { + alert("loaded !!"); +} */ + +/* End of scriptloader functions */ + +// Array.unique( strict ) - Remove duplicate values +function unique(tab) { + var a = new Array(); + var i; + var l = tab.length; + + if (tab[0] != undefined) { + a[0] = tab[0]; + } + else { + return -1 + } + + for (i = 1; i < l; i++) { + if (indexof(a, tab[i], 0) < 0) { + a.push(tab[i]); + } + } + return a; +} +function indexof(tab, element, begin) { + for (var i = begin; i < tab.length; i++) { + if (tab[i] == element) { + return i; + } + } + return -1; + +} +/* end of Array functions */ + + +/* + Param: mots= list of words to look for. + This function creates an hashtable: + - The key is the index of a html file which contains a word to look for. + - The value is the list of all words contained in the html file. + + Return value: the hashtable fileAndWordList + */ +function SortResults(mots) { + + var fileAndWordList = new Object(); + if (mots.length == 0) { + return null; + } + + for (var t in mots) { + // get the list of the indices of the files. + var listNumerosDesFicStr = w[mots[t].toString()]; + //alert ("listNumerosDesFicStr "+listNumerosDesFicStr); + var tab = listNumerosDesFicStr.split(","); + + //for each file (file's index): + for (var t2 in tab) { + var temp = tab[t2].toString(); + if (fileAndWordList[temp] == undefined) { + + fileAndWordList[temp] = "" + mots[t]; + } else { + + fileAndWordList[temp] += "," + mots[t]; + } + } + } + + var fileAndWordListValuesOnly = new Array(); + + // sort results according to values + var temptab = new Array(); + for (t in fileAndWordList) { + tab = fileAndWordList[t].split(','); + + var tempDisplay = new Array(); + for (var x in tab) { + if(stemQueryMap[tab[x]] != undefined){ + tempDisplay.push(stemQueryMap[tab[x]]); //get the original word from the stem word. + } else { + tempDisplay.push(tab[x]); //no stem is available. (probably a CJK language) + } + } + var tempDispString = tempDisplay.join(", "); + + temptab.push(new resultPerFile(t, fileAndWordList[t], tab.length, tempDispString)); + fileAndWordListValuesOnly.push(fileAndWordList[t]); + } + + + //alert("t"+fileAndWordListValuesOnly.toString()); + + fileAndWordListValuesOnly = unique(fileAndWordListValuesOnly); + fileAndWordListValuesOnly = fileAndWordListValuesOnly.sort(compare_nbMots); + //alert("t: "+fileAndWordListValuesOnly.join(';')); + + var listToOutput = new Array(); + + for (var j in fileAndWordListValuesOnly) { + for (t in temptab) { + if (temptab[t].motsliste == fileAndWordListValuesOnly[j]) { + if (listToOutput[j] == undefined) { + listToOutput[j] = new Array(temptab[t]); + } else { + listToOutput[j].push(temptab[t]); + } + } + } + } + return listToOutput; +} + +function resultPerFile(filenb, motsliste, motsnb, motslisteDisplay) { + this.filenb = filenb; + this.motsliste = motsliste; + this.motsnb = motsnb; + this.motslisteDisplay= motslisteDisplay; +} + +function compare_nbMots(s1, s2) { + var t1 = s1.split(','); + var t2 = s2.split(','); + //alert ("s1:"+t1.length + " " +t2.length) + if (t1.length == t2.length) { + return 0; + } else if (t1.length > t2.length) { + return 1; + } else { + return -1; + } + //return t1.length - t2.length); }
\ No newline at end of file diff --git a/installer/2/en/content/resizeFATChoose.html b/installer/2/en/content/resizeFATChoose.html index 1ad17aa7..09e382f3 100644 --- a/installer/2/en/content/resizeFATChoose.html +++ b/installer/2/en/content/resizeFATChoose.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>8. Resize Windows® partition</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="doPartitionDisks.html" title="7. Partitioning"/><link rel="next" href="takeOverHdChoose.html" title="9. Choose hard disk to erase for Mageia"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/search/nwSearchFnt.js b/installer/2/en/content/search/nwSearchFnt.js index 0111559c..0c4336d7 100644 --- a/installer/2/en/content/search/nwSearchFnt.js +++ b/installer/2/en/content/search/nwSearchFnt.js @@ -1,513 +1,513 @@ -/*----------------------------------------------------------------------------
- * JavaScript for webhelp search
- *----------------------------------------------------------------------------
- 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
- */
-
-//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', expressionInput);
-
-
- 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) {
-
- /* 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, "</").replace(/_di_/g, "%24_");
-
- searchFor = searchFor.replace(/ +/g, " ");
- searchFor = searchFor.replace(/ $/, "").replace(/^ /, "");
-
- wordsList = searchFor.split(" ");
- wordsList.sort();
-
- //set the tokenizing method
- if(typeof indexerLanguage != "undefined" && (indexerLanguage=="zh" || indexerLanguage=="ja" ||indexerLanguage=="ko")){
- useCJKTokenizing=true;
- } else {
- useCJKTokenizing=false;
- }
- //If Lucene CJKTokenizer was used as the indexer, then useCJKTokenizing will be true. Else, do normal tokenizing.
- // 2-gram tokenizinghappens in CJKTokenizing,
- if(useCJKTokenizing){
- finalWordsList = cjkTokenize(wordsList);
- } else {
- finalWordsList = tokenize(wordsList);
- }
-
- //load the scripts with the indices: the following lines do not work on the server. To be corrected
- /*if (IEBrowser) {
- scriptsarray = loadTheIndexScripts (scriptLetterTab);
- } */
-
- /**
- * Compare with the indexed words (in the w[] array), and push words that are in it to tempTab.
- */
- var tempTab = new Array();
- for (var t in finalWordsList) {
- if (w[finalWordsList[t].toString()] == undefined) {
- txt_wordsnotfound += finalWordsList[t] + " ";
- } else {
- tempTab.push(finalWordsList[t]);
- }
- }
- finalWordsList = tempTab;
-
- if (finalWordsList.length) {
-
- //search 'and' and 'or' one time
- fileAndWordList = SortResults(finalWordsList);
-
- var cpt = fileAndWordList.length;
- for (var i = cpt - 1; i >= 0; i--) {
- if (fileAndWordList[i] != undefined) {
- linkTab.push("<p>" + txt_results_for + " " + "<span class=\"searchExpression\">" + fileAndWordList[i][0].motslisteDisplay + "</span>" + "</p>");
-
- linkTab.push("<ul class='searchresult'>");
- for (t in fileAndWordList[i]) {
- //DEBUG: alert(": "+ fileAndWordList[i][t].filenb+" " +fileAndWordList[i][t].motsliste);
- //linkTab.push("<li><a href=\"../"+fl[fileAndWordList[i][t].filenb]+"\">"+fl[fileAndWordList[i][t].filenb]+"</a></li>");
- var tempInfo = fil[fileAndWordList[i][t].filenb];
- var pos1 = tempInfo.indexOf("@@@");
- var pos2 = tempInfo.lastIndexOf("@@@");
- var tempPath = tempInfo.substring(0, pos1);
- var tempTitle = tempInfo.substring(pos1 + 3, pos2);
- var tempShortdesc = tempInfo.substring(pos2 + 3, tempInfo.length);
-
- //file:///home/kasun/docbook/WEBHELP/webhelp-draft-output-format-idea/src/main/resources/web/webhelp/installation.html
- var linkString = "<li><a href=" + tempPath + ">" + tempTitle + "</a>";
- // var linkString = "<li><a href=\"installation.html\">" + tempTitle + "</a>";
- if ((tempShortdesc != "null")) {
- linkString += "\n<div class=\"shortdesclink\">" + tempShortdesc + "</div>";
- }
- linkString += "</li>";
- linkTab.push(linkString);
- }
- linkTab.push("</ul>");
- }
- }
- }
-
- var results = "";
- if (linkTab.length > 0) {
- /*writeln ("<p>" + txt_results_for + " " + "<span class=\"searchExpression\">" + cleanwordsList + "</span>" + "<br/>"+"</p>");*/
- results = "<p>";
- //write("<ul class='searchresult'>");
- for (t in linkTab) {
- results += linkTab[t].toString();
- }
- results += "</p>";
- } else {
- results = "<p>" + "Your search returned no results for " + "<span class=\"searchExpression\">" + txt_wordsnotfound + "</span>" + "</p>";
- }
- //alert(results);
- document.getElementById('searchResults').innerHTML = results;
-}
-
-function tokenize(wordsList){
- var stemmedWordsList = new Array(); // Array with the words to look for after removing spaces
- var cleanwordsList = new Array(); // Array with the words to look for
- for(var j in wordsList){
- var word = wordsList[j];
- if(typeof stemmer != "undefined" ){
- stemQueryMap[stemmer(word)] = word;
- } else {
- stemQueryMap[word] = word;
- }
- }
- //stemmedWordsList is the stemmed list of words separated by spaces.
- for (var t in wordsList) {
- wordsList[t] = wordsList[t].replace(/(%22)|^-/g, "");
- if (wordsList[t] != "%20") {
- scriptLetterTab.add(wordsList[t].charAt(0));
- cleanwordsList.push(wordsList[t]);
- }
- }
-
- if(typeof stemmer != "undefined" ){
- //Do the stemming using Porter's stemming algorithm
- for (var i = 0; i < cleanwordsList.length; i++) {
- var stemWord = stemmer(cleanwordsList[i]);
- stemmedWordsList.push(stemWord);
- }
- } else {
- stemmedWordsList = cleanwordsList;
- }
- return stemmedWordsList;
-}
-
-//Invoker of CJKTokenizer class methods.
-function cjkTokenize(wordsList){
- var allTokens= new Array();
- var notCJKTokens= new Array();
- var j=0;
- for(j=0;j<wordsList.length;j++){
- var word = wordsList[j];
- if(getAvgAsciiValue(word) < 127){
- notCJKTokens.push(word);
- } else {
- var tokenizer = new CJKTokenizer(word);
- var tokensTmp = tokenizer.getAllTokens();
- allTokens = allTokens.concat(tokensTmp);
- }
- }
- allTokens = allTokens.concat(tokenize(notCJKTokens));
- return allTokens;
-}
-
-//A simple way to determine whether the query is in english or not.
-function getAvgAsciiValue(word){
- var tmp = 0;
- var num = word.length < 5 ? word.length:5;
- for(var i=0;i<num;i++){
- if(i==5) break;
- tmp += word.charCodeAt(i);
- }
- return tmp/num;
-}
-
-//CJKTokenizer
-function CJKTokenizer(input){
- this.input = input;
- this.offset=-1;
- this.tokens = new Array();
- this.incrementToken = incrementToken;
- this.tokenize = tokenize;
- this.getAllTokens = getAllTokens;
- this.unique = unique;
-
- function incrementToken(){
- if(this.input.length - 2 <= this.offset){
- // console.log("false "+offset);
- return false;
- }
- else {
- this.offset+=1;
- return true;
- }
- }
-
- function tokenize(){
- //document.getElementById("content").innerHTML += x.substring(offset,offset+2)+"<br>";
- return this.input.substring(this.offset,this.offset+2);
- }
-
- function getAllTokens(){
- while(this.incrementToken()){
- var tmp = this.tokenize();
- this.tokens.push(tmp);
- }
- return this.unique(this.tokens);
-// document.getElementById("content").innerHTML += tokens+" ";
-// document.getElementById("content").innerHTML += "<br>dada"+sortedTokens+" ";
-// console.log(tokens.length+"dsdsds");
- /*for(i=0;i<tokens.length;i++){
- console.log(tokens[i]);
- var ss = tokens[i] == sortedTokens[i];
-
-// document.getElementById("content").innerHTML += "<br>dada"+un[i]+"- "+stems[i]+" "+ ss;
- document.getElementById("content").innerHTML += "<br>"+sortedTokens[i];
- }*/
- }
-
- function unique(a)
- {
- var r = new Array();
- o:for(var i = 0, n = a.length; i < n; i++)
- {
- for(var x = 0, y = r.length; x < y; x++)
- {
- if(r[x]==a[i]) continue o;
- }
- r[r.length] = a[i];
- }
- return r;
- }
-}
-
-
-/* Scriptfirstchar: to gather the first letter of index js files to upload */
-function Scriptfirstchar() {
- this.strLetters = "";
- this.add = addLettre;
-}
-
-function addLettre(caract) {
-
- if (this.strLetters == 'undefined') {
- this.strLetters = caract;
- } else if (this.strLetters.indexOf(caract) < 0) {
- this.strLetters += caract;
- }
-
- return 0;
-}
-/* end of scriptfirstchar */
-
-/*main loader function*/
-/*tab contains the first letters of each word looked for*/
-function loadTheIndexScripts(tab) {
-
- //alert (tab.strLetters);
- var scriptsarray = new Array();
-
- for (var i = 0; i < tab.strLetters.length; i++) {
-
- scriptsarray[i] = "..\/search" + "\/" + tab.strLetters.charAt(i) + ".js";
- }
- // add the list of html files
- i++;
- scriptsarray[i] = "..\/search" + "\/" + htmlfileList;
-
- //debug
- for (var t in scriptsarray) {
- //alert (scriptsarray[t]);
- }
-
- tab = new ScriptLoader();
- for (t in scriptsarray) {
- tab.add(scriptsarray[t]);
- }
- tab.load();
- //alert ("scripts loaded");
- return (scriptsarray);
-}
-
-/* ScriptLoader: to load the scripts and wait that it's finished */
-function ScriptLoader() {
- this.cpt = 0;
- this.scriptTab = new Array();
- this.add = addAScriptInTheList;
- this.load = loadTheScripts;
- this.onScriptLoaded = onScriptLoadedFunc;
-}
-
-function addAScriptInTheList(scriptPath) {
- this.scriptTab.push(scriptPath);
-}
-
-function loadTheScripts() {
- var script;
- var head;
-
- head = document.getElementsByTagName('head').item(0);
-
- //script = document.createElement('script');
-
- for (var el in this.scriptTab) {
- //alert (el+this.scriptTab[el]);
- script = document.createElement('script');
- script.src = this.scriptTab[el];
- script.type = 'text/javascript';
- script.defer = false;
-
- head.appendChild(script);
- }
-
-}
-
-function onScriptLoadedFunc(e) {
- e = e || window.event;
- var target = e.target || e.srcElement;
- var isComplete = true;
- if (typeof target.readyState != undefined) {
-
- isComplete = (target.readyState == "complete" || target.readyState == "loaded");
- }
- if (isComplete) {
- ScriptLoader.cpt++;
- if (ScriptLoader.cpt == ScriptLoader.scripts.length) {
- ScriptLoader.onLoadComplete();
- }
- }
-}
-
-/*
-function onLoadComplete() {
- alert("loaded !!");
-} */
-
-/* End of scriptloader functions */
-
-// Array.unique( strict ) - Remove duplicate values
-function unique(tab) {
- var a = new Array();
- var i;
- var l = tab.length;
-
- if (tab[0] != undefined) {
- a[0] = tab[0];
- }
- else {
- return -1
- }
-
- for (i = 1; i < l; i++) {
- if (indexof(a, tab[i], 0) < 0) {
- a.push(tab[i]);
- }
- }
- return a;
-}
-function indexof(tab, element, begin) {
- for (var i = begin; i < tab.length; i++) {
- if (tab[i] == element) {
- return i;
- }
- }
- return -1;
-
-}
-/* end of Array functions */
-
-
-/*
- Param: mots= list of words to look for.
- This function creates an hashtable:
- - The key is the index of a html file which contains a word to look for.
- - The value is the list of all words contained in the html file.
-
- Return value: the hashtable fileAndWordList
- */
-function SortResults(mots) {
-
- var fileAndWordList = new Object();
- if (mots.length == 0) {
- return null;
- }
-
- for (var t in mots) {
- // get the list of the indices of the files.
- var listNumerosDesFicStr = w[mots[t].toString()];
- //alert ("listNumerosDesFicStr "+listNumerosDesFicStr);
- var tab = listNumerosDesFicStr.split(",");
-
- //for each file (file's index):
- for (var t2 in tab) {
- var temp = tab[t2].toString();
- if (fileAndWordList[temp] == undefined) {
-
- fileAndWordList[temp] = "" + mots[t];
- } else {
-
- fileAndWordList[temp] += "," + mots[t];
- }
- }
- }
-
- var fileAndWordListValuesOnly = new Array();
-
- // sort results according to values
- var temptab = new Array();
- for (t in fileAndWordList) {
- tab = fileAndWordList[t].split(',');
-
- var tempDisplay = new Array();
- for (var x in tab) {
- if(stemQueryMap[tab[x]] != undefined){
- tempDisplay.push(stemQueryMap[tab[x]]); //get the original word from the stem word.
- } else {
- tempDisplay.push(tab[x]); //no stem is available. (probably a CJK language)
- }
- }
- var tempDispString = tempDisplay.join(", ");
-
- temptab.push(new resultPerFile(t, fileAndWordList[t], tab.length, tempDispString));
- fileAndWordListValuesOnly.push(fileAndWordList[t]);
- }
-
-
- //alert("t"+fileAndWordListValuesOnly.toString());
-
- fileAndWordListValuesOnly = unique(fileAndWordListValuesOnly);
- fileAndWordListValuesOnly = fileAndWordListValuesOnly.sort(compare_nbMots);
- //alert("t: "+fileAndWordListValuesOnly.join(';'));
-
- var listToOutput = new Array();
-
- for (var j in fileAndWordListValuesOnly) {
- for (t in temptab) {
- if (temptab[t].motsliste == fileAndWordListValuesOnly[j]) {
- if (listToOutput[j] == undefined) {
- listToOutput[j] = new Array(temptab[t]);
- } else {
- listToOutput[j].push(temptab[t]);
- }
- }
- }
- }
- return listToOutput;
-}
-
-function resultPerFile(filenb, motsliste, motsnb, motslisteDisplay) {
- this.filenb = filenb;
- this.motsliste = motsliste;
- this.motsnb = motsnb;
- this.motslisteDisplay= motslisteDisplay;
-}
-
-function compare_nbMots(s1, s2) {
- var t1 = s1.split(',');
- var t2 = s2.split(',');
- //alert ("s1:"+t1.length + " " +t2.length)
- if (t1.length == t2.length) {
- return 0;
- } else if (t1.length > t2.length) {
- return 1;
- } else {
- return -1;
- }
- //return t1.length - t2.length);
+/*---------------------------------------------------------------------------- + * JavaScript for webhelp search + *---------------------------------------------------------------------------- + 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 + */ + +//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', expressionInput); + + + 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) { + + /* 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, "</").replace(/_di_/g, "%24_"); + + searchFor = searchFor.replace(/ +/g, " "); + searchFor = searchFor.replace(/ $/, "").replace(/^ /, ""); + + wordsList = searchFor.split(" "); + wordsList.sort(); + + //set the tokenizing method + if(typeof indexerLanguage != "undefined" && (indexerLanguage=="zh" || indexerLanguage=="ja" ||indexerLanguage=="ko")){ + useCJKTokenizing=true; + } else { + useCJKTokenizing=false; + } + //If Lucene CJKTokenizer was used as the indexer, then useCJKTokenizing will be true. Else, do normal tokenizing. + // 2-gram tokenizinghappens in CJKTokenizing, + if(useCJKTokenizing){ + finalWordsList = cjkTokenize(wordsList); + } else { + finalWordsList = tokenize(wordsList); + } + + //load the scripts with the indices: the following lines do not work on the server. To be corrected + /*if (IEBrowser) { + scriptsarray = loadTheIndexScripts (scriptLetterTab); + } */ + + /** + * Compare with the indexed words (in the w[] array), and push words that are in it to tempTab. + */ + var tempTab = new Array(); + for (var t in finalWordsList) { + if (w[finalWordsList[t].toString()] == undefined) { + txt_wordsnotfound += finalWordsList[t] + " "; + } else { + tempTab.push(finalWordsList[t]); + } + } + finalWordsList = tempTab; + + if (finalWordsList.length) { + + //search 'and' and 'or' one time + fileAndWordList = SortResults(finalWordsList); + + var cpt = fileAndWordList.length; + for (var i = cpt - 1; i >= 0; i--) { + if (fileAndWordList[i] != undefined) { + linkTab.push("<p>" + txt_results_for + " " + "<span class=\"searchExpression\">" + fileAndWordList[i][0].motslisteDisplay + "</span>" + "</p>"); + + linkTab.push("<ul class='searchresult'>"); + for (t in fileAndWordList[i]) { + //DEBUG: alert(": "+ fileAndWordList[i][t].filenb+" " +fileAndWordList[i][t].motsliste); + //linkTab.push("<li><a href=\"../"+fl[fileAndWordList[i][t].filenb]+"\">"+fl[fileAndWordList[i][t].filenb]+"</a></li>"); + var tempInfo = fil[fileAndWordList[i][t].filenb]; + var pos1 = tempInfo.indexOf("@@@"); + var pos2 = tempInfo.lastIndexOf("@@@"); + var tempPath = tempInfo.substring(0, pos1); + var tempTitle = tempInfo.substring(pos1 + 3, pos2); + var tempShortdesc = tempInfo.substring(pos2 + 3, tempInfo.length); + + //file:///home/kasun/docbook/WEBHELP/webhelp-draft-output-format-idea/src/main/resources/web/webhelp/installation.html + var linkString = "<li><a href=" + tempPath + ">" + tempTitle + "</a>"; + // var linkString = "<li><a href=\"installation.html\">" + tempTitle + "</a>"; + if ((tempShortdesc != "null")) { + linkString += "\n<div class=\"shortdesclink\">" + tempShortdesc + "</div>"; + } + linkString += "</li>"; + linkTab.push(linkString); + } + linkTab.push("</ul>"); + } + } + } + + var results = ""; + if (linkTab.length > 0) { + /*writeln ("<p>" + txt_results_for + " " + "<span class=\"searchExpression\">" + cleanwordsList + "</span>" + "<br/>"+"</p>");*/ + results = "<p>"; + //write("<ul class='searchresult'>"); + for (t in linkTab) { + results += linkTab[t].toString(); + } + results += "</p>"; + } else { + results = "<p>" + "Your search returned no results for " + "<span class=\"searchExpression\">" + txt_wordsnotfound + "</span>" + "</p>"; + } + //alert(results); + document.getElementById('searchResults').innerHTML = results; +} + +function tokenize(wordsList){ + var stemmedWordsList = new Array(); // Array with the words to look for after removing spaces + var cleanwordsList = new Array(); // Array with the words to look for + for(var j in wordsList){ + var word = wordsList[j]; + if(typeof stemmer != "undefined" ){ + stemQueryMap[stemmer(word)] = word; + } else { + stemQueryMap[word] = word; + } + } + //stemmedWordsList is the stemmed list of words separated by spaces. + for (var t in wordsList) { + wordsList[t] = wordsList[t].replace(/(%22)|^-/g, ""); + if (wordsList[t] != "%20") { + scriptLetterTab.add(wordsList[t].charAt(0)); + cleanwordsList.push(wordsList[t]); + } + } + + if(typeof stemmer != "undefined" ){ + //Do the stemming using Porter's stemming algorithm + for (var i = 0; i < cleanwordsList.length; i++) { + var stemWord = stemmer(cleanwordsList[i]); + stemmedWordsList.push(stemWord); + } + } else { + stemmedWordsList = cleanwordsList; + } + return stemmedWordsList; +} + +//Invoker of CJKTokenizer class methods. +function cjkTokenize(wordsList){ + var allTokens= new Array(); + var notCJKTokens= new Array(); + var j=0; + for(j=0;j<wordsList.length;j++){ + var word = wordsList[j]; + if(getAvgAsciiValue(word) < 127){ + notCJKTokens.push(word); + } else { + var tokenizer = new CJKTokenizer(word); + var tokensTmp = tokenizer.getAllTokens(); + allTokens = allTokens.concat(tokensTmp); + } + } + allTokens = allTokens.concat(tokenize(notCJKTokens)); + return allTokens; +} + +//A simple way to determine whether the query is in english or not. +function getAvgAsciiValue(word){ + var tmp = 0; + var num = word.length < 5 ? word.length:5; + for(var i=0;i<num;i++){ + if(i==5) break; + tmp += word.charCodeAt(i); + } + return tmp/num; +} + +//CJKTokenizer +function CJKTokenizer(input){ + this.input = input; + this.offset=-1; + this.tokens = new Array(); + this.incrementToken = incrementToken; + this.tokenize = tokenize; + this.getAllTokens = getAllTokens; + this.unique = unique; + + function incrementToken(){ + if(this.input.length - 2 <= this.offset){ + // console.log("false "+offset); + return false; + } + else { + this.offset+=1; + return true; + } + } + + function tokenize(){ + //document.getElementById("content").innerHTML += x.substring(offset,offset+2)+"<br>"; + return this.input.substring(this.offset,this.offset+2); + } + + function getAllTokens(){ + while(this.incrementToken()){ + var tmp = this.tokenize(); + this.tokens.push(tmp); + } + return this.unique(this.tokens); +// document.getElementById("content").innerHTML += tokens+" "; +// document.getElementById("content").innerHTML += "<br>dada"+sortedTokens+" "; +// console.log(tokens.length+"dsdsds"); + /*for(i=0;i<tokens.length;i++){ + console.log(tokens[i]); + var ss = tokens[i] == sortedTokens[i]; + +// document.getElementById("content").innerHTML += "<br>dada"+un[i]+"- "+stems[i]+" "+ ss; + document.getElementById("content").innerHTML += "<br>"+sortedTokens[i]; + }*/ + } + + function unique(a) + { + var r = new Array(); + o:for(var i = 0, n = a.length; i < n; i++) + { + for(var x = 0, y = r.length; x < y; x++) + { + if(r[x]==a[i]) continue o; + } + r[r.length] = a[i]; + } + return r; + } +} + + +/* Scriptfirstchar: to gather the first letter of index js files to upload */ +function Scriptfirstchar() { + this.strLetters = ""; + this.add = addLettre; +} + +function addLettre(caract) { + + if (this.strLetters == 'undefined') { + this.strLetters = caract; + } else if (this.strLetters.indexOf(caract) < 0) { + this.strLetters += caract; + } + + return 0; +} +/* end of scriptfirstchar */ + +/*main loader function*/ +/*tab contains the first letters of each word looked for*/ +function loadTheIndexScripts(tab) { + + //alert (tab.strLetters); + var scriptsarray = new Array(); + + for (var i = 0; i < tab.strLetters.length; i++) { + + scriptsarray[i] = "..\/search" + "\/" + tab.strLetters.charAt(i) + ".js"; + } + // add the list of html files + i++; + scriptsarray[i] = "..\/search" + "\/" + htmlfileList; + + //debug + for (var t in scriptsarray) { + //alert (scriptsarray[t]); + } + + tab = new ScriptLoader(); + for (t in scriptsarray) { + tab.add(scriptsarray[t]); + } + tab.load(); + //alert ("scripts loaded"); + return (scriptsarray); +} + +/* ScriptLoader: to load the scripts and wait that it's finished */ +function ScriptLoader() { + this.cpt = 0; + this.scriptTab = new Array(); + this.add = addAScriptInTheList; + this.load = loadTheScripts; + this.onScriptLoaded = onScriptLoadedFunc; +} + +function addAScriptInTheList(scriptPath) { + this.scriptTab.push(scriptPath); +} + +function loadTheScripts() { + var script; + var head; + + head = document.getElementsByTagName('head').item(0); + + //script = document.createElement('script'); + + for (var el in this.scriptTab) { + //alert (el+this.scriptTab[el]); + script = document.createElement('script'); + script.src = this.scriptTab[el]; + script.type = 'text/javascript'; + script.defer = false; + + head.appendChild(script); + } + +} + +function onScriptLoadedFunc(e) { + e = e || window.event; + var target = e.target || e.srcElement; + var isComplete = true; + if (typeof target.readyState != undefined) { + + isComplete = (target.readyState == "complete" || target.readyState == "loaded"); + } + if (isComplete) { + ScriptLoader.cpt++; + if (ScriptLoader.cpt == ScriptLoader.scripts.length) { + ScriptLoader.onLoadComplete(); + } + } +} + +/* +function onLoadComplete() { + alert("loaded !!"); +} */ + +/* End of scriptloader functions */ + +// Array.unique( strict ) - Remove duplicate values +function unique(tab) { + var a = new Array(); + var i; + var l = tab.length; + + if (tab[0] != undefined) { + a[0] = tab[0]; + } + else { + return -1 + } + + for (i = 1; i < l; i++) { + if (indexof(a, tab[i], 0) < 0) { + a.push(tab[i]); + } + } + return a; +} +function indexof(tab, element, begin) { + for (var i = begin; i < tab.length; i++) { + if (tab[i] == element) { + return i; + } + } + return -1; + +} +/* end of Array functions */ + + +/* + Param: mots= list of words to look for. + This function creates an hashtable: + - The key is the index of a html file which contains a word to look for. + - The value is the list of all words contained in the html file. + + Return value: the hashtable fileAndWordList + */ +function SortResults(mots) { + + var fileAndWordList = new Object(); + if (mots.length == 0) { + return null; + } + + for (var t in mots) { + // get the list of the indices of the files. + var listNumerosDesFicStr = w[mots[t].toString()]; + //alert ("listNumerosDesFicStr "+listNumerosDesFicStr); + var tab = listNumerosDesFicStr.split(","); + + //for each file (file's index): + for (var t2 in tab) { + var temp = tab[t2].toString(); + if (fileAndWordList[temp] == undefined) { + + fileAndWordList[temp] = "" + mots[t]; + } else { + + fileAndWordList[temp] += "," + mots[t]; + } + } + } + + var fileAndWordListValuesOnly = new Array(); + + // sort results according to values + var temptab = new Array(); + for (t in fileAndWordList) { + tab = fileAndWordList[t].split(','); + + var tempDisplay = new Array(); + for (var x in tab) { + if(stemQueryMap[tab[x]] != undefined){ + tempDisplay.push(stemQueryMap[tab[x]]); //get the original word from the stem word. + } else { + tempDisplay.push(tab[x]); //no stem is available. (probably a CJK language) + } + } + var tempDispString = tempDisplay.join(", "); + + temptab.push(new resultPerFile(t, fileAndWordList[t], tab.length, tempDispString)); + fileAndWordListValuesOnly.push(fileAndWordList[t]); + } + + + //alert("t"+fileAndWordListValuesOnly.toString()); + + fileAndWordListValuesOnly = unique(fileAndWordListValuesOnly); + fileAndWordListValuesOnly = fileAndWordListValuesOnly.sort(compare_nbMots); + //alert("t: "+fileAndWordListValuesOnly.join(';')); + + var listToOutput = new Array(); + + for (var j in fileAndWordListValuesOnly) { + for (t in temptab) { + if (temptab[t].motsliste == fileAndWordListValuesOnly[j]) { + if (listToOutput[j] == undefined) { + listToOutput[j] = new Array(temptab[t]); + } else { + listToOutput[j].push(temptab[t]); + } + } + } + } + return listToOutput; +} + +function resultPerFile(filenb, motsliste, motsnb, motslisteDisplay) { + this.filenb = filenb; + this.motsliste = motsliste; + this.motsnb = motsnb; + this.motslisteDisplay= motslisteDisplay; +} + +function compare_nbMots(s1, s2) { + var t1 = s1.split(','); + var t2 = s2.split(','); + //alert ("s1:"+t1.length + " " +t2.length) + if (t1.length == t2.length) { + return 0; + } else if (t1.length > t2.length) { + return 1; + } else { + return -1; + } + //return t1.length - t2.length); }
\ No newline at end of file diff --git a/installer/2/en/content/selectInstallClass.html b/installer/2/en/content/selectInstallClass.html index 98fe739d..36e6a867 100644 --- a/installer/2/en/content/selectInstallClass.html +++ b/installer/2/en/content/selectInstallClass.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>5. Install or Upgrade</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="setupSCSI.html" title="4. Setup SCSI"/><link rel="next" href="selectKeyboard.html" title="6. Keyboard"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/selectKeyboard.html b/installer/2/en/content/selectKeyboard.html index 50912672..bfd5e585 100644 --- a/installer/2/en/content/selectKeyboard.html +++ b/installer/2/en/content/selectKeyboard.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>6. Keyboard</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="selectInstallClass.html" title="5. Install or Upgrade"/><link rel="next" href="doPartitionDisks.html" title="7. Partitioning"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/selectLanguage.html b/installer/2/en/content/selectLanguage.html index 5c41ce81..355f0301 100644 --- a/installer/2/en/content/selectLanguage.html +++ b/installer/2/en/content/selectLanguage.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>2. Please choose a language to use</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="installer.html" title="1. DrakX, the Mageia Installer"/><link rel="next" href="acceptLicense.html" title="3. License and Release Notes"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/selectMouse.html b/installer/2/en/content/selectMouse.html index 2f5ff501..a30baddf 100644 --- a/installer/2/en/content/selectMouse.html +++ b/installer/2/en/content/selectMouse.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>20. Select mouse</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="misc-params.html" title="19. Summary of miscellaneous parameters"/><link rel="next" href="installUpdates.html" title="21. Updates"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/setupBootloaderBeginner.html b/installer/2/en/content/setupBootloaderBeginner.html index 802f6727..c20031da 100644 --- a/installer/2/en/content/setupBootloaderBeginner.html +++ b/installer/2/en/content/setupBootloaderBeginner.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>17. Bootloader main options</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="setupX.html" title="16. Set up X, graphic card and monitor configuration"/><link rel="next" href="setupBootloaderExpert.html" title="18. Bootloader expert use"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/setupBootloaderExpert.html b/installer/2/en/content/setupBootloaderExpert.html index 487e308a..81be16d3 100644 --- a/installer/2/en/content/setupBootloaderExpert.html +++ b/installer/2/en/content/setupBootloaderExpert.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>18. Bootloader expert use</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="setupBootloaderBeginner.html" title="17. Bootloader main options"/><link rel="next" href="misc-params.html" title="19. Summary of miscellaneous parameters"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/setupSCSI.html b/installer/2/en/content/setupSCSI.html index 8d9e57c6..a52a554e 100644 --- a/installer/2/en/content/setupSCSI.html +++ b/installer/2/en/content/setupSCSI.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>4. Setup SCSI</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="acceptLicense.html" title="3. License and Release Notes"/><link rel="next" href="selectInstallClass.html" title="5. Install or Upgrade"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/setupX.html b/installer/2/en/content/setupX.html index e3db6470..e39958b5 100644 --- a/installer/2/en/content/setupX.html +++ b/installer/2/en/content/setupX.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>16. Set up X, graphic card and monitor configuration</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="addUser.html" title="15. User and Superuser Management"/><link rel="next" href="setupBootloaderBeginner.html" title="17. Bootloader main options"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/takeOverHdChoose.html b/installer/2/en/content/takeOverHdChoose.html index f85cce53..f0cc1a3e 100644 --- a/installer/2/en/content/takeOverHdChoose.html +++ b/installer/2/en/content/takeOverHdChoose.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>9. Choose hard disk to erase for Mageia</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="resizeFATChoose.html" title="8. Resize Windows® partition"/><link rel="next" href="takeOverHdConfirm.html" title="10. Confirm hard disk to be formatted"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization diff --git a/installer/2/en/content/takeOverHdConfirm.html b/installer/2/en/content/takeOverHdConfirm.html index 77cee924..e561d778 100644 --- a/installer/2/en/content/takeOverHdConfirm.html +++ b/installer/2/en/content/takeOverHdConfirm.html @@ -5,7 +5,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=7"/> <title>10. Confirm hard disk to be formatted</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Installation with DrakX"/><link rel="up" href="index.html" title="Installation with DrakX"/><link rel="prev" href="takeOverHdChoose.html" title="9. Choose hard disk to erase for Mageia"/><link rel="next" href="ask_mntpoint_s.html" title="11. Choose the mount points"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript"> //The id for tree cookie - var treeCookieId = "treeview-1485"; + var treeCookieId = "treeview-1484"; var language = "en"; var w = new Object(); //Localization |