# Slideshow Events

In this part, events from slideshow.js file are documented.

# Ti.App.fireEvent('scrolledBJ')

Jump to the slide given as parameter if current slide is not the slide in parameters on scrollView.

Example:

Ti.App.fireEvent('scrolledBJ', {
  currentPage: 'myCurrentPage'
})
  • currentPage - current page that the slideshow should be at.

# Ti.App.fireEvent('sendAnimationNextBJ')

On modalWebView, advances to the next build by processing click or tap at display coordinates.

Example:

Ti.App.fireEvent('sendAnimationNextBJ', {})

# Ti.App.fireEvent('exitModalWebBJ')

Closes modalWebView.

Example:

Ti.App.fireEvent('exitModalWebBJ', {})

# Ti.App.fireEvent('sendAnimationNext')

Sends next animation to the remote. If there is no remote connection, this function will just quit.

Example:

Ti.App.fireEvent('sendAnimationNext', {})

# Ti.App.fireEvent('doubleTappedOld')

This event listener handles the old double tapping if used oldNav.

If animation parameter is true, then newly opened popover will open in modalWebView, else; it will open in scrollView.

If animation is false, this method also fires closeOpenModal event just before quitting.

Example:

Ti.App.fireEvent('doubleTappedOld', {
  animation: true,
  cX: 365,
  cY: 365
})
  • animation - is there any animation?
  • cX - X coordinate of the double tap point.(center of the newly created rectangle)
  • cY - Y coordinate of the double tap point.(center of the newly created rectangle)

# Ti.App.fireEvent('doubleTappedD')

Fires doubleTapped event with same parameters.

Example:

Ti.App.fireEvent('doubleTappedD', { e })

# Ti.App.fireEvent('tappedOnSlide')

Does nothing.

Example:

Ti.App.fireEvent('tappedOnSlide', {})

# Ti.App.fireEvent('doubleFingerTapped')

This event evaluates JS on the current webview to prevent double finger tap with parameters.

If the evaluation returns true, then it will simply return. Else, it will fire refreshSlidePage event.

Example:

Ti.App.fireEvent('doubleFingerTapped', {
  cX: 365,
  cY: 365
})
  • cX - X coordinate of the tap point.
  • cY - Y coordinate of the tap point.

# Ti.App.fireEvent('tripleFingerTapped')

Refreshes slide page.

Example:

Ti.App.fireEvent('tripleFingerTapped', {})

# Ti.App.fireEvent('swiped')

Handles swipe operation on the page and logs in terms as both time and point.

Example:

Ti.App.fireEvent('swiped', {
  direction: 1,
  cX: 365,
  cY: 365
})
  • direction - direction of the swipe. Can be: 1(vertical), 2(vertical), 4(horizontal), 8(horizontal)
  • cX - X coordinate of the swipe start point.
  • cY - Y coordinate of the swipe start point.

# Ti.App.fireEvent('doubleTapped')

Handles double tap operation on the page.(Needs detailed explanations.)

Example:

Ti.App.fireEvent('doubleTapped', {
  cX: 365,
  cY: 365,
  animation: true
})
  • cX - X coordinate of the swipe start point.
  • cY - Y coordinate of the swipe start point.
  • animation - if true, all of the animations are activated on page. Else, there are no animations.

# Ti.App.fireEvent('loadPresentationsFromDB')

Loads presentations from table tbl_slides_v2 using offlineCMSData, namely vUrl, ID and extra attributes of each file.

Evaluates these presentations at mainWebView.

Example:

Ti.App.fireEvent('loadPresentationsFromDB')

# Ti.App.fireEvent('loadArticlesFromDB')

Loads articles from table tbl_articles and evaluates them at mainWebView.

Example:

Ti.App.fireEvent('loadPresentationsFromDB')

# Ti.App.fireEvent('logFromWeb')

Logs message using Ti.API.info().

Example:

Ti.App.fireEvent('logFromWeb', {
  message: 'myMessage'
})
  • message - message to log.

