]> git.donarmstrong.com Git - x_full.git/blobdiff - .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
diff --git a/.mozilla/firefox/default/extensions/itsalltext@docwhat.gerf.org/chrome/content/badeditor.js b/.mozilla/firefox/default/extensions/itsalltext@docwhat.gerf.org/chrome/content/badeditor.js
new file mode 100644 (file)
index 0000000..f0b8b2d
--- /dev/null
@@ -0,0 +1,40 @@
+/*jslint nomen: true, evil: false, browser: true */
+/**
+ * Pass back the values that that the user selected.
+ */
+function onOK() {
+    window['arguments'][0].out = {
+        do_preferences: true
+    };
+    return true;
+}
+function doOnload() {
+    var locale = document.getElementById("strings");
+    var params = window['arguments'][0];
+    var reason = document.getElementById('reason');
+    var textnode = '**error**';
+    /* Errors are from
+     * http://lxr.mozilla.org/seamonkey/source/xpcom/base/nsError.h#262 */
+    if(params.exception == 'NS_ERROR_FILE_INVALID_PATH' ||
+       params.exception == 'NS_ERROR_FILE_UNRECOGNIZED_PATH' ||
+       params.exception == 'NS_ERROR_FILE_TARGET_DOES_NOT_EXIST' ||
+       params.exception == 'NS_ERROR_FILE_INVALID_PATH' ||
+       params.exception == 'NS_ERROR_FILE_NOT_FOUND' ||
+       params.exception == 'NS_ERROR_FILE_NAME_TOO_LONG' ) {
+        textnode = locale.getFormattedString('bad.noent', [params.path]);
+    } else if(params.exception == 'NS_ERROR_FILE_ACCESS_DENIED' ||
+              params.exception == 'NS_ERROR_FILE_IS_DIRECTORY' ||
+              params.exception == 'NS_ERROR_FILE_IS_LOCKED' ) {
+        textnode = locale.getFormattedString('bad.noexec', []);
+
+    /* At this point, we don't know exactly why it failed...
+     * Try some heuristics. */
+    } else if(!params.path) {
+        textnode = locale.getFormattedString('bad.noset',[]);
+    } else if(params.exists) {
+        textnode = locale.getFormattedString('bad.noexec', []);
+    } else {
+        textnode = locale.getFormattedString('bad.noent', [params.path]);
+    }
+    reason.appendChild(document.createTextNode(textnode));
+}