Return newly-appended textbox `p:sp` element.

        Element has position (*x*, *y*) and size (*cx*, *cy*).
519998
def _add_textbox_sp(self, x, y, cx, cy):
        
        id_ = self._next_shape_id
        name = 'TextBox %d' % (id_-1)
        sp = self._spTree.add_textbox(id_, name, x, y, cx, cy)
        return sp
243057
function createTextElement (name, element = {}) {
  let classToAdd = ''
  const Tag = name

  if (/^h\d$/i.test(name)) {
    classToAdd = 'header'
  } else {
    classToAdd = 'text'
  }

  return createElement(name, merge({
    attrs: true,
    rules: {
      [`.${name}.${classToAdd}`]: [ { '@pseudo': 'root' }, '@default', { display: transforms.trueHide() }, margin, background, border, borderRadius, text, font ]
    },
    render (attrs, contents) {
      attrs.class += ` ${classToAdd} ${name}`

      return <Tag {...attrs}>{contents}</Tag>
    }
  }, element))
}
1201477
function (point, win) {
	var clientX = point.clientX;
	var clientY = point.clientY;

	if(point == null){return null;}
	
	if (syn.support.elementFromPage) {
		var off = syn.helpers.scrollOffset(win);
		clientX = clientX + off.left; //convert to pageX
		clientY = clientY + off.top; //convert to pageY
	}
	
	return win.document.elementFromPoint(Math.round(clientX), Math.round(clientY));
}
764848
function screenPos( element, refWin ) {
				var pos = { x: 0, y: 0 };

				if ( !( element.is( isQuirks ? 'body' : 'html' ) ) ) {
					var box = element.$.getBoundingClientRect();
					pos.x = box.left, pos.y = box.top;
				}

				var win = element.getWindow();
				if ( !win.equals( refWin ) ) {
					var outerPos = screenPos( CKEDITOR.dom.element.get( win.$.frameElement ), refWin );
					pos.x += outerPos.x, pos.y += outerPos.y;
				}

				return pos;
			}
1184767
def append(self, panel, position=Panel.Position.LEFT):
        
        assert panel is not None
        pos_to_string = {
            Panel.Position.BOTTOM: 'bottom',
            Panel.Position.LEFT: 'left',
            Panel.Position.RIGHT: 'right',
            Panel.Position.TOP: 'top'
        }
        _logger().log(5, 'adding panel %s at %r', panel.name,
                      pos_to_string[position])
        panel.order_in_zone = len(self._panels[position])
        self._panels[position][panel.name] = panel
        panel.position = position
        panel.on_install(self.editor)
        _logger().log(5, 'panel %s installed', panel.name)
        return panel
313141
def Append(self, x, p):
        
        self.xs.append(x)
        self.ps.append(p)
276680
function append() {
  var i, l = this.length, el, args = this.slice.call(arguments);
  function it(node, index) {
    // content elements to insert
    el.each(function(ins) {
      ins = (index < (l - 1)) ? ins.cloneNode(true) : ins;
      node.appendChild(ins);
    });
  }
  for(i = 0;i < args.length;i++) {
    // wrap content
    el = this.air(args[i]);
    // matched parent elements (targets)
    this.each(it);
  }
  return this;
}
1162634
function (point) {
            var textRangeInfo = function (container, offset) {
                var node, isCollapseToStart;

                if (dom.isText(container)) {
                    var prevTextNodes = dom.listPrev(container, func.not(dom.isText));
                    var prevContainer = list.last(prevTextNodes).previousSibling;
                    node =  prevContainer || container.parentNode;
                    offset += list.sum(list.tail(prevTextNodes), dom.nodeLength);
                    isCollapseToStart = !prevContainer;
                } else {
                    node = container.childNodes[offset] || container;
                    if (dom.isText(node)) {
                        return textRangeInfo(node, 0);
                    }

                    offset = 0;
                    isCollapseToStart = false;
                }

                return {
                    node: node,
                    collapseToStart: isCollapseToStart,
                    offset: offset
                };
            };

            var textRange = document.body.createTextRange();
            var info = textRangeInfo(point.node, point.offset);

            textRange.moveToElementText(info.node);
            textRange.collapse(info.collapseToStart);
            textRange.moveStart('character', info.offset);
            return textRange;
        }
