When including this script, define var where="xxx". The text will be part of log and error messages.
Include this script, and execute init(). This will initialize the global variables
promptService (nsIPromptService for window dialog messages)
consoleService (nsIConsoleService for logging to the JavaScript console)
Functions for logging and error handling:
log(n, s)
error(s, e)
Functions |
|
| void | error (string s, error e) |
| void | error2 (string t, string s, error e) |
| void | errorClose (string s, error e, Object er) |
| void | errorClose2 (string s, error e) |
| void | errorCloseNmp (string s, error e, Object nmp) |
| void | errorDisplayThrowNmp (string s, error e, Object nmp) |
| void | errorNmp (string s, error e, Object nmp) |
| void | init () |
| void | log (int n, string s) |
| void | openURL (string url) |
Variables |
|
| nsIConsoleService | consoleService |
| boolean | initialized |
| string | logLevel |
| string | NS |
| nsIPromptService | promptService |
| void error | ( | string | s, | |
| error | e | |||
| ) |
Display error message as window, and log to JavaScript console
| s | A string explaining where the error occured | |
| e | The error to report |
| void error2 | ( | string | t, | |
| string | s, | |||
| error | e | |||
| ) |
Display error message with additional text as window, and log to JavaScript console
| t | A string explaining where the error occured | |
| s | A string explaining how the error occured | |
| e | The error to report |
| void errorClose | ( | string | s, | |
| error | e, | |||
| Object | er | |||
| ) |
Display error message with additional text as window, and log to JavaScript console. Set er.error to true (for returning the error message to "calling" window). Close originating window.
| s | A string explaining how the error occured | |
| e | The error to report | |
| er |
The error object in which .error shall be set
|
| void errorClose2 | ( | string | s, | |
| error | e | |||
| ) |
Display error message with additional text as window, and log to JavaScript console. Close originating window.
| s | A string explaining how the error occured | |
| e | The error to report |
| void errorCloseNmp | ( | string | s, | |
| error | e, | |||
| Object | nmp | |||
| ) |
Display NMP (NOKIA) error message with additional text as window, and log to JavaScript console. Close originating window.
| s | A string explaining how the error occured | |
| e | The error to report | |
| nmp | The NMP (NOKIA) object from which the originated |
| void errorDisplayThrowNmp | ( | string | s, | |
| error | e, | |||
| Object | nmp | |||
| ) |
Display NMP (NOKIA) error message with additional text as window, and log to JavaScript console. Rethrow base exception.
| s | A string explaining how the error occured | |
| e | The error to report | |
| nmp | The NMP (NOKIA) object from which the originated |
| void errorNmp | ( | string | s, | |
| error | e, | |||
| Object | nmp | |||
| ) |
Display NMP (NOKIA) error message with additional text as window, and log to JavaScript console.
| s | A string explaining how the error occured | |
| e | The error to report | |
| nmp | The NMP (NOKIA) object from which the originated |
| void init | ( | ) |
Initialize
promptService
consoleService
| void log | ( | int | n, | |
| string | s | |||
| ) |
Log message to JavaScript console
| n | Log level. 1: Global; 2: Each contact; 3: More detail | |
| s | The string to write to the console |
| void openURL | ( | string | url | ) |
Open specified URL in browser. window.open() does not work with URL's from Thunderbird
| url |
| nsIConsoleService consoleService |
For logging to the JavaScript console
| boolean initialized |
Remember if already initialized
| string logLevel |
Global. Level for logging. 1: Global; 2: Each contact; 3: More detail
| string NS |
Global namespace for NokaSync
| nsIPromptService promptService |
For window dialog message