Initiate, and Mark a place for the Table of Contents to be inserted
324236
public function TOC(
		$tocfont = '',
		$tocfontsize = 0,
		$tocindent = 0,
		$resetpagenum = '',
		$pagenumstyle = '',
		$suppress = '',
		$toc_orientation = '',
		$TOCusePaging = true,
		$TOCuseLinking = false,
		$toc_id = 0,
		$tocoutdent = '',
		$toc_resetpagenum = '',
		$toc_pagenumstyle = '',
		$toc_suppress = ''
	) {

		if (strtoupper($toc_id) == 'ALL') {
			$toc_id = '_mpdf_all';
		} else if (!$toc_id) {
			$toc_id = 0;
		} else {
			$toc_id = strtolower($toc_id);
		}
		// To use odd and even pages
		// Cannot start table of contents on an even page
		if (($this->mpdf->mirrorMargins) && (($this->mpdf->page) % 2 == 0)) { // EVEN
			if ($this->mpdf->ColActive) {
				if (count($this->mpdf->columnbuffer)) {
					$this->mpdf->printcolumnbuffer();
				}
			}
			$this->mpdf->AddPage($this->mpdf->CurOrientation, '', $resetpagenum, $pagenumstyle, $suppress);
		} else {
			$this->mpdf->PageNumSubstitutions[] = ['from' => $this->mpdf->page, 'reset' => $resetpagenum, 'type' => $pagenumstyle, 'suppress' => $suppress];
		}
		if ($toc_id) {
			$this->m_TOC[$toc_id]['TOCmark'] = $this->mpdf->page;
			$this->m_TOC[$toc_id]['TOCoutdent'] = $tocoutdent;
			$this->m_TOC[$toc_id]['TOCorientation'] = $toc_orientation;
			$this->m_TOC[$toc_id]['TOCuseLinking'] = $TOCuseLinking;
			$this->m_TOC[$toc_id]['TOCusePaging'] = $TOCusePaging;
			$this->m_TOC[$toc_id]['TOC_resetpagenum'] = $toc_resetpagenum; // mPDF 6
			$this->m_TOC[$toc_id]['TOC_pagenumstyle'] = $toc_pagenumstyle; // mPDF 6
			$this->m_TOC[$toc_id]['TOC_suppress'] = $toc_suppress; // mPDF 6
		} else {
			$this->TOCmark = $this->mpdf->page;
			$this->TOCoutdent = $tocoutdent;
			$this->TOCorientation = $toc_orientation;
			$this->TOCuseLinking = $TOCuseLinking;
			$this->TOCusePaging = $TOCusePaging;
			$this->TOC_resetpagenum = $toc_resetpagenum; // mPDF 6
			$this->TOC_pagenumstyle = $toc_pagenumstyle; // mPDF 6
			$this->TOC_suppress = $toc_suppress; // mPDF 6
		}
	}
849596
def initialize(self, author=""):
        ''' '''
        self.cur.execute("CREATE TABLE version(major, minor);")
        self.cur.execute("INSERT INTO version(major, minor) VALUES (?,?);",
                (self.appversion[0], self.appversion[1]))
        #20150314 self.cur.execute("CREATE TABLE note(noteId integer primary key autoincrement, authorId, date, modified, due, title, content, hash, privacy DEFAULT 0, in_trash DEFAULT 0);")
        self.cur.execute("CREATE TABLE note(noteId integer primary key autoincrement, authorId, date, modified, due, title, content, hash, privacy DEFAULT 0, book DEFAULT 1);")
        self.cur.execute("CREATE TABLE author(authorId integer primary key autoincrement, name, nickname);")
        self.cur.execute("CREATE TABLE alias(aliasId integer primary key autoincrement, item, alias);")
        self.cur.execute("CREATE TABLE keyword(keywordId integer primary key autoincrement, keyword);")
        self.cur.execute("CREATE TABLE notekeyword(notekeywordId integer primary key autoincrement, noteid, keywordid);")
        self.cur.execute("CREATE TABLE book(bookId integer primary key autoincrement, number, name DEFAULT '');")
        self.cur.execute("INSERT INTO book(number, name) VALUES (0, 'Trash');")
        self.cur.execute("INSERT INTO book(number, name) VALUES (1, 'Default');")
        self.con.commit()
