diff options
author | dave@33eels.com <dave@33eels.com@4eb1ac78-321c-0410-a911-ec516a8615a5> | 2009-03-11 15:11:35 (GMT) |
---|---|---|
committer | dave@33eels.com <dave@33eels.com@4eb1ac78-321c-0410-a911-ec516a8615a5> | 2009-03-11 15:11:35 (GMT) |
commit | 08bdec3b9db24ff801f70791e893e349376887a6 (patch) | |
tree | 0464e3e3531b119a3ae7b5b90a9226677fe99594 | |
parent | 2c3cc9900f243256eb5dd620fb27180226d02f70 (diff) |
Fix for bug 470267 ("[E-1.3.4] Ability to publish to more than more email at once");
git-svn-id: http://svn.mozilla.org/addons/trunk@23106 4eb1ac78-321c-0410-a911-ec516a8615a5
-rw-r--r-- | bandwagon/components/bandwagon-service.js | 13 | ||||
-rw-r--r-- | bandwagon/content/ui/publishController.js | 2 | ||||
-rw-r--r-- | bandwagon/locale/en-US/publish.dtd | 2 |
3 files changed, 15 insertions, 2 deletions
diff --git a/bandwagon/components/bandwagon-service.js b/bandwagon/components/bandwagon-service.js index 0c1201e..daf9c1d 100644 --- a/bandwagon/components/bandwagon-service.js +++ b/bandwagon/components/bandwagon-service.js @@ -687,6 +687,9 @@ BandwagonService.prototype = { addPreviouslySharedEmailAddress: function(emailAddress) { + emailAddress = emailAddress.replace(/^\s+/, ""); + emailAddress = emailAddress.replace(/\s+$/, ""); + var previouslySharedEmailAddresses = this.getPreviouslySharedEmailAddresses(); for (var i=0; i<previouslySharedEmailAddresses.length; i++) @@ -702,6 +705,16 @@ BandwagonService.prototype = { Bandwagon.Preferences.setPreferenceList("publish.shared.emails", previouslySharedEmailAddresses); }, + addPreviouslySharedEmailAddresses: function(commaSeparatedEmailAddresses) + { + var bits = commaSeparatedEmailAddresses.split(","); + + for (var i=0; i<bits.length; i++) + { + this.addPreviouslySharedEmailAddress(bits[i]); + } + }, + publishToCollection: function(extension, collection, personalNote, callback) { this._service.publishToCollection(extension, collection, personalNote, callback); diff --git a/bandwagon/content/ui/publishController.js b/bandwagon/content/ui/publishController.js index 422e7b1..3a23457 100644 --- a/bandwagon/content/ui/publishController.js +++ b/bandwagon/content/ui/publishController.js @@ -186,7 +186,7 @@ Bandwagon.Controller.Publish.finished = function(event) if (Bandwagon.Controller.Publish.publishType == Bandwagon.Controller.Publish.TYPE_NEW_EMAIL && document.getElementById("remember-email").checked) { - bandwagonService.addPreviouslySharedEmailAddress(document.getElementById("email-address").value); + bandwagonService.addPreviouslySharedEmailAddresses(document.getElementById("email-address").value); } if (Bandwagon.Controller.Publish.publishType == Bandwagon.Controller.Publish.TYPE_COLLECTION) diff --git a/bandwagon/locale/en-US/publish.dtd b/bandwagon/locale/en-US/publish.dtd index 288d1e6..0ea8d7d 100644 --- a/bandwagon/locale/en-US/publish.dtd +++ b/bandwagon/locale/en-US/publish.dtd @@ -39,7 +39,7 @@ <!ENTITY cancel.label "Cancel"> <!ENTITY publish.label "Publish"> <!ENTITY new.email.label "New E-mail"> -<!ENTITY enter.an.email.label "Enter an e-mail address to share this add-on with:"> +<!ENTITY enter.an.email.label "Enter an e-mail address to share this add-on with (you can separate multiple e-mail addresses with commas):"> <!ENTITY remember.this.email.label "Remember this e-mail address"> <!ENTITY enter.a.personal.note.label "Enter an optional personal note to accompany this add-on:"> |