Commit f483a8b2b1a81b0377805014fc8b824d1bc9d914

  • avatar
  • dBsooner's Stuff <dbsooner @del…ge.vision5.com>
  • Wed Mar 03 06:42:35 CET 2010
2 New, 6 ported patches for 1.4.0.
  
1diff --git a/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js b/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
2index 9057138..7c98cc9 100644
3--- a/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
4+++ b/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
5@@ -17,6 +17,7 @@ var LauncherAssistant = Class.create({
6 kAppsPerRow: NaN,
7 kAppHeight: NaN,
8 kAppWidth: NaN,
9+ kMaxPageSelectorTabs: 5,
10 /* constant end */
11
12 appMenuModel: {
13@@ -73,6 +74,18 @@ var LauncherAssistant = Class.create({
14 onAppUpdated: this.onAppUpdated.bind(this)
15 }
16 );
17+
18+ // Set up an initial blank view menu widget for page selection. (LMO)
19+ this.viewMenuModel = {
20+ label: $L('Launcher pages'), items: [
21+ { items: [] },
22+ { label: $L('Pages'), items: [] },
23+ { items: [] }
24+ ]
25+ };
26+ this.controller.setupWidget(
27+ Mojo.Menu.viewMenu, { menuClass: 'no-fade' }, this.viewMenuModel
28+ );
29
30 this.globalSearchAssistant = new GlobalSearchAssistant(this.controller, this);
31
32@@ -111,6 +124,14 @@ var LauncherAssistant = Class.create({
33
34 handleCommand: function(event) {
35 if (event.type == Mojo.Event.command) {
36+
37+ // Check for pageselect_{number} commands to switch pages. (LMO)
38+ var m;
39+ if (m = (/^pageselect_(\d+)$/.exec(event.command))) {
40+ // Note: parseInt() needed here so scroller math doesn't break
41+ return this.gotoPage(parseInt(m[1]));
42+ }
43+
44 switch (event.command) {
45 case Mojo.Menu.helpCmd:
46 ApplicationService.launch(this.helpInfo.id, this.helpInfo.params);
47@@ -255,6 +276,7 @@ var LauncherAssistant = Class.create({
48
49 // tell our scroller widget that it has a new page element to snap
50 this.updatePageSnappingPoints();
51+ this.rebuildPageSelector(); // (LMO)
52 },
53
54 deletePage: function(pageIndex) {
55@@ -307,6 +329,7 @@ var LauncherAssistant = Class.create({
56 }
57
58 this.updatePageSnappingPoints();
59+ this.rebuildPageSelector(); // (LMO)
60 },
61
62 /* creates and appends a new application div in the provided page container */
63@@ -655,6 +678,9 @@ var LauncherAssistant = Class.create({
64
65 /* Updates the positions of all page indicators. */
66 updatePageIndicators: function() {
67+
68+ // Ensure that the view menu tabs reflect the active page. (LMO)
69+ this.setPageSelectorState(this.activePageIndex);
70
71 if (this.indicators.length <= 0) {
72 return;
73@@ -763,6 +789,91 @@ var LauncherAssistant = Class.create({
74 onLaunchCompleted: function(response) {
75
76 this.launchRequest = undefined;
77- }
78+ },
79+
80+ /**
81+ * Rebuild the page selector tabs and possible overflow submenu. (LMO)
82+ */
83+ rebuildPageSelector: function () {
84+
85+ var items = [],
86+ submenu_items = [];
87+
88+ for (var i=0,l=this.pageDivs.length; i<l; i++) {
89+
90+ // Build a new page selection item.
91+ var new_item = { label: '#'+(i+1), command: 'pageselect_' + i };
92+
93+ // If there are exactly 5 items, or this is item 4 or less,
94+ // drop it into the top-level items list.
95+ if (l<=this.kMaxPageSelectorTabs || i<(this.kMaxPageSelectorTabs-1)) {
96+ items.push(new_item);
97+ }
98+
99+ // If there are more than 5 items, the fifth top-level item
100+ // invokes a sub-menu containing the rest of the items.
101+ if (l>this.kMaxPageSelectorTabs) {
102+ if (i==(this.kMaxPageSelectorTabs-1)) {
103+ // Create the overflow submenu button.
104+ items.push({ label: '...', command: 'pageselect_more_pages',
105+ submenu: 'pageselect_more_pages' });
106+ }
107+ if (i>=(this.kMaxPageSelectorTabs-1)) {
108+ // Add the current item to the overflow submenu.
109+ submenu_items.push(new_item);
110+ }
111+ }
112+
113+ }
114+
115+ // Update the view menu model for page selection.
116+ this.viewMenuModel.items[1].items = items;
117+
118+ // If there was a submenu of items built, rebuild the submenu itself.
119+ if (submenu_items.length) {
120+ this.controller.setupWidget('pageselect_more_pages', undefined,
121+ this.pageselectSubmenuModel = {
122+ label: $('More pages'), items: submenu_items
123+ }
124+ );
125+ }
126+
127+ // Make the widget refresh with the new data, ensure state matches
128+ // active page state.
129+ this.controller.modelChanged(this.viewMenuModel);
130+ this.setPageSelectorState(this.activePageIndex);
131+ },
132+
133+ /**
134+ * Update the view menu tabs to reflect a given page index. (LMO)
135+ *
136+ * @param {int} idx Page index.
137+ */
138+ setPageSelectorState: function (idx) {
139+ if (idx >= (this.kMaxPageSelectorTabs-1) && this.pageDivs.length > this.kMaxPageSelectorTabs) {
140+ // Tab selected belongs to the overflow submenu, so set a checkmark
141+ this.viewMenuModel.items[1].toggleCmd = 'pageselect_more_pages';
142+ this.pageselectSubmenuModel.toggleCmd = 'pageselect_' + idx;
143+ } else {
144+ // Tab belongs to the visible tabs, so toggle one on.
145+ this.viewMenuModel.items[1].toggleCmd = 'pageselect_' + idx;
146+ if (this.pageselectSubmenuModel) {
147+ // If there happens to be a submenu, clear the checkmark.
148+ this.pageselectSubmenuModel.toggleCmd = '';
149+ }
150+ }
151+ this.controller.modelChanged(this.viewMenuModel);
152+ },
153+
154+ /**
155+ * Switch directly to a page. (LMO)
156+ *
157+ * @param {int} idx Page index.
158+ */
159+ gotoPage: function (idx) {
160+ $('launcher_root').mojo.setSnapIndex(idx, true);
161+ this.activePageIndex = idx;
162+ this.updatePageIndicators();
163+ }
164
165 });
166diff --git a/usr/lib/luna/system/luna-applauncher/stylesheets/launcher.css b/usr/lib/luna/system/luna-applauncher/stylesheets/launcher.css
167index 45b6546..fe30375 100644
168--- a/usr/lib/luna/system/luna-applauncher/stylesheets/launcher.css
169+++ b/usr/lib/luna/system/luna-applauncher/stylesheets/launcher.css
170@@ -59,7 +59,7 @@ body.palm-default
171 width: 100%;
172 z-index: 29;
173 height: 24px;
174- top: 1px;
175+ top: 45px; /* Insert some space for the page selector (LMO) */
176 background: url(../images/fade-arrow-up.png) center center no-repeat;
177 -webkit-palm-mouse-target: ignore;
178 }
179@@ -106,7 +106,7 @@ body.palm-default
180 }
181
182 .page_scroller_container {
183- margin-top: 10px;
184+ margin-top: 55px; /* Insert some space for the page selector (LMO) */
185 margin-bottom: -20px;
186 }
187
  
1diff --git a/usr/palm/applications/com.palm.app.browser/app/controllers/page-assistant.js b/usr/palm/applications/com.palm.app.browser/app/controllers/page-assistant.js
2index 09c898f..1dc6465 100644
3--- a/usr/palm/applications/com.palm.app.browser/app/controllers/page-assistant.js
4+++ b/usr/palm/applications/com.palm.app.browser/app/controllers/page-assistant.js
5@@ -621,7 +621,7 @@ PageAssistant.prototype._onWebViewSingleTap = function(event) {
6 tapPt.left = event.centerX - tapPt.left;
7 tapPt.top = event.centerY - tapPt.top;
8
9- if (event.altKey) {
10+ if (event.altKey || event.metaKey) {
11
12 var popupItems = [
13 {label: $L('Open In New Card'), command:'openNew'},
14diff --git a/usr/palm/frameworks/mojo/builtins/palmInitFramework330.js b/usr/palm/frameworks/mojo/builtins/palmInitFramework330.js
15index 177ea93..41b577d 100644
16--- a/usr/palm/frameworks/mojo/builtins/palmInitFramework330.js
17+++ b/usr/palm/frameworks/mojo/builtins/palmInitFramework330.js
18@@ -28075,7 +28075,7 @@ if(!this.isElementHighlighted&&this.trackballMode===false&&this.selectionMode===
19 this._addElementHighlight(event.centerX,event.centerY);
20 }
21
22-if(event.altKey){
23+if(event.altKey || event.metaKey){
24
25
26
  
1--- .orig/usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
2+++ /usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
3@@ -79,6 +79,7 @@
1diff --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
2index e4f2e91..e604fd4 100644
3--- a/usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
4+++ b/usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
5@@ -172,8 +172,11 @@ var ComposeAssistant = Class.create({
46 visible: true,
57 menuClass: 'palm-white',
68 items: [
79+ {label:$L('Priority'), icon:'priority', command:'priority'},
810 {label:$L('Attach'), icon:'attach', command:'attach'},
9 {label:$L('Send'), icon:'send', command:'send'}
10 ]};
11@@ -80,7 +81,8 @@
12 menuClass: 'palm-white',
13 items: [
14 {label:$L('Attach'), icon:'attach', command:'attach'},
1511- {label:$L('Send'), icon:'send', command:'send'}
16+ {label:('Send'), icon:'send', command:'send'},
12+ {label:$L('Save'), icon:'save', command:'save'},
13+ {label:$L('Send'), icon:'send', command:'send'},
1714+ {label:$L('Delete'),icon:'delete', command:'cancel'}
1815 ]};
1916
20 this.draftIsDirty = false;
21@@ -236,7 +238,15 @@
17 this.appMenuSaveIndex = 2;
18@@ -383,6 +386,7 @@ var ComposeAssistant = Class.create({
19 },
20
21 orientationChanged: function(orientation) {
22+ this.controller.stageController.setWindowOrientation(orientation);
23 if (orientation === "left" || orientation === "right") {
24 this.controller.sceneElement.addClassName('landscape');
25 } else {
26@@ -614,11 +618,26 @@ var ComposeAssistant = Class.create({
2227 break;
2328
29 case 'send':
30- this.send();
31+ this.controller.showAlertDialog({
32+ onChoose: function(value) {if (value == 'yes') {this.send();}},
33+ title: $L("Send This Message?"),
34+ choices:[
35+ {label:$L('Yes'), value:"yes", type:'negative'},
36+ {label:$L("No"), value:"no", type: 'dismiss'}
37+ ]
38+ });
39 break;
40
2441 case 'cancel':
2542- this.cancelCompose();
2643+ this.controller.showAlertDialog({
5252 break;
5353
5454 case 'priority':
55@@ -1164,8 +1183,7 @@ ComposeAssistant.onLoad = function(controller, email) {
56 if (email.action === ComposeAssistant.kForwardAction) {
57 controller.get('forwarded_msg_body').innerHTML = originalText;
58 } else {
59- bodyText += originalText;
60- editor.setStyle({'min-height':'320px', 'font-size': '18px'});
61+ controller.get('forwarded_msg_body').innerHTML = originalText;
62 }
63 editor.innerHTML = bodyText;
64
65@@ -1212,6 +1230,6 @@ ComposeAssistant.replaceURIs = function(originalText, email) {
66 ComposeAssistant.kForwardAction = 'forward';
67 ComposeAssistant.kAppMenuHighPriority = $L('Set as High Priority');
68 ComposeAssistant.kAppMenuNormalPriority = $L('Set as Normal Priority');
69-ComposeAssistant.kEmptySignatureRegex = /<span id="signature"><div style="font-family: arial, sans-serif; font-size: 12px;color: #999999;">[<br>]*<\/div>[<br>]*<\/span>/
70+ComposeAssistant.kEmptySignatureRegex = /<span id="signature"><div style="font-family: Calibri, sans-serif; font-size: 15px;color: #999999;">[<br>]*<\/div>[<br>]*<\/span>/
71 ComposeAssistant.kForwardDraftDelimeter = "<span id='FORWARD_DRAFT_TEXT' class='display:none'></span>";
72
  
1diff --git a/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js b/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
2index 84e13e3..6cb9384 100644
3--- a/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
4+++ b/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
5@@ -1799,9 +1799,210 @@ var ChatviewAssistant = Class.create({
6 this.addTextToClipboard(text);
7 } else if (value === 'delete-cmd') {
8 this.handleMessageDeleteFromContextMenu(messageId, index);
9+ } else if (value === "twitter-retweet-cmd") {
10+ Mojo.Log.info("twitter-retweet-cmd");
11+ this.twitterRetweet(text);
12+ } else if (value === "twitter-reply-cmd") {
13+ Mojo.Log.info("twitter-reply-cmd");
14+ this.twitterReply(text);
15+ } else if (value === "twitter-leave-user-cmd") {
16+ Mojo.Log.info("twitter-leave-user-cmd");
17+ this.twitterLeaveUser(text);
18+ }
19+ },
20+
21+ twitterSkipChain: function (body) {
22+ var originally_from, chainlink, result;
23+ var modified = false;
24+ Mojo.Log.info("twitterSkipChain(%j)", body);
25+ while (true) {
26+ // skip past any RT/via chains.
27+ if (/^\s*rt(?:\s*@\s*|\s+)([_A-Za-z0-9]+)(?:\s*:\s*|\s+)/i.test(body)) {
28+ // RT@user:... (space optional before or after @ and :)
29+ // RT user ...
30+ chainlink = RegExp.match;
31+ originally_from = RegExp.$1;
32+ body = RegExp.rightContext;
33+ Mojo.Log.info("twitterSkipChain: skipping 'RT' chain link: %j", chainlink);
34+ modified = true;
35+ }
36+ else if (/^\s*(?:[\(\[\{]\s*)?via(?:\s*@\s*|\s+)[_A-Za-z0-9]+(?:\s*[\)\]\}])?(?:\s*:\s*|\s+)/i.test(body)) {
37+ // (via@user):...
38+ // via user ...
39+ chainlink = RegExp.match;
40+ body = RegExp.rightContext;
41+ Mojo.Log.info("twitterSkipChain: skipping 'via' chain link: %j", chainlink);
42+ modified = true;
43+ }
44+ else {
45+ break;
46+ }
47+ }
48+ if (modified) {
49+ result = {
50+ body: body,
51+ originally_from: originally_from
52+ };
53+ }
54+ Mojo.Log.info("twitterSkipChain: returning %j", result);
55+ return result;
56+ },
57+
58+ twitterParseMessage: function (text) {
59+ var from, originally_from, body, chain, result;
60+ Mojo.Log.info("twitterParseMessage(%j)", text);
61+ if (/^Direct from (\S+):\s*(.*)/i.test(text)) {
62+ from = RegExp.$1;
63+ body = RegExp.$2;
64+ result = {
65+ direct: true,
66+ from: from,
67+ body: body
68+ };
69+ }
70+ else if (/^(\S+):\s*(.*)/.test(text)) {
71+ from = RegExp.$1;
72+ originally_from = from;
73+ body = RegExp.$2;
74+ chain = this.twitterSkipChain(body);
75+ if (chain) {
76+ if ("originally_from" in chain) {
77+ originally_from = chain.originally_from;
78+ }
79+ body = chain.body;
80+ }
81+ result = {
82+ direct: false,
83+ from: from,
84+ originally_from: originally_from,
85+ body: body
86+ };
87+ }
88+ Mojo.Log.info("twitterParseMessage: returning %j", result);
89+ return result;
90+ },
91+
92+ twitterRetweet: function (text) {
93+ Mojo.Log.info("twitterRetweet(%j)", text);
94+ var tweet = this.twitterParseMessage(text);
95+ if (tweet) {
96+ Mojo.Log.info("twitterRetweet: is an actionable tweet.");
97+ if (tweet.direct) {
98+ this.twitterErrorDialog("You cannot retweet a direct message.");
99+ }
100+ else {
101+ if (tweet.originally_from === tweet.from) {
102+ this.twitterSetTextFieldValue(
103+ "RT @" + tweet.originally_from + ": " + tweet.body
104+ );
105+ }
106+ else {
107+ this.twitterSetTextFieldValue(
108+ "RT @" + tweet.originally_from +
109+ " via @" + tweet.from + ": " + tweet.body
110+ );
111+ }
112+ }
113+ }
114+ else {
115+ Mojo.Log.info("twitterRetweet: is not an actionable tweet.");
116+ }
117+ },
118+
119+ twitterErrorDialog: function (error) {
120+ this.controller.showAlertDialog({
121+ onChoose: function () { },
122+ title: $L("Error"),
123+ message: $L(error),
124+ preventCancel: false,
125+ choices: [{ label: $L('Dismiss'), value: 'Dismiss' }]
126+ });
127+ },
128+
129+ twitterWarningDialog: function (warning) {
130+ this.controller.showAlertDialog({
131+ onChoose: function () { },
132+ title: $L("Warning"),
133+ message: $L(warning),
134+ preventCancel: false,
135+ choices: [{ label: $L('OK'), value: 'OK' }]
136+ });
137+ },
138+
139+ twitterSetTextFieldValue: function (text) {
140+ var self = this;
141+ var value = this.messageTextElement.value;
142+ if (/\S/.test(value)) {
143+ this.controller.showAlertDialog({
144+ onChoose: function (choice) {
145+ if (choice) {
146+ self.twitterSetTextFieldValueRaw(text);
147+ }
148+ },
149+ title: "Erase existing message?",
150+ message: "Your current message:\n" + value,
151+ preventCancel: false,
152+ choices: [{ label: $L('Yes'), value: true },
153+ { label: $L('No'), value: false }]
154+ });
155+ }
156+ else {
157+ this.twitterSetTextFieldValueRaw(text);
158+ }
159+ },
160+
161+ twitterSetTextFieldValueRaw: function (text) {
162+ this.setTextFieldValue(text);
163+ this.moveCursorToEndOfTextField();
164+ if (text.length > 140) {
165+ this.twitterWarningDialog("Your submission is longer than 140 characters. " +
166+ "Please shorten before sending.");
167+ }
168+ },
169+
170+ twitterReply: function (text) {
171+ Mojo.Log.info("twitterReply(%j)", text);
172+ var tweet = this.twitterParseMessage(text);
173+ if (tweet) {
174+ Mojo.Log.info("twitterReply: is an actionable tweet.");
175+ if (tweet.direct) {
176+ this.twitterSetTextFieldValue("D " + tweet.from + " ");
177+ }
178+ else {
179+ this.twitterSetTextFieldValue("@" + tweet.from + " ");
180+ }
181+ }
182+ else {
183+ Mojo.Log.info("twitterReply: is not an actionable tweet.");
184 }
185 },
186
187+ twitterLeaveUser: function (text) {
188+ Mojo.Log.info("twitterLeaveUser(%j)", text);
189+ var tweet = this.twitterParseMessage(text);
190+ if (tweet) {
191+ Mojo.Log.info("twitterLeaveUser: is an actionable tweet.");
192+ if (tweet.direct) {
193+ this.twitterSetTextFieldValue("leave " + tweet.from);
194+ }
195+ else {
196+ this.twitterSetTextFieldValue("leave " + tweet.from);
197+ }
198+ }
199+ else {
200+ Mojo.Log.info("twitterLeaveUser: is not an actionable tweet.");
201+ }
202+ },
203+
204+ moveCursorToEndOfTextField: function () {
205+ var widget = this.controller.get('messageTextWidget');
206+ if (widget) {
207+ widget = widget.mojo;
208+ }
209+ var len = widget.getValue().length;
210+ widget.setCursorPosition(len, len);
211+ },
212+
213 /**
214 * context menu handler for tap on MMS in chat list
215 *
216@@ -1937,15 +2138,36 @@ var ChatviewAssistant = Class.create({
217
218 var composeParams;
219 if ((messageType === "SMS") || (messageType === "IM")) {
220+ var menuItems = [
221+ {label: $L('Forward'), command: 'forward-cmd'},
222+ {label: $L('Forward Via Email'), command: 'forward-as-email-cmd'},
223+ {label: $L('Copy Text'), command: 'copy-cmd'},
224+ {label: $L('Delete'), command: 'delete-cmd'}
225+ ];
226+ var lcDisplayName = this.chatDisplayName.toLowerCase();
227+ if (lcDisplayName === "twitter" ||
228+ lcDisplayName === "40404") {
229+ var text = event.item.textForCopying;
230+ var tweet = this.twitterParseMessage(text);
231+ if (tweet) {
232+ if (tweet.direct) {
233+ menuItems.push({ label: $L('DM Reply'),
234+ command: 'twitter-reply-cmd' });
235+ }
236+ else {
237+ menuItems.push({ label: $L('Retweet'),
238+ command: 'twitter-retweet-cmd' });
239+ menuItems.push({ label: $L('Tweet Reply'),
240+ command: 'twitter-reply-cmd' });
241+ }
242+ menuItems.push({ label: $L('Leave User'),
243+ command: 'twitter-leave-user-cmd' });
244+ }
245+ }
246 this.controller.popupSubmenu({
247 onChoose: this.handleContextMenuSelectSmsIm.bind(this, event.item.textForCopying, messageId, event.index),
248 placeNear: eventTarget.target,
249- items: [
250- {label: $L('Forward'), command: 'forward-cmd'},
251- {label: $L('Forward Via Email'), command: 'forward-as-email-cmd'},
252- {label: $L('Copy Text'), command: 'copy-cmd'},
253- {label: $L('Delete'), command: 'delete-cmd'}
254- ]
255+ items: menuItems
256 });
257
258 } else if (messageType === "MMS") {
  
1diff --git a/usr/palm/applications/com.palm.app.phone/app/controllers/announcer-assistant.js b/usr/palm/applications/com.palm.app.phone/app/controllers/announcer-assistant.js
2index ced1495..f409e8e 100644
3--- a/usr/palm/applications/com.palm.app.phone/app/controllers/announcer-assistant.js
4+++ b/usr/palm/applications/com.palm.app.phone/app/controllers/announcer-assistant.js
5@@ -261,7 +261,6 @@ var AnnouncerAssistant = Class.create({
6 QDLogger.log( "announceMissed", number);
7
8 // get contact info
9- var name = this.getDisplayNameFromContact(contact);
10
11 // if on a call, go straight to dashboard and don't show popup
12 if (this.appAssistant.telephonyEventListener.callExists()) {
13@@ -342,6 +341,8 @@ var AnnouncerAssistant = Class.create({
14 call.displayName = this.getDisplayNameFromContact(contact);
15 if (!(call.displayName)) {
16 call.displayName = FormatPhoneNumber(number);
17+ var message = Messages.contactWithLabel;
18+ call.displayName = new Template(message).evaluate({"contact":call.displayName, "label":RegionLookup.regionFromPhoneNumber(number)});
19 } else if (contact.labelFormatted) {
20 var message = Messages.contactWithLabel;
21 call.displayName = new Template(message).evaluate({"contact":call.displayName, "label":contact.labelFormatted});
22diff --git a/usr/palm/applications/com.palm.app.phone/app/controllers/incomingcall-assistant.js b/usr/palm/applications/com.palm.app.phone/app/controllers/incomingcall-assistant.js
23index 6b6ea1a..305f0ab 100644
24--- a/usr/palm/applications/com.palm.app.phone/app/controllers/incomingcall-assistant.js
25+++ b/usr/palm/applications/com.palm.app.phone/app/controllers/incomingcall-assistant.js
26@@ -177,7 +177,7 @@ var IncomingcallAssistant = Class.create({
27 } else if (contact.cnapName && contact.cnapName !== "unknown") {
28 name = contact.cnapName;
29 } else {
30- name = Messages.unknownCaller;
31+ name = RegionLookup.regionFromPhoneNumber(number);
32 }
33
34 this.fromContacts = fromContacts;
35diff --git a/usr/palm/applications/com.palm.app.phone/app/controllers/missedcall-assistant.js b/usr/palm/applications/com.palm.app.phone/app/controllers/missedcall-assistant.js
36index e03c2f8..77d20db 100644
37--- a/usr/palm/applications/com.palm.app.phone/app/controllers/missedcall-assistant.js
38+++ b/usr/palm/applications/com.palm.app.phone/app/controllers/missedcall-assistant.js
39@@ -70,7 +70,7 @@ var MissedcallAssistant = Class.create({
40 }
41
42 // ensure empty label is displayed as empty
43- this.displayLabel = (this.contact.labelFormatted ? this.contact.labelFormatted : "");
44+ this.displayLabel = (this.contact.labelFormatted ? this.contact.labelFormatted : RegionLookup.regionFromPhoneNumber(number));
45 var tempDateString = Mojo.Format.formatDate(new Date(parseInt(timeStamp)), {time:'short'});
46 this.message = message.interpolate({timeStamp: tempDateString});
47 QDLogger.log( "MissedcallAssistant::updateFields", "end");
48diff --git a/usr/palm/applications/com.palm.app.phone/app/models/CallLogList.js b/usr/palm/applications/com.palm.app.phone/app/models/CallLogList.js
49index da78b23..0fef85c 100644
50--- a/usr/palm/applications/com.palm.app.phone/app/models/CallLogList.js
51+++ b/usr/palm/applications/com.palm.app.phone/app/models/CallLogList.js
52@@ -58,7 +58,7 @@ var CallLogList = (function() {
53 // Wasn't in our contacts
54 var label = item.label;
55 if (label == -1) {
56- item.displayLabel = '';
57+ item.displayLabel = RegionLookup.regionFromPhoneNumber(item.number);
58 item.displayShortlabel = '';
59
60 // Was in our contacts
61diff --git a/usr/palm/applications/com.palm.app.phone/app/models/FormattedCall.js b/usr/palm/applications/com.palm.app.phone/app/models/FormattedCall.js
62index 1e4b4b5..1046dbd 100644
63--- a/usr/palm/applications/com.palm.app.phone/app/models/FormattedCall.js
64+++ b/usr/palm/applications/com.palm.app.phone/app/models/FormattedCall.js
65@@ -50,7 +50,7 @@ var FormattedCall = Class.create({
66 this.id = callMsg[lineNumber].id;
67
68 // ensure empty label is displayed as empty
69- this.displayLabel = (callMsg[lineNumber].contact.labelFormatted ? callMsg[lineNumber].contact.labelFormatted : "");
70+ this.displayLabel = (callMsg[lineNumber].contact.labelFormatted ? callMsg[lineNumber].contact.labelFormatted : RegionLookup.regionFromPhoneNumber(callMsg[lineNumber].number));
71 this.numberCaption = ((callMsg[lineNumber].contact.name !== undefined || callMsg[lineNumber].contact.id !== undefined) ? this.number : " ");
72
73 },
  
1diff --git a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
2index a4a150e..37ecd2f 100644
3--- a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
4+++ b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
5@@ -1698,7 +1698,7 @@ handlePowerNotifications: function(payload) {
6 this.controller.showBanner({
7 messageText: batteryalert,
8 icon: "/usr/lib/luna/system/luna-systemui/images/battery-"+i+'.png',
9- soundClass: "notifications"
10+ soundClass: "none"
11 },{}, 'batteryAlert');
12 }
13 else if(this.batteryLevel > 10 && this.batteryLevel <= 20 && !this.batteryLevel20Shown) {
  
1diff --git a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
2index a4a150e..11149e4 100644
3--- a/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
4+++ b/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
5@@ -1707,7 +1707,7 @@ handlePowerNotifications: function(payload) {
6 this.controller.showBanner({
7 messageText: batteryalert,
8 icon: "/usr/lib/luna/system/luna-systemui/images/battery-"+i+'.png',
9- soundClass: "notifications"
10+ soundClass: "none"
11 },{}, 'batteryAlert');
12 }
13
  
1diff --git a/usr/palm/applications/com.palm.app.notes/app/controllers/app-assistant.js b/usr/palm/applications/com.palm.app.notes/app/controllers/app-assistant.js
2index 410a4ad..ce1055d 100644
3--- a/usr/palm/applications/com.palm.app.notes/app/controllers/app-assistant.js
4+++ b/usr/palm/applications/com.palm.app.notes/app/controllers/app-assistant.js
5@@ -12,8 +12,20 @@ var AppAssistant = Class.create
6
7 handleLaunch: function(params)
8 {
9+ Mojo.Log.info("APP ASSISTANT: handleLaunch: %j", params);
10 var name = 'notes';
11 var stageController = this.controller.getStageController(name);
12+ if (params && ("newNoteText" in params)) {
13+ Mojo.Log.info("APP ASSISTANT: newNoteText: %j", params.newNoteText);
14+ this.data.newNoteText = params.newNoteText;
15+ }
16+ else {
17+ Mojo.Log.info("APP ASSISTANT: newNoteText: %j", null);
18+ this.data.newNoteText = null;
19+ }
20+ if (params && ("refresh" in params)) {
21+ this.data.refresh = params.refresh;
22+ }
23 if (stageController)
24 {
25 this.launch(false, stageController);
26@@ -32,6 +44,27 @@ var AppAssistant = Class.create
27 {
28 if (!created)
29 {
30+ var scenes = stageController.getScenes();
31+ if ("newNoteText" in this.data && this.data.newNoteText !== null) {
32+ if (!(scenes && scenes.length === 1)) {
33+ // doing this if the top scene
34+ // is already 'grid' causes an
35+ // unwanted transition effect.
36+ stageController.popScenesTo('grid');
37+ }
38+ else {
39+ // In GridAssistant, activate() calls
40+ // refreshList() which calls
41+ // _createNewNoteFromParams().
42+ // Since in this situation activate
43+ // isn't called, we do this "manually".
44+ stageController.delegateToSceneAssistant('_createNewNoteFromParams');
45+ }
46+ }
47+ else if (this.data.refresh &&
48+ scenes && scenes.length === 1) {
49+ stageController.delegateToSceneAssistant('_refreshList');
50+ }
51 stageController.activate();
52 }
53 else
54diff --git a/usr/palm/applications/com.palm.app.notes/app/controllers/grid-assistant.js b/usr/palm/applications/com.palm.app.notes/app/controllers/grid-assistant.js
55index d470fb2..9aff3e9 100644
56--- a/usr/palm/applications/com.palm.app.notes/app/controllers/grid-assistant.js
57+++ b/usr/palm/applications/com.palm.app.notes/app/controllers/grid-assistant.js
58@@ -100,7 +100,7 @@ var GridAssistant = Class.create(
59 this.controller.getSceneScroller().mojo.revealTop(0);
60 },
61
62- _handleNewNote: function()
63+ _handleNewNote: function(newNoteText)
64 {
65 // Get top element. We insert before this one so we need to know its position and its color
66 var top = this.$widget_noteGrid.getItemAt(0, 1); // row-0,col-1 : Skip notepad which is element 0
67@@ -115,6 +115,7 @@ var GridAssistant = Class.create(
68 }
69 this.controller.stageController.pushScene('note',
70 {
71+ newNoteText: newNoteText,
72 model: this.model,
73 color: Note.colors[(Note.colors.indexOf(top.color) + 1) % Note.colors.length],
74 position: this._findInsertPosition('a', top.position),
75@@ -122,6 +123,13 @@ var GridAssistant = Class.create(
76 });
77 },
78
79+ _createNewNoteFromParams: function () {
80+ if ("newNoteText" in this.data && this.data.newNoteText !== null) {
81+ this._handleNewNote(this.data.newNoteText);
82+ this.data.newNoteText = null;
83+ }
84+ },
85+
86 _handleEditNote: function(id, color)
87 {
88 this.controller.stageController.pushScene('note',
89@@ -280,6 +288,7 @@ var GridAssistant = Class.create(
90 self._fixMissingInfo(list, 1);
91 self.$widget_noteGrid.render(list);
92 self._enableDisableFilter(total);
93+ self._createNewNoteFromParams();
94 done && done();
95 });
96 },
97diff --git a/usr/palm/applications/com.palm.app.notes/app/controllers/note-assistant.js b/usr/palm/applications/com.palm.app.notes/app/controllers/note-assistant.js
98index fd50861..9d5de78 100644
99--- a/usr/palm/applications/com.palm.app.notes/app/controllers/note-assistant.js
100+++ b/usr/palm/applications/com.palm.app.notes/app/controllers/note-assistant.js
101@@ -57,6 +57,13 @@ var NoteAssistant = Class.create(
102 green: {},
103 blue: {}
104 };
105+ Mojo.Log.info("NOTE ASSISTANT: data.newNoteText: %j", data.newNoteText);
106+ if (data.newNoteText) {
107+ this.newNoteText = data.newNoteText;
108+ }
109+ else {
110+ this.newNoteText = "";
111+ }
112 },
113
114 setup: function()
115@@ -80,9 +87,16 @@ var NoteAssistant = Class.create(
116 }
117 else
118 {
119+ var text = data.text;
120+ Mojo.Log.info("NOTE ASSISTANT: this.newNoteText: %j", this.newNoteText);
121+ if (this.newNoteText !== "") {
122+ text = this.newNoteText + "\n\n" +
123+ Mojo.Format.formatDate(new Date(), "short") +
124+ "\n";
125+ }
126 this._onNoteLoaded.bind(this).defer(new Note(
127 {
128- text: data.text,
129+ text: text,
130 color: data.color,
131 position: data.position
132 }), true);
133diff --git a/usr/palm/applications/com.palm.app.notes/appinfo.json b/usr/palm/applications/com.palm.app.notes/appinfo.json
134index c25552f..eb9e0f9 100644
135--- a/usr/palm/applications/com.palm.app.notes/appinfo.json
136+++ b/usr/palm/applications/com.palm.app.notes/appinfo.json
137@@ -9,5 +9,5 @@
138 "splashicon": "icon-256x256.png",
139 "splashBackground": "images/splash-screenshot-default.png",
140 "noWindow": true,
141- "keywords": ["Notes", "Stickies", "Notepad"]
142+ "keywords": ["Notes", "Stickies", "Notepad", "iGrokTheCommandLine", "iCanBeRefreshed"]
143 }