Bumped TB version support 2.x -> 3.0
authorHugo Monteiro <hugo.monteiro@fct.unl.pt>
Wed, 28 Apr 2010 15:27:59 +0000 (16:27 +0100)
committerHugo Monteiro <hugo.monteiro@fct.unl.pt>
Wed, 28 Apr 2010 15:27:59 +0000 (16:27 +0100)
* Code cleanup
* Initiated WebUI support but still not implemented

modified:   chrome/content/dspam.js
modified:   chrome/content/messenger.xul
modified:   chrome/content/options.js
modified:   chrome/content/options.xul
modified:   chrome/locale/en-US/dspam.dtd
modified:   chrome/skin/dspam.css
modified:   install.rdf

chrome/content/dspam.js
chrome/content/messenger.xul
chrome/content/options.js
chrome/content/options.xul
chrome/locale/en-US/dspam.dtd
chrome/skin/dspam.css
install.rdf

index d44e1bf..19e45b4 100644 (file)
@@ -114,7 +114,7 @@ function dspamReportSpam(event) {
                                                        }
                                                }
                                        } else {
-                                               alert("la la la.");
+                                               alert("There was a problem forwarding the message.");
                                        }
                                } else {
                                        alert("Unknown Error. Please contact the plugin author.");
@@ -239,3 +239,66 @@ function dspamReportHam(event) {
 
 }
 
+function dspamGoWebUI() {
+
+       alert("I'm sorry but WebUI integration is not implemented yet.");
+       return;
+
+       var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
+                       .getService(Components.interfaces.nsIPromptService);
+       var pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
+
+       var dspamurl = pref.getCharPref("dspam.webuiurl");
+
+       var username = {value: ""};              // default the username to user
+       var password = {value: ""};              // default the password to pass
+       var check = {value: false};                   // default the checkbox to true
+
+       var result = prompts.promptUsernameAndPassword(null, "DSPAM WebUI", "Enter your DSPAM username and password:",
+                                                              username, password, "Save", check);
+       let authurl = "http://"+username.value+":"+password.value+"@"+dspamurl;
+
+       let dspamController = {
+               get _thunderbirdRegExp() {
+                               delete this._thunderbirdRegExp;
+                               //return this._thunderbirdRegExp = new RegExp("http?://*ae.fct.unl.pt/.*");
+                               //return this._thunderbirdRegExp = new RegExp("http?://"+username.value+":"+password.value+"@nospam.ae.fct.unl.pt");
+                               return this._thunderbirdRegExp = new RegExp("^" + this._siteURL);
+                       },
+                       get _siteURL() {
+                               return authurl + "/";
+                       },
+                       openURLInTab: function (url) {
+                               openTab("contentTab", { contentPage: url, clickHandler: "specialTabs.siteClickHandler(event, dspamController._thunderbirdRegExp);" });
+                       }
+       };
+
+
+
+let browser = document.getElementById("messagepane");
+
+if (!browser) {
+// Try opening new tabs in an existing 3pane window if we can't get messagepane 
+       let mail3PaneWindow = Components.classes["@mozilla.org/appshell/window-mediator;1"]  
+               .getService(Components.interfaces.nsIWindowMediator)  
+               .getMostRecentWindow("mail:3pane");  
+       
+       if (mail3PaneWindow) {  
+               browser = mail3PaneWindow.document.getElementById("messagepane");  
+               mail3PaneWindow.focus();
+       }  
+}
+
+//let authurl = "about:config";
+
+if (browser)  
+//     browser.openTab("contentTab", {contentPage: url});  
+//     browser.loadURI(authurl, browser.currentURL, null);
+       browser.loadURI(authurl, browser.currentURL, null);
+//else  
+//     window.openDialog("chrome://messenger/content/", "_blank",  
+//             "chrome,dialog=no,all", null,  
+//                     { tabType: "contentTab", tabParams: {contentPage: url} });  
+
+}
+
index e029fcc..1a4bd11 100644 (file)
                <command id="cmd_dspam_reportham"
             label="&dspam.hamreportbutton.label;"
             tooltiptext="&dspam.hamreportbutton.tooltiptext;"
-            oncommand="dspamReportHam();"/>
+                       oncommand="dspamReportHam();"/>
+               <command id="cmd_dspam_gowebui"
+                       label="&dspam.gowebuibutton.label;"
+                       tooltiptext="&dspam.gowebuibutton.tooltiptext;"
+                       oncommand="dspamGoWebUI();"/>
        </commandset>
-       
        <keyset id="mailKeys">
                <key id="key_dspam_reportspam" modifiers="shift,alt,control,accel" keycode="VK_SCROLL_LOCK" command="cmd_dspam_reportspam"/>
                <key id="key_dspam_reportham" modifiers="shift,alt,control,accel" keycode="VK_SCROLL_LOCK" command="cmd_dspam_reportham"/>
+               <key id="key_dspam_gowebui" modifiers="shift,alt,control,accel" keycode="VK_SCROLL_LOCK" command="cmd_dspam_gowebui"/>
        </keyset>
        
        <toolbarpalette id="MailToolbarPalette">
-       <toolbaritem id="toolbarbuttongroup">
+       <toolbaritem id="toolbardspamreportbuttongroup">
                <toolbarbutton class="toolbarbutton-1 dspamButtons" id="bReportSpam"
                                                                                command="cmd_dspam_reportspam"/>
                <toolbarbutton class="toolbarbutton-1 dspamButtons" id="bReportHam"
                                                                                command="cmd_dspam_reportham"/>
        </toolbaritem>
+       <toolbaritem id="toolbardspamwebuibuttongroup">
+               <toolbarbutton class="toolbarbutton-1 dspamButtons" id="bGoWebUI"
+                                                                               command="cmd_dspam_gowebui"/>
+       </toolbaritem>
+
        </toolbarpalette>
        
 </overlay>
index 05d11ba..6f077ab 100644 (file)
@@ -2,7 +2,7 @@
 * to preferences
 */
 
-var _elementIDs = ["spamaddress", "hamaddress", "spamaction", "hamaction", "PickFolder0", "PickFolder1", "spamfolder", "hamfolder"];
+var _elementIDs = ["usewebui", "reportmethod", "spamaddress", "hamaddress", "webuiurl", "webuiuser", "webuipass", "rememberwebuipass", "spamaction", "hamaction", "spamfolder", "hamfolder" ];
        
 function init()
 {
@@ -13,6 +13,7 @@ function init()
        {
                var elementID = _elementIDs[i];
                var element = document.getElementById(elementID);
+
                if (!element) break;
                        var eltType = element.localName;
                try 
@@ -23,8 +24,13 @@ function init()
                                element.checked = pref.getBoolPref(element.getAttribute("prefstring"));
                        else if (eltType == "textbox")
                                element.value = pref.getCharPref(element.getAttribute("prefstring")) ;
-                       else if (eltType == "menulist")
-                               SetFolderPicker(pref.getComplexValue(element.getAttribute("prefstring"), Components.interfaces.nsISupportsString).data, elementID);
+                       else if ((eltType == "menupopup") || (eltType == "menuitem") || (eltType == "menulist")) {
+                               if ((elementID == "spamfolder") || (elementID == "hamfolder")) {
+                                       var msgFolder = GetMsgFolderFromUri(pref.getComplexValue(element.getAttribute("prefstring"),Components.interfaces.nsISupportsString).data, false);
+                                       element.setAttribute("uri",msgFolder.URI);
+                                       element.selectFolder(msgFolder);
+                               }
+                       }
                } catch (ex) {
                        if (eltType == "radiogroup")
                                element.selectedIndex = 0;
@@ -55,8 +61,8 @@ function savePrefs()
                        pref.setIntPref(element.getAttribute("prefstring"), parseInt(element.value) );
                else if (eltType == "textbox")
                        pref.setCharPref(element.getAttribute("prefstring"), element.value );
-               else if (eltType == "menulist")
-                       if ((elementID == "PickFolder0") || (elementID == "PickFolder1")) {
+               else if ((eltType == "menupopup") || (eltType == "menuitem") || (eltType == "menulist"))
+                       if ((elementID == "spamfolder") || (elementID == "hamfolder")) {
                                var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
                                str.data = element.getAttribute("uri");
                                pref.setComplexValue(element.getAttribute("prefstring"), Components.interfaces.nsISupportsString, str);
@@ -65,162 +71,42 @@ function savePrefs()
 }
 
 
-function setFolderPicker(val,pickerID,targetID,selection) {
+function onTargetFolderClick(myID,target)
+{
+
+       var targetFolder = target;
 
        try {
-               var picker = document.getElementById(pickerID);
+               var picker = document.getElementById(myID);
+               picker.selectFolder(targetFolder);
        } catch(e) {}
 
-       var uri = val;
-       if (selection) {
-               var pn = selection.parentNode;
-               while (pn.id.indexOf('PickFolde') < 0) {
-                       pn = pn.parentNode;
-               }
-               if (pn.id.indexOf('PickFolde') > -1) {
-                       var picker = pn;
-               }
-               uri = selection.getAttribute('id');
-               val = selection.getAttribute('value');
-               if (uri == '' && val == '') return;
+       uri = targetFolder.URI;
+       val = document.getElementById("bundle_messenger").getFormattedString("verboseFolderFormat", [targetFolder.name, targetFolder.server.prettyName]);
+       if (uri == '' && val == '') {
+               return;
        }
-       var msgfolder = GetMsgFolderFromUri(uri, true);
-       if (msgfolder == null) {
-               if (val == QMglobals.bundle.getString("treeItemNone") ) uri = '';
-       } else {
-               val = document.getElementById("bundle_messenger").getFormattedString("verboseFolderFormat", [msgfolder.name, msgfolder.server.prettyName]);
-       }        
        try {
                picker.setAttribute("label",val);
                picker.setAttribute("uri",uri);
        } catch(e) {}
-}
-
-/*
-        function savePrefsnction() {
-               var pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
-               for( var i = 0; i < QMglobals.items; i++ ) {
-                var elementID = 'PickFolder' + i;
-                var element = document.getElementById(elementID);
-                var uri = element.getAttribute("uri")
-                if (!element) break;
-                pref.setCharPref('quickmove.qf' + i, uri);
-                var element = document.getElementById("qmMR" + i);
-                if (!element) break;
-                pref.setBoolPref("quickmove.markread" + i, element.checked);
-               }
-               for( var i = 1; i < 11; i++ ) {
-                var element = document.getElementById('gl' + i);
-                pref.setCharPref('quickmove.label.group' + i, element.value);
-               }
-            pref.setBoolPref(QMglobals.bundle.getString("debugpref"), document.getElementById("QMdebug").checked);
-            var obSvc = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
-            obSvc.notifyObservers(null, "update_QMsettings", null);
-        },  
-*/
 
+} 
 
 
-
-    function setBox(myId, myValue) {
-      document.getElementById(myId).setAttribute("disabled", !myValue);
-    }
-
-    function getBox(myId) {
-      return document.getElementById(myId).getAttribute("focused")
-    }
-
-    function updateCheckSpam() {
-//      setBox("startupLabel", getBox("spammove"));
-      setBox("PickFolder0", getBox("spammove"));
-    }
-
-    function updateCheckHam() {
-//      setBox("startupLabel", getBox("spammove"));
-      setBox("PickFolder1", getBox("hammove"));
-    }
-
-    function doDefault() {
-      var selected = theListbox.selectedIndex;
-      if (selected < 0) {
-        alert(alerts.getString("dspam.options.errordefault"));
-      } else {
-        var defaultLabel = document.getElementById("defaultServerLabel");
-        var newDefault = theListbox.getItemAtIndex(selected);
-        theListbox.insertItemAt(0, defaultLabel.getAttribute("value"), defaultAccount);
-        defaultLabel.setAttribute("value", newDefault.getAttribute("label"));
-        defaultAccount = newDefault.getAttribute("value");
-        theListbox.removeItemAt(selected+1);
-        theListbox.ensureIndexIsVisible(0);
-        theListbox.selectedIndex = 0;
-      }
-    }
-
-    function doUp() {
-      var selected = theListbox.selectedIndex;
-      if (selected < 0) {
-        alert(alerts.getString("dspam.options.errormoveup"));
-        return;
-      } else if (selected > 0) {
-        var moveMe = theListbox.removeItemAt(selected-1);
-        if (moveMe) {
-          if(selected >= theListbox.getRowCount()) {
-            theListbox.appendItem(moveMe.getAttribute("label"), moveMe.getAttribute("value"));
-          } else {
-            theListbox.insertItemAt(selected, moveMe.getAttribute("label"), moveMe.getAttribute("value"));
-          }
-          if(selected-2 >= 0)
-            theListbox.ensureIndexIsVisible(selected-2);
-          theListbox.ensureIndexIsVisible(selected);
-        }
-      }
-    }
-
-    function doDown() {
-      var selected = theListbox.selectedIndex;
-      if (selected < 0) {
-        alert(alerts.getString("dspam.options.errormovedown"));
-        return;
-      } else if (selected < theListbox.getRowCount()-1) {
-        var moveMe = theListbox.removeItemAt(selected+1);
-        if (moveMe) {
-          theListbox.insertItemAt(selected, moveMe.getAttribute("label"), moveMe.getAttribute("value"));
-          if(selected+2 < theListbox.getRowCount())
-            theListbox.ensureIndexIsVisible(selected+2);
-          theListbox.ensureIndexIsVisible(selected+1);
-        }
-      }
-    }
-
-    function openURL(aURL) {
-      var uri = Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIURI);
-      uri.spec = aURL;
-      var protocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"].getService(Components.interfaces.nsIExternalProtocolService);
-      protocolSvc.loadUrl(uri);
-    }
-
-function chuonthisInitPrefs(branch) {
-  return Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(branch);
+function setBox(myId, myValue) {
+       document.getElementById(myId).parentNode.setAttribute("disabled", !myValue);
 }
 
-function chuonthisGetPrefString(prefs, prefname) {
-  try {
-    return prefs.getComplexValue(prefname, Components.interfaces.nsISupportsString).data;
-  } catch (ex) {
-    return "";
-  }
+function getBox(myId) {
+       return document.getElementById(myId).parentNode.getAttribute("focused")
 }
 
-function chuonthisSetPrefString(prefs, prefname, prefvalue) {
-  var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
-  str.data = prefvalue;
-  prefs.setComplexValue(prefname, Components.interfaces.nsISupportsString, str);
+function updateSpamAction() {
+//     setBox("spamfolder", getBox("spammove"));
 }
 
-function chuonthisGetPrefBool(prefs, prefname, defvalue) {
-  try {
-    return prefs.getBoolPref(prefname);
-  } catch (ex) {
-    return defvalue;
-  }
+function updateHamAction() {
+//     setBox("hamfolder", getBox("hammove"));
 }
+
index 96e7cd8..04e51f4 100644 (file)
@@ -1,14 +1,11 @@
 <?xml version="1.0"?> 
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://dspam/skin/dspam.css" type="text/css"?>
-<?xul-overlay href="chrome://messenger/content/msgFolderPickerOverlay.xul"?>
 <!-- <!DOCTYPE dialog SYSTEM "chrome://dspam/locale/dspam.dtd"> -->
 
 <!DOCTYPE dialog [
 <!ENTITY % dspamDTD SYSTEM "chrome://dspam/locale/dspam.dtd" >
 %dspamDTD;
-<!ENTITY % folderpickerDTD SYSTEM "chrome://messenger/locale/msgFolderPickerOverlay.dtd" >
-%folderpickerDTD;
 ]>
 
 <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="init();"
         buttons="accept,cancel"
         ondialogaccept="savePrefs();"
-        persist="screenX screenY"
+               persist="screenX screenY"
+               width="400"
+               height="400"
         title="DSPAM Extension for Thunderbird">
 
-  <stringbundleset id="stringbundleset">
-    <stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
-    <stringbundle id="fptAlerts" src="chrome://dspam/locale/dspam.properties"/>
-  </stringbundleset>
+       <stringbundleset id="stringbundleset">
+               <stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
+               <stringbundle id="fptAlerts" src="chrome://dspam/locale/dspam.properties"/>
+       </stringbundleset>
 
-  <script type="application/x-javascript" src="chrome://dspam/content/options.js"/>
-  <script type="application/x-javascript" src="chrome://messenger/content/widgetglue.js"/>
-  <script type="application/x-javascript" src="chrome://global/content/nsUserSettings.js"/>
+       <script type="application/x-javascript" src="chrome://dspam/content/options.js"/>
+       <script type="application/x-javascript" src="chrome://messenger/content/widgetglue.js"/>
+       <script type="application/x-javascript" src="chrome://global/content/nsUserSettings.js"/>
                  
+       <tabbox flex="1" style="margin:5px">
+               <tabs id="prefTabBox">
+                       <tab id="generalTab"  label="&dspam.options.gentab.label;"/>
+                       <tab id="forwardTab"  label="&dspam.options.forwardtab.label;"/>
+                       <tab id="webui"  label="&dspam.options.webuitab.label;"/>
+                       <tab id="actionTab"  label="&dspam.options.actiontab.label;"/>
+               </tabs>
+               <tabpanels flex="1">
 
-  <tabbox flex="1" style="margin:5px">
-    <tabs id="prefTabBox">
-<!--      <tab id="generalTab"  label="&dspam.options.gentab.label;"/> -->
-      <tab id="forwardTab"  label="&dspam.options.forwardtab.label;"/>
-<!--      <tab id="webui"  label="&dspam.options.webuitab.label;" disabled="true"/> -->
-      <tab id="actionTab"  label="&dspam.options.actiontab.label;"/>
-    </tabs>
-<tabpanels flex="1">
+                       <!-- General Options -->
+                       <vbox id="generalTab" flex="1">
+                               <groupbox id="general-box" >
+                                       <caption label="General Options" />
+                                       <label control="method" value="&dspam.options.methodLabel;"/>
+                                       <radiogroup id="reportmethod" prefstring="dspam.reportmethod">
+                                               <radio id="forward" selected="true" label="&dspam.options.methodForward;" oncommand="updateReportMethod();"/>
+                                               <radio id="web" label="&dspam.options.methodWebUI;" oncommand="updateReportMethod();" disabled="true"/>
+                                       </radiogroup>
+                                       <checkbox id="usewebui" preftype="bool" prefstring="dspam.usewebui" label="&dspam.options.usewebuiLabel;" tooltiptext="&dspam.options.usewebuitooltip;" oncommand="updateReportMethod();" disabled="true"/>
+                               </groupbox>
+                       </vbox>
 
-<!-- General Options -->
-<!-- <vbox id="generalTab" flex="1">
-  <groupbox id="general-box" >
-       <caption label="General Options" />
-    <label control="method" value="&dspam.options.methodLabel;"/>
-      <radiogroup id="method" prefstring="dspam.method">
-        <radio id="forward" selected="true" label="&dspam.options.methodForward;"/>
-        <radio id="web" label="&dspam.options.methodWebUI;" disabled="true"/>
-      </radiogroup>
-  </groupbox>
-</vbox>
--->
-<!-- Forwarding Report Options -->
-<vbox id="forwardTab" flex="1">
-  <groupbox id="forward-box" >
-    <caption label="Forward Report Options" />
-    <label control="spamaddress" value="&dspam.options.spamaddressLabel;"/>
-      <textbox id="spamaddress" value="" prefstring="dspam.spamaddress" tooltiptext="&dspam.options.spamaddresstooltip;" />
-    <label control="hamaddress" value="&dspam.options.hamaddressLabel;"/>
-      <textbox id="hamaddress" value="" prefstring="dspam.hamaddress" tooltiptext="&dspam.options.hamaddresstooltip;" />
-  </groupbox>
-</vbox>
+                       <!-- Forwarding Report Options -->
+                       <vbox id="forwardTab" flex="1">
+                               <groupbox id="forward-box" >
+                                       <caption label="Forward Report Options" />
+                                       <label control="spamaddress" value="&dspam.options.spamaddressLabel;"/>
+                                       <textbox id="spamaddress" value="" prefstring="dspam.spamaddress" tooltiptext="&dspam.options.spamaddresstooltip;" />
+                                       <label control="hamaddress" value="&dspam.options.hamaddressLabel;"/>
+                                       <textbox id="hamaddress" value="" prefstring="dspam.hamaddress" tooltiptext="&dspam.options.hamaddresstooltip;" />
+                               </groupbox>
+                       </vbox>
 
-<!-- WebUI Report Options -->
-<!-- <vbox id="webuiTab" flex="1">
-  <groupbox id="webui-box" >
-    <caption label="WebUI Report Options" />
-    <label control="webuiurl" value="&dspam.options.webuiurlLabel;"/>
-      <textbox id="webuiurl" value="" prefstring="dspam.webuiurl" tooltiptext="&dspam.options.webuiurltooltip;" />
-    <label control="webuiuser" value="&dspam.options.webuiuserLabel;"/>
-      <textbox id="webuiuser" value="" prefstring="dspam.webuiuser" tooltiptext="&dspam.options.webuiusertooltip;" />
-    <label control="webuipass" value="&dspam.options.webuipassLabel;"/>
-      <textbox id="webuiupass" type="password" value="" prefstring="dspam.webuipass" tooltiptext="&dspam.options.webuipasstooltip;" />
-       <checkbox id="rememberwebuipass"
-         preftype="bool"
-         prefstring="dspam.rememberwebuipass"
-         label="&dspam.options.rememberwebuipass;"
-         tooltiptext="&dspam.options.rememberwebuipass;" />
-  </groupbox>
-</vbox> -->
+                       <!-- WebUI Report Options -->
+                       <vbox id="webuiTab" flex="1">
+                               <groupbox id="webui-box">
+                                       <caption label="WebUI Report Options" />
+                                       <label control="webuiurl" value="&dspam.options.webuiurlLabel;"/>
+                                       <textbox id="webuiurl" value="" prefstring="dspam.webuiurl" tooltiptext="&dspam.options.webuiurltooltip;" disabled="true"/>
+                                       <label control="webuiuser" value="&dspam.options.webuiuserLabel;"/>
+                                       <textbox id="webuiuser" value="" prefstring="dspam.webuiuser" tooltiptext="&dspam.options.webuiusertooltip;" disabled="true"/>
+                                       <label control="webuipass" value="&dspam.options.webuipassLabel;"/>
+                                       <textbox id="webuipass" type="password" value="" prefstring="dspam.webuipass" tooltiptext="&dspam.options.webuipasstooltip;" disabled="true"/>
+                                       <checkbox id="rememberwebuipass"
+                                               preftype="bool"
+                                               prefstring="dspam.rememberwebuipass"
+                                               label="&dspam.options.rememberwebuipass;"
+                                               tooltiptext="&dspam.options.rememberwebuipass;"
+                                               disabled="true"/>
+                               </groupbox>
+                       </vbox>
+                       <!-- Post Report Action -->
+                       <vbox id="actionTab" flex="1">
+                               <groupbox id="spamreport-box" >
+                                       <caption label="&dspam.options.spamactionLabel;" />
+                                       <radiogroup id="spamaction" prefstring="dspam.spamaction">
+                                               <radio id="spamleave" selected="true" label="&dspam.options.spamactionLeave;" oncommand="updateSpamAction();"/>
+                                               <radio id="spamdelete" label="&dspam.options.spamactionDelete;" oncommand="updateSpamAction();"/>
+                                               <row>
+                                                       <radio id="spammove" label="&dspam.options.selectspamfolder;" oncommand="updateSpamAction();"/>
+                                                       <menulist id="spamfolderlist" flex="1">
+                                                               <menupopup id="spamfolder" prefstring="dspam.spamfolder" type="folder" mode="filing" class="folderMenuItem menu-iconic"
+                                                                       style="-moz-binding: url('chrome://messenger/content/folderWidgets.xml#folder-menupopup');"
+                                                                       oncommand="onTargetFolderClick(id,event.target._folder);"/>
+                                                               </menulist>
+                                               </row>
+                                       </radiogroup>
+                               </groupbox>
 
-<!-- Post Report Action -->
-<vbox id="actionTab" flex="1">
-  <groupbox id="spamreport-box" >
-       <caption label="&dspam.options.spamactionLabel;" />
-      <radiogroup id="spamaction" prefstring="dspam.spamaction">
-        <radio id="spamleave" label="&dspam.options.spamactionLeave;" oncommand="updateCheckSpam();"/>
-        <radio id="spamdelete" label="&dspam.options.spamactionDelete;" oncommand="updateCheckSpam();"/>
-         <row>
-               <radio id="spammove" label="&dspam.options.selectspamfolder;" oncommand="updateCheckSpam();"/>
-                        <menulist id="PickFolder0" flex="1" prefstring="dspam.spamfolder"
-                            oncommand="setFolderPicker('1','PickFolder','',event.target);"
-                            sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
-                            sortDirection="ascending"
-                            context="folderPaneContext"
-                            datasources="rdf:msgaccountmanager rdf:mailnewsfolders"
-                            class="folderMenuItem menu-iconic"
-                            ref="msgaccounts:/">
-                            <template>
-                                    <rule ncll:CanFileMessagesOnServer="false">
-                                        <!-- don't show servers (nntp & any others) which does not allow message filing -->
-                                    </rule>
-                                    <rule ncll:CanFileMessages="false" iscontainer="true" isempty="false" >
-                                        <!-- don't allow folders which does not allow message filing to be picked, show them tho-->
-                                        <menupopup>
-                                            <menu uri="..." 
-                                                class="folderMenuItem menu-iconic"
-                                                SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
-                                                BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
-                                                IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
-                                                IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
-                                                ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
-                                                label="rdf:http://home.netscape.com/NC-rdf#FolderTreeName">
-                                                <menupopup class="folderMenuItem menu-iconic"/>
-                                            </menu>
-                                        </menupopup>
-                                    </rule>
-                                    <rule ncll:CanFileMessages="true" iscontainer="true" isempty="false" >
-                                        <!-- show folders that allow message filing and allow them to be picked-->
-                                        <menupopup>
-                                            <menu uri="..." 
-                                                class="folderMenuItem menu-iconic"
-                                                oncommand="setFolderPicker('2','PickFolder','',event.target);"
-                                                SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
-                                                BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
-                                                IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
-                                                IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
-                                                ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
-                                                label="rdf:http://home.netscape.com/NC-rdf#FolderTreeName">
-                                                <menupopup class="folderMenuItem menu-iconic">
-                                                    <menuitem label="&dspam.options.selectspamfolder.label;" 
-                                                        oncommand="setFolderPicker('3','PickFolder','',event.target.parentNode.parentNode);"/>
-                                                    <menuseparator/>
-                                                </menupopup>
-                                                <menupopup class="folderMenuItem menu-iconic"/>
-                                            </menu>
-                                        </menupopup>
-                                    </rule>
-                                    <rule ncll:CanFileMessages="true">
-                                        <!-- show all folders that can do message filing that did not fit the rules above-->
-                                        <menupopup>
-                                            <menuitem uri="..." value="..."  
-                                                class="folderMenuItem menuitem-iconic"
-                                                SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
-                                                BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
-                                                IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
-                                                IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
-                                                ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
-                                                label="rdf:http://home.netscape.com/NC-rdf#Name"/>
-                                        </menupopup>
-                                    </rule>
-                            </template>
-                        </menulist>
-         </row>
-      </radiogroup>
-  </groupbox>
-
-  <groupbox id="hamreport-box" >
-       <caption label="&dspam.options.hamactionLabel;" />
-      <radiogroup id="hamaction" prefstring="dspam.hamaction">
-        <radio id="hamleave" label="&dspam.options.hamactionLeave;" oncommand="updateCheckHam();"/>
-         <row>
-               <radio id="hammove" label="&dspam.options.selecthamfolder;" oncommand="updateCheckHam();"/>
-                        <menulist id="PickFolder1" flex="1" prefstring="dspam.hamfolder"
-                            oncommand="setFolderPicker('1','PickFolder','',event.target);"
-                            sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
-                            sortDirection="ascending"
-                            context="folderPaneContext"
-                            datasources="rdf:msgaccountmanager rdf:mailnewsfolders"
-                            class="folderMenuItem menu-iconic"
-                            ref="msgaccounts:/">
-                            <template>
-                                    <rule ncll:CanFileMessagesOnServer="false">
-                                        <!-- don't show servers (nntp & any others) which does not allow message filing -->
-                                    </rule>
-                                    <rule ncll:CanFileMessages="false" iscontainer="true" isempty="false" >
-                                        <!-- don't allow folders which does not allow message filing to be picked, show them tho-->
-                                        <menupopup>
-                                            <menu uri="..." 
-                                                class="folderMenuItem menu-iconic"
-                                                SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
-                                                BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
-                                                IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
-                                                IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
-                                                ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
-                                                label="rdf:http://home.netscape.com/NC-rdf#FolderTreeName">
-                                                <menupopup class="folderMenuItem menu-iconic"/>
-                                            </menu>
-                                        </menupopup>
-                                    </rule>
-                                    <rule ncll:CanFileMessages="true" iscontainer="true" isempty="false" >
-                                        <!-- show folders that allow message filing and allow them to be picked-->
-                                        <menupopup>
-                                            <menu uri="..." 
-                                                class="folderMenuItem menu-iconic"
-                                                oncommand="setFolderPicker('2','PickFolder','',event.target);"
-                                                SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
-                                                BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
-                                                IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
-                                                IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
-                                                ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
-                                                label="rdf:http://home.netscape.com/NC-rdf#FolderTreeName">
-                                                <menupopup class="folderMenuItem menu-iconic">
-                                                    <menuitem label="&dspam.options.selectspamfolder.label;" 
-                                                        oncommand="setFolderPicker('3','PickFolder','',event.target.parentNode.parentNode);"/>
-                                                    <menuseparator/>
-                                                </menupopup>
-                                                <menupopup class="folderMenuItem menu-iconic"/>
-                                            </menu>
-                                        </menupopup>
-                                    </rule>
-                                    <rule ncll:CanFileMessages="true">
-                                        <!-- show all folders that can do message filing that did not fit the rules above-->
-                                        <menupopup>
-                                            <menuitem uri="..." value="..."  
-                                                class="folderMenuItem menuitem-iconic"
-                                                SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
-                                                BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
-                                                IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
-                                                IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
-                                                ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"
-                                                label="rdf:http://home.netscape.com/NC-rdf#Name"/>
-                                        </menupopup>
-                                    </rule>
-                            </template>
-                        </menulist>
-         </row>
-      </radiogroup>
-  </groupbox>
- </vbox>
-
-    </tabpanels>
-<hbox>
-  <image id="options_img"/>
-</hbox>
-
-  </tabbox>
+                               <groupbox id="hamreport-box" >
+                                       <caption label="&dspam.options.hamactionLabel;" />
+                                       <radiogroup id="hamaction" prefstring="dspam.hamaction">
+                                               <radio id="hamleave" selected="true" label="&dspam.options.hamactionLeave;" oncommand="updateHamAction();"/>
+                                               <row>
+                                                       <radio id="hammove" label="&dspam.options.selecthamfolder;" oncommand="updateHamAction();"/>
+                                                       <menulist id="hamfolderlist" flex="1">
+                                                               <menupopup id="hamfolder" prefstring="dspam.hamfolder" type="folder" mode="filing" class="folderMenuItem menu-iconic"
+                                                                       style="-moz-binding: url('chrome://messenger/content/folderWidgets.xml#folder-menupopup');"
+                                                                       oncommand="onTargetFolderClick(id,event.target._folder);"/>
+                                                       </menulist>
+                                               </row>
+                                       </radiogroup>
+                               </groupbox>
+                       </vbox>
+               </tabpanels>
+               <hbox>
+                       <image id="options_img"/>
+               </hbox>
+       </tabbox>
 </dialog>
 
index 36ba542..78f1cd8 100644 (file)
@@ -8,6 +8,8 @@
 <!ENTITY dspam.spamreportbutton.tooltiptext "Report the selected messages as SPAM">
 <!ENTITY dspam.hamreportbutton.label "Not Spam">
 <!ENTITY dspam.hamreportbutton.tooltiptext "Report the selected messages as INNOCENT">
+<!ENTITY dspam.gowebuibutton.label "WebUI">
+<!ENTITY dspam.gowebuibutton.tooltiptext "Visit DSPAM WebUI">
 <!ENTITY dspam.options.spamaddresstooltip "Your SPAM report address">
 <!ENTITY dspam.options.hamaddresstooltip "Your HAM report address">
 <!ENTITY dspam.options.quickspamcop "Enable Quick SpamCop">
@@ -41,4 +43,6 @@
 <!ENTITY dspam.options.webuitab.tooltip "WebUI reporting configuration options">
 <!ENTITY dspam.options.actiontab.label "Actions">
 <!ENTITY dspam.options.actiontab.tooltip "Actions to perform after reporting">
+<!ENTITY dspam.options.usewebuiLabel "Enable full WebUI Access">
+<!ENTITY dspam.options.usewebuitooltip "Access WebUI preferences and statistics">
 <!ENTITY dspam. "">
index 1d08d48..ce447aa 100644 (file)
@@ -26,6 +26,11 @@ toolbar[iconsize="small"] #bReportSpam{ list-style-image: url("chrome://dspam/sk
 #bReportHam{ list-style-image: url("chrome://dspam/skin/reportham-large.png"); }
 toolbar[iconsize="small"] #bReportHam{ list-style-image: url("chrome://dspam/skin/reportham-small.png"); }
 
+/* Go WebUI */
+#bGoWebUI{ list-style-image: url("chrome://dspam/skin/dspam-logo-eyes-transp-small.png"); }
+toolbar[iconsize="small"] #bGoWebUI{ list-style-image: url("chrome://dspam/skin/dspam-logo-eyes-transp-small.png"); }
+
+/* DSPAM Preferences Logo */
 #options_img {
    list-style-image: url("chrome://dspam/skin/dspam-logo.gif");
        width: 150px;
index c37a4d0..a7df453 100644 (file)
     <!--Thunderbird -->
       <Description>
         <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
-        <em:minVersion>2.0</em:minVersion>
-       <em:maxVersion>3.0.*</em:maxVersion>
+        <em:minVersion>3.0</em:minVersion>
+               <em:maxVersion>3.0.*</em:maxVersion>
       </Description>
     </em:targetApplication>
     
     <!-- Front End MetaData -->
     <em:id>{f56de514-f1ab-4209-8ad5-05a378d0b24b}</em:id>
     <em:name>dspam</em:name>
-    <em:version>0.8</em:version>
+    <em:version>0.9</em:version>
     <em:description>DSPAM Extension for Thunderbird</em:description>
     <em:iconURL>chrome://dspam/skin/dspam-logo-eyes-small.gif</em:iconURL>
     <em:creator>Hugo Monteiro</em:creator>
@@ -33,6 +33,7 @@
         <em:skin>skin/</em:skin>
         <em:locale>locale/en-US/</em:locale>
                <em:locale>locale/pt-PT/</em:locale>
+               <em:locale>locale/de-DE/</em:locale>
       </Description>
     </em:file>
   </Description>