[Pkg-mozext-commits] [imap-acl-extension] 01/09: Imported Upstream version 0.2.7
Michael Fladischer
fladi at moszumanska.debian.org
Sun Jan 3 16:01:13 UTC 2016
This is an automated email from the git hooks/post-receive script.
fladi pushed a commit to branch master
in repository imap-acl-extension.
commit ed92e4e1cc63f7e3f695284fa3a61404570adf8f
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date: Sun Jan 3 15:58:02 2016 +0100
Imported Upstream version 0.2.7
---
chrome/content/about.xul | 2 +-
chrome/content/aclOverview.js | 15 +++++++-
chrome/content/aclOverview.xul | 2 +-
chrome/content/aclUtils.js | 87 ++++++++++++++++++++++++++++--------------
chrome/content/acls.js | 7 ++++
chrome/content/acls.xul | 2 +-
chrome/content/changeAcl.js | 6 +--
chrome/content/overlay.js | 2 +-
chrome/content/overlay.xul | 60 ++++++++++++++++-------------
install.rdf | 7 ++--
10 files changed, 122 insertions(+), 68 deletions(-)
diff --git a/chrome/content/about.xul b/chrome/content/about.xul
index c386c8a..336ee9e 100644
--- a/chrome/content/about.xul
+++ b/chrome/content/about.xul
@@ -8,7 +8,7 @@
<groupbox align="center" orient="horizontal">
<vbox>
<text value="Imap-ACL-Extension" style="font-weight: bold; font-size: x-large;"/>
- <text value="&version; 0.2.6"/>
+ <text value="&version; 0.2.7"/>
<separator class="thin"/>
<text value="&createdBy;" style="font-weight: bold;"/>
<text value="Daniel Stoye"/>
diff --git a/chrome/content/aclOverview.js b/chrome/content/aclOverview.js
index e03d2a0..0b409d4 100644
--- a/chrome/content/aclOverview.js
+++ b/chrome/content/aclOverview.js
@@ -42,8 +42,12 @@ if ("undefined" == typeof(ImapAclExt.AclOverview)) {
if (rootFolder.canOpenFolder && incomingServer.realUsername.length > 0 && incomingServer.password.length > 0) {
var folderForAcc = new Array();
- let allFolders = this.Cc["@mozilla.org/supports-array;1"].createInstance(this.Ci.nsISupportsArray);
- rootFolder.ListDescendents(allFolders);
+ // SG, 07.10.2015 - TB24 changed from nsISupportsArray to nsIMutableArray, and fix typo ListDescendants
+ // https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Releases/24
+ //let allFolders = this.Cc["@mozilla.org/supports-array;1"].createInstance(this.Ci.nsISupportsArray);
+ let allFolders = this.Cc["@mozilla.org/array;1"].createInstance(this.Ci.nsIMutableArray);
+ rootFolder.ListDescendants(allFolders);
+ //window.alert(allFolders.length);
//window.alert(allFolders.Count());
for each (var folder in fixIterator(allFolders, this.Ci.nsIMsgFolder)) {
@@ -170,6 +174,13 @@ if ("undefined" == typeof(ImapAclExt.AclOverview)) {
//document.getElementById("status_label").value = this._stringBundle.getString("loadingDone");
},
+ click : function(event) {
+ // we only care about button 0 (left click) double click events
+ if (event.button != 0 || event.detail != 2 || event.originalTarget.localName != "listitem")
+ return;
+ this.change();
+ },
+
change : function() {
if (this._folderList.selectedIndex == -1) {
window.alert(this._stringBundle.getString("noEntry"));
diff --git a/chrome/content/aclOverview.xul b/chrome/content/aclOverview.xul
index 9d86b36..32b8016 100644
--- a/chrome/content/aclOverview.xul
+++ b/chrome/content/aclOverview.xul
@@ -16,7 +16,7 @@
</stringbundleset>
<hbox>
<vbox flex="1">
- <listbox id="folder_list" flex="1">
+ <listbox id="folder_list" onclick="ImapAclExt.AclOverview.click(event)" flex="1">
<listhead>
<listheader label="&extensions.ImapAclExt.account;"/>
<listheader label="&extensions.ImapAclExt.folder;"/>
diff --git a/chrome/content/aclUtils.js b/chrome/content/aclUtils.js
index 69f718b..53ac308 100644
--- a/chrome/content/aclUtils.js
+++ b/chrome/content/aclUtils.js
@@ -12,8 +12,11 @@ if ("undefined" == typeof(ImapAclExt)) {
Cu : Components.utils,
getSubFoldersAsArray : function (imapFolder, folders) {
- let allFolders = this.Cc["@mozilla.org/supports-array;1"].createInstance(this.Ci.nsISupportsArray);
- imapFolder.ListDescendents(allFolders);
+ // SG, 07.10.2015 - TB24 changed from nsISupportsArray to nsIMutableArray, and fix typo ListDescendants
+ // https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Releases/24
+ //let allFolders = this.Cc["@mozilla.org/supports-array;1"].createInstance(this.Ci.nsISupportsArray);
+ let allFolders = this.Cc["@mozilla.org/array;1"].createInstance(this.Ci.nsIMutableArray);
+ imapFolder.ListDescendants(allFolders);
for each (var folder in fixIterator(allFolders, this.Ci.nsIMsgFolder)) {
var imapF = folder.QueryInterface(Components.interfaces.nsIMsgImapMailFolder);
@@ -64,6 +67,7 @@ if ("undefined" == typeof(ImapAclExt)) {
check : function (imapFolder, callback, cbSender) {
if (imapFolder instanceof Array && imapFolder.length > 0) {
+ // SG, 07.10.2015 - working, but why not using otherCommands?
var commands = new Array();
for (var i = 0; i < imapFolder.length; ++i) {
commands.push("cmd00" + i + " GETACL \"" + imapFolder[i].onlineName + "\"");
@@ -145,42 +149,69 @@ if ("undefined" == typeof(ImapAclExt)) {
cbSender.parseCheck(cbSender, aclRes, cb, cbS, imapFolder);
},
- parseCheck : function (cbSender, aclRes, cb, cbS, imapFolder) {
+ parseCheck : function (cbSender, aclRes, cb, cbS, imapFolder) {
+ //dump("parseCheck(aclRes = "+aclRes+")\n");
if (aclRes == "" || aclRes.indexOf(" OK ") < 0) {
//window.dump("isChecked "+ imapFolder.onlineName + "\\\\" + cbSender.checkedCounter + "//" + aclRes.indexOf("\n") + result+"\n");
cb(cbS, "", imapFolder);
}
- if (aclRes.indexOf("\n") >= 0) {
- aclRes = aclRes.split("\n")[0];
- }
-
- if (aclRes.indexOf("* ") == 0) {
- aclRes = aclRes.substr(2);
- }
+ //if (aclRes.indexOf("* ") == 0) {
+ // aclRes = aclRes.substr(2);
+ //}
+ //
+ //if (aclRes.indexOf("ACL ") == 0) {
+ // aclRes = aclRes.substr(4);
+ //}
+ //
+ //if (aclRes.indexOf(imapFolder.onlineName+" ") == 0) {
+ // aclRes = aclRes.substr(imapFolder.onlineName.length+1);
+ //}
+ //
+ //if (aclRes.indexOf("\""+imapFolder.onlineName+"\" ") == 0) {
+ // aclRes = aclRes.substr(imapFolder.onlineName.length+3);
+ //}
+ //
+ //var acls = aclRes.split(" ");
+ //var rights = new Array();
+ //
+ //for (var i=0;i<acls.length;i=i+2) {
+ // var user = acls[i].replace(/"/g,"");
+ // var acl = acls[i+1].replace(/"/g,"");
+ // if (user != "owner" && user != imapFolder.server.realUsername) {
+ // rights.push({username: user, permissions: acl});
+ // }
+ //}
- if (aclRes.indexOf("ACL ") == 0) {
- aclRes = aclRes.substr(4);
- }
-
- if (aclRes.indexOf(imapFolder.onlineName+" ") == 0) {
- aclRes = aclRes.substr(imapFolder.onlineName.length+1);
- }
-
- if (aclRes.indexOf("\""+imapFolder.onlineName+"\" ") == 0) {
- aclRes = aclRes.substr(imapFolder.onlineName.length+3);
- }
-
- var acls = aclRes.split(" ");
+ // SG, 07.10.2015 - process all lines:
+ // * ACL <folder> <user> <rights>
var rights = new Array();
+ var aclArr = aclRes.split("\n");
- for (var i=0;i<acls.length;i=i+2) {
- var user = acls[i].replace(/"/g,"");
- var acl = acls[i+1].replace(/"/g,"");
- if (user != "owner" && user != imapFolder.server.realUsername) {
- rights.push({username: user, permissions: acl});
+ for (var a=0;a<aclArr.length;a++) {
+ aclRes = aclArr[a];
+ //dump("\t\t"+aclRes+"\n");
+
+ var acls = aclRes.split(" ");
+
+ if ((acls.length > 4) && (acls[0] == "*") && (acls[1].toLowerCase() == "acl")) {
+ var numACL = 4;
+ if (acls[2].startsWith("\""))
+ // folder may contain spaces, so search for the next with ending quote
+ while ((numACL < acls.length) && !acls[numACL-2].endsWith("\""))
+ numACL++;
+ while (numACL < acls.length) {
+ var user = acls[numACL-1].replace(/"/g,"");
+ var acl = acls[numACL].replace(/"/g,"");
+ if (user != "owner" && user != imapFolder.server.realUsername) {
+ rights.push({username: user, permissions: acl});
+ }
+ numACL += 2;
+ }
}
}
+ //dump("parseCheck found "+rights.length+" ACLs for "+imapFolder.onlineName+"\n");
+
cb(cbS, rights, imapFolder);
},
diff --git a/chrome/content/acls.js b/chrome/content/acls.js
index ada6601..0aa86da 100644
--- a/chrome/content/acls.js
+++ b/chrome/content/acls.js
@@ -90,6 +90,13 @@ if ("undefined" == typeof(ImapAclExt.Aclist)) {
document.getElementById("status_label").value = this._stringBundle.getString("loadingDone");
},
+ click : function(event) {
+ // we only care about button 0 (left click) double click events
+ if (event.button != 0 || event.detail != 2 || event.originalTarget.localName != "listitem")
+ return;
+ this.change();
+ },
+
change : function() {
var selected = this._userList.selectedIndex;
diff --git a/chrome/content/acls.xul b/chrome/content/acls.xul
index 1619ec3..a6d10de 100644
--- a/chrome/content/acls.xul
+++ b/chrome/content/acls.xul
@@ -19,7 +19,7 @@
<label id="foldername_label" value=''/>
<hbox>
<vbox flex="1">
- <listbox id="user_list" flex="1">
+ <listbox id="user_list" onclick="ImapAclExt.Aclist.click(event)" flex="1">
<listhead>
<listheader label="&extensions.ImapAclExt.user;"/>
<listheader label="&extensions.ImapAclExt.rights;"/>
diff --git a/chrome/content/changeAcl.js b/chrome/content/changeAcl.js
index 2ed6e0f..14b72f3 100644
--- a/chrome/content/changeAcl.js
+++ b/chrome/content/changeAcl.js
@@ -29,7 +29,8 @@ if ("undefined" == typeof(ImapAclExt.ChangeAcl)) {
{
document.title=this._stringBundle.getString("setRightsFor") + ": " + selected.username;
usernameBox.value = selected.username;
- usernameBox.disabled = "true";
+ usernameBox.setAttribute("readonly", true);
+ //usernameBox.disabled = "true";
var uacl = selected.permissions;
@@ -307,7 +308,4 @@ if ("undefined" == typeof(ImapAclExt.ChangeAcl)) {
}
}
};
- (function() {
- this.init();
- }).apply(ImapAclExt.ChangeAcl);
};
diff --git a/chrome/content/overlay.js b/chrome/content/overlay.js
index 413191b..8393b9d 100644
--- a/chrome/content/overlay.js
+++ b/chrome/content/overlay.js
@@ -2,7 +2,7 @@ if ("undefined" == typeof(ImapAclExt)) {
var ImapAclExt = {
Cc : Components.classes,
Ci : Components.interfaces,
- IAE_VERSION : "0.2.6",
+ IAE_VERSION : "0.2.7",
_stringBundle : null,
_pref : null,
diff --git a/chrome/content/overlay.xul b/chrome/content/overlay.xul
index 72339f8..18ecf81 100644
--- a/chrome/content/overlay.xul
+++ b/chrome/content/overlay.xul
@@ -9,42 +9,48 @@
<!-- <script type="application/x-javascript" src="chrome://imapaclext/content/debug.js" />!-->
<script type='application/x-javascript' src='chrome://imapaclext/content/overlay.js'/>
- <menupopup id="taskPopup">
- <menuitem id="iae-menupopup" hidden="false" label="&iaeToolbar.label;"
- oncommand="ImapAclExt.onToolbarButtonCommand('tbButtonClicked');"/>
+ <!--menupopup id="taskPopup">
+ <menuitem id="iae-menupopup" hidden="false" label="&iaeToolbar.label;"
+ oncommand="ImapAclExt.onToolbarButtonCommand('tbButtonClicked');"/>
</menupopup>
<menupopup id="taskPopup">
- <menuitem id="iae-overview-menu" hidden="false" label="&iaeToolbar.overviewLabel;"
- oncommand="ImapAclExt.onToolbarOverviewButtonCommand('tbButtonClicked');"/>
+ <menuitem id="iae-overview-menu" hidden="false" label="&iaeToolbar.overviewLabel;"
+ oncommand="ImapAclExt.onToolbarOverviewButtonCommand('tbButtonClicked');"/>
+ </menupopup -->
+
+ <menupopup id="menu_EditPopup">
+ <menu id="iae-menu_Edit" label="&iaeToolbar.label;" insertbefore="menu_favoriteFolder">
+ <menupopup id="iae-menupopup">
+ <menuitem id="iae-menu" hidden="false" label="&iaeToolbar.label;"
+ oncommand="ImapAclExt.onToolbarButtonCommand('tbButtonClicked');"/>
+ <menuitem id="iae-overview-menu" hidden="false" label="&iaeToolbar.overviewLabel;"
+ oncommand="ImapAclExt.onToolbarOverviewButtonCommand('tbButtonClicked');"/>
+ </menupopup>
+ </menu>
</menupopup>
-
- <menu id="menu_edit">
- <menuitem id="iae-menu" hidden="false" label="&iaeToolbar.label;"
- oncommand="ImapAclExt.onToolbarButtonCommand('tbButtonClicked');"/>
- </menu>
<!-- Toolbar Button -->
<toolbox id='mail-toolbox'>
- <toolbarpalette id='MailToolbarPalette'>
- <toolbarbutton
- id='button-iae'
- class='toolbarbutton-1 chromeclass-toolbar-additional'
- label='&iaeToolbar.label;'
- tooltiptext='&iaeToolbar.label;'
- oncommand="ImapAclExt.onToolbarButtonCommand('tbButtonClicked');">
- </toolbarbutton>
- <toolbarbutton
- id='button-iae-list'
- class='toolbarbutton-1 chromeclass-toolbar-additional'
- label='&iaeToolbar.labelList;'
- tooltiptext='&iaeToolbar.labelList;'
- oncommand="ImapAclExt.onToolbarOverviewButtonCommand('tbButtonClicked');">
- </toolbarbutton>
- </toolbarpalette>
+ <toolbarpalette id='MailToolbarPalette'>
+ <toolbarbutton
+ id='button-iae'
+ class='toolbarbutton-1 chromeclass-toolbar-additional'
+ label='&iaeToolbar.label;'
+ tooltiptext='&iaeToolbar.label;'
+ oncommand="ImapAclExt.onToolbarButtonCommand('tbButtonClicked');">
+ </toolbarbutton>
+ <toolbarbutton
+ id='button-iae-list'
+ class='toolbarbutton-1 chromeclass-toolbar-additional'
+ label='&iaeToolbar.labelList;'
+ tooltiptext='&iaeToolbar.labelList;'
+ oncommand="ImapAclExt.onToolbarOverviewButtonCommand('tbButtonClicked');">
+ </toolbarbutton>
+ </toolbarpalette>
</toolbox>
<stringbundleset id='stringbundleset'>
- <stringbundle id='ImapAclExt-string-bundle' src='chrome://imapaclext/locale/overlay.properties'/>
+ <stringbundle id='ImapAclExt-string-bundle' src='chrome://imapaclext/locale/overlay.properties'/>
</stringbundleset>
</overlay>
diff --git a/install.rdf b/install.rdf
index 7557594..190e45d 100644
--- a/install.rdf
+++ b/install.rdf
@@ -3,8 +3,9 @@
<Description about="urn:mozilla:install-manifest">
<em:id>imap-acl at sirphreak.com</em:id>
<em:type>2</em:type>
+ <em:unpack>false</em:unpack>
<em:name>Imap-ACL-Extension</em:name>
- <em:version>0.2.6</em:version>
+ <em:version>0.2.7</em:version>
<em:creator>Daniel Stoye</em:creator>
<em:contributor></em:contributor>
<em:description>Extension to manage ACLs on Imap Servers</em:description>
@@ -13,8 +14,8 @@
<em:targetApplication>
<Description>
<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> <!-- Thunderbird -->
- <em:minVersion>3.0</em:minVersion>
- <em:maxVersion>20.*</em:maxVersion>
+ <em:minVersion>24.0</em:minVersion>
+ <em:maxVersion>45.0</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/imap-acl-extension.git
More information about the Pkg-mozext-commits
mailing list