Options
Menu

IxUtil provides several auxiliary functions for Intrexx.

Index

Functions

changeLang

  • changeLang(language: string): void
  • Change the portal's language.

    Parameters

    • language: string

    Returns void

containsParam

  • containsParam(param: string, url: string): boolean
  • Searches for a parameter in a querystring.

    Parameters

    • param: string

      Parameter to search for.

    • url: string

      Querystring to search in (defaut is window.location).

    Returns boolean

copyTextToClipboard

  • copyTextToClipboard(textToCopy: string): Promise<void>
  • Copying text to the clipboard.

    Parameters

    • textToCopy: string

      Text to copy

    Returns Promise<void>

    Promise

deleteParamFromQs

  • deleteParamFromQs(param: string, queryString: string): string | boolean
  • Removes parameter from a querystring.

    Parameters

    • param: string

      Querystring parameter.

    • queryString: string

      Querystring to search in (defaut is window.location).

    Returns string | boolean

deleteParamFromUrl

  • deleteParamFromUrl(param: string, url: string): string
  • Removes parameter from an URL.

    Parameters

    • param: string
    • url: string

    Returns string

doCharStuffing

  • doCharStuffing(list: any[]): string
  • Transforms an array into a string.

    • || is the separator where | as escaped with |0

    Parameters

    • list: any[]

    Returns string

forceLogout

  • forceLogout(reloginUrl?: string): Promise<void>
  • Force portal logout and opens the portal logout page.

    Parameters

    • Optional reloginUrl: string

      Target page after successful relogin

    Returns Promise<void>

getBaseUrl

  • getBaseUrl(path?: string): string
  • Get base URL.

    Parameters

    • Optional path: string

      Path e.g. folder/file.vm.

    Returns string

getElement

  • getElement(key: string | HTMLElement | JQuery<HTMLElement>, settings?: HTMLElement | Partial<GetHtmlContextSettings>): JQuery<HTMLElement>
  • Try to get the elements for the given key.

    Parameters

    • key: string | HTMLElement | JQuery<HTMLElement>
    • settings: HTMLElement | Partial<GetHtmlContextSettings> = ...

    Returns JQuery<HTMLElement>

getForm

  • getForm(element: any): HTMLFormElement | null
  • Returns the form for an element.

    example
    var inputField = ix.util.getHtml("<GUID>");
    ix.util.getForm(inputField);
    

    Parameters

    Returns HTMLFormElement | null

getFormFields

  • Returns an array of form elements.

    Parameters

    Returns JQuery<HTMLElement>

getFuncPart

  • getFuncPart(element: HTMLElement | UpObject): UpFuncPart | null
  • Returns enclosing UpFuncPart (javascript representation of an Intrexx application page) for the passed element.

    Parameters

    • element: HTMLElement | UpObject

    Returns UpFuncPart | null

getFuncParts

  • getFuncParts(container?: HTMLElement, settings?: FuncPartFilterSettings): UpFuncPart[]
  • Returns a list of enclosing UpFuncPart (javascript representation of an Intrexx application page) for the passed element.

    Parameters

    • Optional container: HTMLElement

      The search can be restricted to a certain area within the window.

    • Optional settings: FuncPartFilterSettings

    Returns UpFuncPart[]

getHtml

  • getHtml(key: string, settings?: HTMLElement | GetHtmlContextSettings): null | HTMLElement
  • Get a HTML element via ID or GUID from a specific context (defaults to document).

    Parameters

    • key: string
    • Optional settings: HTMLElement | GetHtmlContextSettings

    Returns null | HTMLElement

getLayoutDir

  • getLayoutDir(): string
  • Gets the layout's directory.

    Returns string

getQsValue

  • getQsValue(param: string, queryString?: string): undefined | string
  • Get value of a URL querystring parameter.

    Parameters

    • param: string

      Querystring parameter.

    • Optional queryString: string

      Querystring to search in (defaut is window.location).

    Returns undefined | string

getQsValues

  • getQsValues(queryString: string): false | StringMap
  • Get URL querystring parameters or false if none found.

    Parameters

    • queryString: string

      Querystring to search in (defaut is window.location).

    Returns false | StringMap

getUp

  • getUp(key: string | HTMLElement, settings?: Partial<GetUpSettings>): null | UpControlLike
  • Returns the UpObject.

    Parameters

    • key: string | HTMLElement

      An element Guid, id or HTMLElement.

    • settings: Partial<GetUpSettings> = ...

    Returns null | UpControlLike

    The UpControl like object for the first HTML element.

