Options
All
  • Public
  • Public/Protected
  • All
Menu

Copyright (c) 2006-2017, JGraph Ltd Copyright (c) 2006-2017, Gaudenz Alder

Hierarchy

  • Client

Index

Constructors

constructor

Properties

Static IS_ANDROID

IS_ANDROID: boolean = ...

Returns true if the user agent contains Android.

Static IS_CHROMEAPP

IS_CHROMEAPP: boolean = ...

True if the this is running inside a Chrome App.

Static IS_CHROMEOS

IS_CHROMEOS: boolean = ...

True if the client is a Chrome OS.

Static IS_EDGE

IS_EDGE: boolean = ...

True if the current browser is Microsoft Edge.

Static IS_FF

IS_FF: boolean = ...

True if the current browser is Firefox.

Static IS_GC

IS_GC: boolean = ...

True if the current browser is Google Chrome.

Static IS_IOS

IS_IOS: boolean = ...

Returns true if the user agent is an iPad, iPhone or iPod.

Static IS_LOCAL

IS_LOCAL: boolean = ...

True if the documents location does not start with http:// or https://.

Static IS_MAC

IS_MAC: boolean = ...

True if the client is a Mac.

Static IS_MT

IS_MT: boolean = ...

True if -moz-transform is available as a CSS style. This is the case for all Firefox-based browsers newer than or equal 3, such as Camino, Iceweasel, Seamonkey and Iceape.

Static IS_NS

IS_NS: boolean = ...

True if the current browser is Netscape (including Firefox).

Static IS_POINTER

IS_POINTER: boolean = ...

True if this device supports Microsoft pointer events (always false on Macs).

Static IS_SF

IS_SF: boolean = ...

True if the current browser is Safari.

Static IS_SVG

IS_SVG: boolean = ...

True if the browser supports SVG.

Static IS_TOUCH

IS_TOUCH: boolean = ...

True if this device supports touchstart/-move/-end events (Apple iOS, Android, Chromebook and Chrome Browser on touch-enabled devices).

Static IS_WIN

IS_WIN: boolean = ...

True if the client is a Windows.

Static NO_FO

NO_FO: boolean = ...

True if foreignObject support is not available. This is the case for Opera, older SVG-based browsers and all versions of IE.

Static VERSION

VERSION: string = '4.2.2'

Class: Client

Bootstrapping mechanism for the mxGraph thin client. The production version of this file contains all code required to run the mxGraph thin client, as well as global constants to identify the browser and operating system in use. You may have to load chrome://global/content/contentAreaUtils.js in your page to disable certain security restrictions in Mozilla.

Contains the current version of the mxGraph library. The strings that communicate versions of mxGraph use the following format.

versionMajor.versionMinor.buildNumber.revisionNumber

Current version is 4.2.2.

Static basePath

basePath: string = '.'

Basepath for all URLs in the core without trailing slash. Default is '.'. Set mxBasePath prior to loading the Client library as follows to override this setting:

<script type="text/javascript">
mxBasePath = '/path/to/core/directory';
</script>
<script type="text/javascript" src="/path/to/core/directory/js/Client.js"></script>

When using a relative path, the path is relative to the URL of the page that contains the assignment. Trailing slashes are automatically removed.

Static defaultLanguage

defaultLanguage: string = 'en'

Defines the default language which is used in the common resource files. Any resources for this language will only load the common resource file, but not the language-specific resource file. Default is 'en'.

Set mxDefaultLanguage prior to loading the Client library as follows to override this setting:

<script type="text/javascript">
mxDefaultLanguage = 'de';
</script>
<script type="text/javascript" src="js/Client.js"></script>

Static imageBasePath

imageBasePath: string = '.'

Basepath for all images URLs in the core without trailing slash. Default is <Client.basePath> + '/images'. Set mxImageBasePath prior to loading the Client library as follows to override this setting:

<script type="text/javascript">
mxImageBasePath = '/path/to/image/directory';
</script>
<script type="text/javascript" src="/path/to/core/directory/js/Client.js"></script>

When using a relative path, the path is relative to the URL of the page that contains the assignment. Trailing slashes are automatically removed.

Static language

language: string = ...

