Interactive JavaScript API
translateUI()
Supported Platforms:
Pitcher Impact iOS
Pitcher Impact Android (Should be called manually)
Pitcher Impact Windows (Should be called manually)
Not Supported Platforms:
Pitcher Connect
Being called automatically on document launch, feeds a JSON string of system-level translations for the current language.
Source:
index.js
pitcherInit()
Supported Platforms:
Pitcher Impact iOS
Pitcher Connect
Not Supported Platforms:
Pitcher Impact Android
Pitcher Impact Windows
Pitcher calls this function on page scroll. Important: Do not add listeners on Page Init or Page Load, as those can be called when the page is cached! Instead please override the PitcherInit function.
Source:
index.js
getParameters(params)
Supported Platforms:
Pitcher Impact iOS
Pitcher Impact Windows
Pitcher Impact Android
Not Supported Platforms:
Pitcher Connect
Runs as a callback on per slide automatically, pushes the session and device information as a json string to be used in the presentation type interactive documents.
Source:
index.js
Sample:
function getParameters(params){
var parsedParams = JSON.parse(params);
}
saveFromHTML(key,params)
Supported Platforms:
Pitcher Impact iOS
Pitcher Impact Windows
Pitcher Impact Android
Pitcher Connect
As webview doesn't support persistent cookies, this function can be used to make persistent values stored in Pitcher encrypted database.
Parameters:
Name | Type | Description |
---|---|---|
| string | unique identifier |
| string | ie. a stringfied json object |
Source:
index.js
getFromHTML(key,fullcallback,emptycallback)
Note: 'source' parameter is required for only iOS
Supported Platforms:
Pitcher Impact iOS
Pitcher Impact Windows
Pitcher Impact Android
Pitcher Connect
This function can be used to retrieve a persistent value stored in Pitcher encrypted database.
Parameters:
Name | Type | Description |
---|---|---|
| string | unique identifier |
| string | callback function name which will receive if there is a saved value with this unique key |
| string | callback function name which will fire up if there is not a saved value with this unique key |
Source:
index.js
send_email(subject,message,recipients,attachments)
Supported Platforms:
Pitcher Impact iOS
Pitcher Impact Windows
Pitcher Impact Android
Not Supported Platforms:
Pitcher Connect
Opens a new email window from the iOS mail app, pre-filled with recipients, message content and attachments (ie. pdf files).
Parameters:
Name | Type | Description |
---|---|---|
| string | email subject field |
| string | email content text |
| array | |
| array | ie. [filepath1,filepath2] |
Source:
index.js
generatePDF(htmlString)
Note: 'source' parameter is required for only iOS
Supported Platforms:
Pitcher Impact iOS
Pitcher Impact Windows (Requires Custom Build)
Pitcher Impact Android
Not Supported Platforms:
Pitcher Connect
Pitcher Impact Windows (Store Build)
Generates a pdf file with the html string provided as a parameter. Callback goes to gotPDF function which returns the created PDF file.
Parameters:
Name | Type | Description |
---|---|---|
| string | html structure of the pdf page in a string format |
Source:
index.js
gotPDF(filePath)
Supported Platforms:
Pitcher Impact iOS
Pitcher Impact Windows (Requires Custom Build)
Pitcher Impact Android
Not Supported Platforms:
Pitcher Connect
Pitcher Impact Windows (Store Build)
gotPDF function receives the filePath of the generated PDF file as a callback. Send Email function can be called here to send the generated PDF file as an attachment.
Parameters:
Name | Type | Description |
---|---|---|
| string | file path of the generated pdf file |
Source:
index.js
basename(path, suffix)
→ {string}
Supported Platforms:
Pitcher Impact iOS
Pitcher Impact Windows
Pitcher Connect
Pitcher Impact Android
Gets the basename of a file path.
Parameters:
Name | Type | Description |
---|---|---|
| string | Full disk path |
| string | A text to remove, such as an extension |
Source:
index.js
Returns:
Basename of the file path
Typestring
gup(name)
→ {string}
Supported Platforms:
Pitcher Impact iOS
Pitcher Impact Windows
Pitcher Connect
Pitcher Impact Android
Gets the URL parameters of the existing page
Parameters:
Name | Type | Description |
---|---|---|
| string | A certain parameter name, similar to PHPs $_GET function |
Source:
index.js
Returns:
value - returns the current value of the parameter provided
Type - string
customEvent()
Supported Platforms:
Pitcher Impact iOS
Pitcher Impact Windows
Pitcher Connect
Pitcher Impact Android
Tells Pitcher to send a custom event to Pitcher Insight engine. You can use this function to keep track of custom clicks
Source:
index.js
getCurrentFileID()
Supported Platforms:
Pitcher Impact iOS
Pitcher Impact Windows
Pitcher Connect
Pitcher Impact Android
Returns current file ID
Source:
index.js
closeModal()
Supported Platforms:
Pitcher Impact iOS
Pitcher Impact Windows
Pitcher Impact Android
Not Supported Platforms:
Pitcher Connect
Tells Pitcher to close the active presentation
Source:
index.js
showPDF(filename, title, 1, null, null, null, jumpPage, fileID)
Supported Platforms:
Pitcher Impact iOS
Pitcher Impact Windows
Pitcher Connect
Pitcher Impact Android
Tells Pitcher to launch the PDF. You can also use pitcherFile://#/# annotation. For more info please see the Developer manual
Parameters:
Name | Type | Description |
---|---|---|
| string | Full link to the PDF file on disk |
| string | Title to be rendered |
| integer | Page to launch PDF on. 1 based |
| integer | Pitcher file ID, important for links to function properly |
Source:
index.js
playVideo(filename)
Supported Platforms:
Pitcher Impact iOS
Pitcher Impact Windows
Pitcher Impact Android
Not Supported Platforms:
Pitcher Connect
Tells Pitcher to launch the Video. You can also use pitcherFile://#/# annotation. For more info please see the Developer manual
Parameters:
Name | Type | Description |
---|---|---|
| string | Full link to the video file on disk param {boolean} isOnline - Whether online connection is necessary to play the video param {integer} fileID - Pitcher file ID, important for links to function properly |
Source:
index.js
showSurvey(url)
Supported Platforms:
Pitcher Impact iOS
Pitcher Impact Windows
Pitcher Connect
Pitcher Impact Android
Tells Pitcher to launch a survey. You can also use pitcherFile://#/# annotation. For more info please see the Developer manual
Parameters:
Name | Type | Description |
---|---|---|
| string | Full link to the survey folder on disk param {string} title - Title to be rendered param {integer} fileID - Pitcher file ID, important for links to function properly |
Source:
index.js
showZip(url)
Supported Platforms:
Pitcher Impact iOS
Pitcher Impact Windows
Pitcher Connect
Pitcher Impact Android
Tells Pitcher to launch an HTML5 file uploaded by the CMS. You can also use pitcherFile://#/# annotation. For more info please see the Developer manual
Parameters:
Name | Type | Description |
---|---|---|
| string | Full link to the survey folder on disk param {string} title - Title to be rendered param {integer} fileID - Pitcher file ID, important for links to function properly |
Source:
index.js
generateTouch()
Supported Platforms:
Pitcher Impact iOS
Not Supported Platforms:
Pitcher Impact Windows
Pitcher Connect
Pitcher Impact Android
Pitcher Remote application interaction functions, these two "generateTouch" and "touchSynth" functions mimic touch events from the remote app, applies the same touch events on the presentation slideX.html file.
Source:
index.js
touchSynth(x, y, mode)
Supported Platforms:
Pitcher Impact iOS
Not Supported Platforms:
Pitcher Impact Windows
Pitcher Connect
Pitcher Impact Android
Pitcher Remote application interaction functions, these two "generateTouch" and "touchSynth" functions mimic touch events from the remote app, applies the same touch events on the presentation slideX.html file.
Source:
index.js