-
Notifications
You must be signed in to change notification settings - Fork 3
UI API (ex.ui)
This is out of date, for the 7.x bot see here
Provides an interface for interacting with the page easily. These functions can be accessed through extension.ui.<function>.
Sends a notification to the user which is automatically dismissed after displayTime seconds. The text parameter will be HTML escaped.
Creates a notification which requires the user's account. The buttons parameter follows this format: [{text: 'Text', style:'success', action: function(){}, thisArg: undefined, dismiss: true}]. Only the text option is required. The style option may be any of the following: success, danger, warning, info. At least one button must correctly have dismiss set to true. The text parameter of the function will be set as HTML.
Clones the template found by the templateSelector and walks through each rule. The rules array must follow this format: [{selector: '.class', value: ''}]. Each rule must have a selector property. If a text or html property is provided, then the textContent or innerHTML will be set on the selector. Any other properties will be set with setAttribute.
Adds a message to the console.
Adds a tab to the navigation, if groupName is provided, the tab will be added to the specified group. By default, only the group messages and main exist. Returns a <div> which the tab content should be placed within.
Creates a new tab. The groupName can then be used in ui.addTab.
Removes a tab from the navigation and the page. tabContent should be the div returned by ui.addTab.
Removes a group and all child tabs from the page and navigation.