Defines the language of the client, eg. en for english, de for german etc. The special value 'none' will disable all built-in internationalization and resource loading. See {@link Resources#getSpecialBundle} for handling identifiers with and without a dash.

Set mxLanguage prior to loading the Client library as follows to override this setting:

<script type="text/javascript">
mxLanguage = 'en';
</script>
<script type="text/javascript" src="js/Client.js"></script>

If internationalization is disabled, then the following variables should be overridden to reflect the current language of the system. These variables are cleared when i18n is disabled. <Editor.askZoomResource>, <Editor.lastSavedResource>, <Editor.currentFileResource>, <Editor.propertiesResource>, <Editor.tasksResource>, <Editor.helpResource>, <Editor.outlineResource>, {@link ElbowEdgeHandler#doubleClickOrientationResource}, {@link Utils#errorResource}, {@link Utils#closeResource}, {@link GraphSelectionModel#doneResource}, {@link GraphSelectionModel#updatingSelectionResource}, {@link GraphView#doneResource}, {@link GraphView#updatingDocumentResource}, {@link CellRenderer#collapseExpandResource}, {@link Graph#containsValidationErrorsResource} and {@link Graph#alreadyConnectedResource}.

Static languages

languages: null | string[] = null

Defines the optional array of all supported language extensions. The default language does not have to be part of this list. See {@link Resources#isLanguageSupported}.

<script type="text/javascript">
mxLanguages = ['de', 'it', 'fr'];
</script>
<script type="text/javascript" src="js/Client.js"></script>

This is used to avoid unnecessary requests to language files, ie. if a 404 will be returned.

Static mxForceIncludes

mxForceIncludes: boolean = false

Optional global config variable to force loading the JavaScript files in development mode. Default is undefined. NOTE: This is a global variable, not a variable of Client.

<script type="text/javascript">
let mxForceIncludes = false;
</script>
<script type="text/javascript" src="/path/to/core/directory/js/Client.js"></script>

Static mxLoadResources

mxLoadResources: boolean = true

Optional global config variable to toggle loading of the two resource files in Graph and . Default is true. NOTE: This is a global variable, not a variable of Client. If this is false, you can use <Client.loadResources> with its callback to load the default bundles asynchronously.

<script type="text/javascript">
let mxLoadResources = false;
</script>
<script type="text/javascript" src="/path/to/core/directory/js/Client.js"></script>

Static mxLoadStylesheets

mxLoadStylesheets: boolean = true

Optional global config variable to toggle loading of the CSS files when the library is initialized. Default is true. NOTE: This is a global variable, not a variable of Client.

<script type="text/javascript">
let mxLoadStylesheets = false;
</script>
<script type="text/javascript" src="/path/to/core/directory/js/Client.js"></script>

Static mxResourceExtension

mxResourceExtension: string = '.txt'

Optional global config variable to specify the extension of resource files. Default is true. NOTE: This is a global variable, not a variable of Client.

<script type="text/javascript">
let mxResourceExtension = '.txt';
</script>
<script type="text/javascript" src="/path/to/core/directory/js/Client.js"></script>

Methods

Static isBrowserSupported

  • isBrowserSupported(): boolean
  • Returns true if the current browser is supported, that is, if <Client.IS_SVG> is true.

    Example:

    if (!Client.isBrowserSupported())
    {
    mxUtils.error('Browser is not supported!', 200, false);
    }

    Returns boolean

Static link

  • link(rel: string, href: string, doc?: null | Document, id?: null | string): void
  • Adds a link node to the head of the document. Use this to add a stylesheet to the page as follows:

    Client.link('stylesheet', filename);
    

    where filename is the (relative) URL of the stylesheet. The charset is hardcoded to ISO-8859-1 and the type is text/css.

    Parameters

    • rel: string

      String that represents the rel attribute of the link node.

    • href: string

      String that represents the href attribute of the link node.

    • doc: null | Document = null

      Optional parent document of the link node.

    • id: null | string = null

      unique id for the link element to check if it already exists

    Returns void

Static setBasePath

  • setBasePath(value: string): void

Static setDefaultLanguage

  • setDefaultLanguage(value: undefined | null | string): void
  • Parameters

    • value: undefined | null | string

    Returns void

Static setForceIncludes

  • setForceIncludes(value: boolean): void

Static setImageBasePath

  • setImageBasePath(value: string): void

Static setLanguage

  • setLanguage(value: undefined | null | string): void
  • Parameters

    • value: undefined | null | string

    Returns void

Static setLanguages

  • setLanguages(value: undefined | null | string[]): void
  • Parameters

    • value: undefined | null | string[]

    Returns void

Static setLoadResources

  • setLoadResources(value: boolean): void

Static setLoadStylesheets

  • setLoadStylesheets(value: boolean): void

Static setResourceExtension

  • setResourceExtension(value: string): void

Generated using TypeDoc