-
Notifications
You must be signed in to change notification settings - Fork 23
ViSH Editor API
Aldo edited this page Jun 15, 2015
·
3 revisions
Any external web application can communicate with ViSH Editor using the ViSH Editor Iframe API (download file here), an extremely lightweight JavaScript library. Using this API, a communication channel can be stablished between the external app and ViSH Editor through an iframe according to the HTML5 Web Messaging specification.
An application that uses the Iframe API can:
- Listen to any ViSH Editor event.
- Control the learning objects and the ViSH Editor tool.
The following table lists all the available methods:
Key | Description |
---|---|
registerCallback("eventName",function) | Register a listener/function for a specific event. Available events are listed in the VISH.IframeAPI.js file in the VISH.Constant.Event object. |
unregisterCallback("eventName") | Unregister a listener for an event. |
sendMessage(iframeMessage,iframeId) | Send a message using the API. |
goToSlide(slideNumber) | Go to a specific slide. |
openSubslide(slideId) | Open a subslide. |
closeSubslide(slideId) | Close a subslide. |
An example of how to use the API is provided here: https://github.com/ging/vish_editor/blob/master/examples/API/framed_api.html .
If you are insterested in more information about how works the ViSH Editor Messenger, you can see this guide.