htmlDecode

  • htmlDecode(text: string, decodeNbsp?: boolean): string
  • Unescapes a HTML removing traces of offending characters that could be wrongfully interpreted as markup. The following characters are reserved in HTML and must be replaced with their corresponding HTML entities:

    • " is replaced with &quot;
    • & is replaced with &amp;
    • < is replaced with &lt;
    • > is replaced with &gt;
    example
    ix.util.htmlDecode("&lt;a href=&quot;https://foobar?rq_foo=bar&amp;rq_bar=foo&quot;&gt;encode me &lt;/a&gt;");
    // returns: "<a href="https://foobar?rq_foo=bar&rq_bar=foo">encode me </a>"
    
    example
    ix.util.htmlDecode("&lt;h1&gt;example&lt;/h1&gt;&lt;br&gt;&lt;p&gt;my&nbsp;cool&nbsp;paragraph&lt;/p&gt;", true);
    // returns: "<h1>example</h1><br><p>my cool paragraph</p>"
    

    Parameters

    • text: string
    • decodeNbsp: boolean = false

      Shall &nbsp; be replaced with space ( ).

    Returns string

htmlEncode

  • htmlEncode(text: string, encodeSpace?: boolean, encodeNewline?: boolean): string
  • Ecapes a string and converts traces of HTML characters that could be wrongfully interpreted as markup. The following characters are reserved in HTML and must be replaced with their corresponding HTML entities:

    • " is replaced with &quot;
    • & is replaced with &amp;
    • < is replaced with &lt;
    • > is replaced with &gt;
    example
    ix.util.htmlEncode('<a href="https://foobar?rq_foo=bar&rq_bar=foo">encode me </a>');
    // returns: "&lt;a href=&quot;https://foobar?rq_foo=bar&amp;rq_bar=foo&quot;&gt;encode me &lt;/a&gt;"
    
    example
    ix.util.htmlEncode("<h1>example</h1>\n<p>my cool paragraph</p>", true, true);
    // returns: "&lt;h1&gt;example&lt;/h1&gt;&lt;br&gt;&lt;p&gt;my&nbsp;cool&nbsp;paragraph&lt;/p&gt;"
    

    Parameters

    • text: string
    • encodeSpace: boolean = false

      Shall space ( ) be replaced with &nbsp;.

    • encodeNewline: boolean = false

      Shall line break (\n) be replaced with &lt;br&gt;.

    Returns string

isGuid

  • isGuid(guid: any): boolean
  • Returns true if test string is a GUID.

    Parameters

    • guid: any

    Returns boolean

isHTMLElement

  • isHTMLElement(obj: any): boolean
  • Returns true if object is an HTML element, else false.

    Parameters

    • obj: any

    Returns boolean

isMouseOnElement

  • isMouseOnElement(element: HTMLElement): boolean
  • Checks if the mouse is on the given element.

    Parameters

    • element: HTMLElement

      To check if mouse is on it.

    Returns boolean

isSVGElement

  • isSVGElement(obj: any): boolean
  • Returns true if object is an SVG element, else false.

    Parameters

    • obj: any

    Returns boolean

isUndefinedOrEmpty

  • isUndefinedOrEmpty(obj: any): boolean
  • Returns true if an String|Array is undefined or empty, else false.

    Parameters

    • obj: any

    Returns boolean

isUndefinedOrNull

  • isUndefinedOrNull(obj: any): boolean
  • Returns true if an object is undefined or null, else false.

    Parameters

    • obj: any

    Returns boolean

mergeQueryStrings

  • mergeQueryStrings(string1: string, string2: string): string
  • Merges two querystrings.

    Parameters

    • string1: string
    • string2: string

    Returns string

padLeft

  • padLeft(value: string | number, length: number, padding?: string): string
  • Pads a value with given padding lefthandsite.

    Parameters

    • value: string | number
    • length: number
    • Optional padding: string

    Returns string

setQsValue

  • setQsValue(param: string, value: string, queryString: string, noHexEnc?: boolean, noUrlCheck?: boolean): string | false
  • Sets a specified querystring parameter with a given value to an URL-string that has to be passed to the URL.

    Parameters

    • param: string

      Querystring parameter to change. Add parameter if not existing already.

    • value: string

      The value for the (new) parameter.

    • queryString: string

      Complete URI or parameter component part of an URI.

    • Optional noHexEnc: boolean

      Disable hex encoding.

    • noUrlCheck: boolean = false

      Separate parameter component part from the given URI.

    Returns string | false

    Parameter component part without question mark.

setUp

  • setUp(element: HTMLElement, ctrlInfoGuid?: string, up?: any): any
  • Set and returns the UpObject or null.

    Parameters

    • element: HTMLElement
    • Optional ctrlInfoGuid: string

      Control info GUID, default is current element GUID.

    • Optional up: any

    Returns any

tableRecordInfo

  • tableRecordInfo(node: Node): any
  • Returns a table-record info object.

    Parameters

    • node: Node

      Reference to a HTML element

    Returns any

undoCharStuffing

  • undoCharStuffing(input: string): string[]
  • Splits a string to an array.

    • || is used as separator, while |0 is unescaped to |

    Parameters

    • input: string

    Returns string[]