updates and additions
[webos-internals:modifications.git] / email / email-auto-bcc.patch
1 diff --git a/usr/palm/applications/com.palm.app.email/app/controllers/accountpreferences-assistant.js b/usr/palm/applications/com.palm.app.email/app/controllers/accountpreferences-assistant.js
2 index 1e53cf6..e4bac69 100644
3 --- a/usr/palm/applications/com.palm.app.email/app/controllers/accountpreferences-assistant.js
4 +++ b/usr/palm/applications/com.palm.app.email/app/controllers/accountpreferences-assistant.js
5 @@ -67,6 +67,12 @@ AccountpreferencesAssistant.prototype.setup = function() {
6         this.controller.setupWidget('sync-server-deleted-toggle', this.syncServerDeletedOptions, this.accountPrefs);
7         
8         this.controller.setupWidget('signature', {}, this.accountPrefs);
9 +       
10 +       // autobcc
11 +       var autobcc_cookie = new Mojo.Model.Cookie("bcc_cookie:" + this.account._id);
12 +       var autobccValue = autobcc_cookie.get();
13 +       this.controller.setupWidget('autobcc',  this.autobccAttributes, this.autobccModel = { value: autobccValue });
14 +       
15         this.controller.setupWidget('reply-to', this.replyToAttributes, this.accountPrefs);
16         this.controller.setupWidget('full-name', this.displayNameAttributes, this.accountPrefs);
17         
18 @@ -247,6 +253,10 @@ AccountpreferencesAssistant.prototype.handleSaveAccount = function() {
19         if (this.accountPrefs.notifications.enabled === false) {
20                 Mojo.Controller.getAppController().assistant.notificationAssistant.clear(this.account._id);
21         }
22 +
23 +       // autobcc
24 +       var bcc_cookie = new Mojo.Model.Cookie("bcc_cookie:" + this.account._id);
25 +       bcc_cookie.put(this.autobccModel.value);
26         
27         // Handle case where user set alerts to play a ringtone, but then didn't choose a ringtone.
28         // Default back to "play system sound".
29 @@ -490,6 +500,11 @@ AccountpreferencesAssistant.prototype.replyToAttributes = {
30         acceptBack: true
31  };
32  
33 +AccountpreferencesAssistant.prototype.autobccAttributes = {
34 +       textReplacement: false,
35 +       acceptBack: true // ?
36 +};
37 +
38  //this.mailFormats =  {
39  //     modelProperty: 'useHTML',
40  //     label: $L("Mail format"),
41 diff --git a/usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js b/usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
42 index 72daa3f..715563b 100644
43 --- a/usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
44 +++ b/usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
45 @@ -101,10 +101,11 @@ ComposeAssistant.prototype.activate = function() {
46                 // The CC and BCC must begin life shown, so here we determine if they should be hidden.
47                 // Show if they have contacts in them, otherwise hide. 
48                 if (this.parsedRecips[EmailRecipient.typeBcc] && this.parsedRecips[EmailRecipient.typeBcc].length > 0) {
49 +                       this.setupCCWidgets();
50                         this.showingRecipients = true;
51 -                       this.ccElement.style.display='';
52 +                       //this.ccElement.style.display='';
53                         this.bccElement.style.display='';
54 -                       this.controller.showWidgetContainer(this.ccElement);
55 +                       //this.controller.showWidgetContainer(this.ccElement);
56                         this.controller.showWidgetContainer(this.bccElement);
57                 }
58  
59 @@ -167,6 +168,16 @@ ComposeAssistant.prototype.setup = function() {
60         this.controller.get('email-composeview-from').addEventListener(Mojo.Event.propertyChange, this.boundSenderAccountChanged);
61         // need to determine type of account  
62         this.renderListOfUserAccount(EmailApp.accounts.list);
63 +       // autobcc 
64 +       var autobcc_cookie = new Mojo.Model.Cookie("bcc_cookie:" + this.composition.accountId);
65 +       var autobccValue = autobcc_cookie.get();
66 +       if (autobccValue && autobccValue.length > 0) {
67 +               var newRecip = {};
68 +               newRecip.type = EmailRecipient.typeBcc;
69 +               newRecip.addr = autobccValue;
70 +               newRecip.name = autobccValue;
71 +               this.composition.email.to.push(newRecip);
72 +       }
73  
74         // Add address picker
75         this.parsedRecips = EmailRecipient.separateRecipients(this.composition.email.to);
76 diff --git a/usr/palm/applications/com.palm.app.email/app/views/accountpreferences/accountpreferences-scene.html b/usr/palm/applications/com.palm.app.email/app/views/accountpreferences/accountpreferences-scene.html
77 index 655326c..2f02d41 100644
78 --- a/usr/palm/applications/com.palm.app.email/app/views/accountpreferences/accountpreferences-scene.html
79 +++ b/usr/palm/applications/com.palm.app.email/app/views/accountpreferences/accountpreferences-scene.html
80 @@ -84,6 +84,21 @@
81         </div> 
82  </div>
83  
84 +<div id="edit-account-autobcc" class="palm-group">
85 +       <div class="palm-group-title" x-mojo-loc=''>Auto Bcc</div>
86 +       <div class="palm-list">
87 +               <div class="palm-row single">
88 +                       <!-- <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true" style="margin: -16px -15px -15px -16px;">                  -->
89 +                       <!-- <div id="autobcc" style="min-height: 72px;" x-mojo-element="RichTextEdit"></div> -->
90 +                       <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true">               
91 +                               <div class="title">
92 +                                       <div id="autobcc" x-mojo-element="TextField"></div>
93 +                               </div>
94 +                       </div>                    
95 +               </div>  
96 +       </div> 
97 +</div>
98 +
99  <div id="edit-account-reply-to" class="palm-group">
100         <div class="palm-group-title" x-mojo-loc=''>Reply-To Address</div>
101         <div id="edit-account-reply-to-list" class="palm-list">
102 diff --git a/usr/palm/applications/com.palm.app.email/resources/de/views/accountpreferences/accountpreferences-scene.html b/usr/palm/applications/com.palm.app.email/resources/de/views/accountpreferences/accountpreferences-scene.html
103 index 14a8e92..ac24333 100644
104 --- a/usr/palm/applications/com.palm.app.email/resources/de/views/accountpreferences/accountpreferences-scene.html
105 +++ b/usr/palm/applications/com.palm.app.email/resources/de/views/accountpreferences/accountpreferences-scene.html
106 @@ -84,6 +84,21 @@
107         </div> 
108  </div>
109  
110 +<div id="edit-account-autobcc" class="palm-group">
111 +       <div class="palm-group-title" x-mojo-loc=''>Auto Bcc</div>
112 +       <div class="palm-list">
113 +               <div class="palm-row single">
114 +                       <!-- <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true" style="margin: -16px -15px -15px -16px;">                  -->
115 +                       <!-- <div id="autobcc" style="min-height: 72px;" x-mojo-element="RichTextEdit"></div> -->
116 +                       <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true">               
117 +                               <div class="title">
118 +                                       <div id="autobcc" x-mojo-element="TextField"></div>
119 +                               </div>
120 +                       </div>                    
121 +               </div>  
122 +       </div> 
123 +</div>
124 +
125  <div id="edit-account-reply-to" class="palm-group">
126         <div class="palm-group-title">Antwortadresse</div>
127         <div id="edit-account-reply-to-list" class="palm-list">
128 diff --git a/usr/palm/applications/com.palm.app.email/resources/en/ca/views/accountpreferences/accountpreferences-scene.html b/usr/palm/applications/com.palm.app.email/resources/en/ca/views/accountpreferences/accountpreferences-scene.html
129 index 6bdefda..7e8b6ad 100644
130 --- a/usr/palm/applications/com.palm.app.email/resources/en/ca/views/accountpreferences/accountpreferences-scene.html
131 +++ b/usr/palm/applications/com.palm.app.email/resources/en/ca/views/accountpreferences/accountpreferences-scene.html
132 @@ -84,6 +84,21 @@
133         </div> 
134  </div>
135  
136 +<div id="edit-account-autobcc" class="palm-group">
137 +       <div class="palm-group-title" x-mojo-loc=''>Auto Bcc</div>
138 +       <div class="palm-list">
139 +               <div class="palm-row single">
140 +                       <!-- <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true" style="margin: -16px -15px -15px -16px;">                  -->
141 +                       <!-- <div id="autobcc" style="min-height: 72px;" x-mojo-element="RichTextEdit"></div> -->
142 +                       <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true">               
143 +                               <div class="title">
144 +                                       <div id="autobcc" x-mojo-element="TextField"></div>
145 +                               </div>
146 +                       </div>                    
147 +               </div>  
148 +       </div> 
149 +</div>
150 +
151  <div id="edit-account-reply-to" class="palm-group">
152         <div class="palm-group-title">Reply-To Address</div>
153         <div id="edit-account-reply-to-list" class="palm-list">
154 diff --git a/usr/palm/applications/com.palm.app.email/resources/en/gb/views/accountpreferences/accountpreferences-scene.html b/usr/palm/applications/com.palm.app.email/resources/en/gb/views/accountpreferences/accountpreferences-scene.html
155 index 6bdefda..7e8b6ad 100644
156 --- a/usr/palm/applications/com.palm.app.email/resources/en/gb/views/accountpreferences/accountpreferences-scene.html
157 +++ b/usr/palm/applications/com.palm.app.email/resources/en/gb/views/accountpreferences/accountpreferences-scene.html
158 @@ -84,6 +84,21 @@
159         </div> 
160  </div>
161  
162 +<div id="edit-account-autobcc" class="palm-group">
163 +       <div class="palm-group-title" x-mojo-loc=''>Auto Bcc</div>
164 +       <div class="palm-list">
165 +               <div class="palm-row single">
166 +                       <!-- <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true" style="margin: -16px -15px -15px -16px;">                  -->
167 +                       <!-- <div id="autobcc" style="min-height: 72px;" x-mojo-element="RichTextEdit"></div> -->
168 +                       <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true">               
169 +                               <div class="title">
170 +                                       <div id="autobcc" x-mojo-element="TextField"></div>
171 +                               </div>
172 +                       </div>                    
173 +               </div>  
174 +       </div> 
175 +</div>
176 +
177  <div id="edit-account-reply-to" class="palm-group">
178         <div class="palm-group-title">Reply-To Address</div>
179         <div id="edit-account-reply-to-list" class="palm-list">
180 diff --git a/usr/palm/applications/com.palm.app.email/resources/es/es/views/accountpreferences/accountpreferences-scene.html b/usr/palm/applications/com.palm.app.email/resources/es/es/views/accountpreferences/accountpreferences-scene.html
181 index f0858ef..a241537 100644
182 --- a/usr/palm/applications/com.palm.app.email/resources/es/es/views/accountpreferences/accountpreferences-scene.html
183 +++ b/usr/palm/applications/com.palm.app.email/resources/es/es/views/accountpreferences/accountpreferences-scene.html
184 @@ -84,6 +84,21 @@
185         </div> 
186  </div>
187  
188 +<div id="edit-account-autobcc" class="palm-group">
189 +       <div class="palm-group-title" x-mojo-loc=''>Auto Bcc</div>
190 +       <div class="palm-list">
191 +               <div class="palm-row single">
192 +                       <!-- <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true" style="margin: -16px -15px -15px -16px;">                  -->
193 +                       <!-- <div id="autobcc" style="min-height: 72px;" x-mojo-element="RichTextEdit"></div> -->
194 +                       <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true">               
195 +                               <div class="title">
196 +                                       <div id="autobcc" x-mojo-element="TextField"></div>
197 +                               </div>
198 +                       </div>                    
199 +               </div>  
200 +       </div> 
201 +</div>
202 +
203  <div id="edit-account-reply-to" class="palm-group">
204         <div class="palm-group-title">Dirección de respuesta</div>
205         <div id="edit-account-reply-to-list" class="palm-list">
206 diff --git a/usr/palm/applications/com.palm.app.email/resources/es/views/accountpreferences/accountpreferences-scene.html b/usr/palm/applications/com.palm.app.email/resources/es/views/accountpreferences/accountpreferences-scene.html
207 index da84d6e..e46c465 100644
208 --- a/usr/palm/applications/com.palm.app.email/resources/es/views/accountpreferences/accountpreferences-scene.html
209 +++ b/usr/palm/applications/com.palm.app.email/resources/es/views/accountpreferences/accountpreferences-scene.html
210 @@ -84,6 +84,21 @@
211         </div> 
212  </div>
213  
214 +<div id="edit-account-autobcc" class="palm-group">
215 +       <div class="palm-group-title" x-mojo-loc=''>Auto Bcc</div>
216 +       <div class="palm-list">
217 +               <div class="palm-row single">
218 +                       <!-- <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true" style="margin: -16px -15px -15px -16px;">                  -->
219 +                       <!-- <div id="autobcc" style="min-height: 72px;" x-mojo-element="RichTextEdit"></div> -->
220 +                       <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true">               
221 +                               <div class="title">
222 +                                       <div id="autobcc" x-mojo-element="TextField"></div>
223 +                               </div>
224 +                       </div>                    
225 +               </div>  
226 +       </div> 
227 +</div>
228 +
229  <div id="edit-account-reply-to" class="palm-group">
230         <div class="palm-group-title">Dirección de respuesta</div>
231         <div id="edit-account-reply-to-list" class="palm-list">
232 diff --git a/usr/palm/applications/com.palm.app.email/resources/fr/ca/views/accountpreferences/accountpreferences-scene.html b/usr/palm/applications/com.palm.app.email/resources/fr/ca/views/accountpreferences/accountpreferences-scene.html
233 index 7023f87..bce86eb 100644
234 --- a/usr/palm/applications/com.palm.app.email/resources/fr/ca/views/accountpreferences/accountpreferences-scene.html
235 +++ b/usr/palm/applications/com.palm.app.email/resources/fr/ca/views/accountpreferences/accountpreferences-scene.html
236 @@ -84,6 +84,21 @@
237         </div> 
238  </div>
239  
240 +<div id="edit-account-autobcc" class="palm-group">
241 +       <div class="palm-group-title" x-mojo-loc=''>Auto Bcc</div>
242 +       <div class="palm-list">
243 +               <div class="palm-row single">
244 +                       <!-- <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true" style="margin: -16px -15px -15px -16px;">                  -->
245 +                       <!-- <div id="autobcc" style="min-height: 72px;" x-mojo-element="RichTextEdit"></div> -->
246 +                       <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true">               
247 +                               <div class="title">
248 +                                       <div id="autobcc" x-mojo-element="TextField"></div>
249 +                               </div>
250 +                       </div>                    
251 +               </div>  
252 +       </div> 
253 +</div>
254 +
255  <div id="edit-account-reply-to" class="palm-group">
256         <div class="palm-group-title">Adresse pour réponse</div>
257         <div id="edit-account-reply-to-list" class="palm-list">
258 diff --git a/usr/palm/applications/com.palm.app.email/resources/fr/views/accountpreferences/accountpreferences-scene.html b/usr/palm/applications/com.palm.app.email/resources/fr/views/accountpreferences/accountpreferences-scene.html
259 index 6dde270..f797c16 100644
260 --- a/usr/palm/applications/com.palm.app.email/resources/fr/views/accountpreferences/accountpreferences-scene.html
261 +++ b/usr/palm/applications/com.palm.app.email/resources/fr/views/accountpreferences/accountpreferences-scene.html
262 @@ -84,6 +84,21 @@
263         </div> 
264  </div>
265  
266 +<div id="edit-account-autobcc" class="palm-group">
267 +       <div class="palm-group-title" x-mojo-loc=''>Auto Bcc</div>
268 +       <div class="palm-list">
269 +               <div class="palm-row single">
270 +                       <!-- <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true" style="margin: -16px -15px -15px -16px;">                  -->
271 +                       <!-- <div id="autobcc" style="min-height: 72px;" x-mojo-element="RichTextEdit"></div> -->
272 +                       <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true">               
273 +                               <div class="title">
274 +                                       <div id="autobcc" x-mojo-element="TextField"></div>
275 +                               </div>
276 +                       </div>                    
277 +               </div>  
278 +       </div> 
279 +</div>
280 +
281  <div id="edit-account-reply-to" class="palm-group">
282         <div class="palm-group-title">Adresse pour réponse</div>
283         <div id="edit-account-reply-to-list" class="palm-list">
284 diff --git a/usr/palm/applications/com.palm.app.email/resources/it/views/accountpreferences/accountpreferences-scene.html b/usr/palm/applications/com.palm.app.email/resources/it/views/accountpreferences/accountpreferences-scene.html
285 index c3b27d3..e623987 100644
286 --- a/usr/palm/applications/com.palm.app.email/resources/it/views/accountpreferences/accountpreferences-scene.html
287 +++ b/usr/palm/applications/com.palm.app.email/resources/it/views/accountpreferences/accountpreferences-scene.html
288 @@ -84,6 +84,21 @@
289         </div> 
290  </div>
291  
292 +<div id="edit-account-autobcc" class="palm-group">
293 +       <div class="palm-group-title" x-mojo-loc=''>Auto Bcc</div>
294 +       <div class="palm-list">
295 +               <div class="palm-row single">
296 +                       <!-- <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true" style="margin: -16px -15px -15px -16px;">                  -->
297 +                       <!-- <div id="autobcc" style="min-height: 72px;" x-mojo-element="RichTextEdit"></div> -->
298 +                       <div class="palm-row-wrapper textfield-group" x-mojo-focus-highlight="true">               
299 +                               <div class="title">
300 +                                       <div id="autobcc" x-mojo-element="TextField"></div>
301 +                               </div>
302 +                       </div>                    
303 +               </div>  
304 +       </div> 
305 +</div>
306 +
307  <div id="edit-account-reply-to" class="palm-group">
308         <div class="palm-group-title">Indirizzo di risposta</div>
309         <div id="edit-account-reply-to-list" class="palm-list">