Adds a field to the Common Fields container. Used internally by H5PEditor.processSemanticsChunk
.
Optional
skipAppendTo: booleanSkips appending the common field if set
Bind events to important description
Check if clipboard can be pasted and give reason if not.
Results. {canPaste: boolean, reason: string, description: string}.
Check if any errors have been set. Blocks tab-key on $input if $errors is not empty.
Makes it easier to add consistent buttons across the editor widget
Typical CSS class format
Human readable format
Action handler when triggered
Optional
displayTitle: booleanShow button with text. Default: false
Create the HTML wrapper for field items.
Field type as string (ie. "text", "image", "number")
Label text. Can be HTML
Optional description text for the field. If set, it will be included beneath the field edit form
HTML content for the field as a string. Inserted in the wrapper
since version 1.12 (Jan. 2017, will be removed Jan. 2018). Use createFieldMarkup instead.
Optional
value: stringInitial value for the text input
Optional
maxLength: numberMaximum number of characters
Optional
placeholder: stringPlaceholder string shown if no value is entered
Optional
id: stringThe input field's id
Optional
describedby: stringaria-describedby
id
Input field as string of HTML
Find field from a path
Observe a field to get changes to its params.This is used to track changes within an object during editing in case the change needs to be reflected visually.
An example from H5PEditor.DragQuestion. This observes the "settings/background" property and changes the background of the editor if changed.
The parent object of the field
Relative to the parent object
Gets called for params changes
Translates a library object to a library string.
Library object with machineName, majorVersion and minorVersion set
Loads a complete library, with semantics, scripts and CSS from the server. Injects the javascript and stylesheets then returns the semantics object in the callback.
Callback that will be called with the library's semantics when loaded
Recursive processing of the semantics chunks.
Call remove on the given children
Render common fields of content type with given machine name.
Machine name of content type with common fields
Optional
libraries: H5PLibrary[]Library data for machine name
Attach ancestor of parent's common fields to a new wrapper
Parent content type instance that common fields should be attached to
New wrapper of common fields
Translate text strings
The library name(machineName), or "core"
Translation string identifier
Optional
vars: Record<`:${string}`, string>Placeholders and values to replace in the text
Translated string, or a default text if the translation is missing
Param: TWidgetMachineName
Typically PascalCased - MyWidget
Param: TWidgetName
Typically camelCased - myWidget
Param: TWidget
The widget class
See
https://h5p.org/node/2468