WebInspector Event: DOM.childNodeCountUpdated
194546
function _onChildNodeCountUpdated(event, res) {
        // res = {nodeId, childNodeCount}
        if (res.nodeId > 0) {
            Inspector.DOM.requestChildNodes(res.nodeId);
        }
    }
341522
function(obj,parentEl) {
      
      var ul = inputEx.cn('ul', {className: 'inputEx-JsonTreeInspector'});
      
      for(var key in obj) {
         if(obj.hasOwnProperty(key)) {
            var value = obj[key];
            
            var id = Dom.generateId();
            var li = inputEx.cn('li', {id: id}, null, key+':');
            this.hash[id] = {value: value, expanded: false};
            
            
            if( lang.isObject(value) || lang.isArray(value) ) {
               if(lang.isArray(value)) {
                  li.appendChild( inputEx.cn('span', null, null, "[ "+value.length+" element"+(value.length > 1 ? 's':'')+"]" ) );
               }
               Dom.addClass(li,'collapsed');
               Event.addListener(li, 'click', this.onItemClick, this, true);
            }
            else {
               var spanContent = '';
               if( lang.isString(value) ) {
                  spanContent = '"'+inputEx.htmlEntities(value)+'"';
               }
               else {
                  if(value === null) {
                     spanContent = "null";
                  }
                  else {
                     spanContent = value.toString();
                  }
               }
               li.appendChild( inputEx.cn('span', {className: 'type-'+(value === null ? "null" : (typeof value))}, null, spanContent ) );
            }
            
            
            ul.appendChild(li);
         }
      }
      
      parentEl.appendChild(ul);
      
      return ul;
   }
1260070
private void processParentEvent(WatchedEvent event) throws Exception {
        // get current children snapshot and reset this watch.
        Set<String> children = new TreeSet<String>(m_zk.getChildren(m_rootNode, m_parentWatch));
        // intersect to get newChildren and update m_lastChildren to the current set.
        Set<String> newChildren = new HashSet<String>(children);
        newChildren.removeAll(m_lastChildren);
        m_lastChildren = children;

        List<ByteArrayCallback> callbacks = new ArrayList<ByteArrayCallback>();
        for (String child : children) {
            ByteArrayCallback cb = new ByteArrayCallback();
            // set watches on new children.
            if(newChildren.contains(child)) {
                m_zk.getData(ZKUtil.joinZKPath(m_rootNode, child), m_childWatch, cb, null);
            } else {
                m_zk.getData(ZKUtil.joinZKPath(m_rootNode, child), false, cb, null);
            }

            callbacks.add(cb);
        }

        HashMap<String, JSONObject> cache = new HashMap<String, JSONObject>();
        for (ByteArrayCallback callback : callbacks) {
            try {
                byte payload[] = callback.get();
                JSONObject jsObj = new JSONObject(new String(payload, "UTF-8"));
                cache.put(callback.getPath(), jsObj);
            } catch (KeeperException.NoNodeException e) {
                // child may have been deleted between the parent trigger and getData.
            }
        }

        m_publicCache.set(ImmutableMap.copyOf(cache));
        if (m_cb != null) {
            m_cb.run(m_publicCache.get());
        }
    }
902314
function(source) {
			var res,
				parent = this.parent,
				pos = $.inArray(this, parent.children),
				that = this;

			_assert(
				this.isPagingNode(),
				"replaceWith() currently requires a paging status node"
			);

			res = this.tree._callHook("nodeLoadChildren", this, source);
			res.done(function(data) {
				// New nodes are currently children of `this`.
				var children = that.children;
				// Prepend newly loaded child nodes to `this`
				// Move new children after self
				for (i = 0; i < children.length; i++) {
					children[i].parent = parent;
				}
				parent.children.splice.apply(
					parent.children,
					[pos + 1, 0].concat(children)
				);

				// Remove self
				that.children = null;
				that.remove();
				// Redraw new nodes
				parent.render();
				// TODO: set node.partload = false if this was tha last paging node?
				// parent.addPagingNode(false);
			}).fail(function() {
				that.setExpanded();
			});
			return res;
			// $.error("Not implemented: replaceWith()");
		}
843514
private void recursivelyRemoveNodesFromPage(final DOMNode parent, final SecurityContext securityContext) throws FrameworkException {

		// Remove node from page
		final PropertyMap changedProperties = new PropertyMap();

		changedProperties.put(StructrApp.key(DOMNode.class, "syncedNodes"), Collections.EMPTY_LIST);
		changedProperties.put(StructrApp.key(DOMNode.class, "pageId"),      null);

		parent.setProperties(securityContext, changedProperties);

		// recurse
		for (final DOMNode child : parent.getChildren()) {

			recursivelyRemoveNodesFromPage(child, securityContext);
		}
	}
