Callbacks

You can define callback functions by assigning methods to the FSI Pages instance.


The following callback methods exist:


onReady();


Called as soon as FSI Pages finished loading data and gets interactive.



onDestroy();


Called when the fsi-pages element is destroyed.




onInitFailed(strReason);


Called when the initialization is failed. This could happen if e.g. an image cannot be loaded or the dimensions of an image cannot be requested. The listener returns a string with the reason why the initialization failed.




onChangeConfig(strCfgFileName, oParameters);


Called when the config file is changed.




onMenuEnabled(bEnabled);


Called if the menu is enabled/disabled.




onMenuDestroy();


Called if the menu is destroyed.




onMenuButtonEnabled(strButtonID, null, bEnable);


This optional callback function can be used call an action when a button is enabled or disabled.




onMenuButtonPressed(strButtonID, evt);


This optional callback function can be used to set an action that starts when a button is pressed.




onMenuButtonReleased(strButtonID, evt);


This optional callback function can be used to set an action when a certain button is released..




onMenuButtonClicked(strButtonID, evt);


This optional callback function can be used to set an action when a certain button is released..





onMenuButtonSetPressed(bPressed);


This optional callback function can be used to call an action when a button is pressed.




onRegisterExternalMenuButtons()


This optional callback function can be used to call an action as soon as external menu buttons are registered.




onAfterRegisterExternalButton(elButton, strButtonID, bButtonPresentInViewer)


This optional callback function can be used to remove inactive buttons from the menu bar if you are using a custom skin.




onMenuReady();


This optional callback function can be used to set an action when the menu is ready (after all buttons are added).




onFullScreen(bSet);


This optional callback function can be used to call an action when FullScreen mode is enabled or disabled.




onPageChanged(nPage, strPage, strMaxPage);


This optional callback function can be used to call an action as soon as the viewed page changes.




onShowPageIndex(bShow);


This optional callback function can be used to call an action as soon as the page index is opened.




onShowBookmarkList(bShow);


This optional callback function can be used to call an action as soon as the bookmark list is opened.




onShowChapters(bShow);


This optional callback function can be used to call an action as soon as the chapters opened.




onShowChaptersData(arIndexItems);


This optional callback function can be used to return the Chapters data if the Chapters plugin is implemented (arIndexItems can be multi-dimensional if sub-chapters exist).




onShowPrintDialog(bShow);


This optional callback function can be used to call an action as soon as the print dialog is opened.




onAutoPageLayoutChange(bDoublePage);


This optional callback function can be used to call an action as soon as the page layout is automatically changed.




onPageLayoutChanged(oPageLayoutData);


This optional callback function can be used to call an action as soon as the page layout is manually changed.




onBookmarkAdded(nPage);


This optional callback function can be used to call an action as soon as a bookmark is added to the page.




onBookmarkRemoved(nPage);


This optional callback function can be used to call an action as soon as a bookmark is removed of the page.




onBookmarksLoaded(strLoaded);


This optional callback function can be used to call an action as soon as the bookmarks are loaded.




onBookmarksSaved(strStored);


This optional callback function can be used to call an action as soon as the bookmarks are saved.




onRemoveAllBookmarks();


This optional callback function can be used to call an action as soon as all bookmarks are removed.




onPageSizeChanged(nWidth, nHeight);


This optional callback function can be used to call an action as soon as the page size is changed.




onPageZoomStart(Page, oImageData, oOffset);


This optional callback function can be used to call an action as soon as a page is clicked for zoom (e.g. to call a FSI Viewer to be replace the FSI pages for zoom).




onPageZoomed(nPage);


This optional callback function can be used to call an action as soon as the page is zoomed.




onPrintPages(arPageIndices, arImageURLs);


This optional callback function can be used to call an action as soon as the pages are printed.




onPageToolTip(nLinkAreaIndex, strURL, strTipContent);


This optional callback function returns a string that is useful if you want to modify the tool tip content. Returns: strModifiedToolTipContent




onOpenPageLink(nLinkAreaIndex, strURL, strTarget);


This optional callback function can be used to call an action if links are clicked. Return "false" to prevent opening the link., return {strURL:"foo", strTarget: "bar"} to modifiy the URL or the target (both are optional)




onResize(nWidth, nHeight, bResizeDone, BFullScreen);


Called when the fsi-pages element is resized.




onSkinChanged(strCurrentSkinClass, strCurrentSkinClassBefore)


This optional callback function can be used to call an action as soon as the skin class is changed.




onSearchInit(elInput)


This optional callback function can be used to call an action as soon as the search is initialized.




onSearchResults(arPageNumbers, arImages)


This optional callback function can be used to call an action as soon as the search results are returned.




onSearchStart(strKeyWords,strInput)


This optional callback function can be used to call an action as soon as the search is started.




onClickDemoMode(url, targetFrame);


This optional callback function can be used to call an action as soon as the demo mode instance is clicked on. (You need to return "false" in order to prevent default action!)




onEnterDemoMode();


This optional callback function can be used to call an action as soon as the demo mode is entered.




onExitDemoMode();


This optional callback function can be used to call an action as soon as the demo mode is left.




onShowSaveDialog(bShow)


This optional callback function can be used to call an action as soon as the save dialog is showed.


onShowSearchDialog(bShow)


This optional callback function can be used to call an action as soon as the search dialog is showed.


onGetChaptersData(nodeChaptersData )


This optional callback function can be used to call an action as soon as the chapters data is loaded.


onGetIntroContent(nodeIntroData )


This optional callback function can be used to call an action as soon as the intro content is loaded.


onLinkHover(oLinkData, bHover)


This optional callback function can be used to call an action as soon as the cursor hovers over the link.