Insert the element into the open element or foster parent it
551864
function insertElement(eltFunc) {
    var elt;
    if (foster_parent_mode && isA(stack.top, tablesectionrowSet)) {
      elt = fosterParent(eltFunc);
    }
    else if (stack.top instanceof impl.HTMLTemplateElement) {
      // "If the adjusted insertion location is inside a template element,
      // let it instead be inside the template element's template contents"
      elt = eltFunc(stack.top.content.ownerDocument);
      stack.top.content._appendChild(elt);
    } else {
      elt = eltFunc(stack.top.ownerDocument);
      stack.top._appendChild(elt);
    }

    stack.push(elt);
    return elt;
  }
456182
function() {
        var root = this.oDomContainer,
            cal = this.parent || this,
            anchor = "a",
            click = "click";

        var linkLeft = Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT, anchor, root),
            linkRight = Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT, anchor, root);

        if (linkLeft && linkLeft.length > 0) {
            this.linkLeft = linkLeft[0];
            Event.addListener(this.linkLeft, click, this.doPreviousMonthNav, cal, true);
        }

        if (linkRight && linkRight.length > 0) {
            this.linkRight = linkRight[0];
            Event.addListener(this.linkRight, click, this.doNextMonthNav, cal, true);
        }

        if (cal.cfg.getProperty("navigator") !== null) {
            this.applyNavListeners();
        }

        if (this.domEventMap) {
            var el,elements;
            for (var cls in this.domEventMap) { 
                if (Lang.hasOwnProperty(this.domEventMap, cls)) {
                    var items = this.domEventMap[cls];
    
                    if (! (items instanceof Array)) {
                        items = [items];
                    }
    
                    for (var i=0;i<items.length;i++) {
                        var item = items[i];
                        elements = Dom.getElementsByClassName(cls, item.tag, this.oDomContainer);
    
                        for (var c=0;c<elements.length;c++) {
                            el = elements[c];
                             Event.addListener(el, item.event, item.handler, item.scope, item.correct );
                        }
                    }
                }
            }
        }

        Event.addListener(this.oDomContainer, "click", this.doSelectCell, this);
        Event.addListener(this.oDomContainer, "mouseover", this.doCellMouseOver, this);
        Event.addListener(this.oDomContainer, "mouseout", this.doCellMouseOut, this);
    }
741784
function (element, options) {
		this.$element = $(element);
		this.options = $.extend({}, $.fn.tree.defaults, options);

		this.$element.on('click', '.tree-item', $.proxy( function(ev) { this.selectItem(ev.currentTarget); } ,this));
		this.$element.on('click', '.tree-folder-header', $.proxy( function(ev) { this.selectFolder(ev.currentTarget); }, this));

		this.render();
	}
1180493
function(parent) {
    if (!parent) return this;
    if (typeof parent.append === 'function') {
      parent.append(this);
    } else if (typeof parent.appendChild === 'function') {
      parent.appendChild(this._element);
      this.onAppend();
    }
    return this;
  }
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;
   }
1325755
function(el) {
		var self = this,
			$el = $(el);

		if ($el.length > 1) {
			$el.each(function() {
				self.addElement(this);
			});
		} else if ($el.length === 0) {
			throw new Error("Invalid element!");
		}

		if (this.$el.closest($el).length) {
			throw new Error("Element is a child of this view. This is only for unrelated elements");
		}
		if ($el.closest(this.$el).length) {
			throw new Error("Element is an ancestor of this view! Reconsider how you're using this view.");
		}

		// normalize
		el = $el.get(0);

		if (!this._trackedElements) {
			this._trackedElements = [];
		}
		_(this._trackedElements).each(function(otherEl) {
			var $otherEl = $(otherEl);

			if ($otherEl.closest($el).length) {
				throw new Error("Element is a child of another tracked element. This will cause problems.");
			}
			if ($el.closest($otherEl).length) {
				throw new Error("Element is an ancestor of another tracked element. This will cause problems.");
			}
		});
		this._trackedElements.push(el);
	}
1207672
function(element) {

      var x, link, image, text, fields;

      // set current element and node
      hashedit.current.element = element;
      hashedit.current.node = element;

      // if the current element is not a [hashedit-element], find the parent that matches
      if(hashedit.current.element.hasAttribute('hashedit-element') === false) {
        hashedit.current.element = hashedit.findParentBySelector(element, '[hashedit-element]');
      }

      // hide #hashedit-image
      image = document.querySelector('#hashedit-image-settings-modal');
      image.removeAttribute('visible');

      // hide #hashedit-link
      link = document.querySelector('#hashedit-link-settings-modal');
      link.removeAttribute('visible');

      // get #hashedit-config
      text = document.querySelector('#hashedit-text-settings');
      text.setAttribute('visible', '');

      // clear form fields
      fields = document.querySelectorAll('[data-model]');

      for (x = 0; x < fields.length; x += 1) {
        if (fields[x].nodeType == 'SELECT') {
          fields[x].selectedIndex = 0;
        } else {
          fields[x].value = '';
        }
      }

      hashedit.bind();

    }