# Ti.App.fireEvent('addArticlesToDB')

Adds all of the articles which are given as parameter to the DB.

Example:

Ti.App.fireEvent('addArticlesToDB', {
  articles: [article0, article1, ...]
})
  • articles - list of articles to be added.

# Ti.App.fireEvent('deleteArticlesFromDB')

Clears all of the articles from DB.

Example:

Ti.App.fireEvent('deleteArticlesFromDB', {})

# Ti.App.fireEvent('unloadMainPage')

Unloads mainPage.

This event fires hidePZeroOverlay at start and if there is no right condition for appStoreVersion, then it will close the document.

Example:

Ti.App.fireEvent('unloadMainPage', {})

# Ti.App.fireEvent('refreshMainPage')

Refreshes mainPage.

This event fires hidePZeroOverlay at start and if there is no right condition for appStoreVersion, then it will check for mainWebView URL.

Example:

Ti.App.fireEvent('refreshMainPage', {})

# Ti.App.fireEvent('loadSlidePage')

Loads a specific page of a presentation. with respective URL. If URL parameter is null, then it does nothing. Else, it will change the file:// part to "" in the url parameter.

Example:

Ti.App.fireEvent('loadSlidePage', {
  url: 'slideURL'
})
  • url: url of the requested slide.

# Ti.App.fireEvent('refreshSlidePage')

Refreshes the slide page on the current webview.

Example:

Ti.App.fireEvent('refreshSlidePage', {})

# Ti.App.fireEvent('loadPageFromSlides')

Loads the page in the slide.

Example:

Ti.App.fireEvent('loadPageFromSlide', {
  url: 'slideURL'
})
  • url: url of the requested slide.

# Ti.App.fireEvent('gotoVSlide')

Jumps to the respective slide in scrollView.

Example:

Ti.App.fireEvent('gotoVSlide', {
  p: 5
})
  • p: page number of the respective slide.

# Ti.App.fireEvent('gotoVSlideH')

Jumps to the respective slide in scrollView.

This event differs from previous event as it includes hidden pages and calculates new index by calculating how many hidden ones there was before this page.

Example:

Ti.App.fireEvent('gotoVSlideH', {
  p: 5
})
  • p: page number of the respective slide.

# Ti.App.fireEvent('gotoVSlideHD')

Jumps to the respective slide in scrollView.

This event differs from previous events as it checks for index and if it is below zero, it sets jump location as the last browsed page. Then it updates last browsed page as the current page.

Example:

Ti.App.fireEvent('gotoVSlideHD', {
  p: 5
})
  • p: page number of the respective slide.

# Ti.App.fireEvent('setLastPage')

Sets the last browsed page.

Example:

Ti.App.fireEvent('setLastPage', {
  p: 5
})
  • p: page number of the respective slide.

# Ti.App.fireEvent('getLastSlide')

Retrieves the last slide in the presentation.

This function takes hidden slides into consideration.

Example:

Ti.App.fireEvent('getLastSlide', {})

# Ti.App.fireEvent('goBackToLastSlide')

Goes back to the last browsed slide.

This function takes hidden slides into consideration before making a jump.

Example:

Ti.App.fireEvent('goBackToLastSlide', {})

# Ti.App.fireEvent('setLastPage')

Sets the last page.

Example:

Ti.App.fireEvent('setLastPage', {
  p: 5
})
  • p: page number of the respective slide.

# Ti.App.fireEvent('reloadPage')

Reloads the requested page within activeWebView using URL of activeWebView.

Example:

Ti.App.fireEvent('reloadPage', {
  p: 5
})
  • p: page number of the respective slide.

# Ti.App.fireEvent('closeOpenModal')

Closes and opens the modal.

Example:

Ti.App.fireEvent('closeOpenModal', {
  skipGuided: true,
  reset: false,
  direction: 'myDirection',
  version: 2
})
  • skipGuided: if the starting guide is not skipped, fire loadNextInGuided event.
  • reset: reset flag for the modal.
  • direction: which swipe direction does what. Can be: up(fire goNextSlide), down(fire goPrevSlide), left(fire goNextChapter), right(fire goPrevChapter)
  • version: if version is old, then set animationWebView oldURL to -1; else, set it and animationWebView itself to null.

# Ti.App.fireEvent('saveFromHTML')

Saves data to the local DB under an Id key.

Example:

Ti.App.fireEvent('saveFromHTML', {
  variables: data,
  closeWeb: false,
  id: 'myproject_' + account.Id,
  useSFDCDB: true
})
  • variables - javascript object to be saved, slashes added to it before saving.
  • closeWeb - close the application. Fires closeOpenModal event with parameter version equals to 3.
  • id - the key under which this is saved
  • useSFDCDB - use pitcher.sql instead of the project specific database (default: false)

# Ti.App.fireEvent('deleteFromHTML')

Deletes data that was previously saved with saveFromHTML.

Example:

Ti.App.fireEvent('deleteFromHTML', {
  id: 'myproject_' + accountID,
  useSFDCDB: true
})
  • id - the key under which this is previously saved
  • useSFDCDB - use pitcher.sql instead of the project specific database (default: false)

# Ti.App.fireEvent('getFromHTML')

Retrieves data from the local DB previously saved with saveFromHTML.

Example:

Ti.App.fireEvent('getFromHTML', {
  id: 'myproject_' + account.Id,
  callBack: 'resume',
  emptyFunction: 'resume',
  useSFDCDB: true,
  source: 'mySource'
})