581256
function() {
			// Insert the dialog's element to the root document.
			var element = this._.element;
			var definition = this.definition;
			if ( !( element.getParent() && element.getParent().equals( CKEDITOR.document.getBody() ) ) )
				element.appendTo( CKEDITOR.document.getBody() );
			else
				element.setStyle( 'display', 'block' );

			// First, set the dialog to an appropriate size.
			this.resize( this._.contentSize && this._.contentSize.width || definition.width || definition.minWidth, this._.contentSize && this._.contentSize.height || definition.height || definition.minHeight );

			// Reset all inputs back to their default value.
			this.reset();

			// Select the first tab by default.
			this.selectPage( this.definition.contents[ 0 ].id );

			// Set z-index.
			if ( CKEDITOR.dialog._.currentZIndex === null )
				CKEDITOR.dialog._.currentZIndex = this._.editor.config.baseFloatZIndex;
			this._.element.getFirst().setStyle( 'z-index', CKEDITOR.dialog._.currentZIndex += 10 );

			// Maintain the dialog ordering and dialog cover.
			if ( CKEDITOR.dialog._.currentTop === null ) {
				CKEDITOR.dialog._.currentTop = this;
				this._.parentDialog = null;
				showCover( this._.editor );

			} else {
				this._.parentDialog = CKEDITOR.dialog._.currentTop;
				var parentElement = this._.parentDialog.getElement().getFirst();
				parentElement.$.style.zIndex -= Math.floor( this._.editor.config.baseFloatZIndex / 2 );
				CKEDITOR.dialog._.currentTop = this;
			}

			element.on( 'keydown', accessKeyDownHandler );
			element.on( 'keyup', accessKeyUpHandler );

			// Reset the hasFocus state.
			this._.hasFocus = false;

			for ( var i in definition.contents ) {
				if ( !definition.contents[ i ] )
					continue;

				var content = definition.contents[ i ],
					tab = this._.tabs[ content.id ],
					requiredContent = content.requiredContent,
					enableElements = 0;

				if ( !tab )
					continue;

				for ( var j in this._.contents[ content.id ] ) {
					var elem = this._.contents[ content.id ][ j ];

					if ( elem.type == 'hbox' || elem.type == 'vbox' || !elem.getInputElement() )
						continue;

					if ( elem.requiredContent && !this._.editor.activeFilter.check( elem.requiredContent ) )
						elem.disable();
					else {
						elem.enable();
						enableElements++;
					}
				}

				if ( !enableElements || ( requiredContent && !this._.editor.activeFilter.check( requiredContent ) ) )
					tab[ 0 ].addClass( 'cke_dialog_tab_disabled' );
				else
					tab[ 0 ].removeClass( 'cke_dialog_tab_disabled' );
			}

			CKEDITOR.tools.setTimeout( function() {
				this.layout();
				resizeWithWindow( this );

				this.parts.dialog.setStyle( 'visibility', '' );

				// Execute onLoad for the first show.
				this.fireOnce( 'load', {} );
				CKEDITOR.ui.fire( 'ready', this );

				this.fire( 'show', {} );
				this._.editor.fire( 'dialogShow', this );

				if ( !this._.parentDialog )
					this._.editor.focusManager.lock();

				// Save the initial values of the dialog.
				this.foreach( function( contentObj ) {
					contentObj.setInitValue && contentObj.setInitValue();
				} );

			}, 100, this );
		}