319221
def add_child(self, obj):
        """"""
        self.children.append(obj)
        obj.parents.append(self)
23916
function () {

            var oIFrame = this.iframe,
                oParentNode;

            if (oIFrame) {
                oParentNode = this.element.parentNode;

                if (oParentNode != oIFrame.parentNode) {
                    this._addToParent(oParentNode, oIFrame);
                }
                oIFrame.style.display = "block";
            }
        }
315168
function (element, options) {
    this.element = element;
    this.options = options;

    $(this.element).addClass(ClassName.tree);

    $(Selector.treeview + Selector.active, this.element).addClass(ClassName.open);

    this._setUpListeners();
  }
1124412
public static void lazyInsertAfter(Element parent, Element newElement, Element after) {
        if (!parent.contains(newElement)) {
            parent.insertBefore(newElement, after.nextSibling);
        }
    }
1213367
function() {
    if(_.isUndefined(this.options.el)) {
      utils.log("You must provide an el");
      return false;
    }

    this.el = this.options.el;
    this.form = Dom.getClosest(this.el, 'form');

    var outer = Dom.createElement("div", {
                  'id': this.ID,
                  'class': 'st-outer notranslate',
                  'dropzone': 'copy link move'});

    var wrapper = Dom.createElement("div", {'class': 'st-blocks'});

    // Wrap our element in lots of containers *eww*

    Dom.wrap(Dom.wrap(this.el, outer), wrapper);

    this.outer = this.form.querySelector('#' + this.ID);
    this.wrapper = this.outer.querySelector('.st-blocks');

    return true;
  }
1176532
function(wrapper) {
                var self = this;
                self.parent.insert(wrapper, self);
                wrapper.append(self);
                return self;
            }
1184049
function insertAfter(newNode, referenceNode) {
  if (!referenceNode.parentNode) {
    referenceNode = AFRAME.INSPECTOR.selectedEntity;
  }

  if (!referenceNode) {
    AFRAME.INSPECTOR.sceneEl.appendChild(newNode);
  } else {
    referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
  }
}
114320
function() {
	      
	   // Add element button
	   if(this.options.useButtons) {
	      this.addButton = inputEx.cn('img', {src: inputEx.spacerUrl, className: 'inputEx-ListField-addButton'});
	      this.fieldContainer.appendChild(this.addButton);
      }
	      
	   // List label
	   this.fieldContainer.appendChild( inputEx.cn('span', null, {marginLeft: "4px"}, this.options.listLabel) );
	      
	   // Div element to contain the children
	   this.childContainer = inputEx.cn('div', {className: 'inputEx-ListField-childContainer'});
	   this.fieldContainer.appendChild(this.childContainer);
	   
	   // Add link
	   if(!this.options.useButtons) {
	      this.addButton = inputEx.cn('a', {className: 'inputEx-List-link'}, null, this.options.listAddLabel);
	      this.fieldContainer.appendChild(this.addButton);
      }
	}
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);
                }
1153251
function insert(node, parent, tight) {
    var children = parent.children;
    var length = children.length;
    var last = children[length - 1];
    var isLoose = false;
    var index;
    var item;

    if (node.depth === 1) {
        item = listItem();

        item.children.push({
            type: PARAGRAPH,
            children: [
                {
                    type: LINK,
                    title: null,
                    url: '#' + node.id,
                    children: [
                        {
                            type: TEXT,
                            value: node.value
                        }
                    ]
                }
            ]
        });

        children.push(item);
    } else if (last && last.type === LIST_ITEM) {
        insert(node, last, tight);
    } else if (last && last.type === LIST) {
        node.depth--;

        insert(node, last, tight);
    } else if (parent.type === LIST) {
        item = listItem();

        insert(node, item, tight);

        children.push(item);
    } else {
        item = list();
        node.depth--;

        insert(node, item, tight);

        children.push(item);
    }

    /*
    * Properly style list-items with new lines.
    */

    parent.spread = !tight;

    if (parent.type === LIST && parent.spread) {
        parent.spread = false;
        index = -1;

        while (++index < length) {
            if (children[index].children.length > 1) {
                parent.spread = true;
                break;
            }
        }
    }

    // To do: remove `loose` in next major release.
    if (parent.type === LIST_ITEM) {
        parent.loose = tight ? false : children.length > 1;
    } else {
        if (tight) {
            isLoose = false;
        } else {
            index = -1;

            while (++index < length) {
                if (children[index].loose) {
                    isLoose = true;

                    break;
                }
            }
        }

        index = -1;

        while (++index < length) {
            children[index].loose = isLoose;
        }
    }
}