Lurch web app user interface

Module

DocumentSettings

This module exports a function that installs in a TinyMCE editor features for editing document settings. It also exports lookup() and store() functions that are convenience shortcuts to metadata-related function calls in the LurchDocument class.

Source

Members

staticconstant

lookup

Look up the value of a given setting in a given editor's document. This will return either the value the user has specified for that setting, as stored in the metadata for the document currently loaded in that editor, or the default value for that setting, if the user has not specified one for that document.

This is the function that most parts of the application will use. Many parts of the application will want to ask what the value is of a certain document setting, so that they can respect it. This function allows them to do so in a quick and simple way.

Source

staticconstant

store

Change the value of a given setting in a given editor's document. This will write the given value into the metadata for the current document in the given editor.

Source

Methods

static

install(editor)

Installs in a given TinyMCE editor the UI features for editing document settings. Specifically, we add a menu item called "docsettings" that is intended for the Document menu, and which does the following:

  • Pop up a user interface allowing the user to edit the document's settings.
  • Populate that user interface with the existing values of the settings stored in the document's metadata.
  • If the user accepts any changes they've made to the settings before closing the dialog, save those changes back into the document's metadata as well.

Parameters

  • editor tinymce.Editor

    the editor into which to install the features

Source