mozdev.org

QuickTools    

resources:
API for XPInstall - API Home | Demo | Documentation |

getList() Creates an instance of List object. List object contains a set of key, value pair and methods for manipulating it.
getList(set) Creates an instance of List object from an existing set.
.
List Properties
set This is the bag which contains all key, value pairs
.
List Method
append(key, value) Adds a new key value pair to list object, if a key already exist the values are converted to an array. ie, a single key can have multiple values. Useful to store selected items in multiselect list box.
overwrite(key, value) creates a new key. if same key already exist it will be overwritten
exist(key) check existence of a key.
isArray (key) check a key is an array or not
list2query() returns a HTTP query string created with data from List.set
set2query(set) returns a HTTP query string created with data from set argument provided as input
query2list(qry, start) appends key value pairs from a HTTP query string. Optional "start" argument can be used to chop "?" from location.search
query2set (qry,set, start) appends key value pair from a HTTP query string to a passed set. Optional "start" argument can be used to chop "?" from location.search
list2string (filter) converts a List.set to string for display purpose. an optional filter can be specified to limit elements
set2string (set, filter) converts a set provided a input to string for display purpose. an optional filter can be specified to limit elements
form2list (formobj) Itrates through HTML form Object and add selected elements them to the List.set
form2set (formobj) Itrates through HTML form Object and add selected elements them to the input set arguments
list2form (formobj) Update a HTML form and with data from List.set
set2form (set,formobj) Update a HTML form and with data from set object provided
formelements(frm, arr) returns form elements as an array. passing input array argument is optional.
setformitem (formobj, itemname, value, flags) An internal function used to set a HTML form object. I exposed it so that it may be useful for other for other purpose
.
String Object Following methods are added to String object
trim() Removes all white space characters(space, tabs, new lines) from beginning and end of string
ltrim() trims only beginning
rtrim() trims only ending
head(sep) gets first item from a coma separated list. "cat,dog,man".head() gives "cat". "sep" argument may be use to specify a character other than coma as separator. "cat/dog/man".head("/") gives "cat"
nonhead(sep) gets rest items other than first item from a coma separated list. "cat,dog,man".nonhead() gives "dog,man"
tail(sep) "cat,dog,man".tail() gives "man"
nontail(sep) "cat,dog,man".nontail() gives "cat,dog"
trimhead(sep) removes blank items from begining of list ",,,,cat,dog,man,,,,,,,".trimhead() gives "cat,dog,man,,,,"
trimtail(sep) ",,,cat,dog,,,man,,,,".trimhead() gives ",,,cat,dog,,,man"
trimboth(sep) ",,,cat,dog,,,man,,,,".trimhead() gives "cat,dog,,,man"
.
getEnv() Creates an instance of Env object. On first time call this will also update String object to add more method for List processing. Mandatory to be called before creating List object or before calling new String methods
.
Env Properties
appName Returns Mozilla, Firebird, Thunderbird to indicate the application in which it is running
ver (future) Gives version
platform same as navigator.platform or Install.platform
os Returns Unix, Win, Mac to indicate the OS in which it is running
.
Env Method
escape(str) same as normal escape(str)
unescape(str) same as normal unescape(str)
int2hex(i) returns hex value of an integer. int2hex(255) gives "FF"
hex2int(hex) returns integervalue of a hex string. hex2int("FF") gives 255
S(str) returns a cloned string of str
id(id) same as document.getElementById();
isMozilla() true if application is mozilla;
isFirebird() true if application is Firebird;
isThunderbird() true if application is thunderbird;
isUnix() true if OS is unix;
isWin() true if OS is win;
isMac() true if OS is Mac;
set2query(set) same as List.set2query(set)
query2set(qry,set, start) same as List.query2set(qry, set, start)
set2string(set, filter) same as List.set2string(set, filter)
formelements(frm, arr) returns form elements as an array. passing input array argument is optional.
printFormData() Display data received from forms for debug purpose
query2set (qry,set, start) Same as List.query2set (qry,set, start) ;
set2string (set, filter) Same as List.set2string (set, filter);
set2query(set) Same as List.set2query(set)
dirOfFile(filename) if a file name is supplied, it returns the parent dir object. if dir name is give as input object for same dir is returned
diskfile(filename) same as getFolder("file:///",filename)
.
Env Additional properties
JSLibExist true is JSLib already installed
JSLibFolder points JSLib Folder is it is installed
appFolder points to application folder same as getFolder("Program")
userChrome points to user chrome folder
appChrome points to application chrome folder
url same as Install.url, but is of String object type. So you can use all methods for String object.
arguments same as Install.arguments, (String object)
jarfile same as Install.jarfile, (String object)
archive same as Install.archive, (String object)
formdata A Set object created from Install.arguments. It contains all the submitted data as (key value) pair.
fldChrome point to output of getFolder("Chrome")
fldComponents point to output of getFolder("Components")
fldCurrentUser point to output of getFolder("Current User")
fldDefaults
fldOSDrive
fldPlugins
fldProgram
fldPreferences
fldTemporary
fldMacAppleMenu
fldMacControlPanel
fldMacDesktop
fldMacDocuments
fldMacExtension
fldMacFonts
fldMacShutdown
fldMacStartup
fldMacSystem
fldMacTrash
fldMacPreferences
fldUnixLib
fldUnixLocal
fldWinSystem
fldWindows


The quicktools project can be contacted through the mailing list or the member list.
Copyright © 2000-2017. All rights reserved. Terms of Use & Privacy Policy.