Finishes the current box - empties the text line buffer and creates a DOM element from it.
762831
protected void finishBox()
    {
    	if (textLine.length() > 0)
    	{
            String s;
            if (isReversed(Character.getDirectionality(textLine.charAt(0))))
                s = textLine.reverse().toString();
            else
                s = textLine.toString();

            curstyle.setLeft(textMetrics.getX());
            curstyle.setTop(textMetrics.getTop());
            curstyle.setLineHeight(textMetrics.getHeight());

	        renderText(s, textMetrics);
	        textLine = new StringBuilder();
	        textMetrics = null;
    	}
    }
798724
function (text) {
            var preview = panels.preview;
            var parent = preview.parentNode;
            var sibling = preview.nextSibling;
            parent.removeChild(preview);
            preview.innerHTML = text;
            if (!sibling)
                parent.appendChild(preview);
            else
                parent.insertBefore(preview, sibling);
        }
1043904
def end_of_line(event):
    "  "
    buff = event.current_buffer
    buff.cursor_position += buff.document.get_end_of_line_position()
622544
function() {
      // Create the div wrapper for this group
  	   this.divEl = inputEx.cn('div', {className: this.options.className});
	   if(this.options.id) {
   	   this.divEl.id = this.options.id;
   	}
   	  	   
  	   // Create the FORM element
      this.form = inputEx.cn('form', {method: this.options.method || 'POST', action: this.options.action || '', className: this.options.className || 'inputEx-Form'});
      this.divEl.appendChild(this.form);

		// set the enctype
		if(this.options.enctype) {
			this.form.setAttribute('enctype',this.options.enctype);
		}

	   // Set the autocomplete attribute to off to disable browser autocompletion
		this.form.setAttribute('autocomplete', this.options.autocomplete ? 'on' : 'off');
   	
      // Set the name of the form
      if(this.options.formName) { this.form.name = this.options.formName; }
  	   
  	   this.renderFields(this.form);

      this.renderButtons();
      
      if(this.options.disabled) {
  	      this.disable();
  	   }	  
   }
758879
function handleDeleteInCaption() {
        var ZWSP = '\uFEFF';

        var isEmptyNode = function (node) {
          return editor.dom.isEmpty(node) || node.firstChild === node.lastChild && isCaretContainer(node.firstChild);
        };

        var isTableCaption = function (node) {
          return node && node.nodeName == 'CAPTION' && node.parentNode.nodeName == 'TABLE';
        };

        var isTheHeirOf = function (heir, ancestor) {
          var node = ancestor.firstChild;
          do {
            if (node === heir) {
              return true;
            }
          } while ((node = node.firstChild));
          return false;
        };

        var isCaretContainer = function (node) {
          if (node.nodeType === 3) {
            if (node.data === ZWSP) {
              return true;
            }
            node = node.parentNode;
          }
          return node.nodeType === 1 && node.hasAttribute('data-mce-caret');
        };

        var caretIsAtTheLeftEdgeOf = function (node) {
          var rng = editor.selection.getRng();
          return !rng.startOffset && !rng.startContainer.previousSibling && isTheHeirOf(rng.startContainer, node);
        };

        var appendCaretContainer = function (node, isBlock) {
          var caretNode;
          if (!isBlock) {
            caretNode = node.ownerDocument.createTextNode(ZWSP);
          } else {
            caretNode = editor.dom.create('p', {
              'data-mce-caret': 'after',
              'data-mce-bogus': 'all'
            },
            '<br data-mce-bogus="1">');
          }
          node.appendChild(caretNode);
        };

        var restoreCaretPlaceholder = function (container, insertCaret) {
          var lastChild = container.lastChild;
          var rng = editor.selection.getRng();

          // save the current position of the caret to restore it later (IE requires this)
          var caretContainer = rng.startContainer;
          var caretOffset = rng.startOffset;

          // if container contains only debris, we replace the contents with inline caret placeholder, to avoid
          // vertical stretching of the caption
          if (isEmptyNode(container)) {
            container.innerHTML = ZWSP;
            // in IE caret springs off from the caption (to the first td), we need to bring it back
            caretContainer = container.lastChild;
            caretOffset = 0;
          } else if (!isCaretContainer(lastChild)) {
            appendCaretContainer(container, editor.dom.isBlock(lastChild));
          }

          // in IE caret is off after restoration
          editor.selection.setCursorLocation(caretContainer, caretOffset);
        };

        var contractSelectionTo = function (caption) {
          var rng = editor.selection.getRng();
          var newRng = editor.dom.createRng();
          var firstChild = caption.firstChild;

          if (rng.commonAncestorContainer === caption.parentNode && isTheHeirOf(rng.startContainer, caption)) { // ignore backward selections
            // rng.selectNodeContents() didn't work in IE
            newRng.setStart(caption, 0);
            if (firstChild.nodeType === 1) {
              newRng.setEnd(caption, caption.childNodes.length);
            } else {
              newRng.setEnd(firstChild, firstChild.nodeValue.length);
            }
            editor.selection.setRng(newRng);
          }
        };

        editor.on('keydown', function (e) {
          if (e.keyCode !== VK.DELETE && e.keyCode !== VK.BACKSPACE || e.isDefaultPrevented()) {
            return;
          }

          var container = editor.dom.getParent(editor.selection.getStart(), 'caption');
          if (!isTableCaption(container)) {
            return;
          }

          // in IE caption collapses if caret placeholder is deleted (and it is very much possible)
          if (!editor.selection.isCollapsed()) {

            // in Chrome triple click selects beyond the boundaries of the caption, if then delete is pressed,
            // contents are being removed with the whole caption, so make sure we stay in caption
            contractSelectionTo(container);

            // if the whole contents are selected, caret placeholder will be deleted too and we take
            // over delete operation here to do it manually and restore the placeholder if required
            editor.undoManager.transact(function () {
              editor.execCommand('Delete');
              restoreCaretPlaceholder(container);
            });
            e.preventDefault();
          } else {
            restoreCaretPlaceholder(container);

            if (isEmptyNode(container) || e.keyCode === VK.BACKSPACE && caretIsAtTheLeftEdgeOf(container)) { // see TINY-979
              e.preventDefault();
            }
          }
        });
      }
520545
function completed( event ) {
	        // readyState === "complete" is good enough for us to call the dom ready in oldIE
	        if ( w3c || event.type === LOAD || doc[READYSTATE] === COMPLETE ) {
	            detach();
	            ready();
	        }
	    }
572842
function(input) {
  this.doc = makeBlock('Document', 1, 1);
  this.tip = this.doc;
  this.refmap = {};
  var lines = input.replace(/\n$/,'').split(/\r\n|\n|\r/);
  var len = lines.length;
  for (var i = 0; i < len; i++) {
    this.incorporateLine(lines[i], i+1);
  }
  while (this.tip) {
    this.finalize(this.tip, len - 1);
  }
  this.processInlines(this.doc);
  return this.doc;
}
457722
function() {
      // Build the inputEx field
      this._inputExField = inputEx(this._inputExFieldDef);
      this.getContainerEl().appendChild(this._inputExField.getEl());
		
		// Locals for Save/Cancel Buttons
		this.LABEL_SAVE = inputEx.messages.saveText;
		this.LABEL_CANCEL = inputEx.messages.cancelText;
   }
955986
function(dom) {
			//end recursion
			if (!dom) {
				return null;
			}
			var outline = [];
			for (var i = 0; i < dom.length; i++) {
				var node = dom[i];
				if(this.skip(node)) {
				    continue;
				}
				var element = {
					label: this.domToLabel(node),
					children: this.domToOutline(node.children),
					start: node.range[0],
					end: node.range[1]
				};
				outline.push(element);
			}
			if(outline.length > 0) {
				return outline;
			}
			return null;
		}
498292
def finish(self):
        
        self.lines.reverse()
        self._content = '\n'.join(self.lines)
        self.lines = None
450825
function elementEnd() {
    if (isParent) {
        isParent = false;
    }
    else {
        ngDevMode && assertHasParent();
        previousOrParentNode = getParentLNode(previousOrParentNode);
    }
    ngDevMode && assertNodeType(previousOrParentNode, 3 /* Element */);
    var queries = previousOrParentNode.queries;
    queries && queries.addNode(previousOrParentNode);
    queueLifecycleHooks(previousOrParentNode.tNode.flags, tView);
    currentElementNode = null;
}
488466
function finalizeHtml($html, needHtmlText) {
  let returnValue;

  if (needHtmlText) {
    returnValue = $html[0].innerHTML;
  } else {
    const frag = document.createDocumentFragment();
    const childNodes = util.toArray($html[0].childNodes);
    const {length} = childNodes;

    for (let i = 0; i < length; i += 1) {
      frag.appendChild(childNodes[i]);
    }
    returnValue = frag;
  }

  return returnValue;
}
385319
def finish(*args, &block)
      self['Content-Type'] ||= 'text/html;charset=utf-8'
      @block = block if block
      if [204, 205, 304].include?(status.to_i)
        header.delete "Content-Type"
        header.delete "Content-Length"
        close
        [status.to_i, header, []]
      else
        [status.to_i, header, body]
      end
    end
565891
def end_element(self, tag):
        """"""
        if tag == u'form':
            self.forms.append(self.form)
            self.form = None
475340
function completeInit() {
        setCSSFlags();

        // initialize scroller and resizer components
        scroller = scope.createComponent('scroller');
        scroller.init(config.$viewport);
        resizer = scope.createComponent('resizer');
        resizer.init(config.$viewport);

        var controller;
        switch (config.metadata.type) {
            case 'text':
                // load text-based viewer
                controller = scope.createComponent('controller-text');
                // force the text layout only
                // @TODO: allow overriding the layout eventually
                config.layout = LAYOUT_TEXT;
                break;

            case 'paged':
                /* falls through */
            default:
                controller = scope.createComponent('controller-paged');
                break;
        }
        controller.init();

        // disable text selection if necessary
        if (config.metadata.type === 'text') {
            if (!config.enableTextSelection) {
                api.disableTextSelection();
            }
        } else if (browser.ielt9) {
            api.disableTextSelection();
        }

        // disable links if necessary
        // @NOTE: links are disabled in IE < 9
        if (!config.enableLinks || browser.ielt9) {
            api.disableLinks();
        }

        // set the initial layout
        api.setLayout(config.layout);

        // broadcast ready message
        scope.broadcast('ready', {
            page: config.page || 1,
            numPages: config.numPages
        });

        scope.ready();
    }
220560
public function finish()
    {
        $this->xml_depth = 0;
        $this->current_ns = [];
        $this->idhandlers = [];
        $this->xpathhandlers = [];
        $this->eventHandlers = [];
    }
533260
public function wrap_html_finish() {
        global $PAGE;
        if ($this->canagreeany) {
            echo \html_writer::empty_tag('input', ['type' => 'hidden', 'name' => 'action', 'value' => 'accept']);
            echo \html_writer::empty_tag('input', ['type' => 'submit', 'data-action' => 'acceptmodal',
                'value' => get_string('consentbulk', 'tool_policy'), 'class' => 'btn btn-primary mt-1']);
            $PAGE->requires->js_call_amd('tool_policy/acceptmodal', 'getInstance', [\context_system::instance()->id]);
        }
        echo "</form>\n";
    }