Package se.conciliate.extensions.publish
Class DOMFieldContent
java.lang.Object
se.conciliate.extensions.publish.DOMFieldContent
- All Implemented Interfaces:
FieldContent
A field content that manipulates a given dom element. The given element will
not yet be placed in the DOM, to (somewhat) prevent implementors from walking
to parents of the given element and manipulate "up" the tree.
NOTE: It will always be possible to use setInterval/Timeout or ajax calls to manipulate the DOM "later" and that way gain access to the parents of the given element. To prevent this, later revisions may copy the resulting element's structure into the DOM.
NOTE: It will always be possible to use setInterval/Timeout or ajax calls to manipulate the DOM "later" and that way gain access to the parents of the given element. To prevent this, later revisions may copy the resulting element's structure into the DOM.
- Author:
- Per-Erik
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the unique ID of the content type.abstract String
Returns a function name that will be invoked when the user navigates the publication to a model or an object.
-
Constructor Details
-
DOMFieldContent
public DOMFieldContent()
-
-
Method Details
-
getContentID
Description copied from interface:FieldContent
Returns the unique ID of the content type.- Specified by:
getContentID
in interfaceFieldContent
- Returns:
- The content type ID.
-
getManipulatorFn
Returns a function name that will be invoked when the user navigates the publication to a model or an object.
To define said function: implementScriptProvider
. That will create a javascript file which will be loaded by the publication.
Argument the function will receive:language
Uuid of the language to create data for. The function will be called once for every language.modelOrObject
An object with information about the selected model or object.{ uuid: string }
parent
Parent element that the function is free to add content to.settings
An object constructed with the settings from the field.env
Functions and properties related to the environment. See below for more details.
Contents of theenv
argument:webUrl: string
URL that points to the directory whereWebResourceProvider
files end upscriptUrl: string
URL that points to the directory whereScriptProvider
files end upaddLanguageListener: (fn: (languageUUID) => void) => void
Adds a language listener. Will be called when the user changes the language.styleTable: (td: HTMLTableElement) => void
Styles the given table element.
- Returns:
- Name of js function to call when model or object is selected in the publication.
-