35018
function DOMChildrenWalker(el) {
    this.raw = [];
    this.index = 0;
    this.target = el;

    var child = el.firstChild;
    var next;
    while (child) {
        next = child.nextSibling;

        switch (child.nodeType) {
            case 3:
                if (/^\s*$/.test(child.data || child.textContent)) {
                    removeEl(child);
                }
                else {
                    this.raw.push(child);
                }
                break;

            case 1:
            case 8:
                this.raw.push(child);
        }

        child = next;
    }

    this.current = this.raw[this.index];
    this.next = this.raw[this.index + 1];
}
637529
function (dom, selection) {
      var caretContainer;

      caretContainer = getParentCaretContainer(selection.getStart());
      if (caretContainer && !dom.isEmpty(caretContainer)) {
        Tools.walk(caretContainer, function (node) {
          if (node.nodeType === 1 && node.id !== CARET_ID && !dom.isEmpty(node)) {
            dom.setAttrib(node, 'data-mce-bogus', null);
          }
        }, 'childNodes');
      }
    }
1357955
function eventHandler(trackedElements = {}, options = { tolerance: 0 }) {
    const selectors = Object.keys(trackedElements);
    let testVisibility;

    if (!selectors.length) return;

    if (options.container === window) {
        testVisibility = inViewport;
    } else {
        testVisibility = inContainer;
    }

    selectors.forEach((selector) => {
        trackedElements[selector].nodes.forEach((item) => {
            if (testVisibility(item.node, options)) {
                item.wasVisible = item.isVisible;
                item.isVisible = true;
            } else {
                item.wasVisible = item.isVisible;
                item.isVisible = false;
            }
            if (item.isVisible === true && item.wasVisible === false) {
                if (!trackedElements[selector].enter) return;

                Object.keys(trackedElements[selector].enter).forEach((callback) => {
                    if (typeof trackedElements[selector].enter[callback] === 'function') {
                        trackedElements[selector].enter[callback](item.node, 'enter');
                    }
                });
            }
            if (item.isVisible === false && item.wasVisible === true) {
                if (!trackedElements[selector].leave) return;

                Object.keys(trackedElements[selector].leave).forEach((callback) => {
                    if (typeof trackedElements[selector].leave[callback] === 'function') {
                        trackedElements[selector].leave[callback](item.node, 'leave');
                    }
                });
            }
        });
    });
}
1250419
function highlightRecursive(node) {
				var match,
					languageId,
					currentNodeCount,
					j,
					nodes,
					k,
					partialContext,
					container,
					codeContainer;
				
				if (this.isAlreadyHighlighted(node) || (match = this.matchSunlightNode(node)) === null) {
					return;
				}

				languageId = match[1];
				currentNodeCount = 0;
				fireEvent("beforeHighlightNode", this, { node: node });
				for (j = 0; j < node.childNodes.length; j++) {
					if (node.childNodes[j].nodeType === 3) {
						//text nodes
						partialContext = highlightText.call(this, node.childNodes[j].nodeValue, languageId, partialContext);
						HIGHLIGHTED_NODE_COUNT++;
						currentNodeCount = currentNodeCount || HIGHLIGHTED_NODE_COUNT;
						nodes = partialContext.getNodes();

						node.replaceChild(nodes[0], node.childNodes[j]);
						for (k = 1; k < nodes.length; k++) {
							node.insertBefore(nodes[k], nodes[k - 1].nextSibling);
						}
					} else if (node.childNodes[j].nodeType === 1) {
						//element nodes
						highlightRecursive.call(this, node.childNodes[j]);
					}
				}

				//indicate that this node has been highlighted
				node.className += " " + this.options.classPrefix + "highlighted";
				
				//if the node is block level, we put it in a container, otherwise we just leave it alone
				if (getComputedStyle(node, "display") === "block") {
					container = document.createElement("div");
					container.className = this.options.classPrefix + "container";
					
					codeContainer = document.createElement("div");
					codeContainer.className = this.options.classPrefix + "code-container";

					//apply max height if specified in options
					if (this.options.maxHeight !== false) {
						codeContainer.style.overflowY = "auto";
						codeContainer.style.maxHeight = this.options.maxHeight + (/^\d+$/.test(this.options.maxHeight) ? "px" : "");
					}
					
					container.appendChild(codeContainer);
					
					node.parentNode.insertBefore(codeContainer, node);
					node.parentNode.removeChild(node);
					codeContainer.appendChild(node);
					
					codeContainer.parentNode.insertBefore(container, codeContainer);
					codeContainer.parentNode.removeChild(codeContainer);
					container.appendChild(codeContainer);
				}
				
				fireEvent("afterHighlightNode", this, { 
					container: container,
					codeContainer: codeContainer,
					node: node, 
					count: currentNodeCount
				});
			}
