]> git.donarmstrong.com Git - x_full.git/blob - .mozilla/firefox/default/extensions/itsalltext@docwhat.gerf.org/chrome/content/badeditor.js
add itsalltext
[x_full.git] / .mozilla / firefox / default / extensions / itsalltext@docwhat.gerf.org / chrome / content / badeditor.js
1 /*jslint nomen: true, evil: false, browser: true */
2 /**
3  * Pass back the values that that the user selected.
4  */
5 function onOK() {
6     window['arguments'][0].out = {
7         do_preferences: true
8     };
9     return true;
10 }
11 function doOnload() {
12     var locale = document.getElementById("strings");
13     var params = window['arguments'][0];
14     var reason = document.getElementById('reason');
15     var textnode = '**error**';
16     /* Errors are from
17      * http://lxr.mozilla.org/seamonkey/source/xpcom/base/nsError.h#262 */
18     if(params.exception == 'NS_ERROR_FILE_INVALID_PATH' ||
19        params.exception == 'NS_ERROR_FILE_UNRECOGNIZED_PATH' ||
20        params.exception == 'NS_ERROR_FILE_TARGET_DOES_NOT_EXIST' ||
21        params.exception == 'NS_ERROR_FILE_INVALID_PATH' ||
22        params.exception == 'NS_ERROR_FILE_NOT_FOUND' ||
23        params.exception == 'NS_ERROR_FILE_NAME_TOO_LONG' ) {
24         textnode = locale.getFormattedString('bad.noent', [params.path]);
25     } else if(params.exception == 'NS_ERROR_FILE_ACCESS_DENIED' ||
26               params.exception == 'NS_ERROR_FILE_IS_DIRECTORY' ||
27               params.exception == 'NS_ERROR_FILE_IS_LOCKED' ) {
28         textnode = locale.getFormattedString('bad.noexec', []);
29
30     /* At this point, we don't know exactly why it failed...
31      * Try some heuristics. */
32     } else if(!params.path) {
33         textnode = locale.getFormattedString('bad.noset',[]);
34     } else if(params.exists) {
35         textnode = locale.getFormattedString('bad.noexec', []);
36     } else {
37         textnode = locale.getFormattedString('bad.noent', [params.path]);
38     }
39     reason.appendChild(document.createTextNode(textnode));
40 }