Object: sapphire.ui |
Description
LabVantage API for dialogs, panels, animation, drag-drop and linking.
File
WEB-CORE\scripts\sapphireui.js
Properties
None.
Object: sapphire.ui.selectBlocker |
Description
Blocks select elements in IE6.
File
WEB-CORE\scripts\sapphireui.js
Properties
None.
show |
Functionality
Creates and shows an iframe setup for hiding select elements in IE6.
Parameters
Parameter | Type | Description |
sId | String | Id of the iframe. |
oParent | Object | Owner element. |
iX | Integer | X coordinate. |
iY | Integer | Y coordinate. |
iWidth | Integer | Width. |
iHeight | Integer | Height. |
Returns
Object.
hide |
Functionality
Hides the select blocker.
Parameters
Parameter | Type | Description |
sId | String | Id of the iframe. |
Returns
Object.
Object: sapphire.ui.modalCover |
Description
Shows a modal cover over a page.
File
WEB-CORE\scripts\sapphireui.js
Properties
None.
create |
Functionality
Creates a div that covers a page. Ideal for using when ajax is fired to disable the page. Used in dialogs.
Parameters
Parameter | Type | Description |
sId | String | Id of the object. |
oParent | Object | Owner element. |
iOpacity | Integer | Opacity (0 to 100) of the cover. |
Returns
Object.
show |
Functionality
Shows a div that covers the page. Ideal for using when ajax is fired to disable the page. Used in dialogs.
Parameters
Parameter | Type | Description |
oModal | Object | Object to show. |
Returns
None.
hide |
Functionality
Hides the modal cover.
Parameters
Parameter | Type | Description |
oModal | Object | Object to hide. |
Returns
None.
resize |
Functionality
Resizes a model div.
Parameters
Parameter | Type | Description |
oModal | Object | Object to resize. |
Returns
None.
remove |
Functionality
Removes a cover.
Parameters
Parameter | Type | Description |
sId | String | Id for the object. |
oParent | Object | Owner element. |
Returns
None.
Object: sapphire.ui.dialog |
Description
Shows dialogs and popups.
File
WEB-CORE\scripts\sapphireui.js
Properties
Property | Type | Description |
dialogCount | Integer | Number of dialogs created in the page. This number 1 is the last dialog number. |
focusedNumber | Integer | Dialog number of the currently focused dialog. |
started | Boolean | The value of this is true if a dialog has been created on the current page. |
alert |
Functionality
Shows a LabVantage alert dialog. Returns the created dialog object.
Parameters
Parameter | Type | Description |
sContent | String | Text for the dialog. |
Returns
Object.
show |
Functionality
Shows a LabVantage dialog. Returns the created dialog object.
Parameters
Parameter | Type | Description |
stitle | String | title for the dialog. Defaults to LabVantage if not specified. |
sContent | String | Text for the dialog. |
lModal | Boolean | Set to true to show the dialog as a modal dialog. Set to false for a non-modal dialog (shows the dialog but lets you use the application). |
sURL | String | If provided, creates a basic URL dialog. You can specify
a full URL to a Web page, a LabVantage page name, or the request string
(rc?command=file).
To provide buttons and submit data to the URL, then use the "open" method. |
Returns
Object.
open |
Functionality
Shows a LabVantage URL dialog. Returns the created dialog object.
Parameters
Parameter | Type | Description |
stitle | String | title for the dialog. Defaults to LabVantage if not specified. |
sURL | String |
If provided, creates a basic URL dialog. You can specify a full URL to a Web page, a LabVantage page name, or the request string (rc?command=file). To provide buttons and submit data to the URL, then use the "open" method. |
lModal | Boolean | Set to true to show the dialog as a modal dialog. Set to false for a non-modal dialog (shows the dialog but lets you use the application). |
iWidth | Integer | Width in pixels of the dialog. |
iHeight | Integer | Height in pixels of the dialog. |
oBtns | Object | Buttons object. For example, to create two buttons, specify {"My Button":"alert(1)","Another":"alert(2)"} |
oForm | Object | Form to submit to the URL. This can be a form in the current page or a dynamic form created using the "document.createElement('FORM');" syntax. |
lResizable | Boolean | Set to true (default) to allow resizing of the dialog. Set to false to lock the dialogs size. |
Returns
Object.
create |
Functionality
Creates a custom dialog. Returns the created dialog object.
Parameters
Parameter | Type | Description |
iWidth | Integer | Width in pixels of the dialog. |
iHeight | Integer | Height in pixels of the dialog. |
stitle | String | title for the dialog. |
sHTML | String | HTML content for the dialog. |
oBtns | Object | Buttons object. For example, to create two buttons, specify {"My Button":"alert(1)","Another":"alert(2);"} |
lResizable | Boolean | Set to true to allow the dialog to be resized or set to false to stop the dialog from being resized. |
lShowInnerContainer | Boolean | Set to true to show the inner container of the dialog. You will need to show this if you are rendering buttons. |
lModal | Boolean | Set to true to show the dialog as a modal dialog. Set to false for a non-modal dialog (shows the dialog but lets you use the application). |
iInnerPadding | Integer | Pixel padding around the inner dialog area (the default is 10). |
sCloseFunction | String | Function to execute when the dialog is closed by clicking the top close button or pressing the Esc key. |
Returns
Object.
prompt |
Functionality
Prompts the user to input a string.
Parameters
Parameter | Type | Description |
stitle | String | title for the dialog. |
sPrompt | String | Prompt for the dialog. |
sDefault | String | Default prompt entry. |
sReturnFunction | String | Function to callback to. If not specified, calls the default callback. |
Returns
Object (the dialog object).
multiPrompt |
Functionality
Prompts the user to input multiple strings.
Parameters
Parameter | Type | Description |
stitle | String | title for the dialog. |
saPromptArray | String Array | Prompts for the dialog. |
saDefaultArray | String Array | Default prompt entries. |
sReturnFunction | String | Function to callback to. If not specified, calls the default callback. |
Returns
Object (the dialog object).
confirm |
Functionality
Prompts the user for a yes or no (true or false).
You can also pass the returned dialog object the yesscript, yescallback, yescallbackobjects, noscript, notcallback and nocallbackarguments. It will then automatically process these if you have not specified a return function. If you have specified a return function, you can call sapphire.ui.dialog.postConfirm to run the various callbacks from your return function.
Parameters
Parameter | Type | Description |
stitle | String | title for the dialog. |
sPrompt | String | Prompt for the dialog. |
sReturnFunction | String | Function to callback to. If not specified, calls the default callback. |
Returns
Object (the dialog object).
postConfirm |
Functionality
Used to process the result of the confirmation dialog. If you have specified the dialog object with callback variables, this processes those variables.
Parameters
Parameter | Type | Description |
oDialog | Object | Dialog object. |
lValue | String | Result of the dialog. |
Returns
None.
attachOnShowEvent |
Functionality
Attaches an event (reference to function) or script to run when the dialog has finished showing.
Parameters
Parameter | Type | Description |
iDialogNumber | Integer | Dialog handle number. |
vFunction | Object | Script or function to run. |
Returns
None.
attachOnHideEvent |
Functionality
Attaches an event (reference to function) or script to run when the dialog has finished hiding or closing.
Parameters
Parameter | Type | Description |
iDialogNumber | Integer | Dialog handle number. |
vFunction | Object | Script or function to run. |
Returns
None.
keyDown |
Functionality
Used for the onKeyDown event.
Parameters
None.
Returns
None.
showEnd |
Functionality
Callback function called when the dialog finishes showing.
Parameters
Parameter | Type | Description |
iDialogNumber | Integer | Dialog handle number. |
Returns
None.
close |
Functionality
Closes the dialog.
Parameters
Parameter | Type | Description |
iDialogNumber | Integer | Dialog handle number. |
Returns
None.
maximize |
Functionality
Maximizes the dialog.
Parameters
Parameter | Type | Description |
iDialogNumber | Integer | Dialog handle number. |
Returns
None.
restore |
Functionality
Restores the dialog after a maximize.
Parameters
Parameter | Type | Description |
iDialogNumber | Integer | Dialog handle number. |
Returns
None.
closeEnd |
Functionality
Callback function called when the dialog finishes closing.
Parameters
Parameter | Type | Description |
iDialogNumber | Integer | Dialog handle number. |
Returns
None.
clearFocus |
Functionality
Clears focus on a dialog and removes it from the order management object. This is typically called when the dialog is closed.
Parameters
Parameter | Type | Description |
iDialogNumber | Integer | Dialog handle number. |
Returns
None.
focus |
Functionality
Sets focus to the dialog. This means it brings the dialog to the top and sets the focusedNumber property to the dialog number.
Parameters
Parameter | Type | Description |
iDialogNumber | Integer | Dialog handle number. |
Returns
None.
getDialogNumber |
Functionality
Gets the dialog number of the dialog. If you provide a window object of the frame within a dialog, this returns the dialog number of the dialog you are in. Alternatively, if you do not provide any window object, the currently focused dialog number is returned.
Parameters
Parameter | Type | Description |
oWindow | Object | Window object from within the dialog iframe. |
Returns
Integer.
getDialogButton |
Functionality
Gets the dialog button element. You can use this to enable, disable, or hide dialog buttons.
Parameters
Parameter | Type | Description |
iDialogNumber | Integer | Dialog handle number. |
iButtonNumber | Integer | Button number (starting from 0 for the left-most button). |
Returns
Object.
getDialogObject |
Functionality
Gets the dialog object (DIV element).
Parameters
Parameter | Type | Description |
iDialogNumber | Integer | Dialog handle number. |
Returns
Object.
setContent |
Functionality
Sets the content of an existing dialog.
Parameters
Parameter | Type | Description |
iDialogNumber | Integer | Dialog handle number. |
sHTML | String | New dialog content. |
Returns
None.
Object: sapphire.ui.panel |
Description
Manages panels.
File
WEB-CORE\scripts\sapphireui.js
Properties
Property | Type | Description |
panels | Object Array | Array of panels that exist on the current page. |
register |
Functionality
Registers a new panel on a page.
Parameters
Parameter | Type | Description |
sPanelId | String | Id of the panel element. |
lDragDrop | Boolean | Set to true to enable drag drop for the panel. |
sResizeEvent | String | JavaScript to execute when the panel is resized. |
sDropEvent | String | JavaScript to execute when the panel is dropped. |
Returns
None.
load |
Functionality
Load functionality of all registered panels.
Parameters
None.
Returns
None.
focus |
Functionality
Sets focus on the panel element. This brings the panel to the top of all other panels.
Parameters
Parameter | Type | Description |
sPanelId | String | Id of the panel element. |
Returns
None.
close |
Functionality
Removes a panel from the panel registration and the page.
Parameters
Parameter | Type | Description |
sPanelId | String | Id of the panel element. |
Returns
None.
Object: sapphire.ui.order |
Description
Manages the z-index.
File
WEB-CORE\scripts\sapphireui.js
Properties
Property | Type | Description |
zOrder | Object | Object array holding z-order collections. |
register |
Functionality
Registers an object as z-order usable. To be usable for z-order manipulation, the object must have its style.position attribute set to "absolute", and have a height and width style attribute.
Parameters
Parameter | Type | Description |
oElement | Object | Element for ordering. |
oaFollowElements | Object Array | Array of elements that should be ordered to the same z-index as the primary object. For example, in dialogs this would be the shadow element. |
Returns
None.
unregister |
Functionality
Unregisters the element from the z-order management routines.
Parameters
Parameter | Type | Description |
oElement | Object | Element to be unregistered. |
oaFollowElements | Object Array | Array of elements that should be ordered to the same z-index as the primary object. For example, in dialogs this would be the shadow element. |
Returns
None.
restore |
Functionality
Restores the registered elements to their specified z-index.
Parameters
Parameter | Type | Description |
lTriggerEvent | Boolean | Set to true to activate and call the z-order change trigger event. |
Returns
None.
bringToFront |
Functionality
Brings the specified element to the front of all others.
Parameters
Parameter | Type | Description |
oElement | Object | Element for bringing to the front. This must be a registered element. |
Returns
None.
setZIndexChangedEvent |
Functionality
Registers a z-index changed event to the specified element.
Parameters
Parameter | Type | Description |
oElement | Object | Element with the event to be registered. This must be a registered element. |
oChangeEvent | Function | Function to call when the event is triggered. |
Returns
None.
Object: sapphire.ui.animation |
Description
Provides fade-in/out and transition-in/out animations.
File
WEB-CORE\scripts\sapphireui.js
Properties
Property | Type | Description |
menuEnabled | Boolean | Set to true if the menu animations are enabled. |
fadeInOutEnabled | Boolean | Set to true if the fade in and fade out animations are enabled. |
resizeInOutEnabled | Boolean | Set to true if the resize in and resize out animations are enabled. |
fadeIn |
Functionality
Fades any element into the page.
Parameters
Parameter | Type | Description |
id | String | Id of element. |
millisec | Integer | number of milliseconds between iterations. |
inc | Integer | Amount by which to increase opacity on each iteration. |
startOpacity | Integer | Starting opacity. |
endOpacity | Integer | Ending opacity. |
animationOnEnd | Function | Function to call when the animation is complete. |
Returns
None.
fadeOut |
Functionality
Fades any element out of the page.
Parameters
Parameter | Type | Description |
id | String | Id of element. |
millisec | Integer | Number of milliseconds between iterations. |
dec | Integer | Amount by which to decrease opacity on each iteration. |
startOpacity | Integer | Starting opacity. |
endOpacity | Integer | Ending opacity. |
animationOnEnd | Function | Function to call when the animation is complete. |
Returns
None.
changeObjectFade |
Functionality
Updates an element with fade transition settings.
Parameters
Parameter | Type | Description |
id | String | Id of element. |
opacity | Integer | Opacity to set. |
show | Boolean | Set to true if showing. |
hide | Boolean | Set to true if hiding. |
Returns
None.
showObjectVertical |
Functionality
Resizes any element into the page (such as zoom-in transition) along the vertical dimension.
Parameters
Parameter | Type | Description |
id | String | Id of element. |
millisec | Integer | Number of milliseconds between iterations. |
inc | Integer | Amount by which to increase height on each iteration. |
animationOnEnd | Function | Function to call when the animation has completed. |
Returns
None.
showObjectHorizontal |
Functionality
Resizes any element into the page (such as zoom-in transition) along the horizontal dimension.
Parameters
Parameter | Type | Description |
id | String | Id of element. |
millisec | Integer | Number of milliseconds between iterations. |
inc | Integer | Amount by which to increase height on each iteration. |
animationOnEnd | Function | Function to call when the animation has completed. |
Returns
None.
hideObjectVertical |
Functionality
Resizes any element out of the page (such as zoom-out transition) along the vertical dimension.
Parameters
Parameter | Type | Description |
id | String | Id of element. |
millisec | Integer | Number of milliseconds between iterations. |
inc | Integer | Amount by which to increase height on each iteration. |
animationOnEnd | Function | Function to call when the animation has completed. |
Returns
None.
hideObjectHorizontal |
Functionality
Resizes any element out of the page (such as zoom-out transition) along the horizontal dimension.
Parameters
Parameter | Type | Description |
id | String | Id of element. |
millisec | Integer | Number of milliseconds between iterations. |
inc | Integer | Amount by which to increase height on each iteration. |
animationOnEnd | Function | Function to call when the animation has completed. |
Returns
None.
changeObjectVertical |
Functionality
Updates an element with the resize vertical transition settings.
Parameters
Parameter | Type | Description |
id | String | Id of element. |
height | Integer | Height to set. |
action | Integer | Action type to perform. |
Returns
None.
changeObjectHorizontal |
Functionality
Updates an element with the resize horizontal transition settings.
Parameters
Parameter | Type | Description |
id | String | Id of element. |
width | Integer | Width to set. |
action | Integer | Action type to perform. |
Returns
None.
Object: sapphire.ui.progress |
Description
Shows a progress bar dialog.
File
WEB-CORE\scripts\sapphireui.js
Properties
Property | Type | Description |
oProgressControl | Object | Progress control object. |
show |
Functionality
Shows the progress window.
Parameters
Parameter | Type | Description |
stitle | String | title for the dialog. |
sText1 | String | Text for the main heading. |
sText2 | String | Text for the subheading. |
iInitalTime | Integer | Start time. |
sTimeUnit | String | Unit of time. |
sImageFrom | String | Source to the image used as the from icon. |
sImageTo | String | Source to the image used as the to icon. |
Returns
None.
hide |
Functionality
Hides the progress window.
Parameters
None.
Returns
None.
hideEnd |
Functionality
Callback function called when hiding has finished.
Parameters
None.
Returns
None.
update |
Functionality
Updates the progress window.
Parameters
Parameter | Type | Description |
sText1 | String | Text for the main heading. |
sText2 | String | Text for the subheading. |
iTotalItems | Integer | Total number of iterations/items. |
iItemNumber | Integer | Current iteration/item. |
nTimePerItem | Double | Time per iteration/item. |
Returns
None.
Object: sapphire.ui.resize |
Description
Dynamically resizes any HTML element.
File
WEB-CORE\scripts\sapphireui.js
Properties
Property | Type | Description | |||||||||||||||
xcorr | Integer | x dimension correction. This is added to the calculation of the resize and should be used if the resize is out on this dimension. | |||||||||||||||
ycorr | Integer | y dimension correction. This is added to the calculation of the resize and should be used if the resize is out on this dimension. | |||||||||||||||
offsetX | Integer | x coordinate offset. This is the difference between the real mouse coordinate and the actual mouse coordinate. | |||||||||||||||
offsetY | Integer | y coordinate offset. This is the difference between the real mouse coordinate and the actual mouse coordinate. | |||||||||||||||
bounds | Object | A bounds object containing:
|
|||||||||||||||
resizing | Boolean | This value is true if the API is currently performing a resize on an object. | |||||||||||||||
direction | String | Direction of the resize. This will be N, NE, E, SE, S, SW or NW. | |||||||||||||||
orgbodycursor | String | style cursor to use for the body object when resizing is complete. | |||||||||||||||
resizeObject | Object | Resized HTML div element (the dashed box). | |||||||||||||||
resizableObject | Object | HTML element being resized. |
start |
Functionality
Starts resizing an element. For resize to occur, the element must have the style position attribute set to absolute, and have a width and height.
Parameters
Parameter | Type | Description |
oResizableObject | Object | HTML element to resize. |
oaFollowObjects | Object | HTML elements to resize after the primary object has been resized. |
sDirection | String | Direction for the resize. This will be N, NE, E, SE, S, SW or NW. |
Returns
None.
doMMFrame |
Functionality
Operates the onMouseMove event from an iframe element.
Parameters
Parameter | Type | Description |
sFrameId | String | Id of the iframe with the mouse event. |
Returns
None.
doMUFrame |
Functionality
Operates the onMouseUp event from an iframe element.
Parameters
Parameter | Type | Description |
sFrameId | String | Id of the iframe with the mouse event. |
Returns
None.
doResizeMM |
Functionality
Operates the onMouseMove event from the main window.
Parameters
None.
Returns
None.
doResize |
Functionality
Resizes a resizable HTML element.
Parameters
Parameter | Type | Description |
iX | Integer | x coordinate to which the element is resized. |
iY | Integer | y coordinate to which the element is resized. |
Returns
None.
doResizeEnd |
Functionality
Called when the resizing is complete, this performs the resize on the resizable HTML element.
Parameters
None.
Returns
None.
maximize |
Functionality
Maximizes a resizable HTML element.
Parameters
Parameter | Type | Description |
oResizableObject | Object | HTML element to be maximized. |
Returns
None.
restore |
Functionality
Restores a resizable HTML element from a maximized state.
Parameters
Parameter | Type | Description |
oResizableObject | Object | HTML element to be maximized. |
Returns
None.
setResizeEvent |
Functionality
Sets an event to trigger when an element is resized.
Parameters
Parameter | Type | Description |
oResizableObject | Object | HTML element to be resized. |
oOnResize | Function | Function to call when the event is triggered. |
Returns
None.
Object: sapphire.ui.dragdrop |
Description
Applies drag and drop to any HTML element.
File
WEB-CORE\scripts\sapphireui.js
Properties
Property | Type | Description | |||||||||||||||
xcorr | Integer | x dimension correction. This is added to the calculation of the drag and should be used if the drag is out on this dimension. | |||||||||||||||
ycorr | Integer | y dimension correction. This is added to the calculation of the drag and should be used if the drag is out on this dimension. | |||||||||||||||
offsetX | Integer | x coordinate offset. This is the difference between the real mouse coordinate and the actual mouse coordinate. | |||||||||||||||
offsetY | Integer | y coordinate offset. This is the difference between the real mouse coordinate and the actual mouse coordinate. | |||||||||||||||
bounds | Object | A bounds object containing:
|
|||||||||||||||
startLeft | Integer | starting x position of the object that is being dragged. This is 0 when not in a drag process. | |||||||||||||||
startTop | Integer | starting y position of the object that is being dragged. This is 0 when not in a drag process. | |||||||||||||||
dragObject | Object | HTML element that is being dragged. This is null when not in a drag process. | |||||||||||||||
dropTarget | Object | current HTML element that is registered as a drop target and the dragable HTML element is over. This is null when not activated. | |||||||||||||||
targets | Object Array | Array of registered drop targets. These are HTML elements where the dragable HTML element can be dropped. | |||||||||||||||
cursor | String | style of cursor to use when resizing. This is defaulted to the "move" cursor. | |||||||||||||||
dragging | Boolean | This is true when the drag drop process is active. |
setMoveX |
Functionality
Sets the movement in the x dimension. By default the movement is allowed both left and right.
Parameters
Parameter | Type | Description |
oDragPointElement | Object | Drag point element. This is the element that has been registered as the element on which the drag is initialized (such as a dialog header bar). |
iMovement | Integer | Movement constant. This is 1 for right only, -1 for left only, 0 for no x dimension movement, and 99 for both left and right movement. |
Returns
None.
setMoveY |
Functionality
Sets the movement in the y dimension. By default the movement is allowed both up and down.
Parameters
Parameter | Type | Description |
oDragPointElement | Object | Drag point element. This is the element that has been registered as the element on which the drag is initialized (such as a dialog header bar). |
iMovement | Integer | Movement constant. This is 1 for up only, -1 for down only, 0 for no y dimension movement, and 99 for both up and down movement. |
Returns
None.
setFollowElements |
Functionality
Sets a collection of elements to move to the same position when the primary draggable object has been dragged.
Parameters
Parameter | Type | Description |
oDragPointElement | Object | Drag point element. This is the element that has been registered as the element on which the drag is initialized (such as a dialog header bar). |
oaFollowElements | Object Array | Array of HTML elements to follow the primary draggable object. |
Returns
None.
setDropOnTargetEvent |
Functionality
Sets an event to call when the draggable HTML element has been dropped on the drop target HTML element.
Parameters
Parameter | Type | Description |
oDragPointElement | Object | Drag point element. This is the element that has been registered as the element on which the drag is initialized (such as a dialog header bar). |
oOnDropOnTarget | Function | Function to call when the event is triggered by the drop on target. |
Returns
None.
setDropOffTargetEvent |
Functionality
Sets an event to call when the draggable HTML element has been dropped off a drop target HTML element.
Parameters
Parameter | Type | Description |
oDragPointElement | Object | Drag point element. This is the element that has been registered as the element on which the drag is initialized (such as a dialog header bar). |
oOnDropOnTarget | Function | Function to call when the event is triggered by the drop off target. |
Returns
None.
defaultBounds |
Functionality
Sets the bounds object with the default bounds.
Parameters
Parameter | Type | Description |
oDragElement | Object | Draggable HTML element. |
oOnDropOnTarget | Function | Function to call when the event is triggered by the drop off target. |
Returns
None.
registerDragObject |
Functionality
Registers an HTML element as a draggable object.
Parameters
Parameter | Type | Description |
oDragPointElement | Object | Drag point element. This is the element that has been registered as the element on which the drag is initialized (such as a dialog header bar). |
oDragElement | Object | The draggable HTML element. |
lReset | Boolean | If true, the draggable HTML element will return to its starting position when dropped. |
Returns
None.
registerDropTarget |
Functionality
Registers an HTML element as a drop target object. A drop target is a point on the page where a draggable element can be dropped to perform an action.
Parameters
Parameter | Type | Description |
oHTMLElement | Object | HTML element to register as a drop target. |
Returns
None.
doMMFrame |
Functionality
Operates the onMouseMove event from an iframe element.
Parameters
Parameter | Type | Description |
sFrameId | String | Id of the iframe with the mouse event. |
Returns
None.
doMUFrame |
Functionality
Operates the onMouseUp event from an iframe element.
Parameters
Parameter | Type | Description |
sFrameId | String | Id of the iframe with the mouse event. |
Returns
None.
doDragMM |
Functionality
Operates the onMouseMove event from the main window. This function initializes the drag-drop process.
Parameters
None.
Returns
None.
doDrag |
Functionality
Performs the drag process. This is called whenever the drag is active and the mouse is moved.
Parameters
Parameter | Type | Description |
iX | Integer | x coordinate of the mouse. |
iY | Integer | y coordinate of the mouse. |
Returns
None.
doDragEnter |
Functionality
Operates the logic that occurs when a draggable object enters a drop target.
Parameters
Parameter | Type | Description |
oElement | Object | The HTML element that has been entered. |
Returns
None.
doDragLeave |
Functionality
Operates the logic that occurs when a draggable object leaves a drop target.
Parameters
None.
Returns
None.
doDragEnd |
Functionality
Ends the drag drop process and resets the drag drop. This is called when the mouse button is released.
Parameters
None.
Returns
None.
Object: sapphire.ui.link |
Description
Draws graphical links between any two HTML elements.
File
WEB-CORE\scripts\sapphireui.js
Properties
Property | Type | Description |
count | Integer | Number of links created. |
offset | Integer | Offset applied to each link on the same element. For example, if you provide an offset of 20, an element's links are separated by 20 pixels. The link bends are also separated by 20 pixels. This stops links from overlapping. |
attachEvent |
Functionality
Attaches an event to the link objects.
Parameters
Parameter | Type | Description |
oLink | Object | Link object to which the event is attached. |
sEventName | String | HTML event to attach (such as onClick or onMouseOver). |
oFunction | Function | Function called when the event is triggered. |
Returns
None.
detachEvent |
Functionality
Detaches an event from the link objects.
Parameters
Parameter | Type | Description |
oLink | Object | Link object from which the event is detached. |
sEventName | String | HTML event to detach (such as onClick or onMouseOver). |
oFunction | Function | Function to detach from the event tree. |
Returns
None.
register |
Functionality
Registers a link between two HTML elements. The function returns the new link object containing:
Parameter | Type | Description |
fromobject | Object | Link start HTML element. |
toobject | Object | Link end HTML element. |
linkcolor | String | Link color. |
linkwidth | Integer | Link width in pixels. |
startnodesrc | String | Start node image URL. |
centernodesrc | String | Center node image URL. |
endnodesrc | String | End node image URL. |
description | String | Link description. |
linkobject1 | Object | Image 1 used to build the link. |
linkobject2 | Object | Image 2 used to build the link. |
linkobject3 | Object | Image 3 used to build the link. |
linkobject4 | Object | Image 4 used to build the link. |
linkobject5 | Object | Image 5 used to build the link. |
startnode | Object | Start node element. |
centernode | Object | Center node element. |
endnode | Object | End node element. |
descriptionnode | Object | Description node element. |
Parameters
Parameter | Type | Description |
oFromObject | Object | HTML element from which to link. |
oToObject | Object | HTML element linked to. |
sLinkColor | String | Color of the lines in the link. This can be an HTML color name or a hexadecimal color (such as #FF0000). |
iLinkWidth | Integer | Width in pixels of the link lines. |
sStartNodeSrc | String | Source/URL of the image placed at the start of the link. |
sCenterNodeSrc | String | Source/URL of the image placed at the center of the link. |
sEndNodeSrc | String | Source/URL of the image placed at the end of the link. |
sDescription | String | Description text placed in a buble at the center of the link. |
Returns
Object.
updateAll |
Functionality
Updates all links (to and from the specified HTML element) to their new positions and sizes.
Parameters
Parameter | Type | Description |
oLinkedObject | Object | Element that has been registered for linking and requires updating. |
Returns
None.
removeAll |
Functionality
Removes all links to and from the specified HTML element.
Parameters
Parameter | Type | Description |
oLinkedObject | Object | Element that has been registered for linking and requires link removal. |
Returns
None.
hideAll |
Functionality
Hides all links to and from the specified HTML element.
Parameters
Parameter | Type | Description |
oLinkedObject | Object | Element that has been registered for linking and requires hidden links. |
Returns
None.
change |
Functionality
Updates a link to the correct size and position.
Parameters
Parameter | Type | Description |
oLink | Object | Link object representing this link. To get this, call the register function, or access the "links" object array on the linked element. |
Returns
None.
add |
Functionality
Add a link to the page.
Parameters
Parameter | Type | Description |
oLink | Object | Link object representing this link. To get this, call the register function, or access the "links" object array on the linked element. |
Returns
None.
draw |
Functionality
Used by the link API to draw the link.
Parameters
Parameter | Type | Description |
iaCoordFrom | Integer Array | The "from" coordinate array (point array of X and Y). |
iaCoordTo | Integer Array | The "to" coordinate array (point array of X and Y). |
iLinkSize | Integer | Size in pixels of the link. |
oLinkObject1 | Object | Link image 1. |
oLinkObject2 | Object | Link image 2. |
oLinkObject3 | Object | Link image 3. |
oLinkObject4 | Object | Link image 4. |
oLinkObject5 | Object | Link image 5. |
oStart | Object | Start node object. |
oCenter | Object | Center node object. |
oEnd | Object | End node object. |
oDescription | Object | Description node object. |
iFill | Integer | Size to space the links (in pixels). |
Returns
None.
drawLine |
Functionality
Draws the lines that make a link.
Parameters
Parameter | Type | Description |
iStartX | Integer | The x start coordinate. |
iStartY | Integer | The y start coordinate. |
iEndX | Integer | The x end coordinate. |
iEndY | Integer | The y end coordinate. |
iSize | Integer | Thickness of the line. |
oLinkObject | Object | Link image object. |
Returns
None.
hide |
Functionality
Hides the specified link.
Parameters
Parameter | Type | Description |
oLink | Object | Link object representing this link. Get this by calling the register function, or accessing the "links" object array on the linked element. |
Returns
None.
remove |
Functionality
Removes the specified link.
Parameters
Parameter | Type | Description |
oLink | Object | Link object representing this link. Get this by calling the register function, or accessing the "links" object array on the linked element. |
Returns
None.
Object: sapphire.ui.util |
Description
Provides user interface utility methods.
File
WEB-CORE\scripts\sapphireui.js
Properties
None.
findElementPos |
Functionality
Finds the position coordinate of the specified HTML element. The function returns an array consisting of the x and y coordinate. By default, this method will use recursion to find the element position. However, specifying use rect will use the rectangle method instead.
Parameters
Parameter | Type | Description |
oOrgElement | Object | HTML element for which to find the position. |
lUseRect | Boolean | Set to true to use client rectangles for finding the position (more efficient) or set to false (default) to use element recursion. |
Returns
Integer Array.
setCaretPos |
Functionality
Sets the caret position for a text element (such as a text input or text area).
Parameters
Parameter | Type | Description |
oElement | Object | Object for which to set the caret position. |
iCaretPos | Integer | New caret position. |
Returns
None.
getCaretPos |
Functionality
Gets the caret position for a text element (such as a text input or text area).
Parameters
Parameter | Type | Description |
oElement | Object | Object for which to get the caret position. |
Returns
Integer.
findCaretCoord |
Functionality
Gets the caret coordinate of a text area element. The function returns an array consisting of the x and y coordinate.
Parameters
Parameter | Type | Description |
oElement | Object | Object for which to get the caret coordinate. |
Returns
Integer Array.
addCover |
Functionality
Creates a transparent cover over the entire HTML element. The document thereby becomes inactive, or a mouse event can be trapped over iframes.
Parameters
Parameter | Type | Description |
oElement | Object | Object over which to create the cover. |
minX | Integer | The start x coordinate. |
minY | Integer | The start y coordinate. |
maxX | Integer | The end x coordinate. |
maxY | Integer | The end y coordinate. |
Returns
None.
remoteCover |
Functionality
Removes the transparent cover created with the addCover method.
Parameters
None.
Returns
None.
prepareFragment |
Functionality
Removes the provided element from the DOM and keeps a bookmark so it can be edited without slowing down the DOM. Use this with restoreFragment to connect the element back to the DOM.
Parameters
Parameter | Type | Description |
oElement | Object | Element object to remove from the DOM. |
oDoc | Object | Document or fragment on which you are working. If not provided, it uses the document. |
Returns
Returns a fragment object with properties: documentFragment (contains element), bookmark, parent (parent element).
restoreFragment |
Functionality
Restores a fragmented DOM. Use with prepareFragment.
Parameters
Parameter | Type | Description |
oFragment | Object | Fragment object returned from prepareFragment. |
Returns
Void.
scrollTo |
Functionality
Pass element object where scroll bar are, child object where we want to scroll to and the max height for the scrollable area. Used internally for the new scroll panel element.
Parameters
Parameter | Type | Description |
oEl | Object | Element where scroll bars are |
oChild | Object | Element to scroll to |
iMaxHeight | Integer | Max height of scrollable area |
Returns
None.
createPopup |
Functionality
A multibrowser solution for creating a DIV for popup contents. Returns the created popup div with additional show and hide methods (makes it compatible with IE popup calls).
Parameters
None.
Returns
Object -Div Object.
Object: sapphire.ui.button |
Description
Holds the element pointer for the last button (sapphire button) element clicked.
File
WEB-CORE\scripts\sapphireui.js
Properties
Property | Type | Description |
clicked | Object | Element pointer, last button element clicked. |