Core.js

MochaUIA Web Applications User Interface Framework.

Copyright

Copyright © 2007-2008 Greg Houston, http://greghoustondesign.com/.

License

MIT-style license.

Contributors

  • Scott F.  Frederick
  • Joel Lindau

Note

This documentation is taken directly from the javascript source files.  It is built using Natural Docs.

Todo

Consider making title tooltips optional and using them more often.

Summary
Core.js
Functions
updateContentReplace the content of a window or panel.
reloadIframeReload an iframe.
closeWindowCloses a window.
closeAllClose all open windows.
toggleWindowVisibilityToggle window visibility with Ctrl-Alt-Q.
centerWindowCenter a window in it’s container.
dynamicResizeUse with a timer to resize a window as the window’s content size changes, such as with an accordian.
garbageCleanUpEmpties all windows of their children, and removes and garbages the windows.
fixPNGBob Osola’s PngFix for IE6.

Functions

updateContent

updateContent: function(updateOptions)

Replace the content of a window or panel.

Arguments

elementThe parent window or panel.
childElementThe child element of the window or panel recieving the content.
title(string) Change this if you want to change the title of the window or panel.
content(string or element) An html loadMethod option.
loadMethod(‘html’, ‘xhr’, or ‘iframe’) Defaults to ‘html’.
urlUsed if loadMethod is set to ‘xhr’ or ‘iframe’.
padding(object)

reloadIframe

reloadIframe: function(iframe)

Reload an iframe.  Fixes an issue in Firefox when trying to use location.reload on an iframe that has been destroyed and recreated.

Arguments

iframeThis should be both the name and the id of the iframe.

Syntax

MochaUI.reloadIframe(element);

Example

To reload an iframe from within another iframe:

parent.MochaUI.reloadIframe('myIframeName');

closeWindow

closeWindow: function(windowEl)

Closes a window.

Syntax

MochaUI.closeWindow();

Arguments

windowElthe ID of the window to be closed

Returns

truethe window was closed
falsethe window was not closed

closeAll

closeAll: function()

Close all open windows.

toggleWindowVisibility

toggleWindowVisibility: function()

Toggle window visibility with Ctrl-Alt-Q.

centerWindow

centerWindow: function(windowEl)

Center a window in it’s container.  If windowEl is undefined it will center the window that has focus.

dynamicResize

dynamicResize: function(windowEl)

Use with a timer to resize a window as the window’s content size changes, such as with an accordian.

garbageCleanUp

garbageCleanUp: function()

Empties all windows of their children, and removes and garbages the windows.  It is does not trigger onClose() or onCloseComplete().  This is useful to clear memory before the pageUnload.

Syntax

MochaUI.garbageCleanUp();

fixPNG

function fixPNG(myImage)

Bob Osola’s PngFix for IE6.

example

<img src="xyz.png" alt="foo" width="10" height="20" onload="fixPNG(this)">

note

You must have the image height and width attributes specified in the markup.

updateContent: function(updateOptions)
Replace the content of a window or panel.
reloadIframe: function(iframe)
Reload an iframe.
closeWindow: function(windowEl)
Closes a window.
closeAll: function()
Close all open windows.
toggleWindowVisibility: function()
Toggle window visibility with Ctrl-Alt-Q.
centerWindow: function(windowEl)
Center a window in it’s container.
dynamicResize: function(windowEl)
Use with a timer to resize a window as the window’s content size changes, such as with an accordian.
garbageCleanUp: function()
Empties all windows of their children, and removes and garbages the windows.
function fixPNG(myImage)
Bob Osola’s PngFix for IE6.
Close