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 StringReturns 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:FieldContentReturns the unique ID of the content type.- Specified by:
getContentIDin 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:languageUuid of the language to create data for. The function will be called once for every language.modelOrObjectAn object with information about the selected model or object.{ uuid: string }parentParent element that the function is free to add content to.settingsAn object constructed with the settings from the field.envFunctions and properties related to the environment. See below for more details.
Contents of theenvargument:webUrl: stringURL that points to the directory whereWebResourceProviderfiles end upscriptUrl: stringURL that points to the directory whereScriptProviderfiles end upaddLanguageListener: (fn: (languageUUID) => void) => voidAdds a language listener. Will be called when the user changes the language.styleTable: (td: HTMLTableElement) => voidStyles the given table element.
- Returns:
- Name of js function to call when model or object is selected in the publication.
-