]> granicus.if.org Git - docbook-dsssl/commitdiff
Remove unnecessary bits of code from webhelp
authorKasun Gajasinghe <kasunbg@gmail.com>
Fri, 25 May 2012 15:41:03 +0000 (15:41 +0000)
committerKasun Gajasinghe <kasunbg@gmail.com>
Fri, 25 May 2012 15:41:03 +0000 (15:41 +0000)
xsl/webhelp/template/common/css/positioning.css
xsl/webhelp/template/content/search/nwSearchFnt.js

index a087660ed7714677fc6dd6578fe50797f0aa1ae7..d843f6410afa928f43661a2daf52246d35b82156 100644 (file)
@@ -191,8 +191,6 @@ p.breadcrumbs a:first-child {background: url(../images/breadcrumb-arrow-white.pn
 
 p.breadcrumbs a:hover {text-decoration: underline;}
 
-/* OXYGEN ADDITION FOR SEARCH RESULT RATING */
-
 #star ul.star { 
     LIST-STYLE: none; 
     MARGIN: 0; 
@@ -368,4 +366,4 @@ div.note *, div.caution *, div.important *, div.tip *, div.warning * {
        margin: 0 0 0 0;
     }
 
-}
\ No newline at end of file
+}
index 09ca1bcd9ba3a399bdd327c7593926107450c918..4ff11c370f8d92a1eb08cb3a98bb7eeef3970f87 100644 (file)
@@ -12,7 +12,6 @@ var htmlfileList = "htmlFileList.js";
 var htmlfileinfoList = "htmlFileInfoList.js";\r
 var useCJKTokenizing = false;\r
 \r
-//-------------------------OXYGEN PATCH START-------------------------\r
 var w = new Object();\r
 var scoring = new Object();\r
 \r
@@ -35,7 +34,6 @@ txt_enter_more_than_10_words = "Only first 10 words will be processed.";
 txt_browser_not_supported = "Your browser is not supported. Use of Mozilla Firefox is recommended.";\r
 txt_please_wait = "Please wait. Search in progress...";\r
 txt_results_for = "Results for: ";\r
-//-------------------------OXYGEN PATCH END-------------------------\r
 \r
 /* This function verify the validity of search input by the user\r
   Cette fonction verifie la validite de la recherche entrre par l utilisateur */\r
@@ -48,12 +46,10 @@ function Verifie(searchForm) {
         return;\r
     }\r
 \r
-    //-------------------------OXYGEN PATCH START-------------------------\r
     searchTextField = trim(document.searchForm.textToSearch.value);\r
