Commit 70ecfc08b2f7ce99fcfc80225a329c36ac604541

  • avatar
  • Daniel Beames <dbeames @beames…ptop.(none)>
  • Thu Oct 29 05:43:20 CET 2009
Four more patches submitted with script.
  
1Copyright (c) 2009 PrestonJames
2
3Permission is hereby granted, free of charge, to any person
4obtaining a copy of this software and associated documentation
5files (the "Software"), to deal in the Software without
6restriction, including without limitation the rights to use,
7copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the
9Software is furnished to do so, subject to the following
10conditions:
11
12The above copyright notice and this permission notice shall be
13included in all copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22OTHER DEALINGS IN THE SOFTWARE.
  
1--- .orig/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
2+++ /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
3@@ -8,7 +8,7 @@
4 * hardcoding the quick launch height until we can find a better way.
5 * This value = ql graphic height - the offset from the top (small fade area)
6 */
7- kQuickLaunchHeight: 67,
8+ kQuickLaunchHeight: 0,
9
10 kPageIndicatorSpacing: 6, /* spacing between each page indicator */
11 kPageMargin: 10, /* 10 pixel margin on each side of a page */
12\ No newline at end of file
  
1Copyright (c) 2009 dallashigh <karl@webosnerd.com>
2
3Permission is hereby granted, free of charge, to any person
4obtaining a copy of this software and associated documentation
5files (the "Software"), to deal in the Software without
6restriction, including without limitation the rights to use,
7copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the
9Software is furnished to do so, subject to the following
10conditions:
11
12The above copyright notice and this permission notice shall be
13included in all copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22OTHER DEALINGS IN THE SOFTWARE.
  
1Index: /usr/palm/applications/com.palm.app.email/app/controllers/accountpreferences-assistant.js
2===================================================================
3--- /usr/palm/applications/com.palm.app.email/app/controllers/~accountpreferences-assistant.js
4+++ /usr/palm/applications/com.palm.app.email/app/controllers/accountpreferences-assistant.js
5@@ -436,7 +436,16 @@
6 {label: $L('15 minutes'), value: 15},
7 {label: $L('30 minutes'), value: 30},
8 {label: $L('1 hour'), value: 60},
9+ {label: '2 hours', value: 120},
10+ {label: '3 hours', value: 180},
11+ {label: '4 hours', value: 240},
12+ {label: '5 hours', value: 300},
13 {label: $L('6 hours'), value: 360},
14+ {label: '7 hours', value: 420},
15+ {label: '8 hours', value: 480},
16+ {label: '9 hours', value: 540},
17+ {label: '10 hours', value: 600},
18+ {label: '11 hours', value: 660},
19 {label: $L('12 hours'), value: 720},
20 {label: $L('24 hours'), value: 1440},
21 {label: $L('Manual'), value: 1000000}
  
1Copyright (c) 2009 dsevil <dse@webonastick.com>
2
3Permission is hereby granted, free of charge, to any person
4obtaining a copy of this software and associated documentation
5files (the "Software"), to deal in the Software without
6restriction, including without limitation the rights to use,
7copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the
9Software is furnished to do so, subject to the following
10conditions:
11
12The above copyright notice and this permission notice shall be
13included in all copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22OTHER DEALINGS IN THE SOFTWARE.
  
