The Client Side API          
  
   
 


http://www.w3schools.com/jsref
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference

init.js

  • includeInitFunction( jsCode )
    • jsCode - the Javascript to execute on page load
    • Includes this Javascript code in the list of functions to run once the page has loaded
  • includeLibrary( libraryUrl )
    • libraryUrl - the path to the Javascript Wiki attachment
    • Makes this Javascript library available once the page has loaded
  • includeStyleSheet( styleSheetUrl )
    • styleSheetUrl - the path to the css (Style Sheet) Wiki attachment
    • Installs this style sheet once the page has loaded (Not working in IE)
  • exists( objectName )
    • objectName - the object or variable to check
    • Checks to see if a Javascript object or variable has been defined
    • returns true or false
  • getLibraryVersion( libraryUrl )
    • libraryUrl - the path to the Javascript Wiki attachment
    • Returns the version set by a library
  • setLibraryVersion( libraryUrl,version )
    • libraryUrl - the path to the Javascript Wiki attachment
    • version - the version label
    • Called by libraries to set their version

ajax.js

  • ajax.doGet( pageName,request )
    • pageName - The wiki page name to call
    • request - The request to pass (eg. pageName=MyPage&fileName=MyFile.txt)
    • Makes a 'get' method call to the server and returns the result synchronously
  • ajax.doPort( pageName,dataArray )
    • pageName - The wiki page name to call
    • dataArray - A two dimensional array of key value pairs to post
    • Makes a 'post' method call to the server and returns the result synchronously
  • new AjaxRequest( method,pageName,request,data,action,asynchronous )
    • An AJAX request object used in calls to postRequest
    • method - The method to request (get or post)
    • pageName - The Wiki page to send the request to
    • request - The request to pass (eg. pageName=MyPage&fileName=MyFile.txt)
    • data - A two dimensional array of key value pairs to post
    • action - The javascript action to run after the request has completed
    • asynchronous - true or false, whether the request should be asynchronous
  • ajax.postRequest( postRequest )
    • Posts an AjaxRequest to the server
    • postRequest - AjaxRequest object to process
  • fileManager.loadFile( pageName,fileName )
    • returns the contents of an attachment on the wiki as a string
  • fileManager.saveFile( pageName,fileName,data )
    • saves a string as a wiki attachment

author.js]

  • setUserName()
    • Sets a cookie 'user' to the value from a form named 'userForm' with a field named 'user'
  • readCookie(name)
    • name - the name of the cookie value to retrieve
    • Gets the value of a cookie

mouse.js

This library is reserved for future functionality

  • initMouse()
    • Initialises this library to process mouse actions
  • moved(event)
    • Called when the mouse is moved with an event object
  • up()
    • Called when a mouse button is released
  • down()
    • Called when a mouse button is pressed
  • out()
    • Called when the mouse leaves the page

tree.js

This library is used to display and control the attachment tree view.

  • buildTree( xmlElement,layerName )
    • xmlElement - The root XmlElement to display
    • layerName - The name of the layer to display in
    • Displays a tree view of the xmlElement in a given layer
    • xmlElement - An OpenForum XmlElement
    • layerName - The
  • Node(title,href,action,icon,delayedRequest)
    • The controlling Object for a displayed tree node
  • toggleNode( nodeId )
    • Expands and collapses the node with the given id
  • doAction( nodeId )
    • Performs the action associated with a node with the given id
  • showForm(nodeId)
    • Shows the form associated with a node with the given id

ui.js

This library is used to display messages to users from javascript

  • ui.showConfirm(title,message,action)
    • Displays a box with the title and message and runs the action Javascript if the user chooses to
  • ui.showAlert(title,message,action)
    • Displays a box with the title and message and runs the action Javascript
  • ui.showMessage(title,message)
    • Displays a box with the title and message. The box is only remove after a new page is displayed
  • ui.writeToLayer(layerName,htmlData)
    • Writes the given html in the named layer, replacing any existing content.

xml.js

  • XmlElement(name)
    • A Javascript XmlElement with the given name
  • XmlAttribute(name,value)
    • A Javascipt XmlAttribute used to represent attributes in an XmlElement
by Anon on 21/04/2008 at 10:08 PM