Bug 1335905 - Add a preffed off search feature to about:preferences. r?jaws, r?mconley
MozReview-Commit-ID: 2Nc65ar2COH
--- 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.