Skip to content

uEdit Objects Overview

galkahana edited this page Nov 11, 2014 · 6 revisions

When including the uEdit JavaScript file UEdit.min.js, several objects are added to the JavaScript context.
This topic provides an overview about each of the main objects.

uEdit jQuery plug-in

A document editor that is implemented as a jQuery plug-in. uEdit jQuery plug-in can be plugged into an HTML DIV and provide ability to view and manipulate a document. A UEditDocument object, representing a document, may be set on it, and so loaded. Indirectly, you can load a XLIM document to it by providing it a XLIM string, which will be parsed to a document and loaded to the editor. In both cases, at any point in time, the current document may be saved to a XLIM file. Use the getDocument method to get the UEditDocument document object that is currently shown in the application in order to query or manipulate it. Any manipulation on the object will be reflected in the application. There are two main objects that are members of the plug-in object - UEditDocumentView and UEditStoryView. The former implements the uEdit application as a document editor. It is the face of a UEditDocument as it is viewed in uEdit jQuery plug-in. UEditStoryView implements a text editor view that can be used for creating UEditRichText objects, that can be read and written from XNIP strings. Each of the editors lives independently, allowing for implementation to switch between them dynamically, when an occasional text editing is required in an application that normally uses the document editor.

Through either one of the editor faces (document or rich text) one can access their (independent) underlying objects. For example, you can access each ADOR Preview object, font repository, image repository, undo/redo stack etc.

uEdit Document Model

The uEdit document model is an implementation of the XLIM file format in JavaScript. The main document object is UEditDocument. Other objects exist to describe text (UEditText), boxes (UEditBox), images (UEditImage), layers (UEditLayer) and so on and so forth. The document exists independently from the uEdit plug-in and you can create document objects regardless of whether they are used in the uEdit Application or even do not use it at all. For example, if you are looking to create your own editor, or simply create XLIM files automatically, you can create the document model, and then save it to a XLIM file, without instantiating the jQuery plug-in at all.

uEdit document model also implements XNIP file format objects. In addition to creating and manipulating a UEditDocument object, you can also create and manipulate UEditRichText objects. These objects implement the document model of a XNIP file format and can be edited with the rich text edit mode of uEdit jQuery plug-in.

XLIM2UEdit and UEdit2XLIM

XLIM2UEdit implements a XLIM parser that creates a UEditDocument object that matches it. UEdit2XLIM can be used to write a XLIM string that represents a UEditDocument. The XLIM content is compatible with other elements of the XMPie eco-system, and so uEdit can be used as an online editor for XLIM files. Note, that the reader and writer are good also if not used as part of the uEdit jQuery plug-in, for cases when it is desirable by the application to create or parse XLIM files automatically.

In addition to handling XLIM and UEditDocument, both XLIM2UEdit and UEdit2XLIM can handle the XNIP and UEditRichtText models, also providing the ability to create and save XNIP elements.

Version Info

Two significantly lesser elements of the plug-in are muEditBuild and muEditVersion. These are global elements providing the version and build of the uEdit implementation. Very important when calling XMPie support