function resume(dataStr) {
  if (!dataStr) {
    return
  }
  let resumeData = JSON.parse(dataStr)
  ...
}
  • id - the key under which this is saved. If null, then it is set to lastOpenFileID.
  • callBack - name of function to be called with the data
  • emptyFunction - name of function to be called if data is empty
  • useSFDCDB - use pitcher.sql instead of the project specific database (default: false)
  • source- targetWebView. Can be: 'modal'(modalWebView), 'homescreen'(mainWebView), 'sfdcWebView'(sfdcWebView), 'popover'(initPopover.webview), 'presentation'(currentPage's webview)

# Ti.App.fireEvent('sendStatsFromHTML')

Sends data to an event handler on a server.

The event handler needs to be defined by a pitcher administrator.

Example:

Ti.App.fireEvent('sendStatsFromHTML', {
  eventArray: [],
  closeWeb: false,
  event_name: 'myEventName',
  event_params: {},
  event_extra: 'crmData'
})
  • closeWeb - close the window after the event, default: false, fires closeOpenModal event with fileClose: true and version: 3
  • event_name - name of the event
  • event_extra - CRM login data - optional
  • event_params - data to be sent
  • event_params.pitcherTimestamp - timestamp of data - optional
  • event_params.ignoreFields - fields of event_params that are ignored - optional
  • event_params.apiVersion - salesforce API version to be used - optional
  • eventArray - array of object to be sent instead of event_params. Every object in the array will be sent individually to the server

# Ti.App.fireEvent('updateModalTitle')

fab fa-apple

Updates the title of the modal window.

iOS example:

Ti.App.fireEvent('updateModalTitle', {
  title: 'New interactive header title'
})

# Ti.App.fireEvent('loadWebPage')

Loads web page.

Checks first for internet connection, then calls loadPage function.

Example:

Ti.App.fireEvent('loadWebPage', { e })

loadPage(
  ('showBar': true),
  ('colorBack': 'color'),
  ('ID': 'myID'),
  ('fileID': 'myFileID'),
  ('folderName': 'myFolderName'),
  ('title': 'myTitle'),
  ('allowPortrait': true),
  ('hideToolBar': true),
  ('useWKView': true),
  ('useUIWeb': false),
  ('isModal': true),
  ('useInitialOnSafari': true),
  ('parameters': []),
  ('showToolBar': true)
)
  • showBar - show top bar.
  • colorBack - background color of the browser windows
  • ID - fileID backup
  • fileID - determine URLs from offlineCMSData using fileID
  • folderName - used to determine URL, acts as parent folder
  • title - title of the browser window, if null, set to empty string
  • allowPortrait - if not null, then navigation window's orientation modes will be same with modal's orientation modes.
  • hideToolBar - if true, hide tool bar of the browser
  • useWKView - if true, use custom WK view for browser
  • useUIWeb - if true, forces to use UIWebView
  • isModal - if false, do not open the content as modal
  • useInitialOnSafari - if true, open URL with Safari web browser
  • parameters - updated within the function to be updated and evaluated in webview.
  • showToolBar - if true, show tool bar

# Ti.App.fireEvent('loadAnimation')

Adds animationWebView to the currentPage's webview.

Example:

Ti.App.fireEvent('loadAnimation', {})

# Ti.App.fireEvent('loadWebPageFromSlidesBJ')

Loads web page from slides by firing loadWebPageFromSlides event with same parameters.

Example:

Ti.App.fireEvent('loadWebPageFromSlidesBJ', { e })

# Ti.App.fireEvent('loadWebPageFromSlides')

Loads web page from slide.

Example:

Ti.App.fireEvent('loadWebPageFromSlides', {
  folderName: 'myFolderName',
  urlValue: 'myURLVal',
  skipToolBar: true,
  parameters: [param0, param1, ...]
})
  • folderName - parent folder name of the slide.
  • urlValue - URL of the slide
  • skipToolBar - show/hide toolbar. In method, set to true.
  • parameters - parameters for the to-be-loaded page. AnimationLibVersion is set in the method.

# Ti.App.fireEvent('loadWebPageFromFolder')

fab fa-apple fab fa-android

Loads web page from given folder.

iOS example:

Ti.App.fireEvent('loadWebPageFromFolder', {
  ID: 'myID',
  fileID: 'myFileID',
  folderName: 'myFolderName',
  urlValue: 'myURL'
})
  • ID - general id parameter. If this is null, then fileID will assigned from fileID parameter.
  • fileID - id of the file. If ID is null, then fileID will be assigned from this parameter.
  • folderName - look up for web page at this folder
  • urlValue - look up for web page with this sub URL

Android example:

Ti.App.fireEvent('loadWebPageFromFolder', {
  ID: 'myID',
  fileID: 'myFileID',
  folderName: 'myFolderName',
  urlValue: 'myURL',
  subID: 123456,
  title: 'myTitle',
  showBar: true,
  parameters: '{param0, param1, ...}'
})
  • ID - general id parameter. If this is null, then fileID will assigned from fileID parameter.
  • fileID - id of the file. If ID is null, then fileID will be assigned from this parameter.
  • folderName - look up for web page at this folder
  • urlValue - look up for web page with this sub URL
  • subID - subID of the file
  • title - title of the file
  • showBar - show bar if true
  • parameters - extra parameters if needed for files

# Ti.App.fireEvent('setModalWebUrl')

Sets modalWebView's URL.

Example:

Ti.App.fireEvent('setModalWebUrl', {
  urlValue: 'myURL'
})
  • urlValue - respective URL

# Ti.App.fireEvent('getParameters')

fab fa-apple

Retrieves the parameters object Impact usually injects into modal with the global setParameters function. It contains information like the logged in SalesForce user, last open file, current contact, appName and appId.

Example:

Ti.App.fireEvent('getParameters', {
  callBackFunc: 'myCallBackFunc',
  source: 'mySource'
})
  • callBackFunc - callBack function which is evaluated with targeted WebView
  • source - define the targeted web view. Can be: 'modal', 'postcall', 'precall'(modalWebView), 'homescreen'(mainWebView), 'sfdcWebView'(sfdcWebView), 'popover'(initPopover.webview), default -> currentPage's webview

# Ti.App.fireEvent('updateModalWeb')

Updates modalWebView's URL using parameter URL within sub sub directory of slides.

Example:

Ti.App.fireEvent('updateModalWeb', {
  urlValue: 'myURL'
})
  • urlValue - respective URL

# Ti.App.fireEvent('closeModalWeb')

Closes modalWebView and continues with the guide if skipGuided parameter is not true.

Example:

Ti.App.fireEvent('closeModalWeb', {
  skipGuided: 'false'
})
  • skipGuided - did the user skip guide?

# Ti.App.fireEvent('refreshModalWeb')

Refreshes(reloads) modalWebView.

Example:

Ti.App.fireEvent('refreshModalWeb', {})

# Ti.App.fireEvent('closeScrollWeb')

Closes scrollWebView(presentations).

If pitcherCanClose returns false, it will set lastHomeButton as null and quits. Else, it will handle all quit scenarios and close scrollWebWiew.

Example:

Ti.App.fireEvent('closeScrollWeb', {})

# Ti.App.fireEvent('closeEmailForm')

Closes emailPopup if it is present on the UI.

Example:

Ti.App.fireEvent('closeEmailForm', {})

# Ti.App.fireEvent('loadThreeD')

Loads 3D file with fileID in a modal window with title.

If appStoreVersion requirement is not satisfied, then this method simply quits.

After loading, keeps the path with folder as last3DModel.

Example:

Ti.App.fireEvent('loadThreeD', {
  fileID: 'myFileID',
  title: 'myTitle',
  folder: 'myFolder',
  model: 'myModel'
})
  • fileID- fileID of the 3D model file.
  • title- title of the newly opened modal.
  • folder- parent folder of the 3D model file
  • model- fileName of the 3D model

# Ti.App.fireEvent('loadMolecule')

Loads molecule file with fileID in a modal window with title.

If appStoreVersion requirement is not satisfied, then this method simply quits.

After loading, keeps the path with folder as last3DModel.

Example:

Ti.App.fireEvent('loadMolecule', {
  fileID: 'myFileID',
  title: 'myTitle',
  folder: 'myFolder',
  model: 'myModel'
})
  • fileID- fileID of the molecule file.
  • title- title of the newly opened modal.
  • folder- parent folder of the molecule file
  • model- fileName of the molecule

# Ti.App.fireEvent('createEmailClient')

Creates a new email client with parameters over an email dialog.

If appStoreVersion requirement is not satisfied, this method will throw an alert with message: "No email accounts are set up on this device.Can't proceed."

Example:

Ti.App.fireEvent('createEmailClient', {
  subject: 'mySubject',
  messageBody: 'myMessageBody',
  to: 'myTo',
  cc: 'myCC'
})
  • subject- subject of mail.
  • messageBody- message body of the mail
  • to- recipient of the mail
  • cc- cc of the mail

# Ti.App.fireEvent('loadAppUrl')

Loads application with URL.

If URL cannot be opened, then this method will alert with message: "Please make sure you have the right app installed to perform this operation. \nSuggestion: "+e.url.split("😕/")[0]

Example:

Ti.App.fireEvent('loadAppUrl', {
  url: 'myURL'
})
  • url- URL of the application.

# Ti.App.fireEvent('loadCustomPDF')

Loads custom PDF.

Before this event, user should select custom slides and save them, which is creating the new PDF with parameter pages locally.

Fires loadPDF event just before it exits with the listed parameters:

  • fileName
  • presentationName
  • viewMode: 1
  • lockViewMode: null
  • references: null
  • articles: null
  • annotationEnabled : true
  • emailEnabled: emailEnabled (if file is a pdf and fileData has extra2[1] = "1" or file is a presentation and fileData.sendPDF = "1" true; else, false.)
  • subFolder: null
  • jumpToPage: 0
  • pdfID: slideOrder

Example:

Ti.App.fireEvent('loadCustomPDF', {
  dataOfPres: 'myDataOfPres'
})
  • dataOfPres- data regarding to custom pdf file. Contains: slideOrder, timeValue, presentationName

# Ti.App.fireEvent('loadPDF')

fab fa-apple fab fa-android

Loads PDF with given parameters.

iOS example:

Ti.App.fireEvent('loadPDF', {
  subFolder: 'subFolder',
  file: 'fileName',
  pdfID: 'slideOrder',
  uniqueParam: 'myUniqueParam',
  pageMode: 'pageMode',
  jumpToPage: 0,
  articles: null,
  references: null,
  lockViewMode: null,
  viewMode: 1,
  titleV: 'presentationName',
  fileData: 'myFileData',
  annotationEnabled: true,
  emailEnabled: emailEnabled
})
  • subFolder - name of the sub folder (if any) in which PDF file to-be-loaded exists.
  • file - file name of the PDF file.
  • pdfID - ID of the PDF
  • uniqueParam - if one wants to check move, enable this.
  • pageMode - preference of the PDF
  • jumpToPage - page to be opened
  • articles - articles list of the PDF
  • references - references of the PDF
  • lockViewMode - lock view mode while loading PDF ?
  • viewMode - currentPDFViewMode is set with this parameter(if any)
  • titleV - title of the view. Automatically set to body(name) of the presentation.
  • fileData - the data related to file. If not set, then it will be automatically set to:
{
  "uploaderType": null,
  "ID": "38652",
  "body": "Dummy PDF",
  "author": "",
  "keywords": "",
  "referencesV": null,
  "typeV": "1914|1911",
  "source": "",
  "vUrl": "pdfs/1388950465195.pdf",
  "year": "0",
  "edit_time": "2014-01-05 19:35:10",
  "category": "pdf",
  "extra": "1",
  "vVersion": 1388950510,
  "extra2": "1|1",
  "server": null,
  "uploaded_by": "1",
  "convertedSize": "198192",
  "vType": "pdfs",
  "bucket": "btocpitcher",
  "startDate": 1388950452,
  "endDate": 1420486455,
  "thumb": "thumbs/1388950465195.png",
  "fake": true
}
  • annotationEnabled - use annotations within PDF?
  • emailEnabled - can send this PDF?

Android example:

Ti.App.fireEvent('loadPDF', {
  file: filename,
  titleV: title,
  viewMode: 1,
  lockViewMode: lockMode,
  references: references,
  articles: articles,
  annotationEnabled: true,
  subFolder: subFolder,
  jumpToPage: page,
  pdfID: ID
})
  • file - file path of the PDF file.
  • titleV - name of the file.
  • viewMode - currentPDFViewMode is set with this parameter(if any)
  • lockViewMode - lock view mode while loading PDF ?
  • references - references of the PDF
  • articles - articles list of the PDF
  • annotationEnabled - use annotations within PDF?
  • subFolder - name of the sub folder (if any) in which PDF file to-be-loaded exists.
  • jumpToPage - page to be opened
  • pdfID - file key of the PDF

# Ti.App.fireEvent('loadYB')

Loads YB.

Not called unless articles of the file contains ybVideo keyword.

NOTE

Not used anymore.

Example:

Ti.App.fireEvent('loadYB', {
  file: 'myFile',
  fileID: 'myFileID',
  title: 'myTitle'
})
  • file - path to the requested file.
  • fileID - ID of the file.
  • title - title of the new modal screen

# Ti.App.fireEvent('loadMovie')

fab fa-apple fab fa-android

Loads movie(videos) from file.

iOS example:

Ti.App.fireEvent('loadMovie', {
  fileID: 'myFileID',
  file: 'myFileName',
  title: 'myTitle',
  isOnline: false
})
  • fileID - ID of the movie file.
  • file - URL path to the movie file.
  • title - title of the new modal screen, opened for playing video.
  • isOnline - is movie online or not.

Android example:

Ti.App.fireEvent('loadMovie', {
  fileID: 'myFileID',
  file: 'myFileName',
  jumpToSecs: 0.365
})
  • fileID - ID of the movie file.
  • file - URL path to the movie file.
  • jumToSecs - start video at X seconds. In the method this value is mutliplied by 1000.