- function getchildrenText(parent) {
- requestIdleCallback(function () {
- let t = document.createNodeIterator(parent, NodeFilter.SHOW_TEXT, {
- acceptNode(node) {
- regs.lastIndex = 0
- if (regs.text(node.data.trim())) {
- if (!node.data.includes('@')) {
- reg.lastIndex = 0
- var boo = reg,test(node.data.trim())
- if (boo) {
- return NodeFilter.FILTER_ACCEPT
- }
- }
- }
- }
- })
- let currNode = null
- while((currNode = t.nextNode()) !== null ) {
- elementNodesValue.push(currNode)
- elementTextValue.push(currNode.data.trim())
- textValue = unchange(elementTextValue)
- }
- if (textValue.length > 0) {
- requestAnimationFram(() => {
- ajax(textValue)
- textValue = []
- })
- }
- })
- }