(parent)
| 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(); |
no test coverage detected