List of core events.
AppStudio widgets use a minimalist publisher/subscriber pattern for communication. Primarily this communication is between a widget and the core although there are a few instances where widgets communicate with each other (e.g. slides within a slideshow may respond to an ELEMENT_VISIBLE event when they slide on screen, widgets listening for this event—as in, widgets within that slide—will hear the event and fire their response).
For the most part widgets respond to events rather than broadcast events themselves and this largely means that controlling widgets can, in part, be handled by creating buttons with actions attributed to them. For example, a slideshow that performs multiple actions on the page could trigger a button that responds to the ELEMENT_VISIBLE event and then fires a number of different events that control on-screen widgets.
Widgets can listen for events using the subscribe
method and they can broadcast events using the broadcast
event. unsubscribe
can be used to stop listening for a previously assigned event.
Data can be passed along with a broadcasted event, for example, many widget actions pass data via the APP_NOTIFY_EVENT event to communicate with the framework (i.e. ios, android, web app) e.g. radio(PR.Event.APP_NOTIFY_EVENT).broadcast('video://' + video_source)
passes the location of a video, this is then handled by the framework. Note that you can also pass objects e.g. radio(PR.Event.NAVIGATE_TO_URL).broadcast( {target: href} )
.
- Source:
- core/PressrunCore.js, line 52
Events
-
APP_NOTIFY_EVENT
-
Event to notify a message to the native application.
Type: String
- Source:
- core/PressrunCore.js, line 98
-
APP_SCROLL_EVENT
-
Event to specify if the application can scroll or not.
Type: String
- Source:
- core/PressrunCore.js, line 74
-
COLORING_EVENT
-
This event is triggered by the colouring widget
Type: String
- Source:
- core/PressrunCore.js, line 59
-
DISABLE_GPU
-
Event is fired when a page flip finishes flipping
Type: String
- Source:
- core/PressrunCore.js, line 330
-
ELEMENT_NOT_VISIBLE
-
Event when an item is no longer visible e.g. slide or popup
Type: String
- Source:
- core/PressrunCore.js, line 138
-
ELEMENT_VISIBLE
-
Event when an item is visible e.g. slide or popup
Type: String
- Source:
- core/PressrunCore.js, line 130
-
ENABLE_GPU
-
Event is fired when a page flip starts to flip
Type: String
- Source:
- core/PressrunCore.js, line 322
-
GEOLOCATION
-
Event to notify a message to the native application for Geolocation.
Type: String
- Source:
- core/PressrunCore.js, line 106
-
GO_TO_SLIDE
-
Event to indicate the slide show to move to a specified slide.
Type: String
- Source:
- core/PressrunCore.js, line 274
-
HIDE_POPUP
-
Event to notify a popup to become invisibile
Type: String
- Source:
- core/PressrunCore.js, line 162
-
HIGHLIGHT_ALL
-
Highlight All event when the app wants something highlighting
Type: String
- Source:
- core/PressrunCore.js, line 338
-
ISSUE_SCREEN
-
Event to indicate going back to the issue screen
Type: String
- Source:
- core/PressrunCore.js, line 290
-
LOAD_STATE
-
Saves the current state of the widgets
Type: String
- Source:
- core/PressrunCore.js, line 362
-
NAVIGATE_NEXT_PAGE
-
Event to notify the app to navigate to the next page
Type: String
- Source:
- core/PressrunCore.js, line 210
-
NAVIGATE_PREVIOUS_PAGE
-
Event to notify the app to navigate to the previous page
Type: String
- Source:
- core/PressrunCore.js, line 218
-
NAVIGATE_TO_ARTICLE
-
Event to notify the app to navigate to an article
Type: String
- Source:
- core/PressrunCore.js, line 234
-
NAVIGATE_TO_PAGE
-
Event to notify the app to navigate a specfic page
Type: String
- Source:
- core/PressrunCore.js, line 226
-
NAVIGATE_TO_URL
-
Event to notify the app to navigate to a URL
Type: String
- Source:
- core/PressrunCore.js, line 242
-
NEXT_SLIDE
-
Event to indicate the slide show to move to the next slide
Type: String
- Source:
- core/PressrunCore.js, line 258
-
ONLINE_EVENT
-
Event triggered when the device goes online/offline.
Type: String
- Source:
- core/PressrunCore.js, line 90
-
OPEN_FILE
-
Event to indicate the opening of a File
Type: String
- Source:
- core/PressrunCore.js, line 282
-
PAGE_FLIP
-
Event is fired when a page flip button is pressed to flip the page
Type: String
- Source:
- core/PressrunCore.js, line 314
-
PAGE_OFF_SCREEN
-
Event to notify when page is off screen
Type: String
- Source:
- core/PressrunCore.js, line 122
-
PAGE_ON_SCREEN
-
Event to notify when page is on screen
Type: String
- Source:
- core/PressrunCore.js, line 114
-
PAUSE_MEDIA
-
Event is fired when a media item should be paused
Type: String
- Source:
- core/PressrunCore.js, line 186
-
PLAY_ANIMATION
-
Event is fired when an animation should start playing
Type: String
- Source:
- core/PressrunCore.js, line 202
-
PLAY_MEDIA
-
Event is fired when a media item should be played
Type: String
- Source:
- core/PressrunCore.js, line 178
-
PR_INITIALIZED
-
This event is triggered by PR.Core after this is initialized.
Type: String
- Source:
- core/PressrunCore.js, line 66
-
PREVIOUS_SLIDE
-
Event to indicate the slide show to move to the previous slide
Type: String
- Source:
- core/PressrunCore.js, line 266
-
REASSIGN_EVENT
-
Event to assign the click handlers back to the html elements.
Type: String
- Source:
- core/PressrunCore.js, line 82
-
RESET_PAGE
-
Event to tell the app to reset the page
Type: String
- Source:
- core/PressrunCore.js, line 306
-
SAVE_STATE
-
Saves the current state of the widgets
Type: String
- Source:
- core/PressrunCore.js, line 354
-
SHOW_POPUP
-
Event to notify a popup to become visibile
Type: String
- Source:
- core/PressrunCore.js, line 154
-
STOP_MEDIA
-
Event is fired when an inline player starts to stop other players
Type: String
- Source:
- core/PressrunCore.js, line 170
-
TAKE_SCREENSHOT
-
Event to take a screenshot of the current screen
Type: String
- Source:
- core/PressrunCore.js, line 298
-
TOGGLE_MEDIA
-
Event is fired when a media item should be toggled play/pause
Type: String
- Source:
- core/PressrunCore.js, line 194
-
TOGGLE_POPUP
-
Event to notify of layer visibility toggle
Type: String
- Source:
- core/PressrunCore.js, line 146
-
UNHIGHLIGHT_ALL
-
Unhighlight All event when the app wants something unhighlighting
Type: String
- Source:
- core/PressrunCore.js, line 346
-
ZOOMABLE_IMAGE
-
Event to notify the app to open an image for zooming
Type: String
- Source:
- core/PressrunCore.js, line 250