57107
def insert(self, index, item):
        """"""
        super(ObservableList, self).insert(index, item)
        length = len(self)
        if index >= length:
            index = length - 1
        elif index < 0:
            index += length - 1
            if index < 0:
                index = 0
        self._notify_add_at(index)
666459
function init() {
		$_option = 'pressbooks_theme_options_' . $this->getSlug();
		$_page = $_option;
		$_section = $this->getSlug() . '_options_section';

		if ( false === get_option( $_option ) ) {
			add_option( $_option, $this->defaults );
		}

		add_settings_section(
			$_section,
			$this->getTitle(),
			[ $this, 'display' ],
			$_page
		);

		add_settings_field(
			'ebook_start_point',
			__( 'Ebook Start Point', 'pressbooks' ),
			[ $this, 'renderEbookStartPointField' ],
			$_page,
			$_section,
			[
				__( 'Note: This designated ebook start book may be overridden by some ereader devices.', 'pressbooks' ),
				'label_for' => 'ebook_start_point',
			]
		);

		add_settings_field(
			'ebook_paragraph_separation',
			__( 'Paragraph Separation', 'pressbooks' ),
			[ $this, 'renderParagraphSeparationField' ],
			$_page,
			$_section,
			[
				'indent' => __( 'Indent paragraphs', 'pressbooks' ),
				'skiplines' => __( 'Skip lines between paragraphs', 'pressbooks' ),
			]
		);

		add_settings_field(
			'ebook_compress_images',
			__( 'Compress Images', 'pressbooks' ),
			[ $this, 'renderCompressImagesField' ],
			$_page,
			$_section,
			[
				__( 'Reduce image size and quality', 'pressbooks' ),
			]
		);

		/**
		 * Add custom settings fields.
		 *
		 * @since 3.9.7
		 *
		 * @param string $arg1
		 * @param string $arg2
		 */
		do_action( 'pb_theme_options_ebook_add_settings_fields', $_page, $_section );

		register_setting(
			$_option,
			$_option,
			[ $this, 'sanitize' ]
		);
	}
1228178
def OnInsertTabs(self, event):
        """"""

        with undo.group(_("Insert table")):
            self.grid.actions.insert_tabs(self.grid.current_table - 1, 1)

        self.grid.GetTable().ResetView()
        self.grid.actions.zoom()

        event.Skip()
1118778
def insert(self, i, x):
        """"""
        if i == len(self):  # end of list or empty list: append
            self.append(x)
        elif len(self.matches) > i:
            # create a new xml node at the requested position
            insert_index = self.matches[i].getparent().index(self.matches[i])
            _create_xml_node(self.xast, self.node, self.context, insert_index)
            # then use default set logic
            self[i] = x
        else:
            raise IndexError("Can't insert '%s' at index %d - list length is only %d" \
                            % (x, i, len(self)))
602081
function(content, opts, onOk, oncancel) {
        Dialog.setup('prompt', content, opts, onOk, oncancel);
      }
749819
private void organizeContent()
    {
        cells = new Vector<TableCellBox>();
        TableCellBox anoncell = null;
        
        int size = nested.size();
        List<Box> toremove = new ArrayList<Box>();
        for (int i = 0; i < size; i++)
        {
            Box box = nested.get(i);
            
            if (box instanceof TableCellBox)
            {
                addCell((TableCellBox) box);
                //finish and add possible previous anonymous cell
                if (anoncell != null)
                {
                    anoncell.endChild = anoncell.nested.size();
                    addSubBox(anoncell);
                }
                anoncell = null;
            }
            else
            {
                if (anoncell == null)
                {
                    Element anonelem = viewport.getFactory().createAnonymousElement(getParent().getParent().getParent().getElement().getOwnerDocument(), "td", "table-cell");
                    anoncell = new TableCellBox(anonelem, g, ctx);
                    anoncell.adoptParent(this);
                    anoncell.setStyle(viewport.getFactory().createAnonymousStyle("table-cell"));
                    addCell(anoncell);
                }
                anoncell.addSubBox(box);
                anoncell.isempty = false;
                if (box.isBlock()) anoncell.contblock = true;
                box.setContainingBlockBox(anoncell);
                box.setParent(anoncell);
                toremove.add(box);
                endChild--;
            }
        }
        nested.removeAll(toremove);
        
        if (anoncell != null)
        {
            anoncell.endChild = anoncell.nested.size();
            addSubBox(anoncell);
        }
    }