1Index: /usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js
2===================================================================
3--- .orig/usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js
4+++ /usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js
5@@ -37,6 +37,12 @@
6 'noDomain': 'IM'
7 };
8
9+if (!String.prototype.trim) {
10+ String.prototype.trim = function () {
11+ return this.replace(/^\s+/, "").replace(/\s+$/, "");
12+ };
13+}
14+
15 GlobalSearchAssistant = Class.create({
16 initialize : function(controller, appAssistant) {
17
18@@ -71,6 +77,8 @@
19 '2': $L("Other")
20 };
21
22+ this.buildCommandLineAppList();
23+
24 this.quickDial = {};
25 this.searchApps = $A();
26 this.globalSearchModel = {mode:'vertical'};
27@@ -119,6 +127,9 @@
28 this.webDrawer = { showWeb: false };
29 this.controller.setupWidget('web_drawer', {unstyled:true, property:'showWeb'}, this.webDrawer);
30
31+ this.commandLineDrawer = { showCommandLine: false };
32+ this.controller.setupWidget('command_line_drawer', {unstyled: true, property: 'showCommandLine'}, this.commandLineDrawer);
33+
34 //set up searchtermfield
35 this.searchTermTextAttributes = {
36 textReplacement:false,
37@@ -1284,6 +1295,226 @@
38 ApplicationService.launch('com.palm.app.browser', params);
39 },
40
41+ commandEntries: {
42+ "calc": {
43+ usage: "<i>expression</i>",
44+ description: "Perform a calculation.",
45+ method: function (s) {
46+ // Yes, I'm aware that eval is usually
47+ // evil. The user chooses to use 'calc'
48+ // at their own risk. I'm only using it
49+ // here because I'm too lazy at the
50+ // moment to write an infix expression
51+ // calculator.
52+ var result = eval(s);
53+ var that = this;
54+ this.controller.showAlertDialog({
55+ onChoose: function () { that.deactivate(); },
56+ title: "Result",
57+ message: s + " = " + result,
58+ choices: [ { label: "OK", value: "ok" } ]
59+ });
60+ }
61+ },
62+ "imdb": {
63+ usage: "<i>query</i>",
64+ description: "Find something on IMDB.com.",
65+ url: "http://www.imdb.com/find?s=all&q="
66+ },
67+ "dict": {
68+ usage: "<i>word</i>",
69+ description: "Find a word on Dictionary.com.",
70+ url: "http://m.reference.com/d/search.html?q="
71+ },
72+ "thes": {
73+ usage: "<i>word</i>",
74+ description: "Find a word on Thesaurus.com.",
75+ url: "http://m.reference.com/t/search.html?q="
76+ },
77+ "memo": "note",
78+ "note": {
79+ usage: "<i>text</i>",
80+ description: "Quickly create a new note.",
81+ appId: "com.palm.app.notes",
82+ param: "newNoteText"
83+ },
84+ "m": "memo",
85+ "n": "note",
86+ "c": "calc",
87+ "d": "dict",
88+ "th": "thes",
89+ "help": {
90+ method: function () {
91+ var that = this;
92+ var commands = [];
93+ var realCommands = [];
94+ var aka = {};
95+ var command;
96+ var entry;
97+ var aliasedTo;
98+
99+ for (command in this.commandEntries) {
100+ if (this.commandEntries.hasOwnProperty(command)) {
101+ if (command === "help") {
102+ continue;
103+ }
104+ commands.push(command);
105+ }
106+ }
107+ commands.forEach(function (command) {
108+ aliasedTo = null;
109+ entry = that.commandEntries[command];
110+ if (entry.constructor === String) {
111+ while (entry.constructor === String) {
112+ aliasedTo = entry;
113+ entry = that.commandEntries[entry];
114+ }
115+ }
116+ else {
117+ if (entry.appId &&
118+ that.commandLineApps &&
119+ !that.commandLineApps[entry.appId + "_default"]) {
120+ return;
121+ }
122+ realCommands.push(command);
123+ }
124+ if (aliasedTo) {
125+ if (!aka[aliasedTo]) {
126+ aka[aliasedTo] = [];
127+ }
128+ aka[aliasedTo].push(command);
129+ }
130+ });
131+ var html = "";
132+ html += "<div style='font-size: smaller;'>";
133+ realCommands.forEach(function (command) {
134+ var entry = that.commandEntries[command];
135+ if (!aka[command]) {
136+ aka[command] = [];
137+ }
138+ html += "<div style='text-indent: -1em; padding-left: 1em;'>";
139+ html += "<b>";
140+ html += (aka[command].concat([command]).
141+ map(function (s) { return "." + s; }).
142+ join("|"));
143+ html += "</b>";
144+ if (entry.usage) {
145+ html += " " + entry.usage;
146+ }
147+ if (entry.description) {
148+ html += " &mdash; " + entry.description;
149+ }
150+ html += "</div>";
151+ });
152+ html += "</div>";
153+ this.controller.showAlertDialog({
154+ onChoose: function () { that.deactivate(); },
155+ title: "Commands",
156+ message: html,
157+ allowHTMLMessage: true,
158+ choices: [ { label: "OK", value: "ok" } ]
159+ });
160+ }
161+ },
162+ },
163+
164+ deactivateWithError: function (message) {
165+ var that = this;
166+ this.controller.showAlertDialog({
167+ onChoose: function () { that.deactivate(); },
168+ title: "Error",
169+ message: message,
170+ choices: [ { label: "OK", value: "ok" } ]
171+ });
172+ },
173+
174+ runCommand: function (command, arg) {
175+ if (!this.commandEntries) {
176+ return null;
177+ }
178+ var entry = this.commandEntries[command];
179+ if (!entry) {
180+ this.deactivateWithError("." + command + ": Command not found.");
181+ return null;
182+ }
183+ while (entry.constructor === String) {
184+ // handle aliases.
185+ entry = this.commandEntries[entry];
186+ }
187+ if (!entry) {
188+ this.deactivateWithError("." + command + ": Command not found.");
189+ return null;
190+ }
191+ if (arg === "") {
192+ this.deactivateWithError("." + command + ": No arguments specified.");
193+ return null;
194+ }
195+ if (entry.method) {
196+ var result = entry.method.apply(this, [arg]);
197+ return result;
198+ }
199+ else if (entry.appId) {
200+ if (this.commandLineApps &&
201+ !this.commandLineApps[entry.appId + "_default"]) {
202+ this.deactivateWithError("." + command + ": The application " + entry.appId +
203+ " is not configured for the Universal Search Command Line.");
204+ return null;
205+ }
206+ var params = {};
207+ params[entry.param] = arg;
208+ this.controller.serviceRequest(
209+ "palm://com.palm.applicationManager", {
210+ method: "launch",
211+ parameters: {
212+ id: entry.appId,
213+ params: params
214+ }
215+ }
216+ );
217+ }
218+ else if (entry.url) {
219+ this.launchBrowser(entry.url + encodeURIComponent(arg.trim()));
220+ }
221+ else {
222+ this.deactivateWithError("." + command + ": Command not implemented.");
223+ return null;
224+ }
225+ },
226+
227+ buildCommandLineAppList: function () {
228+ // get a complete list of apps.
229+ this.commandLineListRequest =
230+ new Mojo.Service.Request("palm://com.palm.applicationManager", {
231+ method: 'searchApps',
232+ parameters: {'keyword': 'igrokthecommandline'},
233+ onSuccess: this.handleAppResultsForCommandLineList.bind(this),
234+ onFailure: this.handleAppResultsForCommandLineList.bind(this)
235+ });
236+ },
237+
238+ handleAppResultsForCommandLineList: function (response) {
239+ var that = this;
240+ var apps = response.apps;
241+ if (!apps) {
242+ return;
243+ }
244+ this.commandLineApps = {};
245+ apps.forEach(function (app) {
246+ var launchPoint = app.launchPoint;
247+ that.commandLineApps[launchPoint] = true;
248+ });
249+ },
250+
251+ runCommandLine: function (s) {
252+ if (!/^\s*\.(\S+)\s*(.*)$/.test(s)) {
253+ this.deactivateWithError("No command supplied.");
254+ return;
255+ }
256+ var command = RegExp.$1;
257+ var arg = RegExp.$2;
258+ return this.runCommand(command, arg);
259+ },
260+
261 launchHelpApp: function(url) {
262 var params = {"target":"http://help.palm.com/search/results.cgi?q="+this.buildSearchQuery(url)};
263 ApplicationService.launch('com.palm.app.help', params);
264@@ -1305,10 +1536,22 @@
265 $('webtext').innerHTML = this.currentFilter;
266 this.webDrawer.showWeb = true;
267 this.controller.modelChanged(this.webDrawer);
268+ this.commandLineDrawer.showCommandLine = false;
269+ this.controller.modelChanged(this.commandLineDrawer);
270+ }
271+ else if (this.commandLineString(this.currentFilter)) {
272+ //$('twitter').removeClassName('last');
273+ $('commandlinetext').innerHTML = this.currentFilter;
274+ this.webDrawer.showWeb = false;
275+ this.controller.modelChanged(this.webDrawer);
276+ this.commandLineDrawer.showCommandLine = true;
277+ this.controller.modelChanged(this.commandLineDrawer);
278 }
279 else {
280 this.webDrawer.showWeb = false ;
281 this.controller.modelChanged(this.webDrawer);
282+ this.commandLineDrawer.showCommandLine = false ;
283+ this.controller.modelChanged(this.commandLineDrawer);
284 //$('twitter').addClassName('last');
285 }
286 $('find').removeClassName('single');
287@@ -1340,11 +1583,23 @@
288 $('webtext').innerHTML = this.currentFilter;
289 this.webDrawer.showWeb = true;
290 this.controller.modelChanged(this.webDrawer);
291+ this.commandLineDrawer.showCommandLine = false;
292+ this.controller.modelChanged(this.commandLineDrawer);
293+ }
294+ else if (this.commandLineString(this.currentFilter)) {
295+ //$('twitter').removeClassName('last');
296+ $('commandlinetext').innerHTML = this.currentFilter;
297+ this.webDrawer.showWeb = false;
298+ this.controller.modelChanged(this.webDrawer);
299+ this.commandLineDrawer.showCommandLine = true;
300+ this.controller.modelChanged(this.commandLineDrawer);
301 }
302 else {
303 //$('twitter').addClassName('last');
304 this.webDrawer.showWeb = false;
305 this.controller.modelChanged(this.webDrawer);
306+ this.commandLineDrawer.showCommandLine = false;
307+ this.controller.modelChanged(this.commandLineDrawer);
308 }
309 $('find').removeClassName('single');
310 $('find').addClassName('first');
311@@ -1395,10 +1650,22 @@
312 $('webtext').innerHTML = this.currentFilter;
313 this.webDrawer.showWeb = true;
314 this.controller.modelChanged(this.webDrawer);
315+ this.commandLineDrawer.showCommandLine = false;
316+ this.controller.modelChanged(this.commandLineDrawer);
317+ }
318+ else if (this.commandLineString(this.currentFilter)) {
319+ //$('twitter').removeClassName('last');
320+ $('commandlinetext').innerHTML = this.currentFilter;
321+ this.webDrawer.showWeb = false;
322+ this.controller.modelChanged(this.webDrawer);
323+ this.commandLineDrawer.showCommandLine = true;
324+ this.controller.modelChanged(this.commandLineDrawer);
325 }
326 else {
327 this.webDrawer.showWeb = false;
328 this.controller.modelChanged(this.webDrawer);
329+ this.commandLineDrawer.showCommandLine = false;
330+ this.controller.modelChanged(this.commandLineDrawer);
331 //$('twitter').addClassName('last');
332 }
333 $('find').removeClassName('single');
334@@ -1653,6 +1920,8 @@
335 this.numberDiv.hide();
336 this.webDrawer.showWeb = false ;
337 this.controller.modelChanged(this.webDrawer);
338+ this.commandLineDrawer.showCommandLine = false ;
339+ this.controller.modelChanged(this.commandLineDrawer);
340 this.expandedSearchDrawer.showExpanded = false;
341 this.controller.modelChanged(this.expandedSearchDrawer);
342 this.searchApps.clear();
343@@ -1661,10 +1930,15 @@
344 $('wikipedia').removeClassName('selected');
345 $('twitter').removeClassName('selected');
346 $('web').removeClassName('selected');
347+ $('commandLine').removeClassName('selected');
348 this.searchField.mojo.setText("");
349 this.gpsInfo = undefined;
350 },
351
352+ commandLineString: function (s) {
353+ return /^\s*\./.test(s);
354+ },
355+
356 webSiteString: function(s){
357 if (s.indexOf("http://") == 0)
358 return s;
359@@ -1762,6 +2036,7 @@
360 //clear search':
361 $('google').removeClassName('palm-focus');
362 $('web').removeClassName('palm-focus');
363+ $('commandLine').removeClassName('palm-focus');
364 },
365 highlightSelection: function() {
366
367@@ -1821,11 +2096,19 @@
368 if (this.webDrawer.showWeb == true) {
369 $('google').removeClassName('palm-focus');
370 $('web').addClassName('palm-focus');
371+ $('commandLine').removeClassName('palm-focus');
372 this.highlightTarget = $('web');
373 }
374+ else if (this.commandLineDrawer.showCommandLine == true) {
375+ $('google').removeClassName('palm-focus');
376+ $('web').removeClassName('palm-focus');
377+ $('commandLine').addClassName('palm-focus');
378+ this.highlightTarget = $('commandLine');
379+ }
380 else if(this.expandedSearchDrawer.showExpanded == true){
381 $('google').addClassName('palm-focus');
382 $('web').removeClassName('palm-focus');
383+ $('commandLine').removeClassName('palm-focus');
384 this.highlightTarget = $('google');
385 }
386 break;
387@@ -1833,6 +2116,7 @@
388 if (this.enterKeyActionItem != "search") {
389 $('google').removeClassName('palm-focus');
390 $('web').removeClassName('palm-focus');
391+ $('commandLine').removeClassName('palm-focus');
392 }
393 },
394
395@@ -1922,6 +2206,8 @@
396 }
397 if (this.webDrawer.showWeb == true)
398 this.launchBrowser(this.currentFilter);
399+ else if (this.commandLineDrawer.showCommandLine == true)
400+ this.runCommandLine(this.currentFilter);
401 else {
402 this.launchBrowser(this.URLs['google'] + encodeURIComponent(this.currentFilter));
403 }
404Index: /usr/lib/luna/system/luna-applauncher/app/views/global-search/expanded-searches-div.html
405===================================================================
406--- .orig/usr/lib/luna/system/luna-applauncher/app/views/global-search/expanded-searches-div.html
407+++ /usr/lib/luna/system/luna-applauncher/app/views/global-search/expanded-searches-div.html
408@@ -36,4 +36,14 @@
409 </div>
410 </div>
411 </div>
412+ <div id='command_line_drawer' x-mojo-element="Drawer">
413+ <div class="palm-row last" id="commandLine" name="search-identifier" x-mojo-tap-highlight="persistent">
414+ <div class="palm-row-wrapper">
415+ <div class="title search-command-line truncating-text">
416+ <span class="prefix">cmd:</span>
417+ <span id="commandlinetext">#{filterText}</span>
418+ </div>
419+ </div>
420+ </div>
421+ </div>
422 </div>
423\ No newline at end of file
424Index: /usr/lib/luna/system/luna-applauncher/stylesheets/global-search.css
425===================================================================
426--- .orig/usr/lib/luna/system/luna-applauncher/stylesheets/global-search.css
427+++ /usr/lib/luna/system/luna-applauncher/stylesheets/global-search.css
428@@ -161,6 +161,16 @@
429 text-align: center;
430 }
431
432+.palm-group.search .search-command-line {
433+ text-align: left;
434+ font-size: smaller;
435+ color: yellow;
436+}
437+.palm-group.search .search-command-line .prefix {
438+ color: black;
439+ font-weight: bold;
440+}
441+
442 .palm-group.search .palm-group-title {
443 max-width: 264px;
444 }
  
