Public Methods

The JavaScript interface of FSI Viewer can be useful if you want to change the current image or config or add additional content depending on the object spin position or hot spot actions.



void

changeConfig(strCfgFileName, oParameters);


Reset the viewer object and change the configuration to the given configuration file.

strCfgFileName (optional): path to the configuration file (see "cfg" parameter)

oParameters (optional): an object containing parameters If present, these parameters will overwrite the parameters defined upon initialization.



Example:
var oParameters = {};
   oParameters src = "images/bluemarble.tif";
/*
// optional:
   oParameters.imageWidth;
   oParameters.imageHeight;
   oParameters.cropRect;
   oParameters.cropValues;
   oParameters.effects;
*/
 
fsiviewer.changeConfig(oParameters);


bSuccess

changeImage(cfg, strView);


Resets the viewer object and changes the image displayed to the given image file.



void

start();


Starts the viewer.



void

printAPI();


Shows all API methods in the console in alphabetical order.



bEnabled

debugEnabled();


Returns if the debug mode is enabled.



mixed

debugError();


Returns the corresponding viewer error messages in the console.



mixed

debugLog();


Returns the corresponding viewer log messages in the console.



mixed

debugWarn();


Returns the corresponding viewer warning messages in the console.



void

init(elementID, oParameters, bDebug);


Initialises the chosen viewer element.



mixed

getConfigValue(strName);


Returns the value of the configuration parameter "strName".



mixed

traceConfigValue(strName);


Traces a config value and enables you to see where (in config files, the _default.xml, etc) a specific value is set.



bInitDone

getInitDone();


Returns if the initialization process is done.



void

spinToDegree(fDegree);


Spins to the position indicated by degree. Note that you can only spin to a position that has a corresponding HD image, not to a position that shows a video only.

fDegree: the desired position in degree (0 .. 360)



void

spinToTarget(nTargetFrame, nStopSceneSet, nFrames);


Spins to the position indicated by the target parameters.

Note that you can only spin to a position that has a corresponding HD image, not to a position that shows a video only.


rcVisibleRect

getVisibleImageRect();


RETURNS: rcVisibleRect.

Returns the Image Rectangle currently visible in FSI Viewer.



strImageRectParameter

getVisibleImageRectParameter();


RETURNS: strImageRectParam.

Returns the Image Rectangle currently visible in FSI Viewer in parameter form.


fZoomAsFloat

getZoomFloat();


RETURNS: fZoomAsFloat.

Returns the current zoom stage as a float value.



strURL

getVisibleImageURL(width, height, strEffects, bMakeImageFitInto);


RETURNS: strURL.

Returns the Image URL exactly as it is currently visible in FSI Viewer.

width (default: as in viewer)
height (default: as in viewer)
effects: optional, ansonsten wie im viewer
bMakeImageFitInto: default: false, true => fit image into w x h



nMousemode

getMouseMode();


Returns the current active mouse mode.



void

setMouseMode(nMode);


Sets the active mouse mode.



nInstanceID

getInstanceID();


Returns the number of the viewer object.



strInstanceName

getInstanceName();


Returns the name of the viewer object.



void

destroy();


Destroys the given FSI Viewer object. You should destroy the instance before you remove the object spins <div> tag from the DOM tree.



void

dumpListeners();


Dumps all listeners.



strVersion

getVersion();


Returns a string containing the FSI Viewer software version.



strVersion

getBuild();


Returns a string containing the FSI Viewer software build number.



nHeight

getMenuHeight(strPurpose);


Returns a string containing the height of the menu bar.



bSuccess

addListener(strListenerName, fn, iScope);


Calls a specific listener. Listeners which are added via addListener(), remain valid when changeConfig() is called.



bSuccess

removeListener(strListenerName, fn);


Removes a specific listener.



void

showAboutWindow();


Shows the "About" window.



void

showMenuButton(strButtonID, bShow);


Shows a specific menu button.



void

updateSize();


Updates the size of a fsi-viewer element.



void

resetView();


Reset the viewer to the initial magnification and rotation.



fZoomInPercent

getZoom();


Returns the current magnification level, fZoomInPercent [0...100], where fPercent = 0 means normal scale and fPercent = 100 for maximum magnification.



