From 731d9d45bda55231f118977bf9cd302a77f53e8d Mon Sep 17 00:00:00 2001 From: theglu Date: Sun, 1 Feb 2009 11:29:49 +0000 Subject: [PATCH] See changelog git-svn-id: http://svn.getfiregpg.org/firegpg@526 1e1cc2a3-b62a-0410-bc93-fb3b3b0a0737 --- ChangeLog | 8 ++ content/Core/cgpgaccess.js | 4 +- content/Core/firefoxOverlay.xul | 21 +++-- content/Core/misc.js | 84 +++++++++++------ content/Core/overlay.js | 3 + content/Dialogs/options.xul | 148 ++++++++++++++++-------------- content/Webmails/Gmail/cgmail2.js | 78 +++++++++------- skin/overlay.css | 18 ++-- 8 files changed, 219 insertions(+), 145 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3fc9832..4f7c208 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,12 @@ +2009-02-01 Maximilien Cuony + * FS#225 + * FS#224 + * FS#219 + * FS#226 + * FS#221 + 2009-01-31 Maximilien Cuony + * FS#228 * Splitting mime functions * FS#222 * Keyring -> inline (FireGPGInline) diff --git a/content/Core/cgpgaccess.js b/content/Core/cgpgaccess.js index 27c988c..7e844f7 100644 --- a/content/Core/cgpgaccess.js +++ b/content/Core/cgpgaccess.js @@ -203,7 +203,7 @@ var GPGAccess = { if (arguement == '') return ""; - arguement = arguement.replace(/\{\$FXFolder\}/, FGPGFireFoxCurrentFolder); + arguement = arguement.replace(/\{\$FXFolder\}/gi, FGPGFireFoxCurrentFolder); //We remove double-spaces var reg=new RegExp(" ", "gi"); @@ -291,7 +291,7 @@ var GPGAccess = { */ getGPGCommand: function () { - return this.GpgCommand.replace(/\{\$FXFolder\}/, FGPGFireFoxCurrentFolder); + return this.GpgCommand.replace(/\{\$FXFolder\}/gi, FGPGFireFoxCurrentFolder); }, /* diff --git a/content/Core/firefoxOverlay.xul b/content/Core/firefoxOverlay.xul index 862d1ac..3ffcd89 100644 --- a/content/Core/firefoxOverlay.xul +++ b/content/Core/firefoxOverlay.xul @@ -130,22 +130,29 @@ --> - + --> + + + + + diff --git a/content/Core/misc.js b/content/Core/misc.js index 499cb9b..9960d8b 100644 --- a/content/Core/misc.js +++ b/content/Core/misc.js @@ -112,6 +112,8 @@ var savedPassword = null; /* the private key password */ */ var oldKeyID = ''; +var updateAvailable = false; + /* Function: fireGPGDebug @@ -811,51 +813,77 @@ function testIfSomethingsIsNew() { if (!noUpdates) { - var Stamp = new Date(); - var nbMs = Stamp.getTime(); - var lastUpdate = 0; + if (updateAvailable) { + if (document.getElementById('firegpg-statusbar-update')) + document.getElementById('firegpg-statusbar-update').style.display = ''; - try { - lastUpdate = parseInt(prefs.getCharPref("lastUpdateCheck")); - } catch (e) { } + } else { + var Stamp = new Date(); + var nbMs = Stamp.getTime(); - //Not A Number - if (isNaN(lastUpdate)) - lastUpdate = 0; - //One day - if (lastUpdate < (nbMs - (24 * 60 * 60 * 1000))) - { + var lastUpdate = 0; - prefs.setCharPref("lastUpdateCheck",nbMs); + try { + lastUpdate = parseInt(prefs.getCharPref("lastUpdateCheck")); + } catch (e) { } - //Get the last version - var updateData = getContent("http://getfiregpg.org/stable/update.rdf"); + //Not A Number + if (isNaN(lastUpdate)) + lastUpdate = 0; + //One day + if (lastUpdate < (nbMs - (24 * 60 * 60 * 1000))) + { - var toDetect = "NS1:version=\"" + versionAct + "\""; + prefs.setCharPref("lastUpdateCheck",nbMs); - if (updateData.indexOf('ec8030f7-c20a-464f-9b0e-13a3a9e97384') != -1 && updateData.indexOf(toDetect) == -1 ) - { + //Get the last version + var updateData = getContent("http://getfiregpg.org/stable/update.rdf"); - var newVersion = "A new version of FireGPG is available, would you like to update now?"; - try { + var toDetect = "NS1:version=\"" + versionAct + "\""; - newVersion = i18n.getString('newVersionAlert'); - } catch (e) { } + 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(); + } - if (confirm(newVersion)) - { - openUILink("http://getfiregpg.org/stable/firegpg.xpi"); - } - } - } + } + } + } } //*/ } } +function showUpdateDialog() { + + var i18n = document.getElementById("firegpg-strings"); + + var newVersion = "A new version of FireGPG is available, would you like to update now?"; + + try { + newVersion = i18n.getString('newVersionAlert'); + } catch (e) { } + + if (confirm(newVersion)) + { + openUILink("http://getfiregpg.org/stable/firegpg.xpi"); + + } + + updateAvailable = false; + + 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. diff --git a/content/Core/overlay.js b/content/Core/overlay.js index c70e455..599d5f7 100644 --- a/content/Core/overlay.js +++ b/content/Core/overlay.js @@ -63,6 +63,7 @@ const ACTION_EDITEUR = 'EDITEUR'; const ACTION_MANAGER = 'MANAGER'; const ACTION_OPTS = 'OPTS'; const ACTION_ERASE = 'ERASE'; +const ACTION_UPDATE = 'UPDATE'; /* * Class: firegpg @@ -129,6 +130,8 @@ var firegpg = { window.openDialog("chrome://firegpg/content/Dialogs/options.xul", "optionsFiregpg", "chrome, centerscreen, toolbar").focus(); else if (action == ACTION_ERASE) eraseSavedPassword(); + else if(action == ACTION_UPDATE) + showUpdateDialog(); }, /* diff --git a/content/Dialogs/options.xul b/content/Dialogs/options.xul index 70ba038..1b553bf 100644 --- a/content/Dialogs/options.xul +++ b/content/Dialogs/options.xul @@ -226,99 +226,107 @@ label="&gmail-no-no-sign-checkbox;"/> - + +