MCPcopy Create free account
hub / github.com/ChaseFlorell/jQuery.ProfanityFilter / allTextNodes

Function allTextNodes

jquery.profanityfilter.js:57–83  ·  view source on GitHub ↗
(parent)

Source from the content-addressed store, hash-verified

55 }();
56
57 function allTextNodes(parent) {
58 function getChildNodes(parent) {
59 var x,
60 out = [];
61
62 for (x = 0; x < parent.childNodes.length; x += 1) {
63 out[x] = parent.childNodes[x];
64 }
65
66 return out;
67 }
68
69 var cursor,
70 closed = [],
71 open = getChildNodes(parent);
72
73 while (open.length) {
74 cursor = open.shift();
75 if (cursor.nodeType === 1) {
76 open.unshift.apply(open, getChildNodes(cursor));
77 }
78 if (cursor.nodeType === 3) {
79 closed.push(cursor);
80 }
81 }
82 return closed;
83 }
84
85 function readJsonFromController(file) {
86 var request = new XMLHttpRequest();

Callers 1

Calls 1

getChildNodesFunction · 0.70

Tested by

no test coverage detected