Table of contents, footnotes, format painter & change case

Four long-document tools that CKEditor and TinyMCE both put behind a paid plan. A table of contents that rebuilds itself from your headings (and shows page numbers in page view), footnotes that renumber themselves in document order, a format painter that copies character formatting between selections, and change case that rewrites the selected text without flattening the markup inside it.

Change case

Notes on the Statute of Anne

The Statute of Anne, enacted in 1710, is generally treated as the first modern copyright statute. It vested rights in authors rather than in the stationers’ guild, and it did so for a fixed term rather than in perpetuity.

Put the caret anywhere in this paragraph and insert a footnote — then insert another one above it and watch both the markers and the notes list renumber themselves.

Selected commentary

the doctrine of fair abridgement predates the modern fair-use test

Later commentators disagree about how far the statute displaced common-law rights, and the question was not settled until Donaldson v Becket in 1774.

Example code

<script src="/richtexteditor/rte.js"></script>
<script src="/richtexteditor/plugins/all_plugins.js"></script>

<div id="div_editor1">...</div>

<script>
  var editor1 = new RichTextEditor("#div_editor1");

  // --- footnotes ------------------------------------------------------
  editor1.insertFootnote();                  // marker at the caret
  editor1.insertFootnote("Ibid., p. 42");    // ...or with the note text
  editor1.getFootnotes();                    // -> [{ id, number, text }, ...]

  // Numbering follows document order and re-derives itself on every edit,
  // so inserting above, deleting, or moving a paragraph all renumber.

  // --- format painter -------------------------------------------------
  editor1.copyFormatting();     // capture at the caret
  editor1.pasteFormatting();    // paint onto the selection

  // --- change case ----------------------------------------------------
  editor1.changeCase("upper");     // THE DATA ACT
  editor1.changeCase("title");     // The Data Act
  editor1.changeCase("sentence");  // The data act
</script>