Bug 1335905 - Add a preffed off search feature to about:preferences. r?jaws, r?mconley draft
authorFirefox <manotejmeka@gmail.com>
Thu, 16 Feb 2017 20:57:41 -0500
changeset 485695 c826b10874bdab47ce5efe0bc4cc8ad83d425224
parent 485656 e6993a45aa44743d705c7484a1e558d0515a61c3
child 546090 53a4e37058c2c47867f67092e4561b033a8f33e9
push id45813
push usermanotejmeka@gmail.com
push dateFri, 17 Feb 2017 01:58:59 +0000
reviewersjaws, mconley
bugs1335905
milestone54.0a1
Bug 1335905 - Add a preffed off search feature to about:preferences. r?jaws, r?mconley MozReview-Commit-ID: 2Nc65ar2COH
browser/components/preferences/in-content/SearchEach.js
--- a/browser/components/preferences/in-content/SearchEach.js
+++ b/browser/components/preferences/in-content/SearchEach.js
@@ -147,21 +147,18 @@ function nodeRecursion(nodeObject, searc
             // if (getLabelAttribute(nodeObject,word)){
             //     console.log(nodeObject)
             //     foundIn = true
             // }
         });
 
         //  Label tag that does not have textCont but text is in Value attr
         listOfWords.forEach(function(word) {
-            let boolAns = getValueAttribute(nodeObject, word);
+            let boolAns = getValueAttribute(nodeObject, word, findSelection);
             foundIn = foundIn || boolAns;
-            if (boolAns) {
-                searchWord(nodeObject, nodeObject.value, word, findSelection)
-            }
             // if (getLabelAttribute(nodeObject,word)){
             //     console.log(nodeObject)
             //     foundIn = true
             // }
         });
     }
     for (let i = 0; i < nodeObject.childElementCount; i++) {
         let boolAns = nodeRecursion(nodeObject.childNodes[i], searchPhrase, findSelection);
@@ -264,28 +261,28 @@ function getLabelAttribute(nodeObject, s
         // creatSpanTag.classList.add("search-bubble-text");
         // creatSpanTag.innerHTML = searchPhrase;
        //  nodeObject.appendChild(creatSpanTag);
         return true;
     }
     return false;
 }
 
-function getValueAttribute(nodeObject, searchPhrase) {
+function getValueAttribute(nodeObject, searchPhrase, findSelection) {
     if (typeof nodeObject.value == "string" && nodeObject.value != ""
     && stringMatchesFilters(nodeObject.value, searchPhrase)) {
         console.log("Found it in value", nodeObject);
-        nodeObject.textContent = nodeObject.value
-        nodeObject.innerHTML = nodeObject.value
+        //nodeObject.textContent = nodeObject.value
+        //nodeObject.innerHTML = nodeObject.value
         // nodeObject.classList.add("search-bubble");
 
-        // var creatSpanTag = document.createElement("span");
-        // creatSpanTag.classList.add("search-bubble-text");
-        // creatSpanTag.innerHTML = searchPhrase;
-       //  nodeObject.appendChild(creatSpanTag);
+        //var createTextNode = document.createTextNode(nodeObject.value);
+        //nodeObject.appendChild(createTextNode);
+        //console.log(nodeObject, nodeObject.childNodes[0])
+        //searchWord(nodeObject.childNodes[0], nodeObject.value, word, findSelection)
         return true;
     }
     return false;
 }
 
 
 function getSelectionController() {
     //  Yuck. See bug 138068.