ui

Namespace

ui is a static object to handle anything related to user interface
ui utility belt can be accessed through window.ui or calling ui directly

ui

Description:
  • Handling user interface stuff

Source:

Classes

CellInfoTab

Methods

(static) bumpGridScroll()

Description:
  • Add 20% to the grid's scroll height

Source:

(static) createMenu(menuObj)

Description:
  • Create a nwjs native menu from object
    More info about nwjs's native menu at : https://docs.nwjs.io/en/latest/References/Menu/

Source:
Parameters:
Name Type Description
menuObj Array.<Obj>

Array of menu object

(static) disableButtons()

Description:
  • Disable buttons when no project is currently oppened

Source:

(static) drawWordWrapByTagField(options)

Description:
  • Create wordWrapperByTag DOM element

Source:
Parameters:
Name Type Description
options

(static) form($elm, optionsopt) → {Promise.<Object>}

Description:
  • Creates a form dialog with custom fields.

Source:
Parameters:
Name Type Attributes Default Description
$elm jQuery | Object

jQuery object or customField object representing the element to which the form will be appended.

options Object <optional>
{}

Options for customization.

Properties
Name Type Attributes Default Description
ignoreValidation boolean <optional>
false

Flag to submit the form regardless of validation errors.

Returns:
  • A promise that resolves to the form field values when the form is submitted successfully, or rejects if an error occurs.
Type
Promise.<Object>

(static) off(evt, fn)

Description:
  • Removes an event

Source:
Since:
  • 4.3.20
Example
ui.off('transLoaded', (e, opt)=> {
	// do something
})
Parameters:
Name Type Description
evt String

Event name

fn function

Function to trigger

(static) on(evt, fn)

Description:
  • Create a new event with JQuery eventing convenience

Source:
Since:
  • 4.3.20
Example
ui.on('transLoaded', (e, opt)=> {
	// do something
})
Parameters:
Name Type Description
evt String

Event name

fn function

Function to trigger

(static) onDOMReady(fn)

Description:
  • This function is called when the DOM is ready. It takes a function as a parameter and calls it immediately if the DOM is already available.
    If the DOM is not available, it adds an event listener to call the function when the DOMContentLoaded event is fired.

Source:
Parameters:
Name Type Description
fn function

The function to be called when the DOM is ready.

(static) onReady(onReadyEvent)

Description:
  • This function is called when the UI is ready. It takes a function as a parameter and adds it to the onReadyPool if the UI is not initialized.
    If the UI is already initialized, it calls all the functions in the onReadyPool and then clears the pool.

Source:
Parameters:
Name Type Description
onReadyEvent function

The function to be called when the UI is ready.

(static) one(evt, fn)

Description:
  • Run the event once
    Trigger an event and immediately removes it

Source:
Since:
  • 4.3.20
Parameters:
Name Type Description
evt String

Event name

fn function

Function to trigger

(static) openImportTrans(transFile, optionsopt)

Description:
  • Open import translator dialog window

Source:
Parameters:
Name Type Attributes Description
transFile String

Path to the file

options Object <optional>

options

(async, static) saveAs(filePath) → {Promise.<string>}

Description:
  • Open a modal and blocking save as dialog

Source:
Since:
  • 4.3.16
Parameters:
Name Type Description
filePath String

Default path of the file

Returns:
  • Path of the file. Empty when canceled
Type
Promise.<string>

(async, static) saveAsTPP(filePath) → {Promise.<string>}

Description:
  • Open a modal and blocking save as dialog

Source:
Since:
  • 5.1.6
Parameters:
Name Type Description
filePath String

Default path of the file

Returns:
  • Path of the file. Empty when canceled
Type
Promise.<string>

(static) setCurrentCellText(value, trigger)

Description:
  • Set Current Cell Text

Source:
Since:
  • 4.12.11
Parameters:
Name Type Description
value String

New value

trigger Boolean

Immidiately trigger change event

(static) trigger(evt, fn)

Description:
  • Trigger an event

Source:
Since:
  • 4.3.20
Parameters:
Name Type Description
evt String

Event name

fn function

Function to trigger

Events

busyOverlayClosed

Description:
  • Triggered when busyOverlay closed

Source:
Since:
  • 4.3.20

busyOverlayOpened

Description:
  • Triggered when busyOverlay opened

Source:
Since:
  • 4.3.20

dialogRowPropertiesOpened

Description:
  • Triggered when dialog Row Properties Opened

Source:

loadingScreenIsClosed

Description:
  • Triggered when loading console closed

Source:
Since:
  • 4.3.20

optionsWindowClosed

Description:
  • Triggered when option window is closed

Source:
Since:
  • 4.3.20

optionsWindowClosed

Description:
  • Triggered when option window is closed

Source:
Since:
  • 4.5.1

optionsWindowOpened

Description:
  • Triggered when option window is opened

Source:
Since:
  • 4.3.20