Methods
addBoolean(title, value, callbackopt) → {module:QuickSettings}
Adds a checkbox to the panel.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
title |
String | The title of this control. | |
value |
Boolean | The initial value of this control. | |
callback |
function |
<optional> |
A callback function that will be called when the value of this control changes. |
- Source:
Returns:
- Type
- module:QuickSettings
addButton(title, callbackopt) → {module:QuickSettings}
Adds a button to the panel.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
title |
String | The title of the control. | |
callback |
function |
<optional> |
Callback function to be called when the button is clicked. |
- Source:
Returns:
- Type
- module:QuickSettings
addColor(title, color, callbackopt) → {module:QuickSettings}
Adds a color picker control. In some browsers this will just render as a text input field, but should still retain all other functionality.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
title |
String | The title of this control. | |
color |
String | The initial color value for this control. | |
callback |
function |
<optional> |
Callback that will be called when the value of this control changes. |
- Source:
Returns:
- Type
- module:QuickSettings
addDate(title, date, callbackopt) → {*}
Adds a date input control. In some browsers this will just render as a text input field, but should still retain all other functionality.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
title |
String | The title of the control. | |
date |
String | Date | A string in the format "YYYY-MM-DD" or a Date object. | |
callback |
function |
<optional> |
Callback function that will be called when the value of this control changes. |
- Source:
Returns:
- Type
- *
addDropDown(title, items, callbackopt) → {module:QuickSettings}
Adds a dropdown (select) control. Dropdown items can be strings ("one", "two", "three"), any other values that can be converted to strings (1, 2, 3), or an object that contains label and value properties ({label: "one", value: 77}).
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
title |
String | The title of the control. | |
items |
Array | An array of items. | |
callback |
function |
<optional> |
Callback function that will be called when a new option is chosen. Callback will be passed an object containing "index", "label", and "value" properties. If the selected item is a simple value, then label and value will be the same. |
- Source:
Returns:
- Type
- module:QuickSettings
addElement(title, element) → {module:QuickSettings}
Adds an existing HTML Element to the panel.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of the control. |
element |
HTMLElement | The element to add. |
- Source:
Returns:
- Type
- module:QuickSettings
addFileChooser(title, lableStr, filter, callbackopt) → {module:QuickSettings}
Adds a file input control to the panel.
Filter accepts standard media types such as "image/*", "video/*", "audio/*", a file extension, such as ".doc", ".jpg", or mime types.
Multiple filters can be added, comma separated. See standard HTML docs for file input "accept" attribute.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
title |
String | The title of the control. | |
lableStr |
String | The initial label on the file button. Defaults to "Choose a file...". | |
filter |
String | Species what file types the chooser will accept. See below. | |
callback |
function |
<optional> |
Callback function that will be called when a file is chosen. |
- Source:
Returns:
- Type
- module:QuickSettings
addHTML(title, html) → {module:QuickSettings}
Adds arbitrary HTML to the panel.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of the control. |
html |
String | The HTML to add. |
- Source:
Returns:
- Type
- module:QuickSettings
addImage(title, imageURL, callbackopt) → {module:QuickSettings}
Adds an image control.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
title |
String | The title of the control. | |
imageURL |
String | The URL to the image. | |
callback |
function |
<optional> |
Callback function to call when the image has fully loaded |
- Source:
Returns:
- Type
- module:QuickSettings
addNumber(title, min, max, value, step, callbackopt) → {module:QuickSettings}
Adds a number control.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
title |
String | Title of the control. | |
min |
Number | Minimum value of control. | |
max |
Number | Maximum value of control. | |
value |
Number | Initial value of control. | |
step |
Number | Size of value increments. | |
callback |
function |
<optional> |
Callback function to call when control value changes. |
- Source:
Returns:
- Type
- module:QuickSettings
addPassword(title, text, callbackopt) → {module:QuickSettings}
Adds a password input field.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
title |
String | The title of the control. | |
text |
String | The initial text value to put in the control. | |
callback |
function |
<optional> |
Callback that will be called when the value of this control changes. |
- Source:
Returns:
- Type
- module:QuickSettings
addProgressBar(title, max, value, valueDisplay) → {module:QuickSettings}
Adds a progress bar control.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of the control. |
max |
(Number} The maximum value of the control. | |
value |
(Number} The initial value of the control. | |
valueDisplay |
String | How to display the value. Valid values: "percent" displays percent of max, "numbers" displays value and max as fraction. Anything else, value is not shown. |
- Source:
Returns:
- Type
- module:QuickSettings
addRange(title, min, max, value, step, callbackopt) → {module:QuickSettings}
Adds a range slider control.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
title |
String | Title of the control. | |
min |
Number | Minimum value of control. | |
max |
Number | Maximum value of control. | |
value |
Number | Initial value of control. | |
step |
Number | Size of value increments. | |
callback |
function |
<optional> |
Callback function to call when control value changes. |
- Source:
Returns:
- Type
- module:QuickSettings
addText(title, text, callbackopt) → {module:QuickSettings}
Adds a text input field.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
title |
String | The title of the control. | |
text |
String | The initial text value to put in the control. | |
callback |
function |
<optional> |
Callback that will be called when the value of this control changes. |
- Source:
Returns:
- Type
- module:QuickSettings
addTextArea(title, text, callbackopt) → {module:QuickSettings}
Adds a text area control.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
title |
String | The title of the control. | |
text |
String | The initial text value to put in the control. | |
callback |
function |
<optional> |
Callback that will be called when the value of this control changes. |
- Source:
Returns:
- Type
- module:QuickSettings
addTime(title, time, callbackopt) → {*}
Adds a time input control. In some browsers this will just render as a text input field, but should still retain all other functionality.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
title |
String | The title of the control. | |
time |
String | Date | A string in the format "HH:MM", "HH:MM:SS" or a Date object. | |
callback |
function |
<optional> |
Callback function that will be called when the value of this control changes. |
- Source:
Returns:
- Type
- *
bindBoolean(title, value, object) → {module:QuickSettings}
Adds a checkbox to the panel, bound to an object
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of this control. |
value |
Boolean | The initial value of this control. |
object |
Object | Object the control is bound to. When the value of the control changes, a property on this object, with the name of the title of this control, will be set to the current value of this control. |
- Source:
Returns:
- Type
- module:QuickSettings
bindColor(title, color, object) → {module:QuickSettings}
Adds a color picker control bound to an object. In some browsers this will just render as a text input field, but should still retain all other functionality.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of this control. |
color |
String | The initial color value for this control. |
object |
Object | Object the control is bound to. When the value of the control changes, a property on this object, with the name of the title of this control, will be set to the current value of this control. |
- Source:
Returns:
- Type
- module:QuickSettings
bindDate(title, date, object) → {*}
Adds a date input control. In some browsers this will just render as a text input field, but should still retain all other functionality.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of the control. |
date |
String | Date | A string in the format "YYYY-MM-DD" or a Date object. |
object |
Object | Object the control is bound to. When the value of the control changes, a property on this object, with the name of the title of this control, will be set to the current value of this control. |
- Source:
Returns:
- Type
- *
bindDropDown(title, items, object) → {module:QuickSettings}
Adds a dropdown (select) control bound to an object.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of the control. |
items |
Array | An array of strings or values that will be converted to string and displayed as options. |
object |
Object | Object the control is bound to. When the value of the control changes, a property on this object, with the name of the title of this control, will be set to the current value of this control. |
- Source:
Returns:
- Type
- module:QuickSettings
bindNumber(title, min, max, value, step, object) → {module:QuickSettings}
Add a number control bound to an object.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | Title of the control. |
min |
Number | Minimum value of control. |
max |
Number | Maximum value of control. |
value |
Number | Initial value of control. |
step |
Number | Size of value increments. |
object |
Object | Object the control is bound to. When the value of the control changes, a property on this object, with the name of the title of this control, will be set to the current value of this control. |
- Source:
Returns:
- Type
- module:QuickSettings
bindPassword(title, text, object) → {module:QuickSettings}
Adds a password input field bound to an object.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of the control. |
text |
String | The initial text value to put in the control. |
object |
Object | Object the control is bound to. When the value of the control changes, a property on this object, with the name of the title of this control, will be set to the current value of this control. |
- Source:
Returns:
- Type
- module:QuickSettings
bindRange(title, min, max, value, step, object) → {module:QuickSettings}
Add a range slider control bound to an object.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | Title of the control. |
min |
Number | Minimum value of control. |
max |
Number | Maximum value of control. |
value |
Number | Initial value of control. |
step |
Number | Size of value increments. |
object |
Object | Object the control is bound to. When the value of the control changes, a property on this object, with the name of the title of this control, will be set to the current value of this control. |
- Source:
Returns:
- Type
- module:QuickSettings
bindText(title, text, object) → {module:QuickSettings}
Adds a text input field bound to an object.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of the control. |
text |
String | The initial text value to put in the control. |
object |
Object | Object the control is bound to. When the value of the control changes, a property on this object, with the name of the title of this control, will be set to the current value of this control. |
- Source:
Returns:
- Type
- module:QuickSettings
bindTextArea(title, text, object) → {module:QuickSettings}
Adds a text area control bound to an object.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of the control. |
text |
String | The initial text value to put in the control. |
object |
Object | Object the control is bound to. When the value of the control changes, a property on this object, with the name of the title of this control, will be set to the current value of this control. |
- Source:
Returns:
- Type
- module:QuickSettings
bindTime(title, date, object) → {*}
Adds a time input control. In some browsers this will just render as a text input field, but should still retain all other functionality.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of the control. |
date |
String | Date | A string in the format "HH:MM", "HH:MM:SS" or a Date object. |
object |
Object | Object the control is bound to. When the value of the control changes, a property on this object, with the name of the title of this control, will be set to the current value of this control. |
- Source:
Returns:
- Type
- *
clearLocalStorage(name) → {module:QuickSettings}
Clears any saved values in local storage.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | The unique name in localStorage to clear. |
- Source:
Returns:
- Type
- module:QuickSettings
collapse() → {module:QuickSettings}
Collapses the panel showing only the title bar.
- Source:
Returns:
- Type
- module:QuickSettings
create(x, y, title, parent) → {module:QuickSettings}
Static method. Creates a new QuickSettings Panel
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | x position of panel (default 0) |
y |
Number | y position of panel (default 0) |
title |
String | title of panel (default "QuickSettings") |
parent |
HTMLElement | parent element (default document.body) |
- Source:
Returns:
New QuickSettings Panel
- Type
- module:QuickSettings
destroy()
Destroys the panel, removing it from the document and nulling all properties.
- Source:
disableControl(title) → {module:QuickSettings}
Disables the given control.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of the control to disable. |
- Source:
Returns:
- Type
- module:QuickSettings
enableControl(title) → {module:QuickSettings}
Enables the given control.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of the control to enable. |
- Source:
Returns:
- Type
- module:QuickSettings
expand() → {module:QuickSettings}
If panel is collapsed, re-expands it.
- Source:
Returns:
- Type
- module:QuickSettings
getValuesAsJSON(asString) → {Object}
Returns an object containing the titles and values of all user-interactive controls in this panel.
Parameters:
Name | Type | Description |
---|---|---|
asString |
Boolean | If true, returns a JSON formatted string of these values. |
- Source:
Returns:
An object or string containing the titles and values fo all user-interactive controls in this panel.
- Type
- Object
hide() → {module:QuickSettings}
Hides the panel.
- Source:
Returns:
- Type
- module:QuickSettings
hideAllTitles() → {module:QuickSettings}
Hides the title labels of all controls.
- Source:
Returns:
- Type
- module:QuickSettings
hideControl(title) → {module:QuickSettings}
Hides the given control.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of the control to hide. |
- Source:
Returns:
- Type
- module:QuickSettings
hideTitle(title) → {module:QuickSettings}
Hides the title label of a given control.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of the control. |
- Source:
Returns:
- Type
- module:QuickSettings
overrideStyle(title, style, value) → {module:QuickSettings}
Changes a specific style on the given component.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of the control. |
style |
String | The name of the style. |
value |
Various | The new value of the style. |
- Source:
Returns:
- Type
- module:QuickSettings
removeControl(title) → {module:QuickSettings}
Removes a given control from the panel.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of the control to remove. |
- Source:
Returns:
- Type
- module:QuickSettings
saveInLocalStorage(name) → {model:QuickSettings}
Sets up the panel to save all of its values to local storage. This will also immediately try to read in any saved values from local storage, if they exist.
So the method should be called after all controls are created on the panel.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | A unique name to store the values under in localStorage. |
- Source:
Returns:
- Type
- model:QuickSettings
setCollapsible(collapsible) → {module:QuickSettings}
Sets whether or not the panel will collapse and expand when the title is double clicked.
Parameters:
Name | Type | Description |
---|---|---|
collapsible |
Boolean | Wheter or not the panel can collapse and expand. |
- Source:
Returns:
- Type
- module:QuickSettings
setDraggable(draggable) → {module:QuickSettings}
Sets whether or not the panel can be dragged.
Parameters:
Name | Type | Description |
---|---|---|
draggable |
Boolean | Whether or not the panel can be dragged. |
- Source:
Returns:
- Type
- module:QuickSettings
setGlobalChangeHandler(handler) → {module:QuickSettings}
Sets a function that will be called whenever any value in the panel is changed.
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
- Source:
Returns:
- Type
- module:QuickSettings
setHeight(h) → {module:QuickSettings}
Sets the height of the panel.
Parameters:
Name | Type | Description |
---|---|---|
h |
Number | The height of the panel. |
- Source:
Returns:
- Type
- module:QuickSettings
setKey(char) → {module:QuickSettings}
Sets a key that, when pressed, will show and hide the panel.
Parameters:
Name | Type | Description |
---|---|---|
char |
- Source:
Returns:
- Type
- module:QuickSettings
setNumberParameters(title, min, max, step) → {module:QuickSettings}
Sets the parameters of a number control.
Parameters:
Name | Type | Description |
---|---|---|
title |
Number | The title of the control to set the parameters on. |
min |
Number | The minimum value of the control. |
max |
Number | The maximum value of the control. |
step |
Number | Size of value increments. |
- Source:
Returns:
- Type
- module:QuickSettings
setPosition(x, y) → {module:QuickSettings}
Positions the panel at the given location.
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | The x position. |
y |
Number | The y position. |
- Source:
Returns:
- Type
- module:QuickSettings
setProgressMax(title, max) → {module:QuickSettings}
Sets the maximum value for a progress bar control.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of the control to change. |
max |
Number | The new maximum value for the control. |
- Source:
Returns:
- Type
- module:QuickSettings
setRangeParameters(title, min, max, step) → {module:QuickSettings}
Sets the parameters of a range control.
Parameters:
Name | Type | Description |
---|---|---|
title |
Number | The title of the control to set the parameters on. |
min |
Number | The minimum value of the control. |
max |
Number | The maximum value of the control. |
step |
Number | Size of value increments. |
- Source:
Returns:
- Type
- module:QuickSettings
setSize(w, h) → {module:QuickSettings}
Sets the size of the panel.
Parameters:
Name | Type | Description |
---|---|---|
w |
Number | The width of the panel. |
h |
Number | The height of the panel. |
- Source:
Returns:
- Type
- module:QuickSettings
setTextAreaRows(title, rows) → {module:QuickSettings}
Sets the number of rows in a text area control.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The control to set the number of rows on. |
rows |
Integer | The number of rows in the text area. |
- Source:
Returns:
- Type
- module:QuickSettings
setValuesFromJSON(json) → {module:QuickSettings}
Sets values of any controls from a JSON object or string. The JSON is one large object with title: value elements for each control you want to set.
Parameters:
Name | Type | Description |
---|---|---|
json |
Object | A string or JS object containing the titles and values to set. |
- Source:
Returns:
- Type
- module:QuickSettings
setWidth(w) → {module:QuickSettings}
Sets the width of the panel.
Parameters:
Name | Type | Description |
---|---|---|
w |
Number | The width of the panel. |
- Source:
Returns:
- Type
- module:QuickSettings
show() → {module:QuickSettings}
Shows the panel.
- Source:
Returns:
- Type
- module:QuickSettings
showAllTitles() → {module:QuickSettings}
Shows the title labels of all controls. Button and booleans have no title labels.
- Source:
Returns:
- Type
- module:QuickSettings
showControl(title) → {module:QuickSettings}
Shows the given control.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of the control to show. |
- Source:
Returns:
- Type
- module:QuickSettings
showTitle(title) → {module:QuickSettings}
Shows the title label of a given control.
Parameters:
Name | Type | Description |
---|---|---|
title |
String | The title of the control. |
- Source:
Returns:
- Type
- module:QuickSettings
toggleCollapsed() → {module:QuickSettings}
Toggles the panel back and forth between collapsed and expanded states.
- Source:
Returns:
- Type
- module:QuickSettings
toggleVisibility() → {module:QuickSettings}
Toggles the panel from hidden to visible and back.
- Source:
Returns:
- Type
- module:QuickSettings
useExtStyleSheet()
Static method. Causes QuickSettings to ignore its default styles and instead use whatever QuickSettings stylesheet is on the page. This must be called before creating any panel in order to have any effect.
- Source: