Namespace SSB.prefs.pane
The Preference Pane allows you to easily allow users to configure your scripts with parameters of your choice. By specifying the structure of your preferences and pointing them at keys you have used with SSB.prefs.getValue and SSB.prefs.setValue, the pane object will automagically generate UI with which the user can configure the preference-enabled variables of your script. For example, lets say your script checks a site for updates, and it does it every such and such interval. If you store this interval as a value with SSB.prefs.setValue, and define it as a variable of type integer using SSB.prefs.pane.addPrefs the user will be able to get a configuration dialog for your script where he can choose the interval, and that will update the values you pull with SSB.prefs.getValue. Its like SSB.prefs is your registry and SSB.prefs.pane is your registry-editor, but since you don't want to expose your entire registry to users, you tell the registry-editor what things to expose. different site options and enhance SSB experience.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Field Attributes | Field Name and Description |
|---|---|
| <static> {JavaCode String} |
SSB.prefs.pane.documentHandler
Use this field to set handler function or script code string for computing document
object in which preference pane should be showed by calling
SSB.prefs.pane.show or by clicking "Bubble Preferences" in the context menu.
|
| <static> {Hanler Function} |
SSB.prefs.pane.onSubmit
Set handler function to be executed after user clicks "Save Settings" in the
prefsPane.
|
| Method Attributes | Method Name and Description |
|---|---|
| <static> {void} |
SSB.prefs.pane.addPrefs(prefsPaneObjectsArray)
Adds configurable preferences variables to the prefsPane.
|
| <static> {boolean} |
SSB.prefs.pane.hasPrefs()
Function that returns boolean value indicating whether the SSB.prefs.pane
has decleared preference variables.
|
| <static> |
SSB.prefs.pane.init(prefsPaneObjectsArray)
Deprecated, use SSB.prefs.pane.addPrefs instead.
|
| <static> {boolean} |
SSB.prefs.pane.isOpen()
Function that returns boolean value indicating whether the SSB.prefs.pane
is open.
|
| <static> {void} |
SSB.prefs.pane.show()
Shows preferences box to the user in the bubbles window with configurable variables
that was previously defined with SSB.prefs.pane.addPrefs.
|
SSB.prefs.pane.onSubmit = function() {
alert("You have just saved preferences!");
}
SSB.prefs.pane.addPrefs([
{ type:'boolean',
defVal:true,
name:'isNotifiactionEnabled',
title:'Enable notification of new emails'
},
{ type:'string',
name:'name',
title:'whats your name'
},
{ type:'options',
name:'myOprions',
title:'choose your car',
defVal:'BMW',
options:{
MB:'Mercedes-Benz',
BMW:'Bavarian Motor Works',
nocar:'I don't have a car!'
}
}
]);
- Parameters:
- {Array} prefsPaneObjectsArray
- Array of PrefsPaneObjects.
- Returns:
- {void}
- See:
- PrefsPaneObject
- Returns:
- {boolean}
- Parameters:
- prefsPaneObjectsArray
- Deprecated:
- Use SSB.prefs.pane.addPrefs instead.
- Returns:
- {boolean}
- Returns:
- {void}