Interact with the user interface of the editor and generate custom UI.

Hierarchy

  • UI

Methods

  • Adds UI elements to the specified destination.

    Parameters

    • callback: null

      [Deprecated] The callback is not required anymore and should not be used. Pass null instead.

    • destination: UiDestinationTarget

      The destination to add the UI to.

    • Rest ...args: MEUIBase[]

      A list of UI items to add to the destination.

    Returns void

  • Removes all custom UI elements from the editor interface.

    Parameters

    Returns void

  • Closes a dialog.

    Parameters

    • dialogId: string

      The id of the dialog to close.

    Returns void

  • Method for custom fields to set the UI for the field popup dialog. Up to 3 individual tabs can be used. Each tab can have a custom UI item to display.

    Parameters

    Returns void

  • Removes UI elements from the editor interface.

    Parameters

    • callback: null

      [Deprecated] The callback is not required anymore and should not be used. Pass null instead.

    • Rest ...args: MEUIBase[]

      The list of UI items to remove.

    Returns void

  • Returns the currently selected album in the gallery control.

    Returns MediaAlbum

    The currently selected album.

  • Shows a dialog for the user to enter a text value.

    Parameters

    • message: string

      The message to display on the dialog.

    • title: string

      The title of the dialog.

    • defaultValue: string

      The default value to display in the input field.

    • callback: ((success, input) => void)

      The callback will be triggered once the user closes the dialog. If the user clicked OK, the success parameter will be true, otherwise if he canceled it will be false.

        • (success, input): void
        • Parameters

          • success: boolean
          • input: string

          Returns void

    • cssClasses: string

      Adds one or more css classes (separated by space) to the dialog - used for custom styling.

    Returns void

  • Shows a dialog for the user to enter a number value.

    Parameters

    • message: string

      The message to display on the dialog.

    • title: string

      The title of the dialog.

    • defaultValue: number

      The default value to display in the input field.

    • min: number

      The minimum value allowed.

    • max: number

      The maximum value allowed.

    • step: number

      The step size to use for the input field.

    • callback: ((success, input) => void)

      The callback will be triggered once the user closes the dialog. If the user clicked OK, the success parameter will be true, otherwise if he canceled it will be false.

        • (success, input): void
        • Parameters

          • success: boolean
          • input: number

          Returns void

    • cssClasses: string

      Adds one or more css classes (separated by space) to the dialog - used for custom styling.

    Returns void

  • Removes the overlay display and restores the editor to its normal state. Does nothing if the overlay is already hidden.

    Returns void

  • Reloads the UI elements passed as parameters - so that the script version is updated to the current version. Note that if you have callbacks configured for your UI elements, they reload automatically when the callbacks are triggered.

    Parameters

    • callback: null

      [Deprecated] The callback is not required anymore and should not be used. Pass null instead.

    • Rest ...args: MEUIBase[]

      The list of UI items to update.

    Returns void

  • Removes a previously added rectangle from the canvas.

    Parameters

    • id: any

      The identifier of the rectangle to remove. See the return value of ShowRectAreaOnPage.

    Returns void

  • Sets a new CSS rule or updates an existing rule for the editor directly. Normally CSS override can be used to change the appearance of the editor, but this function allows to set a new rule directly via scripting. This function is used to set multiple CSS attributes with their values.

    Parameters

    • name: string

      The name of the CSS rule to set.

    • object: {
          [key: string]: string;
      }

      The object with the CSS attributes and values to set.

      • [key: string]: string

    Returns void

    Example

    Editor.UI.SetCssClass(".exampleRecordEntry", {
    "display": "inline-block",
    "color": "Black",
    "font-weight": "bold",
    "padding-left": "10px",
    "cursor": "pointer"
    });
  • Sets a new CSS rule or updates an existing rule for the editor directly. Normally CSS override can be used to change the appearance of the editor, but this function allows to set a new rule directly via scripting. This function is used to set a single CSS attribute with a given value.

    Parameters

    • name: string

      The name of the CSS rule to set.

    • attr: string

      The CSS attribute to set.

    • value: string

      The CSS value to set.

    Returns void

    Example

    setCssRule(".galleryWrapper .galleryItem, .galleryWrapper .spinnerimage", "width", size + "%");
    
  • Set the default album for the current job. This will be loaded as default and will receive all new media items.

    Parameters

    • albumOrId: string | MediaAlbum

      The media album or its ID to set as the new default.

    Returns void

  • Sets the UI data for a specific target. This can be used to configure individual elements of the editor UI.

    Parameters

    • target: FreeTarget

      The target to set the data for.

    • value: unknown

      The value to set. The type and format depends on the target. See EditorUiDataFlag for details.

    Returns void

  • Adjusts the currently selected album in the gallery control.

    Parameters

    • albumOrId: string | MediaAlbum

      The media album or its ID.

    Returns void

  • Shows a dialog for the user to confirm a choice. The user has to click either a 'yes' or 'no' button.

    Parameters

    • msg: string

      The message to display on the dialog.

    • title: string

      The title of the dialog.

    • Optional buttonYesText: string

      The text to display on the 'yes' button. Default is 'Yes'.

    • Optional buttonNoText: string

      The text to display on the 'no' button. Default is 'No'.

    • Optional yesCallback: (() => void)

      The callback will be triggered if the user clicked the 'yes' button.

        • (): void
        • Returns void

    • Optional noCallback: (() => void)

      The callback will be triggered if the user clicked the 'no' button.

        • (): void
        • Returns void

    Returns void

  • Shows a modal popup dialog within the editor.

    Parameters

    • title: string

      The title of the dialog.

    • uiItem: MEUIBase

      The UI item to display in the dialog. Usually a layout item like MEUIStackLayout, but can be any UI item of type MEUIBase.

    • actions: DialogActions

      The actions to display at the bottom of the dialog. Can be any number of buttons.

    • Optional closeCallback: (() => void)

      The callback will be triggered when the dialog is closed.

        • (): void
        • Returns void

    • Optional callback: DialogCallback

      The callback will be triggered when the dialog is ready. The dialog is is passed as parameter to the callback which is needed to further interact with it.

    • Optional windowClass: string

      An optional CSS class to add to the dialog window.

    Returns void

  • Displays a dialog showing a specific editable content item identified by id.

    Parameters

    • editableContentId: number

      The id of the editable content to display.

    • Optional callback: (() => void)

      The callback is triggered when the dialog is closed.

        • (): void
        • Returns void

    • Optional options: Record<string, any>

      Optional object with options to configure the dialog.

    Returns void

  • Shows or hides a specific element of the editor UI. See EditorUiVisibilityFlag for details.

    Parameters

    • target: EditorUiVisibilityFlag

      The target to show or hide.

    • visible: boolean

      Flag to indicate if the target should be visible or not.

    Returns void

  • Displays an error message to the user. The message will not disappear automatically, but the user can close it via the close icon or the optional button. Will also be logged to the console.

    Parameters

    • msg: string

      The error message text to display.

    • Optional buttonText: string

      An optional button showing on the notification. If not set, the notification will have no button.

    • Optional callback: (() => void)

      The callback will be triggered if the user clicked the button.

        • (): void
        • Returns void

    Returns void

  • Displays a custom help message. For this to work, the help settings have to be enabled to display context help in the per product configuration. The field is optional and will display the help message for the field if it is set. If not, the help message will be displayed for the entire page if the setting to show once per field is also disabled.

    Parameters

    • fieldOrId: string | BaseField

      The optional field or its ID to display the help message for.

    • helpText: string

      The help text to display.

    Returns void

  • Helper method to display a mapping dialog to the user to map a list of items to a list of values. An existing mapping can be passed which will be used to preload the data. If no mapping is set, it will automap the items to the values if possible via AutoMap. The user can then change the mapping. Based on the parameters, the user is able to link a static value instead of a mapped value.

    Parameters

    • message: string

      The message to display on the dialog.

    • title: string

      The title of the dialog.

    • mappingItems: string[]

      The placeholder list of items to map as the keys.

    • mappingValues: string[]

      The values are the list of values available for mapping.

    • mapping: BatchMapping

      The initial mapping data to load. Can be null to trigger an initial automap.

    • allowStatic: boolean

      Flag to indicate if the user should be able to link a static value instead of a mapped value.

    • callback: ((result) => void)

      The callback will be triggered once the user closes the dialog. If the user clicked OK, the mapping will be passed as the parameter, otherwise if he canceled it will be null.

        • (result): void
        • Parameters

          Returns void

    • Optional cssClasses: string

      Adds one or more css classes (separated by space) to the dialog - used for custom styling.

    • Optional options: MappingDialogOptions

      Optional object with options to configure the dialog.

    Returns void

  • Displays a message to the user. By default this will be an information message, but additional options are available. The message will disappear automatically after a short time if no button is set. Will also be logged to the console.

    Parameters

    • msg: string

      The message to display in the notification.

    • Optional type: NotificationType

      The type of the notification. This will impact the style of the notification as well as the behaviour. Defaults to Info.

    • Optional buttonText: string

      An optional button showing on the notification. If not set, the notification will have no button.

    • Optional callback: (() => void)

      The callback will be triggered if the user clicked the button.

        • (): void
        • Returns void

    • Optional permanent: boolean

      Flag to indicate if the notification should be permanent and not disappear automatically. Default is false.

    • Optional forbidClose: boolean

      Flag to indicate if the notification should not be closable by the user. Default is false. Note that this will not prevent the notification from disappearing automatically. If also permanent is set to true, the notification will never disappear unless a button is used and clicked.

    • Optional timeout: number

      The timeout in milliseconds after which the notification should disappear automatically. Default depends on the type. Is ignored if permanent is set to true or a button is configured.

    Returns number

    The unique message identifier. Currently this cannot be used for anything, but it is returned for future use.

  • Shows a waiting overlay over the entire editor. Used to indicate that the editor is busy and to avoid user interaction. If the editori s already showing an overlay, the message and/or other options will be updated.

    Parameters

    • msg: string

      The message to show in the overlay.

    • Optional showTransparent: boolean

      If true, the overlay will be transparent, otherwise it will be opaque. Default is false.

    • Optional showUi: boolean

      You can add custom UI to the overlay. If that should be visible, set this to true. Default is false.

    • Optional showFast: boolean

      There is a transition to show the overlay (fade in). If you want to skip that, set this to true and the overlay will show immediately. Default is false.

    Returns void

  • Helper function to display the current progress of a long running operation - identified via the DocumentUpdateHandler - in the overlay. Does not automatically update the message over time, but can be called again with the same object to update the message.

    Parameters

    • msg: string

      The message prefix to show in the overlay. This will be separated then by the actual progress via a colon.

    • documentUpdateHandler: DocumentUpdateHandler

      The update handler to use to get the current progress.

    • Optional showTransparent: boolean

      If true, the overlay will be transparent, otherwise it will be opaque. Default is false.

    • Optional showUi: boolean

      You can add custom UI to the overlay. If that should be visible, set this to true. Default is false.

    • Optional showFast: boolean

      There is a transition to show the overlay (fade in). If you want to skip that, set this to true and the overlay will show immediately. Default is false.

    Returns void

  • Adds a rectangular area on the canvas to highlight and interact with a special area. The rectangle will be added to the current page and switching pages will remove the rectangle as will do a call to Refresh. This will return a unique identifier which can be used to remove the rectangle via scripting.

    Parameters

    • rect: Rect

      The rectanglular area to cover in points on the canvas.

    • Optional normalFormat: ShapeFormatOption

      Optional format to use for the rectangle. If not set, this will not be drawn. This is used when the mouse is not over the rectangle.

    • Optional hoverFormat: ShapeFormatOption

      Optional hover format to use for the rectangle. If not set, this will not be drawn. This is used when the mouse is over the rectangle and only active if we have a callback defined.

    • Optional callback: (() => void)

      Optional callback which will be triggered when the rectangle is clicked.

        • (): void
        • Returns void

    • Optional rotation: number

      Optional rotation of the rectangle in degrees. Default is 0. Rotation is around the top left corner of the rectangle.

    Returns string

    The identifier of the rectangle which can be used to remove it later.

  • Displays a warning message to the user. The warning message will disappear automatically after a short time if no button is set. Will also be logged to the console.

    Parameters

    • msg: string

      The message to show.

    • Optional buttonText: string

      An optional button showing on the notification. If not set, the notification will have no button.

    • Optional callback: (() => void)

      The callback will be triggered if the user clicked the button.

        • (): void
        • Returns void

    Returns void

  • Update UI elements passed as parameters.

    Parameters

    • callback: null

      [Deprecated] The callback is not required anymore and should not be used. Pass null instead.

    • includeChildren: boolean

      Flag to check if children of the UI element should be updated as well. Default is false.

    • Rest ...args: MEUIBase[]

      A list of UI items to update.

    Returns void

  • Updates an existing dialog

    • title
    • dialog actions / buttons
    • close callback

    Parameters

    • dialogId: string

      The id of the dialog to update.

    • title: string

      The new title of the dialog if specified. If null the title will not be changed.

    • actions: DialogActions

      The new actions to display at the bottom of the dialog. Can be any number of buttons. Will always be updated.

    • Optional closeCallback: (() => void)

      The new callback will be triggered when the dialog is closed.

        • (): void
        • Returns void

    Returns void

  • Updates the media usage counter to the currently correct values. Some script operations will not update the counter automatically, so this function can be used to update it manually.

    Returns void

Generated using TypeDoc