Members
'static'
allowMultivaluedNonChoices
array
Array
- Source:
array
Array
- Source:
bool
cachedManifests
Object serving as an associative array {
string absoluteFolderPath: respective result of manifestsDownToFolder(absoluteFolderPath)
}
cacheRatio
callStack :Stack
Command execution stack
Type:
- Stack
Dotclear :object
A namespace-like object in the global scope.
Type:
- object
Drupal :object
A namespace-like object in the global scope.
Type:
- object
- Source:
expandStoredVars :function
Type:
- function
FUDforum :object
A namespace-like object in the global scope.
Type:
- object
global
This is to access SeLiteMisc object, if available. I don't declare 'var SeLiteMisc' here - otherwise NetBeans would navigate here instead of SeLiteMisc.js when I Ctrl+click at 'SeLiteMisc' elsewhere.
int
int
Location :ValueSource|undefined
of the module definition or 'values' manifest where the value comes from. Only in per-folder mode.
Type:
- ValueSource | undefined
modules
Sorted anonymous object serving as an associative array {
string module name => Module object
}
moduleSetFields
Anonymous object serving as a multidimensional associative array {
string module name: {
string set name (possibly empty): result of Module.getFieldsOfSet();
}
It's only populated, updated and used in set mode; not in per-folder mode.
Purpose: setCellText() uses it to determine whether in a single-valued string field
'undefined' or 'null' are the actual values, or indicators of the field being undefined/null in that set.
I also use it at some places that call nullOrUndefineLabel().
}
name :string
Be careful - this excludes prefix (if any). So this is a 'logical' name. It's mostly used when setting up SeLiteData.RecordSetFormula instances, table aliases in joins etc. If you need to generate custom SQL query, use method nameWithPrefix() to get the full name of the table.
Type:
Namespace-like :object
holder.
Type:
- object
- Source:
newValueRow
0-based index of row beig currently edited, within the set of *visible* rows only (it skips the collapsed rows),
only if the row is for a new value of a multi-valued field and that value was not saved/submitted yet. Otherwise it's undefined.
- Source:
- See:
-
- window's onblur handler, set to 'onTreeBlur()' in this file
NTH_RECORD
Acceptable values of parameter action for nthRecordOrLengthOrIndexesOf()
Null :string|null
if we're showing configuration set(s) irrelevant of a folder. Otherwise it's
a string, absolute path to the folder we're applying the overall configuration.
This will be set depending on how this file is invoked.
Type:
- string | null
Object
Only :object
used when info.field.multivalued and !(info.field instanceof SeLiteSettings.Field.FixedMap). If same as info.treeRow, then the new value stays where it was typed. If undefined, then append the new row at the end.
Type:
- object
phpMyFAQ :object
A namespace-like object in the global scope.
Type:
- object
proxyVerifyFieldsObjectHandler
For verifying on both read and write
roles
A map: role symbolic name => user name. Add the keys in your custom framework. Use SeLiteSettings.loadFromJavascript( 'extensions.selite-settings.common' ).getField( 'roles' ).addKeys( [...] );
Use SeLiteSettings.roleToUser() in your scripts to get the user for a given role.
Serendipity :object
A namespace-like object in the global scope.
Type:
- object
Serving :object
as an associative array {globIdx => object of {any attributes, idx, cmdName}}. SelBlocksGlobal changed this from an array to an object.
Type:
- object
Static :BlockDefs
command definitions stored by command index. Global, used for all test cases.
Type:
- BlockDefs
string
treeColumnElements
It contains elements for tags, as returned by window.document.createElementNS( XUL_NS, 'tree_col').
These are not nsITreeColumn instances, but their .element fields!
In order to get nsITreeColumn instance, use treeColumn(). See also comments near a call to getCellAt().
treeRowsOrChildren
Sorted object (anonymous in any other respect) serving as multi-level associative array {
string module name => anonymous object {
string set name (it may be an empty string) => sorted object {
one or none: SET_SELECTION_ROW => element/object for the row that has a set selection cell
- only if we show set sellection column and the module allows set selection
zero or more: string field name (field is non-choice and single value) => element/object for the row that has that field
zero or more: string field name (the field is multivalue or a choice) => anonymous or sorted object {
value fields (ones with keys that are not reserved) are sorted by key, but entries with reserved keys may be at any position
- one: FIELD_MAIN_ROW => element/object for the collapsible row that contains all options for that field
- one: FIELD_TREECHILDREN => element/object for this field, that contains levels for each option
- zero or more: string key => element/object for the row that contains a value/option
- zero or one: NEW_VALUE_ROW => element/object for the row that contains a value that the user will only have to fill in
(that is, a row dynamically created but with no value specified yet).
}
}
...
}
...
}
I use this when saving a set/module/all displayed modules.
*
unnamedTestSuiteFolderChangeHandlers :Array.<function()>
Array of functions, that are called whenever the test suite folder changes.
Type:
- Array.<function()>
Whether :boolean
the radio button for a Choice field is checked. Not valid for Bool fields.
Type:
- boolean
Methods
applicableColumns() → {Array}
Returns:
Array of Column instances applicable to the current screen/mode, in the same order as displayed.
- Type
- Array
checkField(definitions) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
definitions |
object | Definitions of fields. I.e. proxy[SeLiteMisc.PROXY_FIELD_DEFINITIONS]. |
Returns:
Whether the given definitions allows a field with given name and value.
- Type
- boolean
chooseFileOrFolder(field, tree,, row, column, bool, string, boolean)
Select a file/folder for a field or a folder for which to load the configuration (via manifests).
Parameters:
Name | Type | Description |
---|---|---|
field |
Instance of a subclass of Field.FileOrFolder (Field.File, Field.Folder or Field.SQLite), or null if no field | |
tree, |
used only when changing a field. | |
row |
int 0-based row index, within the set of *visible* rows only (it skips the collapsed rows) | |
column |
Probably an instance of TreeColumn | |
bool |
isFolder whether it's for a folder, rather than a file | |
string |
currentTargetFolder Used as the default folder, when field==null. Optional. | |
boolean |
saveFile Whether we're saving/creating a file, otherwise we're opening/reading. Optional, false by default. Only needed when isFolder is false, because the file/folder picker dialog always lets you create new folder (if you have access). |
Returns:
false if nothing selected, string file/folder path if selected
chooseJavascriptFile()
Returns:
nsIFile instance for a javascript file, if picked; null if none.
createTreeChildren()
Create an object for a new . Add it to the parent.
Returns:
XULElement for the new
directChildList()
Like nsIPrefBranch.getChildList(), but it
- returns direct children only (i.e. not ones that contain dot(s) in the name right of the given namePrefix)
- returns direct virtual child, i.e. a name at direct child level, which is a parent of any grand/great grand... children, even if there
is no preference at direct child level itself. It returns it without the trailing dot.
- without the prefix (namePrefix) - i.e. it removes the prefix
See https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIPrefBranch#getChildList()
directRequisiteIncompatible() → {boolean|string}
Returns:
Return false if versions of the requisite and the dependant are compatible, or if there are no version restrictions. Return one of SeLiteExtensionSequencer.DIRECT_DEPENDANCY_TOO_OLD or SeLiteExtensionSequencer.DIRECT_DEPENDANCY_TOO_NEW otherwise.
- Type
- boolean | string
ensureFieldName(name, description, asModuleOrSetNameopt)
Ensure that the name can be a preference module/set/field name. Module names can contain a dot
but they can't start neither end with a dot, and they must be at least 2 characters long.
Set/SeLiteSettings.Field names and multi-value field keys can't contain dots.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
|||
description |
String to describe what is being checked, if the check fails. | ||
asModuleOrSetName |
bool |
<optional> |
Whether to check as a module/set name; otherwise it's deemed to be a field or FixedMap key name. False by default. |
fieldTreeRow()
Returns:
format(testCase, name)
Format TestCase and return the source.
The 3rd and 4th parameters are used only in default HTML format.
Parameters:
Name | Type | Description |
---|---|---|
testCase |
TestCase to format | |
name |
The name of the test case, if any. It may be used to embed title into the source. |
formatCommands(The)
Format an array of commands to the snippet of source.
Used to copy the source into the clipboard.
Parameters:
Name | Type | Description |
---|---|---|
The |
array of commands to sort. |
generateFields(setFields)
Parameters:
Name | Type | Description |
---|---|---|
setFields |
Result of SeLiteSettings.Module.getFieldsOfSet() or SeLiteSettings.Module.getFieldsDownToFolder() |
generateSets(node, object)
Parameters:
Name | Type | Description |
---|---|---|
node |
moduleChildren |
|
object |
module Module |
generateTreeColumns(allowModules, perFolder)
Parameters:
Name | Type | Description |
---|---|---|
allowModules |
bool Whether we show any module/s rather than just a specific one. If allowModules is true, there may be none, one or more modules to show. | |
perFolder |
bool Whether we're showing fields in per-folder mode - then we show a 'Reset' or 'Inherit' buttons and tooltips that indicate where each field is inherited from. |
Returns:
node object for
infoURLtoDownloadURL() → {string|undefined}
Convert infoURL, if it's https://addons.mozilla.org/en-US/firefox/addon/XXX or https://addons.mozilla.org/firefox/addon/XXX, to download/versions URL.
Returns:
- Type
- string | undefined
loadXMLDoc(filename, handler)
Parameters:
Name | Type | Description |
---|---|---|
filename |
string | |
handler |
function |
locateConnectionInfo(mixed, string) → {SQLiteConnectionInfo}
Locate SQLiteConnectionInfo instance, if any. 'Private function'.
Parameters:
Name | Type | Description |
---|---|---|
mixed |
fileNameOrConnectionOrParameters Either instance of SQLiteConnectionParameters, or a full path+filename of an SQLite file | |
string |
callerFunctionName Used to make the error messages nicer. |
Returns:
instance, if matched; null if not matched but no error
- Type
- SQLiteConnectionInfo
manifestsDownToFolder(string, bool) → {object}
Collect manifest files (both values and associations fo set),
down from filesystem root to given folderPath. Parse them.
Parameters:
Name | Type | Description |
---|---|---|
string |
folderPath Full path (absolute) to the folder where your test suite is. Optional, defaults to current test suite's folder. If not specified and if there is no current test suite folder, then such a call is valid and this function returns an object with no manifests. | |
bool |
dontCache If true, then this doesn't cache manifest files (it doesn't use any previous result stored in the cache and it doesn't store result in the cache). For use by GUI. |
Returns:
Anonymous object {
values: naturally sorted object (that lists more global folders first) {
string absoluteFolderPath: array of entries from a values manifest at this path
[
SeLiteSettings.ManifestInfo instance with isValuesManifest==true
...
],
...
},
associations: naturally sorted object (that lists more global folders first) {
string absoluteFolderPath: array of entries from an association manifest at this path
[
SeLiteSettings.ManifestInfo instance with isValuesManifest==false
...
],
...
}
}
- Type
- object
parse(testCase, source)
Parse source and update TestCase. Throw an exception if any error occurs.
Parameters:
Name | Type | Description |
---|---|---|
testCase |
TestCase to update | |
source |
The source to parse |
parseCommandsAndHeader(doc) → {object}
Parse & extract any header, command(s) and/or comment(s). Used to parse test case .html files, and also to parse from HTML from native clipboard. Factored out from original parse().
Parameters:
Name | Type | Description |
---|---|---|
doc |
string | HTML source to parse. |
Returns:
{commands: Array commands, header: string or undefined header, lastIndex: number }
- Type
- object
PluginDetails(sourceopt)
This serves in SeLiteExtensionSequencer.registerPlugin() to validate the plugin.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
source |
object |
<optional> |
The same as parameter passed to SeLiteExtensionSequencer.registerPlugin(). |
preProcessEdit(row, string) → {Object|SeLiteSettings.Module|string}
Gather some information about the cell, the field, set and module. Validate the value, show an alert if validation fails. If there is a valid change of the field, show/hide 'Undefine' or 'Null' label and related 'properties'.
Only used after type events (setCellText, or blur other than ESC).
Only used after type events (setCellText, or blur other than ESC).
Parameters:
Name | Type | Description |
---|---|---|
row |
is 0-based index among the expanded rows, not all rows. | |
string |
value new value (as typed) |
Returns:
-
result
- Type
- Object
-
result.module
-
result.rowProperties setName: string,TODO field: *, treeRow: *, oldKey: *, validationPassed: boolean, valueChanged: boolean, parsed: *, fieldTreeRowsOrChildren: object
oldKey is the previous value - string, the key as it was before this edit (or the fixed key for FixedMap) - for a multi-valued field - mixed previous value (including Javascript null/undefined) - for single-valued field
parsed is the parsed value, string or number (after trimmed)
fieldTreeRowsOrChildren: object, retrieved as 2nd level entry from moduleRowsOrChildren; serving as an associative array, with values beingor objects for the field string value or option key => object ... SeLiteSettings.FIELD_MAIN_ROW => for the main (collapsible) level of this field SeLiteSettings.FIELD_TREECHILDREN => SeLiteSettings.NEW_VALUE_ROW => for the new value to be added (not saved yet), optional - Type
- string
propertiesPart(string, level)
Parameters:
Name | Type | Description |
---|---|---|
string |
properties 'properties' attribute of |
|
level |
RowLevel | It indicates which level we want the name for. Not all levels may apply. For level===RowLevel.OPTION this may return a string with space(s) in it. |
Returns:
string name for the given level, or undefined if there's no property (word) at that level.
Side note: I would have used https://developer.mozilla.org/en-US/docs/Web/API/element.dataset,
but I didn't know (and still don't know) how to get it for element where the user clicked - tree.view doesn't let me.
readFile(string)
Read whole contents of the file. Assume UTF-8.
Parameters:
Name | Type | Description |
---|---|---|
string |
fileName File name |
Returns:
string contents; false if no such file (compare the result strictly using ===false)
removeCommentsGetLines(string)
Parameters:
Name | Type | Description |
---|---|---|
string |
contents |
Returns:
array Line(s) without those that were purely comments, or empty lines.
requisiteDetailsSubset(Like) → {object}
Parameters:
Name | Type | Description |
---|---|---|
Like |
object | entries in requisitePlugins subfield for SeLiteExtensionSequencer.registerPlugin() |
Returns:
object {
name: string human-friendly name,
infoURL: string,
downloadURL: string optional - see registerPlugin()
}
- Type
- object
SeLiteMiscClassForVerifiedScope()
This defines a catch-all declaration handler, that allows functions not to be declared through declareGlobals(). This means that you can't set up a catch-all handler yourself.
setCellText(row, col, string, object)
This - nsITreeView.setCellText() - gets triggered only for string/number fields and for File fields; not for checkboxes.
Parameters:
Name | Type | Description |
---|---|---|
row |
is 0-based index among the expanded rows, not all rows. | |
col |
I don't use it, because I use module definition to figure out the editable cell. | |
string |
value new value | |
object |
original The original TreeView |
showingPerFolder() → {bool}
Shortcut function. Only valid once I set variable targetFolder.
Returns:
- Type
- bool
SQLiteConnectionInfo()
This opens the file and a connection (and a cache-keeping connection, if needed).
When this is called, it's assumed that there's no existing connection for given fileName.
treeCell(object, level)
Get a element/object from a given treeRow and level
Parameters:
Name | Type | Description |
---|---|---|
object |
treeRow object/element for |
|
level |
Column | It indicates which column to return |
Returns:
object Element for
treeColumn(element)
Parameters:
Name | Type | Description |
---|---|---|
element |
Element for |
Returns:
object Instance of nsITreeColumn, where returnedObject.element=element.
updateSpecial(setName, field, int, keyOrValue, fixedKeyopt)
Set/unset special value for the field in the preferences, if the change involves setting/unsetting a special value
- that is, SeLiteSettings.VALUE_PRESENT or SeLiteSettings.NULL.
Don't actually set/add/remove any actual value (other than a special value).
Call this function before we set/add/remove the new value in preferences.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
setName |
string Name of the set; empty if the module doesn't allow multiple sets | ||
field |
Field instance | ||
int |
addOrRemove +1 if adding entry; -1 if removing it; any of 0/null/undefined if replacing the value or setting the whole field to null/undefined. It can be +1 or -1 only if field.multivalued. If the field is an instance of SeLiteSettings.Field.FixedMap, then addOrRemove should be 0 when setting an *option* (value for fixedKey) of the field to null/undefined. Therefore you usually need 2 calls to this function when handling SeLiteSettings.Field.FixedMap - that keeps this function simple. | ||
keyOrValue |
* | The new value to store, or (for Choice) the key for the new value to check. It can be anything (and is not used) if addOrRemove is +1 or -1, unless the field is an instance of SeLiteSettings.Field.FixedMap. Otherwise It should have been validated - this function doesn't validate keyOrValue. It can be null if it's a single-valued field. It can be undefined (then if it is multi-valued, the field is stored as VALUE_PRESENT). | |
fixedKey |
string |
<optional> |
Only used, when setting an option (key) of SeLiteSettings.Field.FixedMap to null/undefined. But do not use when setting the whole value of a SeLiteSettings.Field.FixedMap field to undefined. |
valueCompound()
Simple shortcut function