778451
function insert(item, msecs) {
  item._idleStart = Timer.now();
  item._idleTimeout = msecs;

  if (msecs < 0) return;

  var list;

  if (lists[msecs]) {
    list = lists[msecs];
  } else {
    list = new Timer();
    list.start(msecs, 0);

    L.init(list);

    lists[msecs] = list;
    list.msecs = msecs;
    list[kOnTimeout] = listOnTimeout;
  }

  L.append(list, item);
  assert(!L.isEmpty(list)); // list is not empty
}
936402
def insert_cols(self, col, no_cols=1):
        

        # Mark content as changed
        post_command_event(self.main_window, self.ContentChangedMsg)

        tab = self.grid.current_table

        self.code_array.insert(col, no_cols, axis=1, tab=tab)
1333385
private void insertEditEmpty() throws CmsException, JspException {

        Tag ancestor = findAncestorWithClass(this, I_CmsXmlContentContainer.class);
        I_CmsXmlContentContainer container = null;
        if (ancestor != null) {
            // parent content container available, use preloaded values from this container
            container = (I_CmsXmlContentContainer)ancestor;
            insertEditEmpty(pageContext, container, m_mode == null ? CmsDirectEditMode.AUTO : m_mode, null);
        }
    }
458801
async function tableOfContentsTransform(
  content: string,
  options: *,
  comment: string
): Promise<string> {
  return toc.insert(content.replace(comment, '<!-- toc -->'));
}
503026
function insertComment(data) {
    var parent = stack.top;
    if (foster_parent_mode && isA(parent, tablesectionrowSet)) {
      fosterParent(function(doc) { return doc.createComment(data); });
    } else {
      // "If the adjusted insertion location is inside a template element,
      // let it instead be inside the template element's template contents"
      if (parent instanceof impl.HTMLTemplateElement) {
        parent = parent.content;
      }
      parent._appendChild(parent.ownerDocument.createComment(data));
    }
  }
956327
final public void startContent(ChainWriter out, WebSiteRequest req, HttpServletResponse resp, int contentColumns, int preferredWidth) throws IOException, SQLException {
		startContent(out, req, resp, new int[] {contentColumns}, preferredWidth);
	}
917962
def begin_table(self, column_count):
        """"""
        self.table_columns = column_count
        self.table_columns_left = 0
        self.write('<table>')
946481
def vieditable_init_tabular
      $log.debug " inside vieditable_init tabular"
      @editable = true
      #bind_key( ?C, :edit_line)
      #bind_key( ?o, :insert_line)
      #bind_key( ?O) { insert_line(@current_index-1) } 
      #bind_key( ?o) { insert_line(@current_index+1) } 
      #bind_key( ?O) { insert_line(@current_index) } 
      bind_key( [?d, ?d] , :delete_line ) 
      #bind_key( ?\C-_ ) { @undo_handler.undo if @undo_handler }
      #bind_key( ?u ) { @undo_handler.undo if @undo_handler }
      #bind_key( ?\C-r ) { @undo_handler.redo if @undo_handler }
      bind_key( [?y, ?y] , :kill_ring_save ) 
      bind_key( ?p, :yank ) # paste after this line
      bind_key( ?P ) { yank(@current_index - 1) } # should be before this line
      bind_key(?\M-y, :yank_pop)
      bind_key(?\M-w, :kill_ring_save)
      @_events.push :CHANGE # thru vieditable
    end