364592
function (event) {
            this.data.showSource = !this.data.showSource;
            if (this.data.showSource) {
                this.data.initialSource = true;
                var filePath = this.data.templateCtxt.tplClasspath.replace(/\./g, "/") + ".tpl";
                this.data.source = this.moduleCtrl.getSource(filePath).value;
            }
            this.$refresh();
        }
308427
function(element) {
		var atts = [];
		new gui.Crawler('functionupdate').descend(element, {
			handleElement: function(elm) {
				if (elm !== element) {
					Array.forEach(elm.attributes, function(att) {
						if (att.value.contains("edbml.$run")) {
							atts.push([elm, att]);
						}
					});
					if (elm.spirit && elm.spirit.script.loaded) { // ... not our DOM tree
						return gui.Crawler.SKIP_CHILDREN;
					}
				}
			}
		});
		return atts;
	}
1033064
function () {
                var children = [],
                    addedDescriptors = [],
                    i, child;

                if (this.$defaultContentName && this.$defaultTemplateName) {
                    throw "both $defaultContentName and $defaultTemplateName are defined";
                }

                var desc;

                function addChildren(childrenFromDescriptor, fromDescriptor) {

                    // don't add children with the same descriptor twice
                    for (var j = 0; j < childrenFromDescriptor.length; j++) {
                        child = childrenFromDescriptor[j];
                        child.$fromDescriptor = fromDescriptor;

                        if (child.$createdByTemplate || _.indexOf(addedDescriptors, child.$descriptor) === -1) {
                            children.push(child);
                            if (child.$descriptor) {
                                addedDescriptors.push(child.$descriptor);
                            }
                        }
                    }
                }

                for (var d = 0; d < this.$internalDescriptors.length; d++) {
                    desc = this.$internalDescriptors[d];
                    addChildren(this._getChildrenFromDescriptor(desc, this, null, this), "intern");
                }

                var externalDescriptorChildren;

                if (this.$defaultTemplateName) {
                    var templateBlock;

                    // go through all children from the external descriptor
                    // and check if a template block with the name $defaultTemplateName

                    for (i = 0; i < this.$descriptor.childNodes.length; i++) {
                        var node = this.$descriptor.childNodes[i];

                        if (node.nodeType === 1 &&
                            node.getAttribute("name") === this.$defaultTemplateName &&
                            this.$stage.$applicationContext.getFqClassName(node.namespaceURI, this._localNameFromDomNode(node), true) === "js/core/Template") {

                            templateBlock = node;
                            break;
                        }
                    }

                    if (!templateBlock && this.$descriptor) {
                        templateBlock = this.createComponent(Component.Template, {
                            name: this.$defaultTemplateName
                        }, this.$descriptor);

                        externalDescriptorChildren = [templateBlock];
                    }

                }

                externalDescriptorChildren = externalDescriptorChildren || this._getChildrenFromDescriptor(this.$descriptor);


                if (this.$defaultContentName && this.$descriptor) {
                    // check if content block is already defined
                    var contentBlock,
                        internAndExternalChildren = children.concat(externalDescriptorChildren);


                    for (i = 0; i < internAndExternalChildren.length; i++) {
                        child = internAndExternalChildren[i];

                        if (child instanceof Component.Content && child.$.name === this.$defaultContentName) {
                            // content block already defined
                            contentBlock = child;
                            break;
                        }
                    }

                    if (!contentBlock) {
                        // create a content block and move all children in a js.core.Content Block
                        contentBlock = this.createComponent(Component.Content, {
                            name: this.$defaultContentName
                        });

                        // add all children to content block
                        for (i = 0; i < externalDescriptorChildren.length; i++) {
                            contentBlock.addChild(externalDescriptorChildren[i]);
                        }

                        externalDescriptorChildren = [contentBlock];
                    }

                }

                addChildren(externalDescriptorChildren, "external");

                var extraChildren = this.createChildren();
                if (extraChildren) {
                    addChildren(extraChildren, "extra");
                }

                this._initializeChildren(children);

                this._childrenInitialized();

                this._initializeXamlEventAttributes(this.$xamlDefaults, this);
                this._initializeXamlEventAttributes(this.$xamlAttributes, this.$rootScope);
            }