1Copyright (c) 2009 dsevil <dse@webonastick.com>
2
3Permission is hereby granted, free of charge, to any person
4obtaining a copy of this software and associated documentation
5files (the "Software"), to deal in the Software without
6restriction, including without limitation the rights to use,
7copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the
9Software is furnished to do so, subject to the following
10conditions:
11
12The above copyright notice and this permission notice shall be
13included in all copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22OTHER DEALINGS IN THE SOFTWARE.
  
1Index: /usr/palm/applications/com.palm.app.notes/app/controllers/app-assistant.js
2===================================================================
3--- .orig/usr/palm/applications/com.palm.app.notes/app/controllers/app-assistant.js
4+++ /usr/palm/applications/com.palm.app.notes/app/controllers/app-assistant.js
5@@ -13,6 +13,12 @@
6 {
7 var name = 'notes';
8 var stageController = this.controller.getStageController(name);
9+ if (params && ("newNoteText" in params)) {
10+ this.data.newNoteText = params.newNoteText;
11+ }
12+ else {
13+ this.data.newNoteText = null;
14+ }
15 if (stageController)
16 {
17 this.launch(false, stageController);
18@@ -31,6 +37,24 @@
19 {
20 if (!created)
21 {
22+ if ("newNoteText" in this.data && this.data.newNoteText !== null) {
23+ var scenes = stageController.getScenes();
24+ var top = scenes[0];
25+ if (!(scenes && scenes.length === 1)) {
26+ // doing this if the top scene
27+ // is already 'grid' causes an
28+ // unwanted transition effect.
29+ stageController.popScenesTo('grid');
30+ }
31+ else {
32+ // In GridAssistant, activate() calls
33+ // refreshList() which calls
34+ // _createNewNoteFromParams().
35+ // Since in this situation activate
36+ // isn't called, we do this "manually".
37+ stageController.delegateToSceneAssistant('_createNewNoteFromParams');
38+ }
39+ }
40 stageController.activate();
41 }
42 else
43Index: /usr/palm/applications/com.palm.app.notes/app/controllers/grid-assistant.js
44===================================================================
45--- .orig/usr/palm/applications/com.palm.app.notes/app/controllers/grid-assistant.js
46+++ /usr/palm/applications/com.palm.app.notes/app/controllers/grid-assistant.js
47@@ -136,7 +136,7 @@
48 this.controller.getSceneScroller().mojo.revealTop(0);
49 },
50
51- handleNewNote: function()
52+ handleNewNote: function(newNoteText)
53 {
54 // Get top element. We insert before this one so we need to know its position and its color
55 var top = this.gridElement.mojo.getItemAt(0, 1); // row-0,col-1 : Skip notepad which is element 0
56@@ -151,12 +151,20 @@
57 }
58 this.controller.stageController.pushScene('note',
59 {
60+ newNoteText: newNoteText,
61 model: this.model,
62 color: Note.colors[(Note.colors.indexOf(top.color) + 1) % Note.colors.length],
63 position: this._findInsertPosition('a', top.position)
64 });
65 },
66
67+ _createNewNoteFromParams: function () {
68+ if ("newNoteText" in this.data && this.data.newNoteText !== null) {
69+ this.handleNewNote(this.data.newNoteText);
70+ this.data.newNoteText = null;
71+ }
72+ },
73+
74 handleEditNote: function(id, color)
75 {
76 this.controller.stageController.pushScene('note',
77@@ -330,6 +338,7 @@
78 self.gridElement.mojo.render(list);
79 self._enableDisableFilter(total);
80 self._ready.defer();
81+ self._createNewNoteFromParams();
82 });
83 },
84
85Index: /usr/palm/applications/com.palm.app.notes/app/controllers/note-assistant.js
86===================================================================
87--- .orig/usr/palm/applications/com.palm.app.notes/app/controllers/note-assistant.js
88+++ /usr/palm/applications/com.palm.app.notes/app/controllers/note-assistant.js
89@@ -18,6 +18,12 @@
90 color: data.color,
91 position: data.position,
92 };
93+ if (data.newNoteText) {
94+ this.newNoteText = data.newNoteText;
95+ }
96+ else {
97+ this.newNoteText = "";
98+ }
99 },
100
101 setup: function()
102@@ -48,7 +54,7 @@
103 };
104 this.noteTextModel =
105 {
106- value: isnew ? '' : ' ',
107+ value: isnew ? this.newNoteText : ' ',
108 disabled: false
109 };
110 this.controller.setupWidget('noteText', this.noteTextAttributes, this.noteTextModel);
111Index: /usr/palm/applications/com.palm.app.notes/appinfo.json
112===================================================================
113--- .orig/usr/palm/applications/com.palm.app.notes/appinfo.json
114+++ /usr/palm/applications/com.palm.app.notes/appinfo.json
115@@ -7,5 +7,5 @@
116 "version": "1.0",
117 "icon": "icon.png",
118 "noWindow": true,
119- "keywords": ["Notes", "Stickies", "Notepad"]
120+ "keywords": ["Notes", "Stickies", "Notepad", "iGrokTheCommandLine"]
121 }