sesaparcours
    Preparing search index...

    Fake class which should be extended to avoid inheriting static properties

    Hierarchy (View Summary)

    Index

    Constructors

    • Class for an image on a block.

      Parameters

      • src: string

        The URL of the image.

      • width: string | number

        Width of the image.

      • height: string | number

        Height of the image.

      • Optionalopt_alt: string

        Optional alt text for when block is collapsed.

      • Optionalopt_onClick: (_0: Blockly.FieldImage) => any

        Optional function to be called when the image is clicked. If opt_onClick is defined, opt_alt must also be defined.

      • Optionalopt_flipRtl: boolean

        Whether to flip the icon in RTL.

      • Optionalopt_config: Object

        A map of options used to configure the field. See the [field creation documentation]https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/image#creation for a list of properties this parameter supports.

      Returns FieldImage__Class

    Properties

    disposed: boolean

    Has this field been disposed of?

    EDITABLE: boolean

    Editable fields usually show some sort of UI indicating they are editable. This field should not.

    maxDisplayLength: number

    Maximum characters of text to display before adding an ellipsis.

    name: any

    Name of field. Unique within each block. Static labels are usually unnamed.

    SERIALIZABLE: boolean

    Serializable fields are saved by the XML renderer, non-serializable fields are not. Editable fields should also be serializable. This is not the case by default so that SERIALIZABLE is backwards compatible.

    Methods

    • Updates the field to match the colour/style of the block. Should only be called by BlockSvg.applyColour().

      Returns void

    • Dispose of all DOM objects and events belonging to this editable field.

      Returns void

    • Force a rerender of the block that this field is installed on, which will rerender this field and adjust for any sizing changes. Other fields on the same block will not rerender, because their sizes have already been recorded.

      Returns void

    • Sets the field's value based on the given XML element. Should only be called by Blockly.Xml.

      Parameters

      • fieldElement: Element

        The element containing info about the field's state.

      Returns void

    • Returns whether or not we should flip the field in RTL.

      Returns boolean

      True if we should flip in RTL.

    • Search through the list of inputs and their fields in order to find the parent input of a field.

      Returns Input

      The input that the field belongs to.

    • Returns the bounding box of the rendered field, accounting for workspace scaling.

      Returns Blockly.utils.Rect

      An object with top, bottom, left, and right in pixels relative to the top left corner of the page (window coordinates).

    • Returns the height and width of the field.

      This should in general be the only place render_ gets called from.

      Returns Blockly.utils.Size

      Height and width.

    • Get the block this field is attached to.

      Returns Blockly.Block

      The block containing this field.

    • Gets the group element for this editable field. Used for measuring the size and for positioning.

      Returns SVGGElement

      The group element.

    • Get the text from this field.

      Returns string

      Current text.

    • Returns the tooltip text for this field.

      Returns string

      The tooltip text for this field.

    • Gets the validation function for editable fields, or null if not set.

      Returns Function

      Validation function, or null.

    • Get the current value of the field.

      Returns any

      Current value.

    • Initialize everything to render this field. Override methods initModel and initView rather than this method.

      Returns void

    • Initializes the model of the field after it has been installed on a block. No-op by default.

      Returns void

    • Create the block UI for this image.

      Returns void

    • Check whether this field defines the showEditor_ function.

      Returns boolean

      Whether this field is clickable.

    • Check whether this field is currently editable. Some fields are never EDITABLE (e.g. text labels). Other fields may be EDITABLE but may exist on non-editable blocks.

      Returns boolean

      Whether this field is editable and on an editable block

    • Check whether this field should be serialized by the XML renderer. Handles the logic for backwards compatibility and incongruous states.

      Returns boolean

      Whether this field should be serialized or not.

    • Returns whether or not the field is tab navigable.

      Returns boolean

      True if the field is tab navigable.

    • Gets whether this editable field is visible or not.

      Returns boolean

      True if visible.

    • Force a rerender of the block that this field is installed on, which will rerender this field and adjust for any sizing changes. Other fields on the same block will not rerender, because their sizes have already been recorded.

      Returns void

    • Handles the given keyboard shortcut.

      Parameters

      Returns boolean

      True if the shortcut has been handled, false otherwise.

    • Whether this field references any Blockly variables. If true it may need to be handled differently during serialization and deserialization. Subclasses may override this.

      Returns boolean

      True if this field has any variable references.

    • Set the alt text of this image.

      Parameters

      • alt: string

        New alt text.

      Returns void

    • Add the cursor SVG to this fields SVG group.

      Parameters

      • cursorSvg: SVGElement

        The SVG root of the cursor to be added to the field group.

      Returns void

    • Add the marker SVG to this fields SVG group.

      Parameters

      • markerSvg: SVGElement

        The SVG root of the marker to be added to the field group.

      Returns void

    • Set the function that is called when this image is clicked.

      Parameters

      • func: (_0: Blockly.FieldImage) => any

        The function that is called when the image is clicked, or null to remove.

      Returns void

    • Attach this field to a block.

      Parameters

      Returns void

    • Sets the tooltip for this field.

      Parameters

      • newTip: TipInfo

        The text for the tooltip, a function that returns the text for the tooltip, a parent object whose tooltip will be used, or null to display the tooltip of the parent block. To not display a tooltip pass the empty string.

      Returns void

    • Sets a new validation function for editable fields, or clears a previously set validator.

      The validator function takes in the new field value, and returns validated value. The validated value could be the input value, a modified version of the input value, or null to abort the change.

      If the function does not return anything (or returns undefined) the new value is accepted as valid. This is to allow for fields using the validated function as a field-level change event notification.

      Parameters

      • handler: Function

        The validator function or null to clear a previous validator.

      Returns void

    • Used to change the value of the field. Handles validation and events. Subclasses should override doClassValidation_ and doValueUpdate_ rather than this method.

      Parameters

      • newValue: any

        New value.

      Returns void

    • Sets whether this editable field is visible or not. Should only be called by input.setVisible.

      Parameters

      • visible: boolean

        True if visible.

      Returns void

    • Show an editor when the field is clicked only if the field is clickable.

      Parameters

      • Optionalopt_e: Event

        Optional mouse event that triggered the field to open, or undefined if triggered programmatically.

      Returns void

    • Serializes this field's value to XML. Should only be called by Blockly.Xml.

      Parameters

      • fieldElement: Element

        The element to populate with info about the field's state.

      Returns Element

      The element containing info about the field's state.

    • Add or remove the UI indicating if this field is editable or not.

      Returns void