-
Notifications
You must be signed in to change notification settings - Fork 131
Event Editor Module
The Event Editor Module is responsible for providing editing capabilities for TrackEvents. This can be accomplished in one of two ways by the ButterApp developer. The first method uses a default UI provided by the developers of Butter. This is the most basic editor you can use, which is made up of text boxes and drop-down lists. The Second method allows a developer to specify custom editors for specific plug-in types. The custom editors can live on another website, so long as the implement the Cores' Client-Server functionality. Custom editors will allow developers and plug-in developers alike to create custom interfaces for defining Popcorn Track Event options.
constructor
butter.eventeditor( options )
The constructor for the Event Editor takes an object as a parameter. This object can specify a target element via { target: "someTarget" }
. If options.target is undefined the editor will use a window. You can also target a window that is already open using the targetWindow key and passing a reference to that window. Target will always take precedence over targetWindow. All you need to do is Specify a default editor source via { defaultEditor: "path/to/editor.html || www.url.com/editor/" }
. If options.defaultEditor is undefined, it defaults to the editor provided with butter (which needs to be place in a directory relative to the Butter Apps html page). You can specify a height and width using the editorHeight and editorWidth keys.
editTrackEvent( trackEvent:Object )
The editTrackEvent method is used to begin an edit on a trackEvent. Other Modules may use it to trigger edits ( Timeline currently does ) but the App Developer also may use this method to trigger edits however they desire.
addCustomEditor( editorSource:String, pluginType:String )
The addCustomEditor method associates an editor source ( a URL ) with a plug-in type ( i.e. "googlemaps" )
removeCustomEditor( editorSource:String, pluginType:String )
The removeCustomEditor method will remove a custom editor source associated with the plug-in type.
changeEditorTarget( newTarget:Object, type:String )
The changeEditorTarget method will set a new target for the Event Editor to use when opening a track event for editing.
setDefaultEditor( newEditor:String )
The setDefaultEditor method will set the Event Editors default editor source to the url passed specified as newEditor
setEditorDims( dims:Object )
The setEditorDims method will set new dimensions based on the height and width attributes of the dims parameter. If either height or width are not supplied the values that are absent are unchanged.
- "trackeditstarted" - triggered when editTrackEvent() is called.
- "trackeditclosed" - triggered when the Event Editor is closing.
- "trackeventupdated" - triggered when a TrackEvent has been changed.
These CSS classes are applied to the default editors' elements:
- butter-eventeditor
- butter-eventeditor-input-element
- butter-eventeditor-select-element
- butter-eventeditor-label