Skip to content

JavascriptFunctions

floorplanner edited this page Sep 13, 2010 · 11 revisions

The Floorplanner application has several functions that can be called from Javascript. These functions can modify the current design, show different kind of menu’s or get information about the state of the application.

Calling a function from Javascript

All you need to do to call a function from Javascript is the Floorplanner-object and the name of the function.

var fp = new Floorplanner({ project_id: 123, ... });
fp.embed('div_id');
fp.showForm( "SEND_A_FRIEND" );

Function reference

Function Description ParametersReturn
loadFloor(floorId)Loads the default design of a floorfloorId the id of the floor to loadvoid
saveDesign(designName)Saves the current designdesignName the name of the designvoid
printDesign()Opens the print dialog to print the current designnonevoid
resetDesign()Clears the current designnonevoid
isModified()Tells if the current design has been modified by the usernonetrue or false
showForm(formName, params)Shows a form (menu) in the appicationformName the name of the form to show:
SAVE, SEND_A_FRIEND, CREATE_ACCOUNT, SHARE, SELECT_DESIGN, PROJECT_SETTINGS, EXPORT_IMAGE
paramsAdditional parameters in Javascript hash format
void
getProject()Gets the information about the current project incl. its floors and incl. its designsnonea Javascript hash with all the information about the project

Clone this wiki locally