summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2009-09-30 22:57:06 -0400
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2009-09-30 22:57:06 -0400
commit3ee00ed56e0206e767a3aa2f8f1c0b8f1252d77a (patch)
tree27a28013a7bd5f933328a1ef2466a97ec23f73d6
parent40935c5396e7d8cefb3fe0070ebdd7d97e4603a2 (diff)
Imported Upstream version 0.7.9upstream/0.7.9
-rw-r--r--chrome.manifest3
-rw-r--r--components/ipc.xptbin3016 -> 0 bytes
-rw-r--r--content/Api/api.js142
-rw-r--r--content/Core/cgpg.js649
-rw-r--r--content/Core/cgpgaccess.js208
-rw-r--r--content/Core/cselect.js10
-rw-r--r--content/Core/downloadOverlay.js25
-rw-r--r--content/Core/firefoxOverlay.xul29
-rw-r--r--content/Core/inline.js43
-rw-r--r--content/Core/misc.js2613
-rw-r--r--content/Core/overlay.js15
-rw-r--r--content/Core/prismeOverlay.xul2
-rw-r--r--content/Dialogs/Assistant/2-gnupg.js2
-rw-r--r--content/Dialogs/Assistant/3-privatekey.js12
-rw-r--r--content/Dialogs/Keymanager/keymanager.js26
-rw-r--r--content/Dialogs/Keymanager/keymanager.xul2
-rw-r--r--content/Dialogs/Keymanager/newkey.js2
-rw-r--r--content/Dialogs/Keymanager/searchkey.js8
-rw-r--r--content/Dialogs/Keymanager/signmanager.js8
-rw-r--r--content/Dialogs/api.js12
-rw-r--r--content/Dialogs/hash.js4
-rw-r--r--content/Dialogs/options.js18
-rw-r--r--content/Dialogs/showtext.js20
-rw-r--r--content/GpgAuth/gpgauth.js4
-rw-r--r--content/Mime/decoder.js44
-rw-r--r--content/Mime/encoder.js6
-rw-r--r--content/Mime/gmailSender.js14
-rw-r--r--content/Mime/mime.js8
-rw-r--r--content/Mime/sender.js34
-rw-r--r--content/Webmails/Gmail/cgmail.js176
-rw-r--r--content/Webmails/Gmail/cgmail2.js3227
-rw-r--r--install.rdf4
-rw-r--r--locale/ar/1-welcome.dtd2
-rw-r--r--locale/ar/2-gnupg.dtd2
-rw-r--r--locale/ar/3-privatekey.dtd2
-rw-r--r--locale/ar/4-gmail.dtd4
-rw-r--r--locale/ar/6-end.dtd8
-rw-r--r--locale/ar/api.dtd4
-rw-r--r--locale/ar/firegpg.dtd2
-rw-r--r--locale/ar/firegpg.properties29
-rw-r--r--locale/ar/hash.dtd4
-rw-r--r--locale/ar/keymanager.dtd5
-rw-r--r--locale/ar/newkey.dtd6
-rw-r--r--locale/ar/prefwindow.dtd6
-rw-r--r--locale/ar/searchkey.dtd2
-rw-r--r--locale/ca/3-privatekey.dtd2
-rw-r--r--locale/ca/4-gmail.dtd4
-rw-r--r--locale/ca/api.dtd2
-rw-r--r--locale/ca/firegpg.dtd26
-rw-r--r--locale/ca/firegpg.properties55
-rw-r--r--locale/ca/keymanager.dtd1
-rw-r--r--locale/ca/prefwindow.dtd24
-rw-r--r--locale/ca/showtext.dtd8
-rw-r--r--locale/cs/1-welcome.dtd24
-rw-r--r--locale/cs/2-gnupg.dtd42
-rw-r--r--locale/cs/3-privatekey.dtd30
-rw-r--r--locale/cs/4-gmail.dtd40
-rw-r--r--locale/cs/5-options.dtd22
-rw-r--r--locale/cs/6-end.dtd22
-rw-r--r--locale/cs/api.dtd20
-rw-r--r--locale/cs/firegpg.dtd10
-rw-r--r--locale/cs/firegpg.properties55
-rw-r--r--locale/cs/hash.dtd10
-rw-r--r--locale/cs/keymanager.dtd1
-rw-r--r--locale/cs/prefwindow.dtd18
-rw-r--r--locale/da/firegpg.dtd2
-rw-r--r--locale/da/firegpg.properties7
-rw-r--r--locale/da/keymanager.dtd1
-rw-r--r--locale/de/4-gmail.dtd2
-rw-r--r--locale/de/firegpg.dtd2
-rw-r--r--locale/de/firegpg.properties9
-rw-r--r--locale/de/keymanager.dtd1
-rw-r--r--locale/el/6-end.dtd2
-rw-r--r--locale/el/api.dtd2
-rw-r--r--locale/el/firegpg.dtd2
-rw-r--r--locale/el/firegpg.properties7
-rw-r--r--locale/el/hash.dtd2
-rw-r--r--locale/el/keymanager.dtd1
-rw-r--r--locale/el/prefwindow.dtd2
-rw-r--r--locale/en-US/6-end.dtd2
-rw-r--r--locale/en-US/api.dtd2
-rw-r--r--locale/en-US/firegpg.dtd2
-rw-r--r--locale/en-US/firegpg.properties7
-rw-r--r--locale/en-US/hash.dtd2
-rw-r--r--locale/en-US/keymanager.dtd1
-rw-r--r--locale/en-US/prefwindow.dtd4
-rw-r--r--locale/eo/6-end.dtd2
-rw-r--r--locale/eo/api.dtd2
-rw-r--r--locale/eo/firegpg.dtd2
-rw-r--r--locale/eo/firegpg.properties7
-rw-r--r--locale/eo/hash.dtd2
-rw-r--r--locale/eo/keymanager.dtd1
-rw-r--r--locale/eo/prefwindow.dtd4
-rw-r--r--locale/es/1-welcome.dtd16
-rw-r--r--locale/es/2-gnupg.dtd32
-rw-r--r--locale/es/3-privatekey.dtd18
-rw-r--r--locale/es/4-gmail.dtd36
-rw-r--r--locale/es/5-options.dtd10
-rw-r--r--locale/es/6-end.dtd10
-rw-r--r--locale/es/about.dtd2
-rw-r--r--locale/es/api.dtd12
-rw-r--r--locale/es/firegpg.dtd6
-rw-r--r--locale/es/firegpg.properties47
-rw-r--r--locale/es/hash.dtd6
-rw-r--r--locale/es/keymanager.dtd1
-rw-r--r--locale/es/prefwindow.dtd4
-rw-r--r--locale/eu/1-welcome.dtd12
-rw-r--r--locale/eu/2-gnupg.dtd23
-rw-r--r--locale/eu/3-privatekey.dtd17
-rw-r--r--locale/eu/4-gmail.dtd22
-rw-r--r--locale/eu/5-options.dtd12
-rw-r--r--locale/eu/6-end.dtd11
-rw-r--r--locale/eu/about.dtd4
-rw-r--r--locale/eu/api.dtd11
-rw-r--r--locale/eu/firegpg.dtd60
-rw-r--r--locale/eu/firegpg.properties190
-rw-r--r--locale/eu/hash.dtd5
-rw-r--r--locale/eu/keymanager.dtd32
-rw-r--r--locale/eu/newkey.dtd17
-rw-r--r--locale/eu/password.dtd3
-rw-r--r--locale/eu/prefwindow.dtd86
-rw-r--r--locale/eu/searchkey.dtd8
-rw-r--r--locale/eu/showtext.dtd10
-rw-r--r--locale/eu/signmanager.dtd7
-rw-r--r--locale/fin/1-welcome.dtd12
-rw-r--r--locale/fin/2-gnupg.dtd23
-rw-r--r--locale/fin/3-privatekey.dtd17
-rw-r--r--locale/fin/4-gmail.dtd22
-rw-r--r--locale/fin/5-options.dtd12
-rw-r--r--locale/fin/6-end.dtd11
-rw-r--r--locale/fin/about.dtd4
-rw-r--r--locale/fin/api.dtd11
-rw-r--r--locale/fin/firegpg.dtd60
-rw-r--r--locale/fin/firegpg.properties190
-rw-r--r--locale/fin/hash.dtd5
-rw-r--r--locale/fin/keymanager.dtd32
-rw-r--r--locale/fin/newkey.dtd17
-rw-r--r--locale/fin/password.dtd3
-rw-r--r--locale/fin/prefwindow.dtd86
-rw-r--r--locale/fin/searchkey.dtd8
-rw-r--r--locale/fin/showtext.dtd10
-rw-r--r--locale/fin/signmanager.dtd7
-rw-r--r--locale/fr/firegpg.dtd2
-rw-r--r--locale/fr/firegpg.properties7
-rw-r--r--locale/fr/keymanager.dtd1
-rw-r--r--locale/gl/1-welcome.dtd12
-rw-r--r--locale/gl/2-gnupg.dtd23
-rw-r--r--locale/gl/3-privatekey.dtd17
-rw-r--r--locale/gl/4-gmail.dtd22
-rw-r--r--locale/gl/5-options.dtd12
-rw-r--r--locale/gl/6-end.dtd11
-rw-r--r--locale/gl/about.dtd4
-rw-r--r--locale/gl/api.dtd11
-rw-r--r--locale/gl/firegpg.dtd60
-rw-r--r--locale/gl/firegpg.properties190
-rw-r--r--locale/gl/hash.dtd5
-rw-r--r--locale/gl/keymanager.dtd32
-rw-r--r--locale/gl/newkey.dtd17
-rw-r--r--locale/gl/password.dtd3
-rw-r--r--locale/gl/prefwindow.dtd86
-rw-r--r--locale/gl/searchkey.dtd8
-rw-r--r--locale/gl/showtext.dtd10
-rw-r--r--locale/gl/signmanager.dtd7
-rw-r--r--locale/he/1-welcome.dtd2
-rw-r--r--locale/he/3-privatekey.dtd2
-rw-r--r--locale/he/4-gmail.dtd2
-rw-r--r--locale/he/6-end.dtd2
-rw-r--r--locale/he/api.dtd2
-rw-r--r--locale/he/firegpg.dtd2
-rw-r--r--locale/he/firegpg.properties7
-rw-r--r--locale/he/hash.dtd2
-rw-r--r--locale/he/keymanager.dtd1
-rw-r--r--locale/he/prefwindow.dtd2
-rw-r--r--locale/hu/1-welcome.dtd4
-rw-r--r--locale/hu/2-gnupg.dtd4
-rw-r--r--locale/hu/3-privatekey.dtd4
-rw-r--r--locale/hu/4-gmail.dtd2
-rw-r--r--locale/hu/5-options.dtd6
-rw-r--r--locale/hu/6-end.dtd8
-rw-r--r--locale/hu/api.dtd6
-rw-r--r--locale/hu/firegpg.dtd2
-rw-r--r--locale/hu/firegpg.properties15
-rw-r--r--locale/hu/hash.dtd4
-rw-r--r--locale/hu/keymanager.dtd1
-rw-r--r--locale/hu/prefwindow.dtd8
-rw-r--r--locale/id/6-end.dtd2
-rw-r--r--locale/id/firegpg.dtd2
-rw-r--r--locale/id/firegpg.properties7
-rw-r--r--locale/id/keymanager.dtd1
-rw-r--r--locale/it/6-end.dtd2
-rw-r--r--locale/it/firegpg.dtd2
-rw-r--r--locale/it/firegpg.properties11
-rw-r--r--locale/it/keymanager.dtd1
-rw-r--r--locale/ja/1-welcome.dtd6
-rw-r--r--locale/ja/2-gnupg.dtd16
-rw-r--r--locale/ja/3-privatekey.dtd6
-rw-r--r--locale/ja/4-gmail.dtd4
-rw-r--r--locale/ja/5-options.dtd4
-rw-r--r--locale/ja/6-end.dtd12
-rw-r--r--locale/ja/api.dtd8
-rw-r--r--locale/ja/firegpg.dtd10
-rw-r--r--locale/ja/firegpg.properties11
-rw-r--r--locale/ja/hash.dtd8
-rw-r--r--locale/ja/keymanager.dtd1
-rw-r--r--locale/ja/prefwindow.dtd20
-rw-r--r--locale/ko-KR/1-welcome.dtd24
-rw-r--r--locale/ko-KR/2-gnupg.dtd44
-rw-r--r--locale/ko-KR/3-privatekey.dtd32
-rw-r--r--locale/ko-KR/4-gmail.dtd44
-rw-r--r--locale/ko-KR/5-options.dtd24
-rw-r--r--locale/ko-KR/6-end.dtd22
-rw-r--r--locale/ko-KR/about.dtd6
-rw-r--r--locale/ko-KR/api.dtd22
-rw-r--r--locale/ko-KR/firegpg.dtd50
-rw-r--r--locale/ko-KR/firegpg.properties305
-rw-r--r--locale/ko-KR/hash.dtd10
-rw-r--r--locale/ko-KR/keymanager.dtd61
-rw-r--r--locale/ko-KR/newkey.dtd28
-rw-r--r--locale/ko-KR/password.dtd2
-rw-r--r--locale/ko-KR/prefwindow.dtd92
-rw-r--r--locale/ko-KR/searchkey.dtd14
-rw-r--r--locale/ko-KR/showtext.dtd4
-rw-r--r--locale/ko-KR/signmanager.dtd14
-rw-r--r--locale/lv/firegpg.dtd2
-rw-r--r--locale/lv/firegpg.properties7
-rw-r--r--locale/lv/keymanager.dtd1
-rw-r--r--locale/nl/6-end.dtd2
-rw-r--r--locale/nl/firegpg.dtd2
-rw-r--r--locale/nl/firegpg.properties7
-rw-r--r--locale/nl/keymanager.dtd1
-rw-r--r--locale/no/1-welcome.dtd4
-rw-r--r--locale/no/2-gnupg.dtd4
-rw-r--r--locale/no/3-privatekey.dtd4
-rw-r--r--locale/no/4-gmail.dtd2
-rw-r--r--locale/no/5-options.dtd6
-rw-r--r--locale/no/6-end.dtd8
-rw-r--r--locale/no/api.dtd6
-rw-r--r--locale/no/firegpg.dtd2
-rw-r--r--locale/no/firegpg.properties11
-rw-r--r--locale/no/hash.dtd6
-rw-r--r--locale/no/keymanager.dtd1
-rw-r--r--locale/no/prefwindow.dtd2
-rw-r--r--locale/pe/2-gnupg.dtd2
-rw-r--r--locale/pe/3-privatekey.dtd4
-rw-r--r--locale/pe/4-gmail.dtd2
-rw-r--r--locale/pe/5-options.dtd2
-rw-r--r--locale/pe/6-end.dtd6
-rw-r--r--locale/pe/api.dtd6
-rw-r--r--locale/pe/firegpg.dtd4
-rw-r--r--locale/pe/firegpg.properties7
-rw-r--r--locale/pe/hash.dtd2
-rw-r--r--locale/pe/keymanager.dtd1
-rw-r--r--locale/pl/6-end.dtd2
-rw-r--r--locale/pl/api.dtd2
-rw-r--r--locale/pl/firegpg.dtd2
-rw-r--r--locale/pl/firegpg.properties7
-rw-r--r--locale/pl/hash.dtd2
-rw-r--r--locale/pl/keymanager.dtd1
-rw-r--r--locale/pl/prefwindow.dtd2
-rw-r--r--locale/pt/firegpg.dtd2
-rw-r--r--locale/pt/firegpg.properties7
-rw-r--r--locale/pt/keymanager.dtd1
-rw-r--r--locale/pt_BR/1-welcome.dtd2
-rw-r--r--locale/pt_BR/2-gnupg.dtd12
-rw-r--r--locale/pt_BR/3-privatekey.dtd6
-rw-r--r--locale/pt_BR/4-gmail.dtd2
-rw-r--r--locale/pt_BR/5-options.dtd2
-rw-r--r--locale/pt_BR/firegpg.dtd2
-rw-r--r--locale/pt_BR/firegpg.properties29
-rw-r--r--locale/pt_BR/keymanager.dtd7
-rw-r--r--locale/pt_BR/prefwindow.dtd2
-rw-r--r--locale/ro/1-welcome.dtd2
-rw-r--r--locale/ro/2-gnupg.dtd6
-rw-r--r--locale/ro/3-privatekey.dtd6
-rw-r--r--locale/ro/4-gmail.dtd6
-rw-r--r--locale/ro/5-options.dtd8
-rw-r--r--locale/ro/6-end.dtd10
-rw-r--r--locale/ro/api.dtd6
-rw-r--r--locale/ro/firegpg.dtd2
-rw-r--r--locale/ro/firegpg.properties11
-rw-r--r--locale/ro/hash.dtd6
-rw-r--r--locale/ro/keymanager.dtd1
-rw-r--r--locale/ro/prefwindow.dtd12
-rw-r--r--locale/ru/1-welcome.dtd22
-rw-r--r--locale/ru/2-gnupg.dtd42
-rw-r--r--locale/ru/3-privatekey.dtd30
-rw-r--r--locale/ru/4-gmail.dtd42
-rw-r--r--locale/ru/5-options.dtd18
-rw-r--r--locale/ru/6-end.dtd16
-rw-r--r--locale/ru/api.dtd18
-rw-r--r--locale/ru/firegpg.dtd10
-rw-r--r--locale/ru/firegpg.properties53
-rw-r--r--locale/ru/hash.dtd6
-rw-r--r--locale/ru/keymanager.dtd1
-rw-r--r--locale/ru/prefwindow.dtd12
-rw-r--r--locale/sr/6-end.dtd2
-rw-r--r--locale/sr/api.dtd2
-rw-r--r--locale/sr/firegpg.dtd2
-rw-r--r--locale/sr/firegpg.properties7
-rw-r--r--locale/sr/hash.dtd2
-rw-r--r--locale/sr/keymanager.dtd1
-rw-r--r--locale/sr/prefwindow.dtd2
-rw-r--r--locale/sw/api.dtd2
-rw-r--r--locale/sw/firegpg.dtd2
-rw-r--r--locale/sw/firegpg.properties7
-rw-r--r--locale/sw/hash.dtd2
-rw-r--r--locale/sw/keymanager.dtd1
-rw-r--r--locale/tr/6-end.dtd2
-rw-r--r--locale/tr/api.dtd2
-rw-r--r--locale/tr/firegpg.dtd2
-rw-r--r--locale/tr/firegpg.properties7
-rw-r--r--locale/tr/hash.dtd2
-rw-r--r--locale/tr/keymanager.dtd1
-rw-r--r--locale/vi/1-welcome.dtd4
-rw-r--r--locale/vi/2-gnupg.dtd6
-rw-r--r--locale/vi/3-privatekey.dtd6
-rw-r--r--locale/vi/4-gmail.dtd6
-rw-r--r--locale/vi/5-options.dtd8
-rw-r--r--locale/vi/6-end.dtd10
-rw-r--r--locale/vi/about.dtd2
-rw-r--r--locale/vi/api.dtd6
-rw-r--r--locale/vi/firegpg.dtd2
-rw-r--r--locale/vi/firegpg.properties21
-rw-r--r--locale/vi/hash.dtd6
-rw-r--r--locale/vi/keymanager.dtd1
-rw-r--r--locale/vi/newkey.dtd2
-rw-r--r--locale/vi/prefwindow.dtd12
-rw-r--r--locale/zh-CN/1-welcome.dtd24
-rw-r--r--locale/zh-CN/2-gnupg.dtd44
-rw-r--r--locale/zh-CN/3-privatekey.dtd34
-rw-r--r--locale/zh-CN/4-gmail.dtd44
-rw-r--r--locale/zh-CN/5-options.dtd24
-rw-r--r--locale/zh-CN/6-end.dtd22
-rw-r--r--locale/zh-CN/api.dtd22
-rw-r--r--locale/zh-CN/firegpg.dtd10
-rw-r--r--locale/zh-CN/firegpg.properties55
-rw-r--r--locale/zh-CN/hash.dtd10
-rw-r--r--locale/zh-CN/keymanager.dtd1
-rw-r--r--locale/zh-CN/prefwindow.dtd18
-rw-r--r--locale/zh-TW/6-end.dtd2
-rw-r--r--locale/zh-TW/api.dtd2
-rw-r--r--locale/zh-TW/firegpg.dtd2
-rw-r--r--locale/zh-TW/firegpg.properties7
-rw-r--r--locale/zh-TW/hash.dtd2
-rw-r--r--locale/zh-TW/keymanager.dtd1
-rw-r--r--locale/zh-TW/prefwindow.dtd2
-rw-r--r--skin/overlay.css6
347 files changed, 6901 insertions, 4887 deletions
diff --git a/chrome.manifest b/chrome.manifest
index 821347a..4aa35c8 100644
--- a/chrome.manifest
+++ b/chrome.manifest
@@ -8,6 +8,8 @@ locale firegpg de jar:chrome/firegpg.jar!/locale/de/
locale firegpg el jar:chrome/firegpg.jar!/locale/el/
locale firegpg eo jar:chrome/firegpg.jar!/locale/eo/
locale firegpg es jar:chrome/firegpg.jar!/locale/es/
+locale firegpg eu jar:chrome/firegpg.jar!/locale/eu/
+locale firegpg fi jar:chrome/firegpg.jar!/locale/fin/
locale firegpg fr jar:chrome/firegpg.jar!/locale/fr/
locale firegpg he jar:chrome/firegpg.jar!/locale/he/
locale firegpg hu jar:chrome/firegpg.jar!/locale/hu/
@@ -16,6 +18,7 @@ locale firegpg it jar:chrome/firegpg.jar!/locale/it/
locale firegpg ja jar:chrome/firegpg.jar!/locale/ja/
locale firegpg ko-KR jar:chrome/firegpg.jar!/locale/ko-KR/
locale firegpg lv jar:chrome/firegpg.jar!/locale/lv/
+locale firegpg gl jar:chrome/firegpg.jar!/locale/gl/
locale firegpg nl jar:chrome/firegpg.jar!/locale/nl/
locale firegpg no jar:chrome/firegpg.jar!/locale/no/
locale firegpg fa jar:chrome/firegpg.jar!/locale/pe/
diff --git a/components/ipc.xpt b/components/ipc.xpt
deleted file mode 100644
index 3c299d9..0000000
--- a/components/ipc.xpt
+++ /dev/null
Binary files differ
diff --git a/content/Api/api.js b/content/Api/api.js
index 8e5218c..89d84ad 100644
--- a/content/Api/api.js
+++ b/content/Api/api.js
@@ -40,10 +40,10 @@ under the terms of any one of the MPL, the GPL or the LGPL.
*/
/*
- Class: gpgApi
+ Class: FireGPGApi
Class who manage link between FireGPG and the website who use the api
*/
-var gpgApi = {
+var FireGPGApi = {
/*
Function: onLoad
Init api features when a new page is loaded
@@ -76,7 +76,7 @@ var gpgApi = {
window.addEventListener( "firegpg:decrypt", this.decrypt, false, true );
window.addEventListener( "firegpg:encrypt", this.encrypt, false, true );
window.addEventListener( "firegpg:signandencrypt", this.signandencrypt, false, true );
- window.addEventListener( "unload", function() { gpgApi.listenerUnload() }, false );
+ window.addEventListener( "unload", function() { FireGPGApi.listenerUnload() }, false );
}
},
@@ -105,7 +105,7 @@ var gpgApi = {
*/
hello: function ( event ) {
- returnData = gpgApi.getReturnDataNode(event.target);
+ returnData = FireGPGApi.getReturnDataNode(event.target);
returnData.setAttribute('result', 'firegpg-ok');
@@ -122,13 +122,13 @@ var gpgApi = {
*/
auth: function ( event ) {
- data = gpgApi.getDataNode(event.target);
+ data = FireGPGApi.getDataNode(event.target);
key_auth = data.getAttribute('auth_key');
- returnData = gpgApi.getReturnDataNode(event.target);
+ returnData = FireGPGApi.getReturnDataNode(event.target);
- if (key_auth == '' || key_auth == undefined || gpgApi.isAuth(key_auth, event.target.ownerDocument) == false )
+ if (key_auth == '' || key_auth == undefined || FireGPGApi.isAuth(key_auth, event.target.ownerDocument) == false )
{
returnData.setAttribute('result', 'auth-fail');
return;
@@ -144,7 +144,7 @@ var gpgApi = {
*/
register: function ( event ) {
- if (!gpgApi.canRegister(event.target.ownerDocument.location)) {
+ if (!FireGPGApi.canRegister(event.target.ownerDocument.location)) {
returnData.setAttribute('result', 'register-fail');
return;
}
@@ -161,7 +161,7 @@ var gpgApi = {
return;
}
- returnData = gpgApi.getReturnDataNode(event.target);
+ returnData = FireGPGApi.getReturnDataNode(event.target);
returnData.setAttribute('auth_key', params.apiKey);
returnData.setAttribute('result', 'register-ok');
@@ -192,20 +192,20 @@ var gpgApi = {
listkey: function ( event ) {
- data = gpgApi.getDataNode(event.target);
+ data = FireGPGApi.getDataNode(event.target);
key_auth = data.getAttribute('auth_key');
- returnData = gpgApi.getReturnDataNode(event.target);
+ returnData = FireGPGApi.getReturnDataNode(event.target);
- if (key_auth == '' || key_auth == undefined || gpgApi.isAuth(key_auth, event.target.ownerDocument) == false )
+ if (key_auth == '' || key_auth == undefined || FireGPGApi.isAuth(key_auth, event.target.ownerDocument) == false )
{
return;
}
keylistcall = FireGPG.listKeys();
- if (keylistcall.result == RESULT_SUCCESS)
+ if (keylistcall.result == FireGPGResults.SUCCESS)
keylist = keylistcall.keylist;
else
return;
@@ -214,7 +214,7 @@ var gpgApi = {
for (key in keylist) {
- return_list = return_list + gpgApi.removeDoublePoint(keylist[key].keyId) + ":" + gpgApi.removeDoublePoint(keylist[key].keyName) + ",";
+ return_list = return_list + FireGPGApi.removeDoublePoint(keylist[key].keyId) + ":" + FireGPGApi.removeDoublePoint(keylist[key].keyName) + ",";
}
returnData.setAttribute('list', return_list);
@@ -232,20 +232,20 @@ var gpgApi = {
listprivkey: function ( event ) {
- data = gpgApi.getDataNode(event.target);
+ data = FireGPGApi.getDataNode(event.target);
key_auth = data.getAttribute('auth_key');
- returnData = gpgApi.getReturnDataNode(event.target);
+ returnData = FireGPGApi.getReturnDataNode(event.target);
- if (key_auth == '' || key_auth == undefined || gpgApi.isAuth(key_auth, event.target.ownerDocument) == false )
+ if (key_auth == '' || key_auth == undefined || FireGPGApi.isAuth(key_auth, event.target.ownerDocument) == false )
{
return;
}
keylistcall = FireGPG.listKeys(true);
- if (keylistcall.result == RESULT_SUCCESS)
+ if (keylistcall.result == FireGPGResults.SUCCESS)
keylist = keylistcall.keylist;
else
return;
@@ -254,7 +254,7 @@ var gpgApi = {
for (key in keylist) {
- return_list = return_list + gpgApi.removeDoublePoint(keylist[key].keyId) + ":" + gpgApi.removeDoublePoint(keylist[key].keyName) + ",";
+ return_list = return_list + FireGPGApi.removeDoublePoint(keylist[key].keyId) + ":" + FireGPGApi.removeDoublePoint(keylist[key].keyName) + ",";
}
returnData.setAttribute('list', return_list);
@@ -276,13 +276,13 @@ var gpgApi = {
check: function ( event ) {
- data = gpgApi.getDataNode(event.target);
+ data = FireGPGApi.getDataNode(event.target);
key_auth = data.getAttribute('auth_key');
- returnData = gpgApi.getReturnDataNode(event.target);
+ returnData = FireGPGApi.getReturnDataNode(event.target);
- if (key_auth == '' || key_auth == undefined || gpgApi.isAuth(key_auth, event.target.ownerDocument) == false )
+ if (key_auth == '' || key_auth == undefined || FireGPGApi.isAuth(key_auth, event.target.ownerDocument) == false )
{
return;
}
@@ -300,24 +300,24 @@ var gpgApi = {
// For I18N
var i18n = document.getElementById("firegpg-strings");
//TODO : multi signs ?
- if (result.result == RESULT_ERROR_NO_GPG_DATA) {
+ if (result.result == FireGPGResults.ERROR_NO_GPG_DATA) {
returnData.setAttribute('result', 'check-err');
returnData.setAttribute('error', 'no-gpg');
return;
}
- else if (result.result != RESULT_SUCCESS)
+ else if (result.result != FireGPGResults.SUCCESS)
{
returnData.setAttribute('result', 'check-err');
returnData.setAttribute('error', 'unknow');
return;
}
- else if (result.signresult== RESULT_ERROR_BAD_SIGN)
+ else if (result.signresult== FireGPGResults.ERROR_BAD_SIGN)
{
returnData.setAttribute('result', 'check-err');
returnData.setAttribute('error', 'bad-sign');
return;
}
- else if (result.signresult == RESULT_ERROR_NO_KEY)
+ else if (result.signresult == FireGPGResults.ERROR_NO_KEY)
{
returnData.setAttribute('result', 'check-err');
returnData.setAttribute('error', 'no-key');
@@ -349,13 +349,13 @@ var gpgApi = {
*/
sign: function ( event ) {
- data = gpgApi.getDataNode(event.target);
+ data = FireGPGApi.getDataNode(event.target);
key_auth = data.getAttribute('auth_key');
- returnData = gpgApi.getReturnDataNode(event.target);
+ returnData = FireGPGApi.getReturnDataNode(event.target);
- if (key_auth == '' || key_auth == undefined || gpgApi.isAuth(key_auth, event.target.ownerDocument) == false )
+ if (key_auth == '' || key_auth == undefined || FireGPGApi.isAuth(key_auth, event.target.ownerDocument) == false )
{
return;
}
@@ -371,15 +371,15 @@ var gpgApi = {
// Needed for a sign
if(keyID == null)
- keyID = getSelfKey();
+ keyID = FireGPGMisc.getSelfKey();
if(keyID == null)
return;
// For I18N
var i18n = document.getElementById("firegpg-strings");
- if (!isGpgAgentActivated()) {
- var password = getPrivateKeyPassword(false,gpgApi.getDomain(event.target.ownerDocument.location));
+ if (!FireGPG_isGpgAgentActivated()) {
+ var password = FireGPGMisc.getPrivateKeyPassword(false,FireGPGApi.getDomain(event.target.ownerDocument.location));
if(password == null || password == "") {
returnData.setAttribute('result', 'sign-err');
@@ -403,20 +403,20 @@ var gpgApi = {
- if (result.result == RESULT_SUCCESS)
+ if (result.result == FireGPGResults.SUCCESS)
{
returnData.setAttribute('result', 'sign-ok');
returnData.setAttribute('text', result.signed);
return;
}
- else if (result.result == RESULT_ERROR_PASSWORD)
+ else if (result.result == FireGPGResults.ERROR_PASSWORD)
{
returnData.setAttribute('result', 'sign-err');
returnData.setAttribute('error', 'bad-pass');
return;
}
- else if (result.result == RESULT_CANCEL)
+ else if (result.result == FireGPGResults.CANCEL)
{
returnData.setAttribute('result', 'sign-err');
returnData.setAttribute('error', 'user-canceled');
@@ -449,13 +449,13 @@ var gpgApi = {
signandencrypt: function ( event ) {
- data = gpgApi.getDataNode(event.target);
+ data = FireGPGApi.getDataNode(event.target);
key_auth = data.getAttribute('auth_key');
- returnData = gpgApi.getReturnDataNode(event.target);
+ returnData = FireGPGApi.getReturnDataNode(event.target);
- if (key_auth == '' || key_auth == undefined || gpgApi.isAuth(key_auth, event.target.ownerDocument) == false )
+ if (key_auth == '' || key_auth == undefined || FireGPGApi.isAuth(key_auth, event.target.ownerDocument) == false )
{
return;
}
@@ -473,7 +473,7 @@ var gpgApi = {
// Needed for a sign
if(keyID == null)
- keyID = getSelfKey();
+ keyID = FireGPGMisc.getSelfKey();
if(keyID == null)
return;
@@ -482,8 +482,8 @@ var gpgApi = {
// For I18N
var i18n = document.getElementById("firegpg-strings");
- if (!isGpgAgentActivated()) {
- var password = getPrivateKeyPassword(false,gpgApi.getDomain(event.target.ownerDocument.location));
+ if (!FireGPG_isGpgAgentActivated()) {
+ var password = FireGPGMisc.getPrivateKeyPassword(false,FireGPGApi.getDomain(event.target.ownerDocument.location));
if(password == null || password == "") {
returnData.setAttribute('result', 'sign-err');
returnData.setAttribute('error', 'user-canceled');
@@ -503,20 +503,20 @@ var gpgApi = {
// We get the result
var result = FireGPG.cryptAndSign(true,text,keyIdList,false,password,keyID);
- if (result.result == RESULT_SUCCESS)
+ if (result.result == FireGPGResults.SUCCESS)
{
returnData.setAttribute('result', 'signandencrypt-ok');
returnData.setAttribute('text', result.encrypted);
return;
}
- else if (result.result == RESULT_ERROR_PASSWORD)
+ else if (result.result == FireGPGResults.ERROR_PASSWORD)
{
returnData.setAttribute('result', 'signandencrypt-err');
returnData.setAttribute('error', 'bad-pass');
return;
}
- else if (result.result == RESULT_CANCEL)
+ else if (result.result == FireGPGResults.CANCEL)
{
returnData.setAttribute('result', 'signandencrypt-err');
returnData.setAttribute('error', 'user-canceled');
@@ -549,13 +549,13 @@ var gpgApi = {
encrypt: function ( event ) {
- data = gpgApi.getDataNode(event.target);
+ data = FireGPGApi.getDataNode(event.target);
key_auth = data.getAttribute('auth_key');
- returnData = gpgApi.getReturnDataNode(event.target);
+ returnData = FireGPGApi.getReturnDataNode(event.target);
- if (key_auth == '' || key_auth == undefined || gpgApi.isAuth(key_auth, event.target.ownerDocument) == false )
+ if (key_auth == '' || key_auth == undefined || FireGPGApi.isAuth(key_auth, event.target.ownerDocument) == false )
{
return;
}
@@ -574,7 +574,7 @@ var gpgApi = {
// We get the result
var result = FireGPG.crypt(true, text, keyIdList);
- if (result.result == RESULT_SUCCESS)
+ if (result.result == FireGPGResults.SUCCESS)
{
returnData.setAttribute('result', 'encrypt-ok');
returnData.setAttribute('text', result.encrypted);
@@ -607,13 +607,13 @@ var gpgApi = {
decrypt: function ( event ) {
- data = gpgApi.getDataNode(event.target);
+ data = FireGPGApi.getDataNode(event.target);
key_auth = data.getAttribute('auth_key');
- returnData = gpgApi.getReturnDataNode(event.target);
+ returnData = FireGPGApi.getReturnDataNode(event.target);
- if (key_auth == '' || key_auth == undefined || gpgApi.isAuth(key_auth, event.target.ownerDocument) == false )
+ if (key_auth == '' || key_auth == undefined || FireGPGApi.isAuth(key_auth, event.target.ownerDocument) == false )
{
return;
}
@@ -630,8 +630,8 @@ var gpgApi = {
var i18n = document.getElementById("firegpg-strings");
// Needed for decrypt
- if (!isGpgAgentActivated()) {
- var password = getPrivateKeyPassword(false,gpgApi.getDomain(event.target.ownerDocument.location));
+ if (!FireGPG_isGpgAgentActivated()) {
+ var password = FireGPGMisc.getPrivateKeyPassword(false,FireGPGApi.getDomain(event.target.ownerDocument.location));
if(password == null || password == "") {
returnData.setAttribute('result', 'sign-err');
returnData.setAttribute('error', 'user-canceled');
@@ -653,10 +653,10 @@ var gpgApi = {
- if (result.result == RESULT_SUCCESS)
+ if (result.result == FireGPGResults.SUCCESS)
{
//If there was a sign with the crypted text
- if (result.signresult == RESULT_SUCCESS)
+ if (result.signresult == FireGPGResults.SUCCESS)
{
returnData.setAttribute('sign-info', result.signresulttext);
}
@@ -670,13 +670,13 @@ var gpgApi = {
return;
}
- else if (result.result == RESULT_ERROR_PASSWORD)
+ else if (result.result == FireGPGResults.ERROR_PASSWORD)
{
returnData.setAttribute('result', 'decrypt-err');
returnData.setAttribute('error', 'bad-pass');
return;
}
- else if (result.result == RESULT_CANCEL)
+ else if (result.result == FireGPGResults.CANCEL)
{
returnData.setAttribute('result', 'decrypt-err');
returnData.setAttribute('error', 'user-canceled');
@@ -730,15 +730,15 @@ var gpgApi = {
*/
allowRegister: function(theLocation, type) {
- access = gpgApi.getAccessList();
+ access = FireGPGApi.getAccessList();
if (type == 'D') {
if (access.domains_allowed[theLocation.hostname] != undefined)
return access.domains_allowed[theLocation.hostname];
- key = genreate_api_key();
+ key = FireGPGMisc.genreate_api_key();
access.domains_allowed[theLocation.hostname] = key;
- gpgApi.setAccessList(access);
+ FireGPGApi.setAccessList(access);
return key;
}
@@ -746,9 +746,9 @@ var gpgApi = {
if (access.sites_allowed[theLocation.protocol + '//' + theLocation.host] != undefined)
return access.sites_allowed[theLocation.protocol + '//' + theLocation.host];
- key = genreate_api_key();
+ key = FireGPGMisc.genreate_api_key();
access.sites_allowed[theLocation.protocol + '//' + theLocation.host] = key;
- gpgApi.setAccessList(access);
+ FireGPGApi.setAccessList(access);
return key;
}
@@ -756,9 +756,9 @@ var gpgApi = {
if (access.pages_allowed[theLocation.href] != undefined)
return access.pages_allowed[theLocation.href];
- key = genreate_api_key();
+ key = FireGPGMisc.genreate_api_key();
access.pages_allowed[theLocation.href] = key;
- gpgApi.setAccessList(access);
+ FireGPGApi.setAccessList(access);
return key;
}
@@ -773,21 +773,21 @@ var gpgApi = {
*/
denyRegister: function(theLocation, type) {
- access = gpgApi.getAccessList();
+ access = FireGPGApi.getAccessList();
if (type == 'D') {
access.domains_denied[theLocation.hostname] = 'deny';
- gpgApi.setAccessList(access);
+ FireGPGApi.setAccessList(access);
}
if (type == 'S') {
access.sites_denied[theLocation.protocol + '//' + theLocation.host] = 'deny';
- gpgApi.setAccessList(access);
+ FireGPGApi.setAccessList(access);
}
if (type == 'P') {
access.pages_denied[theLocation.href] = 'deny';
- gpgApi.setAccessList(access);
+ FireGPGApi.setAccessList(access);
}
@@ -801,7 +801,7 @@ var gpgApi = {
try {
- access = gpgApi.getAccessList();
+ access = FireGPGApi.getAccessList();
if (theLocation.hostname != '')
if (access.domains_denied[theLocation.hostname] == 'deny')
@@ -832,7 +832,7 @@ var gpgApi = {
theLocation = document.location;
- access = gpgApi.getAccessList();
+ access = FireGPGApi.getAccessList();
if (theLocation.hostname != '')
if (access.domains_allowed[theLocation.hostname] == key.toString())
@@ -977,4 +977,4 @@ var gpgApi = {
};
-window.addEventListener("load", function(e) { gpgApi.onLoad(e); }, false);
+window.addEventListener("load", function(e) { FireGPGApi.onLoad(e); }, false);
diff --git a/content/Core/cgpg.js b/content/Core/cgpg.js
index 480d027..88b839f 100644
--- a/content/Core/cgpg.js
+++ b/content/Core/cgpg.js
@@ -43,34 +43,36 @@ under the terms of any one of the MPL, the GPL or the LGPL.
/*
Constants: FireGPG's actions results
- RESULT_SUCCESS - The operation was successfull or the signature is correct
- RESULT_CANCEL - The operation was canceled, for exemple the user click on cancel when his password is asked.
- RESULT_ERROR_UNKNOW - An unkonw error happend
- RESULT_ERROR_PASSWORD - The specified password was wrong.
- RESULT_ERROR_NO_DATA - There wasen't any text to do the operation
- RESULT_ERROR_ALREADY_SIGN - The text is already signed
- RESULT_ERROR_BAD_SIGN - The signature was bad
- RESULT_ERROR_NO_KEY - Impossible to verify the signature beacause there wasn't the public key in the keyring
- RESULT_ERROR_ALREADY_CRYPT - The text is already encrypted
- RESULT_ERROR_NO_GPG_DATA - The text is not a vlid PGP block
- RESULT_ERROR_INIT_FAILLED - There is a problem with GPG, impossible to execute the executable.
+ FireGPGResults.SUCCESS - The operation was successfull or the signature is correct
+ FireGPGResults.CANCEL - The operation was canceled, for exemple the user click on cancel when his password is asked.
+ FireGPGResults.ERROR_UNKNOW - An unkonw error happend
+ FireGPGResults.ERROR_PASSWORD - The specified password was wrong.
+ FireGPGResults.ERROR_NO_DATA - There wasen't any text to do the operation
+ FireGPGResults.ERROR_ALREADY_SIGN - The text is already signed
+ FireGPGResults.ERROR_BAD_SIGN - The signature was bad
+ FireGPGResults.ERROR_NO_KEY - Impossible to verify the signature beacause there wasn't the public key in the keyring
+ FireGPGResults.ERROR_ALREADY_CRYPT - The text is already encrypted
+ FireGPGResults.ERROR_NO_GPG_DATA - The text is not a vlid PGP block
+ FireGPGResults.ERROR_INIT_FAILLED - There is a problem with GPG, impossible to execute the executable.
*/
-const RESULT_SUCCESS = 0;
-const RESULT_CANCEL = 1;
-const RESULT_ERROR_UNKNOW = 2;
-const RESULT_ERROR_PASSWORD = 3;
-const RESULT_ERROR_NO_DATA = 4;
-const RESULT_ERROR_ALREADY_SIGN = 5;
-const RESULT_ERROR_BAD_SIGN = 5;
-const RESULT_ERROR_NO_KEY = 6;
-const RESULT_ERROR_ALREADY_CRYPT = 7;
-const RESULT_ERROR_NO_GPG_DATA = 7;
-const RESULT_ERROR_INIT_FAILLED = 8;
+const FireGPGResults = {
+ SUCCESS: 0,
+ CANCEL: 1,
+ ERROR_UNKNOW: 2,
+ ERROR_PASSWORD: 3,
+ ERROR_NO_DATA: 4,
+ ERROR_ALREADY_SIGN: 5,
+ ERROR_BAD_SIGN: 5,
+ ERROR_NO_KEY: 6,
+ ERROR_ALREADY_CRYPT: 7,
+ ERROR_NO_GPG_DATA: 7,
+ ERROR_INIT_FAILLED: 8
+}
/*
- Function: GPGReturn
+ Function: FireGPG_GPGReturn
This function return a basic object, with variable to return informations about a FireGPG's operation
@@ -84,18 +86,18 @@ const RESULT_ERROR_INIT_FAILLED = 8;
encrypted - The encrypted data with GnuPG
decrypted - The decrypted data with GnuPG
signed - The signed data with GnuPG
- signsresults - An array with <GPGReturn> data for each sign's result in the data.
+ signsresults - An array with <FireGPG_GPGReturn> data for each sign's result in the data.
signresult - The sign result for the first sign (or the current sign if we're in the signsresults array)
signresulttext - The message for the result of the test on the first sign (or the current sign if we're in the signsresults array)
signresultuser - The username of the key of the first sign (or the current sign if we're in the signsresults array)
signresultdate - The date of the first sign (or the current sign if we're in the signsresults array)
- keylist - An array of <GPGKey> with the key of the specified keyring (private or public)
+ keylist - An array of <FireGPG_GPGKey> with the key of the specified keyring (private or public)
exported - The exported key with GnuPG
messagetext - The message who is showed in the lasted alert (usefull when the silent mode is activated)
*/
-function GPGReturn() {
+function FireGPG_GPGReturn() {
this.result = null;
this.ouput = null;
@@ -115,7 +117,7 @@ function GPGReturn() {
}
/*
- Function: GPGKey
+ Function: FireGPG_GPGKey
This function return a basic object, who represent a PGP key
@@ -127,14 +129,14 @@ function GPGReturn() {
keyExpi - The key's expire date
keyDate - The key's creation date (ou de la signature)
keyId - The key's id
- subKeys - An array of <GPGKey> with the subkey of the key.
+ subKeys - An array of <FireGPG_GPGKey> with the subkey of the key.
expired - True if the key is expired
revoked - True if the key is revoked
keyTrust - Trust of the key
fingerPrint - The fingerprint of the ey
*/
-function GPGKey() {
+function FireGPG_GPGKey() {
this.keyName = null;
this.keyExpi = null;
this.keyDate = null;
@@ -149,9 +151,9 @@ function GPGKey() {
}
/*
- Function: Sortage
+ Function: FireGPG_Sortage
- This is a function used to sort an array of <GPGKey> by the key name
+ This is a function used to sort an array of <FireGPG_GPGKey> by the key name
Use it like this : thearray.sort(Sortage)
Parameters:
@@ -159,7 +161,7 @@ function GPGKey() {
b - Internal
*/
-function Sortage(a,b) {
+function FireGPG_Sortage(a,b) {
var x = a.keyName.toLowerCase();
var y = b.keyName.toLowerCase();
@@ -191,7 +193,7 @@ var FireGPG = {
Function: sign
Function to sign a text.
- Return a <GPGReturn> object.
+ Return a <FireGPG_GPGReturn> object.
Parameters:
slient - _Optional_, default to false. Set this to true to disable any alert for the user
@@ -208,7 +210,7 @@ var FireGPG = {
*/
sign: function(silent, text, keyID, password, notClear, autoSelectPrivate, wrap, fileMode, fileFrom, fileTo) {
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
if (silent == undefined)
silent = false;
@@ -244,7 +246,7 @@ var FireGPG = {
}
if (fileFrom == null | fileFrom == '') {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
@@ -283,15 +285,15 @@ var FireGPG = {
} else {
fileTo = fileFrom + '.sig';
- removeFile(fileTo); //If the already exist
+ FireGPGMisc.removeFile(fileTo); //If the already exist
}
if (fileTo == null | fileTo == '') {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
- removeFile(fileTo);
+ FireGPGMisc.removeFile(fileTo);
}
}
@@ -300,7 +302,7 @@ var FireGPG = {
// GPG verification
var gpgTest = FireGPG.selfTest(silent);
- if(gpgTest.result != RESULT_SUCCESS) {
+ if(gpgTest.result != FireGPGResults.SUCCESS) {
returnObject.result = gpgTest.result;
return returnObject;
}
@@ -308,7 +310,7 @@ var FireGPG = {
if ((text == undefined || text == null) && !fileMode) {
var autoSetMode = true;
- text = Selection.get();
+ text = FireGPG_Selection.get();
//Vu que c'est peut etre un webmail, on passe dans l'autowrap
@@ -324,7 +326,7 @@ var FireGPG = {
returnObject.messagetext = i18n.getString("noData");
- returnObject.result = RESULT_ERROR_NO_DATA;
+ returnObject.result = FireGPGResults.ERROR_NO_DATA;
return returnObject;
}
@@ -332,32 +334,32 @@ var FireGPG = {
if (tryPosition != -1 && !fileMode) {
if (!silent && !confirm(i18n.getString("alreadySign"))) {
- returnObject.result = RESULT_ERROR_ALREADY_SIGN;
+ returnObject.result = FireGPGResults.ERROR_ALREADY_SIGN;
return returnObject;
}
}
// Needed for a sign
if (keyID == undefined || keyID == null) {
- keyID = getSelfKey(autoSelectPrivate);
+ keyID = FireGPGMisc.getSelfKey(autoSelectPrivate);
}
if(keyID == null) {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
- if (!isGpgAgentActivated() && (password == undefined || password == null)) {
- password = getPrivateKeyPassword();
+ if (!FireGPG_isGpgAgentActivated() && (password == undefined || password == null)) {
+ password = FireGPGMisc.getPrivateKeyPassword();
}
- if(!isGpgAgentActivated() && password == null) {
- returnObject.result = RESULT_CANCEL;
+ if(!FireGPG_isGpgAgentActivated() && password == null) {
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
// We get the result
- var result = this.GPGAccess.sign(text, password, keyID, notClear, fileMode, fileFrom, fileTo);
+ var result = this.FireGPGGPGAccess.sign(text, password, keyID, notClear, fileMode, fileFrom, fileTo);
returnObject.sdOut = result.sdOut;
returnObject.output = result.output;
@@ -369,9 +371,9 @@ var FireGPG = {
returnObject.messagetext = i18n.getString("signFailedPassword");
- eraseSavedPassword();
+ FireGPGMisc.eraseSavedPassword();
- returnObject.result = RESULT_ERROR_PASSWORD;
+ returnObject.result = FireGPGResults.ERROR_PASSWORD;
return returnObject;
}
@@ -381,20 +383,20 @@ var FireGPG = {
alert(i18n.getString("signFailed") + "\n" + result.sdOut);
returnObject.messagetext = i18n.getString("signFailed" + "\n" + result.sdOut);
- eraseSavedPassword();
- returnObject.result = RESULT_ERROR_UNKNOW;
+ FireGPGMisc.eraseSavedPassword();
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
}
if (autoSetMode) {
// We test if the selection is editable :
- if(Selection.isEditable()) {
+ if(FireGPG_Selection.isEditable()) {
// If yes, we edit this selection with the new text
- Selection.set(result.output);
+ FireGPG_Selection.set(result.output);
}
else //Else, we show a windows with the result
- showText(result.output);
+ FireGPGMisc.showText(result.output);
}
if (fileMode) {
@@ -403,7 +405,7 @@ var FireGPG = {
returnObject.signed = result.output;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
},
@@ -425,7 +427,7 @@ var FireGPG = {
Function: listKeys
Who return a list of key in the keyring
- Return a <GPGReturn> object.
+ Return a <FireGPG_GPGReturn> object.
Parameters:
onlyPrivate - _Optional_, default to false. Set this to true to get only the private keys.
@@ -435,7 +437,7 @@ var FireGPG = {
*/
listKeys: function(onlyPrivate, allKeys, onlySignOfThisKey) {
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
this.initGPGACCESS();
var i18n = document.getElementById("firegpg-strings");
@@ -443,7 +445,7 @@ var FireGPG = {
// GPG verification
var gpgTest = FireGPG.selfTest();
- if(gpgTest.result != RESULT_SUCCESS) {
+ if(gpgTest.result != FireGPGResults.SUCCESS) {
returnObject.result = gpgTest.result;
return returnObject;
}
@@ -452,12 +454,12 @@ var FireGPG = {
if (onlySignOfThisKey == undefined)
- var result = this.GPGAccess.listkey(onlyPrivate);
+ var result = this.FireGPGGPGAccess.listkey(onlyPrivate);
else
- var result = this.GPGAccess.listsigns(onlySignOfThisKey);
+ var result = this.FireGPGGPGAccess.listsigns(onlySignOfThisKey);
// We get informations from GPG
- result = EnigConvertGpgToUnicode(result.sdOut);
+ result = FireGPGMisc.EnigConvertGpgToUnicode(result.sdOut);
returnObject.sdOut = result;
@@ -520,9 +522,15 @@ var FireGPG = {
} else {
var keyId = infos[4];
- tmpDate = new Date(),
- tmpDate.setTime(infos[5] * 1000);
- var keyDate = tmpDate.getFullYear() +'-' + (tmpDate.getMonth() +1 )+ '-' +tmpDate.getDate();
+
+ tmpDate = new Date();
+
+ if (infos[5].indexOf('-') < 1) {
+ tmpDate.setTime(infos[5] * 1000);
+ var keyDate = tmpDate.getFullYear() +'-' + (tmpDate.getMonth() +1 )+ '-' +tmpDate.getDate();
+ } else {
+ var keyDate = infos[5];
+ }
if (infos[6] != "") {
tmpDate.setTime(infos[6] * 1000);
@@ -538,7 +546,7 @@ var FireGPG = {
var keyName = infos[9].replace(/\\e3A/g, ":");
- var theKey = new GPGKey();
+ var theKey = new FireGPG_GPGKey();
theKey.keyDate = keyDate;
theKey.keyExpi = keyExpi;
@@ -599,11 +607,11 @@ var FireGPG = {
}
// Sorts keys
- returnObject.keylist = returnObject.keylist.sort(Sortage);
+ returnObject.keylist = returnObject.keylist.sort(FireGPG_Sortage);
for (var i = 0; i < returnObject.keylist.length; i++)
- returnObject.keylist[i].subKeys = returnObject.keylist[i].subKeys.sort(Sortage);
+ returnObject.keylist[i].subKeys = returnObject.keylist[i].subKeys.sort(FireGPG_Sortage);
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
},
@@ -612,7 +620,7 @@ var FireGPG = {
Function: kimport
Function to import a sign.
- Return a <GPGReturn> object.
+ Return a <FireGPG_GPGReturn> object.
Parameters:
slient - _Optional_, default to false. Set this to true to disable any alert for the user
@@ -621,7 +629,7 @@ var FireGPG = {
*/
kimport: function(silent, text, passSecurity) {
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
if (silent == undefined)
silent = false;
@@ -635,13 +643,13 @@ var FireGPG = {
// GPG verification
var gpgTest = FireGPG.selfTest(silent);
- if(gpgTest.result != RESULT_SUCCESS) {
+ if(gpgTest.result != FireGPGResults.SUCCESS) {
returnObject.result = gpgTest.result;
return returnObject;
}
if (text == undefined || text == null)
- text = Selection.get();
+ text = FireGPG_Selection.get();
if (text == "") {
if (!silent)
@@ -649,7 +657,7 @@ var FireGPG = {
returnObject.messagetext = i18n.getString("noData");
- returnObject.result = RESULT_ERROR_NO_DATA;
+ returnObject.result = FireGPGResults.ERROR_NO_DATA;
return returnObject;
}
@@ -662,7 +670,7 @@ var FireGPG = {
alert(i18n.getString("noGPGData"));
returnObject.messagetext = i18n.getString("noGPGData");
- returnObject.result = RESULT_ERROR_NO_GPG_DATA;
+ returnObject.result = FireGPGResults.ERROR_NO_GPG_DATA;
return returnObject;
}
@@ -670,7 +678,7 @@ var FireGPG = {
text = text.substring(firstPosition,lastPosition + ("-----END PGP PUBLIC KEY BLOCK-----").length);
// We get the result
- var result = this.GPGAccess.kimport(text);
+ var result = this.FireGPGGPGAccess.kimport(text);
returnObject.sdOut = result.sdOut;
@@ -679,7 +687,7 @@ var FireGPG = {
alert(i18n.getString("importFailed") + "\n" + result.sdOut);
returnObject.messagetext = i18n.getString("importFailed") + "\n" + result.sdOut;
- returnObject.result = RESULT_ERROR_UNKNOW;
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
} else {
@@ -687,7 +695,7 @@ var FireGPG = {
alert(i18n.getString("importOk"));
returnObject.messagetext = i18n.getString("importOk");
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
}
@@ -698,14 +706,14 @@ var FireGPG = {
Function: kexport
Function to export a key
- Return a <GPGReturn> object.
+ Return a <FireGPG_GPGReturn> object.
Parameters:
slient - _Optional_, default to false. Set this to true to disable any alert for the user
keyID - _Optional_, if not set use ask the user. The public keyID to export
*/
kexport: function(silent, keyID) {
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
if (silent == undefined)
silent = false;
@@ -716,24 +724,24 @@ var FireGPG = {
// GPG verification
var gpgTest = FireGPG.selfTest(silent);
- if(gpgTest.result != RESULT_SUCCESS) {
+ if(gpgTest.result != FireGPGResults.SUCCESS) {
returnObject.result = gpgTest.result;
return returnObject;
}
// Needed for a crypt
if (keyID == undefined || keyID == null)
- keyID = choosePublicKey();
+ keyID = FireGPGMisc.choosePublicKey();
if(keyID == null) {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
keyID = keyID[0];
- var result = this.GPGAccess.kexport(keyID);
+ var result = this.FireGPGGPGAccess.kexport(keyID);
returnObject.sdOut = result.sdOut;
@@ -743,14 +751,14 @@ var FireGPG = {
alert(i18n.getString("exportFailed"));
returnObject.messagetext = i18n.getString("exportFailed");
- returnObject.result = RESULT_ERROR_UNKNOW;
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
} else {
if (!silent)
- showText(result.sdOut);
+ FireGPGMisc.showText(result.sdOut);
returnObject.exported = result.sdOut;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
}
},
@@ -759,7 +767,7 @@ var FireGPG = {
Function: crypt
Function to encrypt a text.
- Return a <GPGReturn> object.
+ Return a <FireGPG_GPGReturn> object.
Parameters:
slient - _Optional_, default to false. Set this to true to disable any alert for the user
@@ -776,7 +784,7 @@ var FireGPG = {
*/
crypt: function(silent, text, keyIdList, fromGpgAuth, binFileMode, autoSelect, symetrical, password, fileMode, fileFrom, fileTo) {
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
if (silent == undefined)
silent = false;
@@ -805,7 +813,7 @@ var FireGPG = {
}
if (fileFrom == null | fileFrom == '') {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
@@ -839,11 +847,11 @@ var FireGPG = {
}
if (fileTo == null | fileTo == '') {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
- removeFile(fileTo);
+ FireGPGMisc.removeFile(fileTo);
}
}
@@ -851,7 +859,7 @@ var FireGPG = {
// GPG verification
var gpgTest = FireGPG.selfTest(silent);
- if(gpgTest.result != RESULT_SUCCESS) {
+ if(gpgTest.result != FireGPGResults.SUCCESS) {
returnObject.result = gpgTest.result;
return returnObject;
}
@@ -862,7 +870,7 @@ var FireGPG = {
if ((text == undefined || text == null) && !fileMode) {
var autoSetMode = true;
- text = Selection.get();
+ text = FireGPG_Selection.get();
}
if (text == "" && !fileMode) {
@@ -870,7 +878,7 @@ var FireGPG = {
alert(i18n.getString("noData"));
returnObject.messagetext = i18n.getString("noData");
- returnObject.result = RESULT_ERROR_NO_DATA;
+ returnObject.result = FireGPGResults.ERROR_NO_DATA;
return returnObject;
}
@@ -879,18 +887,18 @@ var FireGPG = {
if (tryPosition != -1 && !fileMode) {
if (!silent && !confirm(i18n.getString("alreadyCrypt"))) {
- returnObject.result = RESULT_ERROR_ALREADY_CRYPT;
+ returnObject.result = FireGPGResults.ERROR_ALREADY_CRYPT;
return returnObject;
}
}
// Needed for a sign
if ((keyIdList == undefined || keyIdList == null) && !symetrical) {
- keyIdList = choosePublicKey(autoSelect);
+ keyIdList = FireGPGMisc.choosePublicKey(autoSelect);
}
if(keyIdList == null && !symetrical) {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
@@ -899,11 +907,22 @@ var FireGPG = {
if (password == undefined || password == null) {
- password = getPrivateKeyPassword(false,false,i18n.getString("symetricalPass") + ":", true);
+ password = FireGPGMisc.getPrivateKeyPassword(false,false,i18n.getString("symetricalPass") + ":", true);
+
+ password2 = FireGPGMisc.getPrivateKeyPassword(false,false,i18n.getString("symetricalPass2") + ":", true);
+
+ if (password2 != password) {
+
+ if (!silent)
+ alert(i18n.getString("differentPassword"));
+
+ returnObject.result = FireGPGResults.CANCEL;
+ return returnObject;
+ }
}
if(password == null || password == "") {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
@@ -921,9 +940,9 @@ var FireGPG = {
// We get the result
if (!symetrical)
- var result = this.GPGAccess.crypt(text, keyIdList,fromGpgAuth,binFileMode, fileMode, fileFrom, fileTo);
+ var result = this.FireGPGGPGAccess.crypt(text, keyIdList,fromGpgAuth,binFileMode, fileMode, fileFrom, fileTo);
else
- var result = this.GPGAccess.symetric(text, password, algo, fileMode, fileFrom, fileTo);
+ var result = this.FireGPGGPGAccess.symetric(text, password, algo, fileMode, fileFrom, fileTo);
returnObject.sdOut = result.sdOut;
@@ -938,21 +957,21 @@ var FireGPG = {
if (!silent)
alert(i18n.getString("cryptFailed") + "\n" + result.sdOut);
- eraseSavedPassword();
+ FireGPGMisc.eraseSavedPassword();
returnObject.messagetext = i18n.getString("cryptFailed") + "\n" + result.sdOut;
- returnObject.result = RESULT_ERROR_UNKNOW;
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
}
if (autoSetMode) {
// We test if the selection is editable :
- if(Selection.isEditable()) {
+ if(FireGPG_Selection.isEditable()) {
// If yes, we edit this selection with the new text
- Selection.set(result.output);
+ FireGPG_Selection.set(result.output);
}
else //Else, we show a windows with the result
- showText(result.output);
+ FireGPGMisc.showText(result.output);
}
@@ -962,7 +981,7 @@ var FireGPG = {
returnObject.encrypted = result.output;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
@@ -972,7 +991,7 @@ var FireGPG = {
Function: cryptAndSign
Function to encrypt and sign a text.
- Return a <GPGReturn> object.
+ Return a <FireGPG_GPGReturn> object.
Parameters:
slient - _Optional_, default to false. Set this to true to disable any alert for the user
@@ -990,7 +1009,7 @@ var FireGPG = {
*/
cryptAndSign: function(silent, text, keyIdList, fromGpgAuth, password, keyID, binFileMode, autoSelect, autoSelectPrivate, fileMode, fileFrom, fileTo) {
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
if (silent == undefined)
silent = false;
@@ -1019,7 +1038,7 @@ var FireGPG = {
}
if (fileFrom == null | fileFrom == '') {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
@@ -1053,11 +1072,11 @@ var FireGPG = {
}
if (fileTo == null | fileTo == '') {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
- removeFile(fileTo);
+ FireGPGMisc.removeFile(fileTo);
}
}
@@ -1065,7 +1084,7 @@ var FireGPG = {
// GPG verification
var gpgTest = FireGPG.selfTest(silent);
- if(gpgTest.result != RESULT_SUCCESS) {
+ if(gpgTest.result != FireGPGResults.SUCCESS) {
returnObject.result = gpgTest.result;
return returnObject;
}
@@ -1073,7 +1092,7 @@ var FireGPG = {
if ((text == undefined || text == null) && !fileMode) {
var autoSetMode = true;
- text = Selection.get();
+ text = FireGPG_Selection.get();
}
if (text == "" && !fileMode) {
@@ -1081,7 +1100,7 @@ var FireGPG = {
alert(i18n.getString("noData"));
returnObject.messagetext = i18n.getString("noData");
- returnObject.result = RESULT_ERROR_NO_DATA;
+ returnObject.result = FireGPGResults.ERROR_NO_DATA;
return returnObject;
}
@@ -1089,42 +1108,42 @@ var FireGPG = {
if (tryPosition != -1 && !fileMode) {
if (!silent && !confirm(i18n.getString("alreadyCrypt"))) {
- returnObject.result = RESULT_ERROR_ALREADY_CRYPT;
+ returnObject.result = FireGPGResults.ERROR_ALREADY_CRYPT;
return returnObject;
}
}
// Needed for a sign
if (keyIdList == undefined || keyIdList == null) {
- keyIdList = choosePublicKey(autoSelect);
+ keyIdList = FireGPGMisc.choosePublicKey(autoSelect);
}
if(keyIdList == null) {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
// Needed for a sign
if (keyID == undefined || keyID == null) {
- keyID = getSelfKey(autoSelectPrivate);
+ keyID = FireGPGMisc.getSelfKey(autoSelectPrivate);
}
if(keyID == null) {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
- if (!isGpgAgentActivated() && (password == undefined || password == null)) {
- password = getPrivateKeyPassword();
+ if (!FireGPG_isGpgAgentActivated() && (password == undefined || password == null)) {
+ password = FireGPGMisc.getPrivateKeyPassword();
}
- if(!isGpgAgentActivated() &&password == null) {
- returnObject.result = RESULT_CANCEL;
+ if(!FireGPG_isGpgAgentActivated() &&password == null) {
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
// We get the result
- var result = this.GPGAccess.cryptAndSign(text, keyIdList,fromGpgAuth, password, keyID, binFileMode, fileMode, fileFrom, fileTo);
+ var result = this.FireGPGGPGAccess.cryptAndSign(text, keyIdList,fromGpgAuth, password, keyID, binFileMode, fileMode, fileFrom, fileTo);
returnObject.sdOut = result.sdOut;
@@ -1136,9 +1155,9 @@ var FireGPG = {
if (!silent)
alert(i18n.getString("cryptAndSignFailedPass"));
- eraseSavedPassword();
+ FireGPGMisc.eraseSavedPassword();
returnObject.messagetext = i18n.getString("cryptAndSignFailedPass");
- returnObject.result = RESULT_ERROR_PASSWORD;
+ returnObject.result = FireGPGResults.ERROR_PASSWORD;
return returnObject;
}
@@ -1147,21 +1166,21 @@ var FireGPG = {
if (!silent)
alert(i18n.getString("cryptAndSignFailed") + "\n" + result.sdOut);
- eraseSavedPassword();
+ FireGPGMisc.eraseSavedPassword();
returnObject.messagetext = i18n.getString("cryptAndSignFailed") + "\n" + result.sdOut;
- returnObject.result = RESULT_ERROR_UNKNOW;
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
}
if (autoSetMode) {
// We test if the selection is editable :
- if(Selection.isEditable()) {
+ if(FireGPG_Selection.isEditable()) {
// If yes, we edit this selection with the new text
- Selection.set(result.output);
+ FireGPG_Selection.set(result.output);
}
else //Else, we show a windows with the result
- showText(result.output);
+ FireGPGMisc.showText(result.output);
}
@@ -1171,7 +1190,7 @@ var FireGPG = {
returnObject.encrypted = result.output;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
@@ -1181,7 +1200,7 @@ var FireGPG = {
Function: verify
Function to verify signs in a text.
- Return a <GPGReturn> object.
+ Return a <FireGPG_GPGReturn> object.
Parameters:
slient - _Optional_, default to false. Set this to true to disable any alert for the user
@@ -1196,7 +1215,7 @@ var FireGPG = {
*/
verify: function(silent, text, charset, signData, fileMode, fileFrom, fileSig, fileDataForSign, fromDTA) {
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
if (silent == undefined)
silent = false;
@@ -1229,7 +1248,7 @@ var FireGPG = {
}
if (fileFrom == null | fileFrom == '') {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
@@ -1237,7 +1256,7 @@ var FireGPG = {
if (fileSig == undefined && fileDataForSign == undefined) {
- if (fileExist(fileFrom + '.sig')) {
+ if (FireGPGMisc.fileExist(fileFrom + '.sig')) {
if (confirm(i18n.getString('sigFoundSelectAFile'))) {
@@ -1262,7 +1281,7 @@ var FireGPG = {
}
if (fileSig == null | fileSig == '') {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
@@ -1275,7 +1294,7 @@ var FireGPG = {
// GPG verification
var gpgTest = FireGPG.selfTest(silent);
- if(gpgTest.result != RESULT_SUCCESS) {
+ if(gpgTest.result != FireGPGResults.SUCCESS) {
returnObject.result = gpgTest.result;
return returnObject;
}
@@ -1283,7 +1302,7 @@ var FireGPG = {
if ((text == undefined || text == null) && !fileMode ) {
var autoSetMode = true;
- text = Selection.get();
+ text = FireGPG_Selection.get();
}
if (text == "" && !fileMode) {
@@ -1291,7 +1310,7 @@ var FireGPG = {
alert(i18n.getString("noData"));
returnObject.messagetext = i18n.getString("noData");
- returnObject.result = RESULT_ERROR_NO_DATA;
+ returnObject.result = FireGPGResults.ERROR_NO_DATA;
return returnObject;
}
@@ -1312,7 +1331,7 @@ var FireGPG = {
alert(i18n.getString("noGPGData"));
returnObject.messagetext = i18n.getString("noGPGData");
- returnObject.result = RESULT_ERROR_NO_GPG_DATA;
+ returnObject.result = FireGPGResults.ERROR_NO_GPG_DATA;
return returnObject;
}
else {
@@ -1326,11 +1345,11 @@ var FireGPG = {
result = results[rid];
- if (result.result == RESULT_ERROR_UNKNOW)
+ if (result.result == FireGPGResults.ERROR_UNKNOW)
resulttxt += i18n.getString("verifFailed") + "\n";
- else if (result.result == RESULT_ERROR_BAD_SIGN)
+ else if (result.result == FireGPGResults.ERROR_BAD_SIGN)
resulttxt += i18n.getString("verifFailed") + " (" + i18n.getString("falseSign") + ")\n";
- else if (result.result == RESULT_ERROR_NO_KEY)
+ else if (result.result == FireGPGResults.ERROR_NO_KEY)
resulttxt += i18n.getString("verifFailed") + " (" + i18n.getString("keyNotFound") + ")\n";
else {
resulttxt += i18n.getString("verifSuccess") + " " + result.signresulttext + "\n";
@@ -1354,7 +1373,7 @@ var FireGPG = {
returnObject.notTrusted = results[0].notTrusted;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
@@ -1365,7 +1384,7 @@ var FireGPG = {
Function: layers
Find each layer of a test and verify it (resurcise function)
- Return an array of resultss <GPGReturn> object.
+ Return an array of resultss <FireGPG_GPGReturn> object.
Parameters:
text - The text to verify
@@ -1443,7 +1462,7 @@ var FireGPG = {
Function: layerverify
Internal, verify a part of a test.
- Return a <GPGReturn> object.
+ Return a <FireGPG_GPGReturn> object.
Parameters:
text - The text to verify
@@ -1459,7 +1478,7 @@ var FireGPG = {
fromDTA - _Optional_. True if called form DTA
*/
layerverify: function(text,layer,division, charset,dontask, fileMode, fileFrom, fileSig, nextText, fileDataForSign, fromDTA) {
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
if (dontask == undefined)
dontask = false;
@@ -1467,12 +1486,12 @@ var FireGPG = {
// We get the result
if (nextText == undefined) {
- var result = this.GPGAccess.verify(text, charset, fileMode, fileFrom, fileSig, fileDataForSign, fromDTA);
+ var result = this.FireGPGGPGAccess.verify(text, charset, fileMode, fileFrom, fileSig, fileDataForSign, fromDTA);
if ( charset && charset.toLowerCase() == "iso-8859-1")
- result.sdOut = EnigConvertToUnicode(result.sdOut, 'UTF-8');
+ result.sdOut = FireGPGMisc.EnigConvertToUnicode(result.sdOut, 'UTF-8');
} else {
- result = new GPGReturn();
+ result = new FireGPG_GPGReturn();
result.sdOut = nextText;
}
@@ -1483,14 +1502,14 @@ var FireGPG = {
// If check failled
if(result.sdOut.indexOf("GOODSIG") == "-1") {
- returnObject.result = RESULT_ERROR_UNKNOW;
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
if(result.sdOut.indexOf("REVKEYSIG") != -1) {
returnObject.revoked = true;
}
if(result.sdOut.indexOf("BADSIG") != -1) {
- returnObject.result = RESULT_ERROR_BAD_SIGN;
+ returnObject.result = FireGPGResults.ERROR_BAD_SIGN;
testIfMore = result.sdOut.substring(result.sdOut.indexOf("BADSIG") + "BADSIG".length,result.sdOut.length);
@@ -1501,7 +1520,7 @@ var FireGPG = {
}
if(result.sdOut.indexOf("NO_PUBKEY") != -1) {
- returnObject.result = RESULT_ERROR_NO_KEY;
+ returnObject.result = FireGPGResults.ERROR_NO_KEY;
testIfMore = result.sdOut.substring(result.sdOut.indexOf("NO_PUBKEY") + "NO_PUBKEY".length,result.sdOut.length);
@@ -1560,7 +1579,7 @@ var FireGPG = {
var i18n = document.getElementById("firegpg-strings");
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
var infos2 = "";
infos = infos.split(" ");
@@ -1588,7 +1607,7 @@ var FireGPG = {
Function: decrypt
Function to decrypt a text.
- Return a <GPGReturn> object.
+ Return a <FireGPG_GPGReturn> object.
Parameters:
slient - _Optional_, default to false. Set this to true to disable any alert for the user
@@ -1601,7 +1620,7 @@ var FireGPG = {
api - _Optional_ True if it's a call form the api
*/
decrypt: function(silent, text, password, binFileEncoded, fileMode, fileFrom, fileTo, api) { try {
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
if (silent == undefined)
silent = false;
@@ -1636,7 +1655,7 @@ var FireGPG = {
}
if (fileFrom == null | fileFrom == '') {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
@@ -1670,11 +1689,11 @@ var FireGPG = {
}
if (fileTo == null | fileTo == '') {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
- removeFile(fileTo);
+ FireGPGMisc.removeFile(fileTo);
}
}
@@ -1682,7 +1701,7 @@ var FireGPG = {
// GPG verification
var gpgTest = FireGPG.selfTest(silent);
- if(gpgTest.result != RESULT_SUCCESS) {
+ if(gpgTest.result != FireGPGResults.SUCCESS) {
returnObject.result = gpgTest.result;
return returnObject;
}
@@ -1690,7 +1709,7 @@ var FireGPG = {
if ((text == undefined || text == null) && !fileMode) {
var autoSetMode = true;
- text = Selection.get();
+ text = FireGPG_Selection.get();
}
if (text == "" && !fileMode) {
@@ -1698,7 +1717,7 @@ var FireGPG = {
alert(i18n.getString("noData"));
returnObject.messagetext = i18n.getString("noData");
- returnObject.result = RESULT_ERROR_NO_DATA;
+ returnObject.result = FireGPGResults.ERROR_NO_DATA;
return returnObject;
}
@@ -1723,7 +1742,7 @@ var FireGPG = {
alert(i18n.getString("noGPGData"));
returnObject.messagetext = i18n.getString("noGPGData");
- returnObject.result = RESULT_ERROR_NO_GPG_DATA;
+ returnObject.result = FireGPGResults.ERROR_NO_GPG_DATA;
return returnObject;
}
@@ -1731,36 +1750,36 @@ var FireGPG = {
text = text.substring(firstPosition,lastPosition + ("-----END PGP MESSAGE-----").length);
// Needed for a decrypt
- if (!isGpgAgentActivated() && (password == undefined || password == null)) {
- password = getsavedPassword();
+ if (!FireGPG_isGpgAgentActivated() && (password == undefined || password == null)) {
+ password = FireGPGMisc.getsavedPassword();
if (password == null)
password = "wrongPass";
}
- if(!isGpgAgentActivated() && password == null) {
- returnObject.result = RESULT_CANCEL;
+ if(!FireGPG_isGpgAgentActivated() && password == null) {
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
// We get the result
- var result = this.GPGAccess.decrypt(text,password,binFileEncoded, fileMode, fileFrom, fileTo);
+ var result = this.FireGPGGPGAccess.decrypt(text,password,binFileEncoded, fileMode, fileFrom, fileTo);
returnObject.sdOut = result.sdOut;
returnObject.output = result.output;
if(!api && result.sdOut.indexOf("DECRYPTION_OKAY") == -1 && (result.sdOut.indexOf("BAD_PASSPHRASE") != -1 || result.sdOut.indexOf("NEED_PASSPHRASE_SYM") != -1 || result.sdOut.indexOf("NEED_PASSPHRASE_PIN") != -1)) {
if (result.sdOut.indexOf("NEED_PASSPHRASE_SYM") != -1)
- password = getPrivateKeyPassword(false, false,i18n.getString("symetricalPass") + ":", true);
+ password = FireGPGMisc.getPrivateKeyPassword(false, false,i18n.getString("symetricalPass") + ":", true);
else
- password = getPrivateKeyPassword();
+ password = FireGPGMisc.getPrivateKeyPassword();
if(password == null) {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
// We get the result
- var result = this.GPGAccess.decrypt(text,password,binFileEncoded, fileMode, fileFrom, fileTo);
+ var result = this.FireGPGGPGAccess.decrypt(text,password,binFileEncoded, fileMode, fileFrom, fileTo);
returnObject.sdOut = result.sdOut;
returnObject.output = result.output;
@@ -1772,9 +1791,9 @@ var FireGPG = {
if (!silent)
alert(i18n.getString("decryptFailedPassword"));
- eraseSavedPassword();
+ FireGPGMisc.eraseSavedPassword();
returnObject.messagetext = i18n.getString("decryptFailedPassword");
- returnObject.result = RESULT_ERROR_PASSWORD;
+ returnObject.result = FireGPGResults.ERROR_PASSWORD;
return returnObject;
}
@@ -1784,8 +1803,8 @@ var FireGPG = {
alert(i18n.getString("decryptFailed") + "\n" + result.sdOut);
returnObject.messagetext = i18n.getString("decryptFailed") + "\n" + result.sdOut;
- returnObject.result = RESULT_ERROR_UNKNOW;
- eraseSavedPassword();
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
+ FireGPGMisc.eraseSavedPassword();
return returnObject;
}
if (result.sdOut.indexOf("PLAINTEXT") != -1 && result.sdOut.indexOf("DECRYPTION_OKAY") == -1) { //Filemode produit un output en.. plaintext..
@@ -1828,7 +1847,7 @@ var FireGPG = {
for (var ii = 1; ii < infos.length; ++ii)
infos2 = infos2 + infos[ii] + " ";
- returnObject.signresult = RESULT_SUCCESS;
+ returnObject.signresult = FireGPGResults.SUCCESS;
returnObject.signresulttext = infos2 + " (" + i18n.getString("signMadeThe") + " " + date.toLocaleString() + ")";
returnObject.signresultuser = infos2;
returnObject.signresultdate = date.toLocaleString();
@@ -1839,12 +1858,12 @@ var FireGPG = {
if (autoSetMode) {
//We test is the selection in editable :
- if(Selection.isEditable()) {
+ if(FireGPG_Selection.isEditable()) {
//If yes, we edit this selection with the new text
- Selection.set(result.output,returnObject.signresulttext);
+ FireGPG_Selection.set(result.output,returnObject.signresulttext);
} else {
//Else, we show a windows with the result
- showText(result.output,undefined,undefined,undefined,returnObject.signresulttext);
+ FireGPGMisc.showText(result.output,undefined,undefined,undefined,returnObject.signresulttext);
}
}
@@ -1854,7 +1873,7 @@ var FireGPG = {
returnObject.decrypted = result.output;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
} catch (e) { alert(e) }
},
@@ -1863,17 +1882,17 @@ var FireGPG = {
/*
Function: initGPGACCESS
- Init the GPGAccess class (try to found the GnuPG's command, etc.).
+ Init the FireGPGGPGAccess class (try to found the GnuPG's command, etc.).
*/
initGPGACCESS: function() {
if(this.allreadyinit != undefined && this.allreadyinit == true)
return;
//Find the right command for Gpg
- this.GPGAccess.tryToFoundTheRightCommand();
+ this.FireGPGGPGAccess.tryToFoundTheRightCommand();
- useGPGAgent = this.GPGAccess.runATest('--no-use-agent');
- useGPGTrust = this.GPGAccess.runATest('--trust-model always');
+ useGPGAgent = this.FireGPGGPGAccess.runATest('--no-use-agent');
+ FireGPG_useGPGTrust = this.FireGPGGPGAccess.runATest('--trust-model always');
this.allreadyinit = true;
},
@@ -1884,7 +1903,7 @@ var FireGPG = {
Function: selfTest
This if are able to access to a GnuPG executable
- Return a <GPGReturn> object.
+ Return a <FireGPG_GPGReturn> object.
Parameters:
slient - _Optional_, default to false. Set this to true to disable any alert for the user
@@ -1898,18 +1917,18 @@ var FireGPG = {
// For i18n
var i18n = document.getElementById("firegpg-strings");
- if (this.GPGAccess.selfTest() == false) {
+ if (this.FireGPGGPGAccess.selfTest() == false) {
if (!silent)
alert(i18n.getString("selfTestFailled"));
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
returnObject.messagetext = i18n.getString("selfTestFailled");
- returnObject.result = RESULT_ERROR_INIT_FAILLED;
+ returnObject.result = FireGPGResults.ERROR_INIT_FAILLED;
return returnObject;
}
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_SUCCESS;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
},
@@ -1923,7 +1942,7 @@ var FireGPG = {
*/
searchKeyInServer: function(search, silent) {
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
if (silent == undefined)
silent = false;
@@ -1942,12 +1961,12 @@ var FireGPG = {
this.result == null;
// We get the result
try {
- this.result = this.GPGAccess.searchKeyInServer(this.search,getKeyServer());
+ this.result = this.FireGPGGPGAccess.searchKeyInServer(this.search,FireGPGMisc.getKeyServer());
} catch (e) { } //To be sure to close the wait_box
}
}
- backgroundTask.GPGAccess = this.GPGAccess;
+ backgroundTask.FireGPGGPGAccess = this.FireGPGGPGAccess;
backgroundTask.search = search;
var thread = Components.classes["@mozilla.org/thread-manager;1"]
@@ -1966,7 +1985,7 @@ var FireGPG = {
result = backgroundTask.result;
// We get informations from GPG
- result = EnigConvertGpgToUnicode(result.sdOut);
+ result = FireGPGMisc.EnigConvertGpgToUnicode(result.sdOut);
returnObject.sdOut = result;
@@ -2014,7 +2033,7 @@ var FireGPG = {
}
- var theKey = new GPGKey();
+ var theKey = new FireGPG_GPGKey();
theKey.keyDate = keyDate;
theKey.keyExpi = keyExpi;
@@ -2040,12 +2059,12 @@ var FireGPG = {
}
// Sorts keys
- returnObject.keylist = returnObject.keylist.sort(Sortage);
+ returnObject.keylist = returnObject.keylist.sort(FireGPG_Sortage);
for (var i = 0; i < returnObject.keylist.length; i++)
- returnObject.keylist[i].subKeys = returnObject.keylist[i].subKeys.sort(Sortage);
+ returnObject.keylist[i].subKeys = returnObject.keylist[i].subKeys.sort(FireGPG_Sortage);
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
@@ -2055,9 +2074,9 @@ var FireGPG = {
alert(document.getElementById('firegpg-strings').
getString('keyRecived'));
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
returnObject.sdOut = result.sdOut;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
} else {
@@ -2066,8 +2085,8 @@ var FireGPG = {
alert(document.getElementById('firegpg-strings').
getString('keyFetchError'));
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_ERROR_UNKNOW;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
}*/
@@ -2089,7 +2108,7 @@ var FireGPG = {
this.initGPGACCESS();
- keyId = trim(keyId);
+ keyId = FireGPGMisc.trim(keyId);
keyId = keyId.replace(/\r/gi, "");
keyId = keyId.replace(/\n/gi, "");
@@ -2104,12 +2123,12 @@ var FireGPG = {
this.result == null;
// We get the result
try {
- this.result = this.GPGAccess.retriveKeyFromServer(this.keyId,getKeyServer());
+ this.result = this.FireGPGGPGAccess.retriveKeyFromServer(this.keyId,FireGPGMisc.getKeyServer());
} catch (e) { } //To be sure to close the wait_box
}
}
- backgroundTask.GPGAccess = this.GPGAccess;
+ backgroundTask.FireGPGGPGAccess = this.FireGPGGPGAccess;
backgroundTask.keyId = keyId;
var thread = Components.classes["@mozilla.org/thread-manager;1"]
@@ -2134,9 +2153,9 @@ var FireGPG = {
alert(document.getElementById('firegpg-strings').
getString('keyRecived'));
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
returnObject.sdOut = result.sdOut;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
} else {
@@ -2145,8 +2164,8 @@ var FireGPG = {
alert(document.getElementById('firegpg-strings').
getString('keyFetchError') + '\n' + result.sdOut + '\n' + result.sdErr);
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_ERROR_UNKNOW;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
}
@@ -2180,12 +2199,12 @@ var FireGPG = {
this.result == null;
// We get the result
try {
- this.result = this.GPGAccess.sendKeyToServer(this.keyId,getKeyServer());
+ this.result = this.FireGPGGPGAccess.sendKeyToServer(this.keyId,FireGPGMisc.getKeyServer());
} catch (e) { } //To be sure to close the wait_box
}
}
- backgroundTask.GPGAccess = this.GPGAccess;
+ backgroundTask.FireGPGGPGAccess = this.FireGPGGPGAccess;
backgroundTask.keyId = keyId;
var thread = Components.classes["@mozilla.org/thread-manager;1"]
@@ -2208,9 +2227,9 @@ var FireGPG = {
if (!silent)
alert(result.sdOut);
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
returnObject.sdOut = result.sdOut;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
} else {
@@ -2219,8 +2238,8 @@ var FireGPG = {
alert(document.getElementById('firegpg-strings').getString('unknow-error'));
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_ERROR_UNKNOW;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
}
@@ -2252,12 +2271,12 @@ var FireGPG = {
this.result == null;
// We get the result
try {
- this.result = this.GPGAccess.refrechFromServer(getKeyServer());
+ this.result = this.FireGPGGPGAccess.refrechFromServer(FireGPGMisc.getKeyServer());
} catch (e) { } //To be sure to close the wait_box
}
}
- backgroundTask.GPGAccess = this.GPGAccess;
+ backgroundTask.FireGPGGPGAccess = this.FireGPGGPGAccess;
var thread = Components.classes["@mozilla.org/thread-manager;1"]
.getService(Components.interfaces.nsIThreadManager)
@@ -2279,14 +2298,14 @@ var FireGPG = {
if(!silent)
alert(document.getElementById('firegpg-strings').getString('keySync'));
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
returnObject.sdOut = result.sdOut;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
} else {
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_ERROR_UNKNOW;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
}
@@ -2312,7 +2331,7 @@ var FireGPG = {
// We get the result
- var result = this.GPGAccess.changeTrust(key, trustLevel);
+ var result = this.FireGPGGPGAccess.changeTrust(key, trustLevel);
if (result.sdOut) {
@@ -2320,9 +2339,9 @@ var FireGPG = {
if(!silent)
alert(document.getElementById('firegpg-strings').getString('trustChanged'));
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
returnObject.sdOut = result.sdOut;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
} else {
@@ -2332,8 +2351,8 @@ var FireGPG = {
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_ERROR_UNKNOW;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
}
@@ -2362,11 +2381,11 @@ var FireGPG = {
if (oldpass == undefined) {
- oldpass = getPrivateKeyPassword(false, false, i18n.getString("oldPassword"), true);
+ oldpass = FireGPGMisc.getPrivateKeyPassword(false, false, i18n.getString("oldPassword"), true);
if(oldpass == null) {
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_CANCEL;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
@@ -2374,12 +2393,12 @@ var FireGPG = {
if (newpass == undefined) {
- newpass = getPrivateKeyPassword(false, false, i18n.getString("newPassword"), true);
- newpass2 = getPrivateKeyPassword(false, false, i18n.getString("newPassword2"), false);
+ newpass = FireGPGMisc.getPrivateKeyPassword(false, false, i18n.getString("newPassword"), true);
+ newpass2 = FireGPGMisc.getPrivateKeyPassword(false, false, i18n.getString("newPassword2"), false);
if(newpass == null) {
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_CANCEL;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
@@ -2388,15 +2407,15 @@ var FireGPG = {
if (!silent)
alert(i18n.getString("changeFailledPasswordDiff"));
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_CANCEL;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
}
// We get the result
- var result = this.GPGAccess.changePassword(key, oldpass, newpass);
+ var result = this.FireGPGGPGAccess.changePassword(key, oldpass, newpass);
if(result.sdOut.indexOf("BAD_PASSPHRASE") != -1) {
@@ -2405,9 +2424,9 @@ var FireGPG = {
returnObject.messagetext = i18n.getString("changeFailledPassword");
- eraseSavedPassword();
+ FireGPGMisc.eraseSavedPassword();
- returnObject.result = RESULT_ERROR_PASSWORD;
+ returnObject.result = FireGPGResults.ERROR_PASSWORD;
return returnObject;
}
@@ -2416,9 +2435,9 @@ var FireGPG = {
if(!silent)
alert(document.getElementById('firegpg-strings').getString('passChanged'));
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
returnObject.sdOut = result.sdOut;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
@@ -2455,32 +2474,32 @@ var FireGPG = {
if(!silent)
alert(i18n.getString("need-name"));
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_ERROR_UNKNOW;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
}
if (email == "") {
if(!silent)
alert(i18n.getString("need-email"));
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_ERROR_UNKNOW;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
}
if (password1 == "") {
if(!silent)
alert(i18n.getString("need-password"));
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_ERROR_UNKNOW;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
}
if (password1 != password2) {
if(!silent)
alert(i18n.getString("changeFailledPasswordDiff"));
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_ERROR_UNKNOW;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
}
@@ -2489,24 +2508,24 @@ var FireGPG = {
if (keyexpirevalue <= 0) {
if(!silent)
alert(i18n.getString("need-expire-date"));
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_ERROR_UNKNOW;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
}
}
- var result = this.GPGAccess.genereateKey(name, email, comment, password1, keyneverexpire, keyexpirevalue, keyexpiretype, keylength, keytype);
+ var result = this.FireGPGGPGAccess.genereateKey(name, email, comment, password1, keyneverexpire, keyexpirevalue, keyexpiretype, keylength, keytype);
if (result.sdOut.indexOf("KEY_CREATED") != -1) {
if(!silent)
alert(document.getElementById('firegpg-strings').getString('keygenerated'));
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
returnObject.sdOut = result.sdOut;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
} else {
@@ -2514,8 +2533,8 @@ var FireGPG = {
if(!silent)
alert(document.getElementById('firegpg-strings').getString('unknow-error'));
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_ERROR_UNKNOW;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
}
@@ -2540,15 +2559,15 @@ var FireGPG = {
// We get the result
- var result = this.GPGAccess.deleteKey(key);
+ var result = this.FireGPGGPGAccess.deleteKey(key);
//Assume it's worked (no error message)
if(!silent)
alert(document.getElementById('firegpg-strings').getString('key-deleted'));
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
returnObject.sdOut = result.sdOut;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
},
@@ -2571,25 +2590,25 @@ var FireGPG = {
this.initGPGACCESS();
if (password == undefined || password == null) {
- password = getPrivateKeyPassword(false);
+ password = FireGPGMisc.getPrivateKeyPassword(false);
}
if(password == null) {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
// We get the result
- var result = this.GPGAccess.revokeKey(key, password, raison);
+ var result = this.FireGPGGPGAccess.revokeKey(key, password, raison);
if (result.sdOut.indexOf("GOOD_PASSPHRASE") != -1) {
if(!silent)
alert(document.getElementById('firegpg-strings').getString('keyrevoked'));
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
returnObject.sdOut = result.sdOut;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
} else {
@@ -2597,10 +2616,10 @@ var FireGPG = {
if(!silent)
alert(document.getElementById('firegpg-strings').getString('keynotrevokedpassword'));
- eraseSavedPassword();
+ FireGPGMisc.eraseSavedPassword();
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_ERROR_UNKNOW;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
}
@@ -2635,7 +2654,7 @@ var FireGPG = {
if (!silent)
alert(document.getElementById('firegpg-strings').getString('nameTooShort'));
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
@@ -2650,7 +2669,7 @@ var FireGPG = {
if (!silent)
alert(document.getElementById('firegpg-strings').getString('wrongEmail'));
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
@@ -2662,24 +2681,24 @@ var FireGPG = {
this.initGPGACCESS();
if (password == undefined || password == null) {
- password = getPrivateKeyPassword(false);
+ password = FireGPGMisc.getPrivateKeyPassword(false);
}
if(password == null) {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
- var result = this.GPGAccess.addUid(key, name, email, comment, password);
+ var result = this.FireGPGGPGAccess.addUid(key, name, email, comment, password);
if (result.sdOut.indexOf("GOOD_PASSPHRASE") != -1) {
if(!silent)
alert(document.getElementById('firegpg-strings').getString('uidadded'));
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
returnObject.sdOut = result.sdOut;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
} else {
@@ -2687,10 +2706,10 @@ var FireGPG = {
if(!silent)
alert(document.getElementById('firegpg-strings').getString('uidnotadded'));
- eraseSavedPassword();
+ FireGPGMisc.eraseSavedPassword();
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_ERROR_UNKNOW;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
}
},
@@ -2713,25 +2732,25 @@ var FireGPG = {
this.initGPGACCESS();
if (password == undefined || password == null) {
- password = getPrivateKeyPassword(false);
+ password = FireGPGMisc.getPrivateKeyPassword(false);
}
if(password == null) {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
// We get the result
- var result = this.GPGAccess.revokeUid(key, uid, password, 4);
+ var result = this.FireGPGGPGAccess.revokeUid(key, uid, password, 4);
if (result.sdOut.indexOf("GOOD_PASSPHRASE") != -1) {
if(!silent)
alert(document.getElementById('firegpg-strings').getString('uidrevoked'));
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
returnObject.sdOut = result.sdOut;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
} else {
@@ -2739,10 +2758,10 @@ var FireGPG = {
if(!silent)
alert(document.getElementById('firegpg-strings').getString('uidnotrevokedpassword'));
- eraseSavedPassword();
+ FireGPGMisc.eraseSavedPassword();
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_ERROR_UNKNOW;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
}
@@ -2768,15 +2787,15 @@ var FireGPG = {
// We get the result
- var result = this.GPGAccess.delUid(key, uid);
+ var result = this.FireGPGGPGAccess.delUid(key, uid);
//Assume it's worked
if(!silent)
alert(document.getElementById('firegpg-strings').getString('uiddeleted'));
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
returnObject.sdOut = result.sdOut;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
@@ -2804,26 +2823,26 @@ var FireGPG = {
// Needed for a sign
if (keyForSign == undefined || keyForSign == null) {
- keyForSign = getSelfKey();
+ keyForSign = FireGPGMisc.getSelfKey();
}
if(keyForSign == null) {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
if (password == undefined || password == null) {
- password = getPrivateKeyPassword();
+ password = FireGPGMisc.getPrivateKeyPassword();
}
if(password == null) {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
// We get the result
- var result = this.GPGAccess.signKey(key, keyForSign, password);
+ var result = this.FireGPGGPGAccess.signKey(key, keyForSign, password);
///
if (result.sdOut.indexOf("ALREADY_SIGNED") != -1) {
@@ -2831,8 +2850,8 @@ var FireGPG = {
if(!silent)
alert(document.getElementById('firegpg-strings').getString('erroralreadysigned'));
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_ERROR_UNKNOW;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
@@ -2842,9 +2861,9 @@ var FireGPG = {
if(!silent)
alert(document.getElementById('firegpg-strings').getString('okkeysigned'));
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
returnObject.sdOut = result.sdOut;
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
return returnObject;
} else {
@@ -2852,10 +2871,10 @@ var FireGPG = {
if(!silent)
alert(document.getElementById('firegpg-strings').getString('errorkeynosignedpassword'));
- eraseSavedPassword();
+ FireGPGMisc.eraseSavedPassword();
- var returnObject = new GPGReturn();
- returnObject.result = RESULT_ERROR_UNKNOW;
+ var returnObject = new FireGPG_GPGReturn();
+ returnObject.result = FireGPGResults.ERROR_UNKNOW;
return returnObject;
}
@@ -2878,16 +2897,16 @@ var FireGPG = {
this.initGPGACCESS();
- var returnObject = new GPGReturn();
+ var returnObject = new FireGPG_GPGReturn();
//This values must be given ...
if(hash == null || hash == undefined) {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
if(file == null || file == undefined) {
- returnObject.result = RESULT_CANCEL;
+ returnObject.result = FireGPGResults.CANCEL;
return returnObject;
}
@@ -2896,12 +2915,12 @@ var FireGPG = {
this.result == null;
// We get the result
try {
- this.result = result = this.GPGAccess.computeHash(this.hash,this.file);
+ this.result = result = this.FireGPGGPGAccess.computeHash(this.hash,this.file);
} catch (e) { } //To be sure to close the wait_box
}
}
- backgroundTask.GPGAccess = this.GPGAccess;
+ backgroundTask.FireGPGGPGAccess = this.FireGPGGPGAccess;
backgroundTask.hash = hash;
backgroundTask.file = file;
@@ -2926,7 +2945,7 @@ var FireGPG = {
if (!silent)
alert(tmpHash);
- returnObject.result = RESULT_SUCCESS;
+ returnObject.result = FireGPGResults.SUCCESS;
returnObject.sdOut = result.sdOut;
returnObject.output = tmpHash;
@@ -2936,12 +2955,14 @@ var FireGPG = {
}
-var okWait;
+
+
+var FireGPG_okWait; // ???
// We load the good class for the OS
-FireGPG.GPGAccess = Witch_GPGAccess();
-FireGPG.GPGAccess.parent = FireGPG;
+FireGPG.FireGPGGPGAccess = Witch_FireGPGGPGAccess();
+FireGPG.FireGPGGPGAccess.parent = FireGPG;
//Test if we have to show the 'what is new ?'
//We wait 3 sec.
-setTimeout("testIfSomethingsIsNew()",3000);
+setTimeout("FireGPGMisc.testIfSomethingsIsNew()",3000);
diff --git a/content/Core/cgpgaccess.js b/content/Core/cgpgaccess.js
index 6512b5d..63c5d46 100644
--- a/content/Core/cgpgaccess.js
+++ b/content/Core/cgpgaccess.js
@@ -41,23 +41,23 @@ under the terms of any one of the MPL, the GPL or the LGPL.
/* Constant: nsIExtensionManager_CONRACTID
The component id to manage extentions */
-const nsIExtensionManager_CONRACTID = "@mozilla.org/extensions/manager;1";
+const FireGPG_nsIExtensionManager_CONRACTID = "@mozilla.org/extensions/manager;1";
/* Constant: NS_APPINFO_CONTRACTID
The component id to test the current os */
-const NS_APPINFO_CONTRACTID = "@mozilla.org/xre/app-info;1";
+const FireGPG_NS_APPINFO_CONTRACTID = "@mozilla.org/xre/app-info;1";
/* Constant: FireGPG_OS
The component to test the current os. */
-const FireGPG_OS = Components.classes[NS_APPINFO_CONTRACTID].getService(Components.interfaces.nsIXULRuntime).OS;
+const FireGPG_OS = Components.classes[FireGPG_NS_APPINFO_CONTRACTID].getService(Components.interfaces.nsIXULRuntime).OS;
/* Constant: OS_WINDOWS
The value retruned by components if the os is window */
-const OS_WINDOWS = "WINNT";
+const FireGPG_OS_WINDOWS = "WINNT";
/* Constant: idAppli
The id of firegpg. */
-const idAppli = "firegpg@firegpg.team";
+const FireGPG_idAppli = "firegpg@firegpg.team";
/*
Constants: States of the xpcom support. Deprecated
@@ -67,7 +67,7 @@ const idAppli = "firegpg@firegpg.team";
XPCOM_STATE_DONTWORK - The xpcom doesn't work.
XPCOM_STATE_DISABLED - The xpcom is disabled
XPCOM_STATE_DONTWORK_IN_0_5 - The xpcom of version 0.5 doesn't work.
-*/
+
const XPCOM_STATE_DONTWORK_IN_0_5 = 2;
const XPCOM_STATE_DISABLED_IN_0_5 = 3;
@@ -76,62 +76,61 @@ const XPCOM_STATE_NEVERTESTED = 0;
const XPCOM_STATE_WORKS = 1;
const XPCOM_STATE_DONTWORK = 2;
const XPCOM_STATE_DISABLED = 3;
+*/
/* Constant: comment
The firegpg's comment to add to gnupg texts. */
-const comment = "Use{$SPACE}GnuPG{$SPACE}with{$SPACE}Firefox{$SPACE}:{$SPACE}http://getfiregpg.org{$SPACE}(Version:{$SPACE}" + FIREGPG_VERSION + ")";
+const FireGPG_comment = "Use{$SPACE}GnuPG{$SPACE}with{$SPACE}Firefox{$SPACE}:{$SPACE}http://getfiregpg.org{$SPACE}(Version:{$SPACE}" + FIREGPG_VERSION + ")";
/*
Variable: useGPGTrust
If we have to disable trusting system of gnupg. Set in cGpg.
*/
-var useGPGTrust = true;
+var FireGPG_useGPGTrust = true;
-var file = Components.classes["@mozilla.org/file/directory_service;1"].
- getService(Components.interfaces.nsIProperties).
- get("CurProcD", Components.interfaces.nsIFile);
-
/* Variable: FGPGFireFoxCurrentFolder
The folder of Firefox
*/
-var FGPGFireFoxCurrentFolder = file.path;
+var FGPGFireFoxCurrentFolder = Components.classes["@mozilla.org/file/directory_service;1"].
+ getService(Components.interfaces.nsIProperties).
+ get("CurProcD", Components.interfaces.nsIFile).path;
/*
- Function: Witch_GPGAccess
+ Function: Witch_FireGPGGPGAccess
This function will determing and 'build' the class to access gpg.
She test if the xpcom is usable, update information about the status, and select the rights function to access to gnupg as the current situtation.
- She return the GPGAccess class.
+ She return the FireGPGGPGAccess class.
*/
-function Witch_GPGAccess () {
+function Witch_FireGPGGPGAccess () {
- if (loadXpcom()) {
+ if (FireGPG_loadXpcom()) {
- if (GPGAccess.isUnix()) {
+ if (FireGPGGPGAccess.isUnix()) {
- GPGAccess.tryToFoundTheRightCommand = GPGAccessUnixXpcom.tryToFoundTheRightCommand;
+ FireGPGGPGAccess.tryToFoundTheRightCommand = FireGPGGPGAccessUnixXpcom.tryToFoundTheRightCommand;
} else {
- GPGAccess.tryToFoundTheRightCommand = GPGAccessWindowsXpcom.tryToFoundTheRightCommand;
+ FireGPGGPGAccess.tryToFoundTheRightCommand = FireGPGGPGAccessWindowsXpcom.tryToFoundTheRightCommand;
}
- return GPGAccess;
+ return FireGPGGPGAccess;
} else {
var i18n = document.getElementById("firegpg-strings");
alert(i18n.getString('noipc2'));
- return GPGAccess;
+ return FireGPGGPGAccess;
}
}
@@ -144,7 +143,7 @@ function Witch_GPGAccess () {
She return false if an erreor happend, or ture if all works.
*/
-function loadXpcom () {
+function FireGPG_loadXpcom () {
try {
var ipcService = Components.classes["@mozilla.org/process/ipc-service;1"].getService();
@@ -154,17 +153,17 @@ function loadXpcom () {
return false;
}
- GPGAccess.ipcService = ipcService;
+ FireGPGGPGAccess.ipcService = ipcService;
return true;
}
/*
- Function: isGpgAgentActivated
+ Function: FireGPG_isGpgAgentActivated
Return true if we should use the agent (option and environement variable set
*/
-function isGpgAgentActivated() {
+function FireGPG_isGpgAgentActivated() {
useGPGAgent = false;
var key = "extensions.firegpg.use_gpg_agent";
@@ -189,10 +188,10 @@ function isGpgAgentActivated() {
}
/*
- Class: GPGAccess
+ Class: FireGPGGPGAccess
This is the main class to access to the gnupg executable.
*/
-var GPGAccess = {
+var FireGPGGPGAccess = {
/*
@@ -206,7 +205,7 @@ var GPGAccess = {
Return true if we are on a unix system, false if we're on windows.
*/
isUnix: function() {
- if(FireGPG_OS != OS_WINDOWS)
+ if(FireGPG_OS != FireGPG_OS_WINDOWS)
return true;
return false;
@@ -217,7 +216,7 @@ var GPGAccess = {
Return the content of a script to execute GnuPG. For no-xpcom classes.
*//*
getRunningCommand: function () {
- return getContent("chrome://firegpg/content/run" + (this.isUnix() ? '.sh' : '.bat'));
+ return FireGPGMisc.getContent("chrome://firegpg/content/run" + (this.isUnix() ? '.sh' : '.bat'));
},*/
@@ -272,7 +271,7 @@ var GPGAccess = {
if(prefs.getPrefType(key) == prefs.PREF_BOOL)
if(prefs.getBoolPref(key))
- comment_argument = ' --comment ' + comment;
+ comment_argument = ' --comment ' + FireGPG_comment;
return comment_argument;
},
@@ -284,7 +283,7 @@ var GPGAccess = {
*/
getGPGAgentArgument: function() {
- if (!isGpgAgentActivated())
+ if (!FireGPG_isGpgAgentActivated())
return ' --no-use-agent';
else {
info = Components.classes["@mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment).get('GPG_AGENT_INFO');
@@ -308,7 +307,7 @@ var GPGAccess = {
if ( gpgAuth.prefs.prefHasUserValue( '.global.trust_model' ) && gpgAuth.prefs.getCharPref( '.global.trust_model' ) != "" )
return ' --trust-model ' + gpgAuth.prefs.getCharPref( '.global.trust_model' );
- if (useGPGTrust && !fromDTA)
+ if (FireGPG_useGPGTrust && !fromDTA)
return ' --trust-model always';
else
return '';
@@ -412,14 +411,14 @@ var GPGAccess = {
sdtIn = "";
- sdtIn = EnigConvertFromUnicode(sdtIn, charset);
+ sdtIn = FireGPGMisc.EnigConvertFromUnicode(sdtIn, charset);
var outStrObj = new Object();
var outLenObj = new Object();
var errStrObj = new Object();
var errLenObj = new Object();
- fireGPGDebug(this.getGPGCommand() + " " + parameters + "[" + sdtIn + "]",'GPGAccessCallerUnixXpcom');
+ fireGPGDebug(this.getGPGCommand() + " " + parameters + "[" + sdtIn + "]",'FireGPGGPGAccessCallerUnixXpcom');
parametersS = parameters.split(/ /gi);
@@ -433,14 +432,13 @@ var GPGAccess = {
try {
-
- var fileobj = Components.classes[NS_LOCALEFILE_CONTRACTID].
+ var fileobj = Components.classes[FireGPGMisc.NS_LOCALEFILE_CONTRACTID].
createInstance(Components.interfaces.nsILocalFile);
fileobj.initWithPath( this.getGPGCommand());
} catch (e) {
-
+ fireGPGDebug(e, 'rungpg/3', true);
}
try {
@@ -486,6 +484,7 @@ var GPGAccess = {
/// FireFTP version but it's crash some times firefox
this.ipcService.execPipe(this.getGPGCommand() + " " + parameters, false, "", sdtIn, sdtIn.length, env, env.length, outStrObj, outLenObj, errStrObj, errLenObj);
} catch (e) {
+ fireGPGDebug(e, 'rungpg/1', true);
}
//If we're here, it's didn't crash
@@ -510,14 +509,13 @@ var GPGAccess = {
var retour = new Object();
-
- retour.out = EnigConvertToUnicode(outStrObj.value, charset);
- retour.err = EnigConvertToUnicode(errStrObj.value, charset);
+ retour.out = FireGPGMisc.EnigConvertToUnicode(outStrObj.value, charset);
+ retour.err = FireGPGMisc.EnigConvertToUnicode(errStrObj.value, charset);
return retour;
} catch (e) {
-
+ fireGPGDebug(e, 'rungpg/2', true);
}
return null;
@@ -537,7 +535,7 @@ var GPGAccess = {
fileTo - _Optional_. The file where to put the signature
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
@@ -545,7 +543,7 @@ var GPGAccess = {
if (!fileMode) {
- if (isGpgAgentActivated()) {
+ if (FireGPG_isGpgAgentActivated()) {
result = this.runGnupg(this.getBaseArugments() +
" --default-key " + keyID +
@@ -569,7 +567,7 @@ var GPGAccess = {
}
} else {
- if (isGpgAgentActivated()) {
+ if (FireGPG_isGpgAgentActivated()) {
result = this.runGnupg(this.getBaseArugments() +
" --default-key " + keyID +
@@ -594,7 +592,7 @@ var GPGAccess = {
}
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.output = result.out;
result2.sdOut = result.err;
@@ -613,7 +611,7 @@ var GPGAccess = {
fileSig - _Optional_. The file with the signature
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
verify: function(text, charset, fileMode, fileFrom, fileSig, fileDataForSign, fromDTA) {
@@ -625,7 +623,7 @@ var GPGAccess = {
result = this.runGnupg(this.getBaseArugments() + this.getGPGTrustArgument(undefined, fromDTA) + " --verify" + (fileMode ? ' ' + fileSig.replace(/\s/g, '{$SPACE}') + ' ' + fileFrom.replace(/\s/g, '{$SPACE}') : ''), text, charset);
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.err;
// We return result
return result2;
@@ -639,7 +637,7 @@ var GPGAccess = {
onlyPrivate - Boolean, set to true if only a private key list is wanted.
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
listkey: function(onlyPrivate) {
@@ -650,7 +648,7 @@ var GPGAccess = {
result = this.runGnupg(this.getBaseArugments() + " --fixed-list-mode --fingerprint --with-colons " + mode,"","ISO-8859-1");
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.out;
// We return result
@@ -662,14 +660,14 @@ var GPGAccess = {
List signs.
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
listsigns: function(key) {
result = this.runGnupg(this.getBaseArugments() + " --with-colons --list-sigs " + key,"","ISO-8859-1");
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.out;
// We return result
@@ -690,7 +688,7 @@ var GPGAccess = {
fileTo - _Optional_. The file where to put the encrypted content
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
@@ -733,7 +731,7 @@ var GPGAccess = {
prikey_id = null;
// The crypted text
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.output = result.out;
result2.sdOut = result.err;
result2.keylist = keyIdList;
@@ -757,7 +755,7 @@ var GPGAccess = {
fileTo - The file where to put the encrypted file
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
@@ -777,12 +775,12 @@ var GPGAccess = {
this.getGPGCommentArgument() +
" --passphrase-fd 0" +
" --output " + outputFd +
- (algo != "" ? " --cipher-algo " + trim(algo) : "") +
+ (algo != "" ? " --cipher-algo " + FireGPGMisc.trim(algo) : "") +
" --symmetric " + inputFd,
password + "\n" + (!fileMode ? text : ''));
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.output = result.out;
result2.sdOut = result.err;
@@ -805,7 +803,7 @@ var GPGAccess = {
fileTo - The file where to put the encrypted & signed file
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
cryptAndSign: function(text, keyIdList, fromGpgAuth, password, keyID, binFileMode, fileMode, fileFrom, fileTo) {
@@ -832,7 +830,7 @@ var GPGAccess = {
inputFd = '';
}
- if (isGpgAgentActivated()) {
+ if (FireGPG_isGpgAgentActivated()) {
result = this.runGnupg(this.getBaseArugments() + this.getGPGTrustArgument(fromGpgAuth) +
" " + keyIdListArgument +
@@ -860,7 +858,7 @@ var GPGAccess = {
}
// The crypted text
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.output = result.out;
result2.sdOut = result.err;
@@ -880,7 +878,7 @@ var GPGAccess = {
fileTo - The file where to put the decrypted file
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
decrypt: function(text,password,binFileMode, fileMode, fileFrom, fileTo) {
@@ -895,7 +893,7 @@ var GPGAccess = {
}
- if (isGpgAgentActivated()) {
+ if (FireGPG_isGpgAgentActivated()) {
result = this.runGnupg(this.getBaseArugments() +
" --output " + outputFd +
@@ -914,7 +912,7 @@ var GPGAccess = {
// The decrypted text (maybe)
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.output = result.out;
result2.sdOut = result.err;
@@ -949,14 +947,14 @@ var GPGAccess = {
text - A text with the GnuPG data to import.
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
kimport: function(text) {
result = this.runGnupg(this.getBaseArugments() + " --import " , text);
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.err;
// We return result
@@ -971,13 +969,13 @@ var GPGAccess = {
key - The key id to export.
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
kexport: function(key) {
result = this.runGnupg(this.getBaseArugments() + " --export " + key);
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.out;
// We return result
@@ -992,13 +990,13 @@ var GPGAccess = {
server - The key server to use
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
refrechFromServer: function(server) {
result = this.runGnupg(this.getBaseArugments() + " --keyserver " + server + this.getProxyInformation() + " --refresh-keys");
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.err;
// We return result
@@ -1015,13 +1013,13 @@ var GPGAccess = {
server - The key server to use
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
sendKeyToServer: function(key, server) {
result = this.runGnupg(this.getBaseArugments() + " --keyserver " + server + this.getProxyInformation() + " --send-keys "+ key);
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.err;
// We return result
@@ -1038,13 +1036,13 @@ var GPGAccess = {
server - The key server to use
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
retriveKeyFromServer: function(key, server) {
result = this.runGnupg(this.getBaseArugments() + " --keyserver " + server + this.getProxyInformation() + " --recv-keys "+ key);
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.err;
result2.sdErr = result.out;
@@ -1062,13 +1060,13 @@ var GPGAccess = {
server - The key server to use
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
searchKeyInServer: function(search, server) {
result = this.runGnupg(this.getBaseArugments() + " --keyserver " + server + this.getProxyInformation() + " --with-colons --search-keys "+ search);
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.out;
// We return result
@@ -1085,13 +1083,13 @@ var GPGAccess = {
trustLevel - The new level of trusting
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
changeTrust: function(key, trustLevel){
result = this.runGnupg(this.getBaseArugments() + " --command-fd 0 --edit-key " + key + " trust", trustLevel + "\n");
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.err;
@@ -1110,7 +1108,7 @@ var GPGAccess = {
newpass - The new password
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
changePassword: function(key, oldpass, newpass){
@@ -1121,7 +1119,7 @@ var GPGAccess = {
result = this.runGnupg(this.getBaseArugments() + " --no-batch --command-fd 0 --edit-key " + key + " passwd" , oldpass + "\n" + newpass + "\nsave\ny\n");
}
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.err;
@@ -1147,7 +1145,7 @@ var GPGAccess = {
keytype - The type of the key
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
genereateKey: function(name, email, comment, password, keyneverexpire, keyexpirevalue, keyexpiretype, keylength, keytype){
@@ -1191,7 +1189,7 @@ var GPGAccess = {
result = this.runGnupg(this.getBaseArugments() + " --gen-key", data + "\n");
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.err;
@@ -1208,13 +1206,13 @@ var GPGAccess = {
key - The key to delete
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
deleteKey: function(key){
result = this.runGnupg(this.getBaseArugments() + " --delete-secret-and-public-key " + key);
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.err;
@@ -1233,7 +1231,7 @@ var GPGAccess = {
password - The password of the key
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
delUid: function(key, uid) {
@@ -1242,7 +1240,7 @@ var GPGAccess = {
result = this.runGnupg(this.getBaseArugments() + " --command-fd 0 --edit-key " + key + "", "uid " + uid + "\ndeluid\ny\nsave\ny");
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.err;
@@ -1263,7 +1261,7 @@ var GPGAccess = {
raison - The raison of the revocation
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
revokeUid: function(key, uid, password, raison ) {
@@ -1273,7 +1271,7 @@ var GPGAccess = {
result = this.runGnupg(this.getBaseArugments() + " --no-batch --command-fd 0 --edit-key " + key + "", "uid " + uid + "\nrevuid\ny\n" + raison + "\n\ny\n" + password + "\nsave\ny");
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.err;
@@ -1295,14 +1293,14 @@ var GPGAccess = {
password - The password of the key
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
addUid: function(key, name, email, comment, password) {
result = this.runGnupg(this.getBaseArugments() + " --no-batch --command-fd 0 --edit-key " + key + " adduid", name + "\n" + email + "\n" + comment + "\n" + password + "\nsave\ny");
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.err;
@@ -1321,13 +1319,13 @@ var GPGAccess = {
password - The password of the key (used to sign)
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
signKey: function(key, keyForSign, password) {
result = this.runGnupg(this.getBaseArugments() + " --no-batch --default-key " + keyForSign + " --command-fd 0 --sign-key " + key , "y\n" + password + "\n");
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.err;
@@ -1355,13 +1353,13 @@ var GPGAccess = {
password - The password of the key
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
revokeKey: function (key, password, raison) {
result = this.runGnupg(this.getBaseArugments() + " --no-batch --command-fd 0 --edit-key " + key + " revkey", "y\n" + raison + "\n\ny\n" + password + "\nsave\ny");
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.err;
@@ -1380,13 +1378,13 @@ var GPGAccess = {
file - The file
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
computeHash: function(hash,file) {
result = this.runGnupg(this.getBaseArugments() + " --print-md " + hash + " " + file.replace(/\s/g, '{$SPACE}'), '');
- var result2 = new GPGReturn();
+ var result2 = new FireGPG_GPGReturn();
result2.sdOut = result.out;
@@ -1404,7 +1402,7 @@ var GPGAccess = {
option - The option to test.
Return:
- A <GPGReturn> structure.
+ A <FireGPG_GPGReturn> structure.
*/
runATest: function(option) {
@@ -1422,7 +1420,7 @@ var GPGAccess = {
/*
Function: tryToFoundTheRightCommand
Do some test to be able to find a working GnuPG executable.
- This function is overwrited by the coresponding function of <GPGAccessWindowsXpcom> or <GPGAccessUnixXpcom>
+ This function is overwrited by the coresponding function of <FireGPGGPGAccessWindowsXpcom> or <FireGPGGPGAccessUnixXpcom>
*/
tryToFoundTheRightCommand: function () {
@@ -1433,17 +1431,17 @@ var GPGAccess = {
/*
- Class: GPGAccessWindowsXpcom
+ Class: FireGPGGPGAccessWindowsXpcom
This class has function for building command lines for GnuPG actions on windows, when the xpcom is available.
- *Please refer to functions marked as overwrited by this class in <GPGAccess> for the descriptions of this class's functions.*
+ *Please refer to functions marked as overwrited by this class in <FireGPGGPGAccess> for the descriptions of this class's functions.*
See Also:
- <GPGAccessUnixXpcom>
+ <FireGPGGPGAccessUnixXpcom>
*/
-var GPGAccessWindowsXpcom = {
+var FireGPGGPGAccessWindowsXpcom = {
tryToFoundTheRightCommand: function () {
@@ -1515,17 +1513,17 @@ var GPGAccessWindowsXpcom = {
}
/*
- Class: GPGAccessUnixXpcom
+ Class: FireGPGGPGAccessUnixXpcom
This class has function for building command lines for GnuPG actions on linux, when the xpcom is available.
- *Please refer to functions marked as overwrited by this class in <GPGAccess> for the descriptions of this class's functions.*
+ *Please refer to functions marked as overwrited by this class in <FireGPGGPGAccess> for the descriptions of this class's functions.*
See Also:
- <GPGAccessWindowsXpcom>
+ <FireGPGGPGAccessWindowsXpcom>
*/
-var GPGAccessUnixXpcom = {
+var FireGPGGPGAccessUnixXpcom = {
diff --git a/content/Core/cselect.js b/content/Core/cselect.js
index d968134..2572518 100644
--- a/content/Core/cselect.js
+++ b/content/Core/cselect.js
@@ -40,14 +40,14 @@ under the terms of any one of the MPL, the GPL or the LGPL.
*/
/*
- Class: Selection
+ Class: FireGPG_Selection
Class to handle selection
*/
-var Selection = {
- /*
+var FireGPG_Selection = {
+ /*
Function: getFrame
find a select in a frame
-
+
Parameters:
frames - The frame
*/
@@ -248,7 +248,7 @@ var Selection = {
if(prefs.getPrefType(key) == prefs.PREF_BOOL) {
if(prefs.getBoolPref(key)) {
/* text the text */
- showText(text,undefined,undefined,undefined,infoSignAndCrypt);
+ FireGPGMisc.showText(text,undefined,undefined,undefined,infoSignAndCrypt);
return;
}
}
diff --git a/content/Core/downloadOverlay.js b/content/Core/downloadOverlay.js
index bea0461..81db479 100644
--- a/content/Core/downloadOverlay.js
+++ b/content/Core/downloadOverlay.js
@@ -51,12 +51,15 @@ under the terms of any one of the MPL, the GPL or the LGPL.
ACTION_HASH - The the hash window
*/
+const FireGPGDownloaderActions = {
+ DECRYPT: 'DECRYPT',
+ OPTS: 'OPTS',
+ ERASE: 'ERASE',
+ VERIFY: 'VERIFY',
+ HASH: 'HASH'
+}
+
-const ACTION_DECRYPT = 'DECRYPT';
-const ACTION_OPTS = 'OPTS';
-const ACTION_ERASE = 'ERASE';
-const ACTION_VERIFY = 'VERIFY';
-const ACTION_HASH = 'HASH';
/*
* Class: firegpgdownloader
* This is the class to comunicate with the menus added in firefox downloader
@@ -92,17 +95,17 @@ var firegpgdownloader = {
*/
onDelayMenuAction: function(action) {
- if(action == ACTION_DECRYPT)
+ if(action == FireGPGDownloaderActions.DECRYPT)
FireGPG.decrypt(false,'', undefined,undefined,true,document.getElementById('downloadView').getSelectedItem(0).getAttribute('path'));
- else if(action == ACTION_VERIFY)
+ else if(action == FireGPGDownloaderActions.VERIFY)
FireGPG.verify(false, '', undefined, undefined, true,document.getElementById('downloadView').getSelectedItem(0).getAttribute('path'));
- else if(action == ACTION_OPTS)
+ else if(action == FireGPGDownloaderActions.OPTS)
window.openDialog("chrome://firegpg/content/Dialogs/options.xul", "optionsFiregpg", "chrome, centerscreen, toolbar").focus();
- else if(action == ACTION_HASH) {
+ else if(action == FireGPGDownloaderActions.HASH) {
window.openDialog("chrome://firegpg/content/Dialogs/hash.xul", "hashFireGPG", "chrome, centerscreen, toolbar", {file: document.getElementById('downloadView').getSelectedItem(0).getAttribute('path')}).focus();
}
- else if (action == ACTION_ERASE)
- eraseSavedPassword();
+ else if (action == FireGPGDownloaderActions.ERASE)
+ FireGPGMisc.eraseSavedPassword();
},
diff --git a/content/Core/firefoxOverlay.xul b/content/Core/firefoxOverlay.xul
index 8c45bfd..a7f7e02 100644
--- a/content/Core/firefoxOverlay.xul
+++ b/content/Core/firefoxOverlay.xul
@@ -44,17 +44,17 @@ under the terms of any one of the MPL, the GPL or the LGPL.
<?xml-stylesheet href="chrome://firegpg/skin/gpgauth.css" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://firegpg/locale/firegpg.dtd">
<overlay id="firegpg-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script src="overlay.js"/>
- <script src="misc.js"/>
- <script src="cgpgaccess.js"/>
- <script src="cgpg.js"/>
- <script src="../Webmails/Gmail/cgmail.js"/>
- <script src="../Webmails/Gmail/cgmail2.js"/>
- <script src="../Webmails/autowrap.js"/>
- <script src="cselect.js"/>
- <script src="../GpgAuth/gpgauth.js"/>
- <script src="../Api/api.js"/>
- <script src="inline.js"/>
+ <script src="overlay.js"/> <!---->
+ <script src="misc.js"/> <!---->
+ <script src="cgpgaccess.js"/> <!---->
+ <script src="cgpg.js"/> <!---->
+ <script src="../Webmails/Gmail/cgmail.js"/> <!---->
+ <script src="../Webmails/Gmail/cgmail2.js"/> <!---->
+ <script src="../Webmails/autowrap.js"/> <!---->
+ <script src="cselect.js"/> <!---->
+ <script src="../GpgAuth/gpgauth.js"/> <!---->
+ <script src="../Api/api.js"/> <!---->
+ <script src="inline.js"/> <!---->
<script src="../Mime/mime.js" />
<script src="../Mime/decoder.js" />
<script src="../Mime/encoder.js" />
@@ -207,13 +207,18 @@ under the terms of any one of the MPL, the GPL or the LGPL.
<menupopup id="firegpg-icon-pop-up" onpopupshowing="firegpg.updatePopUp();">
<menuitem class="firegpg-menu menuitem-iconic" id="firegpg-status-of-inline" label="" disabled="true"/>
+
+ <menuitem class="firegpg-menu menuitem-iconic" id="firegpg-parse-again" label="&parseAgain;" oncommand="firegpg.onMenuItemCommand(event,'CHECKAGAIN')"/>
+
<menuitem class="firegpg-menu menuitem-iconic" id="firegpg-inline-switcher" label="" oncommand="firegpg.onMenuItemCommand(event,this.tag)"/>
<menuitem class="firegpg-menu menuitem-iconic" id="firegpg-inline-temp-switcher" label="" oncommand="firegpg.onMenuItemCommand(event,this.tag)"/>
</menupopup>
<img src="chrome://firegpg/skin/firegpg.png" class="statusbarpanel-iconic" popup="firegpg-icon-pop-up" />
- <label value="An update of FireGPG is available" id="firegpg-statusbar-update" onclick="firegpg.onMenuItemCommand(null,'UPDATE');" style="display: none;"/>
+ <label value="&update-avaiable;" id="firegpg-statusbar-update" onclick="firegpg.onMenuItemCommand(null,'UPDATE');" style="display: none;"/>
<label value="" id="firegpg-statusbar-trusted-content" style="display: none;"/>
+
+ <label value="Problems with gmail. Click me." id="firegpg-statusbar-gmail" onclick="firegpg.onMenuItemCommand(null,'GMAIL');" style="display: none;"/>
</statusbarpanel>
<!-- gpgAuth statusbar button -->
diff --git a/content/Core/inline.js b/content/Core/inline.js
index cb68c10..1adb596 100644
--- a/content/Core/inline.js
+++ b/content/Core/inline.js
@@ -108,7 +108,7 @@ FireGPGInline.HandleBlock = function(document, range, blockType) {
var d = range.cloneContents();
var str = s.serializeToString(d);
- var content = Selection.wash(str);
+ var content = FireGPG_Selection.wash(str);
var fragment = range.extractContents();
@@ -393,7 +393,7 @@ FireGPGInline.ImportKey = function(content, block) {
block.output.style.display = "block";
block.output.textContent = result.messagetext;
- if(result.result == RESULT_SUCCESS)
+ if(result.result == FireGPGResults.SUCCESS)
block.body.className = "ok";
else
block.body.className = "failure";
@@ -417,15 +417,15 @@ FireGPGInline.VerifySignature = function(content, block) {
- if (resultTest.signresult == RESULT_SUCCESS) {
+ if (resultTest.signresult == FireGPGResults.SUCCESS) {
block.body.className = "ok";
block.header.textContent = i18n.getString("signed-message") + ", " + resultTest.signsresulttext;
}
- else if (resultTest.signresult == RESULT_ERROR_BAD_SIGN) {
+ else if (resultTest.signresult == FireGPGResults.ERROR_BAD_SIGN) {
block.body.className = "failure";
block.header.textContent = i18n.getString("signed-message") + ", " + i18n.getString("verifFailedFalse");
}
- else if (resultTest.signresult == RESULT_ERROR_NO_KEY) {
+ else if (resultTest.signresult == FireGPGResults.ERROR_NO_KEY) {
block.body.className = "failure";
block.header.textContent = i18n.getString("signed-message") + ", " + i18n.getString("verifFailedUnknownKey") ;
}
@@ -451,7 +451,7 @@ FireGPGInline.DecryptMessage = function(content, block) {
var result = FireGPG.decrypt(true,content);
- if (result.result == RESULT_SUCCESS) {
+ if (result.result == FireGPGResults.SUCCESS) {
block.body.className = "ok";
block.message.textContent = result.decrypted;
@@ -475,7 +475,7 @@ FireGPGInline.DecryptMessage = function(content, block) {
- } else if (result.result == RESULT_ERROR_PASSWORD) {
+ } else if (result.result == FireGPGResults.ERROR_PASSWORD) {
block.body.className = "failure";
block.header.textContent = i18n.getString("encrypted-message") + ", " + result.messagetext;
@@ -484,7 +484,7 @@ FireGPGInline.DecryptMessage = function(content, block) {
block.body.className = "failure";
block.output.style.display = "block";
- block.output.textContent = trim(result.messagetext);
+ block.output.textContent = FireGPGMisc.trim(result.messagetext);
}
@@ -501,9 +501,14 @@ FireGPGInline.DecryptMessage = function(content, block) {
FireGPGInline.onPageLoad = function(aEvent) {
var doc = aEvent.originalTarget;
+
if(doc.nodeName != "#document")
return;
+ if (document.getElementById('firegpg-statusbar-trusted-content')) {
+ document.getElementById('firegpg-statusbar-trusted-content').style.display = 'none';
+ }
+
// Don't handle chrome pages
if(doc.location.protocol == "chrome:")
return;
@@ -548,7 +553,7 @@ FireGPGInline.initSystem = function() {
/*
Function: mouseOverTrusted
Function called when the mouse is over a trusted block
-
+
Parameters:
aEvent - The mouse over event
*/
@@ -574,7 +579,7 @@ FireGPGInline.mouseOverTrusted = function(aEvent) {
/*
Function: mouseOutTrusted
Function called when a mouse is outside a trusted block
-
+
Parameters:
aEvent - The mouseout event
*/
@@ -594,7 +599,7 @@ FireGPGInline.mouseOutTrusted = function(aEvent) {
Function: canIBeExecutedHere
Return true if we should handle pgp blocks on a page
First, we use preferences for page, then domains, then global.
-
+
Parameters:
aUrl - The url of the page
*/
@@ -623,7 +628,7 @@ FireGPGInline.canIBeExecutedHere = function(aUrl) {
/*
Function: siteStatus
Return 'OFF' if we shouln't handle block on the domain, 'ON' if we should, '' if user don't case
-
+
Parameters:
aUrl - The url of the page
*/
@@ -666,7 +671,7 @@ FireGPGInline.siteStatus = function(aUrl) {
/*
Function: siteOn
Activate the handiling of pgp block for a domain
-
+
Parameters:
aUrl - The url of the page
*/
@@ -679,7 +684,7 @@ FireGPGInline.siteOn = function(aUrl) {
/*
Function: siteOff
Desactivate the handiling of pgp block for a domain
-
+
Parameters:
aUrl - The url of the page
*/
@@ -692,7 +697,7 @@ FireGPGInline.siteOff = function(aUrl) {
/*
Function: setSiteTo
Activate or desactivate the handiling of pgp block for a domain
-
+
Parameters:
aUrl - The url of the page
value - ON to activate, OFF to desactive
@@ -737,10 +742,10 @@ FireGPGInline.setSiteTo = function(aUrl, value) {
/*
Function: pageStatus
Return 'OFF' if we shouln't handle block on the page, 'ON' if we should, '' if user don't case
-
+
Parameters:
aUrl - The url of the page
-*/
+*/
FireGPGInline.pageStatus = function(aUrl) {
@@ -754,7 +759,7 @@ FireGPGInline.pageStatus = function(aUrl) {
/*
Function: pageOn
Activate the handiling of pgp block for a page
-
+
Parameters:
aUrl - The url of the page
*/
@@ -773,7 +778,7 @@ FireGPGInline.pageOn = function(aUrl) {
/*
Function: pageOff
Desactivate the handiling of pgp block for a page
-
+
Parameters:
aUrl - The url of the page
*/
diff --git a/content/Core/misc.js b/content/Core/misc.js
index c3e5080..0b22fa7 100644
--- a/content/Core/misc.js
+++ b/content/Core/misc.js
@@ -41,11 +41,11 @@ under the terms of any one of the MPL, the GPL or the LGPL.
/* Constant: FIREGPG_VERSION
The current version of FireGPG */
-const FIREGPG_VERSION = '0.7.8';
+const FIREGPG_VERSION = '0.7.9';
/* Constant: FIREGPG_VERSION_A
The current verion of FireGPG without dots */
-const FIREGPG_VERSION_A = '078';
+const FIREGPG_VERSION_A = '079';
/* Constant: FIREGPG_STATUS
The status of the FireGPG's code. Can be _DEVEL_ or _RELASE_. Use _RELASE_ only for.. relases ;). */
@@ -53,64 +53,7 @@ const FIREGPG_STATUS = 'RELASE';
/* Constant: FIREGPG_SVN
The current subversion's revision number, for this file ! */
-const FIREGPG_SVN = "$Rev: 599 $";
-
-/*
- Constants: Id for components.
-
- NS_LOCALEFILE_CONTRACTID - Id for the component @mozilla.org/file/local;1
- NS_DIRECTORYSERVICE_CONTRACTID - Id for the component @mozilla.org/file/directory_service;1
- NS_NETWORKOUTPUT_CONTRACTID - Id for the component @mozilla.org/network/file-output-stream;1
- NS_NETWORKINPUT_CONTRACTID - Id for the @mozilla.org/network/file-input-stream;1
- NS_NETWORKINPUTS_CONTRACTID - Id for the component @mozilla.org/scriptableinputstream;1
- NS_PROCESSUTIL_CONTRACTID - Id for the component @mozilla.org/process/util;1
-*/
-const NS_LOCALEFILE_CONTRACTID = "@mozilla.org/file/local;1";
-const NS_DIRECTORYSERVICE_CONTRACTID = "@mozilla.org/file/directory_service;1";
-const NS_NETWORKOUTPUT_CONTRACTID = "@mozilla.org/network/file-output-stream;1";
-const NS_NETWORKINPUT_CONTRACTID = "@mozilla.org/network/file-input-stream;1";
-const NS_NETWORKINPUTS_CONTRACTID = "@mozilla.org/scriptableinputstream;1";
-const NS_PROCESSUTIL_CONTRACTID = "@mozilla.org/process/util;1";
-
-/*
- Constants: Tempory files
-
- TMP_DIRECTORY - The base name for files (doesn't same to be a directory)
- TMP_FILES - The file name for common files.
- TMP_RFILES - The file name for executable scripts.
- TMP_EFILES - The file name for executables..
-*/
-const TMP_DIRECTORY = "TmpD";
-const TMP_FILES = "fgpg_tmpFile";
-
-/*
- Constants: Write modes for files.
-
- WRITE_MODE - The default mode for files.
- WRITE_PERMISSION - The default permission for files
- WRITE_PERMISSION_R - The default permission for executable files
-*/
-const WRITE_MODE = 0x02 | 0x08 | 0x20;
-const WRITE_PERMISSION = 0600;
-const WRITE_PERMISSION_R = 0777;
-
-/*
- Variable: savedPassword
- The password of the private key, saved for later actions.
- */
-var savedPassword = null; /* the private key password */
-
-/*
- Variable: oldKeyID
- The previous key selected.
- */
-var oldKeyID = '';
-
-/*
- Variable: updateAvailable
- True if an update of FireGPG is available
-*/
-var updateAvailable = false;
+const FIREGPG_SVN = "$Rev: 657 $";
/*
Function: fireGPGDebug
@@ -123,12 +66,15 @@ var updateAvailable = false;
fatal - True if it's a fatal error.
*/
-function fireGPGDebug(message, debugCode, fatal) {
+function fireGPGDebug (message, debugCode, fatal) {
if (FIREGPG_STATUS == "RELASE" && !fatal)
return;
+ if (message && message.lineNumber)
+ message = message.fileName + '@' + message.lineNumber + ' ' + message.message;
+
if (fatal)
Components.utils.reportError("FireGPG-debug: [" + debugCode + "]" + message);
else {
@@ -140,1625 +86,1686 @@ function fireGPGDebug(message, debugCode, fatal) {
}
-/*
- Function: choosePublicKey
-
- Show a dialog (list.xul) to choose a list of public keys (array).
- null is returned if the public key is not choosed
-
- Paramters:
- preSelect - _Optional_. And array of keys to preselect.
-
-*/
-function choosePublicKey(preSelect)
-{
-
- if(preSelect == undefined)
- preSelect = {};
+var FireGPGMisc = {
- var params = {title: '', description: '', list: {}, selected_items: {}, preSelect: {}};
- var i18n = document.getElementById("firegpg-strings");
+ /*
+ Constants: Id for components.
+
+ NS_LOCALEFILE_CONTRACTID - Id for the component @mozilla.org/file/local;1
+ NS_DIRECTORYSERVICE_CONTRACTID - Id for the component @mozilla.org/file/directory_service;1
+ NS_NETWORKOUTPUT_CONTRACTID - Id for the component @mozilla.org/network/file-output-stream;1
+ NS_NETWORKINPUT_CONTRACTID - Id for the @mozilla.org/network/file-input-stream;1
+ NS_NETWORKINPUTS_CONTRACTID - Id for the component @mozilla.org/scriptableinputstream;1
+ NS_PROCESSUTIL_CONTRACTID - Id for the component @mozilla.org/process/util;1
+ */
+ NS_LOCALEFILE_CONTRACTID: "@mozilla.org/file/local;1",
+ NS_DIRECTORYSERVICE_CONTRACTID: "@mozilla.org/file/directory_service;1",
+ NS_NETWORKOUTPUT_CONTRACTID: "@mozilla.org/network/file-output-stream;1",
+ NS_NETWORKINPUT_CONTRACTID: "@mozilla.org/network/file-input-stream;1",
+ NS_NETWORKINPUTS_CONTRACTID: "@mozilla.org/scriptableinputstream;1",
+ NS_PROCESSUTIL_CONTRACTID: "@mozilla.org/process/util;1",
- params.title = i18n.getString('choosePublicKeyTitle');
- params.description = i18n.getString('choosePublicKeyDescription');
+ /*
+ Constants: Tempory files
- keylistcall = FireGPG.listKeys();
+ TMP_DIRECTORY - The base name for files (doesn't same to be a directory)
+ TMP_FILES - The file name for common files.
+ TMP_RFILES - The file name for executable scripts.
+ TMP_EFILES - The file name for executables..
+ */
+ TMP_DIRECTORY: "TmpD",
+ TMP_FILES: "fgpg_tmpFile",
- if (keylistcall.result == RESULT_SUCCESS)
- params.list = keylistcall.keylist;
- else
- return;
+ /*
+ Constants: Write modes for files.
- params.preSelect = preSelect;
-
-
- var dlg = window.openDialog('chrome://firegpg/content/Dialogs/list.xul',
- '', 'chrome, dialog, modal, resizable=yes',
- params);
- dlg.focus();
- if(params.selected_items.length == 0 || params.selected_items.length == undefined)
- {
- return null;
- } //If we have to, add the private key too.
- else {
-
- var prefs = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefService);
-
- prefs = prefs.getBranch("extensions.firegpg.");
- try {
- var to_my_self = prefs.getBoolPref("allvays_to_myself",false);
- } catch (e) {
- to_my_self = false;
- }
-
- if (to_my_self == true)
- {
- var selfKeyId = getSelfKey();
-
- if (selfKeyId != null)
- {
- params.selected_items.push(selfKeyId);
- }
- }
- }
-
- return params.selected_items;
-}
+ WRITE_MODE - The default mode for files.
+ WRITE_PERMISSION - The default permission for files
+ WRITE_PERMISSION_R - The default permission for executable files
+ */
+ WRITE_MODE: 0x02 | 0x08 | 0x20,
+ WRITE_PERMISSION: 0600,
+ WRITE_PERMISSION_R: 0777,
-/*
- Function: choosePrivateKey
+ /*
+ Variable: savedPassword
+ The password of the private key, saved for later actions.
+ */
+ savedPassword: null, /* the private key password */
- Show a dialog (list.xul) to choose a private key.
- null is returned if no keys are chosen.
+ /*
+ Variable: oldKeyID
+ The previous key selected.
+ */
+ oldKeyID: '',
- Parameters:
- preSelect - _Optional_. A list of key to preselect
-*/
-function choosePrivateKey(preSelect)
-{
- if(preSelect == undefined)
- preSelect = {};
+ /*
+ Variable: updateAvailable
+ True if an update of FireGPG is available
+ */
+ updateAvailable: false,
- var params = {title: '', description: '', list: {}, selected_item: null, preSelect: {}};
- var i18n = document.getElementById("firegpg-strings");
- params.title = i18n.getString('choosePrivateKeyTitle');
- params.description = i18n.getString('choosePrivateKeyDescription');
+ /*
+ Function: choosePublicKey
- keylistcall = FireGPG.listKeys(true);
+ Show a dialog (list.xul) to choose a list of public keys (array).
+ null is returned if the public key is not choosed
- if (keylistcall.result == RESULT_SUCCESS)
- params.list = keylistcall.keylist;
- else
- return;
+ Paramters:
+ preSelect - _Optional_. And array of keys to preselect.
- params.preSelect = preSelect;
+ */
+ choosePublicKey: function(preSelect)
+ {
- var dlg = window.openDialog('chrome://firegpg/content/Dialogs/list.xul',
- '', 'chrome, dialog, modal, resizable=yes',
- params);
- dlg.focus();
- if(params.selected_items.length == 0)
- {
- params.selected_items = null;
- return null;
- }
- return params.selected_items[0];
-}
+ if(preSelect == undefined)
+ preSelect = {};
+ var params = {title: '', description: '', list: {}, selected_items: {}, preSelect: {}};
+ var i18n = document.getElementById("firegpg-strings");
-/*
- Function: showText
+ params.title = i18n.getString('choosePublicKeyTitle');
+ params.description = i18n.getString('choosePublicKeyDescription');
- Show 'text' in a dialog (the editor)
+ keylistcall = FireGPG.listKeys();
- Parameters:
- text - The text to show display
- description - _Optional_. The message to show. If not set, use the default.
- title - _Optional_. The title of the window. If not set, use the default.
- doShowButtons - _Optional_. If we have to show buttons to encrypt and so. Default to false.
- validSign - _Optional_. The message for the validSign field.
-*/
-function showText(text, description, title, doShowButtons, validSign) {
- /* default description and title values */
- var i18n = document.getElementById("firegpg-strings");
-
- /* setting params */
- var params = {text: text, title: title, description: description, doShowButtons: doShowButtons, validSign: validSign};
- if(title == undefined)
- params.title = i18n.getString('showTextDefaultTitle');
- if(description == undefined)
- params.description = i18n.getString('showTextDefaultDescription');
- if(doShowButtons == undefined)
- params.doShowButtons = false;
-
- if(validSign == undefined)
- params.validSign = null;
-
- /* open the dialog */
- window.openDialog('chrome://firegpg/content/Dialogs/showtext.xul',
- '', 'chrome, dialog, resizable=yes',
- params).focus();
-}
+ if (keylistcall.result == FireGPGResults.SUCCESS)
+ params.list = keylistcall.keylist;
+ else
+ return;
-/*
- Function: showEditor
+ params.preSelect = preSelect;
- Open the editor (the showtext.xul dialog)
-*/
-function showEditor() {
- var i18n = document.getElementById("firegpg-strings");
- var title = i18n.getString('editorTitle');
- var description = i18n.getString('editorDescription');
- showText('',description,title);
-}
-/*
- Function: getPassword
+ var dlg = window.openDialog('chrome://firegpg/content/Dialogs/list.xul',
+ '', 'chrome, dialog, modal, resizable=yes',
+ params);
+ dlg.focus();
+ if(params.selected_items.length == 0 || params.selected_items.length == undefined)
+ {
+ return null;
+ } //If we have to, add the private key too.
+ else {
+
+ var prefs = Components.classes["@mozilla.org/preferences-service;1"].
+ getService(Components.interfaces.nsIPrefService);
+
+ prefs = prefs.getBranch("extensions.firegpg.");
+ try {
+ var to_my_self = prefs.getBoolPref("allvays_to_myself",false);
+ } catch (e) {
+ to_my_self = false;
+ }
- Show the generic dialog to get a password.
+ if (to_my_self == true)
+ {
+ var selfKeyId = FireGPGMisc.getSelfKey();
- An object is returned :
- {password: "password", save_password: true/false}$
+ if (selfKeyId != null)
+ {
+ params.selected_items.push(selfKeyId);
+ }
+ }
+ }
- null is returned if cancel button is clicked.
+ return params.selected_items;
+ },
- Parameters:
- question - The text to show for the prompt.
- save_password - _Optional_. The default value for the save password checkbox. If not set, value set in the options by the user is used.
- domain - _Optional_. Say the password is asked form this page and disable the savepassword checkbox.
- nosavecheckbox - _Optional_. Disable the save password feature
-*/
-function getPassword(question, save_password, domain, nosavecheckbox) {
- if(save_password == undefined) {
- var prefs = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefService);
+ /*
+ Function: choosePrivateKey
- prefs = prefs.getBranch("extensions.firegpg.");
- try {
- save_password = prefs.getBoolPref("default_memory");
- } catch (e) {
- save_password = false;
- }
- }
+ Show a dialog (list.xul) to choose a private key.
+ null is returned if no keys are chosen.
- if (domain == undefined)
- domain = false;
+ Parameters:
+ preSelect - _Optional_. A list of key to preselect
+ */
+ choosePrivateKey:function (preSelect)
+ {
+ if(preSelect == undefined)
+ preSelect = {};
- if (nosavecheckbox == undefined)
- nosavecheckbox = false;
+ var params = {title: '', description: '', list: {}, selected_item: null, preSelect: {}};
- var params = {password: '',
- save_password: save_password,
- result: false, question: question, domain: domain, nosavecheckbox: nosavecheckbox};
+ var i18n = document.getElementById("firegpg-strings");
- var dlg = window.openDialog('chrome://firegpg/content/Dialogs/password.xul',
- '', 'chrome, dialog, modal, resizable=yes', params);
- dlg.focus();
+ params.title = i18n.getString('choosePrivateKeyTitle');
+ params.description = i18n.getString('choosePrivateKeyDescription');
- if(params.result) {
+ keylistcall = FireGPG.listKeys(true);
- if (domain == false && nosavecheckbox == false)
- prefs.setBoolPref("default_memory",params.save_password);
+ if (keylistcall.result == FireGPGResults.SUCCESS)
+ params.list = keylistcall.keylist;
+ else
+ return;
- return params;
- }
+ params.preSelect = preSelect;
- return null;
-}
+ var dlg = window.openDialog('chrome://firegpg/content/Dialogs/list.xul',
+ '', 'chrome, dialog, modal, resizable=yes',
+ params);
+ dlg.focus();
+ if(params.selected_items.length == 0)
+ {
+ params.selected_items = null;
+ return null;
+ }
+ return params.selected_items[0];
+ },
-/*
- Function: savePassword
- * TODO !*
- Save a password in the password manager of Firefox
- Parameters:
- password - The password
+ /*
+ Function: showText
+
+ Show 'text' in a dialog (the editor)
+
+ Parameters:
+ text - The text to show display
+ description - _Optional_. The message to show. If not set, use the default.
+ title - _Optional_. The title of the window. If not set, use the default.
+ doShowButtons - _Optional_. If we have to show buttons to encrypt and so. Default to false.
+ validSign - _Optional_. The message for the validSign field.
+ */
+ showText:function (text, description, title, doShowButtons, validSign) {
+ /* default description and title values */
+ var i18n = document.getElementById("firegpg-strings");
+
+ /* setting params */
+ var params = {text: text, title: title, description: description, doShowButtons: doShowButtons, validSign: validSign};
+ if(title == undefined)
+ params.title = i18n.getString('showTextDefaultTitle');
+ if(description == undefined)
+ params.description = i18n.getString('showTextDefaultDescription');
+ if(doShowButtons == undefined)
+ params.doShowButtons = false;
+
+ if(validSign == undefined)
+ params.validSign = null;
+
+ /* open the dialog */
+ window.openDialog('chrome://firegpg/content/Dialogs/showtext.xul',
+ '', 'chrome, dialog, resizable=yes',
+ params).focus();
+ },
-*/
-function savePassword(password) {
-}
+ /*
+ Function: showEditor
+
+ Open the editor (the showtext.xul dialog)
+ */
+ showEditor:function () {
+ var i18n = document.getElementById("firegpg-strings");
+ var title = i18n.getString('editorTitle');
+ var description = i18n.getString('editorDescription');
+ FireGPGMisc.showText('',description,title);
+ },
-/*
- Function: getSavedPassword
- * TODO !*
- Get the password saved in the password manager of Firefox
-*/
-function getSavedPassword() {
-}
+ /*
+ Function: getPassword
+
+ Show the generic dialog to get a password.
+
+ An object is returned :
+ {password: "password", save_password: true/false}$
+
+ null is returned if cancel button is clicked.
+
+ Parameters:
+ question - The text to show for the prompt.
+ save_password - _Optional_. The default value for the save password checkbox. If not set, value set in the options by the user is used.
+ domain - _Optional_. Say the password is asked form this page and disable the savepassword checkbox.
+ nosavecheckbox - _Optional_. Disable the save password feature
+ */
+ getPassword:function (question, save_password, domain, nosavecheckbox) {
+ if(save_password == undefined) {
+ var prefs = Components.classes["@mozilla.org/preferences-service;1"].
+ getService(Components.interfaces.nsIPrefService);
+
+ prefs = prefs.getBranch("extensions.firegpg.");
+ try {
+ save_password = prefs.getBoolPref("default_memory");
+ } catch (e) {
+ save_password = false;
+ }
+ }
-/*
- Function: getPrivateKeyPassword
+ if (domain == undefined)
+ domain = false;
- This function uses getPassword() to get a password for a private key.
+ if (nosavecheckbox == undefined)
+ nosavecheckbox = false;
- It's the user request for it, it's save the password for later.
+ var params = {password: '',
+ save_password: save_password,
+ result: false, question: question, domain: domain, nosavecheckbox: nosavecheckbox};
- If useSavedPassword = false, the password is asked each time,
- even if it's already saved in the global variable savedPassword.
+ var dlg = window.openDialog('chrome://firegpg/content/Dialogs/password.xul',
+ '', 'chrome, dialog, modal, resizable=yes', params);
+ dlg.focus();
- null is returned on error.
+ if(params.result) {
- Parameters:
- useSavedPassword - _Optional_. Set this to false to disable the use of a saved password
- domain - _Optional_. The domain to pass to <getPassword>.
- message - _Optional_. The message to ask the user.
- nosavecheckbox - _Optional_. Disable the save password feature
+ if (domain == false && nosavecheckbox == false)
+ prefs.setBoolPref("default_memory",params.save_password);
-*/
-function getPrivateKeyPassword(useSavedPassword /* default = true */, domain /* default = false*/, message /* default = false*/, nosavecheckbox) {
- /* the default value of the optional variable */
- if(useSavedPassword == undefined)
- useSavedPassword = true;
- if(domain == undefined)
- domain = false;
+ return params;
+ }
- if (nosavecheckbox == undefined)
- nosavecheckbox = false;
+ return null;
+ },
+ /*
+ Function: savePassword
+ * TODO !*
+ Save a password in the password manager of Firefox
- /* return password if it's saved in savePassword */
- if(useSavedPassword && savedPassword != null)
- return savedPassword;
+ Parameters:
+ password - The password
- /* show the dialog ! */
- if (message == undefined)
- var question = document.getElementById('firegpg-strings').
- getString('passwordDialogEnterPrivateKey');
- else
- var question = message;
+ */
+ savePassword:function (password) {
+ },
- var result = getPassword(question,undefined,domain, nosavecheckbox);
+ /*
+ Function: getSavedPassword
+ * TODO !*
+ Get the password saved in the password manager of Firefox
+ */
+ getSavedPassword:function () {
+ },
- if(result == null)
- return null;
+ /*
+ Function: getPrivateKeyPassword
- if(result.save_password && domain == false && nosavecheckbox != true) {
+ This uses getPassword:function () to get a password for a private key.
- savedPassword = result.password;
+ It's the user request for it, it's save the password for later.
+ If useSavedPassword = false, the password is asked each time,
+ even if it's already saved in the global variable savedPassword.
+ null is returned on error.
- try {
- document.getElementById('firegpg-menu-memo-pop').style.display = '';
- document.getElementById('firegpg-menu-memo-menu').style.display = '';
+ Parameters:
+ useSavedPassword - _Optional_. Set this to false to disable the use of a saved password
+ domain - _Optional_. The domain to pass to <getPassword>.
+ message - _Optional_. The message to ask the user.
+ nosavecheckbox - _Optional_. Disable the save password feature
- //document.getElementById('firegpg-menu-memo-tool').style.display = '';
- }
- catch(e) { fireGPGDebug(e,'misc.getPrivateKeyPassword',true); }
- }
+ */
+ getPrivateKeyPassword:function (useSavedPassword /* default = true */, domain /* default = false*/, message /* default = false*/, nosavecheckbox) {
+ /* the default value of the optional variable */
+ if(useSavedPassword == undefined)
+ useSavedPassword = true;
+ if(domain == undefined)
+ domain = false;
- return result.password;
-}
+ if (nosavecheckbox == undefined)
+ nosavecheckbox = false;
-/*
- Function: getsavedPassword
- Return the saved password
-*/
-function getsavedPassword() {
- return savedPassword;
+ /* return password if it's saved in savePassword */
+ if(useSavedPassword && FireGPGMisc.savedPassword != null)
+ return FireGPGMisc.savedPassword;
+ /* show the dialog ! */
+ if (message == undefined)
+ var question = document.getElementById('firegpg-strings').
+ getString('passwordDialogEnterPrivateKey');
+ else
+ var question = message;
-}
+ var result = FireGPGMisc.getPassword(question,undefined,domain, nosavecheckbox);
-/*
- Function: eraseSavedPassword
- This function erase the saved password (it's for exemple when a sign failled)
-*/
-function eraseSavedPassword() {
-
- savedPassword = null;
-
- try {
- if (document.getElementById('firegpg-menu-memo-pop'))
- document.getElementById('firegpg-menu-memo-pop').style.display = 'none';
- if (document.getElementById('firegpg-menu-memo-menu'))
- document.getElementById('firegpg-menu-memo-menu').style.display = 'none';
- if (document.getElementById('firegpg-menu-memo-tool'))
- document.getElementById('firegpg-menu-memo-tool').style.display = 'none';
- }
- catch (e) { }
-}
+ if(result == null)
+ return null;
+ if(result.save_password && domain == false && nosavecheckbox != true) {
-/*
- Function: getSelfKey
+ FireGPGMisc.savedPassword = result.password;
- Function who return a private key for the user (the default or the one selected in the list)
- null is returned if no key is selected.
- Parameters:
- autoSelectPrivate - _Optional_. A list of key to autoselect
-*/
-function getSelfKey(autoSelectPrivate) {
- var keyID;
- var prefs = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefService);
- prefs = prefs.getBranch("extensions.firegpg.");
- keyID = prefs.getCharPref("default_private_key");
-
- /* we must ask for private key ? */
- if(keyID == '')
- keyID = choosePrivateKey(autoSelectPrivate);
-
- /* request password if key id is changed */
- if(keyID.toString() != oldKeyID.toString()) {
- eraseSavedPassword();
- }
+ try {
+ document.getElementById('firegpg-menu-memo-pop').style.display = '';
+ document.getElementById('firegpg-menu-memo-menu').style.display = '';
- oldKeyID = keyID;
+ //document.getElementById('firegpg-menu-memo-tool').style.display = '';
+ }
+ catch(e) { fireGPGDebug(e,'misc.getPrivateKeyPassword',true); }
+ }
- return keyID;
-}
+ return result.password;
+ },
-/*
- Function: getTmpDir
+ /*
+ Function: getsavedPassword
+ Return the saved password
+ */
+ getsavedPassword:function () {
- Get the path of a tmp file.
- The path is returned.
-*/
-function getTmpDir() {
- return Components.classes[NS_DIRECTORYSERVICE_CONTRACTID].
- getService(Components.interfaces.nsIProperties).
- get(TMP_DIRECTORY, Components.interfaces.nsIFile);
-}
+ return FireGPGMisc.savedPassword;
+ },
+ /*
+ Function: eraseSavedPassword
+ This erase the saved password :function (it's for exemple when a sign failled)
+ */
+ eraseSavedPassword:function () {
+
+ FireGPGMisc.savedPassword = null;
+
+ try {
+ if (document.getElementById('firegpg-menu-memo-pop'))
+ document.getElementById('firegpg-menu-memo-pop').style.display = 'none';
+ if (document.getElementById('firegpg-menu-memo-menu'))
+ document.getElementById('firegpg-menu-memo-menu').style.display = 'none';
+ if (document.getElementById('firegpg-menu-memo-tool'))
+ document.getElementById('firegpg-menu-memo-tool').style.display = 'none';
+ }
+ catch (e) { }
+ },
-/*
- Function: getTmpFile
- Get an unique temporary file name.
- The path + filename is returned.
+ /*
+ Function: getSelfKey
- Parameters:
- permission - _Optional_. The permission of the file. See <Write modes for files>
- suffix_file - _Optional_. A suffix to add to the default file name.
-*/
-function getTmpFile(permission /* optional */, suffix_file) {
- if(permission == undefined)
- permission = WRITE_PERMISSION;
+ who return a private key for the user :function (the default or the one selected in the list)
+ null is returned if no key is selected.
- var fileobj = getTmpDir();
+ Parameters:
+ autoSelectPrivate - _Optional_. A list of key to autoselect
- if (permission == WRITE_PERMISSION_R)
- var fileName = TMP_RFILES;
- else
- var fileName = TMP_FILES;
+ */
+ getSelfKey:function (autoSelectPrivate) {
+ var keyID;
+ var prefs = Components.classes["@mozilla.org/preferences-service;1"].
+ getService(Components.interfaces.nsIPrefService);
+ prefs = prefs.getBranch("extensions.firegpg.");
+ keyID = prefs.getCharPref("default_private_key");
- if(suffix_file != undefined)
- fileName += '_S_' + suffix_file; //To be sure to be unique.
+ /* we must ask for private key ? */
+ if(keyID == '')
+ keyID = FireGPGMisc.choosePrivateKey(autoSelectPrivate);
- var date = new Date();
+ /* request password if key id is changed */
+ if(keyID.toString() != FireGPGMisc.oldKeyID.toString()) {
+ FireGPGMisc.eraseSavedPassword();
+ }
- fileobj.append( Math.floor(Math.random() * 9999) + date.getTime() + Math.floor(Math.random() * 9999) + Math.floor(Math.random() * 9999) + fileName);
- fileobj.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, permission);
- fileobj.permissions = permission;
- return fileobj.path;
-}
+ FireGPGMisc.oldKeyID = keyID;
+ return keyID;
+ },
-/*
- Function: removeFile
- Delete a file.
+ /*
+ Function: getTmpDir
+
+ Get the path of a tmp file.
+ The path is returned.
+ */
+ getTmpDir:function () {
+ return Components.classes[FireGPGMisc.NS_DIRECTORYSERVICE_CONTRACTID].
+ getService(Components.interfaces.nsIProperties).
+ get(FireGPGMisc.TMP_DIRECTORY, Components.interfaces.nsIFile);
+ },
- Parameters:
- path - The file to delete.
-*/
-function removeFile(path) {
- var fileobj = Components.classes[NS_LOCALEFILE_CONTRACTID].
- createInstance(Components.interfaces.nsILocalFile);
- fileobj.initWithPath(path);
-
- try {
- fileobj.remove(path);
- }
- catch (e) {
- /* If file doesn't exist */
- }
-}
-/*
- Function: fileExist
- Return true if a file exist
+ /*
+ Function: getTmpFile
- Parameters:
- path - The file to delete.
-*/
-function fileExist(path) {
- var fileobj = Components.classes[NS_LOCALEFILE_CONTRACTID].
- createInstance(Components.interfaces.nsILocalFile);
- fileobj.initWithPath(path);
-
- try {
- return fileobj.exists();
- }
- catch (e) {
- return false;
- }
-}
+ Get an unique temporary file name.
+ The path + filename is returned.
+ Parameters:
+ permission - _Optional_. The permission of the file. See <Write modes for files>
+ suffix_file - _Optional_. A suffix to add to the default file name.
+ */
+ getTmpFile:function (permission /* optional */, suffix_file) {
+ if(permission == undefined)
+ permission = FireGPGMisc.WRITE_PERMISSION;
-/*
- Function: putIntoFile
- Save data to a file. File saved in UTF-8 charset.
+ var fileobj = FireGPGMisc.getTmpDir();
- Parameters:
- filename - The name of the file
- data - The data to save
-*/
-function putIntoFile(filename, data)
-{
- var fileobj = Components.classes[NS_LOCALEFILE_CONTRACTID].
- createInstance(Components.interfaces.nsILocalFile);
+ if (permission == FireGPGMisc.WRITE_PERMISSION_R)
+ var fileName = FireGPGMisc.TMP_RFILES;
+ else
+ var fileName = FireGPGMisc.TMP_FILES;
- fileobj.initWithPath(filename);
+ if(suffix_file != undefined)
+ fileName += '_S_' + suffix_file; //To be sure to be unique.
- var foStream = Components.classes[NS_NETWORKOUTPUT_CONTRACTID].
- createInstance(Components.interfaces.nsIFileOutputStream);
+ var date = new Date();
- foStream.init(fileobj, WRITE_MODE, WRITE_PERMISSION, 0);
- //foStream.write(data, data.length);
+ fileobj.append( Math.floor(Math.random() * 9999) + date.getTime() + Math.floor(Math.random() * 9999) + Math.floor(Math.random() * 9999) + fileName);
+ fileobj.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, permission);
+ fileobj.permissions = permission;
+ return fileobj.path;
+ },
- var charset = "UTF-8"; // Can be any character encoding name that Mozilla supports
- var os = Components.classes["@mozilla.org/intl/converter-output-stream;1"]
- .createInstance(Components.interfaces.nsIConverterOutputStream);
+ /*
+ Function: removeFile
+ Delete a file.
+
+ Parameters:
+ path - The file to delete.
+ */
+ removeFile:function (path) {
+ var fileobj = Components.classes[FireGPGMisc.NS_LOCALEFILE_CONTRACTID].
+ createInstance(Components.interfaces.nsILocalFile);
+ fileobj.initWithPath(path);
+
+ try {
+ fileobj.remove(path);
+ }
+ catch (e) {
+ /* If file doesn't exist */
+ }
+ },
- // This assumes that fos is the nsIOutputStream you want to write to
- os.init(foStream, charset, 0, 0x0000);
+ /*
+ Function: fileExist
+ Return true if a file exist
+
+ Parameters:
+ path - The file to delete.
+ */
+ fileExist:function (path) {
+ var fileobj = Components.classes[FireGPGMisc.NS_LOCALEFILE_CONTRACTID].
+ createInstance(Components.interfaces.nsILocalFile);
+ fileobj.initWithPath(path);
+
+ try {
+ return fileobj.exists();
+ }
+ catch (e) {
+ return false;
+ }
+ },
- os.writeString(data);
- os.close();
+ /*
+ Function: putIntoFile
+ Save data to a file. File saved in UTF-8 charset.
+
+ Parameters:
+ filename - The name of the file
+ data - The data to save
+ */
+ putIntoFile:function (filename, data)
+ {
+ var fileobj = Components.classes[FireGPGMisc.NS_LOCALEFILE_CONTRACTID].
+ createInstance(Components.interfaces.nsILocalFile);
+ fileobj.initWithPath(filename);
- foStream.close();
-}
+ var foStream = Components.classes[FireGPGMisc.NS_NETWORKOUTPUT_CONTRACTID].
+ createInstance(Components.interfaces.nsIFileOutputStream);
-/*
- Function: getFromFile
- Get the content of a file
+ foStream.init(fileobj, FireGPGMisc.WRITE_MODE, FireGPGMisc.WRITE_PERMISSION, 0);
+ //foStream.write(data, data.length);
- Parameters:
- filename - The location of the file.
- charset - _Optional_. The charset of the file. Default to UTF-8
-*/
-function getFromFile(filename,charset) {
+ var charset = "UTF-8"; // Can be any character encoding name that Mozilla supports
- if (charset == undefined)
- charset = "UTF-8";
+ var os = Components.classes["@mozilla.org/intl/converter-output-stream;1"]
+ .createInstance(Components.interfaces.nsIConverterOutputStream);
- try {
- var fileobj = Components.classes[NS_LOCALEFILE_CONTRACTID].
- createInstance(Components.interfaces.nsILocalFile);
+ // This assumes that fos is the nsIOutputStream you want to write to
+ os.init(foStream, charset, 0, 0x0000);
- fileobj.initWithPath(filename);
+ os.writeString(data);
- var data = "";
- var fstream = Components.classes[NS_NETWORKINPUT_CONTRACTID].createInstance(Components.interfaces.nsIFileInputStream);
- //var sstream2 = Components.classes[NS_NETWORKINPUTS_CONTRACTID].
- // createInstance(Components.interfaces.nsIScriptableInputStream);
- const replacementChar = Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER;
- // var charset = /* Need to find out what the character encoding is. Using UTF-8 for this example: */ "UTF-8";
- var sstream = Components.classes["@mozilla.org/intl/converter-input-stream;1"].createInstance(Components.interfaces.nsIConverterInputStream);
+ os.close();
- fstream.init(fileobj, -1, 0, 0);
- //sstream2.init(fstream);
+ foStream.close();
+ },
- // This assumes that fis is the nsIInputStream you want to read from
- sstream.init(fstream, charset, 1024, 0xFFFD);
- var str = {};
- var lengtth = sstream.readString(4096, str);
- while (lengtth > 0) {
- data += str.value;
- lengtth = sstream.readString(4096, str);
- }
+ /*
+ Function: getFromFile
+ Get the content of a file
+
+ Parameters:
+ filename - The location of the file.
+ charset - _Optional_. The charset of the file. Default to UTF-8
+ */
+ getFromFile:function (filename,charset) {
+
+ if (charset == undefined)
+ charset = "UTF-8";
+
+ try {
+ var fileobj = Components.classes[FireGPGMisc.NS_LOCALEFILE_CONTRACTID].
+ createInstance(Components.interfaces.nsILocalFile);
+
+ fileobj.initWithPath(filename);
+
+ var data = "";
+ var fstream = Components.classes[FireGPGMisc.NS_NETWORKINPUT_CONTRACTID].createInstance(Components.interfaces.nsIFileInputStream);
+ //var sstream2 = Components.classes[FireGPGMisc.NS_NETWORKINPUTS_CONTRACTID].
+ // createInstance(Components.interfaces.nsIScriptableInputStream);
+ const replacementChar = Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER;
+ // var charset = /* Need to find out what the character encoding is. Using UTF-8 for this example: */ "UTF-8";
+ var sstream = Components.classes["@mozilla.org/intl/converter-input-stream;1"].createInstance(Components.interfaces.nsIConverterInputStream);
+
+
+ fstream.init(fileobj, -1, 0, 0);
+ //sstream2.init(fstream);
+
+ // This assumes that fis is the nsIInputStream you want to read from
+ sstream.init(fstream, charset, 1024, 0xFFFD);
+ var str = {};
+ var lengtth = sstream.readString(4096, str);
+ while (lengtth > 0) {
+ data += str.value;
+ lengtth = sstream.readString(4096, str);
+ }
- sstream.close();
- fstream.close();
+ sstream.close();
+ fstream.close();
- return data;
- }
- catch (e) { fireGPGDebug(e,'misc.getFromFile',true) }
+ return data;
+ }
+ catch (e) { fireGPGDebug(e,'misc.getFromFile',true) }
- return '';
-}
+ return '';
+ },
-/*
- Function: putIntoBinFile
- Save data to a file, in binary mode.
+ /*
+ Function: putIntoBinFile
+ Save data to a file, in binary mode.
+
+ Parameters:
+ filename - The name of the file
+ data - The data to save
+ */
+ putIntoBinFile:function (filename, data) {
+ // pngBinary already exists
+ var aFile = Components.classes["@mozilla.org/file/local;1"]
+ .createInstance(Components.interfaces.nsILocalFile);
+
+ aFile.initWithPath(filename);
+
+ var stream = Components.classes["@mozilla.org/network/safe-file-output-stream;1"]
+ .createInstance(Components.interfaces.nsIFileOutputStream);
+ stream.init(aFile, FireGPGMisc.WRITE_MODE, FireGPGMisc.WRITE_PERMISSION, 0); // write, create, truncate
+
+ stream.write(data, data.length);
+ if (stream instanceof Components.interfaces.nsISafeOutputStream) {
+ stream.finish();
+ } else {
+ stream.close();
+ }
+ },
- Parameters:
- filename - The name of the file
- data - The data to save
-*/
-function putIntoBinFile(filename, data) {
- // pngBinary already exists
- var aFile = Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile);
-
- aFile.initWithPath(filename);
-
- var stream = Components.classes["@mozilla.org/network/safe-file-output-stream;1"]
- .createInstance(Components.interfaces.nsIFileOutputStream);
- stream.init(aFile, WRITE_MODE, WRITE_PERMISSION, 0); // write, create, truncate
-
- stream.write(data, data.length);
- if (stream instanceof Components.interfaces.nsISafeOutputStream) {
- stream.finish();
- } else {
- stream.close();
- }
-}
+ /*
+ Function: getBinContent
+ Get the content of a binary file
-/*
- Function: getBinContent
- Get the content of a binary file
+ Parameters:
+ aURL - The location of the file.
+ maxData - _Optional_. The max length of data to get. {MAX} is returned if there is too data
+ */
+ getBinContent:function (aURL, maxData) {
+ var ioService = Components.classes["@mozilla.org/network/io-service;1"].
+ getService(Components.interfaces.nsIIOService);
- Parameters:
- aURL - The location of the file.
- maxData - _Optional_. The max length of data to get. {MAX} is returned if there is too data
-*/
-function getBinContent(aURL, maxData) {
- var ioService = Components.classes["@mozilla.org/network/io-service;1"].
- getService(Components.interfaces.nsIIOService);
+ var istream = Components.classes["@mozilla.org/network/file-input-stream;1"]
+ .createInstance(Components.interfaces.nsIFileInputStream);
- var istream = Components.classes["@mozilla.org/network/file-input-stream;1"]
- .createInstance(Components.interfaces.nsIFileInputStream);
+ var channel = ioService.newChannel(aURL, null, null);
- var channel = ioService.newChannel(aURL, null, null);
+ var input = channel.open();
- var input = channel.open();
+ //istream.init(input, -1, -1, false);
- //istream.init(input, -1, -1, false);
+ var bstream = Components.classes["@mozilla.org/binaryinputstream;1"]
+ .createInstance(Components.interfaces.nsIBinaryInputStream);
+ bstream.setInputStream(input);
- var bstream = Components.classes["@mozilla.org/binaryinputstream;1"]
- .createInstance(Components.interfaces.nsIBinaryInputStream);
- bstream.setInputStream(input);
+ //var bytes = bstream.readBytes(bstream.available());
+ var bytes = "";
- //var bytes = bstream.readBytes(bstream.available());
- var bytes = "";
+ while (bstream.available() != 0) {
- while (bstream.available() != 0) {
+ if (maxData != undefined && (bytes.length + bstream.available()) > maxData) {
+ bstream.close();istream.close();
+ return "{MAX}";
+ }
+ bytes += bstream.readBytes(bstream.available());
- if (maxData != undefined && (bytes.length + bstream.available()) > maxData) {
- bstream.close();istream.close();
- return "{MAX}";
}
- bytes += bstream.readBytes(bstream.available());
-
- }
-
- return bytes;
-}
-/*
- Function: getContent
- Get the content of a resource form anywhere (like chrome://)
+ return bytes;
+ },
- Parameters:
- aURL - The location of the resource.
-*/
-function getContent(aURL){
- var ioService = Components.classes["@mozilla.org/network/io-service;1"].
- getService(Components.interfaces.nsIIOService);
- var scriptableStream = Components.classes["@mozilla.org/scriptableinputstream;1"].
- getService(Components.interfaces.nsIScriptableInputStream);
- var channel = ioService.newChannel(aURL, null, null);
+ /*
+ Function: getContent
+ Get the content of a resource form anywhere (like chrome://)
+
+ Parameters:
+ aURL - The location of the resource.
+ */
+ getContent:function (aURL){
+ var ioService = Components.classes["@mozilla.org/network/io-service;1"].
+ getService(Components.interfaces.nsIIOService);
+ var scriptableStream = Components.classes["@mozilla.org/scriptableinputstream;1"].
+ getService(Components.interfaces.nsIScriptableInputStream);
+ var channel = ioService.newChannel(aURL, null, null);
+
+ var input = channel.open();
+ scriptableStream.init(input);
+
+ var str = scriptableStream.read(input.available());
+ scriptableStream.close();
+ input.close();
- var input = channel.open();
- scriptableStream.init(input);
+ return str;
+ },
- var str = scriptableStream.read(input.available());
- scriptableStream.close();
- input.close();
- return str;
-}
+ /*
+ Function: getContentXtttp
+ Get the content of a web resource by using a xmlhttprequest.
+ Parameters:
+ url - The url of the resource
+ */
+ getContentXHttp:function (url)
+ {
+ p = new XMLHttpRequest();
+ p.onload = null;
+ p.open("GET", url, false);
+ p.send(null);
-/*
- Function: getContentXtttp
- Get the content of a web resource by using a xmlhttprequest.
+ if ( p.status != "200" )
+ {
+ return null;
+ }
+ else
+ {
+ contenu = p.responseText;
+ return contenu;
+ }
+ },
- Parameters:
- url - The url of the resource
-*/
-function getContentXHttp(url)
-{
- p = new XMLHttpRequest();
- p.onload = null;
- p.open("GET", url, false);
- p.send(null);
-
- if ( p.status != "200" )
- {
- return null;
- }
- else
- {
- contenu = p.responseText;
- return contenu;
- }
-}
+ /*
+ Function: testIfSomethingsIsNew
+ Test if user update FireGPG or if he have to update, and show the What is new page send a ping or propose to update FireGPG if relevant.
+ */
+ testIfSomethingsIsNew:function () {
+ var prefs = Components.classes["@mozilla.org/preferences-service;1"].
+ getService(Components.interfaces.nsIPrefService);
+ prefs = prefs.getBranch("extensions.firegpg.");
-/*
- Function: testIfSomethingsIsNew
- Test if user update FireGPG or if he have to update, and show the What is new page send a ping or propose to update FireGPG if relevant.
-*/
-function testIfSomethingsIsNew() {
- var prefs = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefService);
- prefs = prefs.getBranch("extensions.firegpg.");
+ /* Should we show the assistant ? */
+ var assistant = "";
+ try {
+ assistant = prefs.getBoolPref("assisant_has_already_been_executed");
+ } catch (e) { assistant = false}
- /* Should we show the assistant ? */
- var assistant = "";
- try {
- assistant = prefs.getBoolPref("assisant_has_already_been_executed");
- } catch (e) { assistant = false}
+ if (!assistant) {
+ window.openDialog('chrome://firegpg/content/Dialogs/Assistant/1-welcome.xul','', 'chrome, dialog, resizable=false').focus();
+ prefs.setBoolPref("assisant_has_already_been_executed",true)
+ }
- if (!assistant) {
- window.openDialog('chrome://firegpg/content/Dialogs/Assistant/1-welcome.xul','', 'chrome, dialog, resizable=false').focus();
- prefs.setBoolPref("assisant_has_already_been_executed",true)
- }
+ //Check des versions
+ var version = "";
+ try {
+ version = prefs.getCharPref("gpg_version");
+ } catch (e) { }
- //Check des versions
- var version = "";
- try {
- version = prefs.getCharPref("gpg_version");
- } catch (e) { }
+ var em = Components.classes["@mozilla.org/extensions/manager;1"]
+ .getService(Components.interfaces.nsIExtensionManager);
- var em = Components.classes["@mozilla.org/extensions/manager;1"]
- .getService(Components.interfaces.nsIExtensionManager);
+ var addon = em.getItemForID("firegpg@firegpg.team");
+ var versionAct = addon.version;
- var addon = em.getItemForID("firegpg@firegpg.team");
- var versionAct = addon.version;
+ versionAct = FIREGPG_VERSION;
- versionAct = FIREGPG_VERSION;
+ var i18n = document.getElementById("firegpg-strings");
- var i18n = document.getElementById("firegpg-strings");
+ if (version != versionAct)
+ {
+ prefs.setCharPref("gpg_version",versionAct)
- if (version != versionAct)
- {
- prefs.setCharPref("gpg_version",versionAct)
+ /*var title = "FireGPG - What is new ?";
+ var description = "What is new in FireGPG ? (An anonymous ping has been send to FireGPG's team for stats.)";
+ try {
- /*var title = "FireGPG - What is new ?";
- var description = "What is new in FireGPG ? (An anonymous ping has been send to FireGPG's team for stats.)";
- try {
+ title = i18n.getString('whatIsNewTitle');
+ description = i18n.getString('whatIsNewDescription');
+ } catch (e) { }
- title = i18n.getString('whatIsNewTitle');
- description = i18n.getString('whatIsNewDescription');
- } catch (e) { }
+ //FireGPGMisc.showText(FireGPGMisc.getContent("chrome://firegpg/content/whatisnew.txt"),description,title,true);*/
- //showText(getContent("chrome://firegpg/content/whatisnew.txt"),description,title,true);*/
+ //Show the page
+ gBrowser.selectedTab = gBrowser.addTab("http://getfiregpg.org/s/justupdated/" + versionAct);
- //Show the page
- gBrowser.selectedTab = gBrowser.addTab("http://getfiregpg.org/s/justupdated/" + versionAct);
+ //Send the ping
- //Send the ping
+ if (version == "")
+ var mode = "New";
+ else
+ var mode = version;
- if (version == "")
- var mode = "New";
- else
- var mode = version;
+ var misc = FireGPGMisc.getContent("http://getfiregpg.org/stable/stats.php?version=" + versionAct + "&oldversion=" + mode);
- var misc = getContent("http://getfiregpg.org/stable/stats.php?version=" + versionAct + "&oldversion=" + mode);
+ } else {
- } else {
+ //DESACTIVED FOR ADDON.MOZILLA.ORG/*
- //DESACTIVED FOR ADDON.MOZILLA.ORG/*
+ //Try to find an update, if it's needed.
+ var noUpdates = false;
+ try {
+ noUpdates = prefs.getBoolPref("no_updates");
+ } catch (e) { }
- //Try to find an update, if it's needed.
- var noUpdates = false;
- try {
- noUpdates = prefs.getBoolPref("no_updates");
- } catch (e) { }
+ if (!noUpdates)
+ {
- if (!noUpdates)
- {
+ if (FireGPGMisc.updateAvailable) {
+ if (document.getElementById('firegpg-statusbar-update'))
+ document.getElementById('firegpg-statusbar-update').style.display = '';
- if (updateAvailable) {
- if (document.getElementById('firegpg-statusbar-update'))
- document.getElementById('firegpg-statusbar-update').style.display = '';
+ } else {
+ var Stamp = new Date();
+ var nbMs = Stamp.getTime();
- } else {
- var Stamp = new Date();
- var nbMs = Stamp.getTime();
+ var lastUpdate = 0;
- var lastUpdate = 0;
+ try {
+ lastUpdate = parseInt(prefs.getCharPref("lastUpdateCheck"));
+ } catch (e) { }
- try {
- lastUpdate = parseInt(prefs.getCharPref("lastUpdateCheck"));
- } catch (e) { }
+ //Not A Number
+ if (isNaN(lastUpdate))
+ lastUpdate = 0;
+ //One day
+ if (lastUpdate < (nbMs - (24 * 60 * 60 * 1000)))
+ {
- //Not A Number
- if (isNaN(lastUpdate))
- lastUpdate = 0;
- //One day
- if (lastUpdate < (nbMs - (24 * 60 * 60 * 1000)))
- {
+ prefs.setCharPref("lastUpdateCheck",nbMs);
- prefs.setCharPref("lastUpdateCheck",nbMs);
+ //Get the last version
+ var updateData = FireGPGMisc.getContent("http://getfiregpg.org/stable/update.rdf");
- //Get the last version
- var updateData = getContent("http://getfiregpg.org/stable/update.rdf");
+ var toDetect = "NS1:version=\"" + versionAct + "\"";
- var toDetect = "NS1:version=\"" + versionAct + "\"";
+ if (updateData.indexOf('ec8030f7-c20a-464f-9b0e-13a3a9e97384') != -1 && updateData.indexOf(toDetect) == -1)
+ {
+ if (document.getElementById('firegpg-statusbar-update') != null) {
+ document.getElementById('firegpg-statusbar-update').style.display = '';
+ FireGPGMisc.updateAvailable = true;
+ } else {
+ FireGPGMisc.showUpdateDialog();
+ }
- if (updateData.indexOf('ec8030f7-c20a-464f-9b0e-13a3a9e97384') != -1 && updateData.indexOf(toDetect) == -1)
- {
- if (document.getElementById('firegpg-statusbar-update') != null) {
- document.getElementById('firegpg-statusbar-update').style.display = '';
- updateAvailable = true;
- } else {
- showUpdateDialog();
}
-
}
}
- }
- }
- //*/
- }
-}
+ }
+ //*/
+ }
+ },
-/*
-Function: showUpdateDialog
-Show the update dialog to let user update FireGPG
-*/
-function showUpdateDialog() {
+ /*
+ Function: showUpdateDialog
+ Show the update dialog to let user update FireGPG
+ */
+ showUpdateDialog:function () {
- var i18n = document.getElementById("firegpg-strings");
+ var i18n = document.getElementById("firegpg-strings");
- var newVersion = "A new version of FireGPG is available, would you like to update now?";
+ var newVersion = "A new version of FireGPG is available, would you like to update now?";
- try {
+ try {
- newVersion = i18n.getString('newVersionAlert');
- } catch (e) { }
+ newVersion = i18n.getString('newVersionAlert');
+ } catch (e) { }
- if (confirm(newVersion))
- {
- openUILink("http://getfiregpg.org/stable/firegpg.xpi");
+ if (confirm(newVersion))
+ {
+ openUILink("http://getfiregpg.org/stable/firegpg.xpi");
- }
+ }
- updateAvailable = false;
+ FireGPGMisc.updateAvailable = false;
- if (document.getElementById('firegpg-statusbar-update') != null)
- document.getElementById('firegpg-statusbar-update').style.display = 'none';
+ if (document.getElementById('firegpg-statusbar-update') != null)
+ document.getElementById('firegpg-statusbar-update').style.display = 'none';
-}
-/*
- Function: htmlEncode
- Encode special chars (&, <, > et ") to they html values.
+ },
+ /*
+ Function: htmlEncode
+ Encode special chars (&, <, > et ") to they html values.
+
+ Parameters:
+ s - The text.
+ */
+ htmlEncode:function (s) {
+ var str = new String(s);
+ str = str.replace(/&/g, "&amp;");
+ str = str.replace(/</g, "&lt;");
+ str = str.replace(/>/g, "&gt;");
+ str = str.replace(/"/g, "&quot;");
+ return str;
+ },
- Parameters:
- s - The text.
-*/
-function htmlEncode(s) {
- var str = new String(s);
- str = str.replace(/&/g, "&amp;");
- str = str.replace(/</g, "&lt;");
- str = str.replace(/>/g, "&gt;");
- str = str.replace(/"/g, "&quot;");
- return str;
-}
+ /*
+ Function: gmailWrapping
-/*
- Function: gmailWrapping
+ This fuction approximates gmail's line-wrapping rules, so that
+ a message can be wrapped before it's signed, instead of after,
+ which would break the signature.
- This fuction approximates gmail's line-wrapping rules, so that
- a message can be wrapped before it's signed, instead of after,
- which would break the signature.
+ Parameters:
+ text - The text.
- Parameters:
- text - The text.
+ */
+ gmailWrapping:function (text)
+ {
+ var lines = text.split("\n");
+ var result = "";
-*/
-function gmailWrapping(text)
-{
- var lines = text.split("\n");
- var result = "";
-
- // Wrap each line
- for (var i = 0; i < lines.length; i++)
- {
- // gmail doesn't wrap lines with less than 81 characters
- // or lines that have been quoted from previous messages
- // in the usual way, so we don't bother either.
- if (lines[i].length <= 80 || lines[i].substring(0,2) == "> ")
- result = result + lines[i] + "\n";
- else
- // If we're wrapping a line, each of the resulting
- // lines shouldn't be longer than 70 characters
- // unless it has to be.
- result = result + wrap(lines[i], 70) + "\n";
- }
-
- return result;
-}
+ // Wrap each line
+ for (var i = 0; i < lines.length; i++)
+ {
+ // gmail doesn't wrap lines with less than 81 characters
+ // or lines that have been quoted from previous messages
+ // in the usual way, so we don't bother either.
+ if (lines[i].length <= 80 || lines[i].substring(0,2) == "> ")
+ result = result + lines[i] + "\n";
+ else
+ // If we're wrapping a line, each of the resulting
+ // lines shouldn't be longer than 70 characters
+ // unless it has to be.
+ result = result + FireGPGMisc.wrap(lines[i], 70) + "\n";
+ }
-/*
- Function: wrap
+ return result;
+ },
- This function wraps a single line of text into multiple lines,
- each no longer than limit, unless a single word is too long.
+ /*
+ Function: wrap
- Parameters:
- text - The text.
- limit - The maximum characters for one line.
+ This function wraps a single line of text into multiple lines,
+ each no longer than limit, unless a single word is too long.
+ Parameters:
+ text - The text.
+ limit - The maximum characters for one line.
-*/
-function wrap(text, limit)
-{
- var result = "";
-
- // Keep wrapping until the remainder is short enough.
- while (text.length > limit)
- {
- var index = text.lastIndexOf(" ", limit);
- // If the first word is too long, look for the first space
- if (index == -1)
- index = text.indexOf(" ");
- // If there are no more spaces at all, give up.
- if (index == -1)
- {
- break;
- }
- else
- {
- result = result + text.substring(0, index) + "\n";
- text = text.substring(index + 1);
- }
- }
-
- return result + text;
-}
-/*
- Function: genreate_api_key
+ */
+ wrap:function (text, limit)
+ {
+ var result = "";
- Generate and random string between 64 and 128 charactes, probably unique.
- This is usefull for the api.
-*/
-function genreate_api_key() {
- var validchars = "";
- var startvalid = "";
-
- var minsize, maxsize, count, actualsize, random_value;
- minsize = parseInt( 64 );
- maxsize = parseInt( 128 );
- startvalid = "";
- validchars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
- actualsize = Math.floor( Math.random() * ( maxsize - minsize + 1 ) ) + minsize;
- random_value = startvalid.charAt( Math.floor( Math.random() * startvalid.length ) );
- for (count = 1; count < actualsize; count++){
- random_value += validchars.charAt( Math.floor( Math.random() * validchars.length ) );
- }
- return random_value;
-}
+ // Keep wrapping until the remainder is short enough.
+ while (text.length > limit)
+ {
+ var index = text.lastIndexOf(" ", limit);
+ // If the first word is too long, look for the first space
+ if (index == -1)
+ index = text.indexOf(" ");
+ // If there are no more spaces at all, give up.
+ if (index == -1)
+ {
+ break;
+ }
+ else
+ {
+ result = result + text.substring(0, index) + "\n";
+ text = text.substring(index + 1);
+ }
+ }
-/*
- Function: trim
- Remove extra space at the end and the begging of the string.
+ return result + text;
+ },
- Parameters:
- str - The string
-*/
-function trim (str){
- return str.replace(/^\s+/, "").replace(/\s+$/, "");
-}
+ /*
+ Function: genreate_api_key
+
+ Generate and random string between 64 and 128 charactes, probably unique.
+ This is usefull for the api.
+ */
+ genreate_api_key:function () {
+ var validchars = "";
+ var startvalid = "";
+
+ var minsize, maxsize, count, actualsize, random_value;
+ minsize = parseInt( 64 );
+ maxsize = parseInt( 128 );
+ startvalid = "";
+ validchars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+ actualsize = Math.floor( Math.random() * ( maxsize - minsize + 1 ) ) + minsize;
+ random_value = startvalid.charAt( Math.floor( Math.random() * startvalid.length ) );
+ for (count = 1; count < actualsize; count++){
+ random_value += validchars.charAt( Math.floor( Math.random() * validchars.length ) );
+ }
+ return random_value;
+ },
-/*
- Function: TrimAndWash
- Remove extra space at the end and the begging of the string, and remove \n
+ /*
+ Function: trim
+ Remove extra space at the end and the begging of the string.
+
+ Parameters:
+ str - The string
+ */
+ trim :function (str){
+ return str.replace(/^\s+/, "").replace(/\s+$/, "");
+ },
- Parameters:
- str - The string
-*/
-function TrimAndWash(str) {
- return trim(str).replace(/\n/, "");
-}
+ /*
+ Function: TrimAndWash
+ Remove extra space at the end and the begging of the string, and remove \n
+
+ Parameters:
+ str - The string
+ */
+ TrimAndWash:function (str) {
+ return FireGPGMisc.trim(str).replace(/\n/, "");
+ },
-/*
- Function: EnigConvertGpgToUnicode
+ /*
+ Function: EnigConvertGpgToUnicode
- Convert the gpg --with-collums text (who are strangly encoded) into a uniform Unicode string.
+ Convert the gpg --with-collums text (who are strangly encoded) into a uniform Unicode string.
- This function is from Enigmail, same license as FireGPG.
+ This function is from Enigmail, same license as FireGPG.
- Parameters:
- text - The text to convert
-*/
-function EnigConvertGpgToUnicode(text) {
+ Parameters:
+ text - The text to convert
+ */
+ EnigConvertGpgToUnicode:function (text) {
- try {
+ try {
- if (typeof(text)=="string") {
- text = text.replace(/\\x3a/ig, "\\e3A");
- a=text.search(/\\x[0-9a-fA-F]{2}/);
- while (a>=0) {
- ch=unescape('%'+text.substr(a+2,2));
- r= new RegExp("\\"+text.substr(a,4));
- text=text.replace(r, ch);
+ if (typeof(text)=="string") {
+ text = text.replace(/\\x3a/ig, "\\e3A");
a=text.search(/\\x[0-9a-fA-F]{2}/);
+ while (a>=0) {
+ ch=unescape('%'+text.substr(a+2,2));
+ r= new RegExp("\\"+text.substr(a,4));
+ text=text.replace(r, ch);
+ a=text.search(/\\x[0-9a-fA-F]{2}/);
+ }
}
- }
- text = EnigConvertToUnicode(text, "utf-8");
-
- } catch (ex) { fireGPGDebug(ex,'misc.EnigConvertGpgToUnicode',true); }
-
- return text;
-}
+ text = FireGPGMisc.EnigConvertToUnicode(text, "utf-8");
-/*
- Function: EnigConvertToUnicode
+ } catch (ex) { fireGPGDebug(ex,'misc.EnigConvertGpgToUnicode',true); }
- Convert the text, in the specified chaset, into an Unicode string.
- This function is from Enigmail, same license as FireGPG.
+ return text;
+ },
- Parameters:
- text - The text to convert
- charset - The charset of the text.
-*/
-function EnigConvertToUnicode(text, charset) {
- if (!text || !charset || (charset.toLowerCase() == "iso-8859-1"))
- return text;
+ /*
+ Function: EnigConvertToUnicode
- // Encode plaintext
- try {
- var unicodeConv = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].getService(Components.interfaces.nsIScriptableUnicodeConverter);
+ Convert the text, in the specified chaset, into an Unicode string.
+ This function is from Enigmail, same license as FireGPG.
- unicodeConv.charset = charset;
+ Parameters:
+ text - The text to convert
+ charset - The charset of the text.
+ */
+ EnigConvertToUnicode:function (text, charset) {
+ if (!text || !charset || (charset.toLowerCase() == "iso-8859-1"))
+ return text;
- return unicodeConv.ConvertToUnicode(text);
+ // Encode plaintext
+ try {
+ var unicodeConv = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].getService(Components.interfaces.nsIScriptableUnicodeConverter);
- } catch (ex) {
- fireGPGDebug(ex,'misc.EnigConvertToUnicode',true);
- return text;
- }
-}
+ unicodeConv.charset = charset;
-/*
- Function: EnigConvertFromUnicode
+ return unicodeConv.ConvertToUnicode(text);
- Convert the text, in unicode, into an string in the specified chaset.
- This function is from Enigmail, same license as FireGPG.
+ } catch (ex) {
+ fireGPGDebug(ex,'misc.EnigConvertToUnicode',true);
+ return text;
+ }
+ },
- Parameters:
- text - The text to convert
- charset - The charset of the text.
-*/
-function EnigConvertFromUnicode(text, charset) {
- if (!text || !charset || (charset.toLowerCase() == "iso-8859-1"))
- return text;
+ /*
+ Function: EnigConvertFromUnicode
- // Encode plaintext
- try {
- var unicodeConv = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].getService(Components.interfaces.nsIScriptableUnicodeConverter);
+ Convert the text, in unicode, into an string in the specified chaset.
+ This function is from Enigmail, same license as FireGPG.
- unicodeConv.charset = charset;
+ Parameters:
+ text - The text to convert
+ charset - The charset of the text.
+ */
+ EnigConvertFromUnicode:function (text, charset) {
+ if (!text || !charset || (charset.toLowerCase() == "iso-8859-1"))
+ return text;
- return unicodeConv.ConvertFromUnicode(text);
+ // Encode plaintext
+ try {
+ var unicodeConv = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].getService(Components.interfaces.nsIScriptableUnicodeConverter);
- } catch (ex) {
- fireGPGDebug(ex,'misc.EnigConvertFromUnicode',true);
- return text;
- }
-}
+ unicodeConv.charset = charset;
+ return unicodeConv.ConvertFromUnicode(text);
+ } catch (ex) {
+ fireGPGDebug(ex,'misc.EnigConvertFromUnicode',true);
+ return text;
+ }
+ },
-/*
- Function: CreateTreeItemKey
- Return a Treeitem for the key in parameter
- Parameters:
- key - The key
- document - The current document.
- forceId - If we have to force the id of the key
-*/
-function CreateTreeItemKey(key, document, forceId) {
- var item = document.createElement('treeitem');
+ /*
+ Function: CreateTreeItemKey
- var row = document.createElement('treerow');
+ Return a Treeitem for the key in parameter
- var child1 = document.createElement('treecell');
- child1.setAttribute('label', key.keyName);
- row.appendChild(child1);
+ Parameters:
+ key - The key
+ document - The current document.
+ forceId - If we have to force the id of the key
+ */
+ CreateTreeItemKey:function (key, document, forceId) {
+ var item = document.createElement('treeitem');
- var child2 = document.createElement('treecell');
- child2.setAttribute('label', key.keyId);
- row.appendChild(child2);
+ var row = document.createElement('treerow');
- var child3 = document.createElement('treecell');
- child3.setAttribute('label', key.keyDate);
- row.appendChild(child3);
+ var child1 = document.createElement('treecell');
+ child1.setAttribute('label', key.keyName);
+ row.appendChild(child1);
- var child4 = document.createElement('treecell');
- child4.setAttribute('label', key.keyExpi);
- row.appendChild(child4);
+ var child2 = document.createElement('treecell');
+ child2.setAttribute('label', key.keyId);
+ row.appendChild(child2);
- var id = key.keyId;
+ var child3 = document.createElement('treecell');
+ child3.setAttribute('label', key.keyDate);
+ row.appendChild(child3);
- if (forceId != undefined)
- id = forceId;
+ var child4 = document.createElement('treecell');
+ child4.setAttribute('label', key.keyExpi);
+ row.appendChild(child4);
- row.setAttribute('gpg-id', id);
+ var id = key.keyId;
- item.appendChild(row);
+ if (forceId != undefined)
+ id = forceId;
+ row.setAttribute('gpg-id', id);
+ item.appendChild(row);
- return item;
-}
+ return item;
-/*
- Function: CreateTreeItemKey2
+ },
- Return a Treeitem for the key in parameter
- Parameters:
- key - The key
- document - The current document.
- forceId - If we have to force the id of the key
- privateKey - True if it's a private key
- subkey - True if it's a subkey
-*/
-function CreateTreeItemKey2(key, document, forceId, privateKey, subkey) {
+ /*
+ Function: CreateTreeItemKey2
+ Return a Treeitem for the key in parameter
- var turstList = new Array();
- turstList['-'] = 'trustUndef';
- turstList['q'] = 'trustUndef';
- turstList['n'] = 'trustDont';
- turstList['m'] = 'trustMargi';
- turstList['f'] = 'trustFull';
- turstList['u'] = 'trustUltimate';
- turstList['e'] = 'trustExpired';
- turstList['r'] = 'trustRevoqued';
+ Parameters:
+ key - The key
+ document - The current document.
+ forceId - If we have to force the id of the key
+ privateKey - True if it's a private key
+ subkey - True if it's a subkey
+ */
+ CreateTreeItemKey2:function (key, document, forceId, privateKey, subkey) {
- var item = document.createElement('treeitem');
+ var turstList = new Array();
+ turstList['-'] = 'trustUndef';
+ turstList['q'] = 'trustUndef';
+ turstList['n'] = 'trustDont';
+ turstList['m'] = 'trustMargi';
+ turstList['f'] = 'trustFull';
+ turstList['u'] = 'trustUltimate';
+ turstList['e'] = 'trustExpired';
+ turstList['r'] = 'trustRevoqued';
- var row = document.createElement('treerow');
- var child1 = document.createElement('treecell');
- child1.setAttribute('label', key.keyName);
- child1 = setSkinForKey(key, child1, privateKey);
- row.appendChild(child1);
+ var item = document.createElement('treeitem');
- var child2 = document.createElement('treecell');
- child2.setAttribute('label', key.keyId);
- child2 = setSkinForKey(key, child2, privateKey);
- row.appendChild(child2);
+ var row = document.createElement('treerow');
- var child3 = document.createElement('treecell');
- child3.setAttribute('label', key.keyDate);
- child3 = setSkinForKey(key, child3, privateKey);
- row.appendChild(child3);
+ var child1 = document.createElement('treecell');
+ child1.setAttribute('label', key.keyName);
+ child1 = FireGPGMisc.setSkinForKey(key, child1, privateKey);
+ row.appendChild(child1);
- var child4 = document.createElement('treecell');
- child4.setAttribute('label', key.keyExpi);
- child4 = setSkinForKey(key, child4, privateKey);
- row.appendChild(child4);
+ var child2 = document.createElement('treecell');
+ child2.setAttribute('label', key.keyId);
+ child2 = FireGPGMisc.setSkinForKey(key, child2, privateKey);
+ row.appendChild(child2);
- var child5 = document.createElement('treecell');
- child5.setAttribute('label', document.getElementById('firegpg-strings').
- getString(turstList[key.keyTrust]));
+ var child3 = document.createElement('treecell');
+ child3.setAttribute('label', key.keyDate);
+ child3 = FireGPGMisc.setSkinForKey(key, child3, privateKey);
+ row.appendChild(child3);
- child5 = setSkinForKey(key, child5, privateKey);
+ var child4 = document.createElement('treecell');
+ child4.setAttribute('label', key.keyExpi);
+ child4 = FireGPGMisc.setSkinForKey(key, child4, privateKey);
+ row.appendChild(child4);
- if (key.revoked) {
+ var child5 = document.createElement('treecell');
child5.setAttribute('label', document.getElementById('firegpg-strings').
- getString(turstList['r']));
- }
+ getString(turstList[key.keyTrust]));
- row.appendChild(child5);
+ child5 = FireGPGMisc.setSkinForKey(key, child5, privateKey);
+ if (key.revoked) {
+ child5.setAttribute('label', document.getElementById('firegpg-strings').
+ getString(turstList['r']));
+ }
- var id = key.keyId;
+ row.appendChild(child5);
- if (forceId != undefined)
- id = forceId;
- row.setAttribute('gpg-id', id);
- row.setAttribute('gpg-rid', key.keyId);
+ var id = key.keyId;
- row.setAttribute('gpg-fingerprint', key.fingerPrint);
+ if (forceId != undefined)
+ id = forceId;
- if (privateKey == true)
- row.setAttribute('gpg-privatekey', 'privatekey');
+ row.setAttribute('gpg-id', id);
+ row.setAttribute('gpg-rid', key.keyId);
- if (key.revoked)
- row.setAttribute('gpg-revokedkey', 'revokedkey');
+ row.setAttribute('gpg-fingerprint', key.fingerPrint);
- if (subkey)
- row.setAttribute('gpg-subkey', 'subkey');
+ if (privateKey == true)
+ row.setAttribute('gpg-privatekey', 'privatekey');
+ if (key.revoked)
+ row.setAttribute('gpg-revokedkey', 'revokedkey');
- item.appendChild(row);
+ if (subkey)
+ row.setAttribute('gpg-subkey', 'subkey');
+ item.appendChild(row);
- return item;
-}
+ return item;
-/*
-Function: setSkinForKey
-Set the correct class of a key, using his status (private, revoked)
-Parameters:
- key - The key
- child - The element
- privateKEy - True if it's a private key
-*/
-function setSkinForKey(key, child, privateKey) {
+ },
- if (privateKey == true)
- child.setAttribute('properties', 'privatekey');
+ /*
+ Function: setSkinForKey
+ Set the correct class of a key, using his status (private, revoked)
- if (key.revoked)
- child.setAttribute('properties', 'revokedkey');
+ Parameters:
+ key - The key
+ child - The element
+ privateKEy - True if it's a private key
+ */
+ setSkinForKey:function (key, child, privateKey) {
- if (key.revoked && privateKey)
- child.setAttribute('properties', 'revokedprivatekey');
+ if (privateKey == true)
+ child.setAttribute('properties', 'privatekey');
- return child;
+ if (key.revoked)
+ child.setAttribute('properties', 'revokedkey');
-}
+ if (key.revoked && privateKey)
+ child.setAttribute('properties', 'revokedprivatekey');
-/*
- Function: CreateTreeItemKey3
- Return a Treeitem for the key in parameter
-
- Parameters:
- key - The key
- document - The current document.
- mainKey - The partent key of the key
- sign - The sign of the key
- havePrivate - If the user have the private key
-*/
-function CreateTreeItemKey3(key, document, mainKey, sign, havePrivate) {
+ return child;
- var item = document.createElement('treeitem');
+ },
- var row = document.createElement('treerow');
+ /*
+ Function: CreateTreeItemKey3
+ Return a Treeitem for the key in parameter
- var child1 = document.createElement('treecell');
- child1.setAttribute('label', key.keyName);
- child1 = setSkinForKey2(key, child1, mainKey, sign, havePrivate);
- row.appendChild(child1);
+ Parameters:
+ key - The key
+ document - The current document.
+ mainKey - The partent key of the key
+ sign - The sign of the key
+ havePrivate - If the user have the private key
+ */
+ CreateTreeItemKey3:function (key, document, mainKey, sign, havePrivate) {
- var child2 = document.createElement('treecell');
- child2.setAttribute('label', key.keyId);
- child2 = setSkinForKey2(key, child2, mainKey, sign, havePrivate);
- row.appendChild(child2);
+ var item = document.createElement('treeitem');
- var child3 = document.createElement('treecell');
- child3.setAttribute('label', key.keyDate);
- child3 = setSkinForKey2(key, child3, mainKey, sign, havePrivate);
- row.appendChild(child3);
+ var row = document.createElement('treerow');
+ var child1 = document.createElement('treecell');
+ child1.setAttribute('label', key.keyName);
+ child1 = FireGPGMisc.setSkinForKey2(key, child1, mainKey, sign, havePrivate);
+ row.appendChild(child1);
+ var child2 = document.createElement('treecell');
+ child2.setAttribute('label', key.keyId);
+ child2 = FireGPGMisc.setSkinForKey2(key, child2, mainKey, sign, havePrivate);
+ row.appendChild(child2);
- var id = key.keyId;
+ var child3 = document.createElement('treecell');
+ child3.setAttribute('label', key.keyDate);
+ child3 = FireGPGMisc.setSkinForKey2(key, child3, mainKey, sign, havePrivate);
+ row.appendChild(child3);
- row.setAttribute('gpg-id', id);
- if (sign && havePrivate)
- row.setAttribute('gpg-haveprivate', 'haveprivate');
+ var id = key.keyId;
- item.appendChild(row);
+ row.setAttribute('gpg-id', id);
+ if (sign && havePrivate)
+ row.setAttribute('gpg-haveprivate', 'haveprivate');
- return item;
+ item.appendChild(row);
-}
-/*
- Function: setSkinForKey2
- Set class for a node with the key attribute
-
- Parameters:
- key - The key
- child - The node
- mainKey - The partent key of the key
- sign - The sign of the key
- havePrivate - If the user have the private key
-*/
-function setSkinForKey2(key, child, mainKey, sign, havePrivate) {
+ return item;
- if (mainKey == true)
- child.setAttribute('properties', 'mainkey');
- if (mainKey == false && sign == false)
- child.setAttribute('properties', 'subkey');
+ },
- if (sign == true)
- child.setAttribute('properties', 'sign');
+ /*
+ Function: setSkinForKey2
+ Set class for a node with the key attribute
- if (sign && havePrivate)
- child.setAttribute('properties', 'signwithprivatekey');
+ Parameters:
+ key - The key
+ child - The node
+ mainKey - The partent key of the key
+ sign - The sign of the key
+ havePrivate - If the user have the private key
+ */
+ setSkinForKey2:function (key, child, mainKey, sign, havePrivate) {
- return child;
+ if (mainKey == true)
+ child.setAttribute('properties', 'mainkey');
-}
+ if (mainKey == false && sign == false)
+ child.setAttribute('properties', 'subkey');
-/*
- Function: getKeyServer
- Return the current key server
-*/
-function getKeyServer() {
+ if (sign == true)
+ child.setAttribute('properties', 'sign');
- var prefs = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefService);
-
- prefs = prefs.getBranch("extensions.firegpg.");
- try {
- keyserver = prefs.getCharPref("keyserver");
- } catch (e) {
- keyserver = "";
- }
-
- if (keyserver == "") {
- keyserver = "subkeys.pgp.net";
- prefs.setCharPref("keyserver", "subkeys.pgp.net");
- }
+ if (sign && havePrivate)
+ child.setAttribute('properties', 'signwithprivatekey');
- return keyserver;
+ return child;
+ },
-}
+ /*
+ Function: getKeyServer
+ Return the current key server
+ */
+ getKeyServer:function () {
+
+ var prefs = Components.classes["@mozilla.org/preferences-service;1"].
+ getService(Components.interfaces.nsIPrefService);
+
+ prefs = prefs.getBranch("extensions.firegpg.");
+ try {
+ keyserver = prefs.getCharPref("keyserver");
+ } catch (e) {
+ keyserver = "";
+ }
-/*
- Function: showSearchBox
- Show the dialog box to search key
+ if (keyserver == "") {
+ keyserver = "subkeys.pgp.net";
+ prefs.setCharPref("keyserver", "subkeys.pgp.net");
+ }
- Paramters:
- autoSearch - Preset the search field
-*/
-function showSearchBox(autoSearch) {
+ return keyserver;
- window.openDialog("chrome://firegpg/content/Dialogs/Keymanager/searchkey.xul", "searchBox", "chrome,centerscreen", {autoSearch: autoSearch}).focus();
+ },
-}
+ /*
+ Function: showSearchBox
+ Show the dialog box to search key
-/*
- Function: convertCRLFToStandarts
- Convert CR to CRLF, LF to CRLF and keep CRLF
+ Paramters:
+ autoSearch - Preset the search field
+ */
+ showSearchBox:function (autoSearch) {
- Parameters:
- text - The text
-*/
-function convertCRLFToStandarts(text) {
- //Standarts say: \r\n, stoo.
- text = text.replace(/\r\n/ig, "\n"); // \r\n -> \n
- text = text.replace(/\r/ig, "\n"); // \r -> \n
+ window.openDialog("chrome://firegpg/content/Dialogs/Keymanager/searchkey.xul", "searchBox", "chrome,centerscreen", {autoSearch: autoSearch}).focus();
- text = text.replace(/\n/ig, "\r\n"); // \n -> \r\n
+ },
- return text;
+ /*
+ Function: convertCRLFToStandarts
+ Convert CR to CRLF, LF to CRLF and keep CRLF
+ Parameters:
+ text - The text
+ */
+ convertCRLFToStandarts:function (text) {
+ //Standarts say: \r\n, stoo.
+ text = text.replace(/\r\n/ig, "\n"); // \r\n -> \n
+ text = text.replace(/\r/ig, "\n"); // \r -> \n
-}
+ text = text.replace(/\n/ig, "\r\n"); // \n -> \r\n
-/*
- Function: dumper
- This function was inspired by the print_r function of PHP.
- This will accept some data as the argument and return a
- text that will be a more readable version of the
- array/hash/object that is given.
+ return text;
- Paramters:
- arr - The object
- level - The current level of the dump
-*/
-function dumper(arr,level) {
- var dumped_text = "";
-
- if(!level) level = 0;
-
- //The padding given at the beginning of the line.
- var level_padding = "";
- for(var j=0;j<level+1;j++) level_padding += " ";
-
- if(typeof(arr) == 'object') { //Array/Hashes/Objects
- for(var item in arr) {
- var value = arr[item];
-
- if(typeof(value) == 'object') { //If it is an array,
- dumped_text += level_padding + "'" + item + "' ...\n";
- dumped_text += dumper(value,level+1);
- } else {
- dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
- }
- }
- } else { //Stings/Chars/Numbers etc.
- dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
- }
- return dumped_text;
-}
-/*
- Function: dump2
- Show an array or an object in a console
+ },
- Parameters:
- o - The object
-*/
-function dump2(o) {
+ /*
+ Function: dumper
+ This function was inspired by the print_r function of PHP.
+ This will accept some data as the argument and return a
+ text that will be a more readable version of the
+ array/hash/object that is given.
+
+ Paramters:
+ arr - The object
+ level - The current level of the dump
+
+ */
+ dumper:function (arr,level) {
+ var dumped_text = "";
+
+ if(!level) level = 0;
+
+ //The padding given at the beginning of the line.
+ var level_padding = "";
+ for(var j=0;j<level+1;j++) level_padding += " ";
+
+ if(typeof(arr) == 'object') { //Array/Hashes/Objects
+ for(var item in arr) {
+ var value = arr[item];
+
+ if(typeof(value) == 'object') { //If it is an array,
+ dumped_text += level_padding + "'" + item + "' ...\n";
+ dumped_text += FireGPGMisc.dumper(value,level+1);
+ } else {
+ dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
+ }
+ }
+ } else { //Stings/Chars/Numbers etc.
+ dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
+ }
+ return dumped_text;
+ },
- for (i in o) {
- if (o[i])
- fireGPGDebug(o[i], i, true);
+ /*
+ Function: dump2
+ Show an array or an object in a console
- if (o.i)
- fireGPGDebug(o.i, '~' + i, true);
- }
+ Parameters:
+ o - The object
+ */
+ dump2:function (o) {
-}
+ for (i in o) {
+ if (o[i])
+ fireGPGDebug(o[i], i, true);
-/*
- Class: UTF8
- Class to handle UTF8 tests.
- http://snippets.dzone.com/posts/show/5294
-*/
-UTF8 = {
- /*
- Function: encode
- Encode a text to utf8
-
- Parameters:
- s - The text
- */
- encode: function(s){
- for(var c, i = -1, l = (s = s.split("")).length, o = String.fromCharCode; ++i < l;
- s[i] = (c = s[i].charCodeAt(0)) >= 127 ? o(0xc0 | (c >>> 6)) + o(0x80 | (c & 0x3f)) : s[i]
- );
- return s.join("");
- },
-
- /*
- Function: decode
- Decode a utf8 text
-
- Parameters:
- s - The text
- */
- decode: function(s){
- for(var a, b, i = -1, l = (s = s.split("")).length, o = String.fromCharCode, c = "charCodeAt"; ++i < l;
- ((a = s[i][c](0)) & 0x80) &&
- (s[i] = (a & 0xfc) == 0xc0 && ((b = s[i + 1][c](0)) & 0xc0) == 0x80 ?
- o(((a & 0x03) << 6) + (b & 0x3f)) : o(128), s[++i] = "")
- );
- return s.join("");
- }
-};
+ if (o.i)
+ fireGPGDebug(o.i, '~' + i, true);
+ }
-/*
- Class: Base64
- Class to handle base64 encoding
- http://www.webtoolkit.info/
-*/
-var Base64 = {
+ },
- /*
- Variable: _keyStr
- Valid base64 chars
- */
- _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
+ /*
+ Class: UTF8
+ Class to handle UTF8 tests.
+ http://snippets.dzone.com/posts/show/5294
+ */
+ UTF8: {
+ /*
+ Function: encode
+ Encode a text to utf8
+
+ Parameters:
+ s - The text
+ */
+ encode: function(s){
+ for(var c, i = -1, l = (s = s.split("")).length, o = String.fromCharCode; ++i < l;
+ s[i] = (c = s[i].charCodeAt(0)) >= 127 ? o(0xc0 | (c >>> 6)) + o(0x80 | (c & 0x3f)) : s[i]
+ );
+ return s.join("");
+ },
+
+ /*
+ Function: decode
+ Decode a utf8 text
+
+ Parameters:
+ s - The text
+ */
+ decode: function(s){
+ for(var a, b, i = -1, l = (s = s.split("")).length, o = String.fromCharCode, c = "charCodeAt"; ++i < l;
+ ((a = s[i][c](0)) & 0x80) &&
+ (s[i] = (a & 0xfc) == 0xc0 && ((b = s[i + 1][c](0)) & 0xc0) == 0x80 ?
+ o(((a & 0x03) << 6) + (b & 0x3f)) : o(128), s[++i] = "")
+ );
+ return s.join("");
+ }
+ },
/*
- Function: encode
- Encode to base6
-
- Parameters:
- input - The text
- bMode - Convert to utf8
- */
- encode : function (input,bMode) {
- var output = "";
- var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
- var i = 0;
-
- if (bMode != true)
- input = Base64._utf8_encode(input);
-
- while (i < input.length) {
-
- chr1 = input.charCodeAt(i++);
- chr2 = input.charCodeAt(i++);
- chr3 = input.charCodeAt(i++);
-
- enc1 = chr1 >> 2;
- enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
- enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
- enc4 = chr3 & 63;
-
- if (isNaN(chr2)) {
- enc3 = enc4 = 64;
- } else if (isNaN(chr3)) {
- enc4 = 64;
- }
+ Class: Base64
+ Class to handle base64 encoding
+ http://www.webtoolkit.info/
+ */
+ Base64:{
+
+ /*
+ Variable: _keyStr
+ Valid base64 chars
+ */
+ _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
+
+ /*
+ Function: encode
+ Encode to base6
+
+ Parameters:
+ input - The text
+ bMode - Convert to utf8
+ */
+ encode: function (input,bMode) {
+ var output = "";
+ var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
+ var i = 0;
+
+ if (bMode != true)
+ input = FireGPGMisc.Base64._utf8_encode(input);
+
+ while (i < input.length) {
+
+ chr1 = input.charCodeAt(i++);
+ chr2 = input.charCodeAt(i++);
+ chr3 = input.charCodeAt(i++);
+
+ enc1 = chr1 >> 2;
+ enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
+ enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
+ enc4 = chr3 & 63;
+
+ if (isNaN(chr2)) {
+ enc3 = enc4 = 64;
+ } else if (isNaN(chr3)) {
+ enc4 = 64;
+ }
- output = output +
- this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
- this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
+ output = output +
+ this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
+ this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
- }
+ }
- return output;
- },
+ return output;
+ },
- /*
- Function: decode
- Decode a base64 string
+ /*
+ Function: decode
+ Decode a base64 string
- Paramters:
- input - The text
- bMode - Decode from utf8
- */
- decode : function (input,bMode) {
- var output = "";
- var chr1, chr2, chr3;
- var enc1, enc2, enc3, enc4;
- var i = 0;
+ Paramters:
+ input - The text
+ bMode - Decode from utf8
+ */
+ decode : function (input,bMode) {
+ var output = "";
+ var chr1, chr2, chr3;
+ var enc1, enc2, enc3, enc4;
+ var i = 0;
- input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
+ input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
- while (i < input.length) {
+ while (i < input.length) {
- enc1 = this._keyStr.indexOf(input.charAt(i++));
- enc2 = this._keyStr.indexOf(input.charAt(i++));
- enc3 = this._keyStr.indexOf(input.charAt(i++));
- enc4 = this._keyStr.indexOf(input.charAt(i++));
+ enc1 = this._keyStr.indexOf(input.charAt(i++));
+ enc2 = this._keyStr.indexOf(input.charAt(i++));
+ enc3 = this._keyStr.indexOf(input.charAt(i++));
+ enc4 = this._keyStr.indexOf(input.charAt(i++));
- chr1 = (enc1 << 2) | (enc2 >> 4);
- chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
- chr3 = ((enc3 & 3) << 6) | enc4;
+ chr1 = (enc1 << 2) | (enc2 >> 4);
+ chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
+ chr3 = ((enc3 & 3) << 6) | enc4;
- output = output + String.fromCharCode(chr1);
+ output = output + String.fromCharCode(chr1);
+
+ if (enc3 != 64) {
+ output = output + String.fromCharCode(chr2);
+ }
+ if (enc4 != 64) {
+ output = output + String.fromCharCode(chr3);
+ }
- if (enc3 != 64) {
- output = output + String.fromCharCode(chr2);
- }
- if (enc4 != 64) {
- output = output + String.fromCharCode(chr3);
}
- }
+ if (bMode != true)
+ output = FireGPGMisc.Base64._utf8_decode(output);
- if (bMode != true)
- output = Base64._utf8_decode(output);
+ return output;
- return output;
+ },
- },
+ /*
+ Function: _utf8_encode
+ Encode a string to utf8
- /*
- Function: _utf8_encode
- Encode a string to utf8
+ Parameters:
+ string - The string
+ */
+ _utf8_encode:function (string) {
+ string = string.replace(/\r\n/g,"\n");
+ var utftext = "";
- Parameters:
- string - The string
- */
- _utf8_encode : function (string) {
- string = string.replace(/\r\n/g,"\n");
- var utftext = "";
+ for (var n = 0; n < string.length; n++) {
- for (var n = 0; n < string.length; n++) {
+ var c = string.charCodeAt(n);
- var c = string.charCodeAt(n);
+ if (c < 128) {
+ utftext += String.fromCharCode(c);
+ }
+ else if((c > 127) && (c < 2048)) {
+ utftext += String.fromCharCode((c >> 6) | 192);
+ utftext += String.fromCharCode((c & 63) | 128);
+ }
+ else {
+ utftext += String.fromCharCode((c >> 12) | 224);
+ utftext += String.fromCharCode(((c >> 6) & 63) | 128);
+ utftext += String.fromCharCode((c & 63) | 128);
+ }
- if (c < 128) {
- utftext += String.fromCharCode(c);
- }
- else if((c > 127) && (c < 2048)) {
- utftext += String.fromCharCode((c >> 6) | 192);
- utftext += String.fromCharCode((c & 63) | 128);
- }
- else {
- utftext += String.fromCharCode((c >> 12) | 224);
- utftext += String.fromCharCode(((c >> 6) & 63) | 128);
- utftext += String.fromCharCode((c & 63) | 128);
}
- }
+ return utftext;
+ },
- return utftext;
- },
+ /*
+ Function: _utf8_decode
+ Decode string from utf8
- /*
- Function: _utf8_decode
- Decode string from utf8
+ Parameters:
+ utftext - The text
+ */
+ _utf8_decode :function (utftext) {
+ var string = "";
+ var i = 0;
+ var c = c1 = c2 = 0;
- Parameters:
- utftext - The text
- */
- _utf8_decode : function (utftext) {
- var string = "";
- var i = 0;
- var c = c1 = c2 = 0;
+ while ( i < utftext.length ) {
- while ( i < utftext.length ) {
+ c = utftext.charCodeAt(i);
- c = utftext.charCodeAt(i);
+ if (c < 128) {
+ string += String.fromCharCode(c);
+ i++;
+ }
+ else if((c > 191) && (c < 224)) {
+ c2 = utftext.charCodeAt(i+1);
+ string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
+ i += 2;
+ }
+ else {
+ c2 = utftext.charCodeAt(i+1);
+ c3 = utftext.charCodeAt(i+2);
+ string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
+ i += 3;
+ }
- if (c < 128) {
- string += String.fromCharCode(c);
- i++;
- }
- else if((c > 191) && (c < 224)) {
- c2 = utftext.charCodeAt(i+1);
- string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
- i += 2;
- }
- else {
- c2 = utftext.charCodeAt(i+1);
- c3 = utftext.charCodeAt(i+2);
- string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
- i += 3;
}
+ return string;
+ },
+
+ /*
+ Function: pgpencode
+ Useless function who do nothing
+
+ Parameters:
+ texte - A variable. Cool.
+ */
+ pgpencode: function(texte) {
}
- return string;
},
- /*
- Function: pgpencode
- Useless function who do nothing
-
- Parameters:
- texte - A variable. Cool.
- */
- pgpencode: function(texte) {
+ /*
+ Function: getFileExtention
+ Return the extention of a file
+
+ Parameters:
+ filename - The file name
+ */
+ getFileExtention:function (filename) {
+ return filename.substring(filename.length - 3,filename.length).toLowerCase();
}
}
-
-/*
- Function: getFileExtention
- Return the extention of a file
-
- Parameters:
- filename - The file name
-*/
-function getFileExtention(filename) {
- return filename.substring(filename.length - 3,filename.length).toLowerCase();
-}
diff --git a/content/Core/overlay.js b/content/Core/overlay.js
index cf07c01..a9d753b 100644
--- a/content/Core/overlay.js
+++ b/content/Core/overlay.js
@@ -95,6 +95,7 @@ const ACTION_SWITCHINLINESITEON = 'SWITCHINLINESITEON';
const ACTION_SWITCHINLINESITEOFF = 'SWITCHINLINESITEOFF';
const ACTION_SWITCHINLINEPAGEON = 'SWITCHINLINEPAGEON';
const ACTION_SWITCHINLINEPAGEOFF = 'SWITCHINLINEPAGEOFF';
+const ACTION_CHECKAGAIN = 'CHECKAGAIN';
/*
* Class: firegpg
@@ -108,8 +109,8 @@ var firegpg = {
*/
onLoad: function() {
- cGmail.initSystem();
- cGmail2.initSystem();
+ FireGPG_cGmail.initSystem();
+ FireGPG_cGmail2.initSystem();
FireGPGInline.initSystem();
//APIListener.init();
@@ -135,7 +136,7 @@ var firegpg = {
*/
onDelayMenuAction: function(action) {
-
+
if (action == ACTION_SIGN)
FireGPG.sign();
@@ -158,15 +159,15 @@ var firegpg = {
else if(action == ACTION_EXPORT)
FireGPG.kexport();
else if(action == ACTION_EDITEUR)
- showEditor('');
+ FireGPGMisc.showEditor('');
else if(action == ACTION_MANAGER)
window.openDialog("chrome://firegpg/content/Dialogs/Keymanager/keymanager.xul", "keyManager", "chrome, centerscreen, toolbar").focus();
else if(action == ACTION_OPTS)
window.openDialog("chrome://firegpg/content/Dialogs/options.xul", "optionsFiregpg", "chrome, centerscreen, toolbar").focus();
else if (action == ACTION_ERASE)
- eraseSavedPassword();
+ FireGPGMisc.eraseSavedPassword();
else if(action == ACTION_UPDATE)
- showUpdateDialog();
+ FireGPGMisc.showUpdateDialog();
else if(action == ACTION_FSIGN)
FireGPG.sign(false, '', undefined, undefined, undefined, undefined, undefined, true);
else if(action == ACTION_FVERIF)
@@ -218,6 +219,8 @@ var firegpg = {
} else if(action == ACTION_SWITCHINLINEPAGEOFF) {
FireGPGInline.pageOff(content.document.location);
content.document.location.reload();
+ } else if (action == ACTION_CHECKAGAIN) {
+ FireGPGInline.HandlePage(content.document);
}
diff --git a/content/Core/prismeOverlay.xul b/content/Core/prismeOverlay.xul
index 90374b2..2d49863 100644
--- a/content/Core/prismeOverlay.xul
+++ b/content/Core/prismeOverlay.xul
@@ -52,7 +52,7 @@ under the terms of any one of the MPL, the GPL or the LGPL.
<script src="../Webmails/Gmail/cgmail2.js"/>
<script src="../Webmails/autowrap.js"/>
<script src="cselect.js"/>
- <script src="../GpgAtuh/gpgauth.js"/>
+ <script src="../GpgAuth/gpgauth.js"/>
<script src="../Api/api.js"/>
<script src="prisme.js"/>
<script src="../Mime/mime.js" />
diff --git a/content/Dialogs/Assistant/2-gnupg.js b/content/Dialogs/Assistant/2-gnupg.js
index 6a1a399..18fc9fb 100644
--- a/content/Dialogs/Assistant/2-gnupg.js
+++ b/content/Dialogs/Assistant/2-gnupg.js
@@ -95,7 +95,7 @@ function testGpg() {
var result = FireGPG.selfTest(true);
- if (result.result == RESULT_SUCCESS) {
+ if (result.result == FireGPGResults.SUCCESS) {
gpgWorking = true;
document.getElementById('gnuPG-working').style.display = '';
diff --git a/content/Dialogs/Assistant/3-privatekey.js b/content/Dialogs/Assistant/3-privatekey.js
index 4ea5ff9..f82006b 100644
--- a/content/Dialogs/Assistant/3-privatekey.js
+++ b/content/Dialogs/Assistant/3-privatekey.js
@@ -76,7 +76,7 @@ function textPrivateKey() {
keylistcall = FireGPG.listKeys(true);
- if (keylistcall.result == RESULT_SUCCESS)
+ if (keylistcall.result == FireGPGResults.SUCCESS)
gpg_keys = keylistcall.keylist;
else
gpg_keys = new Array();
@@ -100,11 +100,11 @@ function textPrivateKey() {
/* read the default private key */
var default_private_key = prefs.getCharPref('default_private_key');
- var AskKey = new GPGKey();
+ var AskKey = new FireGPG_GPGKey();
AskKey.keyName = document.getElementById('firegpg-ask-for-private-label').value;
- var Ditem = CreateTreeItemKey(AskKey, document);
+ var Ditem = FireGPGMisc.CreateTreeItemKey(AskKey, document);
listbox.appendChild(Ditem);
@@ -120,7 +120,7 @@ function textPrivateKey() {
current++;
- item = CreateTreeItemKey(gpg_keys[key], document);
+ item = FireGPGMisc.CreateTreeItemKey(gpg_keys[key], document);
if(default_private_key == gpg_keys[key].keyId)
default_item = current;
@@ -134,7 +134,7 @@ function textPrivateKey() {
if (gpg_keys[key].subKeys[skey].keyName) {
- var subItem = CreateTreeItemKey( gpg_keys[key].subKeys[skey] ,document, gpg_keys[key].keyId);
+ var subItem = FireGPGMisc.CreateTreeItemKey( gpg_keys[key].subKeys[skey] ,document, gpg_keys[key].keyId);
subChildren.appendChild(subItem);
}
@@ -208,7 +208,7 @@ function import() {
return;
var filePath = fp.file.path;
- var data = getFromFile(filePath);
+ var data = FireGPGMisc.getFromFile(filePath);
FireGPG.kimport(false,data, true);
diff --git a/content/Dialogs/Keymanager/keymanager.js b/content/Dialogs/Keymanager/keymanager.js
index d343226..61e0a00 100644
--- a/content/Dialogs/Keymanager/keymanager.js
+++ b/content/Dialogs/Keymanager/keymanager.js
@@ -61,12 +61,12 @@ function updateKeyList() {
keylistcallpriv = FireGPG.listKeys(true,true);
- if (keylistcall.result == RESULT_SUCCESS)
+ if (keylistcall.result == FireGPGResults.SUCCESS)
gpg_keys = keylistcall.keylist;
else
gpg_keys = new Array();
- if (keylistcallpriv.result == RESULT_SUCCESS)
+ if (keylistcallpriv.result == FireGPGResults.SUCCESS)
gpg_keys_priv = keylistcallpriv.keylist;
else
gpg_keys_priv = new Array();
@@ -97,7 +97,7 @@ function updateKeyList() {
current++;
- item = CreateTreeItemKey2(gpg_keys[key], document, undefined, haveAPrivateKey);
+ item = FireGPGMisc.CreateTreeItemKey2(gpg_keys[key], document, undefined, haveAPrivateKey);
if (gpg_keys[key].subKeys.length > 0) {
@@ -108,7 +108,7 @@ function updateKeyList() {
if (gpg_keys[key].subKeys[skey].keyName) {
- var subItem = CreateTreeItemKey2( gpg_keys[key].subKeys[skey] ,document, gpg_keys[key].keyId, haveAPrivateKey, true);
+ var subItem = FireGPGMisc.CreateTreeItemKey2( gpg_keys[key].subKeys[skey] ,document, gpg_keys[key].keyId, haveAPrivateKey, true);
subChildren.appendChild(subItem);
}
@@ -154,6 +154,7 @@ function updateButtons() {
document.getElementById('exportfile-button').disabled = (curentlySelected == null);
document.getElementById('exportserver-button').disabled = (curentlySelected == null);
document.getElementById('changetrust-button').disabled = (curentlySelected == null) || (revoked) || subkey;
+ document.getElementById('fingerprint-button').disabled = (curentlySelected == null) || curentlySelectedFingerPrint == '';
document.getElementById('sign-button').disabled = (curentlySelected == null);
document.getElementById('revoke-button').disabled = (curentlySelected == null) || (revoked) || (!privateKey) || subkey;
document.getElementById('del-button').disabled = (curentlySelected == null) || (curentlySelectedFingerPrint == '' ) || subkey; //&& privateKey == false);
@@ -168,14 +169,12 @@ function updateButtons() {
function refrech() {
-
-
FireGPG.refreshKeysFromServer();
updateKeyList();
}
function importserver() {
- showSearchBox((curentlySelected!= null ? "0x" + curentlySelected.substring(8) : "") , true);
+ FireGPGMisc.showSearchBox((curentlySelected!= null ? "0x" + curentlySelected.substring(8) : "") , true);
updateKeyList();
}
@@ -205,13 +204,13 @@ function exportfile() {
var result = FireGPG.kexport(true, [curentlySelected]);
- if (result.result == RESULT_SUCCESS) {
+ if (result.result == FireGPGResults.SUCCESS) {
data = result.exported;
//Need to remove the file before save
- removeFile(filePath);
- putIntoFile(filePath,data);
+ FireGPGMisc.removeFile(filePath);
+ FireGPGMisc.putIntoFile(filePath,data);
alert(document.getElementById('firegpg-strings').
getString('keyExported'));
@@ -235,7 +234,7 @@ function importfile() {
return;
var filePath = fp.file.path;
- var data = getFromFile(filePath);
+ var data = FireGPGMisc.getFromFile(filePath);
FireGPG.kimport(false,data, true);
@@ -330,4 +329,9 @@ function revokeUid() {
function sign() {
window.openDialog("chrome://firegpg/content/Dialogs/Keymanager/signmanager.xul", "newkey", "chrome, centerscreen, toolbar, modal", {keyid : curentlySelected }).focus();
+}
+
+function fingerPrint() {
+ alert(curentlySelectedFingerPrint);
+
} \ No newline at end of file
diff --git a/content/Dialogs/Keymanager/keymanager.xul b/content/Dialogs/Keymanager/keymanager.xul
index 120b6ab..227b7a2 100644
--- a/content/Dialogs/Keymanager/keymanager.xul
+++ b/content/Dialogs/Keymanager/keymanager.xul
@@ -99,6 +99,8 @@ under the terms of any one of the MPL, the GPL or the LGPL.
<button id="password-button" label="&password-button;" oncommand="password();"/>
+ <button id="fingerprint-button" label="&fingerprint-button;" oncommand="fingerPrint();"/>
+
<button id="sign-button" label="&sign-button;" oncommand="sign();"/>
<button id="userid-button" label="&userid-button;" oncommand="document.getElementById('userIdMenu').openPopup(this);"/>
<menupopup id="userIdMenu">
diff --git a/content/Dialogs/Keymanager/newkey.js b/content/Dialogs/Keymanager/newkey.js
index 54a6110..d5e4d0f 100644
--- a/content/Dialogs/Keymanager/newkey.js
+++ b/content/Dialogs/Keymanager/newkey.js
@@ -63,7 +63,7 @@ function generate() {
var result = FireGPG.generateKey(false, name, email, comment, password1, password2, keyneverexpire, keyexpirevalue, keyexpiretype, keylength, keytype);
- if (result.result == RESULT_SUCCESS)
+ if (result.result == FireGPGResults.SUCCESS)
close();
}
diff --git a/content/Dialogs/Keymanager/searchkey.js b/content/Dialogs/Keymanager/searchkey.js
index affeb4c..5905d20 100644
--- a/content/Dialogs/Keymanager/searchkey.js
+++ b/content/Dialogs/Keymanager/searchkey.js
@@ -82,7 +82,7 @@ function rebuildList() {
var search = document.getElementById('search-textbox').value;
- if (trim(search) == "")
+ if (FireGPGMisc.trim(search) == "")
return;
document.getElementById('search-button').disabled = 'disabled';
@@ -93,7 +93,7 @@ function rebuildList() {
document.getElementById('search-button').disabled = '';
document.getElementById('import-button').disabled = '';
- if (keylistcall.result == RESULT_SUCCESS)
+ if (keylistcall.result == FireGPGResults.SUCCESS)
gpg_keys = keylistcall.keylist;
else
gpg_keys = new Array();
@@ -113,7 +113,7 @@ function rebuildList() {
current++;
- item = CreateTreeItemKey(gpg_keys[key], document);
+ item = FireGPGMisc.CreateTreeItemKey(gpg_keys[key], document);
if (gpg_keys[key].subKeys.length > 0) {
@@ -124,7 +124,7 @@ function rebuildList() {
if (gpg_keys[key].subKeys[skey].keyName) {
- var subItem = CreateTreeItemKey( gpg_keys[key].subKeys[skey] ,document, gpg_keys[key].keyId);
+ var subItem = FireGPGMisc.CreateTreeItemKey( gpg_keys[key].subKeys[skey] ,document, gpg_keys[key].keyId);
subChildren.appendChild(subItem);
}
diff --git a/content/Dialogs/Keymanager/signmanager.js b/content/Dialogs/Keymanager/signmanager.js
index 08a7f73..77449ba 100644
--- a/content/Dialogs/Keymanager/signmanager.js
+++ b/content/Dialogs/Keymanager/signmanager.js
@@ -84,7 +84,7 @@ function updateKeyList() {
current++;
- item = CreateTreeItemKey3(gpg_keys[key], document, true, false);
+ item = FireGPGMisc.CreateTreeItemKey3(gpg_keys[key], document, true, false);
if (gpg_keys[key].signs.length > 0) {
@@ -96,7 +96,7 @@ function updateKeyList() {
if (gpg_keys[key].signs[skey].keyName) {
- var subItem = CreateTreeItemKey3( gpg_keys[key].signs[skey] ,document, true, true, myPrivateKeys[gpg_keys[key].signs[skey].keyId]);
+ var subItem = FireGPGMisc.CreateTreeItemKey3( gpg_keys[key].signs[skey] ,document, true, true, myPrivateKeys[gpg_keys[key].signs[skey].keyId]);
subChildren.appendChild(subItem);
}
@@ -114,7 +114,7 @@ function updateKeyList() {
if (gpg_keys[key].subKeys[skey].keyName) {
- var item = CreateTreeItemKey3( gpg_keys[key].subKeys[skey] ,document, false, false);
+ var item = FireGPGMisc.CreateTreeItemKey3( gpg_keys[key].subKeys[skey] ,document, false, false);
if (gpg_keys[key].subKeys[skey].signs.length > 0) {
@@ -126,7 +126,7 @@ function updateKeyList() {
if (gpg_keys[key].subKeys[skey].signs[skey2].keyName) {
- var subItem = CreateTreeItemKey3(gpg_keys[key].subKeys[skey].signs[skey2] ,document, false, true, myPrivateKeys[gpg_keys[key].subKeys[skey].signs[skey2].keyId]);
+ var subItem = FireGPGMisc.CreateTreeItemKey3(gpg_keys[key].subKeys[skey].signs[skey2] ,document, false, true, myPrivateKeys[gpg_keys[key].subKeys[skey].signs[skey2].keyId]);
subChildren.appendChild(subItem);
}
diff --git a/content/Dialogs/api.js b/content/Dialogs/api.js
index 8f039c5..74a12ea 100644
--- a/content/Dialogs/api.js
+++ b/content/Dialogs/api.js
@@ -130,11 +130,11 @@ function ignore() {
*/
function cannot() {
if (document.getElementById('domain').selected)
- gpgApi.denyRegister(this.theLocation, 'D');
+ FireGPGApi.denyRegister(this.theLocation, 'D');
else if (document.getElementById('website').selected)
- gpgApi.denyRegister(this.theLocation, 'S');
+ FireGPGApi.denyRegister(this.theLocation, 'S');
else if (document.getElementById('page').selected)
- gpgApi.denyRegister(this.theLocation, 'P');
+ FireGPGApi.denyRegister(this.theLocation, 'P');
this.close();
}
@@ -146,11 +146,11 @@ function cannot() {
function can() {
if (document.getElementById('domain').selected)
- key = gpgApi.allowRegister(this.theLocation, 'D');
+ key = FireGPGApi.allowRegister(this.theLocation, 'D');
else if (document.getElementById('website').selected)
- key = gpgApi.allowRegister(this.theLocation, 'S');
+ key = FireGPGApi.allowRegister(this.theLocation, 'S');
else if (document.getElementById('page').selected)
- key = gpgApi.allowRegister(this.theLocation, 'P');
+ key = FireGPGApi.allowRegister(this.theLocation, 'P');
window.arguments[0].apiKey = key;
diff --git a/content/Dialogs/hash.js b/content/Dialogs/hash.js
index 1fc632c..bc9e5b6 100644
--- a/content/Dialogs/hash.js
+++ b/content/Dialogs/hash.js
@@ -115,8 +115,8 @@ function saveToFile() {
var filePath = fp.file.path;
//Need to remove the file before save
- removeFile(filePath);
- putIntoFile(filePath,document.getElementById('result').value.replace(/\n/gi,'').replace(/\r/gi,''));
+ FireGPGMisc.removeFile(filePath);
+ FireGPGMisc.putIntoFile(filePath,document.getElementById('result').value.replace(/\n/gi,'').replace(/\r/gi,''));
}*/
function copy() {
diff --git a/content/Dialogs/options.js b/content/Dialogs/options.js
index f442eef..bffcfd0 100644
--- a/content/Dialogs/options.js
+++ b/content/Dialogs/options.js
@@ -103,13 +103,13 @@ function onLoad(win) {
document.getElementById('firegpg-version-version').value = 'DEVEL - ' + FIREGPG_VERSION + ' - Svn version: ' + FIREGPG_SVN;
- if (GPGAccess.FireGPGCall != null)
+ if (FireGPGGPGAccess.FireGPGCall != null)
document.getElementById('firegpg-version-version').value += ' - XpCom';
// Code duplicated in assistant
keylistcall = FireGPG.listKeys(true);
- if (keylistcall.result == RESULT_SUCCESS)
+ if (keylistcall.result == FireGPGResults.SUCCESS)
gpg_keys = keylistcall.keylist;
else
gpg_keys = new Array();
@@ -119,12 +119,12 @@ function onLoad(win) {
/* read the default private key */
var default_private_key = document.getElementById('default-private-key-pref').value;
- var AskKey = new GPGKey();
+ var AskKey = new FireGPG_GPGKey();
AskKey.keyName = document.getElementById('firegpg-ask-for-private-label').value;
- var Ditem = CreateTreeItemKey(AskKey, document);
+ var Ditem = FireGPGMisc.CreateTreeItemKey(AskKey, document);
listbox.appendChild(Ditem);
@@ -140,7 +140,7 @@ function onLoad(win) {
current++;
- item = CreateTreeItemKey(gpg_keys[key], document);
+ item = FireGPGMisc.CreateTreeItemKey(gpg_keys[key], document);
if(default_private_key == gpg_keys[key].keyId)
default_item = current;
@@ -154,7 +154,7 @@ function onLoad(win) {
if (gpg_keys[key].subKeys[skey].keyName) {
- var subItem = CreateTreeItemKey( gpg_keys[key].subKeys[skey] ,document, gpg_keys[key].keyId);
+ var subItem = FireGPGMisc.CreateTreeItemKey( gpg_keys[key].subKeys[skey] ,document, gpg_keys[key].keyId);
subChildren.appendChild(subItem);
}
@@ -185,7 +185,7 @@ function onLoad(win) {
listbox = document.getElementById('api_domain_list');
- access = gpgApi.getAccessList();
+ access = FireGPGApi.getAccessList();
for(domain in access.domains_allowed) {
var item = document.createElement('listitem');
@@ -335,7 +335,7 @@ function apiRemoveMySelf(item) {
listbox = document.getElementById('api_domain_list');
- access = gpgApi.getAccessList();
+ access = FireGPGApi.getAccessList();
if (item.getAttribute('gpgApi-type') == 'DA')
delete(access.domains_allowed[item.getAttribute('gpgApi-domain')]);
@@ -350,7 +350,7 @@ function apiRemoveMySelf(item) {
if (item.getAttribute('gpgApi-type') == 'PD')
delete(access.pages_denied[item.getAttribute('gpgApi-domain')]);
- gpgApi.setAccessList(access);
+ FireGPGApi.setAccessList(access);
listbox.removeChild(item);
diff --git a/content/Dialogs/showtext.js b/content/Dialogs/showtext.js
index 42c2b71..5a3792c 100644
--- a/content/Dialogs/showtext.js
+++ b/content/Dialogs/showtext.js
@@ -92,7 +92,7 @@ function openf() {
return;
var filePath = fp.file.path;
- var data = getFromFile(filePath);
+ var data = FireGPGMisc.getFromFile(filePath);
document.getElementById('text').value = data;
}
@@ -117,8 +117,8 @@ function savef() {
var filePath = fp.file.path;
var data = document.getElementById('text').value;
//Need to remove the file before save
- removeFile(filePath);
- putIntoFile(filePath,data);
+ FireGPGMisc.removeFile(filePath);
+ FireGPGMisc.putIntoFile(filePath,data);
}
/*
@@ -129,7 +129,7 @@ function crypt() {
var result = FireGPG.crypt(false,getSelectedText());
- if (result.result == RESULT_SUCCESS)
+ if (result.result == FireGPGResults.SUCCESS)
setSeletedText(result.encrypted);
}
@@ -142,7 +142,7 @@ function symcrypt() {
var result = FireGPG.crypt(false,getSelectedText(), undefined, undefined, undefined, undefined, true);
- if (result.result == RESULT_SUCCESS)
+ if (result.result == FireGPGResults.SUCCESS)
setSeletedText(result.encrypted);
}
@@ -156,7 +156,7 @@ function symcrypt() {
function cryptandsign(){
var result = FireGPG.cryptAndSign(false,getSelectedText());
- if (result.result == RESULT_SUCCESS)
+ if (result.result == FireGPGResults.SUCCESS)
setSeletedText(result.encrypted);
}
@@ -169,11 +169,11 @@ function dcrypt() {
var result = FireGPG.decrypt(false,getSelectedText());
- if (result.result == RESULT_SUCCESS)
+ if (result.result == FireGPGResults.SUCCESS)
setSeletedText(result.decrypted);
- if (result.signresult == RESULT_SUCCESS) {
+ if (result.signresult == FireGPGResults.SUCCESS) {
var i18n = document.getElementById("firegpg-strings");
document.getElementById('dcryptsignresult').style.display = '';
document.getElementById('dcryptsignresult').value = i18n.getString("validSignInCrypt") + " " + result.signresulttext;
@@ -190,7 +190,7 @@ function sign() {
var result = FireGPG.sign(false,getSelectedText());
- if (result.result == RESULT_SUCCESS)
+ if (result.result == FireGPGResults.SUCCESS)
setSeletedText(result.signed);
}
@@ -203,7 +203,7 @@ function signUnClear() {
var result = FireGPG.sign(false,getSelectedText(),null,null,true);
- if (result.result == RESULT_SUCCESS)
+ if (result.result == FireGPGResults.SUCCESS)
setSeletedText(result.signed);
}
diff --git a/content/GpgAuth/gpgauth.js b/content/GpgAuth/gpgauth.js
index b0edcf0..ee0412e 100644
--- a/content/GpgAuth/gpgauth.js
+++ b/content/GpgAuth/gpgauth.js
@@ -189,7 +189,7 @@ var gpgAuth = {
} else {
gpgAuth.status_window.update( "... encrypted the token to Key ID: " + server_token.prikey_id );
}
- if ( server_token.result != RESULT_SUCCESS ) {
+ if ( server_token.result != FireGPGResults.SUCCESS ) {
// There was a problem, note that an error has occurred.
gpgAuth.gpg_elements[ gpgAuth.domain ][ 'STK_ERROR' ] = true;
error = server_token.sdOut;
@@ -411,7 +411,7 @@ var gpgAuth = {
gpgAuth.status_window.update( "... decrypting the token" );
// Attempt to decrypt the token provided by the Server.
var result = FireGPG.decrypt( true, user_token );
- if ( result.result == RESULT_SUCCESS ) {
+ if ( result.result == FireGPGResults.SUCCESS ) {
// Check to see if the token was signed, and verify there is a keyid for the sign.
if ( result.signresultkeyid && result.signresultkeyid.length > 8 ) {
// The key is long format - get the short version of the key (Last 8 Chars)
diff --git a/content/Mime/decoder.js b/content/Mime/decoder.js
index d855516..ab7d963 100644
--- a/content/Mime/decoder.js
+++ b/content/Mime/decoder.js
@@ -54,7 +54,7 @@ FireGPGMimeDecoder.prototype = {
init: function(data) {
- this.data = convertCRLFToStandarts(data);
+ this.data = FireGPGMisc.convertCRLFToStandarts(data);
this.parse();
},
@@ -160,14 +160,14 @@ FireGPGMimeDecoder.prototype = {
switch(headers['CONTENT-TRANSFER-ENCODING']) {
case "quoted-printable":
- return convertCRLFToStandarts(this.convertFromQP(body));
+ return FireGPGMisc.convertCRLFToStandarts(this.convertFromQP(body));
break;
case "8bit":
break;
case "base64":
- return convertCRLFToStandarts(this.convertFromB64(body));
+ return FireGPGMisc.convertCRLFToStandarts(this.convertFromB64(body));
break;
}
@@ -215,14 +215,14 @@ FireGPGMimeDecoder.prototype = {
for (i = 0; i < message.length; i++) {
if (message[i][0] == " " || message[i][0] == "\t") {
- headers[currentHeader] += trim(message[i]);
+ headers[currentHeader] += FireGPGMisc.trim(message[i]);
} else {
/*if (message[i].indexOf(":") == -1) //Erreur, on arrêtte
return headers;*/
currentHeader = message[i].substring(0, message[i].indexOf(":")).toUpperCase();
- headers[currentHeader] = trim(message[i].substring(message[i].indexOf(":") + 1 , message[i].length));
+ headers[currentHeader] = FireGPGMisc.trim(message[i].substring(message[i].indexOf(":") + 1 , message[i].length));
}
@@ -242,7 +242,7 @@ FireGPGMimeDecoder.prototype = {
if (headers == undefined)
headers = this.parseHeaders(message);
- if (headers['CONTENT-TYPE'] != undefined || headers['CONTENT-DISPOSITION'] != undefined || headers['CONTENT-TRANSFET-ENCODING'] != undefined)
+ if (headers['CONTENT-TYPE'] != undefined || headers['CONTENT-DISPOSITION'] != undefined || headers['CONTENT-TRANSFER-ENCODING'] != undefined)
message = message.substring(message.indexOf("\r\n\r\n") + 4, message.length); //EndOfHeaders
return message;
@@ -328,7 +328,7 @@ FireGPGMimeDecoder.prototype = {
convertFromB64: function(texte,bMode) {
- return Base64.decode(texte,bMode);
+ return FireGPGMisc.Base64.decode(texte,bMode);
},
@@ -545,7 +545,7 @@ FireGPGMimeDecoder.prototype = {
} else {
- if (minedecrypt.decryptData && minedecrypt.decryptresult.signresult == RESULT_SUCCESS) {
+ if (minedecrypt.decryptData && minedecrypt.decryptresult.signresult == FireGPGResults.SUCCESS) {
retour.signResult = new Object();
retour.signResult.signresult = minedecrypt.decryptresult.signresult;
retour.signResult.signresulttext = minedecrypt.decryptresult.signresulttext;
@@ -592,7 +592,7 @@ FireGPGMimeDecoder.prototype = {
} else {
if (inlinedecrypt != null) {
- if (inlinedecrypt.decryptData && inlinedecrypt.decryptresult.signresult == RESULT_SUCCESS) {
+ if (inlinedecrypt.decryptData && inlinedecrypt.decryptresult.signresult == FireGPGResults.SUCCESS) {
retour.signResult = new Object();
retour.signResult.signresult = inlinedecrypt.decryptresult.signresult;
retour.signResult.signresulttext = inlinedecrypt.decryptresult.signresulttext;
@@ -638,10 +638,10 @@ FireGPGMimeDecoder.prototype = {
retour.decryptresult = FireGPG.decrypt(false,data);
- if (retour.decryptresult.result == RESULT_SUCCESS) {
+ if (retour.decryptresult.result == FireGPGResults.SUCCESS) {
this.saveid = this.extractMimeId();
- this.mainPart = this.mimeParsing(convertCRLFToStandarts(retour.decryptresult.decrypted));
+ this.mainPart = this.mimeParsing(FireGPGMisc.convertCRLFToStandarts(retour.decryptresult.decrypted));
this.mainPart.thisisanencryptedpart = true;
retour.decryptDataToInsert = this.mimeToText(this.mainPart);
@@ -687,9 +687,9 @@ FireGPGMimeDecoder.prototype = {
retour.decryptresult = FireGPG.decrypt(false,data);
- if (retour.decryptresult.result == RESULT_SUCCESS) {
+ if (retour.decryptresult.result == FireGPGResults.SUCCESS) {
- subparttotest = this.mimeParsing(convertCRLFToStandarts(retour.decryptresult.decrypted));
+ subparttotest = this.mimeParsing(FireGPGMisc.convertCRLFToStandarts(retour.decryptresult.decrypted));
subparttotest.thisisanencryptedpart = true;
retour.decryptDataToInsert = this.mimeToText(subparttotest);
@@ -798,15 +798,15 @@ FireGPGMimeDecoder.prototype = {
var resultTest = FireGPG.verify(true,firstSign.replace(/\r/gi, ''), charset);
- if (resultTest.signresult == RESULT_ERROR_BAD_SIGN) {
+ if (resultTest.signresult == FireGPGResults.ERROR_BAD_SIGN) {
fireGPGDebug("Try again widhout charset", "Nonmime sign verif");
var resultTest = FireGPG.verify(true,firstSign.replace(/\r/gi, ''));
}
- if (resultTest.signresult == RESULT_ERROR_BAD_SIGN) {
+ if (resultTest.signresult == FireGPGResults.ERROR_BAD_SIGN) {
fireGPGDebug("Try again utf8 decoded", "Nonmime sign verif");
- var resultTest = FireGPG.verify(true,UTF8.decode(firstSign.replace(/\r/gi, '')), charset);
+ var resultTest = FireGPG.verify(true,FireGPGMisc.UTF8.decode(firstSign.replace(/\r/gi, '')), charset);
}
@@ -906,7 +906,7 @@ FireGPGMimeDecoder.prototype = {
//.ASC, .PGP
for (var i = 0; i < this.mainPart.numberofsubparts; i++) {
if (this.mainPart.subparts[i].attachement) {
- var ext = getFileExtention(this.mainPart.subparts[i].filename)
+ var ext = FireGPGMisc.getFileExtention(this.mainPart.subparts[i].filename)
if ((ext == "asc" || ext == "pgp") && this.mainPart.subparts[i].headers['CONTENT-TYPE'].indexOf('application/pgp-signature') == -1) {
@@ -927,7 +927,7 @@ FireGPGMimeDecoder.prototype = {
//.sig
/* for (var i = 0; i < this.mainPart.numberofsubparts; i++) {
if (this.mainPart.subparts[i].attachement) {
- var ext = getFileExtention(this.mainPart.subparts[i].filename)
+ var ext = FireGPGMisc.getFileExtention(this.mainPart.subparts[i].filename)
if (ext == "sig") {
@@ -937,17 +937,17 @@ FireGPGMimeDecoder.prototype = {
if (this.mainPart.subparts[i2].attachement) {
if (this.mainPart.subparts[i2].filename == originalName) {
- data = "-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\n" + this.mainPart.subparts[i2].clearBinBody.replace(/\n\-/gi, "\n- -").replace(/\r\-/gi, "\r- -") + "\n-----BEGIN PGP SIGNATURE-----\n\n"+ Base64.encode(this.mainPart.subparts[i].clearBinBody,true) + "\n-----END PGP SIGNATURE-----";
+ data = "-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\n" + this.mainPart.subparts[i2].clearBinBody.replace(/\n\-/gi, "\n- -").replace(/\r\-/gi, "\r- -") + "\n-----BEGIN PGP SIGNATURE-----\n\n"+ FireGPGMisc.Base64.encode(this.mainPart.subparts[i].clearBinBody,true) + "\n-----END PGP SIGNATURE-----";
var tmpFile = new Object();
tmpFile.filename = this.mainPart.subparts[i2].filename;
tmpFile.type = "signedfile";
tmpFile.signresult = FireGPG.verify(true,data,'UTF-8');
- alert(dumper(tmpFile.signresult));
+ alert(FireGPGMisc.dumper(tmpFile.signresult));
- removeFile("/tmp/a");
- putIntoBinFile("/tmp/a",data);
+ FireGPGMisc.removeFile("/tmp/a");
+ FireGPGMisc.putIntoBinFile("/tmp/a",data);
retour.push(tmpFile);
diff --git a/content/Mime/encoder.js b/content/Mime/encoder.js
index c438399..294ca61 100644
--- a/content/Mime/encoder.js
+++ b/content/Mime/encoder.js
@@ -112,7 +112,7 @@ FireGPGMimeEncoder.prototype =
createInstance(Components.interfaces.nsIBinaryInputStream);
binInpStream.setInputStream(fileStream);
var bytes = binInpStream.readBytes(fileStream.available());
- var base64coded = breakLines(btoa(bytes));
+ var base64coded = FireGPG_breakLines(btoa(bytes));
this.addStringToStream(base64coded);
}
catch (e)
@@ -237,7 +237,7 @@ FireGPGMimeEncoder.prototype =
part += "; charset=" +
uChars + "\r\nContent-Transfer-Encoding: base64";
str = btoa(str);
- str = breakLines(str);
+ str = FireGPG_breakLines(str);
}
part += this.CRLF;
}
@@ -340,7 +340,7 @@ FireGPGMimeEncoder.prototype =
this.makeRFC2047(cD.filename) + "\"" + this.CRLF;
str += "Content-Type: " + cT.type + this.CRLF + this.CRLF;
- str += breakLines(btoa(attachment.data));
+ str += FireGPG_breakLines(btoa(attachment.data));
this.addStringToStream(str);
return true;
}
diff --git a/content/Mime/gmailSender.js b/content/Mime/gmailSender.js
index def0cf5..597876a 100644
--- a/content/Mime/gmailSender.js
+++ b/content/Mime/gmailSender.js
@@ -65,7 +65,7 @@ FireGPGGmailMimeSender.prototype = new FireGPGMimeSender();
FireGPGGmailMimeSender.prototype.ourSending = function(msgs)
{
// TODO: make more robust by saying how many messages are being sent and the total transfer size, etc.
- cGmail2.setProgressMessage( this.form , this.i18n.getString("GmailSendingMail") + " (" + Math.max(1,Math.round(msgs[0].BodyPlus.length / 1024)) + "K)");
+ FireGPG_cGmail2.setProgressMessage( this.form , this.i18n.getString("GmailSendingMail") + " (" + Math.max(1,Math.round(msgs[0].BodyPlus.length / 1024)) + "K)");
}
// Implementation of abstract value/method from SmimeSender
@@ -364,7 +364,7 @@ FireGPGGmailMimeSender.prototype.ourSent = function(msgs, err, prefs)
}
- cGmail2.setProgressMessage( this.form, null);
+ FireGPG_cGmail2.setProgressMessage( this.form, null);
return;
}
}
@@ -409,7 +409,7 @@ FireGPGGmailMimeSender.prototype.ourSent = function(msgs, err, prefs)
this.removeEventListener("DOMAttrModified", changeStatusMessage, false);
// set the bottom of the message stack, as appropriate
var msgs = this.ownerDocument.evaluate(".//div[contains(@class, 'diLZtc')]//table/tr/td[contains(@class, 'eWTfhb')]//div[contains(@class, 'aWL81')]/div[position()=2]", this.ownerDocument.body, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
- if (!msgs || true) messageTd.innerHTML = cGmail2.i18n.getString("MessageSend");
+ if (!msgs || true) messageTd.innerHTML = FireGPG_cGmail2.i18n.getString("MessageSend");
else
{ /*
// jsdump("Doing tha alternative");
@@ -420,11 +420,11 @@ FireGPGGmailMimeSender.prototype.ourSent = function(msgs, err, prefs)
newmsgdiv.setAttribute("style", "");
msgs.appendChild(newmsgdiv);
newmsgdiv.innerHTML = '<div class="b8" style=""><table cellspacing="0" cellpadding="0" class="cf ve"><tbody><tr><td class="EGPikb" style="background-position: 0px; background-repeat: no-repeat; background-image: url(rc?a=af&c=fff1a8&w=4&h=4);"/><td class="Ptde9b"/><td class="EGPikb" style="background-position: -4px 0px; background-repeat: no-repeat; background-image: url(rc?a=af&c=fff1a8&w=4&h=4);"/></tr><tr><td class="Ptde9b"/><td class="m14Grb">' +
-cGmail2.i18n.getString("MessageSend") + '</td><td class="Ptde9b"/></tr><tr><td class="EGPikb" style="background-position: 0px -4px; background-repeat: no-repeat; background-image: url(rc?a=af&c=fff1a8&w=4&h=4);"/><td class="Ptde9b"/><td class="EGPikb" style="background-position: -4px; background-repeat: no-repeat; background-image: url(rc?a=af&c=fff1a8&w=4&h=4);"/></tr></tbody></table></div>';
+FireGPG_cGmail2.i18n.getString("MessageSend") + '</td><td class="Ptde9b"/></tr><tr><td class="EGPikb" style="background-position: 0px -4px; background-repeat: no-repeat; background-image: url(rc?a=af&c=fff1a8&w=4&h=4);"/><td class="Ptde9b"/><td class="EGPikb" style="background-position: -4px; background-repeat: no-repeat; background-image: url(rc?a=af&c=fff1a8&w=4&h=4);"/></tr></tbody></table></div>';
// newmsgdiv.innerHTML = '<div class="n38jzf" style=""><table cellspacing="0" cellpadding="0" class="cyVRte"><tbody><tr><td class="EGPikb" style="background-position: 0px; background-repeat: no-repeat; background-image: url(rc?a=af&c=fff1a8&w=4&h=4);"/><td class="Ptde9b"/><td class="EGPikb" style="background-position: -4px 0px; background-repeat: no-repeat; background-image: url(rc?a=af&c=fff1a8&w=4&h=4);"/></tr><tr><td class="Ptde9b"/><td class="m14Grb">' +
-//cGmail2.i18n.getString("MessageSend") + '</td><td class="Ptde9b"/></tr><tr><td class="EGPikb" style="background-position: 0px -4px; background-repeat: no-repeat; background-image: url(rc?a=af&c=fff1a8&w=4&h=4);"/><td class="Ptde9b"/><td class="EGPikb" style="background-position: -4px; background-repeat: no-repeat; background-image: url(rc?a=af&c=fff1a8&w=4&h=4);"/></tr></tbody></table></div>';
+//FireGPG_cGmail2.i18n.getString("MessageSend") + '</td><td class="Ptde9b"/></tr><tr><td class="EGPikb" style="background-position: 0px -4px; background-repeat: no-repeat; background-image: url(rc?a=af&c=fff1a8&w=4&h=4);"/><td class="Ptde9b"/><td class="EGPikb" style="background-position: -4px; background-repeat: no-repeat; background-image: url(rc?a=af&c=fff1a8&w=4&h=4);"/></tr></tbody></table></div>';
function removeNote(e)
{
@@ -440,7 +440,7 @@ cGmail2.i18n.getString("MessageSend") + '</td><td class="Ptde9b"/></tr><tr><td c
// 0.3.2: removed: div[@class='fgrX7c']//div[@class='IY0d9c']/div[contains(@class, 'EGSDee')]/
var sD = d.evaluate(".//div/div[contains(@class,'b8')]", d.body, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
// printAncestors("statusDiv", sD);
- cGmail2.i18n = this.i18n;
+ FireGPG_cGmail2.i18n = this.i18n;
sD.addEventListener("DOMAttrModified", changeStatusMessage, false);
// sD.addEventListener("DOMNodeInserted", function (e) {printAncestors("Inserted! ", e.target); }, false);
// sD.addEventListener("DOMNodeRemoved", function (e) {printAncestors("Removed! ", e.target); }, false);
@@ -477,5 +477,5 @@ cGmail2.i18n.getString("MessageSend") + '</td><td class="Ptde9b"/></tr><tr><td c
fireGPGDebug(e, "mime / ourSent", true);
debugger;
}
- cGmail2.setProgressMessage(f, null);
+ FireGPG_cGmail2.setProgressMessage(f, null);
}; // end ourSent \ No newline at end of file
diff --git a/content/Mime/mime.js b/content/Mime/mime.js
index ede9a44..93c5566 100644
--- a/content/Mime/mime.js
+++ b/content/Mime/mime.js
@@ -61,7 +61,7 @@ This file was a part of Gmail S/MIME (adapted)
* TODO: make this function vigorous and robust. Find complex parsing algorithms, or do it yourself
* piecemeal (as opposed to using a regexp).
*/
-function convertAddressLineToArray(line)
+function FireGPG_convertAddressLineToArray(line)
{
function trim(g)
{
@@ -70,7 +70,7 @@ function convertAddressLineToArray(line)
}
if (line == undefined) {
- fireGPGDebug("Undefined line in convertAddressLineToArray, return '' anyways", 'convertAddressLineToArray', true);
+ fireGPGDebug("Undefined line in FireGPG_convertAddressLineToArray, return '' anyways", 'FireGPG_convertAddressLineToArray', true);
return "";
}
@@ -109,14 +109,14 @@ function convertAddressLineToArray(line)
* This function splits lines into 76-character chunks. This is useful
* for stuffing base64 into an rfc822 message.
*/
-function breakLines(t)
+function FireGPG_breakLines(t)
{
// this appears to be the fastest--slightly faster than array.join("\r\n") (because it takes a little bit of time to compose the array, too);
theresult = t.replace(/[\s\S]{76}/g,"$&\r\n");
return theresult;
}
-var stUtil =
+var FireGPG_stUtil =
{
/**
* Make an RFC 2047-compliant string by escaping the extended characters
diff --git a/content/Mime/sender.js b/content/Mime/sender.js
index b408cfd..cb82ba7 100644
--- a/content/Mime/sender.js
+++ b/content/Mime/sender.js
@@ -61,7 +61,7 @@ FireGPGMimeSender.prototype =
/**
* Abstract callbacks to be called right before a message undergoes the operations indicated by the functions. This is meant
* to inform the user via the UI.
- * TODO: Note on implementation: currently signText, encryption, and breakLines take an extraordinarily long time for large data. Thus, they block the UI. Consider addressing this.
+ * TODO: Note on implementation: currently signText, encryption, and FireGPG_breakLines take an extraordinarily long time for large data. Thus, they block the UI. Consider addressing this.
*/
ourSigning: function(msg) {},
ourEncrypting: function(msg) {},
@@ -126,8 +126,8 @@ FireGPGMimeSender.prototype =
var msgs = null; // this will be an Array
- fireGPGDebug("Calling convertAddressLineToArray - parameters : from", 'ourSubmit', false);
- var af = convertAddressLineToArray(from);
+ fireGPGDebug("Calling FireGPG_convertAddressLineToArray - parameters : from", 'ourSubmit', false);
+ var af = FireGPG_convertAddressLineToArray(from);
if (af.length != 1) return false;
msg.mailFrom = af[0];
@@ -135,18 +135,18 @@ FireGPGMimeSender.prototype =
// try to send a message to yourself, Gmail SMTP will actually
// save the first copy of the message. Not the last one or
// whatever.
- fireGPGDebug("Calling convertAddressLineToArray - parameters : to", 'ourSubmit', false);
- a = convertAddressLineToArray(to);
- fireGPGDebug("Calling convertAddressLineToArray - parameters : cc", 'ourSubmit', false);
- a = convertAddressLineToArray(cc);
- fireGPGDebug("Calling convertAddressLineToArray - parameters : bcc", 'ourSubmit', false);
- a = convertAddressLineToArray(bcc);
- fireGPGDebug("Calling convertAddressLineToArray - parameters : to-cc-bcc", 'ourSubmit', false);
+ fireGPGDebug("Calling FireGPG_convertAddressLineToArray - parameters : to", 'ourSubmit', false);
+ a = FireGPG_convertAddressLineToArray(to);
+ fireGPGDebug("Calling FireGPG_convertAddressLineToArray - parameters : cc", 'ourSubmit', false);
+ a = FireGPG_convertAddressLineToArray(cc);
+ fireGPGDebug("Calling FireGPG_convertAddressLineToArray - parameters : bcc", 'ourSubmit', false);
+ a = FireGPG_convertAddressLineToArray(bcc);
+ fireGPGDebug("Calling FireGPG_convertAddressLineToArray - parameters : to-cc-bcc", 'ourSubmit', false);
msg.rcptTo =
- convertAddressLineToArray(to).concat(
- convertAddressLineToArray(cc),
- convertAddressLineToArray(bcc));
+ FireGPG_convertAddressLineToArray(to).concat(
+ FireGPG_convertAddressLineToArray(cc),
+ FireGPG_convertAddressLineToArray(bcc));
if (!msg.rcptTo.length) return false;
// TODO: support quoted-printable for other headers, not just subject
@@ -166,7 +166,7 @@ FireGPGMimeSender.prototype =
if (bcc.length)
msg.Bcc = bcc;
if (subject.length)
- msg.Subject = stUtil.makeRFC2047(subject);
+ msg.Subject = FireGPG_stUtil.makeRFC2047(subject);
// date. (Note: we can get offset from UTC, but we can't get
// the actual time zone) Sample: Tue, 15 May 2007 18:34:56
@@ -349,7 +349,7 @@ FireGPGMimeSender.prototype =
var result = FireGPG.sign(false,stringToWork+ crlf, null, null, null, prefs.whoSendTheMail );
- if (result.result == RESULT_SUCCESS) {
+ if (result.result == FireGPGResults.SUCCESS) {
var digest = "SHA1"; //Unfortunaly by default..
try {
@@ -427,7 +427,7 @@ FireGPGMimeSender.prototype =
var result = FireGPG.cryptAndSign(false,stringToWork, null ,false,null, null, false, whoWillGotTheMail, prefs.whoSendTheMail);
- if (result.result == RESULT_SUCCESS) {
+ if (result.result == FireGPGResults.SUCCESS) {
newmessage = 'X-FireGPG-Version: ' + FIREGPG_VERSION + crlf +
@@ -455,7 +455,7 @@ FireGPGMimeSender.prototype =
var result = FireGPG.crypt(false,stringToWork,null, false, false,whoWillGotTheMail);
- if (result.result == RESULT_SUCCESS) {
+ if (result.result == FireGPGResults.SUCCESS) {
newmessage = 'X-FireGPG-Version: ' + FIREGPG_VERSION + crlf +
diff --git a/content/Webmails/Gmail/cgmail.js b/content/Webmails/Gmail/cgmail.js
index 86a6953..9de9ba3 100644
--- a/content/Webmails/Gmail/cgmail.js
+++ b/content/Webmails/Gmail/cgmail.js
@@ -47,10 +47,10 @@ const FGPG_STATE_START = Components.interfaces.nsIWebProgressListener.STATE_STAR
const FGPG_STATE_STOP = Components.interfaces.nsIWebProgressListener.STATE_STOP;
/*
- Class: cGmailListener
+ Class: FireGPG_cGmailListener
This class implement a listener, to intercept page loaded.
*/
-var cGmailListener = {
+var FireGPG_cGmailListener = {
/*
Function: QueryInterface
This function return the Interface of the listen. Here to be a good listener.
@@ -82,18 +82,18 @@ var cGmailListener = {
if(aFlag & FGPG_STATE_STOP) {
//If we need ton find the IK information
- if (cGmail.ik == null)
+ if (FireGPG_cGmail.ik == null)
{
if (aRequest != null) {
if (aRequest.name.indexOf("?ik=") != -1 || aRequest.name.indexOf("&ik=") != -1)
{
var reg= new RegExp("ik\\=[a-zA-Z0-9]+");
- cGmail.ik = aRequest.name.match(reg);
+ FireGPG_cGmail.ik = aRequest.name.match(reg);
- if (cGmail.ik != null && cGmail.ik != "")
+ if (FireGPG_cGmail.ik != null && FireGPG_cGmail.ik != "")
{
- cGmail.ik = cGmail.ik.toString().substring(3);
+ FireGPG_cGmail.ik = FireGPG_cGmail.ik.toString().substring(3);
}
}
}
@@ -106,9 +106,9 @@ var cGmailListener = {
aProgress.DOMWindow.document.body.setAttribute("gpg","ok");
- cGmail.lastDomToverify = aProgress.DOMWindow;
- setTimeout("cGmail.onDelayLoad()", 1000); //Fast connexions
- setTimeout("cGmail.onDelayLoad()", 5000); //Slow connexions
+ FireGPG_cGmail.lastDomToverify = aProgress.DOMWindow;
+ setTimeout("FireGPG_cGmail.onDelayLoad()", 1000); //Fast connexions
+ setTimeout("FireGPG_cGmail.onDelayLoad()", 5000); //Slow connexions
}
@@ -152,10 +152,10 @@ var cGmailListener = {
/*
- Class: cGmail
+ Class: FireGPG_cGmail
This is the main class to manage gmail's function with the old interface.
*/
-var cGmail = {
+var FireGPG_cGmail = {
/*
Function: onDelayLoad
@@ -187,29 +187,29 @@ var cGmail = {
// For I18N
var i18n = document.getElementById("firegpg-strings");
- if (resultTest.result == RESULT_ERROR_NO_GPG_DATA) {
- if (cGmail.nonosign != true)
+ if (resultTest.result == FireGPGResults.ERROR_NO_GPG_DATA) {
+ if (FireGPG_cGmail.nonosign != true)
{
td.setAttribute("style","color: orange;");
td.innerHTML = i18n.getString("GMailNoS");
}
}
- else if (resultTest.signresult ==RESULT_ERROR_UNKNOW) {
+ else if (resultTest.signresult ==FireGPGResults.ERROR_UNKNOW) {
td.setAttribute("style","color: red;");
td.innerHTML = i18n.getString("GMailSErr"); //"La première signature de ce mail est incorrect !";
}
- else if (resultTest.signresult == RESULT_ERROR_BAD_SIGN) {
+ else if (resultTest.signresult == FireGPGResults.ERROR_BAD_SIGN) {
td.setAttribute("style","color: red;");
td.innerHTML = i18n.getString("GMailSErr") + " (" + i18n.getString("falseSign") + ")"; //"La première signature de ce mail est incorrect !";
}
- else if (resultTest.signresult == RESULT_ERROR_NO_KEY) {
+ else if (resultTest.signresult == FireGPGResults.ERROR_NO_KEY) {
td.setAttribute("style","color: red;");
td.innerHTML = i18n.getString("GMailSErr") + " (" + i18n.getString("keyNotFound") + ")"; //"La première signature de ce mail est incorrect !";
}
else if (resultTest.signresulttext != null) {
td.setAttribute("style","color: green;");
- td.innerHTML = i18n.getString("GMailSOK") + " " + htmlEncode(resultTest.signresulttext); //"La première signature de ce mail est de testtest (testtest)
+ td.innerHTML = i18n.getString("GMailSOK") + " " + FireGPGMisc.htmlEncode(resultTest.signresulttext); //"La première signature de ce mail est de testtest (testtest)
}
/*td.setAttribute("style","color: orange;");
@@ -228,7 +228,7 @@ var cGmail = {
replyBox.appendChild(td);
var tmpListener = new Object;
tmpListener = null;
- tmpListener = new cGmail.callBack("sm_decrypt",i)
+ tmpListener = new FireGPG_cGmail.callBack("sm_decrypt",i)
td.addEventListener('click',tmpListener,true);
}
@@ -329,10 +329,10 @@ var cGmail = {
if (usegmail == true) {
if (document.getElementById("appcontent"))
- document.getElementById("appcontent").addEventListener("DOMContentLoaded", cGmail.listenerLoad, false);
+ document.getElementById("appcontent").addEventListener("DOMContentLoaded", FireGPG_cGmail.listenerLoad, false);
else
- document.getElementById("browser_content").addEventListener("DOMContentLoaded", cGmail.listenerLoad, false);
- window.addEventListener("unload", function() {cGmail.listenerUnload()}, false);
+ document.getElementById("browser_content").addEventListener("DOMContentLoaded", FireGPG_cGmail.listenerLoad, false);
+ window.addEventListener("unload", function() {FireGPG_cGmail.listenerUnload()}, false);
try { var nonosign = prefs.getBoolPref("gmail_no_sign_off"); }
@@ -358,16 +358,16 @@ var cGmail = {
try { var b_use_select_s = prefs.getBoolPref("gmail_butons_use_select"); }
catch (e) { var b_use_select_s = false; }
- cGmail.nonosign = nonosign;
- cGmail.b_sign = b_sign;
- cGmail.b_sign_s = b_sign_s;
- cGmail.b_psign = b_psign;
- cGmail.b_psign_s = b_psign_s;
- cGmail.b_crypt = b_crypt;
- cGmail.b_crypt_s = b_crypt_s;
- cGmail.b_signcrypt = b_signcrypt;
- cGmail.b_signcrypt_s = b_signcrypt_s;
- cGmail.b_use_select_s = b_use_select_s;
+ FireGPG_cGmail.nonosign = nonosign;
+ FireGPG_cGmail.b_sign = b_sign;
+ FireGPG_cGmail.b_sign_s = b_sign_s;
+ FireGPG_cGmail.b_psign = b_psign;
+ FireGPG_cGmail.b_psign_s = b_psign_s;
+ FireGPG_cGmail.b_crypt = b_crypt;
+ FireGPG_cGmail.b_crypt_s = b_crypt_s;
+ FireGPG_cGmail.b_signcrypt = b_signcrypt;
+ FireGPG_cGmail.b_signcrypt_s = b_signcrypt_s;
+ FireGPG_cGmail.b_use_select_s = b_use_select_s;
}
},
@@ -431,7 +431,7 @@ var cGmail = {
var tmpListener = new Object;
tmpListener = null;
- tmpListener = new cGmail.callBack("tralala",info1)
+ tmpListener = new FireGPG_cGmail.callBack("tralala",info1)
select.addEventListener('onchange',tmpListener,false);
} catch (e) { fireGPGDebug(e,'cgmail.addBouton2',true); }
@@ -463,28 +463,28 @@ var cGmail = {
// For i18N
var i18n = document.getElementById("firegpg-strings");
- if (cGmail.b_sign == true)
+ if (FireGPG_cGmail.b_sign == true)
this.addBouton(i18n.getString("GMailCLS"),"sign",box,Ddocument,info1);
- if (cGmail.b_sign_s == true)
+ if (FireGPG_cGmail.b_sign_s == true)
this.addBouton(i18n.getString("GMailCLSS"),"sndsign",box,Ddocument,info1);
- if (cGmail.b_psign == true)
+ if (FireGPG_cGmail.b_psign == true)
this.addBouton(i18n.getString("GMailS"),"psign",box,Ddocument,info1);
- if (cGmail.b_psign_s == true)
+ if (FireGPG_cGmail.b_psign_s == true)
this.addBouton(i18n.getString("GMailSS"),"sndpsign",box,Ddocument,info1);
- if (cGmail.b_crypt == true)
+ if (FireGPG_cGmail.b_crypt == true)
this.addBouton(i18n.getString("GMailC"),"crypt",box,Ddocument,info1);
- if (cGmail.b_crypt_s == true)
+ if (FireGPG_cGmail.b_crypt_s == true)
this.addBouton(i18n.getString("GMailCS"),"sndcrypt",box,Ddocument,info1);
- if (cGmail.b_signcrypt == true)
+ if (FireGPG_cGmail.b_signcrypt == true)
this.addBouton(i18n.getString("GMailSAC"),"signcrypt",box,Ddocument,info1);
- if (cGmail.b_signcrypt_s == true)
+ if (FireGPG_cGmail.b_signcrypt_s == true)
this.addBouton(i18n.getString("GMailSACS"),"sndsigncrypt",box,Ddocument,info1);
try {
var tmpListener = new Object;
tmpListener = null;
- tmpListener = new cGmail.callBack("tralala",info1)
+ tmpListener = new FireGPG_cGmail.callBack("tralala",info1)
box.addEventListener('click',tmpListener,true);
} catch (e) { fireGPGDebug(e,'cgmail.addComposeBoutons',true); }
@@ -501,8 +501,8 @@ var cGmail = {
var urlPage = e.target.defaultView.wrappedJSObject.location.host;
if (urlPage.indexOf('mail.google.com') != -1) {
- cGmail.simpleLoad(e);
- gBrowser.addProgressListener(cGmailListener,
+ FireGPG_cGmail.simpleLoad(e);
+ gBrowser.addProgressListener(FireGPG_cGmailListener,
Components.interfaces.nsIWebProgress.NOTIFY_STATE_DOCUMENT);
}
} catch (e) {}
@@ -515,7 +515,7 @@ var cGmail = {
*/
listenerUnload: function() {
- gBrowser.removeProgressListener(cGmailListener);
+ gBrowser.removeProgressListener(FireGPG_cGmailListener);
},
/*
@@ -561,9 +561,9 @@ var cGmail = {
if (target.id == "sm_decrypt") {
- var contenuMail = cGmail.lastDomToverify.document.getElementById('mb_' + info1);
+ var contenuMail = FireGPG_cGmail.lastDomToverify.document.getElementById('mb_' + info1);
- var range = cGmail.lastDomToverify.document.createRange();
+ var range = FireGPG_cGmail.lastDomToverify.document.createRange();
range.selectNode(contenuMail);
var documentFragment = range.cloneContents();
@@ -571,35 +571,35 @@ var cGmail = {
var d = documentFragment;
var str = s.serializeToString(d);
- contenuMail = Selection.wash(str);
+ contenuMail = FireGPG_Selection.wash(str);
var result = FireGPG.decrypt(false,contenuMail);
- if (result.result == RESULT_SUCCESS)
- showText(result.decrypted,undefined,undefined,undefined,result.signresulttext);
+ if (result.result == FireGPGResults.SUCCESS)
+ FireGPGMisc.showText(result.decrypted,undefined,undefined,undefined,result.signresulttext);
}
else if (target.id == "sndsign" || target.id == "sign")
{
- var mailContent = cGmail.getWriteMailContent(cGmail.lastDomToverify.document,info1);
+ var mailContent = FireGPG_cGmail.getWriteMailContent(FireGPG_cGmail.lastDomToverify.document,info1);
- var boutonBox = cGmail.lastDomToverify.document.getElementById('sb_' + info1).firstChild;
+ var boutonBox = FireGPG_cGmail.lastDomToverify.document.getElementById('sb_' + info1).firstChild;
if (mailContent == "")
return;
- var result = FireGPG.sign(false,gmailWrapping(mailContent));
+ var result = FireGPG.sign(false,FireGPGMisc.gmailWrapping(mailContent));
- if (result.result == RESULT_SUCCESS) {
+ if (result.result == FireGPGResults.SUCCESS) {
- cGmail.setWriteMailContent(cGmail.lastDomToverify.document,info1,result.signed);
+ FireGPG_cGmail.setWriteMailContent(FireGPG_cGmail.lastDomToverify.document,info1,result.signed);
if (target.id == "sndsign") {
- cGmail.sendEmail(boutonBox,cGmail.lastDomToverify.document);
- boutonBox = cGmail.lastDomToverify.document.getElementById('nc_' + info1).parentNode;
- cGmail.sendEmail(boutonBox,cGmail.lastDomToverify.document);
+ FireGPG_cGmail.sendEmail(boutonBox,FireGPG_cGmail.lastDomToverify.document);
+ boutonBox = FireGPG_cGmail.lastDomToverify.document.getElementById('nc_' + info1).parentNode;
+ FireGPG_cGmail.sendEmail(boutonBox,FireGPG_cGmail.lastDomToverify.document);
}
}
@@ -607,24 +607,24 @@ var cGmail = {
else if (target.id == "sndpsign" || target.id == "psign")
{
- var mailContent = cGmail.getWriteMailContent(cGmail.lastDomToverify.document,info1);
+ var mailContent = FireGPG_cGmail.getWriteMailContent(FireGPG_cGmail.lastDomToverify.document,info1);
- var boutonBox = cGmail.lastDomToverify.document.getElementById('sb_' + info1).firstChild;
+ var boutonBox = FireGPG_cGmail.lastDomToverify.document.getElementById('sb_' + info1).firstChild;
if (mailContent == "")
return;
- var result = FireGPG.sign(false,gmailWrapping(mailContent),null,null,true);
+ var result = FireGPG.sign(false,FireGPGMisc.gmailWrapping(mailContent),null,null,true);
- if (result.result == RESULT_SUCCESS) {
+ if (result.result == FireGPGResults.SUCCESS) {
- cGmail.setWriteMailContent(cGmail.lastDomToverify.document,info1,result.signed);
+ FireGPG_cGmail.setWriteMailContent(FireGPG_cGmail.lastDomToverify.document,info1,result.signed);
if (target.id == "sndpsign") {
- cGmail.sendEmail(boutonBox,cGmail.lastDomToverify.document);
- boutonBox = cGmail.lastDomToverify.document.getElementById('nc_' + info1).parentNode;
- cGmail.sendEmail(boutonBox,cGmail.lastDomToverify.document);
+ FireGPG_cGmail.sendEmail(boutonBox,FireGPG_cGmail.lastDomToverify.document);
+ boutonBox = FireGPG_cGmail.lastDomToverify.document.getElementById('nc_' + info1).parentNode;
+ FireGPG_cGmail.sendEmail(boutonBox,FireGPG_cGmail.lastDomToverify.document);
}
}
@@ -633,11 +633,11 @@ var cGmail = {
{
//This code has to mix with the previous else/if block
- var mailContent = cGmail.getWriteMailContent(cGmail.lastDomToverify.document,info1);
+ var mailContent = FireGPG_cGmail.getWriteMailContent(FireGPG_cGmail.lastDomToverify.document,info1);
- var whoWillGotTheMail = cGmail.getToCcBccMail(cGmail.lastDomToverify.document,info1);
+ var whoWillGotTheMail = FireGPG_cGmail.getToCcBccMail(FireGPG_cGmail.lastDomToverify.document,info1);
- var boutonBox = cGmail.lastDomToverify.document.getElementById('sb_' + info1).firstChild;
+ var boutonBox = FireGPG_cGmail.lastDomToverify.document.getElementById('sb_' + info1).firstChild;
if (mailContent == "")
@@ -645,15 +645,15 @@ var cGmail = {
var result = FireGPG.crypt(false,mailContent,undefined, false, false,whoWillGotTheMail);
- if(result.result == RESULT_SUCCESS) {
+ if(result.result == FireGPGResults.SUCCESS) {
- cGmail.setWriteMailContent(cGmail.lastDomToverify.document,info1,result.encrypted);
+ FireGPG_cGmail.setWriteMailContent(FireGPG_cGmail.lastDomToverify.document,info1,result.encrypted);
if (target.id == "sndcrypt")
{
- cGmail.sendEmail(boutonBox,cGmail.lastDomToverify.document);
- boutonBox = cGmail.lastDomToverify.document.getElementById('nc_' + info1).parentNode;
- cGmail.sendEmail(boutonBox,cGmail.lastDomToverify.document);
+ FireGPG_cGmail.sendEmail(boutonBox,FireGPG_cGmail.lastDomToverify.document);
+ boutonBox = FireGPG_cGmail.lastDomToverify.document.getElementById('nc_' + info1).parentNode;
+ FireGPG_cGmail.sendEmail(boutonBox,FireGPG_cGmail.lastDomToverify.document);
}
}
@@ -663,11 +663,11 @@ var cGmail = {
{
//This code has to mix with the previous else/if block
- var mailContent = cGmail.getWriteMailContent(cGmail.lastDomToverify.document,info1);
+ var mailContent = FireGPG_cGmail.getWriteMailContent(FireGPG_cGmail.lastDomToverify.document,info1);
- var whoWillGotTheMail = cGmail.getToCcBccMail(cGmail.lastDomToverify.document,info1);
+ var whoWillGotTheMail = FireGPG_cGmail.getToCcBccMail(FireGPG_cGmail.lastDomToverify.document,info1);
- var boutonBox = cGmail.lastDomToverify.document.getElementById('sb_' + info1).firstChild;
+ var boutonBox = FireGPG_cGmail.lastDomToverify.document.getElementById('sb_' + info1).firstChild;
if (mailContent == "")
@@ -676,15 +676,15 @@ var cGmail = {
var result = FireGPG.cryptAndSign(false, mailContent, undefined ,false,undefined, undefined,true, whoWillGotTheMail);
- if(result.result == RESULT_SUCCESS) {
+ if(result.result == FireGPGResults.SUCCESS) {
- cGmail.setWriteMailContent(cGmail.lastDomToverify.document,info1,result.encrypted);
+ FireGPG_cGmail.setWriteMailContent(FireGPG_cGmail.lastDomToverify.document,info1,result.encrypted);
if (target.id == "sndsigncrypt")
{
- cGmail.sendEmail(boutonBox,cGmail.lastDomToverify.document);
- boutonBox = cGmail.lastDomToverify.document.getElementById('nc_' + info1).parentNode;
- cGmail.sendEmail(boutonBox,cGmail.lastDomToverify.document);
+ FireGPG_cGmail.sendEmail(boutonBox,FireGPG_cGmail.lastDomToverify.document);
+ boutonBox = FireGPG_cGmail.lastDomToverify.document.getElementById('nc_' + info1).parentNode;
+ FireGPG_cGmail.sendEmail(boutonBox,FireGPG_cGmail.lastDomToverify.document);
}
}
@@ -734,7 +734,7 @@ var cGmail = {
var indexOfQuote = select.indexOf('<span class="gmail_quote">');
if (indexOfQuote == -1)
indexOfQuote = select.length;
- contenuMail = Selection.wash(select.substring(0,indexOfQuote));
+ contenuMail = FireGPG_Selection.wash(select.substring(0,indexOfQuote));
this.composeIndexOfQuote = indexOfQuote;
}
@@ -757,7 +757,7 @@ var cGmail = {
textarera.selectionStart = 0;
textarera.selectionEnd = indexOfQuote;
- contenuMail = Selection.wash(select2.substring(0,indexOfQuote));
+ contenuMail = FireGPG_Selection.wash(select2.substring(0,indexOfQuote));
}
//var i18n = document.getElementById("firegpg-strings");
@@ -768,7 +768,7 @@ var cGmail = {
else
{
- contenuMail = Selection.wash(select2);
+ contenuMail = FireGPG_Selection.wash(select2);
}
}
else
@@ -782,7 +782,7 @@ var cGmail = {
var d = documentFragment;
var str = s.serializeToString(d);
- contenuMail = Selection.wash(str);
+ contenuMail = FireGPG_Selection.wash(str);
}
return contenuMail;
@@ -957,7 +957,7 @@ var cGmail = {
var s = new XMLSerializer();
var d = documentFragment;
var str = s.serializeToString(d);
- contenuMail = Selection.wash(str);
+ contenuMail = FireGPG_Selection.wash(str);
return contenuMail;
@@ -1025,14 +1025,14 @@ var cGmail = {
if (this.messageCache == null || this.messageCache[idOfTheMail] == null)
{
- var mailData = getContentXHttp("https://mail.google.com/mail/?ik=" + this.ik + "&view=om&th=" + idOfTheMail + "&zx=");
+ var mailData = FireGPGMisc.getContentXHttp("https://mail.google.com/mail/?ik=" + this.ik + "&view=om&th=" + idOfTheMail + "&zx=");
//temps en temps des probs en https (déconection) alors on utilise le http
if (mailData.indexOf("<html>") == 0)
{
alert("!");
- mailData = getContentXHttp("http://mail.google.com/mail/?ik=" + this.ik + "&view=om&th=" + idOfTheMail + "&zx=");
+ mailData = FireGPGMisc.getContentXHttp("http://mail.google.com/mail/?ik=" + this.ik + "&view=om&th=" + idOfTheMail + "&zx=");
}
if (this.messageCache == null)
diff --git a/content/Webmails/Gmail/cgmail2.js b/content/Webmails/Gmail/cgmail2.js
index fd37e71..c5ffa88 100644
--- a/content/Webmails/Gmail/cgmail2.js
+++ b/content/Webmails/Gmail/cgmail2.js
@@ -41,49 +41,47 @@ under the terms of any one of the MPL, the GPL or the LGPL.
/* Constant: GMAIL_MAIN_DOC_URL
The url of the mail document for gmail */
-const GMAIL_MAIN_DOC_URL = "http://mail.google.com/mail/?ui=2&view=bsp&ver=";
+const FGPG_GMAIL_MAIN_DOC_URL = "http://mail.google.com/mail/?ui=2&view=bsp&ver=";
/* Constant: GMAIL_MAIN_DOC_URL2
The url of the mail document for gmail and https. */
-const GMAIL_MAIN_DOC_URL2 = "https://mail.google.com/mail/?ui=2&view=bsp&ver=";
+const FGPG_GMAIL_MAIN_DOC_URL2 = "https://mail.google.com/mail/?ui=2&view=bsp&ver=";
//Pictures
-const IMG_SIGN_ON = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALlwAAC5cB2lSXmQAAAAd0SU1FB9kHGgoSMVDceZMAAAIySURBVDjLjZPLS9RRGIafMzNZaolZDaHOoET2B0x0YSSoVdFAi1rUKqhVLYSCKGkT4a5NpIuCLuoqWpSRrUoLTQvJSzUkXkDNBE0w1Ln95nfO+VrMKJNOlw8+DhzO+37Pd+D18oeKhLly7Zz/hdHxopogg6PTOPxvRcJc+NkbEvm8T+yXg9JxryoVCVMfCVO89q03j/hM8639D8pKNyo8HpSC6spi3+njlUe2FHIpFltK1QQZGJ3GAKg14mN3G/a2V1SUeAAQAWuyrcEanJTm1OWhuvYeGgF8uQaHD2y/UxHc5gEFYkFM5lwpAa9XASysXHlyDWpDO4IUFIJvAygF1mZabIYGYWomJsDrFY0vB79op39TAUaD0aDTYNzf8LGW5raZ8fYe5tYZAIGSQgVOPDtZZ9roDIE1WCsyNJpoy6XOXSFQ4NGQTiBOXG7c/gSuAyZLYrS86p4zwONcg1yCoNemwbGMjC+p+rPloFNgLSIiD5/PJZ91LR192csEUA1MrFvBo1NY8ci7wQW1J+AXXFHaNdLQMjv75E36/PAkpcAhYCTvHyjt0D+cVCdri1Guo2IJbesa5yeedtvGxRiB7NQR4Mc6A6UIuskEnQNJQrsUkzMpLjYtRjs/0uK4TAFjwDdgOe8fVG5VVR39CU6EvHQNJbje6rz9EOW+FYaz4uV8uVk1cAzlHVHN93kjjzpta99XmoBhIP634K2GyV/G5niS3X1jcvV9lJvANOD+K7m/ALzCEdEPOm1AAAAAAElFTkSuQmCC";
-const IMG_SIGN_OFF = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAAXNSR0IArs4c6QAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAAuXAAALlwHaVJeZAAAAB3RJTUUH2QcaCjARzAAfewAAAUtJREFUKM9dzk8rBHEcx/H3b2etuLBDXGw5CEUph01bysHmwAPghKODR+G2JzyCfQKKcnGQtLKlNpL82RLthLWmPeyitTPz+zqMHcPn+Pu8+vy+BqGk5lbXnViiZLm/b0aonsksTsQWRnrSVUmULO8fSCUzy90qgmIgMj/aka47iZKlA5Aa31jrVxEUoEANGrNjB3XrAaI+mFoaUACCIK3pD4CIDybNNqKADsiTcAM/C6lYX1Tj4aHRaATN7ttpLQCYHTSRUK2leO5v+1/EDRyasoXr78iJcOYDf6FHaHKvVvDQiOw5x5t5m17sFoi7iJyrhDjKlWztKPvYyTDl0A0et2oaV33Ktp07fDexKVMPgDIbFBjima2nwqlT5ZUqjdANZm+BJBdk765y8kKlVQbA67qkIof56yNe+OJPDIB4e6OvuHO1TxWPf/kGAVuOI6EGAwgAAAAASUVORK5CYII%3D";
+const FGPG_IMG_SIGN_ON = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALlwAAC5cB2lSXmQAAAAd0SU1FB9kHGgoSMVDceZMAAAIySURBVDjLjZPLS9RRGIafMzNZaolZDaHOoET2B0x0YSSoVdFAi1rUKqhVLYSCKGkT4a5NpIuCLuoqWpSRrUoLTQvJSzUkXkDNBE0w1Ln95nfO+VrMKJNOlw8+DhzO+37Pd+D18oeKhLly7Zz/hdHxopogg6PTOPxvRcJc+NkbEvm8T+yXg9JxryoVCVMfCVO89q03j/hM8639D8pKNyo8HpSC6spi3+njlUe2FHIpFltK1QQZGJ3GAKg14mN3G/a2V1SUeAAQAWuyrcEanJTm1OWhuvYeGgF8uQaHD2y/UxHc5gEFYkFM5lwpAa9XASysXHlyDWpDO4IUFIJvAygF1mZabIYGYWomJsDrFY0vB79op39TAUaD0aDTYNzf8LGW5raZ8fYe5tYZAIGSQgVOPDtZZ9roDIE1WCsyNJpoy6XOXSFQ4NGQTiBOXG7c/gSuAyZLYrS86p4zwONcg1yCoNemwbGMjC+p+rPloFNgLSIiD5/PJZ91LR192csEUA1MrFvBo1NY8ci7wQW1J+AXXFHaNdLQMjv75E36/PAkpcAhYCTvHyjt0D+cVCdri1Guo2IJbesa5yeedtvGxRiB7NQR4Mc6A6UIuskEnQNJQrsUkzMpLjYtRjs/0uK4TAFjwDdgOe8fVG5VVR39CU6EvHQNJbje6rz9EOW+FYaz4uV8uVk1cAzlHVHN93kjjzpta99XmoBhIP634K2GyV/G5niS3X1jcvV9lJvANOD+K7m/ALzCEdEPOm1AAAAAAElFTkSuQmCC";
+const FGPG_IMG_SIGN_OFF = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAAXNSR0IArs4c6QAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAAuXAAALlwHaVJeZAAAAB3RJTUUH2QcaCjARzAAfewAAAUtJREFUKM9dzk8rBHEcx/H3b2etuLBDXGw5CEUph01bysHmwAPghKODR+G2JzyCfQKKcnGQtLKlNpL82RLthLWmPeyitTPz+zqMHcPn+Pu8+vy+BqGk5lbXnViiZLm/b0aonsksTsQWRnrSVUmULO8fSCUzy90qgmIgMj/aka47iZKlA5Aa31jrVxEUoEANGrNjB3XrAaI+mFoaUACCIK3pD4CIDybNNqKADsiTcAM/C6lYX1Tj4aHRaATN7ttpLQCYHTSRUK2leO5v+1/EDRyasoXr78iJcOYDf6FHaHKvVvDQiOw5x5t5m17sFoi7iJyrhDjKlWztKPvYyTDl0A0et2oaV33Ktp07fDexKVMPgDIbFBjima2nwqlT5ZUqjdANZm+BJBdk765y8kKlVQbA67qkIof56yNe+OJPDIB4e6OvuHO1TxWPf/kGAVuOI6EGAwgAAAAASUVORK5CYII%3D";
-const IMG_ENCRYPT_ON = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAQCAYAAADJViUEAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALAAAACwAB5DetvwAAAAd0SU1FB9kHGgoVEr36niYAAAJSSURBVCjPjZPPS5RBGMc/M/PuD81lVWyTUtDQk4IQFBkY1EWok1AXb12koHMZhkh06GAI/gGd61J07LClkCGBQiYZlIVpadar7tq7++77zrvT4X1117z0wJeZgfl8n2e+MIJ/anh4rFFKORaLWf11dbXtvq/XPE+/Au6MjQ1vVt8V1YeRkXsXlBLPentP097elhZCEARl1tfXCwsLH5zdXef66Ojtp4fgu3fvH9e6tDQ4eLU2mUxaWmtyuXwghKC+Pq1ct2Sy2Wnbcdzzo6O3lgCsPXh7e+vBwMClWDKZVLa9FWSzL1cWFxc/ZjLHmjo7Ozv6+s6lenq6G6amXo8Dlw/AUnKxubm5RmvNzMzs74mJhyO2bb8FMkNDNyZTqSMdXV1dDYlE/Mw+s7dpaKhvklJRKBTN8vLnFdu2nwBfgNmdnZ3Z1dUffhAEvpQqfQgWQkgwlEqeSSSSAKZi3FjWWivP88q+r9WBwNbHk5/iVqxDKYkBykFgFIEf3RAGoRBCCikxpowvgrXMTbfVAtCBdfLo2RKoaBaFQBMvOyBromRikRLw83n8xP7YjpYo36A8E66+4dHjgN5rPvMvyijLoOIGVWtQdQZHy8qbHU9Bjory8OadYe6bYWnFQAHwAB8og+OrClzwFOSpKAf93aF7V4uAEqH24FIV7LgKHOBPpF14vxyGvfbLgBt11hFcDGErggVulL0ILdvSMHlF0poWIZwAggh2ldiHi65k7nvKVH+SUy2hkZEwNw/CQmCFRKEgK52/buami26smf+sjXxuA+AvRn8EP+5R8C8AAAAASUVORK5CYII%3D";
-const IMG_ENCRYPT_OFF = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAQCAQAAABjX+2PAAAAAXNSR0IArs4c6QAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAAsAAAALAAHkN62/AAAAB3RJTUUH2QcaCjITEDgc1QAAAV1JREFUGNNtkT9LW2EYxX/P8743l9Rak2pCQYJkqmKxs0O/QKGzpY4tDn4BKShd3N36DbqVUhC6CopLKR3iVCFpSgQLaUhKYsz98+Z1uFcnzzMceH4cOHCEXO9n9FWwOrOQ9JNffPkwzL6S2e5T3V6nXhQcl3EjGn3a+wlgAPZK6c5GWC04BtPYV22tcLHyonE0yvHam5eL86bnv/07/N26HhSWzKNCs3L8HSyALD8JUk6HB197bWa3Xs9WVx+EdQAFKD9Uxr7Z6/2gS2vQ6jjntHiHRSAiBA9Q9qnGPtW8+cd9WzWA8+IAQUUUj++/27HgKs9QFBVnJ4QoFkvASQkUElx+n3nLMZaAkCIJYCHmCkUxNGjzhwjBMCXOqkWMGTPmiudAjYSEFE+UpSMiQFGaQJcYQ8CU6wxPiBFAecwmZWICpngmkuOOz4ZZQhDOMGLQ2/Tf88kc92jwH24AgN5+uB4a3EQAAAAASUVORK5CYII%3D";
+const FGPG_IMG_ENCRYPT_ON = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAQCAYAAADJViUEAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALAAAACwAB5DetvwAAAAd0SU1FB9kHGgoVEr36niYAAAJSSURBVCjPjZPPS5RBGMc/M/PuD81lVWyTUtDQk4IQFBkY1EWok1AXb12koHMZhkh06GAI/gGd61J07LClkCGBQiYZlIVpadar7tq7++77zrvT4X1117z0wJeZgfl8n2e+MIJ/anh4rFFKORaLWf11dbXtvq/XPE+/Au6MjQ1vVt8V1YeRkXsXlBLPentP097elhZCEARl1tfXCwsLH5zdXef66Ojtp4fgu3fvH9e6tDQ4eLU2mUxaWmtyuXwghKC+Pq1ct2Sy2Wnbcdzzo6O3lgCsPXh7e+vBwMClWDKZVLa9FWSzL1cWFxc/ZjLHmjo7Ozv6+s6lenq6G6amXo8Dlw/AUnKxubm5RmvNzMzs74mJhyO2bb8FMkNDNyZTqSMdXV1dDYlE/Mw+s7dpaKhvklJRKBTN8vLnFdu2nwBfgNmdnZ3Z1dUffhAEvpQqfQgWQkgwlEqeSSSSAKZi3FjWWivP88q+r9WBwNbHk5/iVqxDKYkBykFgFIEf3RAGoRBCCikxpowvgrXMTbfVAtCBdfLo2RKoaBaFQBMvOyBromRikRLw83n8xP7YjpYo36A8E66+4dHjgN5rPvMvyijLoOIGVWtQdQZHy8qbHU9Bjory8OadYe6bYWnFQAHwAB8og+OrClzwFOSpKAf93aF7V4uAEqH24FIV7LgKHOBPpF14vxyGvfbLgBt11hFcDGErggVulL0ILdvSMHlF0poWIZwAggh2ldiHi65k7nvKVH+SUy2hkZEwNw/CQmCFRKEgK52/buami26smf+sjXxuA+AvRn8EP+5R8C8AAAAASUVORK5CYII%3D";
+const FGPG_IMG_ENCRYPT_OFF = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAQCAQAAABjX+2PAAAAAXNSR0IArs4c6QAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAAsAAAALAAHkN62/AAAAB3RJTUUH2QcaCjITEDgc1QAAAV1JREFUGNNtkT9LW2EYxX/P8743l9Rak2pCQYJkqmKxs0O/QKGzpY4tDn4BKShd3N36DbqVUhC6CopLKR3iVCFpSgQLaUhKYsz98+Z1uFcnzzMceH4cOHCEXO9n9FWwOrOQ9JNffPkwzL6S2e5T3V6nXhQcl3EjGn3a+wlgAPZK6c5GWC04BtPYV22tcLHyonE0yvHam5eL86bnv/07/N26HhSWzKNCs3L8HSyALD8JUk6HB197bWa3Xs9WVx+EdQAFKD9Uxr7Z6/2gS2vQ6jjntHiHRSAiBA9Q9qnGPtW8+cd9WzWA8+IAQUUUj++/27HgKs9QFBVnJ4QoFkvASQkUElx+n3nLMZaAkCIJYCHmCkUxNGjzhwjBMCXOqkWMGTPmiudAjYSEFE+UpSMiQFGaQJcYQ8CU6wxPiBFAecwmZWICpngmkuOOz4ZZQhDOMGLQ2/Tf88kc92jwH24AgN5+uB4a3EQAAAAASUVORK5CYII%3D";
-const IMG_INLINE_ON = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAMmwAADJsBwcsw5QAAAAd0SU1FB9kHGgo0B1y4by4AAAFBSURBVDjLnZPPSgMxEMa/JJtWL5VFqhtYQYTQ3ixIWXr01qv0JXr0GXwCpQ/Rg+/gC3jYLMiyLYW9FPEPLN1qLkI3XmxB3HTV7zTJZH4zmUkIvjQej8/zPL9DhQghj8aYy+FweAsAztrR6XT2siyrikeapkJrfQPgO6Ddbj/hF2KMEaWUWK83gDAMT6IoQlEUpYGO42AwGPzcXxue571qrbFarUoBtVoN9XrdDhBCvAkh8FdtAEmSeHEcb62g3+/bAYyxgnMOxlgpgHMOQogdIKV8kVL+/wp4Hh1hfgUU2n569xTAtQUwn+5jllekmwK+rYKzkULzAvh4twNcCcyW5YDFYrEzXx7AmKb1IbXcFoD7csBkMjlWSlmTU0rh+769iUEQJN1uF8YY2y8EpXTLFIAHSmmvamyu6x42Go1NIz4B+0Vdfr/juF8AAAAASUVORK5CYII%3D";
-const IMG_INLINE_OFF = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAAXNSR0IArs4c6QAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAAybAAAMmwHByzDlAAAAB3RJTUUH2QcaCjUE3KoP1QAAAL9JREFUKM99z80KAVEYxvH/mQ9CzYSmKJZTdmzkFuxtXIK9i3Apci/K2AgbCyk2mmmampKPDXXeI97Vqff3vE9HAcw7yRRjVPxcTJbgAPRKV3PPwc/GfEAn+dpjq8iHN1gFax7a0mGkvYFGmnHXQIGiBM28ya9xALb+xrgwlMB+uNgacFEShGn4v+JcO4oKKEtwqZy+coEOuseAmwAeex3E7pWnyLdlxa4eibxFS4LBuS8uKCwJOFkz83tVz8sBXnb+KqAqG6pSAAAAAElFTkSuQmCC";
+const FGPG_IMG_INLINE_ON = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAMmwAADJsBwcsw5QAAAAd0SU1FB9kHGgo0B1y4by4AAAFBSURBVDjLnZPPSgMxEMa/JJtWL5VFqhtYQYTQ3ixIWXr01qv0JXr0GXwCpQ/Rg+/gC3jYLMiyLYW9FPEPLN1qLkI3XmxB3HTV7zTJZH4zmUkIvjQej8/zPL9DhQghj8aYy+FweAsAztrR6XT2siyrikeapkJrfQPgO6Ddbj/hF2KMEaWUWK83gDAMT6IoQlEUpYGO42AwGPzcXxue571qrbFarUoBtVoN9XrdDhBCvAkh8FdtAEmSeHEcb62g3+/bAYyxgnMOxlgpgHMOQogdIKV8kVL+/wp4Hh1hfgUU2n569xTAtQUwn+5jllekmwK+rYKzkULzAvh4twNcCcyW5YDFYrEzXx7AmKb1IbXcFoD7csBkMjlWSlmTU0rh+769iUEQJN1uF8YY2y8EpXTLFIAHSmmvamyu6x42Go1NIz4B+0Vdfr/juF8AAAAASUVORK5CYII%3D";
+const FGPG_IMG_INLINE_OFF = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAAXNSR0IArs4c6QAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAAybAAAMmwHByzDlAAAAB3RJTUUH2QcaCjUE3KoP1QAAAL9JREFUKM99z80KAVEYxvH/mQ9CzYSmKJZTdmzkFuxtXIK9i3Apci/K2AgbCyk2mmmampKPDXXeI97Vqff3vE9HAcw7yRRjVPxcTJbgAPRKV3PPwc/GfEAn+dpjq8iHN1gFax7a0mGkvYFGmnHXQIGiBM28ya9xALb+xrgwlMB+uNgacFEShGn4v+JcO4oKKEtwqZy+coEOuseAmwAeex3E7pWnyLdlxa4eibxFS4LBuS8uKCwJOFkz83tVz8sBXnb+KqAqG6pSAAAAAElFTkSuQmCC";
-const IMG_ATTACHEMENTS_ON = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALvwAAC78BbPa+aAAAAAd0SU1FB9kHGgo3A3D4+PQAAAGQSURBVDjLjZE/aFNRFMa/79z78vLPFILPwZYU/8TJQKFQnMVJIriWggUHQVzcXUSXDF0yqKuDiGkpRXAqiKNiFVQwHUIgsQkdIsGkjxA1ec9BoS+5L/jO+Lvf/c53ziFC6mxubUOob47GQ/+YeqLE9uvfnmWDWpn+fOHMreeeN8prnTpstCrFRqtSBLytX797T5VK6mm9AUT0NZIfAI4BvAWAuO08IlWPooy0Yg5ACDXDGEPkBlESA6lATj6RChQdIQEFFCsEWxBGMBBqCBUQSEAKhCrUQJudNEgNCXgLNXx6E6YzExDm/MEUERIIRGIAoAJQCf8uN1KC/lFtR6vUieVCqbpcKL2PWXOnjtz6K0ZaolhIJRfefN5/cOV7d+/Lj3618+nr/avJxOldCbmOOQIIO3bSAfC62d5e/Yf9uO1cJuj/18AdNPcy6fzmylK5HLedhwAw/Nm5B9+723drH82GZqWd7KU7ufnrt5VKuADGo/Egc9B++aTTffcYgIuIVTi3eKNyfnH9BYCLs0R/AFUHYUhQn+mwAAAAAElFTkSuQmCC";
-const IMG_ATTACHEMENTS_OFF = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALvwAAC78BbPa+aAAAAAd0SU1FB9kHGgo4CRe1DSUAAAF9SURBVDjLjZO9S0JhFMafc45x0fJe+hCSKKRAoqXJRaMMEqJobMlNoqagf6G/IGhuKdrEsSgibi7VELRFRoiBouDU101FfBvkgumN7hkfnvc5v3NeDsGh5ucT6yISazTqytaUAvX1eZDNXu52ej3djxOJtU3L+tJ8vv430zw/AoBodDFqWZ+NQGB0rtvfEyAis8xUYOYWgDwA6LqxIcLfzNxD26MwM4iEOjUiApGQ6wARBhF1kTGYxU2AQOS3kYggIhBxSdDuRL8CmMUdQbuToHMCm8D1DtpG+oPsn2+0jUTEHRorBUcCj9MSK5XSQyg0lUgmt/YAVW82m3qh8HI3ORmecDXC8PBILp0+3s/nc8VS6fUjkzk5GBwcenRJwPD7jQEAT7e32UP7FHTdmHYVUK1WCsHg+HYqtXOl68YpALy/v60opZbK5eJrt58cjlELh2cWI5HYgqZ564Bq1Wrf3vv7m+vn58drAPX/Auwai8eXV4mUMs2LMwAlJ9MP3EBoWAEix+IAAAAASUVORK5CYII%3D";
+const FGPG_IMG_ATTACHEMENTS_ON = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALvwAAC78BbPa+aAAAAAd0SU1FB9kHGgo3A3D4+PQAAAGQSURBVDjLjZE/aFNRFMa/79z78vLPFILPwZYU/8TJQKFQnMVJIriWggUHQVzcXUSXDF0yqKuDiGkpRXAqiKNiFVQwHUIgsQkdIsGkjxA1ec9BoS+5L/jO+Lvf/c53ziFC6mxubUOob47GQ/+YeqLE9uvfnmWDWpn+fOHMreeeN8prnTpstCrFRqtSBLytX797T5VK6mm9AUT0NZIfAI4BvAWAuO08IlWPooy0Yg5ACDXDGEPkBlESA6lATj6RChQdIQEFFCsEWxBGMBBqCBUQSEAKhCrUQJudNEgNCXgLNXx6E6YzExDm/MEUERIIRGIAoAJQCf8uN1KC/lFtR6vUieVCqbpcKL2PWXOnjtz6K0ZaolhIJRfefN5/cOV7d+/Lj3618+nr/avJxOldCbmOOQIIO3bSAfC62d5e/Yf9uO1cJuj/18AdNPcy6fzmylK5HLedhwAw/Nm5B9+723drH82GZqWd7KU7ufnrt5VKuADGo/Egc9B++aTTffcYgIuIVTi3eKNyfnH9BYCLs0R/AFUHYUhQn+mwAAAAAElFTkSuQmCC";
+const FGPG_IMG_ATTACHEMENTS_OFF = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALvwAAC78BbPa+aAAAAAd0SU1FB9kHGgo4CRe1DSUAAAF9SURBVDjLjZO9S0JhFMafc45x0fJe+hCSKKRAoqXJRaMMEqJobMlNoqagf6G/IGhuKdrEsSgibi7VELRFRoiBouDU101FfBvkgumN7hkfnvc5v3NeDsGh5ucT6yISazTqytaUAvX1eZDNXu52ej3djxOJtU3L+tJ8vv430zw/AoBodDFqWZ+NQGB0rtvfEyAis8xUYOYWgDwA6LqxIcLfzNxD26MwM4iEOjUiApGQ6wARBhF1kTGYxU2AQOS3kYggIhBxSdDuRL8CmMUdQbuToHMCm8D1DtpG+oPsn2+0jUTEHRorBUcCj9MSK5XSQyg0lUgmt/YAVW82m3qh8HI3ORmecDXC8PBILp0+3s/nc8VS6fUjkzk5GBwcenRJwPD7jQEAT7e32UP7FHTdmHYVUK1WCsHg+HYqtXOl68YpALy/v60opZbK5eJrt58cjlELh2cWI5HYgqZ564Bq1Wrf3vv7m+vn58drAPX/Auwai8eXV4mUMs2LMwAlJ9MP3EBoWAEix+IAAAAASUVORK5CYII%3D";
-const IMG_ENCRYPTED = IMG_ENCRYPT_ON;
-const IMG_ENCRYPTED2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB9gFCxQBOXBpjnYAAAIFSURBVDjLzZHPS9NxGMdfn8++Op2hWaNE58LZKRNKI1MLRKZ06NahGYs6dO/SLaiTdFDoj8hDh04FefDHpLnAQ1oYUWFB6tRDsFmXre8+z9NhMqZ2rwceHngenhfP837Dvw7zt+bo6MAJ53RMDfWVpkilCJTU8SqdXvp4CBCPX44psmqMCRlTPVZUQVURkXJ1esc7CFD1H9lATcgag7Fm70yDoqiW0xiDqmKNXjsE8GqCV7u7z1EsFPj67TPGWIwBFKQCEEQUh3wIVC8PDfVdirRF7p2KdjA+PkEkEmVrO8uvn7vYwB6oSjaLPDAA/f399YODF58kxpKJnvO9TdW/iwip1BzpxRSrq+8oFguICCKyWywEwhagpeV4sq6ufqC350LTfuEgm92k+VgziRu3uDl2m9raIKoKSmphYaHkJZOJ+7FY55l4fOToQT0mJh8zOzuN7FlojS1/oAowA2Cnpp5NZrObnxYzr/ctz8/PMj39At/3y7aJ4MThnMOJoOrPAAQAVlbeZ0SK4VCo4UpX11kAGhqOkMksspvPlT1XUKlY+X1+bulhBQAQDjeeXF55e31jY53W1gjRaJTh4RF83+FciVw+R6lUKkOE5+vrWy/3edLXd7rxtx98ao0Z9Dyvtj0a9TpinTbS1m7rgkGTy+fM2toX3d7Zcbn8j7tv0stT/BfxB+vd+QMX9EoXAAAAAElFTkSuQmCC";
+const FGPG_IMG_ENCRYPTED = FGPG_IMG_ENCRYPT_ON;
+const FGPG_IMG_ENCRYPTED2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB9gFCxQBOXBpjnYAAAIFSURBVDjLzZHPS9NxGMdfn8++Op2hWaNE58LZKRNKI1MLRKZ06NahGYs6dO/SLaiTdFDoj8hDh04FefDHpLnAQ1oYUWFB6tRDsFmXre8+z9NhMqZ2rwceHngenhfP837Dvw7zt+bo6MAJ53RMDfWVpkilCJTU8SqdXvp4CBCPX44psmqMCRlTPVZUQVURkXJ1esc7CFD1H9lATcgag7Fm70yDoqiW0xiDqmKNXjsE8GqCV7u7z1EsFPj67TPGWIwBFKQCEEQUh3wIVC8PDfVdirRF7p2KdjA+PkEkEmVrO8uvn7vYwB6oSjaLPDAA/f399YODF58kxpKJnvO9TdW/iwip1BzpxRSrq+8oFguICCKyWywEwhagpeV4sq6ufqC350LTfuEgm92k+VgziRu3uDl2m9raIKoKSmphYaHkJZOJ+7FY55l4fOToQT0mJh8zOzuN7FlojS1/oAowA2Cnpp5NZrObnxYzr/ctz8/PMj39At/3y7aJ4MThnMOJoOrPAAQAVlbeZ0SK4VCo4UpX11kAGhqOkMksspvPlT1XUKlY+X1+bulhBQAQDjeeXF55e31jY53W1gjRaJTh4RF83+FciVw+R6lUKkOE5+vrWy/3edLXd7rxtx98ao0Z9Dyvtj0a9TpinTbS1m7rgkGTy+fM2toX3d7Zcbn8j7tv0stT/BfxB+vd+QMX9EoXAAAAAElFTkSuQmCC";
-const IMG_MAIL_NOTHING = IMG_ENCRYPTED2; //FireGPG's logo
-const IMG_MAIL_ERROR = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB9kHGgsDHqkWDe0AAAJRSURBVDjLxZNPSJNxGMc/z7t3m5tNXc0Um6tUOmiTUsm/gQfTDt26KBh06liXbh4iyFNBR6FbJJpZHSQiIkQ0waSalpke9OByk4naWrO5d3t/HZSxMujQoQceHngeng/P83144H+b/CnZ3t50OJ1WXUpwZJKmmQkmpFSa5xMTb+b3AdraWsoU5kcRcYpklxVKgVIK0zR3Y1pd1n8HKGXc0CxWpyaCaLI3pqBQKLXrIoJSCk3UhX0A3Wo/7/efYieRYGl5ERENEUCBmQGYmKYijTlnyW5uba1v8B7xXjvqO05v7228Xh+h8Cqxb1E0yx4oSzYNs0cAGhsbHc3NZ+52dnV31pyuzc/ePbm1xYfhRyQ/z/Pje4yF7Rhvo5uE00Z0J2Hx6ADFxYe6c3IcTbU1dfnZEyW3tggNDXEsGCTH7sCw2jlx0EOp6LxYD8/0jY2l9O7uzutlZeWVbW3nCn7XY+jWTep2DDztHYgIWjyOq6CA8pERGlZD9AFaf//DO6urXxZeT47/0jw6+oqNmQCSNIgrha2lBWdHBym3m+jaGtaVYB6ABSAQmJ00zR2P05l7tqrqJAC5uQf4NDiIK76N7naTV12NxekkMjXF4sAAX0Ph0LNU6l7mCh5PXtH7wLuLweAKJSVefD4f5sYmwelp8v1+UobBeiCAstlYHhtT0Uhk/CU8ychdX1+RlzTsDzSRZl3XbaU+n17hyrcUzc5Zc6Ix0URIbGxgLywksrwUthipqz3wWP72K5egPVfkigsqRSlbAoJReLoN94ch+s/f+BMQoPJkPt9JyAAAAABJRU5ErkJggg%3D%3D";
-
-const IMG_MAIL_SIGNED_OK = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAMoQAADKEBQYPKVwAAAAd0SU1FB9kHGgo6A8VWhrkAAAK0SURBVDjLjZNPaJt1GMc/759kSWjWNk2ZNV0dk9RRq71s1C1aBx62QzzIYCcP4kH8B4J48DYYHsUdRPGgoKDgYTAdQhXsoUNUxpJ1a13XjkK6KJp1SZO+b95/v1/ex4vLYU63Bx6e5/B8P3yfBx6Lu6Jc4tkP3i5UgsgZfLRAZb1OyINGucT0xvwTWpZnRVYOy9r5KVUu8U65ROpBxHuXzk75sjonsvqMyG8lkZWnJF6elcVPH/HKJY7fS2fead54cX9lZmYshZ0EKwmWDYaFIcLcwXz6yWLm3f8ElEuMHC0VRkmmwUqAYYAIIP3Bqze87//PQcFOJMCwQGLoaYh1v/qBAli4F8C+AzBFQ+BCT/2Tmlj3OFezWRqYkAMfzn6z34tqGn3q46e/+vFuB+OG8iF0+eXXTVAhrZbPqbXdLE8fIT1ZNIaGhh4efWj0SG4w98NL371w5l8rEHkS+47kMgLK56MlhSoeIA5iQjcidEMCN0AF2hwYyL557MvZo32AYVAg8ozqlS2jOGbItfUdNrJ5Il/hOh6u4+I6XTodhzFznNALbeXqt/qAxyd2Paa9Lu1OgNkLjZ+v7kgjjFVrexvLN2k2WzjODs/tOc7NZo0/tupst7cn+0fMZ/XEhWqHQ5NJFqttOf1FsJh/9daMmbaHB+0hXp5+nVQizYXNBar1S4gWIhV5fYDbjYevbSpuNlTvzLfx+/UGF42t1unMcGa46l1iJJPn8N455q+fBy1ILyYQfwXAAhjI8vyWIyPzFXlt6QafA5XQjwbTxcTBdDKdqrU2uPznRYIgQGK43W7+1bGbJ7oLcdcCWK/ztWnxyeV1fgI8AH1LVkPL361z0b6EbWeU0kagg7hxu1HrdNqvNN5TVwCM+/xYzsxycteUeSw1bu0LftfVcE0+i9usADsAfwMP0Varg8HQ3AAAAABJRU5ErkJggg%3D%3D";
-const IMG_MAIL_SIGNED_PART = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAMoQAADKEBQYPKVwAAAAd0SU1FB9kHGgo7HSZCipsAAAKvSURBVDjLfZNNSFRrGMd/73tmnA+b7KghpNVQaR8GUhRR0RfdPha1KajWdxHdS9EuatOHRGAEbVq0CQpatCwJLO8VqmstpJlStMwSbCxuR5svp5k5M+ec921hWZj5hwceeJ7n9/9vHoNp2mfu3nZtaVssrwpVS4PR2JA9XGIWiWnHq9u2tL4MNVYawhDkB3Lu6WfnzgDX7qc77VkB+8zdCy+tPTsU2WAGAVCA0mhPk/rXKp5PXD5wP935YDpAfm9ONZyIzd1UHRSGQAgxOZGTfHNnXailsvn0TAnkN/ea+l3R+bJCIgzxE/aHevMDD34LAOplhZxy1J4GBdpRaA2q4AF0zQqAyUVVVuBqVFmhyorc0xT53qxu23zhbt+O7qd92/77YyZAgyorlO2R7hhDuRrHKvHp0QeCjZWEV0WEvy6wILA4tMk/P/Cwp+Wfq78k0I7SylbaiPjQJcVArB9zcTWq6OFl3alSticDkcDx9pW3twP4AERzZ/2SI29F7NUX1h4O68GEK9rXROluWgFSIKRGa3Bcl2Vzmhiw+nzDiXcnOcYjCdC8KLDcLeTJZG2kVxLP+ia0VVJOKp3GKEqSyRS53AQ76/aSSI7wcXyUdCbdNJWgNuIuehLPsr6pgsfxjG69ZT+uPTbWIkM+s8o3jz9X/03QH+LJ+y7io8/RrqbslAtTgC95Zb5675CwHO/qPXVl1KJHjKdaw2bYjBeeUxOuZePCrXQMtoOr0Z7C1sV+AANgToT94zld0xHTf718y00gViqWq0KN/nWhilBwJDXMi/97sG0breBzJvkp60sezHepvAEwNModaXD9xRDdQAHAHdOvS0Zxrltdjvp9vrDjuMJ2bWV9tkay2cxR66LT+8s3zqBqGeFQYJXcE2wwovYHN156o2+oDP3ABMBXKzRMitg5suwAAAAASUVORK5CYII%3D";
-const IMG_MAIL_SIGNED_ERR = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAYAAAAmlE46AAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAMoQAADKEBQYPKVwAAAAd0SU1FB9kHGgsBCoH6uxIAAAKRSURBVCjPdZBLSFRxFMZ//zt3dGac0UZNiClJe+eIEonKrcyIIBwT2wVB6+y1C6KF7SJatIgKalGLCIKoqKw2LSwyWzgomqb5CsNXNs3ozHXuvE6LrMTqg4+zOOcH33cQEX45YFD37Ipv7nA9lwIG3uW7lV4O+UdelKekt1qkr1Y+PdueDBicDRg4/wsGDNZ1P9i+KAN7RAZ2i3wwRPpqJNNbLR13SsyAwcGVoAZw4mhpV0XFGgd6FtiywKaDsqFEqK3Md9btyGtlhbTGXapgr+FbTZYTbHZQCkQA+X3UHow8/gsEfLrdDsoGkoF0CjKp3zMeTwK8WgnqgE+TFMSjkE4uOcX0ZIJvbZvJ14rkTvX+jtGWlvBCKHTh+f37184tdVyrkotgRXnX+RmSFp3tMawnNZS4SvDaHcqh63p+Xl5hkc93te7QobsXlfoZlYQpmcUFyXcJX2eiZN6V4MnxoKqqSG/dSkrT0A8cIO12q5zc3CMby8oadaXwkTBVsD/Kji0uedQWVn5HEabTibe5mUwySWx4GLffTyyRwAoGtbRlHdPKirO3pMwY4UgcLW2p2V6RhGVhjo0xfusWNoeDXL+fhbExRm/e5OvICKHJyY1aoSdV/DoYoWoDtAfD8rgzMjg7McHM9DQJXf/zRbeb+Xicb1NTxEwzpEVjGW//5yQP38TSp67HL/eGEreHhocXZyMRipuamOvp4X1rK46CAlzbtvE9HCYDgypg8DbXReXgBCe7PvIUmD9ut78s93rrV5WWkjZNIuPjrK6sZCoYZD4a/aJDrQJcFZvwdA/JzK9Y65UqboB7hUrttIlkAyjAglEnnD4v0qZEhH9JKVWwD874oMEOHhO6u+DGJ+gSkfkfE/xmVKU6CsQAAAAASUVORK5CYII%3D";
-
-const IMG_MAIL_DECRYPTED = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALGwAACxsBJBCUfQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAL9SURBVDiNbZFLaFRnFMf/5/vu5M4kk5m5c01qwtik1rbBjILBN62LuBBFQexWN2K1dNdFMbHRiA9EVBihW4moISsjFFxKUSRRsAiiTIwZIzHizCR3cufeedzH3Pt1MaaJj8N3Vufjx/+cHwkhsFj9/afXMsbPNTU1/ijLgWbbtidd17sOUGpw8PjSx2VFi4C+vsFfFCWS6u3dwSORiExEqNU8pNMTxtTUmze27fx06tRx41MAA4CTJ89vam4Opfbv39sYiURk23bE7Ow7V9d1N5lcG+npWf8D53TnSwkYAGja3JU9e3Y1EBGePXteSqWu3jtx4s9bw8MjT8bGHi10dKyS43Fl+8DA2W8/AxARVFXZGAqFpEqlivv3H0wMDV07/Pjx+G+jo7cHpqamS5lMphiPK8w0jUOfAiQACIfDQcYYNK3gGYYxDuCtEAJE9I9pmtVsNhdUFLXZsqzuzxIsXJDbVcojYGbQYL7GurjRbl6Uk/blYLd5Ue5OBBdiUXc2IJenKRHItRDRxxZylxpdOVpPgvpMYJnaQgV0s3UzvGQXGqJhOGXLLWjmeMGc3ze8+64hVTzOWtdZ9XNKABjo1QQwNyPQtgb4q7UX0a4kJEbwbAHO5EA8Ju2o2W5627WuNVLZ5YAOgNe7BuDAHzVMvhc4+ns75J87UDEtMAJ8CPieD5lCCElN7TEWvySVbA4YH4RyQJKADZ2E7IKArkYRLlZAnAASEMxHW2gVojyGl/k0irqxRSrbnJYDwAHmA44HGJUyqvN5JNSv0dO2CUVHR5eaxOWHZ+BYDspWqVEqVzlQ/XBAVl8hPSvwXQtB5DVk1Sxyeg5tTQkc7vkVx/4+CMdxIXzAdq0MjRxJ+LtXa/S/BQKIBChAGE57uJFQwGNfgSRghdKCQlGDEAJGyTDmrFyvJAlbu/c6Gl4Su/gA1Re0+mmVp79/x/jKOOXn86iJGgqaNq/PGFfzQ9V/CUDn0gJf7Cg1YGcwSVtD3wQSdtZ7W33h3fV1jAkhnv4HD39KBvLRixYAAAAASUVORK5CYII%3D";
-const IMG_MAIL_DECRYPTED_PART = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALGwAACxsBJBCUfQAAAAd0SU1FB9kHGgsGKWzcXKcAAALvSURBVDjLbZFfaFt1FMc/5/5+N2narkmTdWnStHbt7MQW5sY2pUyFiYjonsQX/7wM/0xkj76L+KZCffLRIRsDcQxmhTGsA1GHoEzRNt2KnTSbTdIkTS65zZ+be38+1NJ27nDOy+HwOed7vmKMYSuuJi89qkR/GLdiJ3qkZ49r3NsN0zwHzJxYfW57cEfIFuBq8tKbKTU4M/zyqLL26bAowbQMze/rTiGb/9s1G09Orz7r3A+wAK4Pzh5LqMTMQ+8e6Lb26bBpGNP+s+n5q57XdbK3L/1U5qAt9uUHXWAB5Px7n4y/OhESJTSv1esXPjs/987ls+dnv5r9xb1YXQ89Fgmn7OT03OCV8fsBWkT4Lvn1UatP6cDxubbw7eLZynungbXf2n9Mp3Xq3KGfD1lq2I6Ub1VeB97fBQCIW/1dYgte1vPX/NINIGeMQUSul/1yw1tqdem0vadmnMn/SVgZmk8rUQQVn8DxGdOj6dzIwtTd8cXJ3MjCZMyKxuhgB44vUekbEJHdLuRGFjxrr9I7ervsCkq+AISOd6MSisAJvM5K+0ZQ8k8NLR50ZHnod7/vxbiFBWILaKH1o8t6bp34RAJ/tUPoeIStzcYYaBq8O+1/lnJLB/TGmafZf9QFBSjoAIe/7HC7YHjrlTThl15AaxtLIMAQ+AFhieBu1NPZ5fmPdL2lwPnPUAVaw+FRIb9uqCai9NY2ECUgBmMFpCLDRFWMW8UstarzuHZbSnYCUGAF0PbB2XBplIpkEiMcSR2j1q7ySGKKj3/4gHazjdusd2u3oaAByCakA2TvGh4eEEyxTD6Rp1AtkOrJcPrIGd6+8hrttocJoOU1/5KLb2SC58fKmx+SzRIxiC1cyPp8kelHxZKIhr39A1RqZYwxOHXHWWsWTmptWuW55WjvtrFbCYnAyNjNhspO3LPUYFyKpSId06FSLpeqK86nxc8bvwowui3ggRWVEM90TckTkf12ppX3c415/5ugyk/GmJv/AmVrSp9tZu/RAAAAAElFTkSuQmCC";
-/* NO USED ? */const IMG_MAIL_NOT_DECRYPTED = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALGwAACxsBJBCUfQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAL+SURBVDiNdZFfaJV1GMc/z+897/m388+dbdocMpqtxlm4XBaDbGgX4aDAiyAJvLGgeyHFqQMpRFbRBK/Cq7IhgkgKkkEXDhxKCTWdbuecdmrOdc7OOXvPn/f8f8/bxZyZ2cPzvf1+v8/zEdu2WZ8jR068JCKf+nzunS6XO1guV+YbDetbkC/Gxg5ZPGNk3eDw4bEPQyH/xK5dwyoUCrpFwLIs7t2bK8RiC4uVSu2N48cPrT5t4AA4duyzHX6/5/Teve94QKjVaqyspOsul5NIpM8fCAS23rz58/fAzqcNlIiQzabG9+x5W1dKMTMzU5yYOP3T0aOj3507N3lraurG6pYtXc62tvCro6Mntj+zQWtr66DX63GUSmWuX5+aP3v26wPAcjwefy0U2vDNxo3tEg63tszOzu0Hbv/HwOfztSilyGQyVjZr3AAStm0jIlP5fMFMpVItmzZ16pVKqUdEePLxavWkqzMsKfRCHFfxd7a1FZ4rnHL1Vz93RwqnXP1dbmNDsPHAoRfibNaTHZVxl/oXheS4t+4KrjVBALB5IgER+evOK/jtfrxOH8VatW4Y+R9/nZ5+94P5ectRsjTV8XIF1KODFBKdg1TC5vUh4c7kbnoC29AbDZoIfk+L7nR7R3oHBxMnRbodZl0DA9DW1BR475MGdx/YXHp/MwNtL9Ls60OGh6mcP497ZIR6PI53ebnr+YGBrxzFqgZ51hpooBywo0dYTNvUs2Hq/iqmUgS7u9EPHkTpOsbCAsbSEkY6/aYyq5qQh8fKgVhgNcE0imRSKZavXCEXjaJ0nVoux+yZMzy8fx8jmfQos6xBGSgBJjQLcHfR5oV2YcVMshiLYUciBHt7Wbh8Gd3vp3PfPrKZDEa9/tBhVjRyRQePKQhc/VhDdGE6Vmf20p8UL14kHY2ydO0a7UNDGIkE6WrVTMOXcuFA+4oSzfcPtvUFBLn9i6kxV1ZO05J1vCbk/oALk7b9kQDdj7LV/yjgh93b4a0O6DQg/Rv8kISrwK2/AbvKQOYDlrSwAAAAAElFTkSuQmCC";
+const FGPG_IMG_MAIL_NOTHING = FGPG_IMG_ENCRYPTED2; //FireGPG's logo
+const FGPG_IMG_MAIL_ERROR = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB9kHGgsDHqkWDe0AAAJRSURBVDjLxZNPSJNxGMc/z7t3m5tNXc0Um6tUOmiTUsm/gQfTDt26KBh06liXbh4iyFNBR6FbJJpZHSQiIkQ0waSalpke9OByk4naWrO5d3t/HZSxMujQoQceHngeng/P83144H+b/CnZ3t50OJ1WXUpwZJKmmQkmpFSa5xMTb+b3AdraWsoU5kcRcYpklxVKgVIK0zR3Y1pd1n8HKGXc0CxWpyaCaLI3pqBQKLXrIoJSCk3UhX0A3Wo/7/efYieRYGl5ERENEUCBmQGYmKYijTlnyW5uba1v8B7xXjvqO05v7228Xh+h8Cqxb1E0yx4oSzYNs0cAGhsbHc3NZ+52dnV31pyuzc/ePbm1xYfhRyQ/z/Pje4yF7Rhvo5uE00Z0J2Hx6ADFxYe6c3IcTbU1dfnZEyW3tggNDXEsGCTH7sCw2jlx0EOp6LxYD8/0jY2l9O7uzutlZeWVbW3nCn7XY+jWTep2DDztHYgIWjyOq6CA8pERGlZD9AFaf//DO6urXxZeT47/0jw6+oqNmQCSNIgrha2lBWdHBym3m+jaGtaVYB6ABSAQmJ00zR2P05l7tqrqJAC5uQf4NDiIK76N7naTV12NxekkMjXF4sAAX0Ph0LNU6l7mCh5PXtH7wLuLweAKJSVefD4f5sYmwelp8v1+UobBeiCAstlYHhtT0Uhk/CU8ychdX1+RlzTsDzSRZl3XbaU+n17hyrcUzc5Zc6Ix0URIbGxgLywksrwUthipqz3wWP72K5egPVfkigsqRSlbAoJReLoN94ch+s/f+BMQoPJkPt9JyAAAAABJRU5ErkJggg%3D%3D";
+const FGPG_IMG_MAIL_SIGNED_OK = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAMoQAADKEBQYPKVwAAAAd0SU1FB9kHGgo6A8VWhrkAAAK0SURBVDjLjZNPaJt1GMc/759kSWjWNk2ZNV0dk9RRq71s1C1aBx62QzzIYCcP4kH8B4J48DYYHsUdRPGgoKDgYTAdQhXsoUNUxpJ1a13XjkK6KJp1SZO+b95/v1/ex4vLYU63Bx6e5/B8P3yfBx6Lu6Jc4tkP3i5UgsgZfLRAZb1OyINGucT0xvwTWpZnRVYOy9r5KVUu8U65ROpBxHuXzk75sjonsvqMyG8lkZWnJF6elcVPH/HKJY7fS2fead54cX9lZmYshZ0EKwmWDYaFIcLcwXz6yWLm3f8ElEuMHC0VRkmmwUqAYYAIIP3Bqze87//PQcFOJMCwQGLoaYh1v/qBAli4F8C+AzBFQ+BCT/2Tmlj3OFezWRqYkAMfzn6z34tqGn3q46e/+vFuB+OG8iF0+eXXTVAhrZbPqbXdLE8fIT1ZNIaGhh4efWj0SG4w98NL371w5l8rEHkS+47kMgLK56MlhSoeIA5iQjcidEMCN0AF2hwYyL557MvZo32AYVAg8ozqlS2jOGbItfUdNrJ5Il/hOh6u4+I6XTodhzFznNALbeXqt/qAxyd2Paa9Lu1OgNkLjZ+v7kgjjFVrexvLN2k2WzjODs/tOc7NZo0/tupst7cn+0fMZ/XEhWqHQ5NJFqttOf1FsJh/9daMmbaHB+0hXp5+nVQizYXNBar1S4gWIhV5fYDbjYevbSpuNlTvzLfx+/UGF42t1unMcGa46l1iJJPn8N455q+fBy1ILyYQfwXAAhjI8vyWIyPzFXlt6QafA5XQjwbTxcTBdDKdqrU2uPznRYIgQGK43W7+1bGbJ7oLcdcCWK/ztWnxyeV1fgI8AH1LVkPL361z0b6EbWeU0kagg7hxu1HrdNqvNN5TVwCM+/xYzsxycteUeSw1bu0LftfVcE0+i9usADsAfwMP0Varg8HQ3AAAAABJRU5ErkJggg%3D%3D";
+const FGPG_IMG_MAIL_SIGNED_PART = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAMoQAADKEBQYPKVwAAAAd0SU1FB9kHGgo7HSZCipsAAAKvSURBVDjLfZNNSFRrGMd/73tmnA+b7KghpNVQaR8GUhRR0RfdPha1KajWdxHdS9EuatOHRGAEbVq0CQpatCwJLO8VqmstpJlStMwSbCxuR5svp5k5M+ec921hWZj5hwceeJ7n9/9vHoNp2mfu3nZtaVssrwpVS4PR2JA9XGIWiWnHq9u2tL4MNVYawhDkB3Lu6WfnzgDX7qc77VkB+8zdCy+tPTsU2WAGAVCA0mhPk/rXKp5PXD5wP935YDpAfm9ONZyIzd1UHRSGQAgxOZGTfHNnXailsvn0TAnkN/ea+l3R+bJCIgzxE/aHevMDD34LAOplhZxy1J4GBdpRaA2q4AF0zQqAyUVVVuBqVFmhyorc0xT53qxu23zhbt+O7qd92/77YyZAgyorlO2R7hhDuRrHKvHp0QeCjZWEV0WEvy6wILA4tMk/P/Cwp+Wfq78k0I7SylbaiPjQJcVArB9zcTWq6OFl3alSticDkcDx9pW3twP4AERzZ/2SI29F7NUX1h4O68GEK9rXROluWgFSIKRGa3Bcl2Vzmhiw+nzDiXcnOcYjCdC8KLDcLeTJZG2kVxLP+ia0VVJOKp3GKEqSyRS53AQ76/aSSI7wcXyUdCbdNJWgNuIuehLPsr6pgsfxjG69ZT+uPTbWIkM+s8o3jz9X/03QH+LJ+y7io8/RrqbslAtTgC95Zb5675CwHO/qPXVl1KJHjKdaw2bYjBeeUxOuZePCrXQMtoOr0Z7C1sV+AANgToT94zld0xHTf718y00gViqWq0KN/nWhilBwJDXMi/97sG0breBzJvkp60sezHepvAEwNModaXD9xRDdQAHAHdOvS0Zxrltdjvp9vrDjuMJ2bWV9tkay2cxR66LT+8s3zqBqGeFQYJXcE2wwovYHN156o2+oDP3ABMBXKzRMitg5suwAAAAASUVORK5CYII%3D";
+const FGPG_IMG_MAIL_SIGNED_ERR = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAYAAAAmlE46AAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAMoQAADKEBQYPKVwAAAAd0SU1FB9kHGgsBCoH6uxIAAAKRSURBVCjPdZBLSFRxFMZ//zt3dGac0UZNiClJe+eIEonKrcyIIBwT2wVB6+y1C6KF7SJatIgKalGLCIKoqKw2LSwyWzgomqb5CsNXNs3ozHXuvE6LrMTqg4+zOOcH33cQEX45YFD37Ipv7nA9lwIG3uW7lV4O+UdelKekt1qkr1Y+PdueDBicDRg4/wsGDNZ1P9i+KAN7RAZ2i3wwRPpqJNNbLR13SsyAwcGVoAZw4mhpV0XFGgd6FtiywKaDsqFEqK3Md9btyGtlhbTGXapgr+FbTZYTbHZQCkQA+X3UHow8/gsEfLrdDsoGkoF0CjKp3zMeTwK8WgnqgE+TFMSjkE4uOcX0ZIJvbZvJ14rkTvX+jtGWlvBCKHTh+f37184tdVyrkotgRXnX+RmSFp3tMawnNZS4SvDaHcqh63p+Xl5hkc93te7QobsXlfoZlYQpmcUFyXcJX2eiZN6V4MnxoKqqSG/dSkrT0A8cIO12q5zc3CMby8oadaXwkTBVsD/Kji0uedQWVn5HEabTibe5mUwySWx4GLffTyyRwAoGtbRlHdPKirO3pMwY4UgcLW2p2V6RhGVhjo0xfusWNoeDXL+fhbExRm/e5OvICKHJyY1aoSdV/DoYoWoDtAfD8rgzMjg7McHM9DQJXf/zRbeb+Xicb1NTxEwzpEVjGW//5yQP38TSp67HL/eGEreHhocXZyMRipuamOvp4X1rK46CAlzbtvE9HCYDgypg8DbXReXgBCe7PvIUmD9ut78s93rrV5WWkjZNIuPjrK6sZCoYZD4a/aJDrQJcFZvwdA/JzK9Y65UqboB7hUrttIlkAyjAglEnnD4v0qZEhH9JKVWwD874oMEOHhO6u+DGJ+gSkfkfE/xmVKU6CsQAAAAASUVORK5CYII%3D";
+const FGPG_IMG_MAIL_DECRYPTED = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALGwAACxsBJBCUfQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAL9SURBVDiNbZFLaFRnFMf/5/vu5M4kk5m5c01qwtik1rbBjILBN62LuBBFQexWN2K1dNdFMbHRiA9EVBihW4moISsjFFxKUSRRsAiiTIwZIzHizCR3cufeedzH3Pt1MaaJj8N3Vufjx/+cHwkhsFj9/afXMsbPNTU1/ijLgWbbtidd17sOUGpw8PjSx2VFi4C+vsFfFCWS6u3dwSORiExEqNU8pNMTxtTUmze27fx06tRx41MAA4CTJ89vam4Opfbv39sYiURk23bE7Ow7V9d1N5lcG+npWf8D53TnSwkYAGja3JU9e3Y1EBGePXteSqWu3jtx4s9bw8MjT8bGHi10dKyS43Fl+8DA2W8/AxARVFXZGAqFpEqlivv3H0wMDV07/Pjx+G+jo7cHpqamS5lMphiPK8w0jUOfAiQACIfDQcYYNK3gGYYxDuCtEAJE9I9pmtVsNhdUFLXZsqzuzxIsXJDbVcojYGbQYL7GurjRbl6Uk/blYLd5Ue5OBBdiUXc2IJenKRHItRDRxxZylxpdOVpPgvpMYJnaQgV0s3UzvGQXGqJhOGXLLWjmeMGc3ze8+64hVTzOWtdZ9XNKABjo1QQwNyPQtgb4q7UX0a4kJEbwbAHO5EA8Ju2o2W5627WuNVLZ5YAOgNe7BuDAHzVMvhc4+ns75J87UDEtMAJ8CPieD5lCCElN7TEWvySVbA4YH4RyQJKADZ2E7IKArkYRLlZAnAASEMxHW2gVojyGl/k0irqxRSrbnJYDwAHmA44HGJUyqvN5JNSv0dO2CUVHR5eaxOWHZ+BYDspWqVEqVzlQ/XBAVl8hPSvwXQtB5DVk1Sxyeg5tTQkc7vkVx/4+CMdxIXzAdq0MjRxJ+LtXa/S/BQKIBChAGE57uJFQwGNfgSRghdKCQlGDEAJGyTDmrFyvJAlbu/c6Gl4Su/gA1Re0+mmVp79/x/jKOOXn86iJGgqaNq/PGFfzQ9V/CUDn0gJf7Cg1YGcwSVtD3wQSdtZ7W33h3fV1jAkhnv4HD39KBvLRixYAAAAASUVORK5CYII%3D";
+const FGPG_IMG_MAIL_DECRYPTED_PART = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALGwAACxsBJBCUfQAAAAd0SU1FB9kHGgsGKWzcXKcAAALvSURBVDjLbZFfaFt1FMc/5/5+N2narkmTdWnStHbt7MQW5sY2pUyFiYjonsQX/7wM/0xkj76L+KZCffLRIRsDcQxmhTGsA1GHoEzRNt2KnTSbTdIkTS65zZ+be38+1NJ27nDOy+HwOed7vmKMYSuuJi89qkR/GLdiJ3qkZ49r3NsN0zwHzJxYfW57cEfIFuBq8tKbKTU4M/zyqLL26bAowbQMze/rTiGb/9s1G09Orz7r3A+wAK4Pzh5LqMTMQ+8e6Lb26bBpGNP+s+n5q57XdbK3L/1U5qAt9uUHXWAB5Px7n4y/OhESJTSv1esXPjs/987ls+dnv5r9xb1YXQ89Fgmn7OT03OCV8fsBWkT4Lvn1UatP6cDxubbw7eLZynungbXf2n9Mp3Xq3KGfD1lq2I6Ub1VeB97fBQCIW/1dYgte1vPX/NINIGeMQUSul/1yw1tqdem0vadmnMn/SVgZmk8rUQQVn8DxGdOj6dzIwtTd8cXJ3MjCZMyKxuhgB44vUekbEJHdLuRGFjxrr9I7ervsCkq+AISOd6MSisAJvM5K+0ZQ8k8NLR50ZHnod7/vxbiFBWILaKH1o8t6bp34RAJ/tUPoeIStzcYYaBq8O+1/lnJLB/TGmafZf9QFBSjoAIe/7HC7YHjrlTThl15AaxtLIMAQ+AFhieBu1NPZ5fmPdL2lwPnPUAVaw+FRIb9uqCai9NY2ECUgBmMFpCLDRFWMW8UstarzuHZbSnYCUGAF0PbB2XBplIpkEiMcSR2j1q7ySGKKj3/4gHazjdusd2u3oaAByCakA2TvGh4eEEyxTD6Rp1AtkOrJcPrIGd6+8hrttocJoOU1/5KLb2SC58fKmx+SzRIxiC1cyPp8kelHxZKIhr39A1RqZYwxOHXHWWsWTmptWuW55WjvtrFbCYnAyNjNhspO3LPUYFyKpSId06FSLpeqK86nxc8bvwowui3ggRWVEM90TckTkf12ppX3c415/5ugyk/GmJv/AmVrSp9tZu/RAAAAAElFTkSuQmCC";
+/* NO USED ? */const FGPG_IMG_MAIL_NOT_DECRYPTED = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALGwAACxsBJBCUfQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAL+SURBVDiNdZFfaJV1GMc/z+897/m388+dbdocMpqtxlm4XBaDbGgX4aDAiyAJvLGgeyHFqQMpRFbRBK/Cq7IhgkgKkkEXDhxKCTWdbuecdmrOdc7OOXvPn/f8f8/bxZyZ2cPzvf1+v8/zEdu2WZ8jR068JCKf+nzunS6XO1guV+YbDetbkC/Gxg5ZPGNk3eDw4bEPQyH/xK5dwyoUCrpFwLIs7t2bK8RiC4uVSu2N48cPrT5t4AA4duyzHX6/5/Teve94QKjVaqyspOsul5NIpM8fCAS23rz58/fAzqcNlIiQzabG9+x5W1dKMTMzU5yYOP3T0aOj3507N3lraurG6pYtXc62tvCro6Mntj+zQWtr66DX63GUSmWuX5+aP3v26wPAcjwefy0U2vDNxo3tEg63tszOzu0Hbv/HwOfztSilyGQyVjZr3AAStm0jIlP5fMFMpVItmzZ16pVKqUdEePLxavWkqzMsKfRCHFfxd7a1FZ4rnHL1Vz93RwqnXP1dbmNDsPHAoRfibNaTHZVxl/oXheS4t+4KrjVBALB5IgER+evOK/jtfrxOH8VatW4Y+R9/nZ5+94P5ectRsjTV8XIF1KODFBKdg1TC5vUh4c7kbnoC29AbDZoIfk+L7nR7R3oHBxMnRbodZl0DA9DW1BR475MGdx/YXHp/MwNtL9Ls60OGh6mcP497ZIR6PI53ebnr+YGBrxzFqgZ51hpooBywo0dYTNvUs2Hq/iqmUgS7u9EPHkTpOsbCAsbSEkY6/aYyq5qQh8fKgVhgNcE0imRSKZavXCEXjaJ0nVoux+yZMzy8fx8jmfQos6xBGSgBJjQLcHfR5oV2YcVMshiLYUciBHt7Wbh8Gd3vp3PfPrKZDEa9/tBhVjRyRQePKQhc/VhDdGE6Vmf20p8UL14kHY2ydO0a7UNDGIkE6WrVTMOXcuFA+4oSzfcPtvUFBLn9i6kxV1ZO05J1vCbk/oALk7b9kQDdj7LV/yjgh93b4a0O6DQg/Rv8kISrwK2/AbvKQOYDlrSwAAAAAElFTkSuQmCC";
/*
- Class: cGmail2
+ Class: FireGPG_cGmail2
This is the main class to manage gmail's function with the new interface.
*/
-var cGmail2 = {
+var FireGPG_cGmail2 = {
/*
Variable: doc
@@ -112,837 +110,845 @@ var cGmail2 = {
*/
checkDoc: function(id, retry) {
- var i18n = document.getElementById("firegpg-strings");
+ try {
- var doc = cGmail2.doc[id];
+ var i18n = document.getElementById("firegpg-strings");
- if (doc != undefined && doc.location != undefined) {
+ var doc = FireGPG_cGmail2.doc[id];
- final_location = doc.location.href;
+ if (doc != undefined && doc.location != undefined) {
- var regrex = new RegExp('^https?://mail.google.com/a/[a-zA-Z.0-9-]*');
+ final_location = doc.location.href;
- final_location = final_location.replace(regrex, "http://mail.google.com/mail");
+ var regrex = new RegExp('^https?://mail.google.com/a/[a-zA-Z.0-9-]*');
- if (final_location.indexOf(GMAIL_MAIN_DOC_URL) == 0 || final_location .indexOf(GMAIL_MAIN_DOC_URL2) == 0) {
+ final_location = final_location.replace(regrex, "http://mail.google.com/mail");
- if (doc.location.href.indexOf("?ui=2") != -1)
- cGmail2.baseUrl = doc.location.href.substring(0, doc.location.href.indexOf("?ui=2"));
+ if (final_location.indexOf(FGPG_GMAIL_MAIN_DOC_URL) == 0 || final_location .indexOf(FGPG_GMAIL_MAIN_DOC_URL2) == 0) {
- //test for messages
- var listeTest = doc.getElementsByClassName('gE iv gt','div');
+ if (doc.location.href.indexOf("?ui=2") != -1)
+ FireGPG_cGmail2.baseUrl = doc.location.href.substring(0, doc.location.href.indexOf("?ui=2"));
- for (var i = 0; i < listeTest.length; i++) {
- listeTest[i] = listeTest[i].parentNode;
- if (listeTest[i].hasAttribute("gpg") == false) {
- listeTest[i].setAttribute("gpg","ok");
+ //test for messages
+ var listeTest = doc.getElementsByClassName('gE iv gt','div');
- var boutonboxs = listeTest[i].getElementsByTagName("table");
+ for (var i = 0; i < listeTest.length; i++) {
+ listeTest[i] = listeTest[i].parentNode;
+ if (listeTest[i].hasAttribute("gpg") == false) {
+ listeTest[i].setAttribute("gpg","ok");
- var boutonbox = "";
+ try {
- //On cherche la boite avec les boutons
- for (var j = 0; j < boutonboxs.length; j++) {
- if (boutonboxs[j] && boutonboxs[j].getAttribute("class").indexOf("cf gz") != -1) { //EWdQcf
- boutonbox = boutonboxs[j].firstChild.firstChild;
- break;
- }
- }
+ var boutonboxs = listeTest[i].getElementsByTagName("table");
+
+ var boutonbox = "";
+
+ //On cherche la boite avec les boutons
+ for (var j = 0; j < boutonboxs.length; j++) {
+ if (boutonboxs[j] && boutonboxs[j].getAttribute("class").indexOf("cf gz") != -1) { //EWdQcf
+ boutonbox = boutonboxs[j].firstChild.firstChild;
+ break;
+ }
+ }
- if (boutonbox == "" || !boutonbox)
- break;
+ if (boutonbox == "" || !boutonbox)
+ break;
- fireGPGDebug("ok");
- // var contenuMail = this.getMailContent(listeTest[i],doc);
+ fireGPGDebug("ok");
+ // var contenuMail = this.getMailContent(listeTest[i],doc);
- var td = doc.createElement("td");
+ var td = doc.createElement("td");
- var mimeContentOf = this.getMimeMailContens(listeTest[i],doc);
+ var mimeContentOf = this.getMimeMailContens(listeTest[i],doc);
- if (mimeContentOf == "{ERROR,WAIT}") {
- listeTest[i].removeAttribute("gpg");
- if (retry == undefined)
- retry = 0;
+ if (mimeContentOf == "{ERROR,WAIT}") {
+ listeTest[i].removeAttribute("gpg");
+ if (retry == undefined)
+ retry = 0;
- if ( retry < 10) {
- setTimeout("cGmail2.checkDoc("+id+", "+ (retry+1) + ")", 1000);
- fireGPGDebug('Reask (' + retry + ')', 'Checkdoc');
- cGmail2.docOccuped[id] = true;
- break;
- } else {
+ if ( retry < 10) {
+ setTimeout("FireGPG_cGmail2.checkDoc("+id+", "+ (retry+1) + ")", 1000);
+ fireGPGDebug('Reask (' + retry + ')', 'Checkdoc');
+ FireGPG_cGmail2.docOccuped[id] = true;
+ break;
+ } else {
- td.setAttribute("style","color: red;");
- td.innerHTML = '<span title="' + i18n.getString("noDataFromServer") + '" onclick="alert(this.title); return false;"><img src="' + IMG_MAIL_ERROR + '">&nbsp;' + i18n.getString("error") +'</span>';
+ td.setAttribute("style","color: red;");
+ td.innerHTML = '<span title="' + i18n.getString("noDataFromServer") + '" onclick="alert(this.title); return false;"><img src="' + FGPG_IMG_MAIL_ERROR + '">&nbsp;' + i18n.getString("error") +'</span>';
- }
- } else {
+ }
+ } else {
- decoder = new FireGPGMimeDecoder(mimeContentOf);
+ decoder = new FireGPGMimeDecoder(mimeContentOf);
- var nosign = false;
+ var nosign = false;
- if (mimeContentOf == "" || mimeContentOf == null) {
- td.setAttribute("style","color: red;");
- td.innerHTML = '<span title="' + i18n.getString("noDataFromServer") + '" onclick="alert(this.title); return false;"><img src="' + IMG_MAIL_ERROR + '">&nbsp;' + i18n.getString("error") +'</span>';
+ if (mimeContentOf == "" || mimeContentOf == null) {
+ td.setAttribute("style","color: red;");
+ td.innerHTML = '<span title="' + i18n.getString("noDataFromServer") + '" onclick="alert(this.title); return false;"><img src="' + FGPG_IMG_MAIL_ERROR + '">&nbsp;' + i18n.getString("error") +'</span>';
- } else {
+ } else {
- listeTest[i].setAttribute("firegpg-mail-id", decoder.extractMimeId());
+ listeTest[i].setAttribute("firegpg-mail-id", decoder.extractMimeId());
- result = decoder.detectGpGContent(cGmail2.noAutoDecrypt);
- var i18n = document.getElementById("firegpg-strings");
+ result = decoder.detectGpGContent(FireGPG_cGmail2.noAutoDecrypt);
+ var i18n = document.getElementById("firegpg-strings");
- if (result.decryptresult && (cGmail2.noAutoDecrypt || result.decryptresult.result == RESULT_SUCCESS)) {
+ if (result.decryptresult && (FireGPG_cGmail2.noAutoDecrypt || result.decryptresult.result == FireGPGResults.SUCCESS)) {
- if (cGmail2.encryptIfDecrypted)
- listeTest[i].setAttribute("firegpg-encrypt-this-mail", "firegpg-encrypt-this-mail");
+ if (FireGPG_cGmail2.encryptIfDecrypted)
+ listeTest[i].setAttribute("firegpg-encrypt-this-mail", "firegpg-encrypt-this-mail");
- if (cGmail2.noAutoDecrypt) {
- td.innerHTML = i18n.getString("GMailD");
+ if (FireGPG_cGmail2.noAutoDecrypt) {
+ td.innerHTML = i18n.getString("GMailD");
- var tmpListener = new Object;
- tmpListener = null;
- tmpListener = new cGmail2.callBack(doc)
- td.addEventListener('click',tmpListener,true);
- td.setAttribute("style","");
- td.setAttribute("firegpg-mail-to-decrypt", result.decryptDataToInsert);
+ var tmpListener = new Object;
+ tmpListener = null;
+ tmpListener = new FireGPG_cGmail2.callBack(doc)
+ td.addEventListener('click',tmpListener,true);
+ td.setAttribute("style","");
+ td.setAttribute("firegpg-mail-to-decrypt", result.decryptDataToInsert);
- } else {
+ } else {
- this.setMailContent(listeTest[i],doc,result.decryptDataToInsert);
+ this.setMailContent(listeTest[i],doc,result.decryptDataToInsert);
- if (result.moreDecryptData && result.moreDecryptData.length > 0) {
+ if (result.moreDecryptData && result.moreDecryptData.length > 0) {
- for (var titop = 0; titop < result.moreDecryptData.length; titop++)
- this.setMailContent(listeTest[i],doc,result.moreDecryptData[titop]);
+ for (var titop = 0; titop < result.moreDecryptData.length; titop++)
+ this.setMailContent(listeTest[i],doc,result.moreDecryptData[titop]);
- }
+ }
- if (cGmail2.decryptOnReply)
- listeTest[i].setAttribute("firegpg-decrypted-data", result.decryptDataToInsert);
+ if (FireGPG_cGmail2.decryptOnReply)
+ listeTest[i].setAttribute("firegpg-decrypted-data", result.decryptDataToInsert);
- td.setAttribute("style","color: blue;");
+ td.setAttribute("style","color: blue;");
- if (result.completeSignOrDecrypt)
- td.innerHTML += '<span title="' + i18n.getString("emailDecrypted") + '" onclick="alert(this.title); return false;"><img src="' + IMG_MAIL_DECRYPTED + '">&nbsp;' + i18n.getString("decryptedMail") + '</span>&nbsp;';
- else {
+ if (result.completeSignOrDecrypt)
+ td.innerHTML += '<span title="' + i18n.getString("emailDecrypted") + '" onclick="alert(this.title); return false;"><img src="' + FGPG_IMG_MAIL_DECRYPTED + '">&nbsp;' + i18n.getString("decryptedMail") + '</span>&nbsp;';
+ else {
- data = decoder.washFromPlain(result.specialmimepart).replace(/<br \/>/gi, '\n');
- rid="firegpg" + genreate_api_key() + "subpart" + genreate_api_key() + "display" + genreate_api_key();
+ data = decoder.washFromPlain(result.specialmimepart).replace(/<br \/>/gi, '\n');
+ rid="firegpg" + FireGPGMisc.genreate_api_key() + "subpart" + FireGPGMisc.genreate_api_key() + "display" + FireGPGMisc.genreate_api_key();
- td.setAttribute("style","color: magenta;");
- td.innerHTML += '<span title="' + i18n.getString("OnlyASubPart2") + ' ' + i18n.getString("emailDecrypted") + '" onclick="alert(document.getElementById(\'' + rid +'\').innerHTML); return false;"><img src="' + IMG_MAIL_DECRYPTED_PART + '">&nbsp;' + i18n.getString("partDecrypted") + '</span>&nbsp;<span id="' + rid +'" style="display: none">' + data + '</span>';
- }
- //td.setAttribute("style","color: blue;");
- //td.innerHTML = i18n.getString("GMailMailWasDecrypted") + " ";
+ td.setAttribute("style","color: magenta;");
+ td.innerHTML += '<span title="' + i18n.getString("OnlyASubPart2") + ' ' + i18n.getString("emailDecrypted") + '" onclick="alert(document.getElementById(\'' + rid +'\').innerHTML); return false;"><img src="' + FGPG_IMG_MAIL_DECRYPTED_PART + '">&nbsp;' + i18n.getString("partDecrypted") + '</span>&nbsp;<span id="' + rid +'" style="display: none">' + data + '</span>';
+ }
+ //td.setAttribute("style","color: blue;");
+ //td.innerHTML = i18n.getString("GMailMailWasDecrypted") + " ";
- //if (result.decryptresult.result.signresulttext != null && result.decryptresult.result.signresulttext != "")
- // td.innerHTML += i18n.getString("GMailSOK") + " " + htmlEncode(result.decryptresult.result.signresulttext) + " ";
+ //if (result.decryptresult.result.signresulttext != null && result.decryptresult.result.signresulttext != "")
+ // td.innerHTML += i18n.getString("GMailSOK") + " " + FireGPGMisc.htmlEncode(result.decryptresult.result.signresulttext) + " ";
- if (result.decryptresult.result.signresulttext != null && result.decryptresult.result.signresulttext != "") {
+ if (result.decryptresult.result.signresulttext != null && result.decryptresult.result.signresulttext != "") {
- if (cGmail2.showUserInfo)
- bonus = " (" + htmlEncode(result.decryptresult.result.signresulttext) + ")";
- else
- bonus = "";
+ if (FireGPG_cGmail2.showUserInfo)
+ bonus = " (" + FireGPGMisc.htmlEncode(result.decryptresult.result.signresulttext) + ")";
+ else
+ bonus = "";
- if (result.completeSignOrDecrypt)
- td.innerHTML += '<span title="' + i18n.getString("goodSignFrom") + ' ' + result.decryptresult.result.signresulttext.replace(/\\/gi, "\\\\").replace(/"/gi, "\\\"") + '" onclick="alert(this.title); return false;"><img src="' + IMG_MAIL_SIGNED_OK + '">&nbsp;' + i18n.getString("signedMail") + '' + bonus + '</span>';
- else {
+ if (result.completeSignOrDecrypt)
+ td.innerHTML += '<span title="' + i18n.getString("goodSignFrom") + ' ' + result.decryptresult.result.signresulttext.replace(/\\/gi, "\\\\").replace(/"/gi, "\\\"") + '" onclick="alert(this.title); return false;"><img src="' + FGPG_IMG_MAIL_SIGNED_OK + '">&nbsp;' + i18n.getString("signedMail") + '' + bonus + '</span>';
+ else {
- data = decoder.washFromPlain(result.specialmimepart).replace(/<br \/>/gi, '\n');
- rid="firegpg" + genreate_api_key() + "subpart" + genreate_api_key() + "display" + genreate_api_key();
+ data = decoder.washFromPlain(result.specialmimepart).replace(/<br \/>/gi, '\n');
+ rid="firegpg" + FireGPGMisc.genreate_api_key() + "subpart" + FireGPGMisc.genreate_api_key() + "display" + FireGPGMisc.genreate_api_key();
+
+ td.setAttribute("style","color: magenta;");
+ td.innerHTML += '<span title="' + i18n.getString("OnlyASubPart2 ")+ ' ' + i18n.getString("goodSignFrom") + ' ' + result.decryptresult.result.signresulttext.replace(/\\/gi, "\\\\").replace(/"/gi, "\\\"") + '" onclick="alert(document.getElementById(\'' + rid +'\').innerHTML); return false;"><img src="' + FGPG_IMG_MAIL_SIGNED_PART + '">&nbsp;' + i18n.getString("partSigned") + '' + bonus + '</span><span id="' + rid +'" style="display: none">' + data + '</span>';
+ }
+ }
- td.setAttribute("style","color: magenta;");
- td.innerHTML += '<span title="' + i18n.getString("OnlyASubPart2 ")+ ' ' + i18n.getString("goodSignFrom") + ' ' + result.decryptresult.result.signresulttext.replace(/\\/gi, "\\\\").replace(/"/gi, "\\\"") + '" onclick="alert(document.getElementById(\'' + rid +'\').innerHTML); return false;"><img src="' + IMG_MAIL_SIGNED_PART + '">&nbsp;' + i18n.getString("partSigned") + '' + bonus + '</span><span id="' + rid +'" style="display: none">' + data + '</span>';
}
+
}
+ if (result.signResult != null) {
- }
+ if (result.signResult.signresult == FireGPGResults.ERROR_NO_GPG_DATA) {
+ if (FireGPG_cGmail2.nonosign != true && !result.decryptresult && !FireGPG_cGmail2.noAutoDecrypt)
+ {
+ //td.setAttribute("style","color: orange;");
+ //td.innerHTML = i18n.getString("GMailNoS");
- }
- if (result.signResult != null) {
+ //td.setAttribute("style","color: red;");
+ td.innerHTML = '<span title="' + i18n.getString("nothingFound") + '" onclick="alert(this.title); return false;"><img src="' + FGPG_IMG_MAIL_NOTHING + '">&nbsp;FireGPG</span>';
- if (result.signResult.signresult == RESULT_ERROR_NO_GPG_DATA) {
- if (cGmail2.nonosign != true && !result.decryptresult && !cGmail2.noAutoDecrypt)
- {
- //td.setAttribute("style","color: orange;");
- //td.innerHTML = i18n.getString("GMailNoS");
+ }
+ nosign = true;
+ }
+ else if (result.signResult.signresult ==FireGPGResults.ERROR_UNKNOW) {
+ td.setAttribute("style","color: red;");
+ //td.innerHTML += i18n.getString("GMailSErr"); //"La première signature de ce mail est incorrect !";
- //td.setAttribute("style","color: red;");
- td.innerHTML = '<span title="' + i18n.getString("nothingFound") + '" onclick="alert(this.title); return false;"><img src="' + IMG_MAIL_NOTHING + '">&nbsp;FireGPG</span>';
+ td.innerHTML += '<span title="' + i18n.getString("unknowErrorCantVerify") + '" onclick="alert(this.title); return false;"><img src="' + FGPG_IMG_MAIL_SIGNED_ERR + '">&nbsp;' + i18n.getString("error") + '</span>';
+ }
+ else if (result.signResult.signresult == FireGPGResults.ERROR_BAD_SIGN) {
+ td.setAttribute("style","color: red;");
+ // td.innerHTML += i18n.getString("GMailSErr") + " (" + i18n.getString("falseSign") + ")"; //"La première signature de ce mail est incorrect !";
- }
- nosign = true;
- }
- else if (result.signResult.signresult ==RESULT_ERROR_UNKNOW) {
- td.setAttribute("style","color: red;");
- //td.innerHTML += i18n.getString("GMailSErr"); //"La première signature de ce mail est incorrect !";
+ td.innerHTML += '<span title="' + i18n.getString("wrongSignature") + '" onclick="alert(this.title); return false;"><img src="' + FGPG_IMG_MAIL_SIGNED_ERR + '">&nbsp;' + i18n.getString("wrongSignature2") + '</span>';
- td.innerHTML += '<span title="' + i18n.getString("unknowErrorCantVerify") + '" onclick="alert(this.title); return false;"><img src="' + IMG_MAIL_SIGNED_ERR + '">&nbsp;' + i18n.getString("error") + '</span>';
- }
- else if (result.signResult.signresult == RESULT_ERROR_BAD_SIGN) {
- td.setAttribute("style","color: red;");
- // td.innerHTML += i18n.getString("GMailSErr") + " (" + i18n.getString("falseSign") + ")"; //"La première signature de ce mail est incorrect !";
+ }
+ else if (result.signResult.signresult == FireGPGResults.ERROR_NO_KEY) {
+ td.setAttribute("style","color: red;");
+ // td.innerHTML += i18n.getString("GMailSErr") + " (" + i18n.getString("keyNotFound") + ")";
- td.innerHTML += '<span title="' + i18n.getString("wrongSignature") + '" onclick="alert(this.title); return false;"><img src="' + IMG_MAIL_SIGNED_ERR + '">&nbsp;' + i18n.getString("wrongSignature2") + '</span>';
+ td.innerHTML += '<span title="' + i18n.getString("noPublicKey") + '" onclick="alert(this.title); return false;"><img src="' + FGPG_IMG_MAIL_SIGNED_ERR + '">&nbsp;' + i18n.getString("keyNotFound") + '</span>';
- }
- else if (result.signResult.signresult == RESULT_ERROR_NO_KEY) {
- td.setAttribute("style","color: red;");
- // td.innerHTML += i18n.getString("GMailSErr") + " (" + i18n.getString("keyNotFound") + ")";
+ }
+ else if (result.signResult.signsresulttext != null){
- td.innerHTML += '<span title="' + i18n.getString("noPublicKey") + '" onclick="alert(this.title); return false;"><img src="' + IMG_MAIL_SIGNED_ERR + '">&nbsp;' + i18n.getString("keyNotFound") + '</span>';
+ td.setAttribute("style","color: green;");
+ //td.innerHTML += i18n.getString("GMailSOK") + " " + FireGPGMisc.htmlEncode(result.signResult.signresulttext); //"La première signature de ce mail est de testtest (testtest)
- }
- else if (result.signResult.signsresulttext != null){
+ if (FireGPG_cGmail2.showUserInfo)
+ bonus = " (" + FireGPGMisc.htmlEncode(result.signResult.signsresulttext).replace(/\n/gi, '<br />') + ")";
+ else
+ bonus = "";
- td.setAttribute("style","color: green;");
- //td.innerHTML += i18n.getString("GMailSOK") + " " + htmlEncode(result.signResult.signresulttext); //"La première signature de ce mail est de testtest (testtest)
- if (cGmail2.showUserInfo)
- bonus = " (" + htmlEncode(result.signResult.signsresulttext).replace(/\n/gi, '<br />') + ")";
- else
- bonus = "";
+ if (result.completeSignOrDecrypt)
+ td.innerHTML += '<span title="' + result.signResult.signsresulttext.replace(/\\/gi, "\\\\").replace(/"/gi, "\\\"") + '" onclick="alert(this.title); return false;"><img src="' + FGPG_IMG_MAIL_SIGNED_OK + '">&nbsp;' + i18n.getString("signedMail") + '' + bonus + '</span>';
+ else {
+ data = decoder.washFromPlain(result.specialmimepart).replace(/<br \/>/gi, '\n');
+ rid="firegpg" + FireGPGMisc.genreate_api_key() + "subpart" + FireGPGMisc.genreate_api_key() + "display" + FireGPGMisc.genreate_api_key();
+
+ td.setAttribute("style","color: magenta;");
+ td.innerHTML += '<span title="' + i18n.getString("OnlyASubPart2") + ' ' + result.signResult.signsresulttext.replace(/\\/gi, "\\\\").replace(/"/gi, "\\\"") + '" onclick="alert(document.getElementById(\'' + rid +'\').innerHTML); return false;"><img src="' + FGPG_IMG_MAIL_SIGNED_PART + '">&nbsp;' + i18n.getString("partSigned") + '' + bonus + '</span><span id="' + rid +'" style="display: none">' + data + '</span>';
+ }
+ }
- if (result.completeSignOrDecrypt)
- td.innerHTML += '<span title="' + result.signResult.signsresulttext.replace(/\\/gi, "\\\\").replace(/"/gi, "\\\"") + '" onclick="alert(this.title); return false;"><img src="' + IMG_MAIL_SIGNED_OK + '">&nbsp;' + i18n.getString("signedMail") + '' + bonus + '</span>';
- else {
+ } else {
- data = decoder.washFromPlain(result.specialmimepart).replace(/<br \/>/gi, '\n');
- rid="firegpg" + genreate_api_key() + "subpart" + genreate_api_key() + "display" + genreate_api_key();
+ if (FireGPG_cGmail2.nonosign != true && !result.decryptresult && !FireGPG_cGmail2.noAutoDecrypt)
+ {
+ //td.setAttribute("style","color: orange;");
+ //td.innerHTML = i18n.getString("GMailNoS");
+ td.innerHTML = '<span title="' + i18n.getString("nothingFound") + '" onclick="alert(this.title); return false;"><img src="' + FGPG_IMG_MAIL_NOTHING + '">&nbsp;FireGPG</span>';
- td.setAttribute("style","color: magenta;");
- td.innerHTML += '<span title="' + i18n.getString("OnlyASubPart2") + ' ' + result.signResult.signsresulttext.replace(/\\/gi, "\\\\").replace(/"/gi, "\\\"") + '" onclick="alert(document.getElementById(\'' + rid +'\').innerHTML); return false;"><img src="' + IMG_MAIL_SIGNED_PART + '">&nbsp;' + i18n.getString("partSigned") + '' + bonus + '</span><span id="' + rid +'" style="display: none">' + data + '</span>';
+ }
+ nosign = true;
}
- }
+ /* if (!result.completeSignOrDecrypt && !nosign) {
- } else {
-
- if (cGmail2.nonosign != true && !result.decryptresult && !cGmail2.noAutoDecrypt)
- {
- //td.setAttribute("style","color: orange;");
- //td.innerHTML = i18n.getString("GMailNoS");
- td.innerHTML = '<span title="' + i18n.getString("nothingFound") + '" onclick="alert(this.title); return false;"><img src="' + IMG_MAIL_NOTHING + '">&nbsp;FireGPG</span>';
+ data = decoder.washFromPlain(result.specialmimepart).replace(/<br \/>/gi, '\n');
+ rid="firegpg" + FireGPGMisc.genreate_api_key() + "subpart" + FireGPGMisc.genreate_api_key() + "display" + FireGPGMisc.genreate_api_key();
+ td.innerHTML += " <br /><span style=\"color: magenta;\">" + i18n.getString("OnlyASubPart").replace(/%w/, '<a href="#" onclick="alert(document.getElementById(\'' + rid +'\').innerHTML);">').replace(/%w2/,
+ '</a><span id="' + rid +'" style="display: none">' + data + '</span></span>');
+ } */ //
- }
- nosign = true;
- }
- /* if (!result.completeSignOrDecrypt && !nosign) {
+ var atts = result.attachements;
- data = decoder.washFromPlain(result.specialmimepart).replace(/<br \/>/gi, '\n');
- rid="firegpg" + genreate_api_key() + "subpart" + genreate_api_key() + "display" + genreate_api_key();
- td.innerHTML += " <br /><span style=\"color: magenta;\">" + i18n.getString("OnlyASubPart").replace(/%w/, '<a href="#" onclick="alert(document.getElementById(\'' + rid +'\').innerHTML);">').replace(/%w2/,
- '</a><span id="' + rid +'" style="display: none">' + data + '</span></span>');
- } */ //
+ var attachementBoxL = listeTest[i].parentNode.getElementsByClassName('hq gt', 'div');
+ attachementBox = attachementBoxL[0];
- var atts = result.attachements;
+ for (i in atts) {
- var attachementBoxL = listeTest[i].parentNode.getElementsByClassName('hq gt', 'div');
- attachementBox = attachementBoxL[0];
+ att = atts[i];
- for (i in atts) {
+ switch(att.type) {
+ case "decrypted":
- att = atts[i];
+ var table = doc.createElement('table');
- switch(att.type) {
- case "decrypted":
+ table.innerHTML = '<tbody><tr><td class="hw"><span id=":ga"><a href="#"><img gpg_action="sattachement2" class="hu" src="/mail/images/generic.gif"></a></span></td><td><b>%n</b> <br>%t&nbsp;&nbsp;<span id=":gd"><a href="#" gpg_action="sattachement">%s</a>&nbsp;&nbsp;</span></td></tr></tbody>';
+ table.innerHTML = table.innerHTML.replace(/%t/, i18n.getString("decryptedfile"));
+ table.innerHTML = table.innerHTML.replace(/%s/, i18n.getString("SaveAS"));
+ table.innerHTML = table.innerHTML.replace(/%n/, FireGPGMisc.htmlEncode(att.filename));
+ table.setAttribute('firegpg-file-content',FireGPGMisc.Base64.encode(att.data,true));
+ table.setAttribute('firegpg-file-name', att.filename);
+ table.setAttribute('firegpg-file-type','decrypted');
+ table.setAttribute('class', 'cf hr');
+ table.setAttribute('gpg_action','attachement');
+ var tmpListener = new Object;
+ tmpListener = null;
+ tmpListener = new FireGPG_cGmail2.callBack(doc)
+ table.addEventListener('click',tmpListener,true);
- var table = doc.createElement('table');
+ attachementBox.appendChild(table);
- table.innerHTML = '<tbody><tr><td class="hw"><span id=":ga"><a href="#"><img gpg_action="sattachement2" class="hu" src="/mail/images/generic.gif"></a></span></td><td><b>%n</b> <br>%t&nbsp;&nbsp;<span id=":gd"><a href="#" gpg_action="sattachement">%s</a>&nbsp;&nbsp;</span></td></tr></tbody>';
- table.innerHTML = table.innerHTML.replace(/%t/, i18n.getString("decryptedfile"));
- table.innerHTML = table.innerHTML.replace(/%s/, i18n.getString("SaveAS"));
- table.innerHTML = table.innerHTML.replace(/%n/, htmlEncode(att.filename));
- table.setAttribute('firegpg-file-content',Base64.encode(att.data,true));
- table.setAttribute('firegpg-file-name', att.filename);
- table.setAttribute('firegpg-file-type','decrypted');
- table.setAttribute('class', 'cf hr');
- table.setAttribute('gpg_action','attachement');
- var tmpListener = new Object;
- tmpListener = null;
- tmpListener = new cGmail2.callBack(doc)
- table.addEventListener('click',tmpListener,true);
+ break;
- attachementBox.appendChild(table);
+ case "encrypted":
- break;
+ var filesNames = attachementBox.getElementsByTagName('b');
- case "encrypted":
+ var tableBox = null;
- var filesNames = attachementBox.getElementsByTagName('b');
+ for(fm in filesNames) {
- var tableBox = null;
+ if (filesNames[fm].textContent == att.filename) {
+ tableBox = filesNames[fm].parentNode.parentNode.parentNode.parentNode;
+ break;
+ }
+ }
- for(fm in filesNames) {
+ if (tableBox == null) {
- if (filesNames[fm].textContent == att.filename) {
- tableBox = filesNames[fm].parentNode.parentNode.parentNode.parentNode;
- break;
- }
- }
+ var tableBox = doc.createElement('table');
- if (tableBox == null) {
+ tableBox.innerHTML = '<tbody><tr><td class="hw"><span id=":ga"><a href="#"><img class="hu" src="/mail/images/generic.gif"></a></span></td><td><b>%n</b> <br>%t&nbsp;&nbsp;<span id=":gd">&nbsp;&nbsp;</span></td></tr></tbody>';
+ tableBox.innerHTML = tableBox.innerHTML.replace(/%t/, i18n.getString("firegpgencrypted"));
+ tableBox.innerHTML = tableBox.innerHTML.replace(/%n/, FireGPGMisc.htmlEncode(att.filename));
+ tableBox.setAttribute('class', 'cf hr');
- var tableBox = doc.createElement('table');
+ attachementBox.appendChild(tableBox);
- tableBox.innerHTML = '<tbody><tr><td class="hw"><span id=":ga"><a href="#"><img class="hu" src="/mail/images/generic.gif"></a></span></td><td><b>%n</b> <br>%t&nbsp;&nbsp;<span id=":gd">&nbsp;&nbsp;</span></td></tr></tbody>';
- tableBox.innerHTML = tableBox.innerHTML.replace(/%t/, i18n.getString("firegpgencrypted"));
- tableBox.innerHTML = tableBox.innerHTML.replace(/%n/, htmlEncode(att.filename));
- tableBox.setAttribute('class', 'cf hr');
+ }
- attachementBox.appendChild(tableBox);
+ var spans = tableBox.getElementsByTagName('span');
+ interstingSpan = spans[1];
- }
+ var newA = doc.createElement('a');
+ newA.setAttribute('firegpg-file-content',FireGPGMisc.Base64.encode(att.data,true));
+ newA.setAttribute('firegpg-file-name', att.filename);
+ newA.setAttribute('firegpg-file-type','encrypted');
+ newA.setAttribute('gpg_action','attachement');
+ newA.setAttribute('style','cursor: pointer;');
+ newA.innerHTML = i18n.getString("decrypt");
+ var tmpListener = new Object;
+ tmpListener = null;
+ tmpListener = new FireGPG_cGmail2.callBack(doc)
+ newA.addEventListener('click',tmpListener,true);
- var spans = tableBox.getElementsByTagName('span');
- interstingSpan = spans[1];
+ interstingSpan.appendChild(newA);
- var newA = doc.createElement('a');
- newA.setAttribute('firegpg-file-content',Base64.encode(att.data,true));
- newA.setAttribute('firegpg-file-name', att.filename);
- newA.setAttribute('firegpg-file-type','encrypted');
- newA.setAttribute('gpg_action','attachement');
- newA.setAttribute('style','cursor: pointer;');
- newA.innerHTML = i18n.getString("decrypt");
- var tmpListener = new Object;
- tmpListener = null;
- tmpListener = new cGmail2.callBack(doc)
- newA.addEventListener('click',tmpListener,true);
+ break;
+ }
- interstingSpan.appendChild(newA);
+ }
- break;
}
- }
+ /*
- }
+ var encrypted = FireGPGMimeDecoder.extractEncryptedData(mimeContentOf).replace(/\r/gi, '');
- /*
+ var firstPosition = encrypted.indexOf("-----BEGIN PGP MESSAGE-----");
+ var lastPosition = encrypted.indexOf("-----END PGP MESSAGE-----");
- var encrypted = FireGPGMimeDecoder.extractEncryptedData(mimeContentOf).replace(/\r/gi, '');
+ if (encrypted != null && encrypted != '' && firstPosition != -1 && lastPosition != -1) {
- var firstPosition = encrypted.indexOf("-----BEGIN PGP MESSAGE-----");
- var lastPosition = encrypted.indexOf("-----END PGP MESSAGE-----");
- if (encrypted != null && encrypted != '' && firstPosition != -1 && lastPosition != -1) {
+ if (FireGPG_cGmail2.noAutoDecrypt) {
+ if (td.innerHTML == i18n.getString("GMailNoS") || td.innerHTML == "") {
- if (cGmail2.noAutoDecrypt) {
+ td.innerHTML = i18n.getString("GMailD");
- if (td.innerHTML == i18n.getString("GMailNoS") || td.innerHTML == "") {
+ var tmpListener = new Object;
+ tmpListener = null;
+ tmpListener = new FireGPG_cGmail2.callBack(doc)
+ td.addEventListener('click',tmpListener,true);
+ td.setAttribute("style","");
+ td.setAttribute("firegpg-mail-to-decrypt", encrypted);
+ td.setAttribute("firegpg-parse-as-mime", "firegpg-parse-as-mime");
+ }
- td.innerHTML = i18n.getString("GMailD");
+ } else {
- var tmpListener = new Object;
- tmpListener = null;
- tmpListener = new cGmail2.callBack(doc)
- td.addEventListener('click',tmpListener,true);
- td.setAttribute("style","");
- td.setAttribute("firegpg-mail-to-decrypt", encrypted);
- td.setAttribute("firegpg-parse-as-mime", "firegpg-parse-as-mime");
- }
+ var result = FireGPG.decrypt(false,encrypted);
- } else {
+ if (result.result == FireGPGResults.SUCCESS) {
+ data = FireGPGMimeDecoder.parseDecrypted(result.decrypted); //For reviewers, a washDecryptedForInsertion is applied too in parseDecrypted ;)
- var result = FireGPG.decrypt(false,encrypted);
+ this.setMailContent(listeTest[i],doc,data.message);
- if (result.result == RESULT_SUCCESS) {
- data = FireGPGMimeDecoder.parseDecrypted(result.decrypted); //For reviewers, a washDecryptedForInsertion is applied too in parseDecrypted ;)
+ if (FireGPG_cGmail2.decryptOnReply)
+ listeTest[i].setAttribute("firegpg-decrypted-data", data.message);
- this.setMailContent(listeTest[i],doc,data.message);
+ td.setAttribute("style","color: blue;");
+ td.innerHTML = i18n.getString("GMailMailWasDecrypted");
- if (cGmail2.decryptOnReply)
- listeTest[i].setAttribute("firegpg-decrypted-data", data.message);
+ if (result.signresulttext != null && result.signresulttext != "")
+ td.innerHTML += " " + i18n.getString("GMailSOK") + " " + FireGPGMisc.htmlEncode(result.signresulttext)
+ else if (data.signData ) {
- td.setAttribute("style","color: blue;");
- td.innerHTML = i18n.getString("GMailMailWasDecrypted");
+ var resultTest = FireGPG.verify(true,data.signData.replace(/\r/gi, ''));
- if (result.signresulttext != null && result.signresulttext != "")
- td.innerHTML += " " + i18n.getString("GMailSOK") + " " + htmlEncode(result.signresulttext)
- else if (data.signData ) {
+ if (resultTest.result == FireGPGResults.ERROR_NO_GPG_DATA) {
+ if (FireGPG_cGmail2.nonosign != true)
+ {
+ td.setAttribute("style","color: orange;");
+ td.innerHTML += " " + i18n.getString("GMailNoS");
+ }
+ }
+ else if (resultTest.signresult ==FireGPGResults.ERROR_UNKNOW) {
+ td.setAttribute("style","color: red;");
+ td.innerHTML += " " + i18n.getString("GMailSErr"); //"La première signature de ce mail est incorrect !";
+ }
+ else if (resultTest.signresult == FireGPGResults.ERROR_BAD_SIGN) {
+ td.setAttribute("style","color: red;");
+ td.innerHTML += " " + i18n.getString("GMailSErr") + " (" + i18n.getString("falseSign") + ")"; //"La première signature de ce mail est incorrect !";
+ }
+ else if (resultTest.signresult == FireGPGResults.ERROR_NO_KEY) {
+ td.setAttribute("style","color: red;");
+ td.innerHTML += " " + i18n.getString("GMailSErr") + " (" + i18n.getString("keyNotFound") + ")"; //"La première signature de ce mail est incorrect !";
+ }
+ else if (resultTest.signresulttext != null){
- var resultTest = FireGPG.verify(true,data.signData.replace(/\r/gi, ''));
+ td.setAttribute("style","color: green;");
+ td.innerHTML += " " + i18n.getString("GMailSOK") + " " + FireGPGMisc.htmlEncode(resultTest.signresulttext); //"La première signature de ce mail est de testtest (testtest)
+ }
- if (resultTest.result == RESULT_ERROR_NO_GPG_DATA) {
- if (cGmail2.nonosign != true)
- {
- td.setAttribute("style","color: orange;");
- td.innerHTML += " " + i18n.getString("GMailNoS");
}
- }
- else if (resultTest.signresult ==RESULT_ERROR_UNKNOW) {
- td.setAttribute("style","color: red;");
- td.innerHTML += " " + i18n.getString("GMailSErr"); //"La première signature de ce mail est incorrect !";
- }
- else if (resultTest.signresult == RESULT_ERROR_BAD_SIGN) {
- td.setAttribute("style","color: red;");
- td.innerHTML += " " + i18n.getString("GMailSErr") + " (" + i18n.getString("falseSign") + ")"; //"La première signature de ce mail est incorrect !";
- }
- else if (resultTest.signresult == RESULT_ERROR_NO_KEY) {
- td.setAttribute("style","color: red;");
- td.innerHTML += " " + i18n.getString("GMailSErr") + " (" + i18n.getString("keyNotFound") + ")"; //"La première signature de ce mail est incorrect !";
- }
- else if (resultTest.signresulttext != null){
+ } else {
- td.setAttribute("style","color: green;");
- td.innerHTML += " " + i18n.getString("GMailSOK") + " " + htmlEncode(resultTest.signresulttext); //"La première signature de ce mail est de testtest (testtest)
+ td.setAttribute("style","color: red;");
+ td.innerHTML = i18n.getString("GMailMailWasNotDecrypted");
}
-
}
- } else {
- td.setAttribute("style","color: red;");
- td.innerHTML = i18n.getString("GMailMailWasNotDecrypted");
- }
- }
+ } else {
+
+ var encrypted = FireGPGMimeDecoder.extractEncrypted(mimeContentOf).replace(/\r/gi, '');
- } else {
+ var firstPosition = encrypted.indexOf("-----BEGIN PGP MESSAGE-----");
+ var lastPosition = encrypted.indexOf("-----END PGP MESSAGE-----");
- var encrypted = FireGPGMimeDecoder.extractEncrypted(mimeContentOf).replace(/\r/gi, '');
+ if (encrypted != null && encrypted != '' && firstPosition != -1 && lastPosition != -1) {
- var firstPosition = encrypted.indexOf("-----BEGIN PGP MESSAGE-----");
- var lastPosition = encrypted.indexOf("-----END PGP MESSAGE-----");
+ if (FireGPG_cGmail2.noAutoDecrypt) {
- if (encrypted != null && encrypted != '' && firstPosition != -1 && lastPosition != -1) {
+ if (td.innerHTML == i18n.getString("GMailNoS") || td.innerHTML == "") {
+ td.innerHTML = i18n.getString("GMailD");
- if (cGmail2.noAutoDecrypt) {
+ var tmpListener = new Object;
+ tmpListener = null;
+ tmpListener = new FireGPG_cGmail2.callBack(doc)
+ td.addEventListener('click',tmpListener,true);
+ td.setAttribute("style","");
+ td.setAttribute("firegpg-mail-to-decrypt", encrypted);
+ }
- if (td.innerHTML == i18n.getString("GMailNoS") || td.innerHTML == "") {
- td.innerHTML = i18n.getString("GMailD");
+ } else {
- var tmpListener = new Object;
- tmpListener = null;
- tmpListener = new cGmail2.callBack(doc)
- td.addEventListener('click',tmpListener,true);
- td.setAttribute("style","");
- td.setAttribute("firegpg-mail-to-decrypt", encrypted);
- }
+ var result = FireGPG.decrypt(false,encrypted);
- } else {
+ if (result.result == FireGPGResults.SUCCESS) {
- var result = FireGPG.decrypt(false,encrypted);
+ data = FireGPGMimeDecoder.washDecryptedForInsertion(FireGPGMimeDecoder.demime(result.decrypted).message.replace(/\r/gi, ''));
+ this.setMailContent(listeTest[i],doc,data);
+ if (FireGPG_cGmail2.decryptOnReply)
+ listeTest[i].setAttribute("firegpg-decrypted-data", data);
- if (result.result == RESULT_SUCCESS) {
+ td.setAttribute("style","color: blue;");
+ td.innerHTML = i18n.getString("GMailMailWasDecrypted");
- data = FireGPGMimeDecoder.washDecryptedForInsertion(FireGPGMimeDecoder.demime(result.decrypted).message.replace(/\r/gi, ''));
- this.setMailContent(listeTest[i],doc,data);
- if (cGmail2.decryptOnReply)
- listeTest[i].setAttribute("firegpg-decrypted-data", data);
- td.setAttribute("style","color: blue;");
- td.innerHTML = i18n.getString("GMailMailWasDecrypted");
+ if (result.signresulttext != null && result.signresulttext != "")
+ td.innerHTML += " " + i18n.getString("GMailSOK") + " " + FireGPGMisc.htmlEncode(result.signresulttext)
- if (result.signresulttext != null && result.signresulttext != "")
- td.innerHTML += " " + i18n.getString("GMailSOK") + " " + htmlEncode(result.signresulttext)
+ } else {
+ td.setAttribute("style","color: red;");
+ td.innerHTML = i18n.getString("GMailMailWasNotDecrypted");
+ }
- } else {
+ }
- td.setAttribute("style","color: red;");
- td.innerHTML = i18n.getString("GMailMailWasNotDecrypted");
}
- }
- }
+ }
- }
+ /*var firstPosition = contenuMail.indexOf("-----BEGIN PGP MESSAGE-----");
+ var lastPosition = contenuMail.indexOf("-----END PGP MESSAGE-----");
+ if (firstPosition != -1 && lastPosition != -1) {
- /*var firstPosition = contenuMail.indexOf("-----BEGIN PGP MESSAGE-----");
- var lastPosition = contenuMail.indexOf("-----END PGP MESSAGE-----");
+ td.innerHTML = i18n.getString("GMailD");
- if (firstPosition != -1 && lastPosition != -1) {
+ var tmpListener = new Object;
+ tmpListener = null;
+ tmpListener = new FireGPG_cGmail2.callBack(doc)
+ td.addEventListener('click',tmpListener,true);
+ td.setAttribute("style","");
+ }*/
- td.innerHTML = i18n.getString("GMailD");
+ }
+ td.innerHTML = '<div class="mD" idlink=""><span class="mG" style="' + td.getAttribute("style") + '">' + td.innerHTML + '</span></div>';
- var tmpListener = new Object;
- tmpListener = null;
- tmpListener = new cGmail2.callBack(doc)
- td.addEventListener('click',tmpListener,true);
- td.setAttribute("style","");
- }*/
- }
- td.innerHTML = '<div class="mD" idlink=""><span class="mG" style="' + td.getAttribute("style") + '">' + td.innerHTML + '</span></div>';
+ //La boite peut avoir été reféinie
+ var boutonboxs = listeTest[i].getElementsByTagName("table");
+ var boutonbox = "";
+
+ //On cherche la boite avec les boutons
+ for (var j = 0; j < boutonboxs.length; j++) {
+ if (boutonboxs[j].getAttribute("class").indexOf("cf gz") != -1) { //EWdQcf
+ boutonbox = boutonboxs[j].firstChild.firstChild;
+ break;
+ }
+ }
- //La boite peut avoir été reféinie
- var boutonboxs = listeTest[i].getElementsByTagName("table");
+ boutonbox.insertBefore(td,boutonbox.childNodes[boutonbox.childNodes.length - 1]);
- var boutonbox = "";
- //On cherche la boite avec les boutons
- for (var j = 0; j < boutonboxs.length; j++) {
- if (boutonboxs[j].getAttribute("class").indexOf("cf gz") != -1) { //EWdQcf
- boutonbox = boutonboxs[j].firstChild.firstChild;
- break;
- }
+ } catch (e) { FireGPG_cGmail2.error(e, 'checkDock/message') }
}
-
- boutonbox.insertBefore(td,boutonbox.childNodes[boutonbox.childNodes.length - 1]);
}
- }
+ //END OF THE TEST FOR MESSAGES.
+ //fireGPGDebug('Begining test for compose messages', 'ProbWithReplyForward');
+ //Test for compose buttons 'CoUvaf'
+ var listeTest = doc.getElementsByClassName('eh','div');
+ var listeTest2 = doc.getElementsByClassName('CoUvaf','div');
+ //fireGPGDebug('1:' + listeTest + ' 2:' + listeTest2, 'ProbWithReplyForward');
- //END OF THE TEST FOR MESSAGES.
-//fireGPGDebug('Begining test for compose messages', 'ProbWithReplyForward');
- //Test for compose buttons 'CoUvaf'
- var listeTest = doc.getElementsByClassName('eh','div');
- var listeTest2 = doc.getElementsByClassName('CoUvaf','div');
+ listeTest = listeTest.concat(listeTest2);
-//fireGPGDebug('1:' + listeTest + ' 2:' + listeTest2, 'ProbWithReplyForward');
+ for (var i = 0; i < listeTest.length; i++) {
- listeTest = listeTest.concat(listeTest2);
+ if (listeTest[i].hasAttribute("gpg") == false) {
- for (var i = 0; i < listeTest.length; i++) {
-
- if (listeTest[i].hasAttribute("gpg") == false) {
-
- fireGPGDebug(listeTest[i] + 'NoFireGPG, processing', 'ProbWithReplyForward');
+ try {
- listeTest[i].setAttribute("gpg","ok");
+ fireGPGDebug(listeTest[i] + 'NoFireGPG, processing', 'ProbWithReplyForward');
+
+ listeTest[i].setAttribute("gpg","ok");
+
+ //Position to add the button
+ var spamLimite = listeTest[i].getElementsByTagName('span');
+ spamLimite = spamLimite[0];
+ //fireGPGDebug('spamLimite is ' + spamLimite, 'ProbWithReplyForward');
+ //Nouvelle version du lundi 29 septembre 2008
+ if (listeTest[i].firstChild && listeTest[i].firstChild.getAttribute("class") == "c1I77d yCMBJb goog-container")
+ var wheretoadd = listeTest[i].firstChild;
+ else if (listeTest[i].firstChild && listeTest[i].firstChild.getAttribute("class") == "c1I77d yCMBJb") { //Version du 29 octobre 2008
+ var wheretoadd = listeTest[i].firstChild.firstChild;
+ if (wheretoadd.getAttribute("class") != "Q4uFlf goog-container")
+ wheretoadd = listeTest[i].firstChild.childNodes[1];
+ }
+ else if (listeTest[i].firstChild && listeTest[i].firstChild.getAttribute("class") == "dW D") { //Version du 5 mars 09
+ var wheretoadd = listeTest[i].firstChild;
+ }else if (listeTest[i].firstChild && listeTest[i].firstChild.getAttribute("class") == "dW") { //Version du 28 juil 09
+ var wheretoadd = listeTest[i].firstChild;
+ }
- //Position to add the button
- var spamLimite = listeTest[i].getElementsByTagName('span');
- spamLimite = spamLimite[0];
-//fireGPGDebug('spamLimite is ' + spamLimite, 'ProbWithReplyForward');
- //Nouvelle version du lundi 29 septembre 2008
- if (listeTest[i].firstChild && listeTest[i].firstChild.getAttribute("class") == "c1I77d yCMBJb goog-container")
- var wheretoadd = listeTest[i].firstChild;
- else if (listeTest[i].firstChild && listeTest[i].firstChild.getAttribute("class") == "c1I77d yCMBJb") { //Version du 29 octobre 2008
- var wheretoadd = listeTest[i].firstChild.firstChild;
- if (wheretoadd.getAttribute("class") != "Q4uFlf goog-container")
- wheretoadd = listeTest[i].firstChild.childNodes[1];
- }
- else if (listeTest[i].firstChild && listeTest[i].firstChild.getAttribute("class") == "dW D") { //Version du 5 mars 09
- var wheretoadd = listeTest[i].firstChild;
- }else if (listeTest[i].firstChild && listeTest[i].firstChild.getAttribute("class") == "dW") { //Version du 28 juil 09
- var wheretoadd = listeTest[i].firstChild;
- }
+ fireGPGDebug('wheretoadd is ' + wheretoadd, 'ProbWithReplyForward');
+ /*if (FireGPG_cGmail2.b_sign == true)
+ this.addBouton(wheretoadd,doc,i18n.getString("GMailCLS"),"sign",spamLimite);
+ if (FireGPG_cGmail2.b_sign_s == true)
+ this.addBouton(wheretoadd,doc,i18n.getString("GMailCLSS"),"sndsign",spamLimite);
+ if (FireGPG_cGmail2.b_psign == true)
+ this.addBouton(wheretoadd,doc,i18n.getString("GMailS"),"psign",spamLimite);
+ if (FireGPG_cGmail2.b_psign_s == true)
+ this.addBouton(wheretoadd,doc,i18n.getString("GMailSS"),"sndpsign",spamLimite);
+ if (FireGPG_cGmail2.b_crypt == true)
+ this.addBouton(wheretoadd,doc,i18n.getString("GMailC"),"crypt",spamLimite);
+ if (FireGPG_cGmail2.b_crypt_s == true)
+ this.addBouton(wheretoadd,doc,i18n.getString("GMailCS"),"sndcrypt",spamLimite);
+ if (FireGPG_cGmail2.b_signcrypt == true)
+ this.addBouton(wheretoadd,doc,i18n.getString("GMailSAC"),"signcrypt",spamLimite);
+ if (FireGPG_cGmail2.b_signcrypt_s == true)
+ this.addBouton(wheretoadd,doc,i18n.getString("GMailSACS"),"sndsigncrypt",spamLimite);*/
-fireGPGDebug('wheretoadd is ' + wheretoadd, 'ProbWithReplyForward');
- /*if (cGmail2.b_sign == true)
- this.addBouton(wheretoadd,doc,i18n.getString("GMailCLS"),"sign",spamLimite);
- if (cGmail2.b_sign_s == true)
- this.addBouton(wheretoadd,doc,i18n.getString("GMailCLSS"),"sndsign",spamLimite);
- if (cGmail2.b_psign == true)
- this.addBouton(wheretoadd,doc,i18n.getString("GMailS"),"psign",spamLimite);
- if (cGmail2.b_psign_s == true)
- this.addBouton(wheretoadd,doc,i18n.getString("GMailSS"),"sndpsign",spamLimite);
- if (cGmail2.b_crypt == true)
- this.addBouton(wheretoadd,doc,i18n.getString("GMailC"),"crypt",spamLimite);
- if (cGmail2.b_crypt_s == true)
- this.addBouton(wheretoadd,doc,i18n.getString("GMailCS"),"sndcrypt",spamLimite);
- if (cGmail2.b_signcrypt == true)
- this.addBouton(wheretoadd,doc,i18n.getString("GMailSAC"),"signcrypt",spamLimite);
- if (cGmail2.b_signcrypt_s == true)
- this.addBouton(wheretoadd,doc,i18n.getString("GMailSACS"),"sndsigncrypt",spamLimite);*/
+ //Rajouter une propriété sur le button send pour le repérer
+ var children = listeTest[i].getElementsByClassName('goog-imageless-button-content');
+ children[0].firstChild.setAttribute("gpg_action", "send_button");
+ //fireGPGDebug('children[0] is ' + children[0], 'ProbWithReplyForward');
- //Rajouter une propriété sur le button send pour le repérer
- var children = listeTest[i].getElementsByClassName('goog-imageless-button-content');
- children[0].firstChild.setAttribute("gpg_action", "send_button");
-//fireGPGDebug('children[0] is ' + children[0], 'ProbWithReplyForward');
+ //Listeners
+ try {
- //Listeners
- try {
+ var tmpListener = new Object;
+ tmpListener = null;
+ tmpListener = new FireGPG_cGmail2.callBack(doc)
+ listeTest[i].addEventListener('mouseup',tmpListener,true);
- var tmpListener = new Object;
- tmpListener = null;
- tmpListener = new cGmail2.callBack(doc)
- listeTest[i].addEventListener('mouseup',tmpListener,true);
+ var tmpListener = new Object;
+ tmpListener = null;
+ tmpListener = new FireGPG_cGmail2.callBack(doc)
+ listeTest[i].addEventListener('keyup',tmpListener,true);
- var tmpListener = new Object;
- tmpListener = null;
- tmpListener = new cGmail2.callBack(doc)
- listeTest[i].addEventListener('keyup',tmpListener,true);
+ var tmpListener = new Object;
+ tmpListener = null;
+ tmpListener = new FireGPG_cGmail2.callBack(doc)
+ listeTest[i].addEventListener('keydown',tmpListener,true);
- var tmpListener = new Object;
- tmpListener = null;
- tmpListener = new cGmail2.callBack(doc)
- listeTest[i].addEventListener('keydown',tmpListener,true);
+ var tmpListener = new Object;
+ tmpListener = null;
+ tmpListener = new FireGPG_cGmail2.callBack(doc)
+ listeTest[i].addEventListener('keypress',tmpListener,true);
- var tmpListener = new Object;
- tmpListener = null;
- tmpListener = new cGmail2.callBack(doc)
- listeTest[i].addEventListener('keypress',tmpListener,true);
+ } catch (e) { fireGPGDebug(e,'cgmail2.checkDoc',true); }
- } catch (e) { fireGPGDebug(e,'cgmail2.checkDoc',true); }
+ form = listeTest[i].parentNode.getElementsByTagName('form');
+ if (form.length == 0) {
- form = listeTest[i].parentNode.getElementsByTagName('form');
- if (form.length == 0) {
+ form = listeTest[i].parentNode.parentNode.getElementsByTagName('form');
- form = listeTest[i].parentNode.parentNode.getElementsByTagName('form');
+ }
- }
+ form = form[0];
- form = form[0];
+ findHere = form.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
+ elements = findHere.getElementsByClassName('gs', 'div');
- findHere = form.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
- elements = findHere.getElementsByClassName('gs', 'div');
+ if (listeTest[i].getAttribute('class').indexOf('eh') != -1) {
- if (listeTest[i].getAttribute('class').indexOf('eh') != -1) {
+ children[0].firstChild.setAttribute("gpg_action", "send_button2");
- children[0].firstChild.setAttribute("gpg_action", "send_button2");
+ //Add the button 'Attach and chiffred a file'
- //Add the button 'Attach and chiffred a file'
+ var tablebox = listeTest[i].parentNode.getElementsByTagName('table');
- var tablebox = listeTest[i].parentNode.getElementsByTagName('table');
+ //Nouvelle version du lundi 29 septembre 2008
+ if (tablebox.length == 0)
+ tablebox = listeTest[i].parentNode.parentNode.getElementsByTagName('table');
- //Nouvelle version du lundi 29 septembre 2008
- if (tablebox.length == 0)
- tablebox = listeTest[i].parentNode.parentNode.getElementsByTagName('table');
+ tablebox = tablebox[0];
+ var boxwhereadd = tablebox.parentNode;
- tablebox = tablebox[0];
- var boxwhereadd = tablebox.parentNode;
+ var span = doc.createElement("span");
- var span = doc.createElement("span");
+ span.setAttribute("style","position: relative; bottom: 26px; right: 5px; float: right; margin-bottom: -30px;");
- span.setAttribute("style","position: relative; bottom: 26px; right: 5px; float: right; margin-bottom: -30px;");
+ span.innerHTML = '<img class="en ed" src="images/cleardot.gif">&nbsp;<span gpg_action="add_crypted" style="font-size: 12px;" class="el">' + i18n.getString("GmailAddChiffred")+ '</span>&nbsp;<span gpg_action="add_crypted_and_sign" style="font-size: 12px;" class="el">' + i18n.getString("GmailAddChiffredSignToo")+ '</span>';
- span.innerHTML = '<img class="en ed" src="images/cleardot.gif">&nbsp;<span gpg_action="add_crypted" style="font-size: 12px;" class="el">' + i18n.getString("GmailAddChiffred")+ '</span>&nbsp;<span gpg_action="add_crypted_and_sign" style="font-size: 12px;" class="el">' + i18n.getString("GmailAddChiffredSignToo")+ '</span>';
+ boxwhereadd.insertBefore(span,tablebox.nextSibling);
- boxwhereadd.insertBefore(span,tablebox.nextSibling);
+ var tmpListener = new Object;
+ tmpListener = null;
+ tmpListener = new FireGPG_cGmail2.callBack(doc)
+ span.addEventListener('click',tmpListener,false);
- var tmpListener = new Object;
- tmpListener = null;
- tmpListener = new cGmail2.callBack(doc)
- span.addEventListener('click',tmpListener,false);
+ //Rajout des trucs à FireGPG
+ var firegpgactions = doc.createElement("tr");
- //Rajout des trucs à FireGPG
- var firegpgactions = doc.createElement("tr");
+ var title = doc.createElement("td");
+ var checkboxes = doc.createElement("td");
- var title = doc.createElement("td");
- var checkboxes = doc.createElement("td");
+ title.setAttribute('class', 'eD');
+ title.innerHTML = 'FireGPG:';
- title.setAttribute('class', 'eD');
- title.innerHTML = 'FireGPG:';
+ randId = FireGPGMisc.genreate_api_key();
+ checkboxes.setAttribute('class', 'eC');
+ checkboxes.setAttribute('style', 'font-size: 12px;');
+ checkboxes.innerHTML = '<img id="'+randId+'a" src="'+FGPG_IMG_SIGN_OFF+'" alt="'+FGPG_IMG_SIGN_ON+'" onclick="a = this.alt; this.alt=this.src; this.src=a; this.title = (this.title==\'On\' ? \'Off\' : \'On\');" title="Off" class="firegpg-sign">&nbsp;<span class="el" onclick="document.getElementById(\''+randId+'a\').onclick();">' + i18n.getString("GMailS") + '</span>&nbsp;|&nbsp;' +
+ '<img id="'+randId+'b" src="'+FGPG_IMG_ENCRYPT_OFF+'" alt="'+FGPG_IMG_ENCRYPT_ON+'" onclick="a = this.alt; this.alt=this.src; this.src=a; this.title = (this.title==\'On\' ? \'Off\' : \'On\');" title="Off" class="firegpg-encrypt" >&nbsp;<span class="el" onclick="document.getElementById(\''+randId+'b\').onclick();">' + i18n.getString("GMailC") + '</span>&nbsp;|&nbsp;' +
+ '<img id="'+randId+'c" src="'+FGPG_IMG_INLINE_OFF+'" alt="'+FGPG_IMG_INLINE_ON+'" onclick="a = this.alt; this.alt=this.src; this.src=a; this.title = (this.title==\'On\' ? \'Off\' : \'On\'); if (this.title==\'Off\') { document.getElementById(\''+randId+'att\').style.display = \'\'; } else { document.getElementById(\''+randId+'att\').style.display = \'none\'; }" title="Off" class="firegpg-inline" >&nbsp;<span class="el" onclick="document.getElementById(\''+randId+'c\').onclick();">' + i18n.getString("GmailI") + '</span>' +
+ '<span id="'+randId+'att">&nbsp;|&nbsp;<img id="'+randId+'d" src="'+FGPG_IMG_ATTACHEMENTS_OFF+'" alt="'+FGPG_IMG_ATTACHEMENTS_ON+'" onclick="a = this.alt; this.alt=this.src; this.src=a; this.title = (this.title==\'On\' ? \'Off\' : \'On\');" title="Off" class="firegpg-attachements" >&nbsp;<span class="el" onclick="document.getElementById(\''+randId+'d\').onclick();">' + i18n.getString("GmailA") + '</span></span>';
- randId = genreate_api_key();
- checkboxes.setAttribute('class', 'eC');
- checkboxes.setAttribute('style', 'font-size: 12px;');
- checkboxes.innerHTML = '<img id="'+randId+'a" src="'+IMG_SIGN_OFF+'" alt="'+IMG_SIGN_ON+'" onclick="a = this.alt; this.alt=this.src; this.src=a; this.title = (this.title==\'On\' ? \'Off\' : \'On\');" title="Off" class="firegpg-sign">&nbsp;<span class="el" onclick="document.getElementById(\''+randId+'a\').onclick();">' + i18n.getString("GMailS") + '</span>&nbsp;|&nbsp;' +
- '<img id="'+randId+'b" src="'+IMG_ENCRYPT_OFF+'" alt="'+IMG_ENCRYPT_ON+'" onclick="a = this.alt; this.alt=this.src; this.src=a; this.title = (this.title==\'On\' ? \'Off\' : \'On\');" title="Off" class="firegpg-encrypt" >&nbsp;<span class="el" onclick="document.getElementById(\''+randId+'b\').onclick();">' + i18n.getString("GMailC") + '</span>&nbsp;|&nbsp;' +
- '<img id="'+randId+'c" src="'+IMG_INLINE_OFF+'" alt="'+IMG_INLINE_ON+'" onclick="a = this.alt; this.alt=this.src; this.src=a; this.title = (this.title==\'On\' ? \'Off\' : \'On\'); if (this.title==\'Off\') { document.getElementById(\''+randId+'att\').style.display = \'\'; } else { document.getElementById(\''+randId+'att\').style.display = \'none\'; }" title="Off" class="firegpg-inline" >&nbsp;<span class="el" onclick="document.getElementById(\''+randId+'c\').onclick();">' + i18n.getString("GmailI") + '</span>' +
- '<span id="'+randId+'att">&nbsp;|&nbsp;<img id="'+randId+'d" src="'+IMG_ATTACHEMENTS_OFF+'" alt="'+IMG_ATTACHEMENTS_ON+'" onclick="a = this.alt; this.alt=this.src; this.src=a; this.title = (this.title==\'On\' ? \'Off\' : \'On\');" title="Off" class="firegpg-attachements" >&nbsp;<span class="el" onclick="document.getElementById(\''+randId+'d\').onclick();">' + i18n.getString("GmailA") + '</span></span>';
+ if (FireGPG_cGmail2.default_sign)
+ checkboxes.innerHTML += '<script>document.getElementById(\''+randId+'a\').onclick();</script>';
- if (cGmail2.default_sign)
- checkboxes.innerHTML += '<script>document.getElementById(\''+randId+'a\').onclick();</script>';
+ if (FireGPG_cGmail2.default_encrypt || (elements[0] && elements[0].hasAttribute("firegpg-encrypt-this-mail") && elements[0].getAttribute("firegpg-encrypt-this-mail") == "firegpg-encrypt-this-mail"))
+ checkboxes.innerHTML += '<script>document.getElementById(\''+randId+'b\').onclick();</script>';
- if (cGmail2.default_encrypt || (elements[0] && elements[0].hasAttribute("firegpg-encrypt-this-mail") && elements[0].getAttribute("firegpg-encrypt-this-mail") == "firegpg-encrypt-this-mail"))
- checkboxes.innerHTML += '<script>document.getElementById(\''+randId+'b\').onclick();</script>';
+ if (FireGPG_cGmail2.default_inline)
+ checkboxes.innerHTML += '<script>document.getElementById(\''+randId+'c\').onclick();</script>';
- if (cGmail2.default_inline)
- checkboxes.innerHTML += '<script>document.getElementById(\''+randId+'c\').onclick();</script>';
+ if (FireGPG_cGmail2.default_attachements)
+ checkboxes.innerHTML += '<script>document.getElementById(\''+randId+'d\').onclick();</script>';
- if (cGmail2.default_attachements)
- checkboxes.innerHTML += '<script>document.getElementById(\''+randId+'d\').onclick();</script>';
+ firegpgactions.appendChild(title);
+ firegpgactions.appendChild(checkboxes);
+ fileattachimage = tablebox.getElementsByClassName('en ed','img');
- firegpgactions.appendChild(title);
- firegpgactions.appendChild(checkboxes);
- fileattachimage = tablebox.getElementsByClassName('en ed','img');
+ if (!fileattachimage[0]) {
+ fileattachimage = tablebox.getElementsByClassName('en','img'); //Forward ??
- if (!fileattachimage[0]) {
- fileattachimage = tablebox.getElementsByClassName('en','img'); //Forward ??
+ }
- }
+ if (!fileattachimage[0]) {
+ fireGPGDebug('Unable to add buttons', 'cgmail2-addbuttons',true);
+ }
- if (!fileattachimage[0]) {
- fireGPGDebug('Unable to add buttons', 'cgmail2-addbuttons',true);
- }
+ filesattachbox = fileattachimage[0].parentNode.parentNode;
- filesattachbox = fileattachimage[0].parentNode.parentNode;
+ try {
+ tablebox.firstChild.insertBefore(firegpgactions,filesattachbox);
+ } catch (e) { fireGPGDebug(e,'cgmail2.checkDoc(insert checkboxes)',true); }
- try {
- tablebox.firstChild.insertBefore(firegpgactions,filesattachbox);
- } catch (e) { fireGPGDebug(e,'cgmail2.checkDoc(insert checkboxes)',true); }
+ if (FireGPG_cGmail2.decryptOnReply) {
- if (cGmail2.decryptOnReply) {
+ if (elements[0] && elements[0].hasAttribute("firegpg-decrypted-data") ) {
+ data = elements[0].getAttribute("firegpg-decrypted-data");
- if (elements[0] && elements[0].hasAttribute("firegpg-decrypted-data") ) {
- data = elements[0].getAttribute("firegpg-decrypted-data");
+ if (FireGPG_cGmail2.iframeOrTextarea(doc,wheretoadd) == "iframe") {
- if (cGmail2.iframeOrTextarea(doc,wheretoadd) == "iframe") {
+ var iframe = FireGPG_cGmail2.getTheIframe(doc,wheretoadd);
- var iframe = cGmail2.getTheIframe(doc,wheretoadd);
+ baseData = iframe.contentWindow.document.body.innerHTML;
- baseData = iframe.contentWindow.document.body.innerHTML;
+ before = baseData.substring(0,baseData.indexOf("-----BEGIN PGP MESSAGE-----"));
- before = baseData.substring(0,baseData.indexOf("-----BEGIN PGP MESSAGE-----"));
+ after = baseData.substring(baseData.indexOf("-----END PGP MESSAGE-----") + "-----END PGP MESSAGE-----".length, baseData.length);
- after = baseData.substring(baseData.indexOf("-----END PGP MESSAGE-----") + "-----END PGP MESSAGE-----".length, baseData.length);
+ iframe.contentWindow.document.body.innerHTML = before + data + after;
- iframe.contentWindow.document.body.innerHTML = before + data + after;
+ } else {
- } else {
+ var textarea = FireGPG_cGmail2.getTheTextarea(doc,wheretoadd);
- var textarea = cGmail2.getTheTextarea(doc,wheretoadd);
+ baseData = textarea.value;
- baseData = textarea.value;
+ before = baseData.substring(0,baseData.indexOf("-----BEGIN PGP MESSAGE-----"));
- before = baseData.substring(0,baseData.indexOf("-----BEGIN PGP MESSAGE-----"));
+ after = baseData.substring(baseData.indexOf("-----END PGP MESSAGE-----") + "-----END PGP MESSAGE-----".length, baseData.length);
- after = baseData.substring(baseData.indexOf("-----END PGP MESSAGE-----") + "-----END PGP MESSAGE-----".length, baseData.length);
+ textarea.value = before + data.replace(/<br \/>/gi, "\n> ") + after;
- textarea.value = before + data.replace(/<br \/>/gi, "\n> ") + after;
+ }
+ }
}
- }
- }
-
- }
+ }
- form.setAttribute("firegpg-mail-id", "");
-//fireGPGDebug('Setting mailid', 'ProbWithReplyForward');
- if (elements[0]) {
- form.setAttribute("firegpg-mail-id", elements[0].getAttribute("firegpg-mail-id"));
- fireGPGDebug('to ' + elements[0].getAttribute("firegpg-mail-id"), 'ProbWithReplyForward');
- }
+ form.setAttribute("firegpg-mail-id", "");
+ //fireGPGDebug('Setting mailid', 'ProbWithReplyForward');
+ if (elements[0]) {
+ form.setAttribute("firegpg-mail-id", elements[0].getAttribute("firegpg-mail-id"));
+ fireGPGDebug('to ' + elements[0].getAttribute("firegpg-mail-id"), 'ProbWithReplyForward');
+ }
- var prefs = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefService);
+ var prefs = Components.classes["@mozilla.org/preferences-service;1"].
+ getService(Components.interfaces.nsIPrefService);
- prefs = prefs.getBranch("extensions.firegpg.");
- try {
- disable_autosave = prefs.getBoolPref("gmail_disable_autosave");
- } catch (e) {
- disable_autosave = false;
- }
+ prefs = prefs.getBranch("extensions.firegpg.");
+ try {
+ disable_autosave = prefs.getBoolPref("gmail_disable_autosave");
+ } catch (e) {
+ disable_autosave = false;
+ }
- // Based on code of Gmail S/MIME
- /*
- Copyright (C) 2005-2007 Richard Jones.
- Copyright (C) 2007-2008 Sean Leonard of SeanTek(R).
+ // Based on code of Gmail S/MIME
+ /*
+ Copyright (C) 2005-2007 Richard Jones.
+ Copyright (C) 2007-2008 Sean Leonard of SeanTek(R).
- GPL 2 License.
- */
- // Disable autosave and add appropriate notification
-//fireGPGDebug('Disable autosave ?', 'ProbWithReplyForward');
- if (disable_autosave && form) // && form
- { // fireGPGDebug('Disabling autosave', 'ProbWithReplyForward');
+ GPL 2 License.
+ */
+ // Disable autosave and add appropriate notification
+ //fireGPGDebug('Disable autosave ?', 'ProbWithReplyForward');
+ if (disable_autosave && form) // && form
+ { // fireGPGDebug('Disabling autosave', 'ProbWithReplyForward');
- String.prototype.startsWith = function(s)
- {
- return (this.match('^'+s)==s);
- };
+ String.prototype.startsWith = function(s)
+ {
+ return (this.match('^'+s)==s);
+ };
- String.prototype.trim = function() {
- return this.replace(/^\s+|\s+$/g, '');
- };
+ String.prototype.trim = function() {
+ return this.replace(/^\s+|\s+$/g, '');
+ };
- var subj = form.elements.namedItem("subject");
+ var subj = form.elements.namedItem("subject");
- // STGS Method
- function getValue()
- {
- // found two bad patterns: $q$_P$xVa$ -> t_a -> OP -> yUa -> BXa [->call] ...
- // $q$_P$UWa$ -> O0a -> iQ -> WVa -> YYa [->call] -> $CNp$ [->apply] -> $e$ ...
- // thus, search for what the stack function names start with
- if (getValue.caller == null) return this.__proto__.__lookupGetter__("value").apply(this);
- function stackMatch(pattern, func)
- {
- for (var i = 0; i < pattern.length; i++)
+ // STGS Method
+ function getValue()
{
- if (func == null) return false;
- if (func.name.indexOf(pattern[i]) != 0 && func.name.indexOf(pattern[i]) != 3) return false;
-
- func = func.caller;
- }
- return true;
- }
- const badpattern1 = ["$mnb", "$knb", "$Zmb", "$1lb", "$Fjb", "$Ejb"];
- const badpattern2 = ["$EUa", "$CUa", "$fUa", "$jTa", "$xRa"];
- const badpattern3 = ["$R$_P$", "$R$_P$", "$R$_P$", "$R$_P$Lfb$", "$R$_P$xib$", "$Ouc$"];
- const badpattern4 = ["$Y$_P$", "$Y$_P$", "$Y$_P$", "$Y$_P$Uib$", "$Y$_P$Glb$"]; // then $rga$, $e$, $a$__protected__$
- const badpattern5 = ["$Z$_P$", "$Z$_P$", "$Z$_P$", "$Z$_P$ZBa$", "$Z$_P$nGb$"];
- const badpattern6 = ["$Z$_P$", "$Z$_P$", "$Z$_P$", "$Z$_P$", "$T_$_P$YHa$"];
- const badpattern7 = ["$Z$_P$", "$Z$_P$", "$Z$_P$", "$Z$_P$ptb$", "$E0$_P$BJa$"];
- const badpattern8 = ["$abb", "$9ab", "$Jab", "$L$a", "$u8a"]; // $t8a
- const badpattern9 = ["EXc", "$8Ua", "gUc", "fUc", "$ATa"]; // hla
- const badpattern10 = ["Qsa", "Jsa", "Jkb", "$wTa", "$xTa"]; // xta
-
- const badpattern11 = ["nWc", "$DWa", "yTc", "xTc", "$1Ua"]; // Cpa
-/*
-EXc $8Ua gUc fUc $ATa hla
+ // found two bad patterns: $q$_P$xVa$ -> t_a -> OP -> yUa -> BXa [->call] ...
+ // $q$_P$UWa$ -> O0a -> iQ -> WVa -> YYa [->call] -> $CNp$ [->apply] -> $e$ ...
+ // thus, search for what the stack function names start with
+ if (getValue.caller == null) return this.__proto__.__lookupGetter__("value").apply(this);
+ function stackMatch(pattern, func)
+ {
+ for (var i = 0; i < pattern.length; i++)
+ {
+ if (func == null) return false;
+ if (func.name.indexOf(pattern[i]) != 0 && func.name.indexOf(pattern[i]) != 3) return false;
-Zna Vna UIb $RQa $SQa Moa
+ func = func.caller;
+ }
+ return true;
+ }
+ const badpattern1 = ["$mnb", "$knb", "$Zmb", "$1lb", "$Fjb", "$Ejb"];
+ const badpattern2 = ["$EUa", "$CUa", "$fUa", "$jTa", "$xRa"];
+ const badpattern3 = ["$R$_P$", "$R$_P$", "$R$_P$", "$R$_P$Lfb$", "$R$_P$xib$", "$Ouc$"];
+ const badpattern4 = ["$Y$_P$", "$Y$_P$", "$Y$_P$", "$Y$_P$Uib$", "$Y$_P$Glb$"]; // then $rga$, $e$, $a$__protected__$
+ const badpattern5 = ["$Z$_P$", "$Z$_P$", "$Z$_P$", "$Z$_P$ZBa$", "$Z$_P$nGb$"];
+ const badpattern6 = ["$Z$_P$", "$Z$_P$", "$Z$_P$", "$Z$_P$", "$T_$_P$YHa$"];
+ const badpattern7 = ["$Z$_P$", "$Z$_P$", "$Z$_P$", "$Z$_P$ptb$", "$E0$_P$BJa$"];
+ const badpattern8 = ["$abb", "$9ab", "$Jab", "$L$a", "$u8a"]; // $t8a
+ const badpattern9 = ["EXc", "$8Ua", "gUc", "fUc", "$ATa"]; // hla
+ const badpattern10 = ["Qsa", "Jsa", "Jkb", "$wTa", "$xTa"]; // xta
+
+ const badpattern11 = ["nWc", "$DWa", "yTc", "xTc", "$1Ua"]; // Cpa
+ /*
+ EXc $8Ua gUc fUc $ATa hla
-Zna Vna UIb $RQa $SQa Moa
- */
+ Zna Vna UIb $RQa $SQa Moa
- if (stackMatch(badpattern11, getValue.caller) || stackMatch(badpattern10, getValue.caller) || stackMatch(badpattern9, getValue.caller) || stackMatch(badpattern8, getValue.caller) || stackMatch(badpattern7, getValue.caller) || stackMatch(badpattern6, getValue.caller) || stackMatch(badpattern5, getValue.caller) || stackMatch(badpattern4, getValue.caller) || stackMatch(badpattern3, getValue.caller) || stackMatch(badpattern1, getValue.caller) || stackMatch(badpattern2, getValue.caller))
- {
- function AutosaveWreckingBall() {};
- AutosaveWreckingBall.prototype.value = "Wrecked";
- AutosaveWreckingBall.prototype.toString = function() { return "[object AutosaveWreckingBall]"; }
- throw new AutosaveWreckingBall();
- }
- else
- {
- // debugger; // keep this around for later usage when needing to adjust badpatterns
- dump(getValue.caller.name + " " +
- getValue.caller.caller.name + " " +
- getValue.caller.caller.caller.name + " " +
- getValue.caller.caller.caller.caller.name + " " +
- getValue.caller.caller.caller.caller.caller.name + " " +
- getValue.caller.caller.caller.caller.caller.caller.name + "\n\n");
- }
- // finally, if nothing matches:
- return this.__proto__.__lookupGetter__("value").apply(this);
- } // end getValue
+ Zna Vna UIb $RQa $SQa Moa
+ */
- function setValue(s)
- {
- this.__proto__.__lookupSetter__("value").call(this,s);
- }
+ if (stackMatch(badpattern11, getValue.caller) || stackMatch(badpattern10, getValue.caller) || stackMatch(badpattern9, getValue.caller) || stackMatch(badpattern8, getValue.caller) || stackMatch(badpattern7, getValue.caller) || stackMatch(badpattern6, getValue.caller) || stackMatch(badpattern5, getValue.caller) || stackMatch(badpattern4, getValue.caller) || stackMatch(badpattern3, getValue.caller) || stackMatch(badpattern1, getValue.caller) || stackMatch(badpattern2, getValue.caller))
+ {
+ function AutosaveWreckingBall() {};
+ AutosaveWreckingBall.prototype.value = "Wrecked";
+ AutosaveWreckingBall.prototype.toString = function() { return "[object AutosaveWreckingBall]"; }
+ throw new AutosaveWreckingBall();
+ }
+ else
+ {
+ // debugger; // keep this around for later usage when needing to adjust badpatterns
+ dump(getValue.caller.name + " " +
+ getValue.caller.caller.name + " " +
+ getValue.caller.caller.caller.name + " " +
+ getValue.caller.caller.caller.caller.name + " " +
+ getValue.caller.caller.caller.caller.caller.name + " " +
+ getValue.caller.caller.caller.caller.caller.caller.name + "\n\n");
+ }
+ // finally, if nothing matches:
+ return this.__proto__.__lookupGetter__("value").apply(this);
+ } // end getValue
- form.ownerDocument.defaultView.setTimeout(getValue.toString() + "\ndocument.getElementById('" + subj.id + "').__defineGetter__('value', getValue);\n" +
- setValue.toString() + "\ndocument.getElementById('" + subj.id + "').__defineSetter__('value', setValue);\n",1);
+ function setValue(s)
+ {
+ this.__proto__.__lookupSetter__("value").call(this,s);
+ }
+ form.ownerDocument.defaultView.setTimeout(getValue.toString() + "\ndocument.getElementById('" + subj.id + "').__defineGetter__('value', getValue);\n" +
+ setValue.toString() + "\ndocument.getElementById('" + subj.id + "').__defineSetter__('value', setValue);\n",1);
- // message about autosave disabled
- var spanAS = form.ownerDocument.evaluate(".//div[contains(@class,'dW')]//span[@class='d2']",
- form.parentNode.parentNode.parentNode.parentNode, null,
- XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
- for (var o=0;o<spanAS.snapshotLength;o++)
- {
- spanAS.snapshotItem(o).innerHTML = i18n.getString("autosave-disabled");
- }
+ // message about autosave disabled
+ var spanAS = form.ownerDocument.evaluate(".//div[contains(@class,'dW')]//span[@class='d2']",
+ form.parentNode.parentNode.parentNode.parentNode, null,
+ XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
+ for (var o=0;o<spanAS.snapshotLength;o++)
+ {
+ spanAS.snapshotItem(o).innerHTML = i18n.getString("autosave-disabled");
+ }
- } // end if autosave disabled
+ } // end if autosave disabled
- //End of code of Gmail S/MIME.
+ //End of code of Gmail S/MIME.
+ } catch (e) { FireGPG_cGmail2.error(e, 'checkDock/compose') }
}
}
//END OF THE TEST FOR COMPOSE BUTTONS
- cGmail2.docOccuped[id] = false;
+ FireGPG_cGmail2.docOccuped[id] = false;
+ }
}
- }
+ } catch (e) { FireGPG_cGmail2.error(e, 'checkDock') }
},
@@ -956,685 +962,691 @@ Zna Vna UIb $RQa $SQa Moa
*/
callBack: function(doc) {
- this._doc = doc;
+ try {
- this.handleEvent = function(event) { // Function in the function for handle... events.
- var i18n = document.getElementById("firegpg-strings");
+ this._doc = doc;
+ this.handleEvent = function(event) { // Function in the function for handle... events.
+ try {
+ var i18n = document.getElementById("firegpg-strings");
- /* if (event.target.nodeName == "SELECT")
- return;
- try {
-
- if (event.target.nodeName == "OPTION") {
+ /* if (event.target.nodeName == "SELECT")
+ return;
- var tmpval = event.target.value;
+ try {
- var target = event.target.parentNode;
+ if (event.target.nodeName == "OPTION") {
- target.setAttribute('gpg_action', tmpval);
+ var tmpval = event.target.value;
- target.value = "FireGPG";
- } else { */
+ var target = event.target.parentNode;
- target = event.target;
+ target.setAttribute('gpg_action', tmpval);
- /* }
+ target.value = "FireGPG";
+ } else { */
- } catch (e) { fireGPGDebug(e,'cgmail2.callBack',true); } */
+ target = event.target;
+ /* }
- if (target.hasAttribute('firegpg-ingore-this-event') && target.getAttribute('firegpg-ingore-this-event') == 'firegpg-ingore-this-event') {
- fireGPGDebug('event ingored', 'callBack');
- return;
- }
+ } catch (e) { fireGPGDebug(e,'cgmail2.callBack',true); } */
- //Keypress
- if (target.getAttribute('gpg_action') == null) {
- list = target.getElementsByTagName('b');
- for(i in list) {
- if (list[i].getAttribute('gpg_action') != null) {
- target = list[i];
- break;
+ if (target.hasAttribute('firegpg-ingore-this-event') && target.getAttribute('firegpg-ingore-this-event') == 'firegpg-ingore-this-event') {
+ fireGPGDebug('event ingored', 'callBack');
+ return;
}
- }
+ //Keypress
+ if (target.getAttribute('gpg_action') == null) {
+ list = target.getElementsByTagName('b');
+ for(i in list) {
+ if (list[i].getAttribute('gpg_action') != null) {
+ target = list[i];
+ break;
+ }
- }
+ }
- fireGPGDebug('Action: ' + target.getAttribute('gpg_action') + ' T:' + target, 'callBack');
+ }
- //If the user want to decrypt the mail (can use normal attibutes)
- if (target.innerHTML.indexOf(i18n.getString("GMailD")) == 0) {
+ fireGPGDebug('Action: ' + target.getAttribute('gpg_action') + ' T:' + target, 'callBack');
- var tmpNode = target;
+ //If the user want to decrypt the mail (can use normal attibutes)
+ if (target.innerHTML.indexOf(i18n.getString("GMailD")) == 0) {
- var result = FireGPG.decrypt(false,target.parentNode.parentNode.getAttribute("firegpg-mail-to-decrypt"));
+ var tmpNode = target;
- if (target.parentNode.parentNode.hasAttribute("firegpg-parse-as-mime"))
- result.decrypted = FireGPGMimeDecoder.parseDecrypted(result.decrypted).message.replace(/<br \/>/gi, "\n");
- if (result.result == RESULT_SUCCESS)
- showText(result.decrypted,undefined,undefined,undefined,result.signresulttext);
+ var result = FireGPG.decrypt(false,target.parentNode.parentNode.getAttribute("firegpg-mail-to-decrypt"));
- } /*
- else if (target.getAttribute('gpg_action') == "sndsign" || target.getAttribute('gpg_action') == "sign")
- {
+ if (target.parentNode.parentNode.hasAttribute("firegpg-parse-as-mime"))
+ result.decrypted = FireGPGMimeDecoder.parseDecrypted(result.decrypted).message.replace(/<br \/>/gi, "\n");
- var mailContent = cGmail2.getWriteMailContent(this._doc,target.parentNode);
+ if (result.result == FireGPGResults.SUCCESS)
+ FireGPGMisc.showText(result.decrypted,undefined,undefined,undefined,result.signresulttext);
- if (mailContent == "")
- return;
+ } /*
+ else if (target.getAttribute('gpg_action') == "sndsign" || target.getAttribute('gpg_action') == "sign")
+ {
- var result = FireGPG.sign(false,gmailWrapping(mailContent));
+ var mailContent = FireGPG_cGmail2.getWriteMailContent(this._doc,target.parentNode);
- if (result.result == RESULT_SUCCESS) {
+ if (mailContent == "")
+ return;
- cGmail2.setWriteMailContent(this._doc,target.parentNode,result.signed);
+ var result = FireGPG.sign(false,FireGPGMisc.gmailWrapping(mailContent));
- if (target.getAttribute('gpg_action') == "sndsign")
- cGmail2.sendEmail(target.parentNode,this._doc);
- }
+ if (result.result == FireGPGResults.SUCCESS) {
- }
- else if (target.getAttribute('gpg_action') == "sndpsign" || target.getAttribute('gpg_action') == "psign")
- {
+ FireGPG_cGmail2.setWriteMailContent(this._doc,target.parentNode,result.signed);
- var mailContent = cGmail2.getWriteMailContent(this._doc,target.parentNode);
+ if (target.getAttribute('gpg_action') == "sndsign")
+ FireGPG_cGmail2.sendEmail(target.parentNode,this._doc);
+ }
- if (mailContent == "")
- return;
+ }
+ else if (target.getAttribute('gpg_action') == "sndpsign" || target.getAttribute('gpg_action') == "psign")
+ {
- var result = FireGPG.sign(false,gmailWrapping(mailContent),null,null,true);
+ var mailContent = FireGPG_cGmail2.getWriteMailContent(this._doc,target.parentNode);
- if (result.result == RESULT_SUCCESS) {
+ if (mailContent == "")
+ return;
- cGmail2.setWriteMailContent(this._doc,target.parentNode,result.signed);
+ var result = FireGPG.sign(false,FireGPGMisc.gmailWrapping(mailContent),null,null,true);
- if (target.getAttribute('gpg_action') == "sndpsign")
- cGmail2.sendEmail(target.parentNode,this._doc);
- }
+ if (result.result == FireGPGResults.SUCCESS) {
- }
- else if (target.getAttribute('gpg_action') == "sndcrypt" || target.getAttribute('gpg_action') == "crypt")
- {
+ FireGPG_cGmail2.setWriteMailContent(this._doc,target.parentNode,result.signed);
- //This code has to mix with the previous else/if block
- var mailContent = cGmail2.getWriteMailContent(this._doc,target.parentNode);
+ if (target.getAttribute('gpg_action') == "sndpsign")
+ FireGPG_cGmail2.sendEmail(target.parentNode,this._doc);
+ }
- var whoWillGotTheMail = cGmail2.getToCcBccMail(this._doc,target.parentNode);
+ }
+ else if (target.getAttribute('gpg_action') == "sndcrypt" || target.getAttribute('gpg_action') == "crypt")
+ {
- if (mailContent == "")
- return;
+ //This code has to mix with the previous else/if block
+ var mailContent = FireGPG_cGmail2.getWriteMailContent(this._doc,target.parentNode);
- var result = FireGPG.crypt(false,mailContent,null, false, false,whoWillGotTheMail);
+ var whoWillGotTheMail = FireGPG_cGmail2.getToCcBccMail(this._doc,target.parentNode);
- if(result.result == RESULT_SUCCESS) {
+ if (mailContent == "")
+ return;
- cGmail2.setWriteMailContent(this._doc,target.parentNode,result.encrypted);
+ var result = FireGPG.crypt(false,mailContent,null, false, false,whoWillGotTheMail);
- if (target.getAttribute('gpg_action') == "sndcrypt")
- {
- cGmail2.sendEmail(target.parentNode,this._doc);
- }
+ if(result.result == FireGPGResults.SUCCESS) {
- }
- }
- else if (target.getAttribute('gpg_action') == "sndsigncrypt" || target.getAttribute('gpg_action') == "signcrypt")
- {
+ FireGPG_cGmail2.setWriteMailContent(this._doc,target.parentNode,result.encrypted);
- //This code has to mix with the previous else/if block
- var mailContent = cGmail2.getWriteMailContent(this._doc,target.parentNode);
+ if (target.getAttribute('gpg_action') == "sndcrypt")
+ {
+ FireGPG_cGmail2.sendEmail(target.parentNode,this._doc);
+ }
- var whoWillGotTheMail = cGmail2.getToCcBccMail(this._doc,target.parentNode);
+ }
+ }
+ else if (target.getAttribute('gpg_action') == "sndsigncrypt" || target.getAttribute('gpg_action') == "signcrypt")
+ {
+ //This code has to mix with the previous else/if block
+ var mailContent = FireGPG_cGmail2.getWriteMailContent(this._doc,target.parentNode);
- if (mailContent == "")
- return;
+ var whoWillGotTheMail = FireGPG_cGmail2.getToCcBccMail(this._doc,target.parentNode);
- var result = FireGPG.cryptAndSign(false, mailContent, null ,false,null, null, false, whoWillGotTheMail);
- // If the sign failled
- if(result.result == RESULT_ERROR_UNKNOW) {
- // We alert the user
- alert(i18n.getString("cryptAndSignFailed"));
- }
- else if(result.result == RESULT_ERROR_PASSWORD) {
- // We alert the user
- alert(i18n.getString("cryptAndSignFailedPass"));
- }
- else {
+ if (mailContent == "")
+ return;
- cGmail2.setWriteMailContent(this._doc,target.parentNode,result.encrypted);
+ var result = FireGPG.cryptAndSign(false, mailContent, null ,false,null, null, false, whoWillGotTheMail);
- if (target.getAttribute('gpg_action') == "sndsigncrypt")
- {
- cGmail2.sendEmail(target.parentNode,this._doc);
- }
+ // If the sign failled
+ if(result.result == FireGPGResults.ERROR_UNKNOW) {
+ // We alert the user
+ alert(i18n.getString("cryptAndSignFailed"));
+ }
+ else if(result.result == FireGPGResults.ERROR_PASSWORD) {
+ // We alert the user
+ alert(i18n.getString("cryptAndSignFailedPass"));
+ }
+ else {
- }
- }*/
- else if (target.getAttribute('gpg_action') == "add_crypted" || target.getAttribute('gpg_action') == "add_crypted_and_sign")
- {
+ FireGPG_cGmail2.setWriteMailContent(this._doc,target.parentNode,result.encrypted);
- //Ok, so the user want to crypt a file.
+ if (target.getAttribute('gpg_action') == "sndsigncrypt")
+ {
+ FireGPG_cGmail2.sendEmail(target.parentNode,this._doc);
+ }
- //First, we got the file. We will crypt him, and save it the the temp folder. Next, we ask gmail to add the file.
+ }
+ }*/
+ else if (target.getAttribute('gpg_action') == "add_crypted" || target.getAttribute('gpg_action') == "add_crypted_and_sign")
+ {
- //Get the file
- var nsIFilePicker = Components.interfaces.nsIFilePicker;
- var fp = Components.classes["@mozilla.org/filepicker;1"]
- .createInstance(nsIFilePicker);
- fp.init(window, null, nsIFilePicker.modeOpen);
- fp.appendFilters(nsIFilePicker.filterText | nsIFilePicker.filterAll);
- if (fp.show() != nsIFilePicker.returnOK) //L'utilisateur annule
- return;
+ //Ok, so the user want to crypt a file.
- var filePath = fp.file.path;
+ //First, we got the file. We will crypt him, and save it the the temp folder. Next, we ask gmail to add the file.
- var data = EnigConvertToUnicode(getBinContent("file://" + filePath), 'UTF-8');
+ //Get the file
+ var nsIFilePicker = Components.interfaces.nsIFilePicker;
+ var fp = Components.classes["@mozilla.org/filepicker;1"]
+ .createInstance(nsIFilePicker);
+ fp.init(window, null, nsIFilePicker.modeOpen);
+ fp.appendFilters(nsIFilePicker.filterText | nsIFilePicker.filterAll);
+ if (fp.show() != nsIFilePicker.returnOK) //L'utilisateur annule
+ return;
- var whoWillGotTheMail = cGmail2.getToCcBccMail(this._doc,target.parentNode.parentNode.parentNode);
+ var filePath = fp.file.path;
- if (data == "")
- return;
+ var data = FireGPGMisc.EnigConvertToUnicode(FireGPGMisc.getBinContent("file://" + filePath), 'UTF-8');
- errors = false;
+ var whoWillGotTheMail = FireGPG_cGmail2.getToCcBccMail(this._doc,target.parentNode.parentNode.parentNode);
- if (target.getAttribute('gpg_action') == "add_crypted") {
+ if (data == "")
+ return;
- var result = FireGPG.crypt(false,data,null, false, true,whoWillGotTheMail);
+ errors = false;
- if(result.result != RESULT_SUCCESS)
- errors = true;
+ if (target.getAttribute('gpg_action') == "add_crypted") {
- } else {
+ var result = FireGPG.crypt(false,data,null, false, true,whoWillGotTheMail);
- // We get the result
- var result = FireGPG.cryptAndSign(false, data, null ,false,null, null,true, whoWillGotTheMail);
+ if(result.result != FireGPGResults.SUCCESS)
+ errors = true;
- if(result.result != RESULT_SUCCESS)
- errors = true;
+ } else {
- }
+ // We get the result
+ var result = FireGPG.cryptAndSign(false, data, null ,false,null, null,true, whoWillGotTheMail);
- if (errors == false){
+ if(result.result != FireGPGResults.SUCCESS)
+ errors = true;
+
+ }
- var newData = result.encrypted;
+ if (errors == false){
- var fileobj = getTmpDir();
+ var newData = result.encrypted;
- fileobj.append( fp.file.leafName + ".asc");
- fileobj.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0777);
+ var fileobj = FireGPGMisc.getTmpDir();
- putIntoBinFile(fileobj.path,newData);
+ fileobj.append( fp.file.leafName + ".asc");
+ fileobj.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0777);
+ FireGPGMisc.putIntoBinFile(fileobj.path,newData);
- //We simulate the add
- var tablebox = target.parentNode.parentNode.getElementsByTagName('table');
- tablebox = tablebox[0];
- //The last span is evry time a "Attach file" button.
+ //We simulate the add
+ var tablebox = target.parentNode.parentNode.getElementsByTagName('table');
+ tablebox = tablebox[0];
- //This is the 'Attach another'
- var FileButtonList = tablebox.getElementsByTagName('span');
- FileButton = FileButtonList[FileButtonList.length-1];
+ //The last span is evry time a "Attach file" button.
- //If he is hidden, there no files for the moment. We take an another button
- if (FileButton.parentNode.parentNode.parentNode.getAttribute("style").indexOf("display: none") != -1)
- {
+ //This is the 'Attach another'
+ var FileButtonList = tablebox.getElementsByTagName('span');
+ FileButton = FileButtonList[FileButtonList.length-1];
- if (FileButtonList[FileButtonList.length-2].innerHTML == FileButtonList[FileButtonList.length-1].innerHTML)
- FileButton = FileButtonList[FileButtonList.length-2];
- else
- FileButton = FileButtonList[FileButtonList.length-3];
+ //If he is hidden, there no files for the moment. We take an another button
+ if (FileButton.parentNode.parentNode.parentNode.getAttribute("style").indexOf("display: none") != -1)
+ {
- }
+ if (FileButtonList[FileButtonList.length-2].innerHTML == FileButtonList[FileButtonList.length-1].innerHTML)
+ FileButton = FileButtonList[FileButtonList.length-2];
+ else
+ FileButton = FileButtonList[FileButtonList.length-3];
+ }
- var evt = doc.createEvent("MouseEvents");
- evt.initEvent("click", true, true);
- FileButton.dispatchEvent(evt);
- //Get the list of inputs
- var InputList = tablebox.getElementsByTagName('input');
+ var evt = doc.createEvent("MouseEvents");
+ evt.initEvent("click", true, true);
+ FileButton.dispatchEvent(evt);
+ //Get the list of inputs
+ var InputList = tablebox.getElementsByTagName('input');
- for (var j = 0; j < InputList.length; j++) {
- if (InputList[j].getAttribute("type") == "file") {
- if (InputList[j].value == "")
- {
- InputList[j].value = fileobj.path;
- break;
+ for (var j = 0; j < InputList.length; j++) {
+
+ if (InputList[j].getAttribute("type") == "file") {
+ if (InputList[j].value == "")
+ {
+ InputList[j].value = fileobj.path;
+ break;
+ }
+ }
}
}
- }
- }
- } else if (target.getAttribute('gpg_action') == "send_button" || target.getAttribute('gpg_action') == "send_button2") {
+ } else if (target.getAttribute('gpg_action') == "send_button" || target.getAttribute('gpg_action') == "send_button2") {
- if (event.type == "keydown" && event.which != 13) {
- return;
- }
+ if (event.type == "keydown" && event.which != 13) {
+ return;
+ }
- if (event.type == "keyup" && event.which == 13) {
- event.stopPropagation();
- return;
- }
+ if (event.type == "keyup" && event.which == 13) {
+ event.stopPropagation();
+ return;
+ }
- if (event.type == "keypress" && event.which == 13) {
- event.stopPropagation();
- return;
- }
+ if (event.type == "keypress" && event.which == 13) {
+ event.stopPropagation();
+ return;
+ }
- if (event.type == "keypress")
- return;
+ if (event.type == "keypress")
+ return;
- if (event.type == "keyup" && event.which != 32) {
- return;
- }
+ if (event.type == "keyup" && event.which != 32) {
+ return;
+ }
- stopTheEvent = false;
+ stopTheEvent = false;
- buttonsboxes = target.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
+ buttonsboxes = target.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
- tmpimage = buttonsboxes.getElementsByClassName('firegpg-sign', 'img');
- sign = tmpimage[0].title == 'On';
+ tmpimage = buttonsboxes.getElementsByClassName('firegpg-sign', 'img');
+ sign = tmpimage[0].title == 'On';
- tmpimage = buttonsboxes.getElementsByClassName('firegpg-encrypt', 'img');
- encrypt = tmpimage[0].title == 'On';
+ tmpimage = buttonsboxes.getElementsByClassName('firegpg-encrypt', 'img');
+ encrypt = tmpimage[0].title == 'On';
- tmpimage = buttonsboxes.getElementsByClassName('firegpg-inline', 'img');
- inline = tmpimage[0].title == 'On';
+ tmpimage = buttonsboxes.getElementsByClassName('firegpg-inline', 'img');
+ inline = tmpimage[0].title == 'On';
- tmpimage = buttonsboxes.getElementsByClassName('firegpg-attachements', 'img');
- attachements = tmpimage[0].title == 'On';
+ tmpimage = buttonsboxes.getElementsByClassName('firegpg-attachements', 'img');
+ attachements = tmpimage[0].title == 'On';
- if (!sign & !encrypt)
- return;
+ if (!sign & !encrypt)
+ return;
- if (target.getAttribute('gpg_action') == "send_button2")
- buttonsboxes = target.parentNode.parentNode;
- else
- buttonsboxes = target.parentNode;
+ if (target.getAttribute('gpg_action') == "send_button2")
+ buttonsboxes = target.parentNode.parentNode;
+ else
+ buttonsboxes = target.parentNode;
- var whoWillGotTheMail = cGmail2.getToCcBccMail(this._doc,buttonsboxes, false, false, false);
+ var whoWillGotTheMail = FireGPG_cGmail2.getToCcBccMail(this._doc,buttonsboxes, false, false, false);
- if (inline) {
+ if (inline) {
- var mailContent = cGmail2.getWriteMailContent(this._doc,target.parentNode, true);
+ var mailContent = FireGPG_cGmail2.getWriteMailContent(this._doc,target.parentNode, true);
- if (mailContent == "")
- stopTheEvent = true;
- else {
+ if (mailContent == "")
+ stopTheEvent = true;
+ else {
- if (sign && encrypt) {
+ if (sign && encrypt) {
- var result = FireGPG.cryptAndSign(false, mailContent, null ,false,null, null, false, whoWillGotTheMail);
+ var result = FireGPG.cryptAndSign(false, mailContent, null ,false,null, null, false, whoWillGotTheMail);
- // If the sign failled
- if(result.result == RESULT_ERROR_UNKNOW) {
- // We alert the user
- alert(i18n.getString("cryptAndSignFailed"));
- stopTheEvent = true;
- }
- else if(result.result == RESULT_ERROR_PASSWORD) {
- // We alert the user
- alert(i18n.getString("cryptAndSignFailedPass"));
- stopTheEvent = true;
- }
- else if(result.result == RESULT_SUCCESS) {
+ // If the sign failled
+ if(result.result == FireGPGResults.ERROR_UNKNOW) {
+ // We alert the user
+ alert(i18n.getString("cryptAndSignFailed"));
+ stopTheEvent = true;
+ }
+ else if(result.result == FireGPGResults.ERROR_PASSWORD) {
+ // We alert the user
+ alert(i18n.getString("cryptAndSignFailedPass"));
+ stopTheEvent = true;
+ }
+ else if(result.result == FireGPGResults.SUCCESS) {
- cGmail2.setWriteMailContent(this._doc,target.parentNode,result.encrypted);
+ FireGPG_cGmail2.setWriteMailContent(this._doc,target.parentNode,result.encrypted);
- } else {
- stopTheEvent = true;
- }
+ } else {
+ stopTheEvent = true;
+ }
- } else if (sign) {
+ } else if (sign) {
- var result = FireGPG.sign(false,gmailWrapping(mailContent));
+ var result = FireGPG.sign(false,FireGPGMisc.gmailWrapping(mailContent));
- if (result.result == RESULT_SUCCESS) {
+ if (result.result == FireGPGResults.SUCCESS) {
- cGmail2.setWriteMailContent(this._doc,target.parentNode,result.signed);
+ FireGPG_cGmail2.setWriteMailContent(this._doc,target.parentNode,result.signed);
- } else {
+ } else {
- stopTheEvent = true;
- }
+ stopTheEvent = true;
+ }
- } else if (encrypt) {
+ } else if (encrypt) {
- var result = FireGPG.crypt(false,mailContent,null, false, false,whoWillGotTheMail);
+ var result = FireGPG.crypt(false,mailContent,null, false, false,whoWillGotTheMail);
- if(result.result == RESULT_SUCCESS) {
- cGmail2.setWriteMailContent(this._doc,target.parentNode,result.encrypted);
- } else {
- stopTheEvent = true;
- }
+ if(result.result == FireGPGResults.SUCCESS) {
+ FireGPG_cGmail2.setWriteMailContent(this._doc,target.parentNode,result.encrypted);
+ } else {
+ stopTheEvent = true;
+ }
- }
+ }
- //
- if (stopTheEvent == false) { //Faut faire notre propre event
+ //
+ if (stopTheEvent == false) { //Faut faire notre propre event
- //On relance un click event
- event.stopPropagation();
+ //On relance un click event
+ event.stopPropagation();
- target.setAttribute('firegpg-ingore-this-event', 'firegpg-ingore-this-event');
+ target.setAttribute('firegpg-ingore-this-event', 'firegpg-ingore-this-event');
- var evt1 = doc.createEvent("MouseEvents");
- evt1.initMouseEvent("mouseover", true, true, window,
- 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+ var evt1 = doc.createEvent("MouseEvents");
+ evt1.initMouseEvent("mouseover", true, true, window,
+ 0, 0, 0, 0, 0, false, false, false, false, 0, null);
- var evt2 = doc.createEvent("MouseEvents");
- evt2.initMouseEvent("mousedown", true, true, window,
- 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+ var evt2 = doc.createEvent("MouseEvents");
+ evt2.initMouseEvent("mousedown", true, true, window,
+ 0, 0, 0, 0, 0, false, false, false, false, 0, null);
- var evt3 = doc.createEvent("MouseEvents");
- evt3.initMouseEvent("mouseup", true, true, window,
- 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+ var evt3 = doc.createEvent("MouseEvents");
+ evt3.initMouseEvent("mouseup", true, true, window,
+ 0, 0, 0, 0, 0, false, false, false, false, 0, null);
- target.dispatchEvent(evt1);
- target.dispatchEvent(evt2);
- target.dispatchEvent(evt3);
+ target.dispatchEvent(evt1);
+ target.dispatchEvent(evt2);
+ target.dispatchEvent(evt3);
- target.setAttribute('firegpg-ingore-this-event', '');
+ target.setAttribute('firegpg-ingore-this-event', '');
- }
+ }
- }
+ }
- } else {
+ } else {
- //alert("S:" + sign + " E:" + encrypt + " I:" + inline);
+ //alert("S:" + sign + " E:" + encrypt + " I:" + inline);
- form = buttonsboxes.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.getElementsByTagName('form');
- f = form[0];
+ form = buttonsboxes.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.getElementsByTagName('form');
+ f = form[0];
- cGmail2.setProgressMessage(f, i18n.getString("GmailCreatingMail"));
+ FireGPG_cGmail2.setProgressMessage(f, i18n.getString("GmailCreatingMail"));
- var children = buttonsboxes.parentNode.parentNode.parentNode.parentNode.parentNode.getElementsByClassName('goog-imageless-button-content');
- a = new FireGPGGmailMimeSender(f, children[2], i18n);
+ var children = buttonsboxes.parentNode.parentNode.parentNode.parentNode.parentNode.getElementsByClassName('goog-imageless-button-content');
+ a = new FireGPGGmailMimeSender(f, children[2], i18n);
- var prefs = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefService);
+ var prefs = Components.classes["@mozilla.org/preferences-service;1"].
+ getService(Components.interfaces.nsIPrefService);
- prefs = prefs.getBranch("extensions.firegpg.");
- try {
- var username = prefs.getCharPref("gmail_username");
- } catch (e) {
- username = "";
- }
+ prefs = prefs.getBranch("extensions.firegpg.");
+ try {
+ var username = prefs.getCharPref("gmail_username");
+ } catch (e) {
+ username = "";
+ }
- try {
+ try {
- var topwinjs = f.ownerDocument.defaultView.parent.wrappedJSObject;
- if (("USER_EMAIL" in topwinjs) && typeof(topwinjs.USER_EMAIL) == "string")
- {
- cGmail2.useremail = topwinjs.USER_EMAIL;
- }
- else if (("GLOBALS" in topwinjs) && typeof(topwinjs.GLOBALS[10]) == "string" &&
- (/@(g|google)mail.com$/i).test(topwinjs.GLOBALS[10]))
- {
- // gmail_fe_509_p10
- cGmail2.useremail = topwinjs.GLOBALS[10];
- }
- else if (typeof(topwinjs.globals) == "object" && typeof(topwinjs.globals.USER_EMAIL) == "string")
- {
- cGmail2.useremail = topwinjs.globals.USER_EMAIL;
- } else {
-
- cGmail2.useremail = f.ownerDocument.evaluate(".//div[@class='a8']//b[contains(text(), '@')]",
- f.ownerDocument.body, null, XPathResult.FIRST_ORDERED_NODE_TYPE,
- null).singleNodeValue.textContent;
-
- }
-
- } catch (e) { fireGPGDebug(e, 'finding smtp username', true);}
-
-
- if (username == "") {
- a.smtpUsername = cGmail2.useremail;
- }
+ var topwinjs = f.ownerDocument.defaultView.parent.wrappedJSObject;
+ if (("USER_EMAIL" in topwinjs) && typeof(topwinjs.USER_EMAIL) == "string")
+ {
+ FireGPG_cGmail2.useremail = topwinjs.USER_EMAIL;
+ }
+ else if (("GLOBALS" in topwinjs) && typeof(topwinjs.GLOBALS[10]) == "string" &&
+ (/@(g|google)mail.com$/i).test(topwinjs.GLOBALS[10]))
+ {
+ // gmail_fe_509_p10
+ FireGPG_cGmail2.useremail = topwinjs.GLOBALS[10];
+ }
+ else if (typeof(topwinjs.globals) == "object" && typeof(topwinjs.globals.USER_EMAIL) == "string")
+ {
+ FireGPG_cGmail2.useremail = topwinjs.globals.USER_EMAIL;
+ } else {
+
+ FireGPG_cGmail2.useremail = f.ownerDocument.evaluate(".//div[@class='a8']//b[contains(text(), '@')]",
+ f.ownerDocument.body, null, XPathResult.FIRST_ORDERED_NODE_TYPE,
+ null).singleNodeValue.textContent;
+
+ }
+
+ } catch (e) { fireGPGDebug(e, 'finding smtp username', true);}
+
+
+ if (username == "") {
+ a.smtpUsername = FireGPG_cGmail2.useremail;
+ }
- else
- a.smtpUsername = username;
+ else
+ a.smtpUsername = username;
- try {
- var no_auth = prefs.getBoolPref("gmail_smtp_no_auth",false);
- } catch (e) {
- no_auth = false;
- }
+ try {
+ var no_auth = prefs.getBoolPref("gmail_smtp_no_auth",false);
+ } catch (e) {
+ no_auth = false;
+ }
- if (no_auth) {
- a.smtpUsername = null;
- }
+ if (no_auth) {
+ a.smtpUsername = null;
+ }
- try {
- var host = prefs.getCharPref("gmail_host");
- } catch (e) {
- host = "smtp.gmail.com";
- }
+ try {
+ var host = prefs.getCharPref("gmail_host");
+ } catch (e) {
+ host = "smtp.gmail.com";
+ }
- a.smtpServer = host;
+ a.smtpServer = host;
- try {
- var port = prefs.getCharPref("gmail_port");
- } catch (e) {
- port = 465;
- }
+ try {
+ var port = prefs.getCharPref("gmail_port");
+ } catch (e) {
+ port = 465;
+ }
- a.smtpPort = port;
+ a.smtpPort = port;
- try {
- var use_ssl = prefs.getBoolPref("gmail_use_ssl",true);
- } catch (e) {
- use_ssl = true;
- }
+ try {
+ var use_ssl = prefs.getBoolPref("gmail_use_ssl",true);
+ } catch (e) {
+ use_ssl = true;
+ }
- if (use_ssl)
- a.smtpSocketTypes = new Array("ssl");
+ if (use_ssl)
+ a.smtpSocketTypes = new Array("ssl");
- fireGPGDebug(a.smtpUsername, 'dbug-username');
- fireGPGDebug(host, 'dbug-host');
- fireGPGDebug(port, 'dbug-port');
- fireGPGDebug(use_ssl, 'dbug-use_ssl');
+ fireGPGDebug(a.smtpUsername, 'dbug-username');
+ fireGPGDebug(host, 'dbug-host');
+ fireGPGDebug(port, 'dbug-port');
+ fireGPGDebug(use_ssl, 'dbug-use_ssl');
- from = cGmail2.getMailSender(this._doc,buttonsboxes);
+ from = FireGPG_cGmail2.getMailSender(this._doc,buttonsboxes);
- if (from == "" || from == null)
- from = cGmail2.useremail;
+ if (from == "" || from == null)
+ from = FireGPG_cGmail2.useremail;
- try {
- var forcefrom = prefs.getCharPref("gmail_force_from");
- } catch (e) {
- forcefrom = "";
- }
+ try {
+ var forcefrom = prefs.getCharPref("gmail_force_from");
+ } catch (e) {
+ forcefrom = "";
+ }
- if (forcefrom != "" && forcefrom != null && forcefrom != undefined)
- from = forcefrom;
+ if (forcefrom != "" && forcefrom != null && forcefrom != undefined)
+ from = forcefrom;
- if (from == undefined) //Zomg problem !
- from = a.smtpUsername
+ if (from == undefined) //Zomg problem !
+ from = a.smtpUsername
- if (from == undefined || from == "") {
- event.stopPropagation();
- alert('This shouldn\'t happend, but I\'m unable to find a from value. Please set one on options');
- return;
- }
+ if (from == undefined || from == "") {
+ event.stopPropagation();
+ alert('This shouldn\'t happend, but I\'m unable to find a from value. Please set one on options');
+ return;
+ }
- to = cGmail2.getToCcBccMail(this._doc,buttonsboxes, true);
- cc= cGmail2.getToCcBccMail(this._doc,buttonsboxes, false, true);
- bcc = cGmail2.getToCcBccMail(this._doc,buttonsboxes, false, false, true);
+ to = FireGPG_cGmail2.getToCcBccMail(this._doc,buttonsboxes, true);
+ cc= FireGPG_cGmail2.getToCcBccMail(this._doc,buttonsboxes, false, true);
+ bcc = FireGPG_cGmail2.getToCcBccMail(this._doc,buttonsboxes, false, false, true);
- subject = cGmail2.getMailSubject(this._doc,buttonsboxes);
+ subject = FireGPG_cGmail2.getMailSubject(this._doc,buttonsboxes);
- //Attachements
+ //Attachements
- var attachments = new Array(), attlink;
- // iterate over all Gmail form elements
- // var attachNumber = 0;
- for (var i=0;i<f.elements.length;i++)
- {
- var elem = f.elements[i];
- if (elem.type == "button" || elem.name == null ||
- elem.name.length == 0)
- continue;
+ var attachments = new Array(), attlink;
+ // iterate over all Gmail form elements
+ // var attachNumber = 0;
+ for (var i=0;i<f.elements.length;i++)
+ {
+ var elem = f.elements[i];
+ if (elem.type == "button" || elem.name == null ||
+ elem.name.length == 0)
+ continue;
- if (elem.type == "file")
- {
- // Add files to multipart encoder
- if (elem.value != null && elem.value.length) {
- attachments.push(elem.value);
- }
- }
- else if (elem.type == "checkbox" && elem.name == "attach" && elem.checked && elem.nextSibling && (attlink = elem.nextSibling.nextSibling) && (attlink instanceof HTMLAnchorElement))
- {
- // this is an already-attached file, and the user wants it.
- var ioService=Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
- var channel=ioService.newChannel(attlink.href,null,null);
- attachments.push(channel);
- }
- } // end for
+ if (elem.type == "file")
+ {
+ // Add files to multipart encoder
+ if (elem.value != null && elem.value.length) {
+ attachments.push(elem.value);
+ }
+ }
+ else if (elem.type == "checkbox" && elem.name == "attach" && elem.checked && elem.nextSibling && (attlink = elem.nextSibling.nextSibling) && (attlink instanceof HTMLAnchorElement))
+ {
+ // this is an already-attached file, and the user wants it.
+ var ioService=Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
+ var channel=ioService.newChannel(attlink.href,null,null);
+ attachments.push(channel);
+ }
+ } // end for
- var mailContent = cGmail2.getWriteMailContentForDirectSend(this._doc, buttonsboxes);
+ var mailContent = FireGPG_cGmail2.getWriteMailContentForDirectSend(this._doc, buttonsboxes);
- var inreplyTo = f.getAttribute("firegpg-mail-id");
+ var inreplyTo = f.getAttribute("firegpg-mail-id");
- prefs = new Object();
+ prefs = new Object();
- prefs.sign = sign;
- prefs.encrypt = encrypt;
- prefs.attachements = attachements;
- prefs.whoWillGotTheMail = whoWillGotTheMail;
- prefs.whoSendTheMail = cGmail2.extractMails(from);
+ prefs.sign = sign;
+ prefs.encrypt = encrypt;
+ prefs.attachements = attachements;
+ prefs.whoWillGotTheMail = whoWillGotTheMail;
+ prefs.whoSendTheMail = FireGPG_cGmail2.extractMails(from);
- resulta = false;
+ resulta = false;
- resulta = a.ourSubmit(from, to, cc, bcc, subject,
- inreplyTo, "", mailContent, cGmail2.iframeOrTextarea(this._doc, buttonsboxes) == "textarea", attachments, prefs);
+ resulta = a.ourSubmit(from, to, cc, bcc, subject,
+ inreplyTo, "", mailContent, FireGPG_cGmail2.iframeOrTextarea(this._doc, buttonsboxes) == "textarea", attachments, prefs);
- //DBUG
- fireGPGDebug(from, 'dbug-from');
- fireGPGDebug(to, 'dbug-to');
- fireGPGDebug(cc, 'dbug-cc');
- fireGPGDebug(bcc, 'dbug-bcc');
- fireGPGDebug(subject, 'dbug-subject');
+ //DBUG
+ fireGPGDebug(from, 'dbug-from');
+ fireGPGDebug(to, 'dbug-to');
+ fireGPGDebug(cc, 'dbug-cc');
+ fireGPGDebug(bcc, 'dbug-bcc');
+ fireGPGDebug(subject, 'dbug-subject');
- if (!resulta)
- cGmail2.setProgressMessage(f, i18n.getString("GmailErrorMail"));
- else
- cGmail2.setProgressMessage(f, i18n.getString("GmailSendingMail"));
+ if (!resulta)
+ FireGPG_cGmail2.setProgressMessage(f, i18n.getString("GmailErrorMail"));
+ else
+ FireGPG_cGmail2.setProgressMessage(f, i18n.getString("GmailSendingMail"));
- stopTheEvent = true;
+ stopTheEvent = true;
- }
+ }
- if (stopTheEvent) {
- event.stopPropagation();
- fireGPGDebug('Canceling event', 'click on send');
- }
+ if (stopTheEvent) {
+ event.stopPropagation();
+ fireGPGDebug('Canceling event', 'click on send');
+ }
- } else if (target.getAttribute('gpg_action') == "attachement" || target.getAttribute('gpg_action') == "sattachement" || target.getAttribute('gpg_action') == "sattachement2") {
+ } else if (target.getAttribute('gpg_action') == "attachement" || target.getAttribute('gpg_action') == "sattachement" || target.getAttribute('gpg_action') == "sattachement2") {
- if ( target.getAttribute('gpg_action') == "sattachement" )
- node = target.parentNode.parentNode.parentNode.parentNode.parentNode;
- if ( target.getAttribute('gpg_action') == "sattachement2" )
- node = target.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
- if ( target.getAttribute('gpg_action') == "attachement" )
- node = target;
+ if ( target.getAttribute('gpg_action') == "sattachement" )
+ node = target.parentNode.parentNode.parentNode.parentNode.parentNode;
+ if ( target.getAttribute('gpg_action') == "sattachement2" )
+ node = target.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
+ if ( target.getAttribute('gpg_action') == "attachement" )
+ node = target;
- name = node.getAttribute('firegpg-file-name');
- type = node.getAttribute('firegpg-file-type');
+ name = node.getAttribute('firegpg-file-name');
+ type = node.getAttribute('firegpg-file-type');
- switch(type) {
- case 'decrypted':
- data = Base64.decode(node.getAttribute('firegpg-file-content'),true);
+ switch(type) {
+ case 'decrypted':
+ data = FireGPGMisc.Base64.decode(node.getAttribute('firegpg-file-content'),true);
- break;
+ break;
- case 'encrypted':
- eData = Base64.decode(node.getAttribute('firegpg-file-content'),true);
+ case 'encrypted':
+ eData = FireGPGMisc.Base64.decode(node.getAttribute('firegpg-file-content'),true);
- var result = FireGPG.decrypt(true,eData);
+ var result = FireGPG.decrypt(true,eData);
- if (result.result == RESULT_ERROR_NO_GPG_DATA) {
+ if (result.result == FireGPGResults.ERROR_NO_GPG_DATA) {
- var result = FireGPG.decrypt(true,eData, undefined, true);
+ var result = FireGPG.decrypt(true,eData, undefined, true);
- }
+ }
- if (result.result == RESULT_SUCCESS)
- data = result.decrypted;
+ if (result.result == FireGPGResults.SUCCESS)
+ data = result.decrypted;
- if (result.notEncrypted)
- alert(i18n.getString("notEncryptedButPlainText"));
+ if (result.notEncrypted)
+ alert(i18n.getString("notEncryptedButPlainText"));
- name = name.substring(0, name.length -4);
+ name = name.substring(0, name.length -4);
- break;
- }
+ break;
+ }
- if (data) {
+ if (data) {
- var nsIFilePicker = Components.interfaces.nsIFilePicker;
- var fp = Components.classes["@mozilla.org/filepicker;1"]
- .createInstance(nsIFilePicker);
+ var nsIFilePicker = Components.interfaces.nsIFilePicker;
+ var fp = Components.classes["@mozilla.org/filepicker;1"]
+ .createInstance(nsIFilePicker);
- fp.init(window, null, nsIFilePicker.modeSave);
- fp.appendFilters(nsIFilePicker.filterAll);
- fp.defaultString = name;
+ fp.init(window, null, nsIFilePicker.modeSave);
+ fp.appendFilters(nsIFilePicker.filterAll);
+ fp.defaultString = name;
- var a = fp.show();
+ var a = fp.show();
- if (a != nsIFilePicker.returnOK && a != nsIFilePicker.returnReplace) //L'utilisateur annule
- return;
+ if (a != nsIFilePicker.returnOK && a != nsIFilePicker.returnReplace) //L'utilisateur annule
+ return;
- var filePath = fp.file.path;
- //Need to remove the file before save
- removeFile(filePath);
- putIntoBinFile(filePath,data);
+ var filePath = fp.file.path;
+ //Need to remove the file before save
+ FireGPGMisc.removeFile(filePath);
+ FireGPGMisc.putIntoBinFile(filePath,data);
- }
+ }
- }
- };
+ }
+
+ } catch (e) { FireGPG_cGmail2.error(e, 'callBack/call') }
+ };
+ } catch (e) { FireGPG_cGmail2.error(e, 'callBack/main') }
},
/*
@@ -1700,7 +1712,7 @@ Zna Vna UIb $RQa $SQa Moa
var tmpListener = new Object;
tmpListener = null;
- tmpListener = new cGmail2.callBack(doc)
+ tmpListener = new FireGPG_cGmail2.callBack(doc)
select.addEventListener('onchange',tmpListener,true);
} catch (e) { fireGPGDebug(e,'cgmail2.addBouton2',true); }
@@ -1747,157 +1759,158 @@ Zna Vna UIb $RQa $SQa Moa
*/
getWriteMailContent: function(dDocument,boutonxboxnode, betterTextOnly, forMime)
{
+ try {
+ if (betterTextOnly && FireGPG_cGmail2.iframeOrTextarea(dDocument,boutonxboxnode) == "iframe") {
- if (betterTextOnly && cGmail2.iframeOrTextarea(dDocument,boutonxboxnode) == "iframe") {
+ var i18n = document.getElementById("firegpg-strings");
- var i18n = document.getElementById("firegpg-strings");
+ if (confirm(i18n.getString("betterToUsePlainText"))) {
- if (confirm(i18n.getString("betterToUsePlainText"))) {
+ whereSeacrch =boutonxboxnode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
- whereSeacrch =boutonxboxnode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
+ children = whereSeacrch.getElementsByClassName('eo el', 'span');
- children = whereSeacrch.getElementsByClassName('eo el', 'span');
+ try {
+ var evt = dDocument.createEvent("MouseEvents");
+ evt.initEvent("click", true, true);
+ children[0].dispatchEvent(evt);
+ } catch (e) { fireGPGDebug(e,'cgmail2.getWriteMailContent(settoplaintext)',true); }
- try {
- var evt = dDocument.createEvent("MouseEvents");
- evt.initEvent("click", true, true);
- children[0].dispatchEvent(evt);
- } catch (e) { fireGPGDebug(e,'cgmail2.getWriteMailContent(settoplaintext)',true); }
+ }
}
- }
-
- if (cGmail2.iframeOrTextarea(dDocument,boutonxboxnode) == "iframe")
- {
-
- var iframe = cGmail2.getTheIframe(dDocument,boutonxboxnode);
+ if (FireGPG_cGmail2.iframeOrTextarea(dDocument,boutonxboxnode) == "iframe")
+ {
+ var iframe = FireGPG_cGmail2.getTheIframe(dDocument,boutonxboxnode);
- //First, we look for a selection
- try { var select = iframe.contentWindow.getSelection(); }
- catch (e) { var select = ""; }
- //Autodetect
- if (select.toString() == "")
- {
- try { var select = iframe.contentWindow.document.body.innerHTML; }
+ //First, we look for a selection
+ try { var select = iframe.contentWindow.getSelection(); }
catch (e) { var select = ""; }
- if ( select != "")
+ //Autodetect
+ if (select.toString() == "")
{
+ try { var select = iframe.contentWindow.document.body.innerHTML; }
+ catch (e) { var select = ""; }
- if (cGmail2.noAutoReplyDetect) {
-
- contenuMail = Selection.wash(select);
+ if ( select != "")
+ {
- } else {
+ if (FireGPG_cGmail2.noAutoReplyDetect) {
- var indexOfQuote = select.indexOf('<div class="gmail_quote">');
+ contenuMail = FireGPG_Selection.wash(select);
- contenuMail = select.substring(0,indexOfQuote);
+ } else {
- if (!forMime)
- contenuMail = Selection.wash(contenuMail);
+ var indexOfQuote = select.indexOf('<div class="gmail_quote">');
- if (indexOfQuote == -1 || TrimAndWash(contenuMail) == "")
- {
- indexOfQuote = select.length;
contenuMail = select.substring(0,indexOfQuote);
if (!forMime)
- contenuMail = Selection.wash(contenuMail);
+ contenuMail = FireGPG_Selection.wash(contenuMail);
- }
+ if (indexOfQuote == -1 || FireGPGMisc.TrimAndWash(contenuMail) == "")
+ {
+ indexOfQuote = select.length;
+ contenuMail = select.substring(0,indexOfQuote);
+
+ if (!forMime)
+ contenuMail = FireGPG_Selection.wash(contenuMail);
+
+ }
- this.composeIndexOfQuote = indexOfQuote;
+ this.composeIndexOfQuote = indexOfQuote;
+ }
}
}
- }
- else
- {
- value = select.getRangeAt(0);
+ else
+ {
+ value = select.getRangeAt(0);
- var documentFragment = value.cloneContents();
+ var documentFragment = value.cloneContents();
- var s = new XMLSerializer();
- var d = documentFragment;
- var str = s.serializeToString(d);
+ var s = new XMLSerializer();
+ var d = documentFragment;
+ var str = s.serializeToString(d);
- contenuMail = Selection.wash(str);
+ contenuMail = FireGPG_Selection.wash(str);
- }
+ }
- } else {
+ } else {
- var textarea = cGmail2.getTheTextarea(dDocument,boutonxboxnode);
+ var textarea = FireGPG_cGmail2.getTheTextarea(dDocument,boutonxboxnode);
- var select2 = "";
- //Mode plain text
+ var select2 = "";
+ //Mode plain text
- //Selection
- try {
- select2 = textarea.value;
- select2 = select2.substring(textarea.selectionStart,textarea.selectionEnd);
- } catch (e) { }
+ //Selection
+ try {
+ select2 = textarea.value;
+ select2 = select2.substring(textarea.selectionStart,textarea.selectionEnd);
+ } catch (e) { }
- //Autodetect
- if (select2 == "")
- {
+ //Autodetect
+ if (select2 == "")
+ {
- if (cGmail2.noAutoReplyDetect) {
+ if (FireGPG_cGmail2.noAutoReplyDetect) {
- contentu = textarea.value;
+ contentu = textarea.value;
- textarea.selectionStart = 0;
- textarea.selectionEnd = contentu.length;
+ textarea.selectionStart = 0;
+ textarea.selectionEnd = contentu.length;
- } else {
+ } else {
- select2 = textarea.value;
+ select2 = textarea.value;
+
+ var indexOfQuote = select2.indexOf("\n> ");
+ select2 = select2.substring(0,indexOfQuote);
- var indexOfQuote = select2.indexOf("\n> ");
- select2 = select2.substring(0,indexOfQuote);
+ indexOfQuote = select2.lastIndexOf("\n");
- indexOfQuote = select2.lastIndexOf("\n");
+ var contentu = select2.substring(0,indexOfQuote);
- var contentu = select2.substring(0,indexOfQuote);
+ if (indexOfQuote == -1 || FireGPGMisc.TrimAndWash(contentu) == "")
+ {
+ select2 = textarea.value;
+ indexOfQuote = select2.length;
- if (indexOfQuote == -1 || TrimAndWash(contentu) == "")
- {
- select2 = textarea.value;
- indexOfQuote = select2.length;
+ var contentu = select2.substring(0,indexOfQuote);
+ }
+
+ textarea.selectionStart = 0;
+ textarea.selectionEnd = indexOfQuote;
- var contentu = select2.substring(0,indexOfQuote);
}
- textarea.selectionStart = 0;
- textarea.selectionEnd = indexOfQuote;
+ contenuMail = FireGPG_Selection.wash(contentu);
+ }
+ else
+ {
+ contenuMail = FireGPG_Selection.wash(select2);
}
- contenuMail = Selection.wash(contentu);
- }
- else
- {
- contenuMail = Selection.wash(select2);
}
+ //Remove stranges A0
+ var reg=new RegExp(unescape('%A0'), "gi");
+ contenuMail = contenuMail.replace(reg," ");
- }
- //Remove stranges A0
- var reg=new RegExp(unescape('%A0'), "gi");
- contenuMail = contenuMail.replace(reg," ");
-
-
- return contenuMail;
+ return contenuMail;
+ } catch (e) { FireGPG_cGmail2.error(e, 'getWriteMailContent') }
},
@@ -1912,35 +1925,36 @@ Zna Vna UIb $RQa $SQa Moa
getWriteMailContentForDirectSend: function(dDocument,boutonxboxnode)
{
+ try {
+ if (FireGPG_cGmail2.iframeOrTextarea(dDocument,boutonxboxnode) == "iframe")
+ {
- if (cGmail2.iframeOrTextarea(dDocument,boutonxboxnode) == "iframe")
- {
-
- var iframe = cGmail2.getTheIframe(dDocument,boutonxboxnode);
+ var iframe = FireGPG_cGmail2.getTheIframe(dDocument,boutonxboxnode);
- texte = iframe.contentWindow.document.body.innerHTML;
+ texte = iframe.contentWindow.document.body.innerHTML;
- var reg=new RegExp("<script[^>]*>[^<]*</script[^>]*>", "gi"); //Élimination des scripts
- texte = texte.replace(reg,"\n");
+ var reg=new RegExp("<script[^>]*>[^<]*</script[^>]*>", "gi"); //Élimination des scripts
+ texte = texte.replace(reg,"\n");
- var reg=new RegExp("<script[^>]*>[^<]*</script>", "gi"); //Élimination des scripts
- texte = texte.replace(reg,"\n");
+ var reg=new RegExp("<script[^>]*>[^<]*</script>", "gi"); //Élimination des scripts
+ texte = texte.replace(reg,"\n");
- var reg=new RegExp("<script>[^<]*</script>", "gi"); //Élimination des scripts
- texte = texte.replace(reg,"\n");
+ var reg=new RegExp("<script>[^<]*</script>", "gi"); //Élimination des scripts
+ texte = texte.replace(reg,"\n");
- return texte;
+ return texte;
- } else {
+ } else {
- var textarea = cGmail2.getTheTextarea(dDocument,boutonxboxnode);
+ var textarea = FireGPG_cGmail2.getTheTextarea(dDocument,boutonxboxnode);
- return textarea.value.replace(/\r\n/gi, "\n").replace(/\r/gi, "\n").replace(/\n/gi, "\r\n");
+ return textarea.value.replace(/\r\n/gi, "\n").replace(/\r/gi, "\n").replace(/\n/gi, "\r\n");
- }
+ }
+ } catch (e) { FireGPG_cGmail2.error(e, 'getWriteMailContentForDirectSend') }
},
/*
@@ -1953,22 +1967,24 @@ Zna Vna UIb $RQa $SQa Moa
*/
iframeOrTextarea: function(dDocument,boutonxboxnode) {
- var iframe = cGmail2.getTheIframe(dDocument,boutonxboxnode);
- var textarea = cGmail2.getTheTextarea(dDocument,boutonxboxnode);
+ try {
+ var iframe = FireGPG_cGmail2.getTheIframe(dDocument,boutonxboxnode);
+ var textarea = FireGPG_cGmail2.getTheTextarea(dDocument,boutonxboxnode);
- if (iframe == null || iframe.parentNode == undefined)
- return "textarea";
+ if (iframe == null || iframe.parentNode == undefined)
+ return "textarea";
- if (textarea == null || textarea.parentNode == undefined)
- return "iframe";
+ if (textarea == null || textarea.parentNode == undefined)
+ return "iframe";
- var style = iframe.parentNode.getAttribute('style');
+ var style = iframe.parentNode.getAttribute('style');
- if (style.indexOf('display: none;') != -1)
- return "textarea";
+ if (style.indexOf('display: none;') != -1)
+ return "textarea";
- return "iframe";
+ return "iframe";
+ } catch (e) { FireGPG_cGmail2.error(e, 'getiframeOrTextarea') }
},
@@ -1983,83 +1999,85 @@ Zna Vna UIb $RQa $SQa Moa
getTheIframe: function(dDocument,boutonxboxnode) {
+ try {
+ var i = dDocument.evaluate(".//td[contains(@class, 'd7')]//iframe", boutonxboxnode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
- var i = dDocument.evaluate(".//td[contains(@class, 'd7')]//iframe", boutonxboxnode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
+ fireGPGDebug(i, 'iframefound');
- fireGPGDebug(i, 'iframefound');
+ return i;
- return i;
+ /*var tmp = boutonxboxnode;
- /*var tmp = boutonxboxnode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.childNodes[1];
- tmp = tmp.childNodes[1];
+ //29 septebmre 2008
+ if (!tmp) {
- //29 septebmre 2008
- if (!tmp) {
+ var tmp = boutonxboxnode;
- var tmp = boutonxboxnode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.childNodes[1];
- tmp = tmp.childNodes[1];
+ }
- }
+ if (!tmp) { //Version du 29 octobre 2008 - BOUTONS DU BAS
- if (!tmp) { //Version du 29 octobre 2008 - BOUTONS DU BAS
+ var tmp = boutonxboxnode;
- var tmp = boutonxboxnode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.childNodes[1];
- tmp = tmp.childNodes[1];
+ }
- }
+ tmp = tmp.firstChild;
- tmp = tmp.firstChild;
+ tmp = tmp.childNodes[2];
- tmp = tmp.childNodes[2];
+ if (!tmp) { //Version du 29 octobre 2008
- if (!tmp) { //Version du 29 octobre 2008
+ var tmp = boutonxboxnode;
- var tmp = boutonxboxnode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.childNodes[1];
- tmp = tmp.childNodes[1];
+ tmp = tmp.firstChild;
- tmp = tmp.firstChild;
+ tmp = tmp.childNodes[2];
- tmp = tmp.childNodes[2];
+ }
- }
+ tmp = tmp.childNodes[1];
- tmp = tmp.childNodes[1];
+ tmp = tmp.getElementsByTagName('iframe');
- tmp = tmp.getElementsByTagName('iframe');
+ tmp = tmp[0];
- tmp = tmp[0];
+ return tmp;*/
- return tmp;*/
+ } catch (e) { FireGPG_cGmail2.error(e, 'getTheIframe') }
},
@@ -2074,81 +2092,84 @@ Zna Vna UIb $RQa $SQa Moa
*/
getTheTextarea: function(dDocument,boutonxboxnode) {
- var i = dDocument.evaluate(".//td[contains(@class, 'd7')]//textarea", boutonxboxnode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
+ try {
- fireGPGDebug(i, 'textareadfound');
+ var i = dDocument.evaluate(".//td[contains(@class, 'd7')]//textarea", boutonxboxnode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
- return i;
+ fireGPGDebug(i, 'textareadfound');
- /*var tmp = boutonxboxnode;
+ return i;
- tmp = tmp.parentNode;
+ /*var tmp = boutonxboxnode;
- tmp = tmp.childNodes[1];
+ tmp = tmp.parentNode;
- //29 septebmre 2008
- if (!tmp) {
+ tmp = tmp.childNodes[1];
- var tmp = boutonxboxnode;
+ //29 septebmre 2008
+ if (!tmp) {
- tmp = tmp.parentNode;
+ var tmp = boutonxboxnode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.childNodes[1];
+ tmp = tmp.parentNode;
- }
+ tmp = tmp.childNodes[1];
- if (!tmp) { //Version du 29 octobre 2008 - BOUTONS DU BAS
+ }
- var tmp = boutonxboxnode;
+ if (!tmp) { //Version du 29 octobre 2008 - BOUTONS DU BAS
- tmp = tmp.parentNode;
+ var tmp = boutonxboxnode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.childNodes[1];
+ tmp = tmp.parentNode;
- }
+ tmp = tmp.childNodes[1];
- tmp = tmp.firstChild;
+ }
- tmp = tmp.childNodes[2];
+ tmp = tmp.firstChild;
- if (!tmp) { //Version du 29 octobre 2008 - BOUTONS DU HAUT
+ tmp = tmp.childNodes[2];
- var tmp = boutonxboxnode;
+ if (!tmp) { //Version du 29 octobre 2008 - BOUTONS DU HAUT
- tmp = tmp.parentNode;
+ var tmp = boutonxboxnode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.childNodes[1];
+ tmp = tmp.parentNode;
- tmp = tmp.firstChild;
+ tmp = tmp.childNodes[1];
- tmp = tmp.childNodes[2];
+ tmp = tmp.firstChild;
- }
+ tmp = tmp.childNodes[2];
- tmp = tmp.childNodes[1];
+ }
- tmp = tmp.getElementsByTagName('textarea');
+ tmp = tmp.childNodes[1];
- tmp = tmp[0];
+ tmp = tmp.getElementsByTagName('textarea');
- return tmp; */
+ tmp = tmp[0];
+ return tmp; */
+
+ } catch (e) { FireGPG_cGmail2.error(e, 'getTextarea') }
},
/*
@@ -2160,99 +2181,104 @@ Zna Vna UIb $RQa $SQa Moa
boutonxboxnode - The note with the buttons of the mails
*/
getToCcBccMail: function(dDocument,boutonxboxnode, onlyto, onlycc, onlybcc) {
- var forWho = "";
- var tmpFor = "";
+ try {
- var tmp = boutonxboxnode;
+ var forWho = "";
+ var tmpFor = "";
- /* tmp = tmp.parentNode;
+ var tmp = boutonxboxnode;
- tmp = tmp.childNodes[1];
+ /* tmp = tmp.parentNode;
- //29 septebmre 2008
- if (!tmp) {
+ tmp = tmp.childNodes[1];
- var tmp = boutonxboxnode;
+ //29 septebmre 2008
+ if (!tmp) {
- tmp = tmp.parentNode;
+ var tmp = boutonxboxnode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.childNodes[1];
+ tmp = tmp.parentNode;
- }
+ tmp = tmp.childNodes[1];
- if (!tmp) { //Version du 29 octobre 2008 - BOUTONS DU HAUT
+ }
- var tmp = boutonxboxnode;
+ if (!tmp) { //Version du 29 octobre 2008 - BOUTONS DU HAUT
- tmp = tmp.parentNode;
+ var tmp = boutonxboxnode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.parentNode;
+ tmp = tmp.parentNode;
- tmp = tmp.childNodes[1];
+ tmp = tmp.parentNode;
+ tmp = tmp.childNodes[1];
- }
- tmp = tmp.firstChild; */
+ }
- var tmp = dDocument.evaluate(".//table[contains(@class, 'cf eA')]/tbody", tmp.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
+ tmp = tmp.firstChild; */
+ var tmp = dDocument.evaluate(".//table[contains(@class, 'cf eA')]/tbody", tmp.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
- var textareas = tmp .getElementsByTagName("textarea");
+ var textareas = tmp .getElementsByTagName("textarea");
- //On cherche la boite avec les boutons
- for (var j = 0; j < textareas.length; j++) {
- if (textareas[j].getAttribute("name") == "to" || textareas[j].getAttribute("name") == "cc" || textareas[j].getAttribute("name") == "bcc") {
- forWho = forWho + " " + textareas[j].value;
+ //On cherche la boite avec les boutons
+ for (var j = 0; j < textareas.length; j++) {
+ if (textareas[j].getAttribute("name") == "to" || textareas[j].getAttribute("name") == "cc" || textareas[j].getAttribute("name") == "bcc") {
- if (onlyto && textareas[j].getAttribute("name") == "to")
- return textareas[j].value;
+ forWho = forWho + " " + textareas[j].value;
- if (onlycc && textareas[j].getAttribute("name") == "cc")
- return textareas[j].value;
+ if (onlyto && textareas[j].getAttribute("name") == "to")
+ return textareas[j].value;
- if (onlybcc && textareas[j].getAttribute("name") == "bcc")
- return textareas[j].value;
+ if (onlycc && textareas[j].getAttribute("name") == "cc")
+ return textareas[j].value;
+ if (onlybcc && textareas[j].getAttribute("name") == "bcc")
+ return textareas[j].value;
+
+ }
}
- }
- return cGmail2.extractMails(forWho);
+ return FireGPG_cGmail2.extractMails(forWho);
+
+ } catch (e) { FireGPG_cGmail2.error(e, 'getToCCbcc') }
},
extractMails: function(forWho) {
-
+ try {
//Pattern
- var reg = new RegExp('[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}', 'gi');
+ var reg = new RegExp('[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}', 'gi');
- var aMail = reg.exec(forWho);
+ var aMail = reg.exec(forWho);
- var i = 0;
- var returnList = new Array();
+ var i = 0;
+ var returnList = new Array();
- while(aMail != null)
- {
- returnList[i] = aMail;
- i++;
- aMail = reg.exec(forWho);
- }
+ while(aMail != null)
+ {
+ returnList[i] = aMail;
+ i++;
+ aMail = reg.exec(forWho);
+ }
- return returnList;
+ return returnList;
+ } catch (e) { FireGPG_cGmail2.error(e, 'ExtractMail') }
},
@@ -2261,60 +2287,61 @@ Zna Vna UIb $RQa $SQa Moa
getMailSender: function(dDocument,boutonxboxnode) {
- var tmp = boutonxboxnode;
+ try {
- var tmp = dDocument.evaluate(".//table[contains(@class, 'cf eA')]/tbody", tmp.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
+ var tmp = boutonxboxnode;
- var selects = tmp .getElementsByTagName("select");
+ var tmp = dDocument.evaluate(".//table[contains(@class, 'cf eA')]/tbody", tmp.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
+ var selects = tmp .getElementsByTagName("select");
- //On cherche la boite avec les boutons
- for (var j = 0; j < selects.length; j++) {
- if (selects[j].getAttribute("name") == "from") {
- return selects[j].value;
+ //On cherche la boite avec les boutons
+ for (var j = 0; j < selects.length; j++) {
+ if (selects[j].getAttribute("name") == "from") {
- }
- }
+ return selects[j].value;
+ }
+ }
- //Peut être en
- var selects = tmp .getElementsByClassName("ef");
- if (selects && selects[0])
- return selects[0].innerHTML.replace(/&lt;/gi, '<').replace(/&gt;/gi, '>');
+ //Peut être en
+ var selects = tmp .getElementsByClassName("ef");
- return "";
+ if (selects && selects[0])
+ return selects[0].innerHTML.replace(/&lt;/gi, '<').replace(/&gt;/gi, '>');
+ return "";
+ } catch (e) { FireGPG_cGmail2.error(e, 'getMailSender') }
},
- getMailSubject: function(dDocument,boutonxboxnode) {
+ getMailSubject: function(dDocument,boutonxboxnode) {
- var tmp = boutonxboxnode;
+ try {
+ var tmp = boutonxboxnode;
- var tmp = dDocument.evaluate(".//table[contains(@class, 'cf eA')]/tbody", tmp.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
+ var tmp = dDocument.evaluate(".//table[contains(@class, 'cf eA')]/tbody", tmp.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
- var inputs = tmp .getElementsByTagName("input");
+ var inputs = tmp .getElementsByTagName("input");
- //On cherche la boite avec les boutons
- for (var j = 0; j < inputs.length; j++) {
- if (inputs[j].getAttribute("name") == "subject") {
+ //On cherche la boite avec les boutons
+ for (var j = 0; j < inputs.length; j++) {
+ if (inputs[j].getAttribute("name") == "subject") {
- return inputs[j].value;
+ return inputs[j].value;
+ }
}
- }
-
- return "";
-
-
+ return "";
+ } catch (e) { FireGPG_cGmail2.error(e, 'getMailSubject') }
},
@@ -2331,72 +2358,70 @@ Zna Vna UIb $RQa $SQa Moa
setWriteMailContent: function(dDocument,boutonxboxnode,newText)
{
+ try {
+ if (FireGPG_cGmail2.iframeOrTextarea(dDocument,boutonxboxnode) == "iframe")
+ {
+ var iframe = FireGPG_cGmail2.getTheIframe(dDocument,boutonxboxnode);
- if (cGmail2.iframeOrTextarea(dDocument,boutonxboxnode) == "iframe")
- {
-
- var iframe = cGmail2.getTheIframe(dDocument,boutonxboxnode);
-
-
- //First, we look for a selection
- try { var select = iframe.contentWindow.getSelection(); }
- catch (e) { var select = ""; }
-
- //Autodetect
- if (select.toString() == "")
- {
- try { var select = iframe.contentWindow.document.body.innerHTML; }
- catch (e) { var select = ""; }
+ //First, we look for a selection
+ try { var select = iframe.contentWindow.getSelection(); }
+ catch (e) { var select = ""; }
- var reg=new RegExp("<", "gi");
- newText = newText.replace(reg,"&lt;");
+ //Autodetect
+ if (select.toString() == "")
+ {
+ try { var select = iframe.contentWindow.document.body.innerHTML; }
+ catch (e) { var select = ""; }
- var reg=new RegExp("\n", "gi");
- newText = newText.replace(reg,"<br>");
+ var reg=new RegExp("<", "gi");
+ newText = newText.replace(reg,"&lt;");
- if (cGmail2.noAutoReplyDetect)
- this.composeIndexOfQuote = select.length;
+ var reg=new RegExp("\n", "gi");
+ newText = newText.replace(reg,"<br>");
- iframe.contentWindow.document.body.innerHTML = newText + select.substring(this.composeIndexOfQuote, select.length) + "<br /><br />";
- }
- else
- {
- var reg=new RegExp("<", "gi");
- newText = newText.replace(reg,"&lt;");
+ if (FireGPG_cGmail2.noAutoReplyDetect)
+ this.composeIndexOfQuote = select.length;
- var reg=new RegExp("\n", "gi");
- newText = newText.replace(reg,"<br>");
+ iframe.contentWindow.document.body.innerHTML = newText + select.substring(this.composeIndexOfQuote, select.length) + "<br /><br />";
+ }
+ else
+ {
+ var reg=new RegExp("<", "gi");
+ newText = newText.replace(reg,"&lt;");
- var range = select.getRangeAt(0);
- var el = iframe.contentWindow.document.createElement("div");
+ var reg=new RegExp("\n", "gi");
+ newText = newText.replace(reg,"<br>");
- el.innerHTML = newText;
+ var range = select.getRangeAt(0);
+ var el = iframe.contentWindow.document.createElement("div");
- range.deleteContents();
- range.insertNode(el);
+ el.innerHTML = newText;
- }
+ range.deleteContents();
+ range.insertNode(el);
+ }
- } else {
- var textarea = cGmail2.getTheTextarea(dDocument,boutonxboxnode);
+ } else {
- var startPos = textarea.selectionStart;
- var endPos = textarea.selectionEnd;
- var chaine = textarea.value;
+ var textarea = FireGPG_cGmail2.getTheTextarea(dDocument,boutonxboxnode);
- // We create the new string and replace it into the focused element
- textarea.value = chaine.substring(0, startPos) + newText + chaine.substring(endPos, chaine.length);
+ var startPos = textarea.selectionStart;
+ var endPos = textarea.selectionEnd;
+ var chaine = textarea.value;
- // We select the new text.
- textarea.selectionStart = startPos;
- textarea.selectionEnd = startPos + newText.length ;
+ // We create the new string and replace it into the focused element
+ textarea.value = chaine.substring(0, startPos) + newText + chaine.substring(endPos, chaine.length);
- }
+ // We select the new text.
+ textarea.selectionStart = startPos;
+ textarea.selectionEnd = startPos + newText.length ;
+ }
+ } catch (e) { FireGPG_cGmail2.error(e, 'setWriteMailContent') }
},
@@ -2410,21 +2435,25 @@ Zna Vna UIb $RQa $SQa Moa
doc - The document of the page.
*/
getMailContent: function(i,doc) {
- var contenuMail = i;
- var range = doc.createRange();
- range.selectNode(contenuMail);
- var documentFragment = range.cloneContents();
- var s = new XMLSerializer();
- var d = documentFragment;
- var str = s.serializeToString(d);
- contenuMail = Selection.wash(str);
+
+ try {
+ var contenuMail = i;
+ var range = doc.createRange();
+ range.selectNode(contenuMail);
+ var documentFragment = range.cloneContents();
+ var s = new XMLSerializer();
+ var d = documentFragment;
+ var str = s.serializeToString(d);
+ contenuMail = FireGPG_Selection.wash(str);
- //Remove stranges A0
- var reg=new RegExp(unescape('%A0'), "gi");
- contenuMail = contenuMail.replace(reg," ");
+ //Remove stranges A0
+ var reg=new RegExp(unescape('%A0'), "gi");
+ contenuMail = contenuMail.replace(reg," ");
- return contenuMail;
+ return contenuMail;
+
+ } catch (e) { FireGPG_cGmail2.error(e, 'getMailContent') }
},
@@ -2439,31 +2468,35 @@ Zna Vna UIb $RQa $SQa Moa
*/
setMailContent: function(papai,doc,data) {
- var i = papai.getElementsByClassName("ii gt");
- i = i[0];
+ try {
+
+ var i = papai.getElementsByClassName("ii gt");
+ i = i[0];
- baseData = i.innerHTML;
+ baseData = i.innerHTML;
- fireGPGDebug(baseData);
+ fireGPGDebug(baseData);
- before = baseData.substring(0,baseData.indexOf("-----BEGIN PGP MESSAGE-----"));
+ before = baseData.substring(0,baseData.indexOf("-----BEGIN PGP MESSAGE-----"));
- end = baseData.indexOf("-----END PGP MESSAGE-----") + "-----END PGP MESSAGE-----".length;
+ end = baseData.indexOf("-----END PGP MESSAGE-----") + "-----END PGP MESSAGE-----".length;
- if (end ==( "-----END PGP MESSAGE-----".length -1))
- end = baseData.indexOf('<a class="vem"');
+ if (end ==( "-----END PGP MESSAGE-----".length -1))
+ end = baseData.indexOf('<a class="vem"');
- after = baseData.substring(end, baseData.length);
+ after = baseData.substring(end, baseData.length);
- img = "<img src=\""+IMG_ENCRYPTED+"\" alt=\"" +IMG_ENCRYPTED2+"\" onmouseout=\"a = this.alt; this.alt=this.src; this.src=a; this.title = ''; \" onmouseover=\"if (this.title == '') { a = this.alt; this.alt=this.src; this.src=a; this.title = 'FireGPG'; }\">";
+ img = "<img src=\""+FGPG_IMG_ENCRYPTED+"\" alt=\"" +FGPG_IMG_ENCRYPTED2+"\" onmouseout=\"a = this.alt; this.alt=this.src; this.src=a; this.title = ''; \" onmouseover=\"if (this.title == '') { a = this.alt; this.alt=this.src; this.src=a; this.title = 'FireGPG'; }\">";
- data = data.replace(/(.{1,70})(?:\s|$)/g,"$1<br/>")
+ data = data.replace(/(.{1,70})(?:\s|$)/g,"$1<br/>")
- data = data.replace(/<br \/>/gi, '<br/>');
- data = data.replace(/ /gi, '&nbsp;');
+ data = data.replace(/<br \/>/gi, '<br/>');
+ data = data.replace(/ /gi, '&nbsp;');
- i.innerHTML = before + img + "<br /><br />" + data + "<br />" + img + after;
+ i.innerHTML = before + img + "<br /><br />" + data + "<br />" + img + after;
+
+ } catch (e) { FireGPG_cGmail2.error(e, 'setMailContent') }
},
@@ -2494,10 +2527,10 @@ Zna Vna UIb $RQa $SQa Moa
if (usegmail == true) {
if (document.getElementById("appcontent"))
- document.getElementById("appcontent").addEventListener("DOMContentLoaded", cGmail2.pageLoaded, false);
+ document.getElementById("appcontent").addEventListener("DOMContentLoaded", FireGPG_cGmail2.pageLoaded, false);
else
- document.getElementById("browser_content").addEventListener("DOMContentLoaded", cGmail2.pageLoaded, false);
- //window.addEventListener("unload", function() {cGmail2.listenerUnload()}, false);
+ document.getElementById("browser_content").addEventListener("DOMContentLoaded", FireGPG_cGmail2.pageLoaded, false);
+ //window.addEventListener("unload", function() {FireGPG_cGmail2.listenerUnload()}, false);
try { var nonosign = prefs.getBoolPref("gmail_no_sign_off"); }
catch (e) { var nonosign = false; }
@@ -2524,17 +2557,17 @@ Zna Vna UIb $RQa $SQa Moa
catch (e) { var b_use_select_s = false; }
- cGmail2.b_sign = b_sign;
- cGmail2.b_sign_s = b_sign_s;
- cGmail2.b_psign = b_psign;
- cGmail2.b_psign_s = b_psign_s;
- cGmail2.b_crypt = b_crypt;
- cGmail2.b_crypt_s = b_crypt_s;
- cGmail2.b_signcrypt = b_signcrypt;
- cGmail2.b_signcrypt_s = b_signcrypt_s;
- cGmail2.b_use_select_s = b_use_select_s; */
+ FireGPG_cGmail2.b_sign = b_sign;
+ FireGPG_cGmail2.b_sign_s = b_sign_s;
+ FireGPG_cGmail2.b_psign = b_psign;
+ FireGPG_cGmail2.b_psign_s = b_psign_s;
+ FireGPG_cGmail2.b_crypt = b_crypt;
+ FireGPG_cGmail2.b_crypt_s = b_crypt_s;
+ FireGPG_cGmail2.b_signcrypt = b_signcrypt;
+ FireGPG_cGmail2.b_signcrypt_s = b_signcrypt_s;
+ FireGPG_cGmail2.b_use_select_s = b_use_select_s; */
- cGmail2.nonosign = nonosign;
+ FireGPG_cGmail2.nonosign = nonosign;
try { var default_sign = prefs.getBoolPref("gmail_select_by_default_sign"); }
catch (e) { var default_sign = false; }
@@ -2548,31 +2581,31 @@ Zna Vna UIb $RQa $SQa Moa
try { var default_attachements = prefs.getBoolPref("gmail_select_by_default_attachements"); }
catch (e) { var default_attachements = false; }
- cGmail2.default_sign = default_sign;
- cGmail2.default_encrypt = default_encrypt;
- cGmail2.default_inline = default_inline;
- cGmail2.default_attachements = default_attachements;
+ FireGPG_cGmail2.default_sign = default_sign;
+ FireGPG_cGmail2.default_encrypt = default_encrypt;
+ FireGPG_cGmail2.default_inline = default_inline;
+ FireGPG_cGmail2.default_attachements = default_attachements;
try { var noAutoDecrypt = prefs.getBoolPref("gmail_disable_auto_decryption"); }
catch (e) { var noAutoDecrypt = false; }
- cGmail2.noAutoDecrypt = noAutoDecrypt;
+ FireGPG_cGmail2.noAutoDecrypt = noAutoDecrypt;
try { var noAutoReplyDetect = prefs.getBoolPref("gmail_disable_detection_of_reply_for_signs"); }
catch (e) { var noAutoReplyDetect = false; }
- cGmail2.noAutoReplyDetect = noAutoReplyDetect;
+ FireGPG_cGmail2.noAutoReplyDetect = noAutoReplyDetect;
try { var decryptOnReply = prefs.getBoolPref("gmail_decrypt_when_reply"); }
catch (e) { var decryptOnReply = false; }
- cGmail2.decryptOnReply = decryptOnReply;
+ FireGPG_cGmail2.decryptOnReply = decryptOnReply;
try { var showUserInfo = prefs.getBoolPref("gmail_show_user_info_for_signs"); }
catch (e) { var showUserInfo = false; }
- cGmail2.showUserInfo = showUserInfo;
+ FireGPG_cGmail2.showUserInfo = showUserInfo;
try { var encryptIfDecrypted = prefs.getBoolPref("gmail_keep_encrypted_mail"); }
catch (e) { var encryptIfDecrypted = false; }
- cGmail2.encryptIfDecrypted = encryptIfDecrypted;
+ FireGPG_cGmail2.encryptIfDecrypted = encryptIfDecrypted;
@@ -2608,7 +2641,7 @@ Zna Vna UIb $RQa $SQa Moa
var tmp_string = final_location.substring(final_location.indexOf("&ik=") + 4, final_location.length);
var ik = tmp_string.substring(0, tmp_string.indexOf('&'));
- cGmail2.ik = ik;
+ FireGPG_cGmail2.ik = ik;
fireGPGDebug("ik:" + ik);
@@ -2617,8 +2650,8 @@ Zna Vna UIb $RQa $SQa Moa
//Fing base url
if ((final_location.indexOf("http://mail.google.com/mail/?ui=2") == 0 || final_location.indexOf("https://mail.google.com/mail/?ui=2") == 0)) {
- cGmail2.baseUrl = doc.location.href.substring(0, doc.location.href.indexOf("?ui=2"));
-fireGPGDebug("baseurl:" + cGmail2.baseUrl);
+ FireGPG_cGmail2.baseUrl = doc.location.href.substring(0, doc.location.href.indexOf("?ui=2"));
+fireGPGDebug("baseurl:" + FireGPG_cGmail2.baseUrl);
}
//Add windowopen rewriter
@@ -2642,7 +2675,7 @@ fireGPGDebug("try to add");
//http://mail.google.com/mail/?ui=2&ik=8e7a8837c3&
- if (final_location.indexOf(GMAIL_MAIN_DOC_URL) == 0 || final_location .indexOf(GMAIL_MAIN_DOC_URL2) == 0) {
+ if (final_location.indexOf(FGPG_GMAIL_MAIN_DOC_URL) == 0 || final_location .indexOf(FGPG_GMAIL_MAIN_DOC_URL2) == 0) {
fireGPGDebug("activated");
doc.getElementsByClassName = function(className, tag) {
@@ -2673,23 +2706,23 @@ fireGPGDebug("activated");
- cGmail2.current = cGmail2.current + 1;
+ FireGPG_cGmail2.current = FireGPG_cGmail2.current + 1;
- cGmail2.doc[cGmail2.current] = doc;
+ FireGPG_cGmail2.doc[FireGPG_cGmail2.current] = doc;
/*var tmpListener = new Object;
tmpListener = null;
- tmpListener = new cGmail2.clickOnDock(cGmail2.current)
+ tmpListener = new FireGPG_cGmail2.clickOnDock(FireGPG_cGmail2.current)
doc.addEventListener('mousedown',tmpListener,true);*/
var tmpListener = new Object;
tmpListener = null;
- tmpListener = new cGmail2.whenNodeIsInsered(cGmail2.current)
+ tmpListener = new FireGPG_cGmail2.whenNodeIsInsered(FireGPG_cGmail2.current)
doc.addEventListener('DOMNodeInserted',tmpListener,true);
- //setTimeout("cGmail2.checkDoc("+cGmail2.current+")", 5000);
+ //setTimeout("FireGPG_cGmail2.checkDoc("+FireGPG_cGmail2.current+")", 5000);
}
@@ -2709,11 +2742,11 @@ fireGPGDebug("activated");
//
this.handleEvent = function(event) {
- if (cGmail2.docOccuped[this._docid] == undefined || cGmail2.docOccuped[this._docid] == false)
+ if (FireGPG_cGmail2.docOccuped[this._docid] == undefined || FireGPG_cGmail2.docOccuped[this._docid] == false)
{
- setTimeout("cGmail2.checkDoc("+this._docid+")", 5000);
- cGmail2.docOccuped[this._docid] = true;
+ setTimeout("FireGPG_cGmail2.checkDoc("+this._docid+")", 5000);
+ FireGPG_cGmail2.docOccuped[this._docid] = true;
}
@@ -2734,12 +2767,12 @@ fireGPGDebug("activated");
if (event.target && event.target.className &&
(event.target.className == "HprMsc" || event.target.className.indexOf("y4Wv6d") != -1 || event.target.className == "XoqCub" ||//load old mail | compose | Mail widnow
event.target.className.indexOf("HprMsc") != -1 || event.target.className.indexOf("CoUvaf") != -1 || event.target.className.indexOf("T1HY1") != -1 || event.target.className.indexOf("cf hX") != -1 || event.target.className.indexOf("Bs nH iY") != -1) && //load old mail2 | compose2 | Mail widnow2 | bouton d'un mail
- (cGmail2.docOccuped[this._docid] == undefined || cGmail2.docOccuped[this._docid] == false))
+ (FireGPG_cGmail2.docOccuped[this._docid] == undefined || FireGPG_cGmail2.docOccuped[this._docid] == false))
{
fireGPGDebug("Captured !");
- cGmail2.docOccuped[this._docid] = true;
- setTimeout("cGmail2.checkDoc("+this._docid+")",1000);
+ FireGPG_cGmail2.docOccuped[this._docid] = true;
+ setTimeout("FireGPG_cGmail2.checkDoc("+this._docid+")",1000);
}
@@ -2759,218 +2792,242 @@ fireGPGDebug("activated");
*/
getMimeMailContens: function(id,doc) {
- fireGPGDebug('Starting get content', 'getMimeMailContens');
+ try {
- var elements = id.parentNode.parentNode.parentNode.parentNode.firstChild.getElementsByTagName("img");
+ fireGPGDebug('Starting get content', 'getMimeMailContens');
- actionbox = "";
+ var elements = id.parentNode.parentNode.parentNode.parentNode.firstChild.getElementsByTagName("img");
- //On cherche la boite avec les boutons
- for (var j = 0; j < elements.length; j++) {
- if (elements[j].getAttribute("class") == "hA" && elements[j].getAttribute("alt") == "") {
- actionbox = elements[j].parentNode;
- //break;
- }
- }//
+ actionbox = "";
- fireGPGDebug('Actionbox is ' + actionbox, 'getMimeMailContens');
+ //On cherche la boite avec les boutons
+ for (var j = 0; j < elements.length; j++) {
+ if (elements[j].getAttribute("class") == "hA" && elements[j].getAttribute("alt") == "") {
+ actionbox = elements[j].parentNode;
+ //break;
+ }
+ }//
+ fireGPGDebug('Actionbox is ' + actionbox, 'getMimeMailContens');
- //This is a ugly hack.
- var evt = doc.createEvent("MouseEvents");
- evt.initMouseEvent("click", true, true, window,
- 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+ //This is a ugly hack.
- var scollage = doc.documentElement.scrollTop;
- var a = actionbox.dispatchEvent(evt);
- doc.documentElement.scrollTop = scollage;
+ var evt = doc.createEvent("MouseEvents");
+ evt.initMouseEvent("click", true, true, window,
+ 0, 0, 0, 0, 0, false, false, false, false, 0, null);
- fireGPGDebug('Event dispatech (click) is ' + a, 'getMimeMailContens');
+ var scollage = doc.documentElement.scrollTop;
+ var a = actionbox.dispatchEvent(evt);
+ doc.documentElement.scrollTop = scollage;
- // return '';
- //On choppe le bouton en question
- //CHILDREN OF gv
- // act="32"
+ fireGPGDebug('Event dispatech (click) is ' + a, 'getMimeMailContens');
- papa = doc.getElementsByClassName('gv');
- papa = papa[0];
+ // return '';
+ //On choppe le bouton en question
+ //CHILDREN OF gv
+ // act="32"
- fireGPGDebug('Papa is ' + papa, 'getMimeMailContens');
+ papa = doc.getElementsByClassName('hx');
+ papa = papa[0];
- detailsElement = null;
+ fireGPGDebug('Papa is ' + papa, 'getMimeMailContens');
- /* for (var j = 0; j < papa.childNodes.length; j++) {
+ detailsElement = null;
- fireGPGDebug(papa.childNodes[j].getAttribute("act"));
+ /* for (var j = 0; j < papa.childNodes.length; j++) {
- if (papa.childNodes[j].getAttribute("act") == "32") {
- detailsElement = papa.childNodes[j];
- break;
+ fireGPGDebug(papa.childNodes[j].getAttribute("act"));
+
+ if (papa.childNodes[j].getAttribute("act") == "32") {
+ detailsElement = papa.childNodes[j];
+ break;
+ }
+ }*/
+
+ var detailsElement = doc.evaluate(".//div[@act='32']", papa, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
+
+ if (detailsElement == null) {
+ fireGPGDebug('Holy cow, no detailsElement !!!', 'getMimeMailContens',true);
+ return '';
}
- }*/
- var detailsElement = doc.evaluate(".//div[@act='32']", papa, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
+ fireGPGDebug('detailsElement is ' + detailsElement, 'getMimeMailContens');
+ doc.body.setAttribute('firegpg',"#FIREGPGCAPTURE");
- if (detailsElement == null) {
- fireGPGDebug('Holy cow, no detailsElement !!!', 'getMimeMailContens',true);
- return '';
- }
+ var evt3 = doc.createEvent("MouseEvents");
+ evt3.initMouseEvent("mousedown", true, true, window,
+ 1, 0, 0, 0, 0, false, false, false, false, 0, null);
- fireGPGDebug('detailsElement is ' + detailsElement, 'getMimeMailContens');
- doc.body.setAttribute('firegpg',"#FIREGPGCAPTURE");
+ var scollage = doc.documentElement.scrollTop;
+ detailsElement.dispatchEvent(evt3);
+ doc.documentElement.scrollTop = scollage;
- var evt3 = doc.createEvent("MouseEvents");
- evt3.initMouseEvent("mousedown", true, true, window,
- 1, 0, 0, 0, 0, false, false, false, false, 0, null);
- var scollage = doc.documentElement.scrollTop;
- detailsElement.dispatchEvent(evt3);
- doc.documentElement.scrollTop = scollage;
+ var evt3 = doc.createEvent("MouseEvents");
+ evt3.initMouseEvent("mouseup", true, true, window,
+ 1, 0, 0, 0, 0, false, false, false, false, 0, null);
+ var scollage = doc.documentElement.scrollTop;
+ detailsElement.dispatchEvent(evt3);
+ doc.documentElement.scrollTop = scollage;
- var evt3 = doc.createEvent("MouseEvents");
- evt3.initMouseEvent("mouseup", true, true, window,
- 1, 0, 0, 0, 0, false, false, false, false, 0, null);
+ var evt3 = doc.createEvent("MouseEvents");
+ evt3.initMouseEvent("click", true, true, window,
+ 1, 0, 0, 0, 0, false, false, false, false, 0, null);
- var scollage = doc.documentElement.scrollTop;
- detailsElement.dispatchEvent(evt3);
- doc.documentElement.scrollTop = scollage;
+ var scollage = doc.documentElement.scrollTop;
+ detailsElement.dispatchEvent(evt3);
+ doc.documentElement.scrollTop = scollage;
- var evt3 = doc.createEvent("MouseEvents");
- evt3.initMouseEvent("click", true, true, window,
- 1, 0, 0, 0, 0, false, false, false, false, 0, null);
+ url = doc.body.getAttribute('firegpg');
- var scollage = doc.documentElement.scrollTop;
- detailsElement.dispatchEvent(evt3);
- doc.documentElement.scrollTop = scollage;
+ fireGPGDebug('Url get is ' + url, 'getMimeMailContens');
- url = doc.body.getAttribute('firegpg');
+ if (url == "#FIREGPGCAPTURE" ) {
+ //Close popup
+ var evt4 = doc.createEvent("MouseEvents");
+ evt4.initMouseEvent("mousedown", true, true, window,
+ 0, 0, 0, 0, 0, false, false, false, false, 0, null);
- fireGPGDebug('Url get is ' + url, 'getMimeMailContens');
+ var scollage = doc.documentElement.scrollTop;
+ actionbox.dispatchEvent(evt4);
+ doc.documentElement.scrollTop = scollage;
- if (url == "#FIREGPGCAPTURE" ) {
- //Close popup
- var evt4 = doc.createEvent("MouseEvents");
- evt4.initMouseEvent("mousedown", true, true, window,
- 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+ fireGPGDebug('Waiting mode', 'getMimeMailContens');
+ return "{ERROR,WAIT}";
- var scollage = doc.documentElement.scrollTop;
- actionbox.dispatchEvent(evt4);
- doc.documentElement.scrollTop = scollage;
+ }
- fireGPGDebug('Waiting mode', 'getMimeMailContens');
- return "{ERROR,WAIT}";
+ doc.body.setAttribute('firegpg',"");
- }
+ fireGPGDebug('baseUrl is ' + FireGPG_cGmail2.baseUrl, 'getMimeMailContens');
- doc.body.setAttribute('firegpg',"");
+ if (this.messageCache == null || this.messageCache[url] == null)
+ {
+ //FireGPGMisc.getContentXHttp
+ data = FireGPGMisc.getBinContent(FireGPG_cGmail2.baseUrl + url , 5000*1024);
- fireGPGDebug('baseUrl is ' + cGmail2.baseUrl, 'getMimeMailContens');
+ // fireGPGDebug('data1 is ' + data, 'getMimeMailContens');
- if (this.messageCache == null || this.messageCache[url] == null)
- {
- //getContentXHttp
- data = getBinContent(cGmail2.baseUrl + url , 5000*1024);
+ if (data == "{MAX}") {
- // fireGPGDebug('data1 is ' + data, 'getMimeMailContens');
+ var i18n = document.getElementById("firegpg-strings");
- if (data == "{MAX}") {
+ if (confirm(i18n.getString("GmailBigMail")))
+ data = FireGPGMisc.getBinContent(FireGPG_cGmail2.baseUrl + url );
+ else
+ return '';
- var i18n = document.getElementById("firegpg-strings");
+ // fireGPGDebug('data2 is ' + data, 'getMimeMailContens');
- if (confirm(i18n.getString("GmailBigMail")))
- data = getBinContent(cGmail2.baseUrl + url );
- else
- return '';
+ }
+
+ // fireGPGDebug('finaldata is ' + data, 'getMimeMailContens');
- // fireGPGDebug('data2 is ' + data, 'getMimeMailContens');
+ var mailData = FireGPGMisc.EnigConvertToUnicode(data , 'UTF-8');
+
+ // fireGPGDebug('mailData is ' + mailData, 'getMimeMailContens');
+ // FireGPGMisc.getContentXHttp(FireGPG_cGmail2.baseUrl + url);
+
+ if (this.messageCache == null)
+ this.messageCache = { };
+
+ //this.messageCache[url ] = mailData;
+
+ return mailData;
}
+ else
+ {
+ return this.messageCache[url ];
+ }
+ } catch (e) { FireGPG_cGmail2.error(e, 'getMimeMailContent') }
- // fireGPGDebug('finaldata is ' + data, 'getMimeMailContens');
+ },
- var mailData = EnigConvertToUnicode(data , 'UTF-8');
+ setProgressMessage: function(form, text) {
+ try
+ {
+ // already closed (this also means that local variables like jsdump are probably unavailable)
+ if (!form.ownerDocument.defaultView) return;
+ // all that's needed is the form...we can go from there
+ var t = form.ownerDocument.defaultView.top;
+ var d = t.document;
+ const F = XPathResult.FIRST_ORDERED_NODE_TYPE;
+
+ var jH = d.evaluate("div[contains(@class, 'vY')]", d.body, null, F, null).singleNodeValue;
+ // used to have div[@class='jHZvnc'] but should be div[contains(@class, 'jHZvnc')], so moved around
+ var IY = d.evaluate(".//div[@class='no']", jH, null, F, null).singleNodeValue;
+ var wT = d.evaluate("div/div[contains(@class,'nH vX')]",IY, null, F, null).singleNodeValue;
+ if (!wT) wT = d.evaluate("div/div[contains(@class,'QShok')]", IY, null, F, null).singleNodeValue;
+ if (text == null)
+ {
+ wT.parentNode.style.display = "none";
+ return;
+ }
- // fireGPGDebug('mailData is ' + mailData, 'getMimeMailContens');
- // getContentXHttp(cGmail2.baseUrl + url);
+ wT.parentNode.style.display = "";
+ FireGPG_stUtil.removeClassName(jH, "nq");
- if (this.messageCache == null)
- this.messageCache = { };
+ // <div class="IY0d9c"><div class="XoqCub EGSDee" style="width: 66px;"><div class="SsbSQb L4XNt"><span class="hdgibf">Loading...</span></div></div><div class="XoqCub EGSDee" style="width: 0px;"/></div>
+ var hd = d.evaluate(".//span[@class='v1']", wT, null, F, null).singleNodeValue;
+ if (!hd)
+ {
+ // does not exist yet; this is the first time.
+ var EGSDee = d.evaluate(".//div[@class='no']/div[contains(@class, 'nH nn') and position()=1]", wT, null, F, null).singleNodeValue;
+ hd = d.createElement("span");
+ hd.className = "v1";
+ var SsbSQb_L4XNt = d.createElement("div");
+ SsbSQb_L4XNt.className = "vZ v3";
+ SsbSQb_L4XNt.appendChild(hd);
+ EGSDee.appendChild(SsbSQb_L4XNt);
+ }
+ hd.innerHTML = text;
+ wT.parentNode.style.display = ""; // need to enable to get the right sizes
+ var ow = hd.offsetWidth; // original width
+ var u; // temporary variable
+ ow += 2;
+ (u = hd.parentNode.parentNode).style.width = ow + "px";
+ u.parentNode.parentNode.style.width = ow + "px";
+
+ ow += 8;
+ var owp = ow + "px";
+ wT.parentNode.style.width = owp;
+ wT.style.width = owp;
+ wT.firstChild.style.width = owp;
+
+ // now deal with equidistant sizing
+ wT.parentNode.previousSibling.style.width = wT.parentNode.nextSibling.style.width = Math.floor((IY.parentNode.offsetWidth - ow)/2).toString() + "px";
+ }
+ catch (e)
+ {
+ FireGPG_cGmail2.error(e, 'setProgressMessage')
+ }
+ }, // end setProgressMessage
- //this.messageCache[url ] = mailData;
+ error: function(error, where) {
- return mailData;
- }
- else
- {
- return this.messageCache[url ];
- }
+ var i18n = document.getElementById("firegpg-strings");
- },
+ if (!getBrowser().contentWindow.document.getElementById('firegpg-gmail-error')) {
+try {
+ div = getBrowser().contentWindow.document.createElement('div');
+ div.setAttribute('id', 'firegpg-gmail-error');
+ div.setAttribute('title', i18n.getString('gmail_problem_message'));
+ div.setAttribute('style', "z-index: 10000; position: absolute; bottom: 0px; right: 0px; width: auto; height: auto; border: 1px red solid; background-color: #ff9999; font-size: 70%; text-align: center;");
+ div.innerHTML = '<b>FireGPG</b>: ' + i18n.getString('gmail_problem_title') + ' <a href="#" onclick="alert(document.getElementById(\'firegpg-gmail-error\').title);">' + i18n.getString('gmail_problem_detail') + '</a> <a href="http://getfiregpg.org/s/gmailstatut" target="_blank">' + i18n.getString('gmail_problem_status') + '</a> <a href="#" onclick="document.getElementById(\'firegpg-gmail-error\').style.display = \'none\'; ">' + i18n.getString('gmail_problem_close') + '</a>';
+ getBrowser().contentWindow.document.body.appendChild(div);
+} catch (e) { alert(e.lineNumber + e); }
+ }
+ getBrowser().contentWindow.document.getElementById('firegpg-gmail-error').title += '\n\n' + FireGPGMisc.htmlEncode(where + ' ' + error.fileName + ' ' + error.lineNumber + ' ' + error.message) ;
- setProgressMessage: function(form, text)
-{
- try
- {
- // already closed (this also means that local variables like jsdump are probably unavailable)
- if (!form.ownerDocument.defaultView) return;
- // all that's needed is the form...we can go from there
- var t = form.ownerDocument.defaultView.top;
- var d = t.document;
- const F = XPathResult.FIRST_ORDERED_NODE_TYPE;
-
- var jH = d.evaluate("div[contains(@class, 'vY')]", d.body, null, F, null).singleNodeValue;
- // used to have div[@class='jHZvnc'] but should be div[contains(@class, 'jHZvnc')], so moved around
- var IY = d.evaluate(".//div[@class='no']", jH, null, F, null).singleNodeValue;
- var wT = d.evaluate("div/div[contains(@class,'nH vX')]",IY, null, F, null).singleNodeValue;
- if (!wT) wT = d.evaluate("div/div[contains(@class,'QShok')]", IY, null, F, null).singleNodeValue;
- if (text == null)
- {
- wT.parentNode.style.display = "none";
- return;
- }
- wT.parentNode.style.display = "";
- stUtil.removeClassName(jH, "nq");
-
- // <div class="IY0d9c"><div class="XoqCub EGSDee" style="width: 66px;"><div class="SsbSQb L4XNt"><span class="hdgibf">Loading...</span></div></div><div class="XoqCub EGSDee" style="width: 0px;"/></div>
- var hd = d.evaluate(".//span[@class='v1']", wT, null, F, null).singleNodeValue;
- if (!hd)
- {
- // does not exist yet; this is the first time.
- var EGSDee = d.evaluate(".//div[@class='no']/div[contains(@class, 'nH nn') and position()=1]", wT, null, F, null).singleNodeValue;
- hd = d.createElement("span");
- hd.className = "v1";
- var SsbSQb_L4XNt = d.createElement("div");
- SsbSQb_L4XNt.className = "vZ v3";
- SsbSQb_L4XNt.appendChild(hd);
- EGSDee.appendChild(SsbSQb_L4XNt);
- }
- hd.innerHTML = text;
- wT.parentNode.style.display = ""; // need to enable to get the right sizes
- var ow = hd.offsetWidth; // original width
- var u; // temporary variable
- ow += 2;
- (u = hd.parentNode.parentNode).style.width = ow + "px";
- u.parentNode.parentNode.style.width = ow + "px";
-
- ow += 8;
- var owp = ow + "px";
- wT.parentNode.style.width = owp;
- wT.style.width = owp;
- wT.firstChild.style.width = owp;
-
- // now deal with equidistant sizing
- wT.parentNode.previousSibling.style.width = wT.parentNode.nextSibling.style.width = Math.floor((IY.parentNode.offsetWidth - ow)/2).toString() + "px";
- }
- catch (e)
- {
- fireGPGDebug(e, "cGmail2.setProgressMessage", true);
- }
-} // end setProgressMessage
+ fireGPGDebug(error, "cGmail2/error/" + where, true);
+
+ }
};
diff --git a/install.rdf b/install.rdf
index a1c905f..49ed7ce 100644
--- a/install.rdf
+++ b/install.rdf
@@ -6,10 +6,10 @@
em:id="toolkit@mozilla.org"
em:minVersion="1.5"
- em:maxVersion="3.5.*" />
+ em:maxVersion="3.6" />
<RDF:Description RDF:about="urn:mozilla:install-manifest"
em:id="firegpg@firegpg.team"
- em:version="0.7.8"
+ em:version="0.7.9"
em:type="2"
em:name="FireGPG"
em:description="An extension that acts as an assistant for using GPG."
diff --git a/locale/ar/1-welcome.dtd b/locale/ar/1-welcome.dtd
index c63bd76..2729574 100644
--- a/locale/ar/1-welcome.dtd
+++ b/locale/ar/1-welcome.dtd
@@ -6,7 +6,7 @@
<!ENTITY whatnext "This suggest a solution or something you should do">
<!ENTITY good "This is something good">
<!ENTITY problem "This is a problem">
-<!ENTITY advanced "This is for advanced users. If you don't understand it, don't worry and don't change it.">
+<!ENTITY advanced "هذه الخيارات للمستخدمين المتقدمين. إذا كنت لا أفهم، لا تقلق ولا تغييره">
<!ENTITY help "This means help is available. Mouse over the icon for the tooltip.">
<!ENTITY helppop "Hello, I'm the help">
<!ENTITY description "Welcome! This assistant will help you to configure FireGPG. If you're a new user it's recommended to follow it to get a working configuration. What ever you choose to do, you will be able to use the option windows to change any option later.">
diff --git a/locale/ar/2-gnupg.dtd b/locale/ar/2-gnupg.dtd
index f073399..e3d23f7 100644
--- a/locale/ar/2-gnupg.dtd
+++ b/locale/ar/2-gnupg.dtd
@@ -14,7 +14,7 @@
<!ENTITY macos "MacOs users: I don't know how, but there is a way. Google is your friend.">
<!ENTITY uncommon "Is you GnuPG installed in an uncommon location?">
<!ENTITY setpath "Please set the path to GnuPG here: ">
-<!ENTITY browse "Browse">
+<!ENTITY browse "تصفح">
<!ENTITY isfireftp "Is FireFTP installed?">
<!ENTITY fireftpproblem "FireGPG and FireFTP conflict due to the old IPC library of FireFTP.">
<!ENTITY uninstall "If FireGPG's fix doesn't work, you have to uninstall one of them to get the other working.">
diff --git a/locale/ar/3-privatekey.dtd b/locale/ar/3-privatekey.dtd
index ce080ce..9069b0d 100644
--- a/locale/ar/3-privatekey.dtd
+++ b/locale/ar/3-privatekey.dtd
@@ -5,7 +5,7 @@
<!ENTITY description "The PGP system works with a private key and a public key. You sign messages with your private key and another user verifies your signature with your public key. If they want to send to you a message, they use your public key, and you, and only you, can decrypt it with your private key.">
<!ENTITY pk "You have at least one private key in your keyring">
<!ENTITY setdk "Set a default key">
-<!ENTITY askforpk "Ask for private key">
+<!ENTITY askforpk "سؤال عن المفتاح الخاص">
<!ENTITY name "Name">
<!ENTITY id "Id">
<!ENTITY created "Created">
diff --git a/locale/ar/4-gmail.dtd b/locale/ar/4-gmail.dtd
index c4aa9e7..9a4ea33 100644
--- a/locale/ar/4-gmail.dtd
+++ b/locale/ar/4-gmail.dtd
@@ -3,13 +3,13 @@
<!ENTITY next "Next">
<!ENTITY title2 "Gmail support">
<!ENTITY description "FireGPG can be integrated with gmail: additional buttons to encrypt and/or sign mails are added and you will be able to decrypt and verify signatures of any email that contains them.">
-<!ENTITY enable "Enable gmail support">
+<!ENTITY enable "تمكين دعم جيميل">
<!ENTITY smtpok "FireGPG is able to access to the SMTP server">
<!ENTITY noauth "NB: Authentication is not tested!">
<!ENTITY noauthhelp "FireGPG will warn you when it tries to send a mail if there is a problem ">
<!ENTITY sign "Sign">
<!ENTITY encrypt "Encrypt">
-<!ENTITY atta "Attachments">
+<!ENTITY atta "مرفقات">
<!ENTITY inline "Use inline">
<!ENTITY inlinesuck "Inline is bad and not working every time. OpenPGP/Mime, as standard, should be used!">
<!ENTITY nosmtp "FireGPG isn't able to access to the SMTP server OR the request is still in progress">
diff --git a/locale/ar/6-end.dtd b/locale/ar/6-end.dtd
index 447b02f..4ccccc9 100644
--- a/locale/ar/6-end.dtd
+++ b/locale/ar/6-end.dtd
@@ -1,11 +1,11 @@
<!ENTITY title "FireGPG Assistant - Done !">
<!ENTITY title2 "Done!">
<!ENTITY description "Assistant is now done. Now you should be able to use FireGPG.">
-<!ENTITY doc "Read the documentation">
-<!ENTITY doc2 "You will find some li<x>nks on this page">
+<!ENTITY doc "إقرأ التوثيق">
+<!ENTITY doc2 "ستجد بعض الوصلات في هذه الصفحة">
<!ENTITY tr "Translate FireGPG">
<!ENTITY tr2 "Horrible mistake in your language for FireGPG? Here is the website!">
<!ENTITY help "Help FireGPG">
<!ENTITY help2 "How to contribute to FireGPG">
-<!ENTITY bug "Report a bug or ask for a new feature">
-<!ENTITY close "Close">
+<!ENTITY bug "تبليغ عن عِلّة أو السؤال عن مزايا جديدة">
+<!ENTITY close "إغلاق">
diff --git a/locale/ar/api.dtd b/locale/ar/api.dtd
index 8f991b7..a3b4d5b 100644
--- a/locale/ar/api.dtd
+++ b/locale/ar/api.dtd
@@ -1,9 +1,9 @@
<!ENTITY thitle "FireGPG Api">
<!ENTITY intro "The current page wants to use the FireGPG API.">
<!ENTITY warning1 "! Accept ONLY if you TRUST this website !">
-<!ENTITY infos "If access is granted, the website will be able to access every functions of FireGPG (encrypt, decrypt, sign, verify a signature, encrypt and sign, import and export public keys). Your password will not be stored in memory when the API is used. You\'ll be asked to type your password every time it is required.">
+<!ENTITY infos "If access is granted, the website will be able to access every functions of FireGPG (encrypt, decrypt, sign, verify a signature, encrypt and sign, import and export public keys). Your password will not be stored in memory when the API is used. You'll be asked to type your password every time it is required.">
<!ENTITY warning2 "! You will allow non-https trafic. This is dangerous. !">
-<!ENTITY domain "The domain">
+<!ENTITY domain "النطاق">
<!ENTITY website "The website">
<!ENTITY page "The page">
<!ENTITY can-access "Can access">
diff --git a/locale/ar/firegpg.dtd b/locale/ar/firegpg.dtd
index 108a5b3..bd004b6 100644
--- a/locale/ar/firegpg.dtd
+++ b/locale/ar/firegpg.dtd
@@ -56,3 +56,5 @@
<!ENTITY firegpgContext.labelFiles "Files operations">
<!ENTITY firegpgMenu.labelFiles "Files operations">
<!ENTITY firegpgMenu.labelHashs "Hashes">
+<!ENTITY parseAgain "Parse (again) this page.">
+<!ENTITY update-avaiable "An update of FireGPG is available">
diff --git a/locale/ar/firegpg.properties b/locale/ar/firegpg.properties
index a265ea8..7a86eae 100644
--- a/locale/ar/firegpg.properties
+++ b/locale/ar/firegpg.properties
@@ -55,8 +55,8 @@ decrypt=Decrypt
verify=Verify
unverified=Unverified
key-block=PGP Public Key
-choosePrivateKeyTitle=FireGPG - private key
-choosePrivateKeyDescription=Select the private key
+choosePrivateKeyTitle=فاير جي.بي.جي - مفتاح خاص
+choosePrivateKeyDescription=حدد المفتاح الخاص
autosave-disabled=Autosave disabled
verifFailedGeneral=could not be verified.
verifFailedFalse=signed with an invalid signature.
@@ -78,7 +78,7 @@ keyRecived=Key fetched from server!
keyFetchError=Error, key not imported!
keyExported=Key exported!
keyNotExported=Unknow error...
-autoFeetch=You don't have the public key to verify this signature. Do you want to try to fetch it from the key server ?
+autoFeetch=لم يكن لديك المفتاح العام للتحقق من هذا التوقيع. هل ترغب في محاولة لتحميل مفتاح رئيسي من خادم؟
trustChanged=Trust changed!
trustUndef=Undefined
trustDont=NO
@@ -105,9 +105,9 @@ sure-revoke-key=Are you sure? Your key will be revoked!
keyrevoked=Key revoked!
nameTooShort=Name is too short
wrongEmail=Email not valid
-entername=Please enter a name (at least 5 characters)
-enteremail=Enter a VALID email
-entercomment=Enter a comment (optional)
+entername=من فضلك أدخل إسماً (5 أحرف غلى الأقل)
+enteremail=أدخل بريد إلكتروني صحيح
+entercomment=أدخل تعليق (إختياري)
uidadded=New user ID added!
uidnotadded=Error, new user ID not added. Wrong password?
sure-revoke-uid=Are you sure? Your user ID will be revoked!
@@ -128,14 +128,14 @@ GmailCreatingMail=FireGPG is creating your mail...
GmailErrorMail={FireGPG} Error : Mail not sent!
GmailSendingMail=FireGPG is sending your mail...
Authrequired=Authentication Required
-Enterpassword=Enter password for
-Badpassword=Bad Password
+Enterpassword=أدخل كلمة مرور لـ
+Badpassword=كلمة مرور زائفة
Enternewpassword=The SMTP server did not accept your password. Do you want to retry with a different password?
SmtpError=Error: Your email message was not sent successfully. The error message received was:
MessageSend=Your message has been sent using FireGPG!
GmailA=Attachments
autowrap-warp=Warp
-autowrap-ignore=Ignore
+autowrap-ignore=تجاهل
autowrap-question=It seems you want to sign the message body of a webmail (%w). Do you want to wrap your text (it will result in better signings) ?
do-not-ask-again=Do not ask again
OnlyASubPart=! WARNING ! This applies to only a subpart of this mail ! %wDisplay part%w2
@@ -143,7 +143,7 @@ SaveAS=Save as
decryptedfile=FireGPG decrypted file
firegpgencrypted=FireGPG encrypted file
OnlyASubPart2=This apply only for a subpart ! Click to display the subpart.
-error=Error
+error=خطأ
noDataFromServer=No data from the server. Try to refresh the page.
emailDecrypted=This email was decrypted.
decryptedMail=Decrypted mail
@@ -180,4 +180,11 @@ inline-desactivate-for-this-site=Deactivate inline for this site
inline-tmp-activate-for-this-page=Temporarily activate inline on this page
inline-tmp-desactivate-for-this-page=Temporarily deactivate inline on this page
comfirm-api-access-with-agent=Current : Confirm access from %1 to the API with the password returned by gpg-agent ?
-api-not-allows=Not allowed to register!
+api-not-allows=غير مسموح بالتسجيل!
+differentPassword=Passwords are not equals !
+symetricalPass2=Please enter the password again
+gmail_problem_message=There is a problem with Gmail's integration of FireGPG. Please check the status page and/or report the following errors:
+gmail_problem_title=Gmail support seems broken.
+gmail_problem_detail=Details
+gmail_problem_status=Status's page
+gmail_problem_close=Close
diff --git a/locale/ar/hash.dtd b/locale/ar/hash.dtd
index 8be201c..f8dc19f 100644
--- a/locale/ar/hash.dtd
+++ b/locale/ar/hash.dtd
@@ -1,5 +1,5 @@
-<!ENTITY thitle "Compute hashes of fles">
+<!ENTITY thitle "Compute hashes of files">
<!ENTITY result "Result:">
-<!ENTITY browse "Select a file">
+<!ENTITY browse "حدد ملفاً">
<!ENTITY hash "Type:">
<!ENTITY copy "Copy hash to clipboard">
diff --git a/locale/ar/keymanager.dtd b/locale/ar/keymanager.dtd
index 6e15125..788c2ef 100644
--- a/locale/ar/keymanager.dtd
+++ b/locale/ar/keymanager.dtd
@@ -26,6 +26,7 @@
<!ENTITY revokeRemplaced "Key is superseded">
<!ENTITY revokeNotUsed "Key is no longer used">
<!ENTITY userid-button "User ID">
-<!ENTITY add "Add">
-<!ENTITY delete "Delete">
+<!ENTITY add "إضافة">
+<!ENTITY delete "حذف">
<!ENTITY revoke "Revoke">
+<!ENTITY fingerprint-button "Fingerprint">
diff --git a/locale/ar/newkey.dtd b/locale/ar/newkey.dtd
index 390ea98..a8d6673 100644
--- a/locale/ar/newkey.dtd
+++ b/locale/ar/newkey.dtd
@@ -1,8 +1,8 @@
<!ENTITY newkey "FireGPG - new key">
<!ENTITY warningaboutgeneeration "Warning! Key generation can take a lot of time, and will freeze Firefox. Do something else while key is generated to create more entropy.">
<!ENTITY name-message "Name">
-<!ENTITY email-message "Email">
-<!ENTITY comment-message "Comment">
+<!ENTITY email-message "بريد إلكتروني">
+<!ENTITY comment-message "تعليق">
<!ENTITY password1-message "Password">
<!ENTITY password2-message "Repeat password">
<!ENTITY keyneverexpire "The key never expires">
@@ -10,7 +10,7 @@
<!ENTITY expire-year "years">
<!ENTITY expire-month "months">
<!ENTITY expire-days "days">
-<!ENTITY advancedoptions "Advanced options">
+<!ENTITY advancedoptions "خيارات متقدمة">
<!ENTITY keylenght-message "Key length">
<!ENTITY keytype-message "Key type">
<!ENTITY generate-button "Generate key">
diff --git a/locale/ar/prefwindow.dtd b/locale/ar/prefwindow.dtd
index e44dfef..ec481fa 100644
--- a/locale/ar/prefwindow.dtd
+++ b/locale/ar/prefwindow.dtd
@@ -68,11 +68,11 @@
<!ENTITY decrypt-when-reply "Decrypt content when reply">
<!ENTITY gmail-buton-attachements-checkbox "Attachments">
<!ENTITY autorwap-liste-action.label "Action">
-<!ENTITY autorwap-liste-domain.label "Webmail">
-<!ENTITY autowrap_list.label "Automatic answers (double-click to remove) :">
+<!ENTITY autorwap-liste-domain.label "بريد الوب">
+<!ENTITY autowrap_list.label "أجوبة تلقائية (نقر مزدوج للإزالة) :">
<!ENTITY paneautowrap.title "Autowrap">
<!ENTITY gmail-show-user-info-for-signs-checkbox "Show user data for good signatures">
-<!ENTITY gmail-keep-encrypted-mail "Encrypt reply of encrypted mails">
+<!ENTITY gmail-keep-encrypted-mail "Encrypt replies to encrypted emails">
<!ENTITY gmail-smtp-no-auth-checkbox "Disable SMTP authentication">
<!ENTITY dont_ask_to_download_key "Don't try to download missing keys">
<!ENTITY keyserverproxy-message "Proxy to use for HTTP and HKP keyservers: ">
diff --git a/locale/ar/searchkey.dtd b/locale/ar/searchkey.dtd
index be6f646..b8e50e0 100644
--- a/locale/ar/searchkey.dtd
+++ b/locale/ar/searchkey.dtd
@@ -1,5 +1,5 @@
<!ENTITY keyimporter "Import key from server">
-<!ENTITY close-button "Close">
+<!ENTITY close-button "إغلاق">
<!ENTITY import-button "Import selected keys">
<!ENTITY search-button "Search">
<!ENTITY search-description "Search for :">
diff --git a/locale/ca/3-privatekey.dtd b/locale/ca/3-privatekey.dtd
index 31e1d78..2d7515f 100644
--- a/locale/ca/3-privatekey.dtd
+++ b/locale/ca/3-privatekey.dtd
@@ -2,7 +2,7 @@
<!ENTITY stop "">
<!ENTITY next "Proper">
<!ENTITY title2 "Clau privada">
-<!ENTITY description "El sistema PGP treballa amb una clau privada i una de pública. Firmes missatges amb la teva clau privada i els altres usuaris verifiquen la teva signatura amb la teva clau pública. Si volen enviar-te un missatge, utilitzen la teva clau pública, i tu, i només tu, pots desencriptar-lo amb la teva clau privada.">
+<!ENTITY description "El sistema PGP treballa amb una clau privada i una de pública. Firmes missatges amb la teva clau privada i els altres usuaris verifiquen la teva signatura amb la teva clau pública. Si volen enviar-te un missatge, utilitzen la teva clau pública, i tu, i només tu, pots desxifrar-lo amb la teva clau privada.">
<!ENTITY pk "Tens com a mínim una clau privada al teu clauer">
<!ENTITY setdk "Estableix una clau per defecte">
<!ENTITY askforpk "Pregunta la clau privada">
diff --git a/locale/ca/4-gmail.dtd b/locale/ca/4-gmail.dtd
index 6acf8fc..fd9fc99 100644
--- a/locale/ca/4-gmail.dtd
+++ b/locale/ca/4-gmail.dtd
@@ -2,13 +2,13 @@
<!ENTITY stop "Para">
<!ENTITY next "Proper">
<!ENTITY title2 "Suport Gmail">
-<!ENTITY description "FireGPG pot integrar-se amb Gmail: S'afegeixen botons addicionals per a encriptar i/o signar e-mails, i podràs desencriptar i verificar signatures dels e-mails rebuts.">
+<!ENTITY description "FireGPG pot integrar-se amb Gmail: S'afegeixen botons addicionals per a xifrar i/o signar e-mails, i podràs desxifrar i verificar signatures dels correus rebuts.">
<!ENTITY enable "Habilita suport de Gmail">
<!ENTITY smtpok "FireGPG pot accedir el servidor SMTP">
<!ENTITY noauth "NB: L'autenticació no s'ha provat!">
<!ENTITY noauthhelp "FireGPG t'avisarà si hi ha un problema quan miri d'enviar un e-mail">
<!ENTITY sign "Signa">
-<!ENTITY encrypt "Encripta">
+<!ENTITY encrypt "Xifra">
<!ENTITY atta "Adjunts">
<!ENTITY inline "Utilitza &quot;Inline&quot;">
<!ENTITY inlinesuck "&quot;Inline&quot; és dolent i no funciona sempre. S'hauria d'utilitzar, com a estàndard, OpenPGP/Mime!">
diff --git a/locale/ca/api.dtd b/locale/ca/api.dtd
index fae86bc..8a79f57 100644
--- a/locale/ca/api.dtd
+++ b/locale/ca/api.dtd
@@ -1,7 +1,7 @@
<!ENTITY thitle "FireGPG Api">
<!ENTITY intro "La pàgina actual vol utilitzar l'API de FireGPG.">
<!ENTITY warning1 "!!Només accepta si confies en aquest lloc web!!">
-<!ENTITY infos "Si permets l'accés, el lloc web podrà accedir a totes les funcions de FireGPG (encriptar, desencriptar, signar, verificar signatura, encriptar i signar, importar i exportar claus públiques). La teva paraula de pas no s'enmagatzemarà a memòria quan s'utilitzi l'API. S'et demanarà que introdueixis la teva paraula de pas cada vegada que es requereixi.">
+<!ENTITY infos "Si permets l'accés, el lloc web podrà accedir a totes les funcions de FireGPG (xifrar, desxifrar, signar, verificar signatura, encriptar i signar, importar i exportar claus públiques). La teva paraula de pas no s'emmagatzemarà a memòria quan s'utilitzi l'API. Se't demanarà que introdueixis la teva paraula de pas cada vegada que es requereixi.">
<!ENTITY warning2 "!!Permetràs tràfic no https. Això és perillós.!!">
<!ENTITY domain "El domini">
<!ENTITY website "El lloc web">
diff --git a/locale/ca/firegpg.dtd b/locale/ca/firegpg.dtd
index 3f5757b..f49e18b 100644
--- a/locale/ca/firegpg.dtd
+++ b/locale/ca/firegpg.dtd
@@ -3,20 +3,20 @@
<!ENTITY firegpgToolbar.tooltip "FireGPG">
<!ENTITY firegpgContext.label "FireGPG">
<!ENTITY firegpgContext.labelSign "Signa">
-<!ENTITY firegpgContext.labelCrypt "Encripta">
+<!ENTITY firegpgContext.labelCrypt "Xifratge">
<!ENTITY firegpgContext.labelVerif "Verifica">
-<!ENTITY firegpgContext.labelDecry "Desencripta">
+<!ENTITY firegpgContext.labelDecry "Desxifra">
<!ENTITY firegpgContext.labelOptions "Opcions">
<!ENTITY firegpgMenu.label "FireGPG">
<!ENTITY firegpgMenu.labelSign "Signa">
-<!ENTITY firegpgMenu.labelCrypt "Encripta">
+<!ENTITY firegpgMenu.labelCrypt "Xifra">
<!ENTITY firegpgMenu.labelVerif "Verifica">
-<!ENTITY firegpgMenu.labelDecry "Desencripta">
+<!ENTITY firegpgMenu.labelDecry "Desxifrar">
<!ENTITY firegpgMenu.labelOptions "Opcions">
<!ENTITY firegpgToolbar.labelSign "Signa">
-<!ENTITY firegpgToolbar.labelCrypt "Encripta">
+<!ENTITY firegpgToolbar.labelCrypt "Xifra">
<!ENTITY firegpgToolbar.labelVerif "Verifica">
-<!ENTITY firegpgToolbar.labelDecry "Desencripta">
+<!ENTITY firegpgToolbar.labelDecry "Desxifra">
<!ENTITY firegpgToolbar.labelOptions "Opcions">
<!ENTITY firegpgMenu.labelErase "Neteja la contrasenya en memòria">
<!ENTITY firegpgContext.labelErase "Neteja la contrasenya en memòria">
@@ -37,12 +37,12 @@
<!ENTITY firegpgContext.labelEditeur "Obre l'editor">
<!ENTITY firegpgMenu.labelEditeur "Obre l'editor">
<!ENTITY firegpgToolbar.labelEditeur "Obre l'editor">
-<!ENTITY firegpgContext.labelCryptSign "Signar i Encriptar">
-<!ENTITY firegpgMenu.labelCryptSign "Signar i Encriptar">
-<!ENTITY firegpgToolbar.labelCryptSign "Signar i Encriptar">
-<!ENTITY firegpgToolbar.labelSymCrypt "Encriptació simètrica">
-<!ENTITY firegpgContext.labelSymCrypt "Encriptació simètrica">
-<!ENTITY firegpgMenu.labelSymCrypt "Encriptació simètrica">
+<!ENTITY firegpgContext.labelCryptSign "Signar i Xifrar">
+<!ENTITY firegpgMenu.labelCryptSign "Signar i xifrar">
+<!ENTITY firegpgToolbar.labelCryptSign "Signar i xifrar">
+<!ENTITY firegpgToolbar.labelSymCrypt "Xifratge simètric">
+<!ENTITY firegpgContext.labelSymCrypt "Xifratge simètric">
+<!ENTITY firegpgMenu.labelSymCrypt "Xifratge simètric">
<!ENTITY firegpgContext.labelClearSign "Neteja la signatura">
<!ENTITY firegpgToolbar.labelClearSign "Neteja la signatura">
<!ENTITY firegpgMenu.labelClearSign "Neteja la signatura">
@@ -56,3 +56,5 @@
<!ENTITY firegpgContext.labelFiles "Operacions amb fitxers">
<!ENTITY firegpgMenu.labelFiles "Operacions amb fitxers">
<!ENTITY firegpgMenu.labelHashs "Hashes">
+<!ENTITY parseAgain "Analitza (altre cop) aquesta pàgina.">
+<!ENTITY update-avaiable "Hi ha una actualització de FireGPG">
diff --git a/locale/ca/firegpg.properties b/locale/ca/firegpg.properties
index c740810..1479b92 100644
--- a/locale/ca/firegpg.properties
+++ b/locale/ca/firegpg.properties
@@ -1,9 +1,9 @@
signFailed=La signatura ha fallat a causa d'un error desconegut. Pot ser que no hagi configurat cap clau per defecte; comprovi que n'ha seŀlecionat una a la finestra de configuració del FireGPG.
signFailedPassword=La signatura ha fallat; la contrasenya especificada és incorrecte.
verifFailed=No es pot verificar aquest missatge.
-cryptFailed=L'encriptació ha fallat per un motiu desconegut.
-decryptFailed=La desencriptació ha fallat per un motiu desconegut.
-decryptFailedPassword=La desencriptació ha fallat perquè ha especificat una contrasenya incorrecta.
+cryptFailed=Xifratge fallit. Error desconegut
+decryptFailed=El desxifrat ha fallat per un motiu desconegut.
+decryptFailedPassword=El desxifrat ha fallat perquè ha especificat una contrasenya incorrecta.
passwordDialogEnterPrivateKey=Introdueixi la seva contrasenya privada:
youMustEnterPassword=Ha d'introduir una contrasenya!
choosePublicKeyTitle=FireGPG - Clau Publica
@@ -20,12 +20,12 @@ noGPGData=La teva seŀleció no conté cap dada GPG vàlida (per a aquesta opera
fileSelectorSelectFile=Seŀlecioni un fitxer
GMailS=Signa
GMailSS=Signa i Envia
-GMailC=Encripta
-GMailCS=Encripta i Envia
+GMailC=Xifra
+GMailCS=Xifra i envia
GMailSOK=Signatura vàlida de
GMailNoS=No s'ha trobat cap signatura en aquest missatge!
GMailSErr=La primera signatura d'aquest missatge no és vàlida!
-GMailD=Desencripta aquest missatge
+GMailD=Desxifra aquest missatge
gmailSelectError=Seŀlecioni una part del seu missatge!
exportFailed=L'exportació ha fallat per un error desconegut.
editorTitle=Editor del FireGPG.
@@ -35,23 +35,23 @@ whatIsNewDescription=Novetats del FireGPG: (S'ha enviat un ping anònim a l'equi
newVersionAlert=Hi ha una nova versió del FireGPG disponible, vols actualitzar-lo ara?
turn-off-updates-w1=ATENCIÓ: Et recomanem que no apaguis les actualitzacions automatiques si no pots actualitzar FireGPG amb Firefox o si no verifiques periòdicament les noves versions de l'extensió.
turn-off-updates-w2=Estas segur?Et recomanem ho mantiguis actiu. Serveix per mantenir FireGPG actualitzat, que encara es beta i podria tenir fallos de seguretat.
-cryptAndSignFailedPass=Ho sento, però signar i encriptar ha fallat
+cryptAndSignFailedPass=La signatura i el xifratge han fallat
cryptAndSignFailed=Ho sento, contrasenya incorrecta
-GMailSAC=Signar i Encriptar
-GMailSACS=Firma, Encripta i Envia
+GMailSAC=Signar i xifrar
+GMailSACS=Firma, xifra i envia
alreadySign=Aquest texte sembla que ja s'ha signat. Estàs segur que el vols tornar a signar?
-alreadyCrypt=Aquest texte sembla que ja està encriptat. Segur que el vols tornar a encriptar?
-GmailAddChiffred=Adjuntar un fitxer encriptat
+alreadyCrypt=Aquest text sembla que ja s'ha xifrat. Segur que el vols tornar a xifrar?
+GmailAddChiffred=Adjuntar un fitxer xifrat
signMadeThe=Fet el
keyNotFound=No es troba la clau
falseSign=Firma falsa
remove-auth-key=Estas segur d'esborrar aquesta clau ?
GmailAddChiffredSignToo=Amb una firma
manyStrings=La firma ha estat trobara en la cerca. Els resultats són :
-encrypted-message=Missatge encriptat PGP
+encrypted-message=Missatge xifrat PGP
signed-message=Missatge Signat PGP
import=Importar
-decrypt=Desencriptar
+decrypt=Desxifrar
verify=verificar
unverified=No verificat
key-block=Clau Pública PGP
@@ -67,7 +67,7 @@ verifSuccess=Aquest missatge ha estat signat amb una clau vàlida de
validSignInCrypt=S'ha trobat una signatura vàlida, amb una clau de
GMailCLS=Neteja la signatura
GMailCLSS=Neteja la signatura i envia
-symetricalPass=Per favor, introdueix una contrasenya per l'encriptació simètrica
+symetricalPass=Si us plau, introdueix una contrasenya pel xifratge simètric
private-key-block=Claudi Privada PGP
private-key-block-message=Aquest és un bloc de clau privada. Per raons de seguretat, FireGPG no importarà claus privades. Si necessites importar aquest clau, fes clic a &quot;Veure Original&quot; i importa-la utilitzant el teu gestor de claus.
fireftp_warning=Hi ha un problema amb la llibreria IPC. La llibreria s'ha carregat amb èxit, però sembla que hi ha instal·lada una versió antiga (FireFTP instal·lat?). Si cliques 'Ok', FireGPG intentarà accedir a la llibreria antiga, però pot fer que el Firefox falli. Tingues en compte que si utilitzes MacOS això es normal: simplement clica 'Ok'. Vols continuar? (Sempre pots canviar els paràmetres a opcions)
@@ -119,8 +119,8 @@ erroralreadysigned=Error: ja has signat aquesta clau
okkeysigned=Clau signada!
errorkeynosignedpassword=Error, clau no signada. Contrassenya incorrecta?
confirmsign=Estàs a punt de signar una clau! Vols continuar? Empremta dactilar de la clau:
-GMailMailWasDecrypted=Correu desencriptat!
-GMailMailWasNotDecrypted=Correu no desencriptat
+GMailMailWasDecrypted=Correu desxifrat!
+GMailMailWasNotDecrypted=Correu no desxifrat.
GmailBigMail=FireGPG està intentant descarregar un correu gran. Vols continuar?
GmailI=En línia
betterToUsePlainText=És millor utilitzar edició de text pla per les opcions que has seleccionat, vols convertir el teu text? (serà convertit, de totes formes, per FireGPG posteriorment)
@@ -140,18 +140,18 @@ autowrap-question=Sembla que vols signar el missatge d'un correu web (%w). Vols
do-not-ask-again=No tornis a demanar.
OnlyASubPart=! ULL ! Això només s'aplica a una part d'aquest correu ! %wDisplay part%w2
SaveAS=Anomena i desa
-decryptedfile=Fitxer desencriptat amb FireGPG
-firegpgencrypted=Fitxer encriptat amb FireGPG
+decryptedfile=Fitxer desxifrat amb FireGPG
+firegpgencrypted=Fitxer xifrat amb FireGPG
OnlyASubPart2=Això només s'aplica a una part! Clica per veure-la.
error=Error
noDataFromServer=No hi ha dades del servidor. Mira de refrescar la pàgina
-emailDecrypted=Aquest email ja ha estat desencriptat
-decryptedMail=Correu desencriptat
-partDecrypted=Troç desencriptat
+emailDecrypted=Aquest correu ja ha estat desxifrat.
+decryptedMail=Correu desxifrat
+partDecrypted=Tros desxifrat
goodSignFrom=Firma bona de
signedMail=Correu signat
partSigned=Troç firmat
-nothingFound=FireGPG ha comprovat aquest correu però no ha trobat signatura o contingut encriptat
+nothingFound=FireGPG ha comprovat aquest correu però no ha trobat signatura o contingut xifrat
unknowErrorCantVerify=Error desconegut, FireGPG no pot verificar aquest missatge de correu.
wrongSignature=Aquest missatge està signat, però amb una signatura dolenta.
wrongSignature2=Signatura dolenta
@@ -159,8 +159,8 @@ keyNotFound=No es troba la clau
noPublicKey=El FireGPG no pot verificar aquest email perquè no tens la clau publica de qui l'envia.
switchdirection=Canvia la direcció
trusted-block=Si aquest numero està a la barra d'estat, es un bloc FireGPG real
-notEncryptedButPlainText=Ull, el texte que acabes de desencriptar no era encriptat, tant sols texte normal (signat o no)!
-notencrypted-message=El missatge PGP NO s'ha encriptat (dades armored)
+notEncryptedButPlainText=Alerta, el text que acabes de desxifrar no era xifrat, tant sols text normal (signat o no)!
+notencrypted-message=El missatge PGP NO s'ha xifrat (dades armored)
destinationFile=Sel.lecciona fitxer de destí (no el mateix!):
sourceFile=Sel.lecciona fitxer font:
operationOnFileDone=Operació en el fitxer feta!
@@ -181,3 +181,10 @@ inline-tmp-activate-for-this-page=Activa &quot;Inline&quot; temporalment en aque
inline-tmp-desactivate-for-this-page=Desactiva &quot;Inline&quot; temporalment en aquesta pàgina
comfirm-api-access-with-agent=Confirmes l'accés de %1 a l'API amb la paraula de pas retornada per l'agent-pgp?
api-not-allows=No s'et permet registrar-te!
+differentPassword=Les paraules de pas no son iguals!
+symetricalPass2=Si et plau, entra la paraula de pas altra vegada
+gmail_problem_message=Hi ha un problema amb la integració de FireGPG amb Gmail. Si et plau, mira la pàgina d'estat i/o reporta els següents errors:
+gmail_problem_title=El suport de Gmail sembla trencat.
+gmail_problem_detail=Detalls
+gmail_problem_status=Status's full
+gmail_problem_close=Tanca
diff --git a/locale/ca/keymanager.dtd b/locale/ca/keymanager.dtd
index c4a8bfd..eff3508 100644
--- a/locale/ca/keymanager.dtd
+++ b/locale/ca/keymanager.dtd
@@ -29,3 +29,4 @@
<!ENTITY add "Afegir">
<!ENTITY delete "Eliminar">
<!ENTITY revoke "Revocar">
+<!ENTITY fingerprint-button "Empremta">
diff --git a/locale/ca/prefwindow.dtd b/locale/ca/prefwindow.dtd
index b186edc..ea7cdf0 100644
--- a/locale/ca/prefwindow.dtd
+++ b/locale/ca/prefwindow.dtd
@@ -16,12 +16,12 @@
<!ENTITY gmail-buttons-label "Botons a mostrar:">
<!ENTITY gmail-buton-sign-checkbox "Signa">
<!ENTITY gmail-buton-signsend-checkbox "Signa i Envia">
-<!ENTITY gmail-buton-crypt-checkbox "Encripta">
-<!ENTITY gmail-buton-cryptsend-checkbox "Encripta i Envia">
-<!ENTITY allvays-to-myself-checkbox "Encripta sempre a mi mateix.">
+<!ENTITY gmail-buton-crypt-checkbox "Xifra">
+<!ENTITY gmail-buton-cryptsend-checkbox "Xifra i envia">
+<!ENTITY allvays-to-myself-checkbox "Xifra sempre a mi mateix">
<!ENTITY enable-gpgauth-check.accesskey "E">
-<!ENTITY global-allow-keyring-pref.label "Desencripta sempre els missatges de Servidors Autenticats">
-<!ENTITY global-allow-keyring-check.label "Desencripta sempre missatges de Servidors Autenticats">
+<!ENTITY global-allow-keyring-pref.label "Desxifra sempre missatges de Servidors Autenticats">
+<!ENTITY global-allow-keyring-check.label "Desxifra sempre missatges de Servidors Autenticats.">
<!ENTITY global-allow-keyring-check.accesskey "A">
<!ENTITY per-domain-preferences.label "Configuració per domini">
<!ENTITY turn-off-updates "Denega FireGPG d'actualitzar-se automàticament">
@@ -31,8 +31,8 @@
<!ENTITY key-expire "Caduca">
<!ENTITY pane4.title "Gpg">
<!ENTITY gpg-add-options "Afegir arguments a la linea de comandes de GPG : (Atenció! Pot trencar GPG ! Mira la documentació)">
-<!ENTITY gmail-buton-signcrypt-checkbox "Signar i Encriptar">
-<!ENTITY gmail-buton-signcryptsend-checkbox "Signar, Encriptar i Enviar">
+<!ENTITY gmail-buton-signcrypt-checkbox "Signar i Xifrar">
+<!ENTITY gmail-buton-signcryptsend-checkbox "Singar, xifrar i enviar">
<!ENTITY firegpg-version-label.text "Versió actual de FireGPG : ">
<!ENTITY hide-expired "Amagar claus caducades">
<!ENTITY use-api "Activa el API de FIREGPG per pàgines Web (Requereix reiniciar)">
@@ -50,7 +50,7 @@
<!ENTITY hide-fireftp-message "No mostrar el missatge que avisa de la presència de l'antiga llibreria IPC">
<!ENTITY use-fireftp-workaround "Mira d'accedir al IPC amb l'API antic.">
<!ENTITY keyserver-message "Servidor de claus">
-<!ENTITY symmetric-algo "Algoritme utilitzat per encriptació simètrica. Deixa-ho en blanc per defecte. Utilitza 'gpg --version' per obtenir la llista d'algoritmes utilitzables, en la majoría de cassos tens aquestes opcions:">
+<!ENTITY symmetric-algo "Algoritme utilitzat per xifratge simètric. Deixa-ho en blanc per defecte. Utilitza 'gpg --version' per obtenir la llista d'algoritmes utilitzables, en la majoria de casos tens aquestes opcions:">
<!ENTITY gmail-new-interface "Nova interfície Gmail">
<!ENTITY gmail-select-by-default-label "Seleccionat per defecte:">
<!ENTITY gmail-buton-inline-checkbox "En línia">
@@ -61,18 +61,18 @@
<!ENTITY gmail-smtp-host "Amfitrió (smtp.gmail.com): ">
<!ENTITY gmail-smtp-port "Port (465):">
<!ENTITY gmail-smtp-use-ssl-checkbox "Utilitzar SSL:">
-<!ENTITY gmail-disable-sign-detection "Desactiva la detecció de resposta en signatura en línia(i encriptació)(sempre utilitza tot el correu)">
-<!ENTITY gmail-disable-auto-decryption "Antic comportament per desencriptació">
+<!ENTITY gmail-disable-sign-detection " Desactiva la detecció de resposta en signatura en línia (i xifratge) (sempre utilitza tot el correu)">
+<!ENTITY gmail-disable-auto-decryption "Antic comportament per desxifratge">
<!ENTITY gmail-force-from "Forçar des del valor:">
<!ENTITY gpg-special-path-values "Utilitza {$FxFolder} per tenir el directori del Firefox i {$SPACE} per tenir un espai dins un argument.">
-<!ENTITY decrypt-when-reply "Desencriptar contingut al respondre">
+<!ENTITY decrypt-when-reply "Desxifrar contingut al respondre">
<!ENTITY gmail-buton-attachements-checkbox "Arxius adjunts">
<!ENTITY autorwap-liste-action.label "Acció">
<!ENTITY autorwap-liste-domain.label "Correu web">
<!ENTITY autowrap_list.label "Respostes automàtiques (doble clic per eliminar)">
<!ENTITY paneautowrap.title "Auto ajustament">
<!ENTITY gmail-show-user-info-for-signs-checkbox "Mostra dades d'usuari per signatures correctes">
-<!ENTITY gmail-keep-encrypted-mail "Encripta la resposta de correus encriptats">
+<!ENTITY gmail-keep-encrypted-mail "Xifra la resposta de correus xifrats">
<!ENTITY gmail-smtp-no-auth-checkbox "Deshabilitar l'autenticació SMTP">
<!ENTITY dont_ask_to_download_key "No provis de descarregar claus perdudes">
<!ENTITY keyserverproxy-message "Proxy a utilitzar pels servidors de claus HTTP i HKP:">
diff --git a/locale/ca/showtext.dtd b/locale/ca/showtext.dtd
index afb042d..e4b7a16 100644
--- a/locale/ca/showtext.dtd
+++ b/locale/ca/showtext.dtd
@@ -1,10 +1,10 @@
-<!ENTITY crypt-button "Encripta">
-<!ENTITY dcrypt-button "Desencripta">
+<!ENTITY crypt-button "Xifra">
+<!ENTITY dcrypt-button "Desxifra">
<!ENTITY sign-button "Signa">
<!ENTITY verify-button "Verifica">
<!ENTITY open-button "Obre">
<!ENTITY save-button "Guarda">
-<!ENTITY cryptandsign-button "Signar i Encriptar">
+<!ENTITY cryptandsign-button "Signar i xifrar">
<!ENTITY sign-clear-button "Neteja la signatura">
-<!ENTITY symcrypt-button "Encriptació simètrica">
+<!ENTITY symcrypt-button "Xifratge simètric">
<!ENTITY closeandcopy-button "Copiar al porta-retalls">
diff --git a/locale/cs/1-welcome.dtd b/locale/cs/1-welcome.dtd
index c63bd76..6850eb9 100644
--- a/locale/cs/1-welcome.dtd
+++ b/locale/cs/1-welcome.dtd
@@ -1,12 +1,12 @@
-<!ENTITY title "FireGPG Assistant - Welcome">
-<!ENTITY skip "Skip">
-<!ENTITY next "Next">
-<!ENTITY title2 "FireGPG Assistant">
-<!ENTITY infoabout "Here is some information about icons and color used:">
-<!ENTITY whatnext "This suggest a solution or something you should do">
-<!ENTITY good "This is something good">
-<!ENTITY problem "This is a problem">
-<!ENTITY advanced "This is for advanced users. If you don't understand it, don't worry and don't change it.">
-<!ENTITY help "This means help is available. Mouse over the icon for the tooltip.">
-<!ENTITY helppop "Hello, I'm the help">
-<!ENTITY description "Welcome! This assistant will help you to configure FireGPG. If you're a new user it's recommended to follow it to get a working configuration. What ever you choose to do, you will be able to use the option windows to change any option later.">
+<!ENTITY title "FireGPG Asistent - Vítejte">
+<!ENTITY skip "Přeskočit">
+<!ENTITY next "Další">
+<!ENTITY title2 "FireGPG Asistent">
+<!ENTITY infoabout "Zde jsou informace o ikonách a použitých barvách:">
+<!ENTITY whatnext "Navrhuje řešení, nebo něco, co byste měli udělat">
+<!ENTITY good "Tohle je dobré">
+<!ENTITY problem "To je problém">
+<!ENTITY advanced "Pro pokročilé uživatele. Pokud tomu nerozumíte, nebojte se, nemusíte nic měnit.">
+<!ENTITY help "Tohle znamená, že je k dispozici nápověda. Pro zobrazení, najeďte myší na ikonu.">
+<!ENTITY helppop "Ahoj, já jsem nápověda">
+<!ENTITY description "Vítej! Tento asistent ti pomůže nakonfigurovat FireGPG. Pokud jsi nový uživatel tak je ti doporučeno sledovat ho dokud nebudeš mít fungující konfiguraci. Cokoliv co uděláš, můžeš kdykoliv změnit pomocí okna nastavení změnit.">
diff --git a/locale/cs/2-gnupg.dtd b/locale/cs/2-gnupg.dtd
index f073399..64b987b 100644
--- a/locale/cs/2-gnupg.dtd
+++ b/locale/cs/2-gnupg.dtd
@@ -1,23 +1,23 @@
-<!ENTITY title "FireGPG Assistant - GnuPG">
+<!ENTITY title "FireGPG Asistent - GnuPG">
<!ENTITY stop "Stop">
-<!ENTITY next "Next">
+<!ENTITY next "Další">
<!ENTITY title2 "GnuPG">
-<!ENTITY description "FireGPG uses GnuPG to handle any pgp operation. This means GnuPG must be installed for FireGPG to work.">
-<!ENTITY working "GnuPG seems to be accessible and working.">
-<!ENTITY specialhome "Do you want to set a custom homedir for GnuPG ?">
-<!ENTITY sethome "Set a home dir">
-<!ENTITY notworking "GnuPG doesn't work, there is a problem. Please fix this and click on next.">
-<!ENTITY isinstalled "Did you install GnuPG?">
-<!ENTITY download "You can download GnuPG here: (But any GnuPG will work)">
-<!ENTITY windows "Windows users: Click here to download gpg4win">
-<!ENTITY linux "Linux users: Please use the package shipped with your distribution, or click here for sources.">
-<!ENTITY macos "MacOs users: I don't know how, but there is a way. Google is your friend.">
-<!ENTITY uncommon "Is you GnuPG installed in an uncommon location?">
-<!ENTITY setpath "Please set the path to GnuPG here: ">
-<!ENTITY browse "Browse">
-<!ENTITY isfireftp "Is FireFTP installed?">
-<!ENTITY fireftpproblem "FireGPG and FireFTP conflict due to the old IPC library of FireFTP.">
-<!ENTITY uninstall "If FireGPG's fix doesn't work, you have to uninstall one of them to get the other working.">
-<!ENTITY strangeplateform "Are you using a strange platform?">
-<!ENTITY platform "FireGPG works only on Windows, MacOs and Linux x86 and x86_64 plateforms.">
-<!ENTITY recompile "You need to recompile the IPC library if that's the case.">
+<!ENTITY description "FireGPG používá GnuPG pro jakoukoliv pgp operaci. To znamená že GnuPG musí mít nainstalováno aby FireGPG fungovalo.">
+<!ENTITY working "GnuPG je dostupný a funguje.">
+<!ENTITY specialhome "Chcete nastavit vlastní domovský adresář pro GnuPG?">
+<!ENTITY sethome "Nastavit domovský adresář">
+<!ENTITY notworking "GnuPG nefunguje, nastal problém. Prosím opravte ho a pokračujte kliknutím na Další">
+<!ENTITY isinstalled "Instalovali jste GnuPG?">
+<!ENTITY download "Můžete stáhnout GnuPG zde: (Ale kterýkoliv GnuPG bude fungovat)">
+<!ENTITY windows "Uživatelé Windows: Klikněte zde pro stažení gpg4win">
+<!ENTITY linux "Uživatelé Linuxu: Prosím použijte balíček z vaší distribuce, nebo klikněte zde pro zdrojové kódy.">
+<!ENTITY macos "Uživatelé MacOS: Nevím jak, ale jde to. Google je váš přítel.">
+<!ENTITY uncommon "Máte GnuPG nainstalované v nebovyklém adresáři?">
+<!ENTITY setpath "Prosím zde uveďte cestu ke GnuPG:">
+<!ENTITY browse "Prohlížet">
+<!ENTITY isfireftp "Máte nainstalovaný FireFTP?">
+<!ENTITY fireftpproblem "FireGPG a FireFTP jsou v konfliktu kvůli staré IPC knihovně z FireFTP.">
+<!ENTITY uninstall "Jestli oprava FireGPG nefunguje, musíte jeden z nich odinstalovat, aby druhý fungoval.">
+<!ENTITY strangeplateform "Používáte divnou platformu?">
+<!ENTITY platform "FireGPG funguje pouze na platformách Windows, MacOS a Linux x86 a x86_64.">
+<!ENTITY recompile "Musíte překompilovat knihovnu IPC, jestli to tak je.">
diff --git a/locale/cs/3-privatekey.dtd b/locale/cs/3-privatekey.dtd
index ce080ce..9ee7a7e 100644
--- a/locale/cs/3-privatekey.dtd
+++ b/locale/cs/3-privatekey.dtd
@@ -1,17 +1,17 @@
-<!ENTITY title "FireGPG Assistant - Private key">
+<!ENTITY title "FireGPG Asistent - Soukromý klíč">
<!ENTITY stop "Stop">
-<!ENTITY next "Next">
-<!ENTITY title2 "Private key">
-<!ENTITY description "The PGP system works with a private key and a public key. You sign messages with your private key and another user verifies your signature with your public key. If they want to send to you a message, they use your public key, and you, and only you, can decrypt it with your private key.">
-<!ENTITY pk "You have at least one private key in your keyring">
-<!ENTITY setdk "Set a default key">
-<!ENTITY askforpk "Ask for private key">
-<!ENTITY name "Name">
+<!ENTITY next "Další">
+<!ENTITY title2 "Soukromý klíč">
+<!ENTITY description "PGP systém funguje se soukromým a veřejným klíčem. Podepíšeš zprávu svým soukromým klíčem a příjemce ověří podpis tvým veřejným klíčem. Pokud chtějí napsat zprávu oni tobě tak použijí tvůj veřejný klíč a ty, jenom ty, jí můžeš se svým soukromým klíčem (a heslem k němu) rozšifrovat. ">
+<!ENTITY pk "Máte alespoň jeden soukromý klíč v klíčence">
+<!ENTITY setdk "Vybrat výchozí klíč">
+<!ENTITY askforpk "Žádejte o soukromá klíč">
+<!ENTITY name "Jméno">
<!ENTITY id "Id">
-<!ENTITY created "Created">
-<!ENTITY expire "Expire">
-<!ENTITY nopk "You don't have any private keys in your keyring">
-<!ENTITY genpk "Generate a private and a public key">
-<!ENTITY gen "Generate">
-<!ENTITY importpk "Import a private key">
-<!ENTITY import "Import">
+<!ENTITY created "Vytvořeno">
+<!ENTITY expire "Vyprší">
+<!ENTITY nopk "Nemáte žádný soukromý klíč v klíčence">
+<!ENTITY genpk "Vytvořit soukromý a veřejný klíč">
+<!ENTITY gen "Vytvořit">
+<!ENTITY importpk "Importovat soukromý klíč">
+<!ENTITY import "Importovat">
diff --git a/locale/cs/4-gmail.dtd b/locale/cs/4-gmail.dtd
index c4aa9e7..7d10150 100644
--- a/locale/cs/4-gmail.dtd
+++ b/locale/cs/4-gmail.dtd
@@ -1,22 +1,22 @@
-<!ENTITY title "FireGPG Assistant - Gmail">
+<!ENTITY title "FireGPG Asistent - Gmail">
<!ENTITY stop "Stop">
-<!ENTITY next "Next">
-<!ENTITY title2 "Gmail support">
-<!ENTITY description "FireGPG can be integrated with gmail: additional buttons to encrypt and/or sign mails are added and you will be able to decrypt and verify signatures of any email that contains them.">
-<!ENTITY enable "Enable gmail support">
-<!ENTITY smtpok "FireGPG is able to access to the SMTP server">
-<!ENTITY noauth "NB: Authentication is not tested!">
-<!ENTITY noauthhelp "FireGPG will warn you when it tries to send a mail if there is a problem ">
-<!ENTITY sign "Sign">
-<!ENTITY encrypt "Encrypt">
-<!ENTITY atta "Attachments">
-<!ENTITY inline "Use inline">
-<!ENTITY inlinesuck "Inline is bad and not working every time. OpenPGP/Mime, as standard, should be used!">
-<!ENTITY nosmtp "FireGPG isn't able to access to the SMTP server OR the request is still in progress">
-<!ENTITY wait "Wait 15 seconds or more if your connection is very slow">
-<!ENTITY setp "Set parameters of a working SMTP server (eg. your internet provider or your workplace server)">
-<!ENTITY host "Host (smtp.gmail.com): ">
+<!ENTITY next "Další">
+<!ENTITY title2 "Podpora Gmailu">
+<!ENTITY description "FireGPG může být integrován se službou gmail: další tlačítka pro šifrování (a)nebo podpis emailů jsou přidány a můžete dešifrovat a ověřovat podpis libovolného emailu, který je obsahuje.">
+<!ENTITY enable "Zapnout podporu pro gmail">
+<!ENTITY smtpok "FireGPG se může připojit k SMTP serveru">
+<!ENTITY noauth "Pozor: Autentizace není odzkoušena!">
+<!ENTITY noauthhelp "FireGPG vás upozorní než se pokusí odeslat email, pokud nastane problém">
+<!ENTITY sign "Podepsat">
+<!ENTITY encrypt "Zašifrovat">
+<!ENTITY atta "Příloha">
+<!ENTITY inline "Použít inline">
+<!ENTITY inlinesuck "Inline je špatný a ne vždy funguje. OpenPGP/Mime by měl být použitý přednostně!">
+<!ENTITY nosmtp "FireGPG se nemůže připojit k SMTP serveru, NEBO požadavek stále probíhá.">
+<!ENTITY wait "Počkejte 15 sekund, nebo víc, pokud máte pomalé připojení">
+<!ENTITY setp "Nastavit parametry fungujícího SMTP serveru (např. vašeho poskytovatele internetu, nebo server v práci)">
+<!ENTITY host "Server (smtp.gmail.com):">
<!ENTITY port "Port (465):">
-<!ENTITY username "Username (leave blank to use the username of logged account):">
-<!ENTITY ssl "Use SSL">
-<!ENTITY setdo "Set default options for sending mails">
+<!ENTITY username "Uživatel (nechte prázdné, chcete-li použít jméno přihlášeného účtu):">
+<!ENTITY ssl "Použít SSL">
+<!ENTITY setdo "Vybrat výchozí možnosti pro odesílaní emailů">
diff --git a/locale/cs/5-options.dtd b/locale/cs/5-options.dtd
index 8f128cf..9f136ad 100644
--- a/locale/cs/5-options.dtd
+++ b/locale/cs/5-options.dtd
@@ -1,12 +1,12 @@
-<!ENTITY title "FireGPG Assistant - Options">
+<!ENTITY title "FireGPG Asistent - Možnosti">
<!ENTITY stop "Stop">
-<!ENTITY next "Next">
-<!ENTITY title2 "Options">
-<