-    searchTextField = searchTextField.replace(/['"]/g,'');
+    searchTextField = searchTextField.replace(/['"]/g,'');\r
        var expressionInput = searchTextField;\r
     $.cookie('textToSearch', expressionInput);\r
-    //-------------------------OXYGEN PATCH END-------------------------\r
 \r
     if (expressionInput.length < 1) {\r
 \r
@@ -61,13 +57,9 @@ function Verifie(searchForm) {
         alert(txt_enter_at_least_1_char);\r
         // reactive la fenetre de search (utile car cadres)\r
 \r
-        //-------------------------OXYGEN PATCH START------------------------\r
         document.searchForm.textToSearch.focus();\r
-        //-------------------------OXYGEN PATCH END-------------------------\r
     }\r
     else {\r
-        //-------------------------OXYGEN PATCH START-------------------------\r
-       // OXYGEN PATCH START - EXM-20996 - split by " ", ".", ":", "-"\r
     var splitSpace = searchTextField.split(" ");\r
        var splitWords = [];\r
         for (var i = 0 ; i < splitSpace.length ; i++) {\r
@@ -85,7 +77,6 @@ function Verifie(searchForm) {
           }\r
        }\r
        noWords = splitWords;\r
-       // OXYGEN PATCH END - EXM-20996 - split by " ", ".", ":", "-"\r
        if (noWords.length > 9){\r
           // Allow to search maximum 10 words\r
                alert(txt_enter_more_than_10_words);\r
@@ -97,16 +88,13 @@ function Verifie(searchForm) {
                document.searchForm.textToSearch.focus();\r
        } else {\r
                // Effectuer la recherche\r
-             // OXYGEN PATCH START - EXM-20996\r
              expressionInput = '';\r
           for (var x = 0 ; x < noWords.length ; x++) {\r
                  expressionInput = expressionInput + " " + noWords[x]; \r
              }\r
-             // OXYGEN PATCH END - EXM-20996\r
                Effectuer_recherche(expressionInput);\r
                // reactive la fenetre de search (utile car cadres)\r
                document.searchForm.textToSearch.focus();        \r
-               //-------------------------OXYGEN PATCH END-------------------------\r
        }\r
     }\r
 }\r
@@ -129,8 +117,8 @@ function Effectuer_recherche(expressionInput) {
     var fileAndWordList = new Array();\r
     var txt_wordsnotfound = "";\r
 \r
-
-    // --------------------------------------
+\r
+    // --------------------------------------\r
     // Begin Thu's patch \r
     /*nqu: expressionInput, la recherche est lower cased, plus remplacement des char speciaux*/\r
     //The original replacement expression is: \r
@@ -141,8 +129,8 @@ function Effectuer_recherche(expressionInput) {
     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_");\r
     \r
     //If it ends with a period, replace it with a space\r
-    searchFor = searchFor.replace(/[.]$/,"");
-    // End Thu's Patch
+    searchFor = searchFor.replace(/[.]$/,"");\r
+    // End Thu's Patch\r
     // ------------------------------------------\r
 \r
     searchFor = searchFor.replace(/  +/g, " ");\r
@@ -155,10 +143,9 @@ function Effectuer_recherche(expressionInput) {
     useCJKTokenizing = typeof indexerLanguage != "undefined" && (indexerLanguage == "zh" || indexerLanguage == "ja" || indexerLanguage == "ko");\r
     //If Lucene CJKTokenizer was used as the indexer, then useCJKTokenizing will be true. Else, do normal tokenizing.\r
     // 2-gram tokenizinghappens in CJKTokenizing, \r
-    // OXYGEN PATCH START. If doStem then make tokenize with Stemmer\r
+    //If doStem then make tokenize with Stemmer\r
     var finalArray;\r
     if (doStem){\r
-    // OXYGEN PATCH END.\r
            if(useCJKTokenizing){\r
                finalWordsList = cjkTokenize(wordsList);\r
           finalArray = finalWordsList;\r
@@ -180,8 +167,8 @@ function Effectuer_recherche(expressionInput) {
      * Compare with the indexed words (in the w[] array), and push words that are in it to tempTab.\r
      */\r
     var tempTab = new Array();\r
-       
-    // ---------------------------------------
+       \r
+    // ---------------------------------------\r
     // Thu's patch\r
     //Do not use associative array in for loop, for example:\r
     //for(var t in finalWordsList)\r
@@ -199,19 +186,19 @@ function Effectuer_recherche(expressionInput) {
        }\r
        finalWordsList = tempTab;               \r
     //Check all the inputs to see if the root words are in the finalWordsList, if not add them there\r
-    var inputs = expressionInput.split(' ');
-    // Thu's Patch 
+    var inputs = expressionInput.split(' ');\r
+    // Thu's Patch \r
     // -------------------------------------------\r
 \r
-    //-------------------------OXYGEN PATCH START-----------------------\r
+    \r
     txt_wordsnotfound = expressionInput;\r
        finalWordsList = removeDuplicate(finalWordsList);\r
-    //-------------------------OXYGEN PATCH END-------------------------\r
+    \r
    }\r
     if (finalWordsList.length) {\r
       //search 'and' and 'or' one time\r
       fileAndWordList = SortResults(finalWordsList);\r
-      //-------------------------OXYGEN PATCH START-----------------------\r
+      \r
       if (fileAndWordList == undefined){\r
                var cpt = 0;\r
       } else {\r
@@ -227,32 +214,32 @@ function Effectuer_recherche(expressionInput) {
                }\r
          }\r
          \r
-      //-------------------------OXYGEN PATCH END-----------------------\r
+      \r
       for (var i = 0; i < cpt; i++) {\r
-                       //-------------------------OXYGEN PATCH START-----------------------\r
+                       \r
                        var hundredProcent = fileAndWordList[i][0].scoring + 100 * fileAndWordList[i][0].motsnb;\r
                        var ttScore_first = fileAndWordList[i][0].scoring;\r
                        var numberOfWords = fileAndWordList[i][0].motsnb;\r
-                       //-------------------------OXYGEN PATCH END-----------------------\r
+                       \r
             if (fileAndWordList[i] != undefined) {\r
                 linkTab.push("<p>" + txt_results_for + " " + "<span class=\"searchExpression\">" + fileAndWordList[i][0].motslisteDisplay + "</span>" + "</p>");\r
 \r
                 linkTab.push("<ul class='searchresult'>");\r
                 for (t in fileAndWordList[i]) {\r
                     //linkTab.push("<li><a href=\"../"+fl[fileAndWordList[i][t].filenb]+"\">"+fl[fileAndWordList[i][t].filenb]+"</a></li>");\r
-                                   //-------------------------OXYGEN PATCH START-----------------------                    \r
+                                                       \r
                     var ttInfo = fileAndWordList[i][t].filenb;\r
                     // Get scoring\r
                     var ttScore = fileAndWordList[i][t].scoring;\r
                     var tempInfo = fil[ttInfo];\r
-                                   //-------------------------OXYGEN PATCH END-----------------------\r
+                                   \r
                     var pos1 = tempInfo.indexOf("@@@");\r
                     var pos2 = tempInfo.lastIndexOf("@@@");\r
                     var tempPath = tempInfo.substring(0, pos1);\r
                     var tempTitle = tempInfo.substring(pos1 + 3, pos2);\r
                     var tempShortdesc = tempInfo.substring(pos2 + 3, tempInfo.length);\r
 \r
-                    //-------------------------OXYGEN PATCH START-------------------------\r
+                    \r
                     // toc.html will not be displayed on search result\r
                     if (tempPath == 'toc.html'){\r
                         continue;\r
@@ -295,11 +282,11 @@ function Effectuer_recherche(expressionInput) {
                                        */\r
                     // Also check if we have a valid description\r
                     if ((tempShortdesc != "null" && tempShortdesc != '...')) {\r
-                    //-------------------------OXYGEN PATCH END-------------------------\r
+                    \r
                         linkString += "\n<div class=\"shortdesclink\">" + tempShortdesc + "</div>";\r
                     }\r
                     linkString += "</li>";\r
-                    //-------------------------OXYGEN PATCH START-------------------------\r
+                    \r
                     // Add rating values for scoring at the list of matches    \r
                                        linkString += "<div id=\"rightDiv\">";\r
                                        linkString += "<div id=\"star\">";\r
@@ -313,7 +300,7 @@ function Effectuer_recherche(expressionInput) {
                        linkString += "</div>";\r
                                        linkString += "</div>";\r
                     //linkString += '<b>Rating: ' + ttScore + '</b>';\r
-                    //-------------------------OXYGEN PATCH END-------------------------                       \r
+                                           \r
                     linkTab.push(linkString);\r
                     no++;\r
                 }\r
@@ -335,7 +322,7 @@ function Effectuer_recherche(expressionInput) {
         results = "<p>" + localeresource.search_no_results + " <span class=\"searchExpression\">" + txt_wordsnotfound + "</span>" + "</p>";\r
     }\r
     \r
-    //-------------------------OXYGEN PATCH START-------------------------\r
+    \r
     // Verify if the browser is Google Chrome and the WebHelp is used on a local machine\r
     // If browser is Google Chrome and WebHelp is used on a local machine a warning message will appear\r
     // Highlighting will not work in this conditions. There is 2 workarounds\r
@@ -344,10 +331,10 @@ function Effectuer_recherche(expressionInput) {
     } else {\r
         document.getElementById('searchResults').innerHTML = warningMsg + results;\r
     }\r
-    //-------------------------OXYGEN PATCH END-------------------------\r
+    \r
 }\r
 \r
-//-------------------------OXYGEN PATCH START-------------------------\r
+\r
 // Verify if the stemmed word is aproximately the same as the searched word\r
 function verifyWord(word, arr){\r
        for (var i = 0 ; i < arr.length ; i++){\r
@@ -375,13 +362,13 @@ function wordsStartsWith(searchedValue){
        }\r
        return toReturn.length > 0 ? toReturn : undefined;\r
 }\r
-//-------------------------OXYGEN PATCH END-------------------------\r
+\r
 \r
 function tokenize(wordsList){\r
     var stemmedWordsList = new Array(); // Array with the words to look for after removing spaces\r
-    var cleanwordsList = new Array(); // Array with the words to look for
-    // -------------------------------------------------
-    // Thu's patch
+    var cleanwordsList = new Array(); // Array with the words to look for\r
+    // -------------------------------------------------\r
+    // Thu's patch\r
     for(var j=0;j<wordsList.length;++j){\r
         var word = wordsList[j];\r
         var originalWord=word;\r
@@ -421,8 +408,8 @@ function tokenize(wordsList){
             else{\r
                 stemmedWordsList.push(cleanwordsList[i]);               \r
             }\r
-        }
-    // End Thu's patch
+        }\r
+    // End Thu's patch\r
     // -------------------------------------------\r
     } else {\r
         stemmedWordsList = cleanwordsList;\r
@@ -670,7 +657,7 @@ function SortResults(mots) {
         return null;\r
     }\r
     \r
-    //-------------------------OXYGEN PATCH START-------------------------\r
+    \r
     // In generated js file we add scoring at the end of the word\r
     // Example word1*scoringForWord1,word2*scoringForWord2 and so on\r
     // Split after * to obtain the right values\r
@@ -807,23 +794,20 @@ function newObj(filesNo, wordList){
        this.filesNo = filesNo;\r
        this.wordList = wordList;\r
 }\r
-//-------------------------OXYGEN PATCH END-------------------------\r
-\r
 \r
-// Object.\r
-// Oxygen. Add a new parameter. Scoring.\r
+// Add a new parameter. Scoring.\r
 function resultPerFile(filenb, motsliste, motsnb, motslisteDisplay, scoring, group) {\r
        //10 - spring,time - 2 - spring, time - 55 - 3\r
     this.filenb = filenb;\r
     this.motsliste = motsliste;\r
     this.motsnb = motsnb;\r
     this.motslisteDisplay= motslisteDisplay;\r
-    //-------------------------OXYGEN PATCH START-------------------------\r
+    \r
     this.scoring = scoring;\r
-    //-------------------------OXYGEN PATCH END-------------------------\r
+    \r
 }\r
 \r
-//-------------------------OXYGEN PATCH START-------------------------\r
+\r
 function findRating(words, nr){\r
     var sum = 0;\r
     var xx = words.split(',');\r
@@ -838,7 +822,7 @@ function findRating(words, nr){
     }\r
     return sum;\r
 }\r
-//-------------------------OXYGEN PATCH END-------------------------\r
+\r
 function compare_nbMots(s1, s2) {\r
     var t1 = s1.split(',');\r
     var t2 = s2.split(',');\r
@@ -852,7 +836,7 @@ function compare_nbMots(s1, s2) {
     }\r
     //return t1.length - t2.length);\r
 }\r
-//-------------------------OXYGEN PATCH START-------------------------\r
+\r
 // return false if browser is Google Chrome and WebHelp is used on a local machine, not a web server \r
 function verifyBrowser(){\r
     var returnedValue = true;    \r
@@ -895,5 +879,3 @@ function rtrim(str, chars) {
        chars = chars || "\\s";\r
        return str.replace(new RegExp("[" + chars + "]+$", "g"), "");\r
 }\r
-\r
-//-------------------------OXYGEN PATCH END-------------------------\r