589808
function (el, parentNode) {
                    // updates the text of the text node
                    update = function (newVal) {
                        node.nodeValue = "" + newVal;
                        teardownCheck(node.parentNode);
                    };

                    var parent = getParentNode(el, parentNode),
                        node = document.createTextNode(binding.value);

                    // When iterating through an Observe.List with no DOM
                    // elements containing the individual items, the parent
                    // is sometimes incorrect not the true parent of the
                    // source element. (#153)
                    if (el.parentNode !== parent) {
                        parent = el.parentNode;
                        parent.insertBefore(node, el);
                        parent.removeChild(el);
                    } else {
                        parent.insertBefore(node, el);
                        parent.removeChild(el);
                    }
                    setupTeardownOnDestroy(parent);
                }
1048552
function _VirtualDom_addDomNodesHelp(
    domNode,
    vNode,
    patches,
    i,
    low,
    high,
    eventNode
  ) {
    var patch = patches[i];
    var index = patch.r;

    while (index === low) {
      var patchType = patch.$;

      if (patchType === 1) {
        _VirtualDom_addDomNodes(domNode, vNode.k, patch.s, eventNode);
      } else if (patchType === 8) {
        patch.t = domNode;
        patch.u = eventNode;

        var subPatches = patch.s.w;
        if (subPatches.length > 0) {
          _VirtualDom_addDomNodesHelp(
            domNode,
            vNode,
            subPatches,
            0,
            low,
            high,
            eventNode
          );
        }
      } else if (patchType === 9) {
        patch.t = domNode;
        patch.u = eventNode;

        var data = patch.s;
        if (data) {
          data.A.s = domNode;
          var subPatches = data.w;
          if (subPatches.length > 0) {
            _VirtualDom_addDomNodesHelp(
              domNode,
              vNode,
              subPatches,
              0,
              low,
              high,
              eventNode
            );
          }
        }
      } else {
        patch.t = domNode;
        patch.u = eventNode;
      }

      i++;

      if (!(patch = patches[i]) || (index = patch.r) > high) {
        return i;
      }
    }

    var tag = vNode.$;

    if (tag === 4) {
      var subNode = vNode.k;

      while (subNode.$ === 4) {
        subNode = subNode.k;
      }

      return _VirtualDom_addDomNodesHelp(
        domNode,
        subNode,
        patches,
        i,
        low + 1,
        high,
        domNode.elm_event_node_ref
      );
    }

    // tag must be 1 or 2 at this point

    var vKids = vNode.e;
    var childNodes = domNode.childNodes;
    for (var j = 0; j < vKids.length; j++) {
      low++;
      var vKid = tag === 1 ? vKids[j] : vKids[j].b;
      var nextLow = low + (vKid.b || 0);
      if (low <= index && index <= nextLow) {
        i = _VirtualDom_addDomNodesHelp(
          childNodes[j],
          vKid,
          patches,
          i,
          low,
          nextLow,
          eventNode
        );
        if (!(patch = patches[i]) || (index = patch.r) > high) {
          return i;
        }
      }
      low = nextLow;
    }
    return i;
  }
106955
function updateNode(node, content, append) {
  append = append || false;

  while(!append && node.firstChild) {
    node.removeChild(node.firstChild);
  }

  if(content instanceof Element) {
    node.appendChild(content);
  }
  else if(content instanceof Array) {
    content.forEach(function(element) {
      node.appendChild(element);
    });
  }
  else {
    node.textContent = content;
  }
}
1206588
function(node) {
            var instance = this,
                pjaxselectionCont = Y.one('.pjaxselection'),
                pjaxselectionButtons = pjaxselectionCont.all('button');

            pjaxselectionCont.delegate(
                'click',
                function(e) {
                    var btn = e.currentTarget,
                        pjaxtype;
                    pjaxselectionButtons.removeClass(PURE_BUTTON_ACTIVE);
                    btn.addClass(PURE_BUTTON_ACTIVE);
                    pjaxtype = btn.getAttribute('data-pjaxtype');
                    switch (pjaxtype) {
                        case '0':
                            instance.switchAttribute(false);
                        break;
                        case '1':
                            instance.switchAttribute(true);
                            instance.allAnchor.removeAttribute('data-pjax-cache');
                        break;
                        case '2':
                            instance.switchAttribute(true);
                            instance.allAnchor.setAttribute('data-pjax-cache', true);
                        break;
                    }
                    Y.soon(Y.bind(instance.refreshCodedescription, instance));
                },
                'button'
            );
        }
1127111
function _onAttributeModified(event, res) {
        // res = {nodeId, name, value}
        var matches = /^data-ld-(.*)/.exec(res.name);
        if (matches) {
            exports.trigger(matches[1], res);
        }
    }