void

setZoom(fPercent, bPreliminary, bAnimate);


Set magnification to the amount indicated by fPercent [0...100], where fPercent = 0 means normal scale and fPercent = 100 for maximum magnification.

bPreliminary: Set to true if the magnification level is temporary only. In this case no additional image data will be loaded. bAnimate:Set to true to animate from the current to the given magnification level.



strViewString

getViewString();


Returns the string representing the current image section and rotation. The format is: SceneSet, Scene, left, top, right, bottom SceneSet is 1 for rotations around one axis

Scene describes the rotation. If you use 36 images for a spin, scene 18 means a rotation of 180 degree.

left, top, right, bottom: image coordinates in the range [0.0 to 1.0].



bSuccess

gotoViewString(strViewString, bAnimated);


Display the image section and rotation as specified by "strViewString".

Please refer to the description of the "getViewString" method for a format description.

The boolean "bAnimated" can be used to specify, wether the view should be displayed immediately or in form of an animated movement from the current view to the specified view.



strViewString

getHotspotViewString(nHotspotID)


returns the view string for the given hotspot.

FSIHotspotID is the consecutive number of the Hotspot (1,2,3,..)



bSuccess

gotoHotspot(FSIHotspotID, bAnimate, bZoom )


displays the image section as specified by the Hotspot.

FSIHotspotID is the consecutive number of the Hotspot (1,2,3,..)

The boolean "bAnimated" can be used to specify, wether the view should be displayed immediately or in form of an animated movement from the current view to the specified view.



bPresent

getMenuButtonPresent(strButtonID)


Shows active menu buttons, can be used to remove inactive buttons from the menu if you are using a custom skin.

NOTE: Method only delivers correct results after the callback "onInitMenu" is called.



void

pressMenuButton(strButtonID)


Sets the menu button to active.



void

clickMenuButton(strButtonID)


Sets the menu button to active.



void

releaseMenuButton(strButtonID)


Disables the active menu button.



void

registerExternalMenuButton(elButton, strButtonID, strTip)


Registers an external menu button.



void

unregisterExternalMenuButton(elButton)


Unregisters an external menu button.



void

registerExternalMenuButtonsFromContainer(elContainer)


Registers an external menu button from a specific container.



void

unregisterExternalMenuButtonsFromContainer(elContainer)


Unregisters an external menu button from a specific container.



strClassName

getSkinClassName()


Returns the name of the current used skin class, e.g. fsi-skin-black



bFullscreen

getInFullScreenMode()


Enables the FullScreen mode.



bSuccess

setFullScreenElement(elFullScreenContainer)


Defines the FullScreen element.



nFrames

getSpinFrames()


Returns the amount of spin frames.



bTransparent

getImageIsTransparent()


Returns the info if the image is transparent.



oDimension

getSrcDim()


Returns the dimensions of the source image.



void

showMenuToolTip(strTip, elSrc, x, y)


Shows custom tooltips..

strTip: HTML code of thetooltip or ID in language.xml files

elSrc: the DOM element wich is used to align the tooltip, usually event.target

x,y: (optional) offset for tooltip position



void

hideMenuToolTip()


Shows custom tooltips..

strTip: HTML code of thetooltip or ID in language.xml files

elSrc: the DOM element wich is used to align the tooltip, usually event.target

x,y: (optional) offset for tooltip position



oParameters

getParameters();


Returns an object containing all parameters set via javascript or custom tag attributes.



bResult

makeBoolean(value, bDefaultValue);


Transforms a value into a boolean value, e.g.

"1" to true, "false" to false

bDefaultValue is optional and false if not defined.



mixed

getPluginParameter(strPluginName, strParameterName, defaultValue, bMakeBoolean);


Returns the parameter defined for the given plugin.

defaultValue and bMakeBoolean are optional.

example: iViewer.getPluginParameter("pages", "dir");



void

testAPIListenersStart()


Starts the API test and shows all called listeners and the parameters which they return.



void

testAPIListenersStop()


Stops the API test.



bSuccess

startAutoSpin()


Starts the auto spin.



bSuccess

stopAutoSpin()


Stops the auto spin.