1268668
function(px) {
        var newPx = this.clone();
        if (px) {
            newPx = this.add(px.x, px.y);
        }
        return newPx;
    }
1314606
function def(p) {
    if (p && p.tagName && p.cls) {
        if (customElements.get(p.tagName)) {
            console.warn(p.tagName + '!!');
        }
        else {
            customElements.define(p.tagName, p.cls);
        }
    }
}
174365
function(px) {
        var deltaX = this.handlers.drag.last.x - px.x;
        var deltaY = this.handlers.drag.last.y - px.y;
        if(deltaX != 0 || deltaY != 0) {
            var rectTop = this.rectPxBounds.top;
            var rectLeft = this.rectPxBounds.left;
            var rectHeight = Math.abs(this.rectPxBounds.getHeight());
            var rectWidth = this.rectPxBounds.getWidth();
            // don't allow dragging off of parent element
            var newTop = Math.max(0, (rectTop - deltaY));
            newTop = Math.min(newTop,
                              this.ovmap.size.h - this.hComp - rectHeight);
            var newLeft = Math.max(0, (rectLeft - deltaX));
            newLeft = Math.min(newLeft,
                               this.ovmap.size.w - this.wComp - rectWidth);
            this.setRectPxBounds(new OpenLayers.Bounds(newLeft,
                                                       newTop + rectHeight,
                                                       newLeft + rectWidth,
                                                       newTop));
        }
    }
487004
def add_autoshape(self, id_, name, prst, x, y, cx, cy):
        
        sp = CT_Shape.new_autoshape_sp(id_, name, prst, x, y, cx, cy)
        self.insert_element_before(sp, 'p:extLst')
        return sp
194553
private CmsContainerPageElementPanel createElement(
        Element element,
        I_CmsDropContainer dragParent,
        CmsContainerElement elementData) {

        CmsContainerPageElementPanel dragElement = new CmsContainerPageElementPanel(
            element,
            dragParent,
            elementData.getClientId(),
            elementData.getSitePath(),
            elementData.getNoEditReason(),
            elementData.getTitle(),
            elementData.getSubTitle(),
            elementData.getResourceType(),
            elementData.hasSettings(dragParent.getContainerId()),
            elementData.hasViewPermission(),
            elementData.hasWritePermission(),
            elementData.isReleasedAndNotExpired(),
            elementData.isNewEditorDisabled(),
            elementData.hasEditHandler(),
            elementData.getModelGroupId(),
            elementData.isWasModelGroup(),
            elementData.getElementView(),
            elementData.getBigIconClasses());
        dragElement.setCreateNew(elementData.isCreateNew());
        if (m_controller.requiresOptionBar(dragElement, dragParent)) {
            addOptionBar(dragElement);
        }
        if (m_controller.isInlineEditable(dragElement, dragParent)) {
            dragElement.initInlineEditor(m_controller);
        }
        return dragElement;
    }
1144719
def new_autoshape_sp(id_, name, prst, left, top, width, height):
        
        tmpl = CT_Shape._autoshape_sp_tmpl()
        xml = tmpl % (id_, name, left, top, width, height, prst)
        sp = parse_xml(xml)
        return sp
329668
def add_textbox(self, left, top, width, height):
        
        sp = self._add_textbox_sp(left, top, width, height)
        self._recalculate_extents()
        return self._shape_factory(sp)
1019289
def p_element_list(self, p):
        
        if len(p) == 3:
            p[0] = p[1] + [p[2]]
        else:
            p[1].extend(p[3])
            p[1].append(p[4])
            p[0] = p[1]
1057439
public boolean addElement(P element) {
		boolean changed = false;
		if (element != null) {
			final GridCellElement<P> gridElement = new GridCellElement<>(element);
			for (final GridCell<P> cell : getGridCellsOn(element.getGeoLocation().toBounds2D(), true)) {
				if (cell.addElement(gridElement)) {
					changed = true;
				}
			}
		}
		if (changed) {
			++this.elementCount;
		}
		return changed;
	}