http://wiki.webos-internals.org/api.php?action=feedcontributions&user=HattCzech&feedformat=atomWebOS Internals - User contributions [en]2024-03-29T14:56:41ZUser contributionsMediaWiki 1.35.1http://wiki.webos-internals.org/index.php?title=Icons&diff=4735Icons2009-08-23T22:53:20Z<p>HattCzech: /* Just Talk Below */</p>
<hr />
<div>== This is a Thinking Page at the Moment ==<br />
<br />
Trying to decide a way to bring the webOS-Internals ecosystem together through their icons.<br />
<br />
The current idea I've been throwing around is to use an "ice" platform.<br />
<br />
== webOS-Internals Icons (more will be added shortly) ==<br />
<br />
{{icon|Icon_WebOSInternals_Base.png}}<br />
{{icon|Icon_WebOSInternals_Base_Plugin.png}}<br />
{{icon|Icon_WebOSInternals_Box.png}}<br />
{{icon|Icon_WebOSInternals_Box_Empty.png}}<br />
{{icon|Icon_WebOSInternals_Box_Tux.png}}<br />
{{icon|Icon_WebOSInternals_Terminal.png}}<br />
{{icon|Icon_WebOSInternals_Keyboard.png}}<br />
{{icon|Icon_WebOSInternals_LED.png}}<br />
<br />
<div style="clear:both;"></div><br />
<br />
== Other Icons ==<br />
<br />
{{icon|Icon_Box.png}}<br />
{{icon|Icon_Box_Arrow.png}}<br />
<br />
<div style="clear:both;"></div><br />
<br />
== Icons For other Applications (for reference only) ==<br />
<br />
{{icon|Icon_Reversi.png}}<br />
{{icon|Icon_Airplane.png}}<br />
<br />
<div style="clear:both;"></div><br />
<br />
== Small Icons ==<br />
<br />
{{icon|Icon_WebOSInternals_Plugin_Small.png}}<br />
{{icon|Icon_WebOSInternals_Installed_Small.png}}<br />
{{icon|Icon_WebOSInternals_Updates_Small.png}}<br />
{{icon|Icon_WebOSInternals_Service_Small.png}}<br />
<div style="clear:both;"></div><br />
<br />
== Just Talk Below ==<br />
The question right now is for the Service icon do we use "Wrench" or "Gear" (votes are below)<br />
<br />
- 5 - "Gear" - AnOutSider, Templarian, RickHasABoat, Oil, HattCzech<br/><br />
- 2 - "Wrench" - PuffTheMagic, k4p741nkrunch</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=User:HattCzech&diff=2785User:HattCzech2009-07-28T17:30:45Z<p>HattCzech: </p>
<hr />
<div>= Modifications =<br />
<br />
== Patches ==<br />
<br />
=== [[Radio_Power_Switch#Seamless_Interface|Phone On/Off Switch]] ===<br />
=== [[Messaging_Mods#Character Counter|Character Counter]] ===<br />
=== [[Tutorials_webOS_Add_Or_Delete_Pages_In_The_Launcher#Add_Delete_Pages_Patch|Add/Delete Launcher Pages]] ===<br />
=== [[Always_Show_Details_of_New_Tasks#Patching_Process|Always Show Details of New Tasks]] ===<br />
<br />
== Images ==<br />
<br />
=== Phone ===<br />
[[Image:Backdrop-phone-blue.png]]<br />
[[Image:Backdrop-phone-scroll-fade-blue.png]]<br />
[[Image:List-section-line-blue.png]]<br />
<br />
= Projects =<br />
<br />
* Flashlight<br />
* More Messaging Mods</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Portal:Patches_to_webOS&diff=2784Portal:Patches to webOS2009-07-28T17:27:37Z<p>HattCzech: </p>
<hr />
<div>__notoc__<br />
{{portal-header<br />
|This page lists patches to webOS existing apps which modify the behavior as shipped. '''Note''' that these patches may be version specific and may be broken by future webOS updates. Proceed with caution. If you get one that works please put " - Works with " + version (for instance 1.0.4)<br />
}}<br />
This page is undergoing structuring please contribute moving or adding new entries under the appropriate headings. For now put pages in alphabetical order. Each page should contain at least the basic headings<br />
*1. '''Introduction''': A brief description to introduce people to the patch.<br />
**1.1 '''Usage''':An explanation if it is needed on how to use the modification see Add/Delete Pages in the Launcher as an example.<br />
*2. '''Editing Process''': Step by step instructions to manually edit. <br />
*3. '''Patching Process''': Details for making the edits with a patch file and pointing people to the [[Applying Patches]] page if the patch is also provided in the webos-internals gitorious repository.<br />
<br />
{{portal-two-columns<br />
|column1= <br />
==Completed Patches==<br />
<br />
* [[Tutorials webOS Add Or Delete Pages In The Launcher|Add/Delete Launcher Pages]] - '''Works with 1.1'''<br />
* [[Always_Show_Details_of_New_Tasks|Always Show Details of New Tasks]] - '''Works with 1.1'''<br />
** If there is a patch process for this, please add the details to the page and have it added to the webos-internals gitorious repository. Info for the repository is on [[Applying Patches]].<br />
* [[Bookmarking_MediaPlayer|Bookmarking MediaPlayer]] - '''Works with 1.1'''<br />
* [[Boot_Themes|Boot Themes]] - '''Works with 1.1'''<br />
* [[Brightness]] - '''Works with 1.1'''<br />
* [[Change_Carrier_String|Change Carrier String]] - '''Works with 1.1'''<br />
* [[Confirm Deletion on Email|Confirm Deletion on Email]] - '''Works with 1.1'''<br />
* [[CPU Frequency or Voltage Scaling|CPU Frequency or Voltage Scaling]] - '''Works with 1.1'''<br />
* [[Disable Charging Event Alerts Sounds|Disable Charging Event Alerts Sounds]] - '''Works with 1.1'''<br />
* [[Edit Dialer Theme|Edit Dialer Theme]] - '''Works with 1.1'''<br />
* [[Fix Broken Formatting for Reply/Forward E-mails|Fix Broken Formatting for E-mails]] - '''Obsolete After 1.1'''<br />
* [[Forward Messages|Forward Messages]] - '''Works with 1.1'''<br />
* [[Global Search Addons Collection]] - '''Works with ALL'''<br />
* [[GPS Tracking|GPS Tracking]] - '''Works with 1.1'''<br />
* [[Graphics]] - '''Works with ALL'''<br />
* [[Hide/Delete_The_NASCAR_App|Hide/Delete The NASCAR App]] - '''Works with 1.1'''<br />
* [[Message Sound|Message Sound]] - '''Works with 1.1'''<br />
* [[Messaging_Mods|Messaging Modifications]] - '''All work with 1.1'''<br />
* [[Add_Words_to_AutoCorrect_Dictionary|Modify AutoCorrect Dictionary]]<br />
* [[New Cards For Each Messaging Conversation|New Cards For Each Messaging Conversation]] - '''Works with 1.1'''<br />
* [[Radio_Power_Switch|Phone On/Off Switch]] - '''Works with 1.1'''<br />
* [[Roam Control|Roam Control]] - '''Works with 1.1'''<br />
* [[Show_Actual_Battery_Percent | Show Actual Battery Percentage]] - '''Works with 1.1'''<br />
* [[Unhide the DeveloperMode App|Unhide the DeveloperMode App]] - '''Works with 1.1'''<br />
<br />
'''The following have not been checked for which the appropriate heading to be under.'''<br />
<br />
* [[Application_Framework|Application Framework]]<br />
* [[Application_Mods:_PDF_Viewer|Application Mods: PDF Viewer]]<br />
* [[Background_Editing|Background Editing]]<br />
* [[Browser_Plugins|Browser Plugins]]<br />
* [[Bypassing_Activation|Bypassing Activation]]<br />
* [[Camera_Modifications_%26_Additions|Camera Modifications & Additions]]<br />
* [[Camera_Remote_View|Camera Remote View]]<br />
* [[Change_Enter_To_Create_Newline_Instead_of_Send_Message|Change Enter to Create Newline Instead of Send Message]]<br />
* [[Change_the_default_notification.wav_Sound|Change the Default notification.wav Sound]]<br />
* [[Changes_Alert/Notification_Sounds|Changes Alert/Notification Sounds]]<br />
* [[Changing_the_%22Turn_off_after_X%22_time|Changing the "Turn off after X" Time]]<br />
* [[Change_default_font_for_replies/forwards_from_navy_to_black|Change Default Font for Replies/Forwards from Navy to Black]]<br />
* [[Display_Full_Status_Messages(Messenger)|Display Full Status Messages(Messenger)]] <br />
* [[Downloading From The Browser|Downloading From The Browser]] <br />
* [[Email App Patch to Prompt for IPK Installation|Email App Patch to Prompt for IPK Installation]] <br />
* [[Enable Landscape Viewing in Email|Enable Landscape Viewing in Email]] <br />
* [[Fix Email Attachments|Fix Email Attachments]] <br />
* [[Hidden Features|Hidden Features]] <br />
* [[Hourly Chime|Hourly Chime]] <br />
* [[Ignore 'A', 'An', and 'The' In Artist and Album names|Ignore 'A', 'An', and 'The' In Artist and Album names]] <br />
* [[Installing Homebrew Apps With A Rooted Pre|Installing Homebrew Apps With A Rooted Pre]] <br />
* [[Modifying Stock Applications|Modifying Stock Applications]] <br />
* [[Modifying a Stock App While Keeping the Original|Modifying a Stock App While Keeping the Original]] <br />
* [[Logging information from within scripts|Logging information from within scripts]]<br />
* [[Packaging Homebrew Apps for Stock Pre without Rooting|Packaging Homebrew Apps for Stock Pre without Rooting]] <br />
* [[My notification|My notification]] <br />
* [[Myavatar In Messaging App|Myavatar In Messaging App]] <br />
* [[Photos Slideshow|Photos Slideshow]] <br />
* [[Random Wallpaper Switching|Random Wallpaper Switching]] <br />
* [[Reverse Tunnel|Reverse Tunnel]] <br />
* [[Screenlock On When Connected|Stay On While Connected]]<br />
* [[Show allday events in calendar month view|Show allday events in calendar month view]] <br />
* [[Splash Application|Splash Application]] <br />
* [[Turn Off Missed Call Sound|Turn Off Missed Call Sound]] <br />
* [[Using Volume Buttons to Take a Picture|Using Volume Buttons to Take a Picture]]<br />
<br />
|column2=<br />
==webOS Update Information==<br />
* [[Update 1.1.0|Update 1.1]]<br />
* [[Update 1.0.4|Update 1.0.4]] <br />
* [[Update 1.0.3|Update 1.0.3]]<br />
<br />
==Patches that Need Work==<br />
* [[Bugs]]<br />
<br />
==Patch Ideas to be Created or in Progress==<br />
<br />
* [[Add_Ability_To_Choose_Snooze_Length|Add Ability to Choose Snooze Length]]<br />
* [[Changing_clipboard_data_from_the_shell|Changing Clipboard Data from the Shell]]<br />
* [[Development_%26_Tweak_Ideas | Development & Tweaking Ideas]]<br />
* [[Longer Vibrate|Longer Vibrate]]<br />
<br />
}}</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Patch_Tasks_Always_Show_Details_of_New_Tasks&diff=2781Patch Tasks Always Show Details of New Tasks2009-07-28T16:58:49Z<p>HattCzech: /* Patching Process */ added</p>
<hr />
<div>[[Image:Tasks.png|right]]<br />
== Introduction==<br />
<br />
I've made a small modification that changes how new tasks are handled. Ordinarily, new tasks appear at the bottom of the task list. In this view, you need to tap again to enter details like a due date. With this modification when add a task, the details card appears (pictured). At this window you can immediately set the task name, due date, task list, and priority. You're not forced to fill out each of those fields, they're just available. Enter your info, then swipe back and you'll see your new task in the list, or close the new task card (flick up) and the task is saved automatically. <br />
<br />
==Disclaimer==<br />
<br />
'''I've tested this on v1.03 and v1.04 and I haven't had any problems yet. Use at your own risk. I'm not responsible. And make a backup!'''<br />
<br />
==Editing Process==<br />
<br />
[[Portal:Accessing Linux|Accessing linux]] is required. These directions assume you have already done so.<br />
<br />
'''1.''' Mount for rw access:<br />
<br />
<pre><nowiki><br />
mount -o remount,rw /<br />
</nowiki></pre><br />
<br />
<br />
'''2.''' Make a backup of the file! Don't be lazy!<br />
<br />
<pre><nowiki><br />
cd /usr/palm/applications/com.palm.app.tasks/app/controllers/<br />
cp tasks-assistant.js tasks-assistant.js.bak<br />
</nowiki></pre><br />
<br />
'''3.''' Then open the file /usr/palm/applications/com.palm.app.tasks/app/controllers/tasks-assistant.js<br />
<br />
<pre><nowiki><br />
vi tasks-assistant.js<br />
</nowiki></pre><br />
<br />
'''4.''' In _newTask: function(previousTask)<br />
<br />
Replace line 917 (line 921 in os 1.1):<br />
<br />
<pre><nowiki><br />
this.listElement.mojo.focusItem(task);<br />
</nowiki></pre><br />
<br />
with this code:<br />
<br />
<pre><nowiki><br />
this.state.edit.call(this, index);<br />
</nowiki></pre><br />
<br />
'''5.''' Also, replace line 940 of the same file (line 944 in os 1.1):<br />
<br />
<pre><nowiki><br />
self.listElement.mojo.focusItem(task);<br />
</nowiki></pre><br />
<br />
with this code:<br />
<br />
<pre><nowiki><br />
self.state.edit.call(self, index);<br />
</nowiki></pre><br />
<br />
'''6.''' Save and reboot.<br />
<pre><nowiki><br />
mount -o remount,ro /<br />
reboot<br />
</nowiki></pre><br />
<br />
Enjoy!<br />
<br />
(os 1.1 changes verified by tcurtin on 7/24/09)<br />
<br />
===Contact Me===<br />
Please leave me a note if it works for you:<br />
http://www.everythingpre.com/forum/webos-development/new-mod-always-show-new-task-details-21326.html#post106281<br />
<br />
//-Tuckmobile//<br />
<br />
= Patching Process =<br />
<br />
== Procedure ==<br />
<br />
Run the following commands:<br />
<br />
''In this example, I have the patch file located in my home directory under '''patches'''''<br />
<source lang="bash"><br />
cd /<br />
sudo patch -p0 --backup-if-mismatch < ~/patches/tasks.patch<br />
</source><br />
<br />
This is what you should see if it ran properly:<br />
<source lang="text"><br />
patching file /usr/palm/applications/com.palm.app.tasks/app/controllers/tasks-assistant.js<br />
</source><br />
<br />
These modifications will require LunaSysMgr to be restarted. A rescan will not work. After you've run the commands above, run one more command:<br />
<source lang="bash"><br />
pkill LunaSysMgr<br />
</source><br />
<br />
== tasks.patch ==<br />
<source lang="diff"><br />
diff -ur /usr/palm/applications/com.palm.app.tasks/app/controllers/tasks-assistant.js /usr/palm/app-modified/com.palm.app.tasks/app/controllers/tasks-assistant.js<br />
--- /usr/palm/applications/com.palm.app.tasks/app/controllers/tasks-assistant.js 2009-07-18 00:22:06.000000000 -0500<br />
+++ /usr/palm/app-modified/com.palm.app.tasks/app/controllers/tasks-assistant.js 2009-07-28 10:50:52.000000000 -0500<br />
@@ -918,7 +918,7 @@<br />
this.listElement.mojo.insertItemsAt(index, [task]);<br />
this.listElement.mojo.revealItem(index);<br />
this.addWidgets(this.listElement.mojo.getNodeByIndex(index).querySelector('[name="subject"]'), task);<br />
- this.listElement.mojo.focusItem(task);<br />
+ this.state.edit.call(this, index); //this.listElement.mojo.focusItem(task);<br />
<br />
task.priority = previousTask.priority; // Attempt to inherit the priority<br />
<br />
@@ -941,7 +941,7 @@<br />
{<br />
// If we find the node we just added, focus on it. We might not find the node however if the list is being refreshed<br />
self.addWidgets(node.querySelector('[name="subject"]'), task);<br />
- self.listElement.mojo.focusItem(task);<br />
+ self.state.edit.call(self, index); //self.listElement.mojo.focusItem(task);<br />
}<br />
<br />
Mojo.Log.info("New task %j %j", task, self.task);<br />
</source></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Patch_Phone_Show_Call_Duration_in_the_Call_Log&diff=2470Patch Phone Show Call Duration in the Call Log2009-07-26T15:23:46Z<p>HattCzech: /* Enable adding / removing pages in the Launcher app */ fixed link to add delete pages in launcher</p>
<hr />
<div>This page details ways to enable hidden functionality in on the palm pre. You will need root shell access to perform these changes. Follow these instructions at your own risk, if you make an error (or perhaps even if you do it correctly) you risk bricking your phone, voiding your warranty, etc. These instructions assume a working knowledge of unix. Also, note that these changes require rebooting the phone to take effect.<br />
<br />
==== Show call duration in the call log ====<br />
Sprint always customizes their phones to conceal call duration information. This avoids angry phone calls from confused customers who are surprised when their 1:01 phone call results in 2:00 minutes charged to their account. I can sympathize. However, I won't call complain, and I occasionally want to know how long a call was after the fact.<br />
<br />
There is now a shell script for executing the commands below if you do not feel comfortable doing the steps below manually. See http://gitorious.org/webos-internals/modifications/commit/3b2e55a22e64b5302b5d45521ccf94fe28db3595<br />
<br />
There is a system preference <tt>phoneAppHideCallDuration</tt> which appears to control this, but it merely provides a default value. The phone app caches the value and saves it as a cookie. As an exercise, I'll show you how to set the preference as well.<br />
<br />
To set the <tt>phoneAppHideCallDuration</tt> preference:<br />
<br />
<source lang="text"><br />
[user@linuxhost]$ ssh -p 222 palm-pre<br />
user@castle:~$ su<br />
root@castle:/home/user# luna-send -n 1 palm:''com.palm.systemservice/setPreferences '{"phoneAppHideCallDuration": false}'<br />
** Message: serviceResponse Handling: 2, { "returnValue": true }<br />
</source><br />
<br />
Here we've used <tt>luna-send</tt> to broadcast a message requesting the <tt>systemservice</tt> to set a preference (I believe you can actually specify multiple preferences at once, the payload format is a json hashtable). Unfortunately, that only sets the default, so to actually see the change we need to update a cookie stored in the phone app. We'll do that now:<br />
<br />
<source lang="text"><br />
root@castle:/home/user# cd /var/palm/data/<br />
root@castle:/var/palm/data# sqlite3 cookies.db<br />
SQLite version 3.6.1<br />
Enter ".help" for instructions<br />
Enter SQL statements terminated with a ";"<br />
sqlite> update Cookies set value = "%220%22" where domain_head = ".usr.palm.applications.com.palm." and domain_tail = "app.phone" and path = "/usr/palm/applications/com.palm.app.phone" and "name" = "mojo_cookie_hidecalllogduration";<br />
sqlite> .exit<br />
root@castle:/var/palm/data# exit<br />
user@castle:~$ exit<br />
Connection to palm-pre closed.<br />
</source><br />
<br />
This time we've used <tt>sqlite3</tt> to update the cookies database directly. The primary key of the Cookies table (in the cookies database) is (domain_head, domain_tail, path, name), we specify the full key, and update the value. Note the value field is always ''percent-encoded'' and in this case represents the string <tt>"0"</tt> (including the quotes). To see your changes, reboot your phone. I've been doing this by holding the power key and turning it off, though presumably a <tt>shutdown -r</tt> would work as well (I have not tried it though).<br />
<br />
''Note: if you are typing in the sql by hand, take care you get it correct. If you make a typo and the where portion does not match any records you will not get any feedback. To verify that your update was successful run the following SQL after your issue the update:'' <tt>select * from Cookies where domain_tail = "app.phone"</tt><br />
<br />
<br />
==== Enable adding / removing pages in the Launcher app ====<br />
<br />
Please see this page for a tutorial: [[Tutorials_webOS_Add_Or_Delete_Pages_In_The_Launcher|Add Or Delete Pages In The Launcher]]<br />
<br />
<br />
<br />
I'm guessing this was disabled due to usability concerns. Especially with the limited number of apps available right now, there's not a huge need for multiple screens, and deleting a page would result in shifting around icons, which can be a frustrating experience. I'm guessing this will be enabled in the future (perhaps on an "advanced mode" switch, or through a different UI). This time the disabling is directly in the code, there are two bits of commented-out code which we simply need to uncomment. I have intentionally not included the file here out of respect for palm's intellectual property.<br />
<br />
<source lang="text"><br />
[user@linuxhost]$ ssh -p 222 palm-pre<br />
user@castle:~$ su<br />
root@castle:/home/user# vi /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js<br />
</source><br />
<br />
Once you have that file open, uncomment the two items in the <tt>items</tt> array defined on line 30. Then scroll down to line 125 in the <tt>handleCommand</tt> function and uncomment the two commented out cases in the switch statement. Save the file, and reboot. You should have two new menu options, "New Page" and "Delete Page". It looks like the code will not let you delete your last page, but I wouldn't try it.<br />
<br />
Verified to run as written by optik678.</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=User:HattCzech&diff=2103User:HattCzech2009-07-24T17:34:17Z<p>HattCzech: /* Modifications */</p>
<hr />
<div>= Modifications =<br />
<br />
== Patches ==<br />
<br />
=== [[Radio_Power_Switch#Seamless_Interface|Phone On/Off Switch]] ===<br />
=== [[Messaging_Mods#Character Counter|Character Counter]] ===<br />
=== [[Tutorials_webOS_Add_Or_Delete_Pages_In_The_Launcher#Add_Delete_Pages_Patch|Add/Delete Launcher Pages]] ===<br />
<br />
== Images ==<br />
<br />
=== Phone ===<br />
[[Image:Backdrop-phone-blue.png]]<br />
[[Image:Backdrop-phone-scroll-fade-blue.png]]<br />
[[Image:List-section-line-blue.png]]<br />
<br />
= Projects =<br />
<br />
* Flashlight<br />
* More Messaging Mods</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=File:List-section-line-blue.png&diff=2098File:List-section-line-blue.png2009-07-24T17:29:24Z<p>HattCzech: </p>
<hr />
<div></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=File:Backdrop-phone-scroll-fade-blue.png&diff=2097File:Backdrop-phone-scroll-fade-blue.png2009-07-24T17:29:09Z<p>HattCzech: </p>
<hr />
<div></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=File:Backdrop-phone-blue.png&diff=2096File:Backdrop-phone-blue.png2009-07-24T17:28:56Z<p>HattCzech: </p>
<hr />
<div></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Patch_Launcher_Add_or_Delete_Pages&diff=2094Patch Launcher Add or Delete Pages2009-07-24T17:25:51Z<p>HattCzech: /* Add Delete Pages Patch */ removed slash from name</p>
<hr />
<div><p>Someone in the forum talked about being able to add and delete pages in the Launcher app and I thought I would look into it further. They stated that they were able to add new pages and delete existing pages.</p><br />
<p>Upon further investigation, they were correct. There is existing code in a particular js file that has been commented out that will allow you to create a new page and delete the current page you are on in the Launcher. There is a variable that stores the max number of pages to 10. This value can probably be increased, but I don't recommend it and seriously, who would need more that 10 pages anyway, right?</p><br />
<p>After I uncommented these said lines and rebooted, I was able to perform these functions. So I tested the new page function.</p><br />
<p>The new page and delete page functions will appear in the launcher app menu.</p><br />
<p><strong>Creating/adding a page:</strong></p><br />
<p>This will create a new page and move whatever page you were on to the right. There is nothing special to this page besides the fact that you now have a new page. I was able to drag icons to it just like any other page. To test this new page out I added a contact to that page.</p><br />
<p><strong>Deleting/Removing a page:</strong></p><br />
<br />
<p>The code is already set up to automagically move any icons to the page to the left of the page you are deleting. What I mean is if the page you delete is in the middle of other pages it will toss whatever was on your current page to the page to the left of it.</p><br />
<p>When I deleted a page that was to the left of the apps page that had web app defaulted to it, it tossed the icons to that page because there is no page to the left of the one I just deleted.</p><br />
<p><strong>Creating/adding multiple pages:</strong></p><br />
<p>So I was on page 1 and created a new page. Then I moved over to the page where device info, backup, screen &amp; lock was at and created a new page there. It tossed the page to the right and made a new page.</p><br />
<hr /><br />
<br />
<h1 id="toc1"><span>Uncomment the Following</span></h1><br />
<br />
<p>/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js</p><br />
<p>Look for "appMenuModel" (line 27) a few lines below you will see a line that has "newpage" in it.<br /><br />
<br />
On the line that remove the "/*" and on the line that has "deletepage" remove the "*/"</p><br />
<p>Next look further in the file (line 119) for "switch" again remove the "/* and "*/" that surrounds the cases for newpage and deletepage.</p><br />
<p>reboot and now you'll have new page and delete page in the launcher app menu.</p><br />
<p>Note that you can download a patch for this at http://gitorious.org/webos-internals/modifications/blobs/raw/master/applauncher/add-delete-pages-in-the-launcher.patch</p><br />
<br />
You can see a picture of the new menu here: http://img195.imageshack.us/img195/7636/unknown20091306141631.png<br />
<p>-PS I moved the location of the edit menu down…</p><br />
<p>-Enjoy</p><br />
<hr /><br />
<p>The credit to this goes to someone in the forums, at the time this was written I wasn't able to find out who exactly was it who wrote about it first (purely I don't have the time to look.) Pyrognome tested and confirmed the new page and delete page functionality.</p><br />
<br />
= Add Delete Pages Patch =<br />
<br />
[[Image:Launcher_AddDeletePages.jpg|border|right|Add/Delete Pages]]<br />
<br />
== Introduction ==<br />
<br />
I'm trying to make most of my modifications into patches, so here's another.<br />
* [[User:HattCzech|HattCzech]]<br />
<br />
== Procedure ==<br />
<br />
Run the following commands:<br />
<br />
''In this example, I have the patch file located in my home directory under '''patches'''''<br />
<source lang="bash"><br />
cd /<br />
sudo patch -p0 --backup-if-mismatch < ~/patches/adddelpages.patch<br />
</source><br />
<br />
This is what you should see if it ran properly:<br />
<source lang="text"><br />
patching file /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js<br />
</source><br />
<br />
These modifications will require LunaSysMgr to be restarted. A rescan will not work. After you've run the commands above, run one more command:<br />
<source lang="bash"><br />
pkill LunaSysMgr<br />
</source><br />
<br />
<br />
== adddelpages.patch ==<br />
<br />
<source lang="diff"><br />
diff -ur /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js /usr/lib/luna/sysmod/luna-applauncher/app/controllers/launcher-assistant.js<br />
--- /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js 2009-07-18 00:21:37.000000000 -0500<br />
+++ /usr/lib/luna/sysmod/luna-applauncher/app/controllers/launcher-assistant.js 2009-07-24 11:03:32.000000000 -0500<br />
@@ -30,8 +30,8 @@<br />
visible: true,<br />
label: $L('Launcher'),<br />
items: [<br />
- /*{ label: $L('New page'), command: 'newpage' },<br />
- { label: $L('Delete page'), command: 'deletepage' },*/<br />
+ { label: $L('New page'), command: 'newpage' },<br />
+ { label: $L('Delete page'), command: 'deletepage' },<br />
Mojo.Menu.editItem,<br />
{ label: $L('List Apps...'), command: 'listapps' },<br />
Mojo.Menu.helpItem<br />
@@ -124,7 +124,6 @@<br />
case 'listapps':<br />
ApplicationService.launch(this.deviceInfo.id, this.deviceInfo.params);<br />
break;<br />
- /*<br />
case 'newpage':<br />
if (this.pageDivs.length < 10) {<br />
this.insertPage(this.activePageIndex, true);<br />
@@ -138,7 +137,6 @@<br />
}<br />
}<br />
break;<br />
- */<br />
}<br />
}<br />
},<br />
</source></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=User:HattCzech&diff=2092User:HattCzech2009-07-24T17:25:25Z<p>HattCzech: </p>
<hr />
<div>= Modifications =<br />
<br />
* Patches<br />
** [[Radio_Power_Switch#Seamless_Interface|Phone On/Off Switch]]<br />
** [[Messaging_Mods#Character Counter|Character Counter]]<br />
** [[Tutorials_webOS_Add_Or_Delete_Pages_In_The_Launcher#Add_Delete_Pages_Patch|Add/Delete Launcher Pages]]<br />
<br />
= Projects =<br />
<br />
* Flashlight<br />
* More Messaging Mods</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Patch_Launcher_Add_or_Delete_Pages&diff=2091Patch Launcher Add or Delete Pages2009-07-24T17:23:15Z<p>HattCzech: /* Add/Delete Pages Patch */ - added image</p>
<hr />
<div><p>Someone in the forum talked about being able to add and delete pages in the Launcher app and I thought I would look into it further. They stated that they were able to add new pages and delete existing pages.</p><br />
<p>Upon further investigation, they were correct. There is existing code in a particular js file that has been commented out that will allow you to create a new page and delete the current page you are on in the Launcher. There is a variable that stores the max number of pages to 10. This value can probably be increased, but I don't recommend it and seriously, who would need more that 10 pages anyway, right?</p><br />
<p>After I uncommented these said lines and rebooted, I was able to perform these functions. So I tested the new page function.</p><br />
<p>The new page and delete page functions will appear in the launcher app menu.</p><br />
<p><strong>Creating/adding a page:</strong></p><br />
<p>This will create a new page and move whatever page you were on to the right. There is nothing special to this page besides the fact that you now have a new page. I was able to drag icons to it just like any other page. To test this new page out I added a contact to that page.</p><br />
<p><strong>Deleting/Removing a page:</strong></p><br />
<br />
<p>The code is already set up to automagically move any icons to the page to the left of the page you are deleting. What I mean is if the page you delete is in the middle of other pages it will toss whatever was on your current page to the page to the left of it.</p><br />
<p>When I deleted a page that was to the left of the apps page that had web app defaulted to it, it tossed the icons to that page because there is no page to the left of the one I just deleted.</p><br />
<p><strong>Creating/adding multiple pages:</strong></p><br />
<p>So I was on page 1 and created a new page. Then I moved over to the page where device info, backup, screen &amp; lock was at and created a new page there. It tossed the page to the right and made a new page.</p><br />
<hr /><br />
<br />
<h1 id="toc1"><span>Uncomment the Following</span></h1><br />
<br />
<p>/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js</p><br />
<p>Look for "appMenuModel" (line 27) a few lines below you will see a line that has "newpage" in it.<br /><br />
<br />
On the line that remove the "/*" and on the line that has "deletepage" remove the "*/"</p><br />
<p>Next look further in the file (line 119) for "switch" again remove the "/* and "*/" that surrounds the cases for newpage and deletepage.</p><br />
<p>reboot and now you'll have new page and delete page in the launcher app menu.</p><br />
<p>Note that you can download a patch for this at http://gitorious.org/webos-internals/modifications/blobs/raw/master/applauncher/add-delete-pages-in-the-launcher.patch</p><br />
<br />
You can see a picture of the new menu here: http://img195.imageshack.us/img195/7636/unknown20091306141631.png<br />
<p>-PS I moved the location of the edit menu down…</p><br />
<p>-Enjoy</p><br />
<hr /><br />
<p>The credit to this goes to someone in the forums, at the time this was written I wasn't able to find out who exactly was it who wrote about it first (purely I don't have the time to look.) Pyrognome tested and confirmed the new page and delete page functionality.</p><br />
<br />
= Add/Delete Pages Patch =<br />
<br />
[[Image:Launcher_AddDeletePages.jpg|border|right|Add/Delete Pages]]<br />
<br />
== Introduction ==<br />
<br />
I'm trying to make most of my modifications into patches, so here's another.<br />
* [[User:HattCzech|HattCzech]]<br />
<br />
== Procedure ==<br />
<br />
Run the following commands:<br />
<br />
''In this example, I have the patch file located in my home directory under '''patches'''''<br />
<source lang="bash"><br />
cd /<br />
sudo patch -p0 --backup-if-mismatch < ~/patches/adddelpages.patch<br />
</source><br />
<br />
This is what you should see if it ran properly:<br />
<source lang="text"><br />
patching file /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js<br />
</source><br />
<br />
These modifications will require LunaSysMgr to be restarted. A rescan will not work. After you've run the commands above, run one more command:<br />
<source lang="bash"><br />
pkill LunaSysMgr<br />
</source><br />
<br />
<br />
== adddelpages.patch ==<br />
<br />
<source lang="diff"><br />
diff -ur /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js /usr/lib/luna/sysmod/luna-applauncher/app/controllers/launcher-assistant.js<br />
--- /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js 2009-07-18 00:21:37.000000000 -0500<br />
+++ /usr/lib/luna/sysmod/luna-applauncher/app/controllers/launcher-assistant.js 2009-07-24 11:03:32.000000000 -0500<br />
@@ -30,8 +30,8 @@<br />
visible: true,<br />
label: $L('Launcher'),<br />
items: [<br />
- /*{ label: $L('New page'), command: 'newpage' },<br />
- { label: $L('Delete page'), command: 'deletepage' },*/<br />
+ { label: $L('New page'), command: 'newpage' },<br />
+ { label: $L('Delete page'), command: 'deletepage' },<br />
Mojo.Menu.editItem,<br />
{ label: $L('List Apps...'), command: 'listapps' },<br />
Mojo.Menu.helpItem<br />
@@ -124,7 +124,6 @@<br />
case 'listapps':<br />
ApplicationService.launch(this.deviceInfo.id, this.deviceInfo.params);<br />
break;<br />
- /*<br />
case 'newpage':<br />
if (this.pageDivs.length < 10) {<br />
this.insertPage(this.activePageIndex, true);<br />
@@ -138,7 +137,6 @@<br />
}<br />
}<br />
break;<br />
- */<br />
}<br />
}<br />
},<br />
</source></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=File:Launcher_AddDeletePages.jpg&diff=2087File:Launcher AddDeletePages.jpg2009-07-24T17:17:04Z<p>HattCzech: </p>
<hr />
<div></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Patch_Launcher_Add_or_Delete_Pages&diff=2086Patch Launcher Add or Delete Pages2009-07-24T17:11:41Z<p>HattCzech: added method for patching</p>
<hr />
<div><p>Someone in the forum talked about being able to add and delete pages in the Launcher app and I thought I would look into it further. They stated that they were able to add new pages and delete existing pages.</p><br />
<p>Upon further investigation, they were correct. There is existing code in a particular js file that has been commented out that will allow you to create a new page and delete the current page you are on in the Launcher. There is a variable that stores the max number of pages to 10. This value can probably be increased, but I don't recommend it and seriously, who would need more that 10 pages anyway, right?</p><br />
<p>After I uncommented these said lines and rebooted, I was able to perform these functions. So I tested the new page function.</p><br />
<p>The new page and delete page functions will appear in the launcher app menu.</p><br />
<p><strong>Creating/adding a page:</strong></p><br />
<p>This will create a new page and move whatever page you were on to the right. There is nothing special to this page besides the fact that you now have a new page. I was able to drag icons to it just like any other page. To test this new page out I added a contact to that page.</p><br />
<p><strong>Deleting/Removing a page:</strong></p><br />
<br />
<p>The code is already set up to automagically move any icons to the page to the left of the page you are deleting. What I mean is if the page you delete is in the middle of other pages it will toss whatever was on your current page to the page to the left of it.</p><br />
<p>When I deleted a page that was to the left of the apps page that had web app defaulted to it, it tossed the icons to that page because there is no page to the left of the one I just deleted.</p><br />
<p><strong>Creating/adding multiple pages:</strong></p><br />
<p>So I was on page 1 and created a new page. Then I moved over to the page where device info, backup, screen &amp; lock was at and created a new page there. It tossed the page to the right and made a new page.</p><br />
<hr /><br />
<br />
<h1 id="toc1"><span>Uncomment the Following</span></h1><br />
<br />
<p>/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js</p><br />
<p>Look for "appMenuModel" (line 27) a few lines below you will see a line that has "newpage" in it.<br /><br />
<br />
On the line that remove the "/*" and on the line that has "deletepage" remove the "*/"</p><br />
<p>Next look further in the file (line 119) for "switch" again remove the "/* and "*/" that surrounds the cases for newpage and deletepage.</p><br />
<p>reboot and now you'll have new page and delete page in the launcher app menu.</p><br />
<p>Note that you can download a patch for this at http://gitorious.org/webos-internals/modifications/blobs/raw/master/applauncher/add-delete-pages-in-the-launcher.patch</p><br />
<br />
You can see a picture of the new menu here: http://img195.imageshack.us/img195/7636/unknown20091306141631.png<br />
<p>-PS I moved the location of the edit menu down…</p><br />
<p>-Enjoy</p><br />
<hr /><br />
<p>The credit to this goes to someone in the forums, at the time this was written I wasn't able to find out who exactly was it who wrote about it first (purely I don't have the time to look.) Pyrognome tested and confirmed the new page and delete page functionality.</p><br />
<br />
= Add/Delete Pages Patch =<br />
<br />
== Procedure ==<br />
<br />
Run the following commands:<br />
<br />
''In this example, I have the patch file located in my home directory under '''patches'''''<br />
<source lang="bash"><br />
cd /<br />
sudo patch -p0 --backup-if-mismatch < ~/patches/adddelpages.patch<br />
</source><br />
<br />
This is what you should see if it ran properly:<br />
<source lang="text"><br />
patching file /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js<br />
</source><br />
<br />
These modifications will require LunaSysMgr to be restarted. A rescan will not work. After you've run the commands above, run one more command:<br />
<source lang="bash"><br />
pkill LunaSysMgr<br />
</source><br />
<br />
== adddelpages.patch ==<br />
<br />
<source lang="diff"><br />
diff -ur /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js /usr/lib/luna/sysmod/luna-applauncher/app/controllers/launcher-assistant.js<br />
--- /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js 2009-07-18 00:21:37.000000000 -0500<br />
+++ /usr/lib/luna/sysmod/luna-applauncher/app/controllers/launcher-assistant.js 2009-07-24 11:03:32.000000000 -0500<br />
@@ -30,8 +30,8 @@<br />
visible: true,<br />
label: $L('Launcher'),<br />
items: [<br />
- /*{ label: $L('New page'), command: 'newpage' },<br />
- { label: $L('Delete page'), command: 'deletepage' },*/<br />
+ { label: $L('New page'), command: 'newpage' },<br />
+ { label: $L('Delete page'), command: 'deletepage' },<br />
Mojo.Menu.editItem,<br />
{ label: $L('List Apps...'), command: 'listapps' },<br />
Mojo.Menu.helpItem<br />
@@ -124,7 +124,6 @@<br />
case 'listapps':<br />
ApplicationService.launch(this.deviceInfo.id, this.deviceInfo.params);<br />
break;<br />
- /*<br />
case 'newpage':<br />
if (this.pageDivs.length < 10) {<br />
this.insertPage(this.activePageIndex, true);<br />
@@ -138,7 +137,6 @@<br />
}<br />
}<br />
break;<br />
- */<br />
}<br />
}<br />
},<br />
</source></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Patch_webOS_Radio_Power_Switch&diff=2080Patch webOS Radio Power Switch2009-07-24T16:55:31Z<p>HattCzech: /* Seamless Interface */ updated patch and credits</p>
<hr />
<div>= Seamless Interface =<br />
<br />
[[Image:RadioPowerSwitch.jpg|border|right|Radio Power Switch]]<br />
<br />
== Introduction ==<br />
<br />
I took what pEEf did and made it look more like it fits. I liked the original idea, but as mentioned in the concerns below, when changing between Airplane mode and back, it doesn't have the correct information. I made mine look like the Bluetooth and Wi-Fi menus.<br />
<br />
Works with: 1.0.x, 1.1<br />
<br />
== Procedure ==<br />
<br />
Run the following commands:<br />
<br />
''In this example, I have the patch file located in my home directory under '''patches'''''<br />
<source lang="bash"><br />
cd /<br />
sudo patch -p0 --backup-if-mismatch < ~/patches/radiopower.patch<br />
</source><br />
<br />
This is what you should see if it ran properly:<br />
<source lang="text"><br />
patching file /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js<br />
patching file /usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js<br />
patching file /usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html<br />
</source><br />
<br />
These modifications will require LunaSysMgr to be restarted. A rescan will not work. After you've run the commands above, run one more command:<br />
<source lang="bash"><br />
pkill LunaSysMgr<br />
</source><br />
<br />
== radiopower.patch ==<br />
<br />
<source lang="diff"><br />
diff -ur /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js /usr/lib/luna/sysmod/luna-systemui/app/controllers/bar-assistant.js<br />
--- /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js 2009-07-18 00:21:30.000000000 -0500<br />
+++ /usr/lib/luna/sysmod/luna-systemui/app/controllers/bar-assistant.js 2009-07-24 00:44:08.000000000 -0500<br />
@@ -789,6 +789,8 @@<br />
this.callForwardNotificationSession = null; <br />
} <br />
}<br />
+ var stageController = Mojo.Controller.getAppController().getStageProxy("DeviceMenu");<br />
+ stageController.delegateToSceneAssistant("updatePhone");<br />
}<br />
else if (payload.eventNetwork && this.phoneRadioState) {<br />
var networkMsg = payload.eventNetwork;<br />
@@ -2572,6 +2574,10 @@<br />
return this.wifiState;<br />
},<br />
<br />
+getCurrentPhoneState: function() {<br />
+ return this.phoneRadioState;<br />
+},<br />
+<br />
setDeviceMenuAssistant: function(menuassistant) {<br />
this.deviceMenuAssistant = menuassistant;<br />
},<br />
diff -ur /usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js /usr/lib/luna/sysmod/luna-systemui/app/controllers/devicemenu-assistant.js<br />
--- /usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js 2009-07-18 00:21:30.000000000 -0500<br />
+++ /usr/lib/luna/sysmod/luna-systemui/app/controllers/devicemenu-assistant.js 2009-07-24 10:46:55.000000000 -0500<br />
@@ -1,6 +1,6 @@<br />
/* Copyright 2009 Palm, Inc. All rights reserved. */<br />
<br />
-var RadioState = new Hash({wifi: undefined, bluetooth: undefined});<br />
+var RadioState = new Hash({wifi: undefined, bluetooth: undefined, phone: undefined});<br />
<br />
var DevicemenuAssistant = Class.create({<br />
<br />
@@ -36,6 +36,8 @@<br />
this.drawerModel = {myOpenProperty:false};<br />
this.controller.setupWidget('wifidetails', {modelProperty:'myOpenProperty'}, this.drawerModel);<br />
this.controller.setupWidget('btdetails', {modelProperty:'myOpenProperty'}, this.drawerModel);<br />
+ this.controller.setupWidget('phonedetails', {modelProperty:'myOpenProperty'}, this.drawerModel);<br />
+ this.phonedrawer = this.controller.get('phonedetails');<br />
this.wifidrawer = this.controller.get('wifidetails');<br />
this.btdrawer = this.controller.get('btdetails');<br />
<br />
@@ -92,6 +94,17 @@<br />
else<br />
this.controller.get('wifimsg').innerHTML = wifistate.escapeHTML(); <br />
} <br />
+ <br />
+ var phonestate = this.barAssistant.getCurrentPhoneState();<br />
+ if(phonestate === 'Off') {<br />
+ this.controller.get('phonemsg').innerHTML = $L('Off');<br />
+ RadioState.set('phone',false);<br />
+ }<br />
+ else {<br />
+ this.controller.get('phonemsg').innerHTML = $L('On');<br />
+ RadioState.set('phone',true);<br />
+ }<br />
+ <br />
this.controller.listen(this.controller.document, Mojo.Event.deactivate, this.close.bindAsEventListener(this));<br />
this.isVisible = true;<br />
<br />
@@ -115,6 +128,8 @@<br />
this.controller.get('btlist').addEventListener(Mojo.Event.listTap,this.handleBTTap.bindAsEventListener(this)); <br />
this.controller.get('dm_wifi').addEventListener(Mojo.Event.tap, this.togglewifiList.bindAsEventListener(this));<br />
this.controller.get('dm_bluetooth').addEventListener(Mojo.Event.tap, this.togglebluetoothList.bindAsEventListener(this));<br />
+ this.controller.get('dm_phone').addEventListener(Mojo.Event.tap, this.togglePhoneList.bindAsEventListener(this));<br />
+ this.controller.get('phone_radio').addEventListener(Mojo.Event.tap, this.togglePhoneRadio.bindAsEventListener(this));<br />
this.controller.get('wifi_radio').addEventListener(Mojo.Event.tap, this.toggleWifiRadio.bindAsEventListener(this));<br />
this.controller.get('bt_radio').addEventListener(Mojo.Event.tap, this.toggleBTRadio.bindAsEventListener(this));<br />
this.controller.get('bt_pref').addEventListener(Mojo.Event.tap,this.handleBluetoothLaunch.bindAsEventListener(this));<br />
@@ -175,6 +190,48 @@<br />
this.apModeInProgress = false;<br />
},<br />
<br />
+ updatePhone: function() {<br />
+ if(this.barAssistant.getCurrentPhoneState()) {<br />
+ this.controller.get('phonemsg').innerHTML = $L('On');<br />
+ this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');<br />
+ RadioState.set('phone', true);<br />
+ }<br />
+ else {<br />
+ this.controller.get('phonemsg').innerHTML = $L('Off');<br />
+ this.controller.get('phone_radio').innerHTML = $L('Turn on Phone');<br />
+ RadioState.set('phone', false);<br />
+ }<br />
+ },<br />
+ <br />
+ togglePhoneRadio: function(event) {<br />
+ this.serviceRequest = new Mojo.Service.Request("palm://com.palm.vibrate", {<br />
+ method: 'vibrate', parameters: { 'period': 0,'duration': 250 }<br />
+ });<br />
+ if(RadioState.get('phone'))<br />
+ TelephonyService.tempPowerSet('off',false,null,null);<br />
+ else<br />
+ TelephonyService.tempPowerSet('on',false,null,null);<br />
+ this.toggleDeviceMenu();<br />
+ },<br />
+ <br />
+ togglePhoneList: function(event) {<br />
+ if(this.apModeInProgress)<br />
+ return;<br />
+ <br />
+ if (this.phonedrawer.mojo.getOpenState()) {<br />
+ this.controller.hideWidgetContainer(this.controller.get('phonedetails')); <br />
+ }<br />
+ else {<br />
+ if(RadioState.get('phone'))<br />
+ this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');<br />
+ else<br />
+ this.controller.get('phone_radio').innerHTML = $L('Turn on Phone'); <br />
+ <br />
+ this.controller.showWidgetContainer(this.controller.get('phonedetails'));<br />
+ }<br />
+ this.phonedrawer.mojo.setOpenState(!this.phonedrawer.mojo.getOpenState()); <br />
+ },<br />
+ <br />
toggleBTRadio: function(event) {<br />
if(RadioState.get('bluetooth')) {<br />
BtService.radiooff(null,null); <br />
@@ -880,7 +937,10 @@<br />
},<br />
<br />
close: function() {<br />
- <br />
+ if(this.phonedrawer.mojo.getOpenState()) {<br />
+ this.controller.hideWidgetContainer(this.controller.get('phonedetails'));<br />
+ this.phonedrawer.mojo.setOpenState(false);<br />
+ }<br />
if (this.btdrawer.mojo.getOpenState()) {<br />
this.clearBTList(); <br />
this.controller.hideWidgetContainer(this.controller.get('btdetails'));<br />
diff -ur /usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html /usr/lib/luna/sysmod/luna-systemui/app/views/devicemenu/devicemenu-scene.html<br />
--- /usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html 2009-07-18 00:21:30.000000000 -0500<br />
+++ /usr/lib/luna/sysmod/luna-systemui/app/views/devicemenu/devicemenu-scene.html 2009-07-24 00:52:11.000000000 -0500<br />
@@ -94,6 +94,22 @@<br />
<br />
<div class="palm-section-divider"></div><br />
<br />
+ <div class="palm-row" id="dm_phone" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
+ <div class="title truncating-text"><br />
+ <div class="label right" id="phonemsg">&nbsp;</div><br />
+ <span x-mojo-loc=''>Phone</span><br />
+ </div><br />
+ </div></div><br />
+ <br />
+ <div id='phonedetails' x-mojo-element="Drawer"><br />
+ <div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
+ <div id="phone_radio" class="title truncating-text"><br />
+ </div><br />
+ </div></div><br />
+ </div><br />
+ <br />
+ <div class="palm-section-divider"></div><br />
+ <br />
<div id="dm_airplanemode" class="palm-row last" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
<div id="dm_airplanemode_status" class="title truncating-text"><br />
</div><br />
</source><br />
<br />
== Acknowledgements ==<br />
<br />
* pEEf, for figuring everything out<br />
* [[User:HattCzech|HattCzech]]<br />
* NetWhiz, for fixing it to work with 1.1.0<br />
<br />
== Concerns ==<br />
<br />
* Airplane mode still always turns the radio on regardless of the state before airplane mode was turned on. Otherwise, very nice.<br />
** I may try to add in a way for it to remember the phone state, but I figured that was the point of Airplane mode, so I haven't looked into it yet. I will look through the code again and see if it's worth it. -[[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Original Version =<br />
<br />
I created this mod so I can turn off the cellular radio, but keep WiFi and Bluetooth on. Strangely, The Pre does not seem to have an existing way to do this, only the "Airplane Mode" which shuts off ALL radios!<br />
<br />
I currently do not have Sprint service on my Pre, and am just using it with WiFi. (See [/bypassing-activation Bypassing Activation] for info on how to do this.)<br />
<br />
This will also be useful for people wishing to save their battery if in a poor or no service area, yet still wanting to use WiFi.<br />
<br />
Another great use is shutting off the phone so calls will not disturb you while allowing the phone to do all of its network-related activity.<br />
<br />
How it works: Simply click the upper right of the screen where the status bar is (signal strength). You will get a drop-down menu, this is where the stock "Airplane Mode" is. I have added a "Toggle Radio Power" function here. If the radio is on it will turn it off, and vice-versa. It will not turn off WiFi or Bluetooth like Airplane mode does.<br />
<br />
== Note ==<br />
<br />
The Pre actually already lets you turn off the cell radio. You can just turn on Airplane Mode, then turn on WiFi, Bluetooth, or both. ~ lolaiba<br />
<br />
== Installation ==<br />
<br />
NOTE: If you have never modified any code on the phone, please see [/stock-application-mods Modifiying Stock Applications] first.<br />
<br />
This mod is simply additional code to be added to 3 files on your Pre. WARNING: MAKE BACKUPS FIRST!<br />
<br />
I will update the page later with proper diffs, but for now you can just get into the shell, make your backups, fire up vi (or nano) then paste in the relevant lines. Once you are done, you can test it without rebooting by forcing the Luna manager to reinitialize its cache:<br />
<code><pre><br />
luna-send -n 1 palm://com.palm.applicationManager/rescan {}<br />
</pre></code><br />
<br />
Here is the code, Enjoy!<br />
<br />
/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html Line 94:<br />
<code><pre><br />
<div class="palm-section-divider"></div><!-- Added by pEEf --><br />
<br />
<div id="dm_power" class="palm-row" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
<div id="dm_power_status" class="title truncating-text"> <br />
</div><br />
</div></div><br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js Line 2039:<br />
<code><pre><br />
//Returns the Radio Power. Called by DeviceMenu. Added by pEEf <br />
getPower: function() { <br />
return this.phoneRadioState;<br />
},<br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 59:<br />
<code><pre><br />
// Toggle for Radio Power - Added by pEEf<br />
if(this.barAssistant.getPower()) {<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn off Phone Radio');<br />
}<br />
else {<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn on Phone Radio');<br />
}<br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 107:<br />
<code><pre>this.controller.get('dm_power').addEventListener(Mojo.Event.tap, this.togglePower.bindAsEventListener(this));</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 126:<br />
<code><pre><br />
// Toggles the Radio Power - Added by pEEf <br />
<br />
togglePower: function() {<br />
this.serviceRequest = new Mojo.Service.Request("palm://com.palm.vibrate", {<br />
method: 'vibrate', parameters: { 'period': 0,'duration': 250 }<br />
});<br />
if(this.barAssistant.getPower()) {<br />
TelephonyService.tempPowerSet('off',false,null,null);<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn on Phone Radio');<br />
}<br />
else {<br />
TelephonyService.tempPowerSet('on',false,null,null);<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn off Phone Radio');<br />
}<br />
this.toggleDeviceMenu();<br />
},<br />
</pre></code><br />
<br />
== Concerns ==<br />
* Turn off the radio, then turn on airplane mode, and upon turning off airplane mode, the toggle displays the wrong message.<br />
* Turn on airplane mode, toggle displays wrong message<br />
<br />
== Credits ==<br />
Brought to you by pEEf.</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Patch_webOS_Radio_Power_Switch&diff=1968Patch webOS Radio Power Switch2009-07-24T07:15:17Z<p>HattCzech: /* Seamless Interface */ details on why 1.1.0 does not work</p>
<hr />
<div>= Seamless Interface =<br />
<br />
[[Image:RadioPowerSwitch.jpg|border|right|Radio Power Switch]]<br />
<br />
== Introduction ==<br />
<br />
I took what pEEf did and made it look more like it fits. I liked the original idea, but as mentioned in the concerns below, when changing between Airplane mode and back, it doesn't have the correct information. I made mine look like the Bluetooth and Wi-Fi menus.<br />
<br />
Works with: 1.0.x<br />
<br />
* Does '''NOT''' currently work with: 1.1.0<br />
** Always shows phone in the OFF state<br />
<br />
== Procedure ==<br />
<br />
Run the following commands:<br />
<br />
''In this example, I have the patch file located in my home directory under '''patches'''''<br />
<source lang="bash"><br />
cd /<br />
sudo patch -p0 --backup-if-mismatch < ~/patches/radiopower.patch<br />
</source><br />
<br />
This is what you should see if it ran properly:<br />
<source lang="text"><br />
patching file /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js<br />
patching file /usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js<br />
patching file /usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html<br />
</source><br />
<br />
These modifications will require LunaSysMgr to be restarted. A rescan will not work. After you've run the commands above, run one more command:<br />
<source lang="bash"><br />
pkill LunaSysMgr<br />
</source><br />
<br />
== radiopower.patch ==<br />
<br />
<source lang="diff"><br />
--- /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js Sat Jul 18 00:21:30 2009<br />
+++ /usr/lib/luna/sys-mod/luna-systemui/app/controllers/bar-assistant.js Fri Jul 24 00:44:08 2009<br />
@@ -789,6 +789,8 @@<br />
this.callForwardNotificationSession = null; <br />
} <br />
}<br />
+ var stageController = Mojo.Controller.getAppController().getStageProxy("DeviceMenu");<br />
+ stageController.delegateToSceneAssistant("updatePhone");<br />
}<br />
else if (payload.eventNetwork && this.phoneRadioState) {<br />
var networkMsg = payload.eventNetwork;<br />
@@ -2570,6 +2572,10 @@<br />
<br />
getCurrentWiFiState: function() {<br />
return this.wifiState;<br />
+},<br />
+<br />
+getCurrentPhoneState: function() {<br />
+ return this.phoneRadioState;<br />
},<br />
<br />
setDeviceMenuAssistant: function(menuassistant) {<br />
--- /usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Sat Jul 18 00:21:30 2009<br />
+++ /usr/lib/luna/sys-mod/luna-systemui/app/controllers/devicemenu-assistant.js Fri Jul 24 00:50:25 2009<br />
@@ -1,6 +1,6 @@<br />
/* Copyright 2009 Palm, Inc. All rights reserved. */<br />
<br />
-var RadioState = new Hash({wifi: undefined, bluetooth: undefined});<br />
+var RadioState = new Hash({wifi: undefined, bluetooth: undefined, phone: undefined});<br />
<br />
var DevicemenuAssistant = Class.create({<br />
<br />
@@ -36,6 +36,8 @@<br />
this.drawerModel = {myOpenProperty:false};<br />
this.controller.setupWidget('wifidetails', {modelProperty:'myOpenProperty'}, this.drawerModel);<br />
this.controller.setupWidget('btdetails', {modelProperty:'myOpenProperty'}, this.drawerModel);<br />
+ this.controller.setupWidget('phonedetails', {modelProperty:'myOpenProperty'}, this.drawerModel);<br />
+ this.phonedrawer = this.controller.get('phonedetails');<br />
this.wifidrawer = this.controller.get('wifidetails');<br />
this.btdrawer = this.controller.get('btdetails');<br />
<br />
@@ -92,6 +94,14 @@<br />
else<br />
this.controller.get('wifimsg').innerHTML = wifistate.escapeHTML(); <br />
} <br />
+ if(this.barAssistant.getCurrentPhoneState()) {<br />
+ this.controller.get('phonemsg').innerHTML = $L('On');<br />
+ RadioState.set('phone',true);<br />
+ }<br />
+ else {<br />
+ this.controller.get('phonemsg').innerHTML = $L('Off');<br />
+ RadioState.set('phone',false);<br />
+ }<br />
this.controller.listen(this.controller.document, Mojo.Event.deactivate, this.close.bindAsEventListener(this));<br />
this.isVisible = true;<br />
<br />
@@ -115,6 +125,8 @@<br />
this.controller.get('btlist').addEventListener(Mojo.Event.listTap,this.handleBTTap.bindAsEventListener(this)); <br />
this.controller.get('dm_wifi').addEventListener(Mojo.Event.tap, this.togglewifiList.bindAsEventListener(this));<br />
this.controller.get('dm_bluetooth').addEventListener(Mojo.Event.tap, this.togglebluetoothList.bindAsEventListener(this));<br />
+ this.controller.get('dm_phone').addEventListener(Mojo.Event.tap, this.togglePhoneList.bindAsEventListener(this));<br />
+ this.controller.get('phone_radio').addEventListener(Mojo.Event.tap, this.togglePhoneRadio.bindAsEventListener(this));<br />
this.controller.get('wifi_radio').addEventListener(Mojo.Event.tap, this.toggleWifiRadio.bindAsEventListener(this));<br />
this.controller.get('bt_radio').addEventListener(Mojo.Event.tap, this.toggleBTRadio.bindAsEventListener(this));<br />
this.controller.get('bt_pref').addEventListener(Mojo.Event.tap,this.handleBluetoothLaunch.bindAsEventListener(this));<br />
@@ -175,6 +187,48 @@<br />
this.apModeInProgress = false;<br />
},<br />
<br />
+ updatePhone: function() {<br />
+ if(this.barAssistant.getCurrentPhoneState()) {<br />
+ this.controller.get('phonemsg').innerHTML = $L('On');<br />
+ this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');<br />
+ RadioState.set('phone', true);<br />
+ }<br />
+ else {<br />
+ this.controller.get('phonemsg').innerHTML = $L('Off');<br />
+ this.controller.get('phone_radio').innerHTML = $L('Turn on Phone');<br />
+ RadioState.set('phone', false);<br />
+ }<br />
+ },<br />
+ <br />
+ togglePhoneRadio: function(event) {<br />
+ this.serviceRequest = new Mojo.Service.Request("palm://com.palm.vibrate", {<br />
+ method: 'vibrate', parameters: { 'period': 0,'duration': 250 }<br />
+ });<br />
+ if(RadioState.get('phone'))<br />
+ TelephonyService.tempPowerSet('off',false,null,null);<br />
+ else<br />
+ TelephonyService.tempPowerSet('on',false,null,null);<br />
+ this.toggleDeviceMenu();<br />
+ },<br />
+ <br />
+ togglePhoneList: function(event) {<br />
+ if(this.apModeInProgress)<br />
+ return;<br />
+ <br />
+ if (this.phonedrawer.mojo.getOpenState()) {<br />
+ this.controller.hideWidgetContainer(this.controller.get('phonedetails')); <br />
+ }<br />
+ else {<br />
+ if(RadioState.get('phone'))<br />
+ this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');<br />
+ else<br />
+ this.controller.get('phone_radio').innerHTML = $L('Turn on Phone'); <br />
+ <br />
+ this.controller.showWidgetContainer(this.controller.get('phonedetails'));<br />
+ }<br />
+ this.phonedrawer.mojo.setOpenState(!this.phonedrawer.mojo.getOpenState()); <br />
+ },<br />
+ <br />
toggleBTRadio: function(event) {<br />
if(RadioState.get('bluetooth')) {<br />
BtService.radiooff(null,null); <br />
@@ -880,7 +934,10 @@<br />
},<br />
<br />
close: function() {<br />
- <br />
+ if(this.phonedrawer.mojo.getOpenState()) {<br />
+ this.controller.hideWidgetContainer(this.controller.get('phonedetails'));<br />
+ this.phonedrawer.mojo.setOpenState(false);<br />
+ }<br />
if (this.btdrawer.mojo.getOpenState()) {<br />
this.clearBTList(); <br />
this.controller.hideWidgetContainer(this.controller.get('btdetails'));<br />
--- /usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html Sat Jul 18 00:21:30 2009<br />
+++ /usr/lib/luna/sys-mod/luna-systemui/app/views/devicemenu/devicemenu-scene.html Fri Jul 24 00:52:11 2009<br />
@@ -94,6 +94,22 @@<br />
<br />
<div class="palm-section-divider"></div><br />
<br />
+ <div class="palm-row" id="dm_phone" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
+ <div class="title truncating-text"><br />
+ <div class="label right" id="phonemsg">&nbsp;</div><br />
+ <span x-mojo-loc=''>Phone</span><br />
+ </div><br />
+ </div></div><br />
+ <br />
+ <div id='phonedetails' x-mojo-element="Drawer"><br />
+ <div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
+ <div id="phone_radio" class="title truncating-text"><br />
+ </div><br />
+ </div></div><br />
+ </div><br />
+ <br />
+ <div class="palm-section-divider"></div><br />
+ <br />
<div id="dm_airplanemode" class="palm-row last" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
<div id="dm_airplanemode_status" class="title truncating-text"><br />
</div><br />
</source><br />
<br />
== Acknowledgements ==<br />
<br />
* pEEf, for figuring everything out<br />
* [[User:HattCzech|HattCzech]]<br />
<br />
== Concerns ==<br />
<br />
* Airplane mode still always turns the radio on regardless of the state before airplane mode was turned on. Otherwise, very nice.<br />
** I may try to add in a way for it to remember the phone state, but I figured that was the point of Airplane mode, so I haven't looked into it yet. I will look through the code again and see if it's worth it. -[[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Original Version =<br />
<br />
I created this mod so I can turn off the cellular radio, but keep WiFi and Bluetooth on. Strangely, The Pre does not seem to have an existing way to do this, only the "Airplane Mode" which shuts off ALL radios!<br />
<br />
I currently do not have Sprint service on my Pre, and am just using it with WiFi. (See [/bypassing-activation Bypassing Activation] for info on how to do this.)<br />
<br />
This will also be useful for people wishing to save their battery if in a poor or no service area, yet still wanting to use WiFi.<br />
<br />
Another great use is shutting off the phone so calls will not disturb you while allowing the phone to do all of its network-related activity.<br />
<br />
How it works: Simply click the upper right of the screen where the status bar is (signal strength). You will get a drop-down menu, this is where the stock "Airplane Mode" is. I have added a "Toggle Radio Power" function here. If the radio is on it will turn it off, and vice-versa. It will not turn off WiFi or Bluetooth like Airplane mode does.<br />
<br />
== Note ==<br />
<br />
The Pre actually already lets you turn off the cell radio. You can just turn on Airplane Mode, then turn on WiFi, Bluetooth, or both. ~ lolaiba<br />
<br />
== Installation ==<br />
<br />
NOTE: If you have never modified any code on the phone, please see [/stock-application-mods Modifiying Stock Applications] first.<br />
<br />
This mod is simply additional code to be added to 3 files on your Pre. WARNING: MAKE BACKUPS FIRST!<br />
<br />
I will update the page later with proper diffs, but for now you can just get into the shell, make your backups, fire up vi (or nano) then paste in the relevant lines. Once you are done, you can test it without rebooting by forcing the Luna manager to reinitialize its cache:<br />
<code><pre><br />
luna-send -n 1 palm://com.palm.applicationManager/rescan {}<br />
</pre></code><br />
<br />
Here is the code, Enjoy!<br />
<br />
/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html Line 94:<br />
<code><pre><br />
<div class="palm-section-divider"></div><!-- Added by pEEf --><br />
<br />
<div id="dm_power" class="palm-row" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
<div id="dm_power_status" class="title truncating-text"> <br />
</div><br />
</div></div><br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js Line 2039:<br />
<code><pre><br />
//Returns the Radio Power. Called by DeviceMenu. Added by pEEf <br />
getPower: function() { <br />
return this.phoneRadioState;<br />
},<br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 59:<br />
<code><pre><br />
// Toggle for Radio Power - Added by pEEf<br />
if(this.barAssistant.getPower()) {<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn off Phone Radio');<br />
}<br />
else {<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn on Phone Radio');<br />
}<br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 107:<br />
<code><pre>this.controller.get('dm_power').addEventListener(Mojo.Event.tap, this.togglePower.bindAsEventListener(this));</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 126:<br />
<code><pre><br />
// Toggles the Radio Power - Added by pEEf <br />
<br />
togglePower: function() {<br />
this.serviceRequest = new Mojo.Service.Request("palm://com.palm.vibrate", {<br />
method: 'vibrate', parameters: { 'period': 0,'duration': 250 }<br />
});<br />
if(this.barAssistant.getPower()) {<br />
TelephonyService.tempPowerSet('off',false,null,null);<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn on Phone Radio');<br />
}<br />
else {<br />
TelephonyService.tempPowerSet('on',false,null,null);<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn off Phone Radio');<br />
}<br />
this.toggleDeviceMenu();<br />
},<br />
</pre></code><br />
<br />
== Concerns ==<br />
* Turn off the radio, then turn on airplane mode, and upon turning off airplane mode, the toggle displays the wrong message.<br />
* Turn on airplane mode, toggle displays wrong message<br />
<br />
== Credits ==<br />
Brought to you by pEEf.</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Patch_webOS_Radio_Power_Switch&diff=1967Patch webOS Radio Power Switch2009-07-24T07:12:37Z<p>HattCzech: /* Seamless Interface */ removed source segments and made patch</p>
<hr />
<div>= Seamless Interface =<br />
<br />
[[Image:RadioPowerSwitch.jpg|border|right|Radio Power Switch]]<br />
<br />
== Introduction ==<br />
<br />
I took what pEEf did and made it look more like it fits. I liked the original idea, but as mentioned in the concerns below, when changing between Airplane mode and back, it doesn't have the correct information. I made mine look like the Bluetooth and Wi-Fi menus.<br />
<br />
Works with: 1.0.x<br />
<br />
Does '''NOT''' currently work with: 1.1.0<br />
<br />
== Procedure ==<br />
<br />
Run the following commands:<br />
<br />
''In this example, I have the patch file located in my home directory under '''patches'''''<br />
<source lang="bash"><br />
cd /<br />
sudo patch -p0 --backup-if-mismatch < ~/patches/radiopower.patch<br />
</source><br />
<br />
This is what you should see if it ran properly:<br />
<source lang="text"><br />
patching file /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js<br />
patching file /usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js<br />
patching file /usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html<br />
</source><br />
<br />
These modifications will require LunaSysMgr to be restarted. A rescan will not work. After you've run the commands above, run one more command:<br />
<source lang="bash"><br />
pkill LunaSysMgr<br />
</source><br />
<br />
== radiopower.patch ==<br />
<br />
<source lang="diff"><br />
--- /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js Sat Jul 18 00:21:30 2009<br />
+++ /usr/lib/luna/sys-mod/luna-systemui/app/controllers/bar-assistant.js Fri Jul 24 00:44:08 2009<br />
@@ -789,6 +789,8 @@<br />
this.callForwardNotificationSession = null; <br />
} <br />
}<br />
+ var stageController = Mojo.Controller.getAppController().getStageProxy("DeviceMenu");<br />
+ stageController.delegateToSceneAssistant("updatePhone");<br />
}<br />
else if (payload.eventNetwork && this.phoneRadioState) {<br />
var networkMsg = payload.eventNetwork;<br />
@@ -2570,6 +2572,10 @@<br />
<br />
getCurrentWiFiState: function() {<br />
return this.wifiState;<br />
+},<br />
+<br />
+getCurrentPhoneState: function() {<br />
+ return this.phoneRadioState;<br />
},<br />
<br />
setDeviceMenuAssistant: function(menuassistant) {<br />
--- /usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Sat Jul 18 00:21:30 2009<br />
+++ /usr/lib/luna/sys-mod/luna-systemui/app/controllers/devicemenu-assistant.js Fri Jul 24 00:50:25 2009<br />
@@ -1,6 +1,6 @@<br />
/* Copyright 2009 Palm, Inc. All rights reserved. */<br />
<br />
-var RadioState = new Hash({wifi: undefined, bluetooth: undefined});<br />
+var RadioState = new Hash({wifi: undefined, bluetooth: undefined, phone: undefined});<br />
<br />
var DevicemenuAssistant = Class.create({<br />
<br />
@@ -36,6 +36,8 @@<br />
this.drawerModel = {myOpenProperty:false};<br />
this.controller.setupWidget('wifidetails', {modelProperty:'myOpenProperty'}, this.drawerModel);<br />
this.controller.setupWidget('btdetails', {modelProperty:'myOpenProperty'}, this.drawerModel);<br />
+ this.controller.setupWidget('phonedetails', {modelProperty:'myOpenProperty'}, this.drawerModel);<br />
+ this.phonedrawer = this.controller.get('phonedetails');<br />
this.wifidrawer = this.controller.get('wifidetails');<br />
this.btdrawer = this.controller.get('btdetails');<br />
<br />
@@ -92,6 +94,14 @@<br />
else<br />
this.controller.get('wifimsg').innerHTML = wifistate.escapeHTML(); <br />
} <br />
+ if(this.barAssistant.getCurrentPhoneState()) {<br />
+ this.controller.get('phonemsg').innerHTML = $L('On');<br />
+ RadioState.set('phone',true);<br />
+ }<br />
+ else {<br />
+ this.controller.get('phonemsg').innerHTML = $L('Off');<br />
+ RadioState.set('phone',false);<br />
+ }<br />
this.controller.listen(this.controller.document, Mojo.Event.deactivate, this.close.bindAsEventListener(this));<br />
this.isVisible = true;<br />
<br />
@@ -115,6 +125,8 @@<br />
this.controller.get('btlist').addEventListener(Mojo.Event.listTap,this.handleBTTap.bindAsEventListener(this)); <br />
this.controller.get('dm_wifi').addEventListener(Mojo.Event.tap, this.togglewifiList.bindAsEventListener(this));<br />
this.controller.get('dm_bluetooth').addEventListener(Mojo.Event.tap, this.togglebluetoothList.bindAsEventListener(this));<br />
+ this.controller.get('dm_phone').addEventListener(Mojo.Event.tap, this.togglePhoneList.bindAsEventListener(this));<br />
+ this.controller.get('phone_radio').addEventListener(Mojo.Event.tap, this.togglePhoneRadio.bindAsEventListener(this));<br />
this.controller.get('wifi_radio').addEventListener(Mojo.Event.tap, this.toggleWifiRadio.bindAsEventListener(this));<br />
this.controller.get('bt_radio').addEventListener(Mojo.Event.tap, this.toggleBTRadio.bindAsEventListener(this));<br />
this.controller.get('bt_pref').addEventListener(Mojo.Event.tap,this.handleBluetoothLaunch.bindAsEventListener(this));<br />
@@ -175,6 +187,48 @@<br />
this.apModeInProgress = false;<br />
},<br />
<br />
+ updatePhone: function() {<br />
+ if(this.barAssistant.getCurrentPhoneState()) {<br />
+ this.controller.get('phonemsg').innerHTML = $L('On');<br />
+ this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');<br />
+ RadioState.set('phone', true);<br />
+ }<br />
+ else {<br />
+ this.controller.get('phonemsg').innerHTML = $L('Off');<br />
+ this.controller.get('phone_radio').innerHTML = $L('Turn on Phone');<br />
+ RadioState.set('phone', false);<br />
+ }<br />
+ },<br />
+ <br />
+ togglePhoneRadio: function(event) {<br />
+ this.serviceRequest = new Mojo.Service.Request("palm://com.palm.vibrate", {<br />
+ method: 'vibrate', parameters: { 'period': 0,'duration': 250 }<br />
+ });<br />
+ if(RadioState.get('phone'))<br />
+ TelephonyService.tempPowerSet('off',false,null,null);<br />
+ else<br />
+ TelephonyService.tempPowerSet('on',false,null,null);<br />
+ this.toggleDeviceMenu();<br />
+ },<br />
+ <br />
+ togglePhoneList: function(event) {<br />
+ if(this.apModeInProgress)<br />
+ return;<br />
+ <br />
+ if (this.phonedrawer.mojo.getOpenState()) {<br />
+ this.controller.hideWidgetContainer(this.controller.get('phonedetails')); <br />
+ }<br />
+ else {<br />
+ if(RadioState.get('phone'))<br />
+ this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');<br />
+ else<br />
+ this.controller.get('phone_radio').innerHTML = $L('Turn on Phone'); <br />
+ <br />
+ this.controller.showWidgetContainer(this.controller.get('phonedetails'));<br />
+ }<br />
+ this.phonedrawer.mojo.setOpenState(!this.phonedrawer.mojo.getOpenState()); <br />
+ },<br />
+ <br />
toggleBTRadio: function(event) {<br />
if(RadioState.get('bluetooth')) {<br />
BtService.radiooff(null,null); <br />
@@ -880,7 +934,10 @@<br />
},<br />
<br />
close: function() {<br />
- <br />
+ if(this.phonedrawer.mojo.getOpenState()) {<br />
+ this.controller.hideWidgetContainer(this.controller.get('phonedetails'));<br />
+ this.phonedrawer.mojo.setOpenState(false);<br />
+ }<br />
if (this.btdrawer.mojo.getOpenState()) {<br />
this.clearBTList(); <br />
this.controller.hideWidgetContainer(this.controller.get('btdetails'));<br />
--- /usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html Sat Jul 18 00:21:30 2009<br />
+++ /usr/lib/luna/sys-mod/luna-systemui/app/views/devicemenu/devicemenu-scene.html Fri Jul 24 00:52:11 2009<br />
@@ -94,6 +94,22 @@<br />
<br />
<div class="palm-section-divider"></div><br />
<br />
+ <div class="palm-row" id="dm_phone" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
+ <div class="title truncating-text"><br />
+ <div class="label right" id="phonemsg">&nbsp;</div><br />
+ <span x-mojo-loc=''>Phone</span><br />
+ </div><br />
+ </div></div><br />
+ <br />
+ <div id='phonedetails' x-mojo-element="Drawer"><br />
+ <div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
+ <div id="phone_radio" class="title truncating-text"><br />
+ </div><br />
+ </div></div><br />
+ </div><br />
+ <br />
+ <div class="palm-section-divider"></div><br />
+ <br />
<div id="dm_airplanemode" class="palm-row last" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
<div id="dm_airplanemode_status" class="title truncating-text"><br />
</div><br />
</source><br />
<br />
== Acknowledgements ==<br />
<br />
* pEEf, for figuring everything out<br />
* [[User:HattCzech|HattCzech]]<br />
<br />
== Concerns ==<br />
<br />
* Airplane mode still always turns the radio on regardless of the state before airplane mode was turned on. Otherwise, very nice.<br />
** I may try to add in a way for it to remember the phone state, but I figured that was the point of Airplane mode, so I haven't looked into it yet. I will look through the code again and see if it's worth it. -[[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Original Version =<br />
<br />
I created this mod so I can turn off the cellular radio, but keep WiFi and Bluetooth on. Strangely, The Pre does not seem to have an existing way to do this, only the "Airplane Mode" which shuts off ALL radios!<br />
<br />
I currently do not have Sprint service on my Pre, and am just using it with WiFi. (See [/bypassing-activation Bypassing Activation] for info on how to do this.)<br />
<br />
This will also be useful for people wishing to save their battery if in a poor or no service area, yet still wanting to use WiFi.<br />
<br />
Another great use is shutting off the phone so calls will not disturb you while allowing the phone to do all of its network-related activity.<br />
<br />
How it works: Simply click the upper right of the screen where the status bar is (signal strength). You will get a drop-down menu, this is where the stock "Airplane Mode" is. I have added a "Toggle Radio Power" function here. If the radio is on it will turn it off, and vice-versa. It will not turn off WiFi or Bluetooth like Airplane mode does.<br />
<br />
== Note ==<br />
<br />
The Pre actually already lets you turn off the cell radio. You can just turn on Airplane Mode, then turn on WiFi, Bluetooth, or both. ~ lolaiba<br />
<br />
== Installation ==<br />
<br />
NOTE: If you have never modified any code on the phone, please see [/stock-application-mods Modifiying Stock Applications] first.<br />
<br />
This mod is simply additional code to be added to 3 files on your Pre. WARNING: MAKE BACKUPS FIRST!<br />
<br />
I will update the page later with proper diffs, but for now you can just get into the shell, make your backups, fire up vi (or nano) then paste in the relevant lines. Once you are done, you can test it without rebooting by forcing the Luna manager to reinitialize its cache:<br />
<code><pre><br />
luna-send -n 1 palm://com.palm.applicationManager/rescan {}<br />
</pre></code><br />
<br />
Here is the code, Enjoy!<br />
<br />
/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html Line 94:<br />
<code><pre><br />
<div class="palm-section-divider"></div><!-- Added by pEEf --><br />
<br />
<div id="dm_power" class="palm-row" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
<div id="dm_power_status" class="title truncating-text"> <br />
</div><br />
</div></div><br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js Line 2039:<br />
<code><pre><br />
//Returns the Radio Power. Called by DeviceMenu. Added by pEEf <br />
getPower: function() { <br />
return this.phoneRadioState;<br />
},<br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 59:<br />
<code><pre><br />
// Toggle for Radio Power - Added by pEEf<br />
if(this.barAssistant.getPower()) {<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn off Phone Radio');<br />
}<br />
else {<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn on Phone Radio');<br />
}<br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 107:<br />
<code><pre>this.controller.get('dm_power').addEventListener(Mojo.Event.tap, this.togglePower.bindAsEventListener(this));</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 126:<br />
<code><pre><br />
// Toggles the Radio Power - Added by pEEf <br />
<br />
togglePower: function() {<br />
this.serviceRequest = new Mojo.Service.Request("palm://com.palm.vibrate", {<br />
method: 'vibrate', parameters: { 'period': 0,'duration': 250 }<br />
});<br />
if(this.barAssistant.getPower()) {<br />
TelephonyService.tempPowerSet('off',false,null,null);<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn on Phone Radio');<br />
}<br />
else {<br />
TelephonyService.tempPowerSet('on',false,null,null);<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn off Phone Radio');<br />
}<br />
this.toggleDeviceMenu();<br />
},<br />
</pre></code><br />
<br />
== Concerns ==<br />
* Turn off the radio, then turn on airplane mode, and upon turning off airplane mode, the toggle displays the wrong message.<br />
* Turn on airplane mode, toggle displays wrong message<br />
<br />
== Credits ==<br />
Brought to you by pEEf.</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Messaging_Mods&diff=1966Messaging Mods2009-07-24T06:18:10Z<p>HattCzech: /* Character Counter */ removed source segments and made patch</p>
<hr />
<div>All files are located in '''/usr/palm/applications/com.palm.app.messaging/'''<br />
<br />
= Add Timestamps to All Messages =<br />
<br />
== Introduction ==<br />
<br />
A number of users have requested adding timestamps to each message that arrives on the device.<br />
Palm actually goes out of their way to group messages that have arrived during various time intervals,<br />
but if you'd prefer to see a timestamp on each message, simply follow the instructions below.<br />
<br />
== Procedure ==<br />
<br />
# [[Portal:Accessing_Linux|Gain root access to your device]]<br />
# Remount the file system as read/write<br />
# cd to '''/usr/palm/applications/com.palm.app.messaging/app/controllers/'''<br />
# Backup '''chatview-assistant.js''' (just to be safe)<br />
# Open '''chatview-assistant.js''' and comment out the following lines:<br />
#* 1169 - line that starts with: '''if(!ChatFlags.'''<br />
#* 1177 - line that starts with: '''if(today-msg.'''<br />
#* 1179 - first closing bracket on its own line: '''}'''<br />
#* 1180 - second closing bracket on its own line: '''}'''<br />
# Save the file and exit the editor<br />
# Remount the file system as read-only<br />
# Logout of your root session<br />
# Reboot the device<br />
<br />
You should now see a full timestamp on all received messages.<br />
<br />
== Acknowledgements ==<br />
<br />
Thanks to [[User:tk102|tk102]] and [[User:scuba_steve|scuba_steve]] on [http://www.precentral.net/ PreCentral] for the mod.<br />
<br />
----<br />
<br />
= New Card For Each Conversation =<br />
<br />
== Introduction ==<br />
<br />
The message app can be a pain when you have multiple conversations going on. You often have to swipe back and then pick someone else. <br />
It gets annoying fast. This modification modifies the messaging application so that a new card is created whenever you click into a conversation.<br />
<br />
== Procedure ==<br />
<br />
Edit '''/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js''' and replace the launchChatView function with the following function:<br />
<br />
<code><pre><br />
launchChatView: function(chatThreadId) {<br />
//Need to jump to that stage if it exists<br />
var stageController = Mojo.Controller.appController.getStageController("messaging"+chatThreadId);<br />
if (stageController) {<br />
stageController.activate();<br />
return;<br />
}<br />
<br />
var params = {name: 'messaging' + chatThreadId,<br />
lightweight: Mojo.Controller.appInfo.lwStages<br />
};<br />
<br />
var callback = function(controller) {<br />
controller.pushScene('chatview',chatThreadId,{<br />
focusWindow: true<br />
}); <br />
};<br />
<br />
Mojo.Controller.getAppController().createStageWithCallback(params, callback); //doesnt create ifit exists sooo<br />
},<br />
<br />
clearListBadgeForChatThreadId: function(chatThreadId) {<br />
var badgeContainers = ["buddyBageContainer","historyBageContainer"];<br />
var listItem;<br />
for (var i = 0; i < badgeContainers.length; i++) {<br />
listItem = this.controller.get(badgeContainers[i] + chatThreadId);<br />
if (listItem && !listItem.hasClassName('hide-unread-count')) {<br />
listItem.addClassName('hide-unread-count');<br />
}<br />
} <br />
},<br />
</pre></code><br />
<br />
Now in '''/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js''', comment out lines 246 and 247.<br />
This change will ensure that if you use the "back gesture" in a chat, the application doesn't bring you back to the conversation list...or do anything else.<br />
<br />
To "comment out" a line, add // at the beginning. Example:<br />
<code><pre><br />
printf("This is code");<br />
//printf("This is commented out");<br />
</pre></code><br />
<br />
== Concerns ==<br />
There is some delay in creating the new cards. I'm not sure why though.<br />
As stated above, the cards are only opened when you click into the conversation. Responding to a notification will result in the reuse of the buddy list window, and you have disabled the back gesture.<br />
<br />
== Acknolwedgements ==<br />
<br />
Thanks to [[User:mikedg|mikedg]] for the mod.<br />
<br />
[[User:chris_phelps|chris_phelps]] is continuing to work on this modification to get it working more completely.<br />
The first step is to clean up the other launchChatNNN functionality in app-assistant.js which accepts Luna System calls from the notification dashboard items which are created when a new message is received on the phone. These code modifications are being tested currently, and will be posted when we figure out how to clear the new message counters in the main listview-assistant.js.<br />
<br />
----<br />
<br />
= Character Counter =<br />
<br />
[[Image:Messaging_CharacterCounter.jpg|border|right|Character Counter]]<br />
<br />
== Introduction ==<br />
<br />
One of the features I liked about my old Treo was the character counter built-in to the messaging application. I thought it would be useful on the Pre, so I modified the messaging application to show the current character count. I made this a separate page from the other modifications because it requires many code changes. Maybe the other messaging modifications could be rolled into this page as well.<br />
<br />
== Procedure ==<br />
<br />
Run the following commands:<br />
<br />
''In this example, I have the patch file located in my home directory under '''patches'''''<br />
<source lang="bash"><br />
cd /<br />
sudo patch -p0 --backup-if-mismatch < ~/patches/charcounter.patch<br />
</source><br />
<br />
This is what you should see if it ran properly:<br />
<source lang="text"><br />
patching file /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js<br />
patching file /usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js<br />
patching file /usr/palm/applications/com.palm.app.messaging/app/utilities/CharacterCounter.js<br />
patching file /usr/palm/applications/com.palm.app.messaging/app/views/chatview/chatview-scene.html<br />
patching file /usr/palm/applications/com.palm.app.messaging/app/views/compose/compose-scene.html<br />
patching file /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css<br />
</source><br />
<br />
These modifications will require LunaSysMgr to be restarted. A rescan will not work. After you've run the commands above, run one more command:<br />
<source lang="bash"><br />
pkill LunaSysMgr<br />
</source><br />
<br />
== charcounter.patch ==<br />
<br />
<source lang="diff"><br />
diff -ur /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js /usr/palm/app-modified/com.palm.app.messaging/app/controllers/chatview-assistant.js<br />
--- /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js 2009-07-18 00:22:14.000000000 -0500<br />
+++ /usr/palm/app-modified/com.palm.app.messaging/app/controllers/chatview-assistant.js 2009-07-23 23:13:19.000000000 -0500<br />
@@ -160,6 +160,11 @@<br />
segmentCountContainer: this.controller.get('segmentCounterContainer'),<br />
segmentCountElement: this.controller.get('segmentCounter'),<br />
setTextFieldValueFn: this.setTextFieldValue.bind(this)<br />
+ },<br />
+ charCounter: {<br />
+ charCountContainer: this.controller.get('charCounterContainer'),<br />
+ charCountElement: this.controller.get('charCounter'),<br />
+ setTextFieldValueFn: this.setTextFieldValue.bind(this)<br />
}<br />
};<br />
<br />
diff -ur /usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js /usr/palm/app-modified/com.palm.app.messaging/app/controllers/compose-assistant.js<br />
--- /usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js 2009-07-18 00:22:14.000000000 -0500<br />
+++ /usr/palm/app-modified/com.palm.app.messaging/app/controllers/compose-assistant.js 2009-07-23 23:14:11.000000000 -0500<br />
@@ -140,6 +140,11 @@<br />
segmentCountContainer: this.controller.get('segmentCounterContainer'),<br />
segmentCountElement: this.controller.get('segmentCounter'),<br />
setTextFieldValueFn: this.setTextFieldValue.bind(this)<br />
+ },<br />
+ charCounter: {<br />
+ charCountContainer: this.controller.get('charCounterContainer'),<br />
+ charCountElement: this.controller.get('charCounter'),<br />
+ setTextFieldValueFn: this.setTextFieldValue.bind(this)<br />
}<br />
};<br />
<br />
diff -ur /usr/palm/applications/com.palm.app.messaging/app/utilities/CharacterCounter.js /usr/palm/app-modified/com.palm.app.messaging/app/utilities/CharacterCounter.js<br />
--- /usr/palm/applications/com.palm.app.messaging/app/utilities/CharacterCounter.js 2009-07-18 00:22:14.000000000 -0500<br />
+++ /usr/palm/app-modified/com.palm.app.messaging/app/utilities/CharacterCounter.js 2009-07-23 23:47:32.000000000 -0500<br />
@@ -39,6 +39,10 @@<br />
containerElement: null,<br />
valueElement: null<br />
};<br />
+ var charCounterUI = {<br />
+ containerElement: null,<br />
+ valueElement: null<br />
+ };<br />
<br />
<br />
// TODO: eventually we might want to implement some cleverness that counts<br />
@@ -185,6 +189,20 @@<br />
}<br />
};<br />
<br />
+ var setCurrentCharCount = function(newCharCount) {<br />
+ if(charCounterUI.valueElement)<br />
+ charCounterUI.valueElement.update(newCharCount);<br />
+ if(charCounterUI.containerElement) {<br />
+ if (newCharCount == 0) {<br />
+ if (charCounterUI.containerElement.visible())<br />
+ charCounterUI.containerElement.hide();<br />
+ } else {<br />
+ if (!charCounterUI.containerElement.visible())<br />
+ charCounterUI.containerElement.show();<br />
+ }<br />
+ }<br />
+ };<br />
+ <br />
return {<br />
<br />
init: function(controller,platform,textElement,params) {<br />
@@ -265,7 +283,13 @@<br />
setTextFieldValueFn = params.segmentCounter.setTextFieldValueFn;<br />
} <br />
}<br />
-<br />
+ if(params.charCounter) {<br />
+ charCounterUI.containerElement = params.charCounter.charCountContainer;<br />
+ charCounterUI.valueElement = params.charCounter.charCountElement;<br />
+ if(params.charCounter.setTextFieldValueFn) {<br />
+ setTextFieldValueFn = params.charCounter.setTextFieldValueFn;<br />
+ } <br />
+ }<br />
} <br />
},<br />
<br />
@@ -304,6 +328,7 @@<br />
var rawCharacterData = getRawCharacterData();<br />
var messageData = parseMessage(rawCharacterData.message,rawCharacterData.count,_maxLength,true);<br />
adjustedCharacterCount = messageData.adjustedCharacterCount;<br />
+ setCurrentCharCount(rawCharacterData.count);<br />
if (_maxLength > 0)<br />
setOverLimit(messageData.isOverLimit);<br />
setCurrentSegmentCount(messageData.segmentCount); <br />
diff -ur /usr/palm/applications/com.palm.app.messaging/app/views/chatview/chatview-scene.html /usr/palm/app-modified/com.palm.app.messaging/app/views/chatview/chatview-scene.html<br />
--- /usr/palm/applications/com.palm.app.messaging/app/views/chatview/chatview-scene.html 2009-07-18 00:22:14.000000000 -0500<br />
+++ /usr/palm/app-modified/com.palm.app.messaging/app/views/chatview/chatview-scene.html 2009-07-23 23:16:55.000000000 -0500<br />
@@ -22,6 +22,10 @@<br />
<div id="messageContainer" class='palm-row'><br />
<div class="palm-row-wrapper textfield-group focused"><br />
<div class="title"><br />
+ <div id="charCounterContainer"><br />
+ <div id="charCounter"><br />
+ </div><br />
+ </div><br />
<div id="attachmentContainer" style="display: none;"><br />
<div id="cancelAttachment"><br />
</div><br />
diff -ur /usr/palm/applications/com.palm.app.messaging/app/views/compose/compose-scene.html /usr/palm/app-modified/com.palm.app.messaging/app/views/compose/compose-scene.html<br />
--- /usr/palm/applications/com.palm.app.messaging/app/views/compose/compose-scene.html 2009-07-18 00:22:14.000000000 -0500<br />
+++ /usr/palm/app-modified/com.palm.app.messaging/app/views/compose/compose-scene.html 2009-07-23 23:17:14.000000000 -0500<br />
@@ -6,6 +6,10 @@<br />
<div id="messageContainer" class='palm-row'><br />
<div class="palm-row-wrapper textfield-group focused"><br />
<div class="title"><br />
+ <div id="charCounterContainer"><br />
+ <div id="charCounter"><br />
+ </div><br />
+ </div><br />
<div id="attachmentContainer" style="display: none;"><br />
<div id="cancelAttachment"><br />
</div><br />
diff -ur /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css /usr/palm/app-modified/com.palm.app.messaging/stylesheets/messaging.css<br />
--- /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css 2009-07-18 00:22:22.000000000 -0500<br />
+++ /usr/palm/app-modified/com.palm.app.messaging/stylesheets/messaging.css 2009-07-23 23:19:25.000000000 -0500<br />
@@ -837,6 +837,23 @@<br />
#messageContainer.palm-row .icon.right {<br />
height: 61px;<br />
}<br />
+#messageContainer #charCounterContainer {<br />
+ line-height: 20px;<br />
+ display:block;<br />
+ height: 20px;<br />
+ border-width: 0px 10px 0px 9px;<br />
+ -webkit-border-image: url(../images/message-segment-badge.png) 0 10 0 9 stretch stretch;<br />
+ position: absolute;<br />
+ z-index: 3;<br />
+ top: 2px;<br />
+ left: 2px;<br />
+}<br />
+#messageContainer #charCounterContainer #charCounter {<br />
+ font-size: 12px;<br />
+ font-weight: bold;<br />
+ color: #679BC2;<br />
+ margin: 0px -4px 3px -3px;<br />
+}<br />
#messageContainer #attachmentContainer {<br />
position: relative;<br />
margin-top:10px;<br />
</source><br />
<br />
== Acknowledgements ==<br />
<br />
* [[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Force Offline Send Without Dialog =<br />
<br />
<code><pre><br />
sudo mount -o remount,rw /<br />
sudo vi /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js<br />
/forceSendIfOffline =<br />
</pre></code><br />
<br />
Change the line to true (below) , writequit , remount, reload , enjoy <br />
<br />
<code><pre><br />
forceSendIfOffline = true; <br />
:wq <br />
sudo mount -o remount,ro /<br />
sudo stop LunaSysMgr ; sudo start LunaSysMgr<br />
</pre></code></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Patch_webOS_Radio_Power_Switch&diff=1803Patch webOS Radio Power Switch2009-07-23T04:16:19Z<p>HattCzech: /* Seamless Interface */ added image and updated headers</p>
<hr />
<div>= Seamless Interface =<br />
<br />
[[Image:RadioPowerSwitch.jpg|border|right|Radio Power Switch]]<br />
<br />
== Introduction ==<br />
<br />
I took what pEEf did and made it look more like it fits. I liked the original idea, but as mentioned in the concerns below, when changing between Airplane mode and back, it doesn't have the correct information. I made mine look like the Bluetooth and Wi-Fi menus.<br />
<br />
== Procedure ==<br />
<br />
'''/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html''' Line 97:<br />
<source lang="HTML4Strict"><br />
<div class="palm-row" id="dm_phone" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
<div class="title truncating-text"><br />
<div class="label right" id="phonemsg">&nbsp;</div><br />
<span x-mojo-loc=''>Phone</span><br />
</div><br />
</div></div><br />
<br />
<div id='phonedetails' x-mojo-element="Drawer"><br />
<br />
<div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
<div id="phone_radio" class="title truncating-text"><br />
</div><br />
</div></div><br />
<br />
</div><br />
<br />
<div class="palm-section-divider"></div><br />
</source><br />
<br />
<br />
'''/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js''' Line 690:<br />
<source lang="JavaScript"><br />
var stageController = Mojo.Controller.getAppController().getStageProxy("DeviceMenu");<br />
stageController.delegateToSceneAssistant("updatePhone");<br />
</source><br />
<br />
:Line 2302:<br />
<source lang="JavaScript"><br />
getCurrentPhoneState: function() {<br />
return this.phoneRadioState;<br />
},<br />
</source><br />
<br />
<br />
'''/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js''' Line 1:<br />
<source lang="JavaScript"><br />
var RadioState = new Hash({wifi: undefined, bluetooth: undefined, phone: undefined});<br />
</source><br />
<br />
:Line 39:<br />
<source lang="JavaScript"><br />
this.controller.setupWidget('phonedetails', {modelProperty:'myOpenProperty'}, this.drawerModel);<br />
this.phonedrawer = this.controller.get('phonedetails');<br />
</source><br />
<br />
:Line 95:<br />
<source lang="JavaScript"><br />
if(this.barAssistant.getCurrentPhoneState()) {<br />
this.controller.get('phonemsg').innerHTML = $L('On');<br />
RadioState.set('phone',true);<br />
}<br />
else {<br />
this.controller.get('phonemsg').innerHTML = $L('Off');<br />
RadioState.set('phone',false);<br />
}<br />
</source><br />
<br />
:Line 118:<br />
<source lang="JavaScript"><br />
this.controller.get('dm_phone').addEventListener(Mojo.Event.tap, this.togglePhoneList.bindAsEventListener(this));<br />
this.controller.get('phone_radio').addEventListener(Mojo.Event.tap, this.togglePhoneRadio.bindAsEventListener(this));<br />
</source><br />
<br />
:Line 173:<br />
<source lang="JavaScript"><br />
updatePhone: function() {<br />
if(this.barAssistant.getCurrentPhoneState()) {<br />
this.controller.get('phonemsg').innerHTML = $L('On');<br />
this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');<br />
RadioState.set('phone', true);<br />
}<br />
else {<br />
this.controller.get('phonemsg').innerHTML = $L('Off');<br />
this.controller.get('phone_radio').innerHTML = $L('Turn on Phone');<br />
RadioState.set('phone', false);<br />
}<br />
},<br />
<br />
togglePhoneRadio: function(event) {<br />
this.serviceRequest = new Mojo.Service.Request("palm://com.palm.vibrate", {<br />
method: 'vibrate', parameters: { 'period': 0,'duration': 250 }<br />
});<br />
if(RadioState.get('phone'))<br />
TelephonyService.tempPowerSet('off',false,null,null);<br />
else<br />
TelephonyService.tempPowerSet('on',false,null,null);<br />
this.toggleDeviceMenu();<br />
},<br />
<br />
togglePhoneList: function(event) {<br />
if(this.apModeInProgress)<br />
return;<br />
<br />
if (this.phonedrawer.mojo.getOpenState()) {<br />
this.controller.hideWidgetContainer(this.controller.get('phonedetails')); <br />
}<br />
else {<br />
if(RadioState.get('phone'))<br />
this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');<br />
else<br />
this.controller.get('phone_radio').innerHTML = $L('Turn on Phone'); <br />
<br />
this.controller.showWidgetContainer(this.controller.get('phonedetails'));<br />
}<br />
this.phonedrawer.mojo.setOpenState(!this.phonedrawer.mojo.getOpenState()); <br />
},<br />
</source><br />
<br />
:Line 921:<br />
<source lang="JavaScript"><br />
if(this.phonedrawer.mojo.getOpenState()) {<br />
this.controller.hideWidgetContainer(this.controller.get('phonedetails'));<br />
this.phonedrawer.mojo.setOpenState(false);<br />
}<br />
</source><br />
<br />
== Acknowledgements ==<br />
<br />
* pEEf, for figuring everything out<br />
* [[User:HattCzech|HattCzech]]<br />
<br />
== Concerns ==<br />
<br />
* Airplane mode still always turns the radio on regardless of the state before airplane mode was turned on. Otherwise, very nice.<br />
** I may try to add in a way for it to remember the phone state, but I figured that was the point of Airplane mode, so I haven't looked into it yet. I will look through the code again and see if it's worth it. -[[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Original Version =<br />
<br />
I created this mod so I can turn off the cellular radio, but keep WiFi and Bluetooth on. Strangely, The Pre does not seem to have an existing way to do this, only the "Airplane Mode" which shuts off ALL radios!<br />
<br />
I currently do not have Sprint service on my Pre, and am just using it with WiFi. (See [/bypassing-activation Bypassing Activation] for info on how to do this.)<br />
<br />
This will also be useful for people wishing to save their battery if in a poor or no service area, yet still wanting to use WiFi.<br />
<br />
Another great use is shutting off the phone so calls will not disturb you while allowing the phone to do all of its network-related activity.<br />
<br />
How it works: Simply click the upper right of the screen where the status bar is (signal strength). You will get a drop-down menu, this is where the stock "Airplane Mode" is. I have added a "Toggle Radio Power" function here. If the radio is on it will turn it off, and vice-versa. It will not turn off WiFi or Bluetooth like Airplane mode does.<br />
<br />
== Note ==<br />
<br />
The Pre actually already lets you turn off the cell radio. You can just turn on Airplane Mode, then turn on WiFi, Bluetooth, or both. ~ lolaiba<br />
<br />
== Installation ==<br />
<br />
NOTE: If you have never modified any code on the phone, please see [/stock-application-mods Modifiying Stock Applications] first.<br />
<br />
This mod is simply additional code to be added to 3 files on your Pre. WARNING: MAKE BACKUPS FIRST!<br />
<br />
I will update the page later with proper diffs, but for now you can just get into the shell, make your backups, fire up vi (or nano) then paste in the relevant lines. Once you are done, you can test it without rebooting by forcing the Luna manager to reinitialize its cache:<br />
<code><pre><br />
luna-send -n 1 palm://com.palm.applicationManager/rescan {}<br />
</pre></code><br />
<br />
Here is the code, Enjoy!<br />
<br />
/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html Line 94:<br />
<code><pre><br />
<div class="palm-section-divider"></div><!-- Added by pEEf --><br />
<br />
<div id="dm_power" class="palm-row" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
<div id="dm_power_status" class="title truncating-text"> <br />
</div><br />
</div></div><br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js Line 2039:<br />
<code><pre><br />
//Returns the Radio Power. Called by DeviceMenu. Added by pEEf <br />
getPower: function() { <br />
return this.phoneRadioState;<br />
},<br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 59:<br />
<code><pre><br />
// Toggle for Radio Power - Added by pEEf<br />
if(this.barAssistant.getPower()) {<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn off Phone Radio');<br />
}<br />
else {<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn on Phone Radio');<br />
}<br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 107:<br />
<code><pre>this.controller.get('dm_power').addEventListener(Mojo.Event.tap, this.togglePower.bindAsEventListener(this));</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 126:<br />
<code><pre><br />
// Toggles the Radio Power - Added by pEEf <br />
<br />
togglePower: function() {<br />
this.serviceRequest = new Mojo.Service.Request("palm://com.palm.vibrate", {<br />
method: 'vibrate', parameters: { 'period': 0,'duration': 250 }<br />
});<br />
if(this.barAssistant.getPower()) {<br />
TelephonyService.tempPowerSet('off',false,null,null);<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn on Phone Radio');<br />
}<br />
else {<br />
TelephonyService.tempPowerSet('on',false,null,null);<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn off Phone Radio');<br />
}<br />
this.toggleDeviceMenu();<br />
},<br />
</pre></code><br />
<br />
== Concerns ==<br />
* Turn off the radio, then turn on airplane mode, and upon turning off airplane mode, the toggle displays the wrong message.<br />
* Turn on airplane mode, toggle displays wrong message<br />
<br />
== Credits ==<br />
Brought to you by pEEf.</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=File:RadioPowerSwitch.jpg&diff=1802File:RadioPowerSwitch.jpg2009-07-23T04:11:35Z<p>HattCzech: </p>
<hr />
<div></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Messaging_Mods&diff=1801Messaging Mods2009-07-23T04:10:58Z<p>HattCzech: /* Character Counter */ added image</p>
<hr />
<div>All files are located in '''/usr/palm/applications/com.palm.app.messaging/'''<br />
<br />
= Add Timestamps to All Messages =<br />
<br />
== Introduction ==<br />
<br />
A number of users have requested adding timestamps to each message that arrives on the device.<br />
Palm actually goes out of their way to group messages that have arrived during various time intervals,<br />
but if you'd prefer to see a timestamp on each message, simply follow the instructions below.<br />
<br />
== Procedure ==<br />
<br />
# [[Portal:Accessing_Linux|Gain root access to your device]]<br />
# Remount the file system as read/write<br />
# cd to '''/usr/palm/applications/com.palm.app.messaging/app/controllers/'''<br />
# Backup '''chatview-assistant.js''' (just to be safe)<br />
# Open '''chatview-assistant.js''' and comment out the following lines:<br />
#* 1169 - line that starts with: '''if(!ChatFlags.'''<br />
#* 1177 - line that starts with: '''if(today-msg.'''<br />
#* 1179 - first closing bracket on its own line: '''}'''<br />
#* 1180 - second closing bracket on its own line: '''}'''<br />
# Save the file and exit the editor<br />
# Remount the file system as read-only<br />
# Logout of your root session<br />
# Reboot the device<br />
<br />
You should now see a full timestamp on all received messages.<br />
<br />
== Acknowledgements ==<br />
<br />
Thanks to [[User:tk102|tk102]] and [[User:scuba_steve|scuba_steve]] on [http://www.precentral.net/ PreCentral] for the mod.<br />
<br />
----<br />
<br />
= New Card For Each Conversation =<br />
<br />
== Introduction ==<br />
<br />
The message app can be a pain when you have multiple conversations going on. You often have to swipe back and then pick someone else. <br />
It gets annoying fast. This modification modifies the messaging application so that a new card is created whenever you click into a conversation.<br />
<br />
== Procedure ==<br />
<br />
Edit '''/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js''' and replace the launchChatView function with the following function:<br />
<br />
<code><pre><br />
launchChatView: function(chatThreadId) {<br />
//Need to jump to that stage if it exists<br />
var stageController = Mojo.Controller.appController.getStageController("messaging"+chatThreadId);<br />
if (stageController) {<br />
stageController.activate();<br />
return;<br />
}<br />
<br />
var params = {name: 'messaging' + chatThreadId,<br />
lightweight: Mojo.Controller.appInfo.lwStages<br />
};<br />
<br />
var callback = function(controller) {<br />
controller.pushScene('chatview',chatThreadId,{<br />
focusWindow: true<br />
}); <br />
};<br />
<br />
Mojo.Controller.getAppController().createStageWithCallback(params, callback); //doesnt create ifit exists sooo<br />
},<br />
<br />
clearListBadgeForChatThreadId: function(chatThreadId) {<br />
var badgeContainers = ["buddyBageContainer","historyBageContainer"];<br />
var listItem;<br />
for (var i = 0; i < badgeContainers.length; i++) {<br />
listItem = this.controller.get(badgeContainers[i] + chatThreadId);<br />
if (listItem && !listItem.hasClassName('hide-unread-count')) {<br />
listItem.addClassName('hide-unread-count');<br />
}<br />
} <br />
},<br />
</pre></code><br />
<br />
Now in '''/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js''', comment out lines 246 and 247.<br />
This change will ensure that if you use the "back gesture" in a chat, the application doesn't bring you back to the conversation list...or do anything else.<br />
<br />
To "comment out" a line, add // at the beginning. Example:<br />
<code><pre><br />
printf("This is code");<br />
//printf("This is commented out");<br />
</pre></code><br />
<br />
== Concerns ==<br />
There is some delay in creating the new cards. I'm not sure why though.<br />
As stated above, the cards are only opened when you click into the conversation. Responding to a notification will result in the reuse of the buddy list window, and you have disabled the back gesture.<br />
<br />
== Acknolwedgements ==<br />
<br />
Thanks to [[User:mikedg|mikedg]] for the mod.<br />
<br />
[[User:chris_phelps|chris_phelps]] is continuing to work on this modification to get it working more completely.<br />
The first step is to clean up the other launchChatNNN functionality in app-assistant.js which accepts Luna System calls from the notification dashboard items which are created when a new message is received on the phone. These code modifications are being tested currently, and will be posted when we figure out how to clear the new message counters in the main listview-assistant.js.<br />
<br />
----<br />
<br />
= Character Counter =<br />
<br />
[[Image:Messaging_CharacterCounter.jpg|border|right|Character Counter]]<br />
<br />
== Introduction ==<br />
<br />
One of the features I liked about my old Treo was the character counter built-in to the messaging application. I thought it would be useful on the Pre, so I modified the messaging application to show the current character count. I made this a separate page from the other modifications because it requires many code changes. Maybe the other messaging modifications could be rolled into this page as well.<br />
<br />
== Procedure ==<br />
<br />
''This modification is the same for both files, just inserted on different lines.''<br><br />
'''app/controllers/chatview-assistant.js''' Line 157:<br><br />
'''app/controllers/compose-assistant.js''' Line 115:<br />
<source lang="JavaScript"><br />
},<br />
charCounter: {<br />
charCountContainer: this.controller.get('charCounterContainer'),<br />
charCountElement: this.controller.get('charCounter'),<br />
setTextFieldValueFn: this.setTextFieldValue.bind(this)<br />
</source><br />
<br />
<br />
'''app/utilities/CharacterCounter.js''' Line 40:<br />
<source lang="JavaScript"><br />
var charCounterUI = {<br />
containerElement: null,<br />
valueElement: null<br />
};<br />
</source><br />
<br />
:Line 188:<br />
<source lang="JavaScript"><br />
var setCurrentCharCount = function(newCharCount) {<br />
if(charCounterUI.valueElement) {<br />
if (newCharCount > 0)<br />
charCounterUI.valueElement.update(newCharCount);<br />
else<br />
charCounterUI.valueElement.update('');<br />
}<br />
if(charCounterUI.containerElement) {<br />
if (newCharCount == 0) {<br />
if (charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.hide();<br />
} else {<br />
if (!charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.show();<br />
}<br />
}<br />
};<br />
</source><br />
<br />
:Line 286:<br />
<source lang="JavaScript"><br />
if(params.charCounter) {<br />
charCounterUI.containerElement = params.charCounter.charCountContainer;<br />
charCounterUI.valueElement = params.charCounter.charCountElement;<br />
if(params.charCounter.setTextFieldValueFn) {<br />
setTextFieldValueFn = params.charCounter.setTextFieldValueFn;<br />
} <br />
}<br />
</source><br />
<br />
:Line 331:<br />
<source lang="JavaScript"><br />
setCurrentCharCount(rawCharacterData.count);<br />
</source><br />
<br />
<br />
''Again, same code for both files, inserted on different lines.''<br><br />
'''app/views/chatview/chatview-scene.html''' Line 25:<br><br />
'''app/views/compose/compose-scene.html''' Line 8:<br />
<source lang="HTML4Strict"><br />
<div id="charCounterContainer"><br />
<div id="charCounter"><br />
</div><br />
</div><br />
</source><br />
<br />
<br />
'''stylesheets/messaging.css''' Line 839:<br />
<source lang="CSS"><br />
#messageContainer #charCounterContainer {<br />
line-height: 20px;<br />
display:block;<br />
height: 20px;<br />
border-width: 0px 10px 0px 9px;<br />
-webkit-border-image: url(../images/message-segment-badge.png) 0 10 0 9 stretch stretch;<br />
position: absolute;<br />
z-index: 3;<br />
top: 2px;<br />
left: 2px;<br />
}<br />
#messageContainer #charCounterContainer #charCounter {<br />
font-size: 12px;<br />
font-weight: bold;<br />
color: #679BC2;<br />
margin: 0px -4px 3px -3px;<br />
}<br />
</source><br />
If you don't like the location of the character counter (I have it configured for the top left of the text area), you can modify the '''#messageContainer #charCounterContainer''' section above.<br />
<br />
<br />
These modifications will require LunaSysMgr to be restarted. A rescan will not work. After you've made the modifications listed above, run the following command:<br />
<source lang="bash"><br />
pkill LunaSysMgr<br />
</source><br />
<br />
== Acknowledgements ==<br />
<br />
* [[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Force Offline Send Without Dialog =<br />
<br />
<code><pre><br />
sudo mount -o remount,rw /<br />
sudo vi /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js<br />
/forceSendIfOffline =<br />
</pre></code><br />
<br />
Change the line to true (below) , writequit , remount, reload , enjoy <br />
<br />
<code><pre><br />
forceSendIfOffline = true; <br />
:wq <br />
sudo mount -o remount,ro /<br />
sudo stop LunaSysMgr ; sudo start LunaSysMgr<br />
</pre></code></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=File:Messaging_CharacterCounter.jpg&diff=1800File:Messaging CharacterCounter.jpg2009-07-23T03:54:51Z<p>HattCzech: </p>
<hr />
<div></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Messaging_Mods&diff=1681Messaging Mods2009-07-22T20:03:14Z<p>HattCzech: /* Acknowledgements */ fixed spelling</p>
<hr />
<div>All files are located in '''/usr/palm/applications/com.palm.app.messaging/'''<br />
<br />
= Add Timestamps to All Messages =<br />
<br />
== Introduction ==<br />
<br />
A number of users have requested adding timestamps to each message that arrives on the device.<br />
Palm actually goes out of their way to group messages that have arrived during various time intervals,<br />
but if you'd prefer to see a timestamp on each message, simply follow the instructions below.<br />
<br />
== Procedure ==<br />
<br />
# [[Portal:Accessing_Linux|Gain root access to your device]]<br />
# Remount the file system as read/write<br />
# cd to '''/usr/palm/applications/com.palm.app.messaging/app/controllers/'''<br />
# Backup '''chatview-assistant.js''' (just to be safe)<br />
# Open '''chatview-assistant.js''' and comment out the following lines:<br />
#* 1169 - line that starts with: '''if(!ChatFlags.'''<br />
#* 1177 - line that starts with: '''if(today-msg.'''<br />
#* 1179 - first closing bracket on its own line: '''}'''<br />
#* 1180 - second closing bracket on its own line: '''}'''<br />
# Save the file and exit the editor<br />
# Remount the file system as read-only<br />
# Logout of your root session<br />
# Reboot the device<br />
<br />
You should now see a full timestamp on all received messages.<br />
<br />
== Acknowledgements ==<br />
<br />
Thanks to [[User:tk102|tk102]] and [[User:scuba_steve|scuba_steve]] on [http://www.precentral.net/ PreCentral] for the mod.<br />
<br />
----<br />
<br />
= New Card For Each Conversation =<br />
<br />
== Introduction ==<br />
<br />
The message app can be a pain when you have multiple conversations going on. You often have to swipe back and then pick someone else. <br />
It gets annoying fast. This modification modifies the messaging application so that a new card is created whenever you click into a conversation.<br />
<br />
== Procedure ==<br />
<br />
Edit '''/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js''' and replace the launchChatView function with the following function:<br />
<br />
<code><pre><br />
launchChatView: function(chatThreadId) {<br />
//Need to jump to that stage if it exists<br />
var stageController = Mojo.Controller.appController.getStageController("messaging"+chatThreadId);<br />
if (stageController) {<br />
stageController.activate();<br />
return;<br />
}<br />
<br />
var params = {name: 'messaging' + chatThreadId,<br />
lightweight: Mojo.Controller.appInfo.lwStages<br />
};<br />
<br />
var callback = function(controller) {<br />
controller.pushScene('chatview',chatThreadId,{<br />
focusWindow: true<br />
}); <br />
};<br />
<br />
Mojo.Controller.getAppController().createStageWithCallback(params, callback); //doesnt create ifit exists sooo<br />
},<br />
<br />
clearListBadgeForChatThreadId: function(chatThreadId) {<br />
var badgeContainers = ["buddyBageContainer","historyBageContainer"];<br />
var listItem;<br />
for (var i = 0; i < badgeContainers.length; i++) {<br />
listItem = this.controller.get(badgeContainers[i] + chatThreadId);<br />
if (listItem && !listItem.hasClassName('hide-unread-count')) {<br />
listItem.addClassName('hide-unread-count');<br />
}<br />
} <br />
},<br />
</pre></code><br />
<br />
Now in '''/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js''', comment out lines 246 and 247.<br />
This change will ensure that if you use the "back gesture" in a chat, the application doesn't bring you back to the conversation list...or do anything else.<br />
<br />
To "comment out" a line, add // at the beginning. Example:<br />
<code><pre><br />
printf("This is code");<br />
//printf("This is commented out");<br />
</pre></code><br />
<br />
== Concerns ==<br />
There is some delay in creating the new cards. I'm not sure why though.<br />
As stated above, the cards are only opened when you click into the conversation. Responding to a notification will result in the reuse of the buddy list window, and you have disabled the back gesture.<br />
<br />
== Acknolwedgements ==<br />
<br />
Thanks to [[User:mikedg|mikedg]] for the mod.<br />
<br />
[[User:chris_phelps|chris_phelps]] is continuing to work on this modification to get it working more completely.<br />
The first step is to clean up the other launchChatNNN functionality in app-assistant.js which accepts Luna System calls from the notification dashboard items which are created when a new message is received on the phone. These code modifications are being tested currently, and will be posted when we figure out how to clear the new message counters in the main listview-assistant.js.<br />
<br />
----<br />
<br />
= Character Counter =<br />
<br />
== Introduction ==<br />
<br />
One of the features I liked about my old Treo was the character counter built-in to the messaging application. I thought it would be useful on the Pre, so I modified the messaging application to show the current character count. I made this a separate page from the other modifications because it requires many code changes. Maybe the other messaging modifications could be rolled into this page as well.<br />
<br />
== Procedure ==<br />
<br />
''This modification is the same for both files, just inserted on different lines.''<br><br />
'''app/controllers/chatview-assistant.js''' Line 157:<br><br />
'''app/controllers/compose-assistant.js''' Line 115:<br />
<source lang="JavaScript"><br />
},<br />
charCounter: {<br />
charCountContainer: this.controller.get('charCounterContainer'),<br />
charCountElement: this.controller.get('charCounter'),<br />
setTextFieldValueFn: this.setTextFieldValue.bind(this)<br />
</source><br />
<br />
<br />
'''app/utilities/CharacterCounter.js''' Line 40:<br />
<source lang="JavaScript"><br />
var charCounterUI = {<br />
containerElement: null,<br />
valueElement: null<br />
};<br />
</source><br />
<br />
:Line 188:<br />
<source lang="JavaScript"><br />
var setCurrentCharCount = function(newCharCount) {<br />
if(charCounterUI.valueElement) {<br />
if (newCharCount > 0)<br />
charCounterUI.valueElement.update(newCharCount);<br />
else<br />
charCounterUI.valueElement.update('');<br />
}<br />
if(charCounterUI.containerElement) {<br />
if (newCharCount == 0) {<br />
if (charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.hide();<br />
} else {<br />
if (!charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.show();<br />
}<br />
}<br />
};<br />
</source><br />
<br />
:Line 286:<br />
<source lang="JavaScript"><br />
if(params.charCounter) {<br />
charCounterUI.containerElement = params.charCounter.charCountContainer;<br />
charCounterUI.valueElement = params.charCounter.charCountElement;<br />
if(params.charCounter.setTextFieldValueFn) {<br />
setTextFieldValueFn = params.charCounter.setTextFieldValueFn;<br />
} <br />
}<br />
</source><br />
<br />
:Line 331:<br />
<source lang="JavaScript"><br />
setCurrentCharCount(rawCharacterData.count);<br />
</source><br />
<br />
<br />
''Again, same code for both files, inserted on different lines.''<br><br />
'''app/views/chatview/chatview-scene.html''' Line 25:<br><br />
'''app/views/compose/compose-scene.html''' Line 8:<br />
<source lang="HTML4Strict"><br />
<div id="charCounterContainer"><br />
<div id="charCounter"><br />
</div><br />
</div><br />
</source><br />
<br />
<br />
'''stylesheets/messaging.css''' Line 839:<br />
<source lang="CSS"><br />
#messageContainer #charCounterContainer {<br />
line-height: 20px;<br />
display:block;<br />
height: 20px;<br />
border-width: 0px 10px 0px 9px;<br />
-webkit-border-image: url(../images/message-segment-badge.png) 0 10 0 9 stretch stretch;<br />
position: absolute;<br />
z-index: 3;<br />
top: 2px;<br />
left: 2px;<br />
}<br />
#messageContainer #charCounterContainer #charCounter {<br />
font-size: 12px;<br />
font-weight: bold;<br />
color: #679BC2;<br />
margin: 0px -4px 3px -3px;<br />
}<br />
</source><br />
If you don't like the location of the character counter (I have it configured for the top left of the text area), you can modify the '''#messageContainer #charCounterContainer''' section above.<br />
<br />
<br />
These modifications will require LunaSysMgr to be restarted. A rescan will not work. After you've made the modifications listed above, run the following command:<br />
<source lang="bash"><br />
pkill LunaSysMgr<br />
</source><br />
<br />
== Acknowledgements ==<br />
<br />
* [[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Force Offline Send Without Dialog =<br />
<br />
<code><pre><br />
sudo mount -o remount,rw /<br />
sudo vi /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js<br />
/forceSendIfOffline =<br />
</pre></code><br />
<br />
Change the line to true (below) , writequit , remount, reload , enjoy <br />
<br />
<code><pre><br />
forceSendIfOffline = true; <br />
:wq <br />
sudo mount -o remount,ro /<br />
sudo stop LunaSysMgr ; sudo start LunaSysMgr<br />
</pre></code></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Messaging_Mods&diff=1680Messaging Mods2009-07-22T20:01:56Z<p>HattCzech: /* Character Counter */ updated sub-sections to be like the others for messaging</p>
<hr />
<div>All files are located in '''/usr/palm/applications/com.palm.app.messaging/'''<br />
<br />
= Add Timestamps to All Messages =<br />
<br />
== Introduction ==<br />
<br />
A number of users have requested adding timestamps to each message that arrives on the device.<br />
Palm actually goes out of their way to group messages that have arrived during various time intervals,<br />
but if you'd prefer to see a timestamp on each message, simply follow the instructions below.<br />
<br />
== Procedure ==<br />
<br />
# [[Portal:Accessing_Linux|Gain root access to your device]]<br />
# Remount the file system as read/write<br />
# cd to '''/usr/palm/applications/com.palm.app.messaging/app/controllers/'''<br />
# Backup '''chatview-assistant.js''' (just to be safe)<br />
# Open '''chatview-assistant.js''' and comment out the following lines:<br />
#* 1169 - line that starts with: '''if(!ChatFlags.'''<br />
#* 1177 - line that starts with: '''if(today-msg.'''<br />
#* 1179 - first closing bracket on its own line: '''}'''<br />
#* 1180 - second closing bracket on its own line: '''}'''<br />
# Save the file and exit the editor<br />
# Remount the file system as read-only<br />
# Logout of your root session<br />
# Reboot the device<br />
<br />
You should now see a full timestamp on all received messages.<br />
<br />
== Acknowledgements ==<br />
<br />
Thanks to [[User:tk102|tk102]] and [[User:scuba_steve|scuba_steve]] on [http://www.precentral.net/ PreCentral] for the mod.<br />
<br />
----<br />
<br />
= New Card For Each Conversation =<br />
<br />
== Introduction ==<br />
<br />
The message app can be a pain when you have multiple conversations going on. You often have to swipe back and then pick someone else. <br />
It gets annoying fast. This modification modifies the messaging application so that a new card is created whenever you click into a conversation.<br />
<br />
== Procedure ==<br />
<br />
Edit '''/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js''' and replace the launchChatView function with the following function:<br />
<br />
<code><pre><br />
launchChatView: function(chatThreadId) {<br />
//Need to jump to that stage if it exists<br />
var stageController = Mojo.Controller.appController.getStageController("messaging"+chatThreadId);<br />
if (stageController) {<br />
stageController.activate();<br />
return;<br />
}<br />
<br />
var params = {name: 'messaging' + chatThreadId,<br />
lightweight: Mojo.Controller.appInfo.lwStages<br />
};<br />
<br />
var callback = function(controller) {<br />
controller.pushScene('chatview',chatThreadId,{<br />
focusWindow: true<br />
}); <br />
};<br />
<br />
Mojo.Controller.getAppController().createStageWithCallback(params, callback); //doesnt create ifit exists sooo<br />
},<br />
<br />
clearListBadgeForChatThreadId: function(chatThreadId) {<br />
var badgeContainers = ["buddyBageContainer","historyBageContainer"];<br />
var listItem;<br />
for (var i = 0; i < badgeContainers.length; i++) {<br />
listItem = this.controller.get(badgeContainers[i] + chatThreadId);<br />
if (listItem && !listItem.hasClassName('hide-unread-count')) {<br />
listItem.addClassName('hide-unread-count');<br />
}<br />
} <br />
},<br />
</pre></code><br />
<br />
Now in '''/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js''', comment out lines 246 and 247.<br />
This change will ensure that if you use the "back gesture" in a chat, the application doesn't bring you back to the conversation list...or do anything else.<br />
<br />
To "comment out" a line, add // at the beginning. Example:<br />
<code><pre><br />
printf("This is code");<br />
//printf("This is commented out");<br />
</pre></code><br />
<br />
== Concerns ==<br />
There is some delay in creating the new cards. I'm not sure why though.<br />
As stated above, the cards are only opened when you click into the conversation. Responding to a notification will result in the reuse of the buddy list window, and you have disabled the back gesture.<br />
<br />
== Acknolwedgements ==<br />
<br />
Thanks to [[User:mikedg|mikedg]] for the mod.<br />
<br />
[[User:chris_phelps|chris_phelps]] is continuing to work on this modification to get it working more completely.<br />
The first step is to clean up the other launchChatNNN functionality in app-assistant.js which accepts Luna System calls from the notification dashboard items which are created when a new message is received on the phone. These code modifications are being tested currently, and will be posted when we figure out how to clear the new message counters in the main listview-assistant.js.<br />
<br />
----<br />
<br />
= Character Counter =<br />
<br />
== Introduction ==<br />
<br />
One of the features I liked about my old Treo was the character counter built-in to the messaging application. I thought it would be useful on the Pre, so I modified the messaging application to show the current character count. I made this a separate page from the other modifications because it requires many code changes. Maybe the other messaging modifications could be rolled into this page as well.<br />
<br />
== Procedure ==<br />
<br />
''This modification is the same for both files, just inserted on different lines.''<br><br />
'''app/controllers/chatview-assistant.js''' Line 157:<br><br />
'''app/controllers/compose-assistant.js''' Line 115:<br />
<source lang="JavaScript"><br />
},<br />
charCounter: {<br />
charCountContainer: this.controller.get('charCounterContainer'),<br />
charCountElement: this.controller.get('charCounter'),<br />
setTextFieldValueFn: this.setTextFieldValue.bind(this)<br />
</source><br />
<br />
<br />
'''app/utilities/CharacterCounter.js''' Line 40:<br />
<source lang="JavaScript"><br />
var charCounterUI = {<br />
containerElement: null,<br />
valueElement: null<br />
};<br />
</source><br />
<br />
:Line 188:<br />
<source lang="JavaScript"><br />
var setCurrentCharCount = function(newCharCount) {<br />
if(charCounterUI.valueElement) {<br />
if (newCharCount > 0)<br />
charCounterUI.valueElement.update(newCharCount);<br />
else<br />
charCounterUI.valueElement.update('');<br />
}<br />
if(charCounterUI.containerElement) {<br />
if (newCharCount == 0) {<br />
if (charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.hide();<br />
} else {<br />
if (!charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.show();<br />
}<br />
}<br />
};<br />
</source><br />
<br />
:Line 286:<br />
<source lang="JavaScript"><br />
if(params.charCounter) {<br />
charCounterUI.containerElement = params.charCounter.charCountContainer;<br />
charCounterUI.valueElement = params.charCounter.charCountElement;<br />
if(params.charCounter.setTextFieldValueFn) {<br />
setTextFieldValueFn = params.charCounter.setTextFieldValueFn;<br />
} <br />
}<br />
</source><br />
<br />
:Line 331:<br />
<source lang="JavaScript"><br />
setCurrentCharCount(rawCharacterData.count);<br />
</source><br />
<br />
<br />
''Again, same code for both files, inserted on different lines.''<br><br />
'''app/views/chatview/chatview-scene.html''' Line 25:<br><br />
'''app/views/compose/compose-scene.html''' Line 8:<br />
<source lang="HTML4Strict"><br />
<div id="charCounterContainer"><br />
<div id="charCounter"><br />
</div><br />
</div><br />
</source><br />
<br />
<br />
'''stylesheets/messaging.css''' Line 839:<br />
<source lang="CSS"><br />
#messageContainer #charCounterContainer {<br />
line-height: 20px;<br />
display:block;<br />
height: 20px;<br />
border-width: 0px 10px 0px 9px;<br />
-webkit-border-image: url(../images/message-segment-badge.png) 0 10 0 9 stretch stretch;<br />
position: absolute;<br />
z-index: 3;<br />
top: 2px;<br />
left: 2px;<br />
}<br />
#messageContainer #charCounterContainer #charCounter {<br />
font-size: 12px;<br />
font-weight: bold;<br />
color: #679BC2;<br />
margin: 0px -4px 3px -3px;<br />
}<br />
</source><br />
If you don't like the location of the character counter (I have it configured for the top left of the text area), you can modify the '''#messageContainer #charCounterContainer''' section above.<br />
<br />
<br />
These modifications will require LunaSysMgr to be restarted. A rescan will not work. After you've made the modifications listed above, run the following command:<br />
<source lang="bash"><br />
pkill LunaSysMgr<br />
</source><br />
<br />
== Acknowledgments ==<br />
<br />
* [[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Force Offline Send Without Dialog =<br />
<br />
<code><pre><br />
sudo mount -o remount,rw /<br />
sudo vi /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js<br />
/forceSendIfOffline =<br />
</pre></code><br />
<br />
Change the line to true (below) , writequit , remount, reload , enjoy <br />
<br />
<code><pre><br />
forceSendIfOffline = true; <br />
:wq <br />
sudo mount -o remount,ro /<br />
sudo stop LunaSysMgr ; sudo start LunaSysMgr<br />
</pre></code></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Messaging_Mods&diff=1679Messaging Mods2009-07-22T19:54:20Z<p>HattCzech: /* Add Timestamps to All Messages */ made name even shorter</p>
<hr />
<div>All files are located in '''/usr/palm/applications/com.palm.app.messaging/'''<br />
<br />
= Add Timestamps to All Messages =<br />
<br />
== Introduction ==<br />
<br />
A number of users have requested adding timestamps to each message that arrives on the device.<br />
Palm actually goes out of their way to group messages that have arrived during various time intervals,<br />
but if you'd prefer to see a timestamp on each message, simply follow the instructions below.<br />
<br />
== Procedure ==<br />
<br />
# [[Portal:Accessing_Linux|Gain root access to your device]]<br />
# Remount the file system as read/write<br />
# cd to '''/usr/palm/applications/com.palm.app.messaging/app/controllers/'''<br />
# Backup '''chatview-assistant.js''' (just to be safe)<br />
# Open '''chatview-assistant.js''' and comment out the following lines:<br />
#* 1169 - line that starts with: '''if(!ChatFlags.'''<br />
#* 1177 - line that starts with: '''if(today-msg.'''<br />
#* 1179 - first closing bracket on its own line: '''}'''<br />
#* 1180 - second closing bracket on its own line: '''}'''<br />
# Save the file and exit the editor<br />
# Remount the file system as read-only<br />
# Logout of your root session<br />
# Reboot the device<br />
<br />
You should now see a full timestamp on all received messages.<br />
<br />
== Acknowledgements ==<br />
<br />
Thanks to [[User:tk102|tk102]] and [[User:scuba_steve|scuba_steve]] on [http://www.precentral.net/ PreCentral] for the mod.<br />
<br />
----<br />
<br />
= New Card For Each Conversation =<br />
<br />
== Introduction ==<br />
<br />
The message app can be a pain when you have multiple conversations going on. You often have to swipe back and then pick someone else. <br />
It gets annoying fast. This modification modifies the messaging application so that a new card is created whenever you click into a conversation.<br />
<br />
== Procedure ==<br />
<br />
Edit '''/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js''' and replace the launchChatView function with the following function:<br />
<br />
<code><pre><br />
launchChatView: function(chatThreadId) {<br />
//Need to jump to that stage if it exists<br />
var stageController = Mojo.Controller.appController.getStageController("messaging"+chatThreadId);<br />
if (stageController) {<br />
stageController.activate();<br />
return;<br />
}<br />
<br />
var params = {name: 'messaging' + chatThreadId,<br />
lightweight: Mojo.Controller.appInfo.lwStages<br />
};<br />
<br />
var callback = function(controller) {<br />
controller.pushScene('chatview',chatThreadId,{<br />
focusWindow: true<br />
}); <br />
};<br />
<br />
Mojo.Controller.getAppController().createStageWithCallback(params, callback); //doesnt create ifit exists sooo<br />
},<br />
<br />
clearListBadgeForChatThreadId: function(chatThreadId) {<br />
var badgeContainers = ["buddyBageContainer","historyBageContainer"];<br />
var listItem;<br />
for (var i = 0; i < badgeContainers.length; i++) {<br />
listItem = this.controller.get(badgeContainers[i] + chatThreadId);<br />
if (listItem && !listItem.hasClassName('hide-unread-count')) {<br />
listItem.addClassName('hide-unread-count');<br />
}<br />
} <br />
},<br />
</pre></code><br />
<br />
Now in '''/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js''', comment out lines 246 and 247.<br />
This change will ensure that if you use the "back gesture" in a chat, the application doesn't bring you back to the conversation list...or do anything else.<br />
<br />
To "comment out" a line, add // at the beginning. Example:<br />
<code><pre><br />
printf("This is code");<br />
//printf("This is commented out");<br />
</pre></code><br />
<br />
== Concerns ==<br />
There is some delay in creating the new cards. I'm not sure why though.<br />
As stated above, the cards are only opened when you click into the conversation. Responding to a notification will result in the reuse of the buddy list window, and you have disabled the back gesture.<br />
<br />
== Acknolwedgements ==<br />
<br />
Thanks to [[User:mikedg|mikedg]] for the mod.<br />
<br />
[[User:chris_phelps|chris_phelps]] is continuing to work on this modification to get it working more completely.<br />
The first step is to clean up the other launchChatNNN functionality in app-assistant.js which accepts Luna System calls from the notification dashboard items which are created when a new message is received on the phone. These code modifications are being tested currently, and will be posted when we figure out how to clear the new message counters in the main listview-assistant.js.<br />
<br />
----<br />
<br />
= Character Counter =<br />
<br />
One of the features I liked about my old Treo was the character counter built-in to the messaging application. I thought it would be useful on the Pre, so I modified the messaging application to show the current character count. I made this a separate page from the other modifications because it requires many code changes. Maybe the other messaging modifications could be rolled into this page as well.<br />
<br />
== Configuration ==<br />
<br />
''This modification is the same for both files, just inserted on different lines.''<br><br />
'''app/controllers/chatview-assistant.js''' Line 157:<br><br />
'''app/controllers/compose-assistant.js''' Line 115:<br />
<source lang="JavaScript"><br />
},<br />
charCounter: {<br />
charCountContainer: this.controller.get('charCounterContainer'),<br />
charCountElement: this.controller.get('charCounter'),<br />
setTextFieldValueFn: this.setTextFieldValue.bind(this)<br />
</source><br />
<br />
<br />
'''app/utilities/CharacterCounter.js''' Line 40:<br />
<source lang="JavaScript"><br />
var charCounterUI = {<br />
containerElement: null,<br />
valueElement: null<br />
};<br />
</source><br />
<br />
:Line 188:<br />
<source lang="JavaScript"><br />
var setCurrentCharCount = function(newCharCount) {<br />
if(charCounterUI.valueElement) {<br />
if (newCharCount > 0)<br />
charCounterUI.valueElement.update(newCharCount);<br />
else<br />
charCounterUI.valueElement.update('');<br />
}<br />
if(charCounterUI.containerElement) {<br />
if (newCharCount == 0) {<br />
if (charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.hide();<br />
} else {<br />
if (!charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.show();<br />
}<br />
}<br />
};<br />
</source><br />
<br />
:Line 286:<br />
<source lang="JavaScript"><br />
if(params.charCounter) {<br />
charCounterUI.containerElement = params.charCounter.charCountContainer;<br />
charCounterUI.valueElement = params.charCounter.charCountElement;<br />
if(params.charCounter.setTextFieldValueFn) {<br />
setTextFieldValueFn = params.charCounter.setTextFieldValueFn;<br />
} <br />
}<br />
</source><br />
<br />
:Line 331:<br />
<source lang="JavaScript"><br />
setCurrentCharCount(rawCharacterData.count);<br />
</source><br />
<br />
<br />
''Again, same code for both files, inserted on different lines.''<br><br />
'''app/views/chatview/chatview-scene.html''' Line 25:<br><br />
'''app/views/compose/compose-scene.html''' Line 8:<br />
<source lang="HTML4Strict"><br />
<div id="charCounterContainer"><br />
<div id="charCounter"><br />
</div><br />
</div><br />
</source><br />
<br />
<br />
'''stylesheets/messaging.css''' Line 839:<br />
<source lang="CSS"><br />
#messageContainer #charCounterContainer {<br />
line-height: 20px;<br />
display:block;<br />
height: 20px;<br />
border-width: 0px 10px 0px 9px;<br />
-webkit-border-image: url(../images/message-segment-badge.png) 0 10 0 9 stretch stretch;<br />
position: absolute;<br />
z-index: 3;<br />
top: 2px;<br />
left: 2px;<br />
}<br />
#messageContainer #charCounterContainer #charCounter {<br />
font-size: 12px;<br />
font-weight: bold;<br />
color: #679BC2;<br />
margin: 0px -4px 3px -3px;<br />
}<br />
</source><br />
If you don't like the location of the character counter (I have it configured for the top left of the text area), you can modify the #charCounterContainer section in the messaging.css above.<br />
<br />
== Use ==<br />
<br />
This will require LunaSysMgr to be restarted. A rescan will not work. After you've made the modifications listed above, run the following command:<br />
<script lang="bash"><br />
pkill LunaSysMgr<br />
</script><br />
<br />
== Credits ==<br />
<br />
* [[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Force Offline Send Without Dialog =<br />
<br />
<code><pre><br />
sudo mount -o remount,rw /<br />
sudo vi /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js<br />
/forceSendIfOffline =<br />
</pre></code><br />
<br />
Change the line to true (below) , writequit , remount, reload , enjoy <br />
<br />
<code><pre><br />
forceSendIfOffline = true; <br />
:wq <br />
sudo mount -o remount,ro /<br />
sudo stop LunaSysMgr ; sudo start LunaSysMgr<br />
</pre></code></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Messaging_Mods&diff=1678Messaging Mods2009-07-22T19:49:47Z<p>HattCzech: /* Character Counter - Use */ updated to use script instead of code and pre</p>
<hr />
<div>All files are located in '''/usr/palm/applications/com.palm.app.messaging/'''<br />
<br />
= Add Timestamps to All Received Messages =<br />
<br />
== Introduction ==<br />
<br />
A number of users have requested adding timestamps to each message that arrives on the device.<br />
Palm actually goes out of their way to group messages that have arrived during various time intervals,<br />
but if you'd prefer to see a timestamp on each message, simply follow the instructions below.<br />
<br />
== Procedure ==<br />
<br />
# [[Portal:Accessing_Linux|Gain root access to your device]]<br />
# Remount the file system as read/write<br />
# cd to '''/usr/palm/applications/com.palm.app.messaging/app/controllers/'''<br />
# Backup '''chatview-assistant.js''' (just to be safe)<br />
# Open '''chatview-assistant.js''' and comment out the following lines:<br />
#* 1169 - line that starts with: '''if(!ChatFlags.'''<br />
#* 1177 - line that starts with: '''if(today-msg.'''<br />
#* 1179 - first closing bracket on its own line: '''}'''<br />
#* 1180 - second closing bracket on its own line: '''}'''<br />
# Save the file and exit the editor<br />
# Remount the file system as read-only<br />
# Logout of your root session<br />
# Reboot the device<br />
<br />
You should now see a full timestamp on all received messages.<br />
<br />
== Acknowledgements ==<br />
<br />
Thanks to [[User:tk102|tk102]] and [[User:scuba_steve|scuba_steve]] on [http://www.precentral.net/ PreCentral] for the mod.<br />
<br />
----<br />
<br />
= New Card For Each Conversation =<br />
<br />
== Introduction ==<br />
<br />
The message app can be a pain when you have multiple conversations going on. You often have to swipe back and then pick someone else. <br />
It gets annoying fast. This modification modifies the messaging application so that a new card is created whenever you click into a conversation.<br />
<br />
== Procedure ==<br />
<br />
Edit '''/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js''' and replace the launchChatView function with the following function:<br />
<br />
<code><pre><br />
launchChatView: function(chatThreadId) {<br />
//Need to jump to that stage if it exists<br />
var stageController = Mojo.Controller.appController.getStageController("messaging"+chatThreadId);<br />
if (stageController) {<br />
stageController.activate();<br />
return;<br />
}<br />
<br />
var params = {name: 'messaging' + chatThreadId,<br />
lightweight: Mojo.Controller.appInfo.lwStages<br />
};<br />
<br />
var callback = function(controller) {<br />
controller.pushScene('chatview',chatThreadId,{<br />
focusWindow: true<br />
}); <br />
};<br />
<br />
Mojo.Controller.getAppController().createStageWithCallback(params, callback); //doesnt create ifit exists sooo<br />
},<br />
<br />
clearListBadgeForChatThreadId: function(chatThreadId) {<br />
var badgeContainers = ["buddyBageContainer","historyBageContainer"];<br />
var listItem;<br />
for (var i = 0; i < badgeContainers.length; i++) {<br />
listItem = this.controller.get(badgeContainers[i] + chatThreadId);<br />
if (listItem && !listItem.hasClassName('hide-unread-count')) {<br />
listItem.addClassName('hide-unread-count');<br />
}<br />
} <br />
},<br />
</pre></code><br />
<br />
Now in '''/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js''', comment out lines 246 and 247.<br />
This change will ensure that if you use the "back gesture" in a chat, the application doesn't bring you back to the conversation list...or do anything else.<br />
<br />
To "comment out" a line, add // at the beginning. Example:<br />
<code><pre><br />
printf("This is code");<br />
//printf("This is commented out");<br />
</pre></code><br />
<br />
== Concerns ==<br />
There is some delay in creating the new cards. I'm not sure why though.<br />
As stated above, the cards are only opened when you click into the conversation. Responding to a notification will result in the reuse of the buddy list window, and you have disabled the back gesture.<br />
<br />
== Acknolwedgements ==<br />
<br />
Thanks to [[User:mikedg|mikedg]] for the mod.<br />
<br />
[[User:chris_phelps|chris_phelps]] is continuing to work on this modification to get it working more completely.<br />
The first step is to clean up the other launchChatNNN functionality in app-assistant.js which accepts Luna System calls from the notification dashboard items which are created when a new message is received on the phone. These code modifications are being tested currently, and will be posted when we figure out how to clear the new message counters in the main listview-assistant.js.<br />
<br />
----<br />
<br />
= Character Counter =<br />
<br />
One of the features I liked about my old Treo was the character counter built-in to the messaging application. I thought it would be useful on the Pre, so I modified the messaging application to show the current character count. I made this a separate page from the other modifications because it requires many code changes. Maybe the other messaging modifications could be rolled into this page as well.<br />
<br />
== Configuration ==<br />
<br />
''This modification is the same for both files, just inserted on different lines.''<br><br />
'''app/controllers/chatview-assistant.js''' Line 157:<br><br />
'''app/controllers/compose-assistant.js''' Line 115:<br />
<source lang="JavaScript"><br />
},<br />
charCounter: {<br />
charCountContainer: this.controller.get('charCounterContainer'),<br />
charCountElement: this.controller.get('charCounter'),<br />
setTextFieldValueFn: this.setTextFieldValue.bind(this)<br />
</source><br />
<br />
<br />
'''app/utilities/CharacterCounter.js''' Line 40:<br />
<source lang="JavaScript"><br />
var charCounterUI = {<br />
containerElement: null,<br />
valueElement: null<br />
};<br />
</source><br />
<br />
:Line 188:<br />
<source lang="JavaScript"><br />
var setCurrentCharCount = function(newCharCount) {<br />
if(charCounterUI.valueElement) {<br />
if (newCharCount > 0)<br />
charCounterUI.valueElement.update(newCharCount);<br />
else<br />
charCounterUI.valueElement.update('');<br />
}<br />
if(charCounterUI.containerElement) {<br />
if (newCharCount == 0) {<br />
if (charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.hide();<br />
} else {<br />
if (!charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.show();<br />
}<br />
}<br />
};<br />
</source><br />
<br />
:Line 286:<br />
<source lang="JavaScript"><br />
if(params.charCounter) {<br />
charCounterUI.containerElement = params.charCounter.charCountContainer;<br />
charCounterUI.valueElement = params.charCounter.charCountElement;<br />
if(params.charCounter.setTextFieldValueFn) {<br />
setTextFieldValueFn = params.charCounter.setTextFieldValueFn;<br />
} <br />
}<br />
</source><br />
<br />
:Line 331:<br />
<source lang="JavaScript"><br />
setCurrentCharCount(rawCharacterData.count);<br />
</source><br />
<br />
<br />
''Again, same code for both files, inserted on different lines.''<br><br />
'''app/views/chatview/chatview-scene.html''' Line 25:<br><br />
'''app/views/compose/compose-scene.html''' Line 8:<br />
<source lang="HTML4Strict"><br />
<div id="charCounterContainer"><br />
<div id="charCounter"><br />
</div><br />
</div><br />
</source><br />
<br />
<br />
'''stylesheets/messaging.css''' Line 839:<br />
<source lang="CSS"><br />
#messageContainer #charCounterContainer {<br />
line-height: 20px;<br />
display:block;<br />
height: 20px;<br />
border-width: 0px 10px 0px 9px;<br />
-webkit-border-image: url(../images/message-segment-badge.png) 0 10 0 9 stretch stretch;<br />
position: absolute;<br />
z-index: 3;<br />
top: 2px;<br />
left: 2px;<br />
}<br />
#messageContainer #charCounterContainer #charCounter {<br />
font-size: 12px;<br />
font-weight: bold;<br />
color: #679BC2;<br />
margin: 0px -4px 3px -3px;<br />
}<br />
</source><br />
If you don't like the location of the character counter (I have it configured for the top left of the text area), you can modify the #charCounterContainer section in the messaging.css above.<br />
<br />
== Use ==<br />
<br />
This will require LunaSysMgr to be restarted. A rescan will not work. After you've made the modifications listed above, run the following command:<br />
<script lang="bash"><br />
pkill LunaSysMgr<br />
</script><br />
<br />
== Credits ==<br />
<br />
* [[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Force Offline Send Without Dialog =<br />
<br />
<code><pre><br />
sudo mount -o remount,rw /<br />
sudo vi /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js<br />
/forceSendIfOffline =<br />
</pre></code><br />
<br />
Change the line to true (below) , writequit , remount, reload , enjoy <br />
<br />
<code><pre><br />
forceSendIfOffline = true; <br />
:wq <br />
sudo mount -o remount,ro /<br />
sudo stop LunaSysMgr ; sudo start LunaSysMgr<br />
</pre></code></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Messaging_Mods&diff=1676Messaging Mods2009-07-22T19:42:29Z<p>HattCzech: /* Force Offline Send Without Dialog */ made name shorter</p>
<hr />
<div>All files are located in '''/usr/palm/applications/com.palm.app.messaging/'''<br />
<br />
= Add Timestamps to All Received Messages =<br />
<br />
== Introduction ==<br />
<br />
A number of users have requested adding timestamps to each message that arrives on the device.<br />
Palm actually goes out of their way to group messages that have arrived during various time intervals,<br />
but if you'd prefer to see a timestamp on each message, simply follow the instructions below.<br />
<br />
== Procedure ==<br />
<br />
# [[Portal:Accessing_Linux|Gain root access to your device]]<br />
# Remount the file system as read/write<br />
# cd to '''/usr/palm/applications/com.palm.app.messaging/app/controllers/'''<br />
# Backup '''chatview-assistant.js''' (just to be safe)<br />
# Open '''chatview-assistant.js''' and comment out the following lines:<br />
#* 1169 - line that starts with: '''if(!ChatFlags.'''<br />
#* 1177 - line that starts with: '''if(today-msg.'''<br />
#* 1179 - first closing bracket on its own line: '''}'''<br />
#* 1180 - second closing bracket on its own line: '''}'''<br />
# Save the file and exit the editor<br />
# Remount the file system as read-only<br />
# Logout of your root session<br />
# Reboot the device<br />
<br />
You should now see a full timestamp on all received messages.<br />
<br />
== Acknowledgements ==<br />
<br />
Thanks to [[User:tk102|tk102]] and [[User:scuba_steve|scuba_steve]] on [http://www.precentral.net/ PreCentral] for the mod.<br />
<br />
----<br />
<br />
= New Card For Each Conversation =<br />
<br />
== Introduction ==<br />
<br />
The message app can be a pain when you have multiple conversations going on. You often have to swipe back and then pick someone else. <br />
It gets annoying fast. This modification modifies the messaging application so that a new card is created whenever you click into a conversation.<br />
<br />
== Procedure ==<br />
<br />
Edit '''/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js''' and replace the launchChatView function with the following function:<br />
<br />
<code><pre><br />
launchChatView: function(chatThreadId) {<br />
//Need to jump to that stage if it exists<br />
var stageController = Mojo.Controller.appController.getStageController("messaging"+chatThreadId);<br />
if (stageController) {<br />
stageController.activate();<br />
return;<br />
}<br />
<br />
var params = {name: 'messaging' + chatThreadId,<br />
lightweight: Mojo.Controller.appInfo.lwStages<br />
};<br />
<br />
var callback = function(controller) {<br />
controller.pushScene('chatview',chatThreadId,{<br />
focusWindow: true<br />
}); <br />
};<br />
<br />
Mojo.Controller.getAppController().createStageWithCallback(params, callback); //doesnt create ifit exists sooo<br />
},<br />
<br />
clearListBadgeForChatThreadId: function(chatThreadId) {<br />
var badgeContainers = ["buddyBageContainer","historyBageContainer"];<br />
var listItem;<br />
for (var i = 0; i < badgeContainers.length; i++) {<br />
listItem = this.controller.get(badgeContainers[i] + chatThreadId);<br />
if (listItem && !listItem.hasClassName('hide-unread-count')) {<br />
listItem.addClassName('hide-unread-count');<br />
}<br />
} <br />
},<br />
</pre></code><br />
<br />
Now in '''/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js''', comment out lines 246 and 247.<br />
This change will ensure that if you use the "back gesture" in a chat, the application doesn't bring you back to the conversation list...or do anything else.<br />
<br />
To "comment out" a line, add // at the beginning. Example:<br />
<code><pre><br />
printf("This is code");<br />
//printf("This is commented out");<br />
</pre></code><br />
<br />
== Concerns ==<br />
There is some delay in creating the new cards. I'm not sure why though.<br />
As stated above, the cards are only opened when you click into the conversation. Responding to a notification will result in the reuse of the buddy list window, and you have disabled the back gesture.<br />
<br />
== Acknolwedgements ==<br />
<br />
Thanks to [[User:mikedg|mikedg]] for the mod.<br />
<br />
[[User:chris_phelps|chris_phelps]] is continuing to work on this modification to get it working more completely.<br />
The first step is to clean up the other launchChatNNN functionality in app-assistant.js which accepts Luna System calls from the notification dashboard items which are created when a new message is received on the phone. These code modifications are being tested currently, and will be posted when we figure out how to clear the new message counters in the main listview-assistant.js.<br />
<br />
----<br />
<br />
= Character Counter =<br />
<br />
One of the features I liked about my old Treo was the character counter built-in to the messaging application. I thought it would be useful on the Pre, so I modified the messaging application to show the current character count. I made this a separate page from the other modifications because it requires many code changes. Maybe the other messaging modifications could be rolled into this page as well.<br />
<br />
== Configuration ==<br />
<br />
''This modification is the same for both files, just inserted on different lines.''<br><br />
'''app/controllers/chatview-assistant.js''' Line 157:<br><br />
'''app/controllers/compose-assistant.js''' Line 115:<br />
<source lang="JavaScript"><br />
},<br />
charCounter: {<br />
charCountContainer: this.controller.get('charCounterContainer'),<br />
charCountElement: this.controller.get('charCounter'),<br />
setTextFieldValueFn: this.setTextFieldValue.bind(this)<br />
</source><br />
<br />
<br />
'''app/utilities/CharacterCounter.js''' Line 40:<br />
<source lang="JavaScript"><br />
var charCounterUI = {<br />
containerElement: null,<br />
valueElement: null<br />
};<br />
</source><br />
<br />
:Line 188:<br />
<source lang="JavaScript"><br />
var setCurrentCharCount = function(newCharCount) {<br />
if(charCounterUI.valueElement) {<br />
if (newCharCount > 0)<br />
charCounterUI.valueElement.update(newCharCount);<br />
else<br />
charCounterUI.valueElement.update('');<br />
}<br />
if(charCounterUI.containerElement) {<br />
if (newCharCount == 0) {<br />
if (charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.hide();<br />
} else {<br />
if (!charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.show();<br />
}<br />
}<br />
};<br />
</source><br />
<br />
:Line 286:<br />
<source lang="JavaScript"><br />
if(params.charCounter) {<br />
charCounterUI.containerElement = params.charCounter.charCountContainer;<br />
charCounterUI.valueElement = params.charCounter.charCountElement;<br />
if(params.charCounter.setTextFieldValueFn) {<br />
setTextFieldValueFn = params.charCounter.setTextFieldValueFn;<br />
} <br />
}<br />
</source><br />
<br />
:Line 331:<br />
<source lang="JavaScript"><br />
setCurrentCharCount(rawCharacterData.count);<br />
</source><br />
<br />
<br />
''Again, same code for both files, inserted on different lines.''<br><br />
'''app/views/chatview/chatview-scene.html''' Line 25:<br><br />
'''app/views/compose/compose-scene.html''' Line 8:<br />
<source lang="HTML4Strict"><br />
<div id="charCounterContainer"><br />
<div id="charCounter"><br />
</div><br />
</div><br />
</source><br />
<br />
<br />
'''stylesheets/messaging.css''' Line 839:<br />
<source lang="CSS"><br />
#messageContainer #charCounterContainer {<br />
line-height: 20px;<br />
display:block;<br />
height: 20px;<br />
border-width: 0px 10px 0px 9px;<br />
-webkit-border-image: url(../images/message-segment-badge.png) 0 10 0 9 stretch stretch;<br />
position: absolute;<br />
z-index: 3;<br />
top: 2px;<br />
left: 2px;<br />
}<br />
#messageContainer #charCounterContainer #charCounter {<br />
font-size: 12px;<br />
font-weight: bold;<br />
color: #679BC2;<br />
margin: 0px -4px 3px -3px;<br />
}<br />
</source><br />
If you don't like the location of the character counter (I have it configured for the top left of the text area), you can modify the #charCounterContainer section in the messaging.css above.<br />
<br />
== Use ==<br />
<br />
This will require LunaSysMgr to be restarted. A rescan will not work. After you've made the modifications listed above, run the following command:<br />
<code><pre><br />
pkill LunaSysMgr<br />
</pre></code><br />
<br />
== Credits ==<br />
<br />
* [[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Force Offline Send Without Dialog =<br />
<br />
<code><pre><br />
sudo mount -o remount,rw /<br />
sudo vi /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js<br />
/forceSendIfOffline =<br />
</pre></code><br />
<br />
Change the line to true (below) , writequit , remount, reload , enjoy <br />
<br />
<code><pre><br />
forceSendIfOffline = true; <br />
:wq <br />
sudo mount -o remount,ro /<br />
sudo stop LunaSysMgr ; sudo start LunaSysMgr<br />
</pre></code></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Messaging_Mods&diff=1675Messaging Mods2009-07-22T19:26:40Z<p>HattCzech: /* New Card For Each Conversation */ made name shorter</p>
<hr />
<div>All files are located in '''/usr/palm/applications/com.palm.app.messaging/'''<br />
<br />
= Add Timestamps to All Received Messages =<br />
<br />
== Introduction ==<br />
<br />
A number of users have requested adding timestamps to each message that arrives on the device.<br />
Palm actually goes out of their way to group messages that have arrived during various time intervals,<br />
but if you'd prefer to see a timestamp on each message, simply follow the instructions below.<br />
<br />
== Procedure ==<br />
<br />
# [[Portal:Accessing_Linux|Gain root access to your device]]<br />
# Remount the file system as read/write<br />
# cd to '''/usr/palm/applications/com.palm.app.messaging/app/controllers/'''<br />
# Backup '''chatview-assistant.js''' (just to be safe)<br />
# Open '''chatview-assistant.js''' and comment out the following lines:<br />
#* 1169 - line that starts with: '''if(!ChatFlags.'''<br />
#* 1177 - line that starts with: '''if(today-msg.'''<br />
#* 1179 - first closing bracket on its own line: '''}'''<br />
#* 1180 - second closing bracket on its own line: '''}'''<br />
# Save the file and exit the editor<br />
# Remount the file system as read-only<br />
# Logout of your root session<br />
# Reboot the device<br />
<br />
You should now see a full timestamp on all received messages.<br />
<br />
== Acknowledgements ==<br />
<br />
Thanks to [[User:tk102|tk102]] and [[User:scuba_steve|scuba_steve]] on [http://www.precentral.net/ PreCentral] for the mod.<br />
<br />
----<br />
<br />
= New Card For Each Conversation =<br />
<br />
== Introduction ==<br />
<br />
The message app can be a pain when you have multiple conversations going on. You often have to swipe back and then pick someone else. <br />
It gets annoying fast. This modification modifies the messaging application so that a new card is created whenever you click into a conversation.<br />
<br />
== Procedure ==<br />
<br />
Edit '''/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js''' and replace the launchChatView function with the following function:<br />
<br />
<code><pre><br />
launchChatView: function(chatThreadId) {<br />
//Need to jump to that stage if it exists<br />
var stageController = Mojo.Controller.appController.getStageController("messaging"+chatThreadId);<br />
if (stageController) {<br />
stageController.activate();<br />
return;<br />
}<br />
<br />
var params = {name: 'messaging' + chatThreadId,<br />
lightweight: Mojo.Controller.appInfo.lwStages<br />
};<br />
<br />
var callback = function(controller) {<br />
controller.pushScene('chatview',chatThreadId,{<br />
focusWindow: true<br />
}); <br />
};<br />
<br />
Mojo.Controller.getAppController().createStageWithCallback(params, callback); //doesnt create ifit exists sooo<br />
},<br />
<br />
clearListBadgeForChatThreadId: function(chatThreadId) {<br />
var badgeContainers = ["buddyBageContainer","historyBageContainer"];<br />
var listItem;<br />
for (var i = 0; i < badgeContainers.length; i++) {<br />
listItem = this.controller.get(badgeContainers[i] + chatThreadId);<br />
if (listItem && !listItem.hasClassName('hide-unread-count')) {<br />
listItem.addClassName('hide-unread-count');<br />
}<br />
} <br />
},<br />
</pre></code><br />
<br />
Now in '''/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js''', comment out lines 246 and 247.<br />
This change will ensure that if you use the "back gesture" in a chat, the application doesn't bring you back to the conversation list...or do anything else.<br />
<br />
To "comment out" a line, add // at the beginning. Example:<br />
<code><pre><br />
printf("This is code");<br />
//printf("This is commented out");<br />
</pre></code><br />
<br />
== Concerns ==<br />
There is some delay in creating the new cards. I'm not sure why though.<br />
As stated above, the cards are only opened when you click into the conversation. Responding to a notification will result in the reuse of the buddy list window, and you have disabled the back gesture.<br />
<br />
== Acknolwedgements ==<br />
<br />
Thanks to [[User:mikedg|mikedg]] for the mod.<br />
<br />
[[User:chris_phelps|chris_phelps]] is continuing to work on this modification to get it working more completely.<br />
The first step is to clean up the other launchChatNNN functionality in app-assistant.js which accepts Luna System calls from the notification dashboard items which are created when a new message is received on the phone. These code modifications are being tested currently, and will be posted when we figure out how to clear the new message counters in the main listview-assistant.js.<br />
<br />
----<br />
<br />
= Character Counter =<br />
<br />
One of the features I liked about my old Treo was the character counter built-in to the messaging application. I thought it would be useful on the Pre, so I modified the messaging application to show the current character count. I made this a separate page from the other modifications because it requires many code changes. Maybe the other messaging modifications could be rolled into this page as well.<br />
<br />
== Configuration ==<br />
<br />
''This modification is the same for both files, just inserted on different lines.''<br><br />
'''app/controllers/chatview-assistant.js''' Line 157:<br><br />
'''app/controllers/compose-assistant.js''' Line 115:<br />
<source lang="JavaScript"><br />
},<br />
charCounter: {<br />
charCountContainer: this.controller.get('charCounterContainer'),<br />
charCountElement: this.controller.get('charCounter'),<br />
setTextFieldValueFn: this.setTextFieldValue.bind(this)<br />
</source><br />
<br />
<br />
'''app/utilities/CharacterCounter.js''' Line 40:<br />
<source lang="JavaScript"><br />
var charCounterUI = {<br />
containerElement: null,<br />
valueElement: null<br />
};<br />
</source><br />
<br />
:Line 188:<br />
<source lang="JavaScript"><br />
var setCurrentCharCount = function(newCharCount) {<br />
if(charCounterUI.valueElement) {<br />
if (newCharCount > 0)<br />
charCounterUI.valueElement.update(newCharCount);<br />
else<br />
charCounterUI.valueElement.update('');<br />
}<br />
if(charCounterUI.containerElement) {<br />
if (newCharCount == 0) {<br />
if (charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.hide();<br />
} else {<br />
if (!charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.show();<br />
}<br />
}<br />
};<br />
</source><br />
<br />
:Line 286:<br />
<source lang="JavaScript"><br />
if(params.charCounter) {<br />
charCounterUI.containerElement = params.charCounter.charCountContainer;<br />
charCounterUI.valueElement = params.charCounter.charCountElement;<br />
if(params.charCounter.setTextFieldValueFn) {<br />
setTextFieldValueFn = params.charCounter.setTextFieldValueFn;<br />
} <br />
}<br />
</source><br />
<br />
:Line 331:<br />
<source lang="JavaScript"><br />
setCurrentCharCount(rawCharacterData.count);<br />
</source><br />
<br />
<br />
''Again, same code for both files, inserted on different lines.''<br><br />
'''app/views/chatview/chatview-scene.html''' Line 25:<br><br />
'''app/views/compose/compose-scene.html''' Line 8:<br />
<source lang="HTML4Strict"><br />
<div id="charCounterContainer"><br />
<div id="charCounter"><br />
</div><br />
</div><br />
</source><br />
<br />
<br />
'''stylesheets/messaging.css''' Line 839:<br />
<source lang="CSS"><br />
#messageContainer #charCounterContainer {<br />
line-height: 20px;<br />
display:block;<br />
height: 20px;<br />
border-width: 0px 10px 0px 9px;<br />
-webkit-border-image: url(../images/message-segment-badge.png) 0 10 0 9 stretch stretch;<br />
position: absolute;<br />
z-index: 3;<br />
top: 2px;<br />
left: 2px;<br />
}<br />
#messageContainer #charCounterContainer #charCounter {<br />
font-size: 12px;<br />
font-weight: bold;<br />
color: #679BC2;<br />
margin: 0px -4px 3px -3px;<br />
}<br />
</source><br />
If you don't like the location of the character counter (I have it configured for the top left of the text area), you can modify the #charCounterContainer section in the messaging.css above.<br />
<br />
== Use ==<br />
<br />
This will require LunaSysMgr to be restarted. A rescan will not work. After you've made the modifications listed above, run the following command:<br />
<code><pre><br />
pkill LunaSysMgr<br />
</pre></code><br />
<br />
== Credits ==<br />
<br />
* [[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Force Message send to an offline user without question dialog box. =<br />
<br />
<code><pre><br />
sudo mount -o remount,rw /<br />
sudo vi /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js<br />
/forceSendIfOffline =<br />
</pre></code><br />
<br />
Change the line to true (below) , writequit , remount, reload , enjoy <br />
<br />
<code><pre><br />
forceSendIfOffline = true; <br />
:wq <br />
sudo mount -o remount,ro /<br />
sudo stop LunaSysMgr ; sudo start LunaSysMgr<br />
</pre></code></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Messaging_Mods&diff=1674Messaging Mods2009-07-22T19:25:41Z<p>HattCzech: /* Add Timestamps to All Received Messages */ made name shorter</p>
<hr />
<div>All files are located in '''/usr/palm/applications/com.palm.app.messaging/'''<br />
<br />
= Add Timestamps to All Received Messages =<br />
<br />
== Introduction ==<br />
<br />
A number of users have requested adding timestamps to each message that arrives on the device.<br />
Palm actually goes out of their way to group messages that have arrived during various time intervals,<br />
but if you'd prefer to see a timestamp on each message, simply follow the instructions below.<br />
<br />
== Procedure ==<br />
<br />
# [[Portal:Accessing_Linux|Gain root access to your device]]<br />
# Remount the file system as read/write<br />
# cd to '''/usr/palm/applications/com.palm.app.messaging/app/controllers/'''<br />
# Backup '''chatview-assistant.js''' (just to be safe)<br />
# Open '''chatview-assistant.js''' and comment out the following lines:<br />
#* 1169 - line that starts with: '''if(!ChatFlags.'''<br />
#* 1177 - line that starts with: '''if(today-msg.'''<br />
#* 1179 - first closing bracket on its own line: '''}'''<br />
#* 1180 - second closing bracket on its own line: '''}'''<br />
# Save the file and exit the editor<br />
# Remount the file system as read-only<br />
# Logout of your root session<br />
# Reboot the device<br />
<br />
You should now see a full timestamp on all received messages.<br />
<br />
== Acknowledgements ==<br />
<br />
Thanks to [[User:tk102|tk102]] and [[User:scuba_steve|scuba_steve]] on [http://www.precentral.net/ PreCentral] for the mod.<br />
<br />
----<br />
<br />
= Make the messaging app create a new card for each conversation =<br />
<br />
== Introduction ==<br />
<br />
The message app can be a pain when you have multiple conversations going on. You often have to swipe back and then pick someone else. <br />
It gets annoying fast. This modification modifies the messaging application so that a new card is created whenever you click into a conversation.<br />
<br />
== Procedure ==<br />
<br />
Edit '''/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js''' and replace the launchChatView function with the following function:<br />
<br />
<code><pre><br />
launchChatView: function(chatThreadId) {<br />
//Need to jump to that stage if it exists<br />
var stageController = Mojo.Controller.appController.getStageController("messaging"+chatThreadId);<br />
if (stageController) {<br />
stageController.activate();<br />
return;<br />
}<br />
<br />
var params = {name: 'messaging' + chatThreadId,<br />
lightweight: Mojo.Controller.appInfo.lwStages<br />
};<br />
<br />
var callback = function(controller) {<br />
controller.pushScene('chatview',chatThreadId,{<br />
focusWindow: true<br />
}); <br />
};<br />
<br />
Mojo.Controller.getAppController().createStageWithCallback(params, callback); //doesnt create ifit exists sooo<br />
},<br />
<br />
clearListBadgeForChatThreadId: function(chatThreadId) {<br />
var badgeContainers = ["buddyBageContainer","historyBageContainer"];<br />
var listItem;<br />
for (var i = 0; i < badgeContainers.length; i++) {<br />
listItem = this.controller.get(badgeContainers[i] + chatThreadId);<br />
if (listItem && !listItem.hasClassName('hide-unread-count')) {<br />
listItem.addClassName('hide-unread-count');<br />
}<br />
} <br />
},<br />
</pre></code><br />
<br />
Now in '''/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js''', comment out lines 246 and 247.<br />
This change will ensure that if you use the "back gesture" in a chat, the application doesn't bring you back to the conversation list...or do anything else.<br />
<br />
To "comment out" a line, add // at the beginning. Example:<br />
<code><pre><br />
printf("This is code");<br />
//printf("This is commented out");<br />
</pre></code><br />
<br />
== Concerns ==<br />
There is some delay in creating the new cards. I'm not sure why though.<br />
As stated above, the cards are only opened when you click into the conversation. Responding to a notification will result in the reuse of the buddy list window, and you have disabled the back gesture.<br />
<br />
== Acknolwedgements ==<br />
<br />
Thanks to [[User:mikedg|mikedg]] for the mod.<br />
<br />
[[User:chris_phelps|chris_phelps]] is continuing to work on this modification to get it working more completely.<br />
The first step is to clean up the other launchChatNNN functionality in app-assistant.js which accepts Luna System calls from the notification dashboard items which are created when a new message is received on the phone. These code modifications are being tested currently, and will be posted when we figure out how to clear the new message counters in the main listview-assistant.js.<br />
<br />
----<br />
<br />
= Character Counter =<br />
<br />
One of the features I liked about my old Treo was the character counter built-in to the messaging application. I thought it would be useful on the Pre, so I modified the messaging application to show the current character count. I made this a separate page from the other modifications because it requires many code changes. Maybe the other messaging modifications could be rolled into this page as well.<br />
<br />
== Configuration ==<br />
<br />
''This modification is the same for both files, just inserted on different lines.''<br><br />
'''app/controllers/chatview-assistant.js''' Line 157:<br><br />
'''app/controllers/compose-assistant.js''' Line 115:<br />
<source lang="JavaScript"><br />
},<br />
charCounter: {<br />
charCountContainer: this.controller.get('charCounterContainer'),<br />
charCountElement: this.controller.get('charCounter'),<br />
setTextFieldValueFn: this.setTextFieldValue.bind(this)<br />
</source><br />
<br />
<br />
'''app/utilities/CharacterCounter.js''' Line 40:<br />
<source lang="JavaScript"><br />
var charCounterUI = {<br />
containerElement: null,<br />
valueElement: null<br />
};<br />
</source><br />
<br />
:Line 188:<br />
<source lang="JavaScript"><br />
var setCurrentCharCount = function(newCharCount) {<br />
if(charCounterUI.valueElement) {<br />
if (newCharCount > 0)<br />
charCounterUI.valueElement.update(newCharCount);<br />
else<br />
charCounterUI.valueElement.update('');<br />
}<br />
if(charCounterUI.containerElement) {<br />
if (newCharCount == 0) {<br />
if (charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.hide();<br />
} else {<br />
if (!charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.show();<br />
}<br />
}<br />
};<br />
</source><br />
<br />
:Line 286:<br />
<source lang="JavaScript"><br />
if(params.charCounter) {<br />
charCounterUI.containerElement = params.charCounter.charCountContainer;<br />
charCounterUI.valueElement = params.charCounter.charCountElement;<br />
if(params.charCounter.setTextFieldValueFn) {<br />
setTextFieldValueFn = params.charCounter.setTextFieldValueFn;<br />
} <br />
}<br />
</source><br />
<br />
:Line 331:<br />
<source lang="JavaScript"><br />
setCurrentCharCount(rawCharacterData.count);<br />
</source><br />
<br />
<br />
''Again, same code for both files, inserted on different lines.''<br><br />
'''app/views/chatview/chatview-scene.html''' Line 25:<br><br />
'''app/views/compose/compose-scene.html''' Line 8:<br />
<source lang="HTML4Strict"><br />
<div id="charCounterContainer"><br />
<div id="charCounter"><br />
</div><br />
</div><br />
</source><br />
<br />
<br />
'''stylesheets/messaging.css''' Line 839:<br />
<source lang="CSS"><br />
#messageContainer #charCounterContainer {<br />
line-height: 20px;<br />
display:block;<br />
height: 20px;<br />
border-width: 0px 10px 0px 9px;<br />
-webkit-border-image: url(../images/message-segment-badge.png) 0 10 0 9 stretch stretch;<br />
position: absolute;<br />
z-index: 3;<br />
top: 2px;<br />
left: 2px;<br />
}<br />
#messageContainer #charCounterContainer #charCounter {<br />
font-size: 12px;<br />
font-weight: bold;<br />
color: #679BC2;<br />
margin: 0px -4px 3px -3px;<br />
}<br />
</source><br />
If you don't like the location of the character counter (I have it configured for the top left of the text area), you can modify the #charCounterContainer section in the messaging.css above.<br />
<br />
== Use ==<br />
<br />
This will require LunaSysMgr to be restarted. A rescan will not work. After you've made the modifications listed above, run the following command:<br />
<code><pre><br />
pkill LunaSysMgr<br />
</pre></code><br />
<br />
== Credits ==<br />
<br />
* [[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Force Message send to an offline user without question dialog box. =<br />
<br />
<code><pre><br />
sudo mount -o remount,rw /<br />
sudo vi /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js<br />
/forceSendIfOffline =<br />
</pre></code><br />
<br />
Change the line to true (below) , writequit , remount, reload , enjoy <br />
<br />
<code><pre><br />
forceSendIfOffline = true; <br />
:wq <br />
sudo mount -o remount,ro /<br />
sudo stop LunaSysMgr ; sudo start LunaSysMgr<br />
</pre></code></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Patch_webOS_Radio_Power_Switch&diff=833Patch webOS Radio Power Switch2009-07-20T15:12:59Z<p>HattCzech: /* Seamless Interface */ syntax highlighting</p>
<hr />
<div>= Seamless Interface =<br />
<br />
I took what pEEf did and made it look more like it fits. I liked the original idea, but as mentioned in the concerns below, when changing between Airplane mode and back, it doesn't have the correct information. I made mine look like the Bluetooth and Wi-Fi menus.<br />
<br />
== Configuration ==<br />
<br />
'''/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html''' Line 97:<br />
<source lang="HTML4Strict"><br />
<div class="palm-row" id="dm_phone" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
<div class="title truncating-text"><br />
<div class="label right" id="phonemsg">&nbsp;</div><br />
<span x-mojo-loc=''>Phone</span><br />
</div><br />
</div></div><br />
<br />
<div id='phonedetails' x-mojo-element="Drawer"><br />
<br />
<div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
<div id="phone_radio" class="title truncating-text"><br />
</div><br />
</div></div><br />
<br />
</div><br />
<br />
<div class="palm-section-divider"></div><br />
</source><br />
<br />
<br />
'''/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js''' Line 690:<br />
<source lang="JavaScript"><br />
var stageController = Mojo.Controller.getAppController().getStageProxy("DeviceMenu");<br />
stageController.delegateToSceneAssistant("updatePhone");<br />
</source><br />
<br />
:Line 2302:<br />
<source lang="JavaScript"><br />
getCurrentPhoneState: function() {<br />
return this.phoneRadioState;<br />
},<br />
</source><br />
<br />
<br />
'''/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js''' Line 1:<br />
<source lang="JavaScript"><br />
var RadioState = new Hash({wifi: undefined, bluetooth: undefined, phone: undefined});<br />
</source><br />
<br />
:Line 39:<br />
<source lang="JavaScript"><br />
this.controller.setupWidget('phonedetails', {modelProperty:'myOpenProperty'}, this.drawerModel);<br />
this.phonedrawer = this.controller.get('phonedetails');<br />
</source><br />
<br />
:Line 95:<br />
<source lang="JavaScript"><br />
if(this.barAssistant.getCurrentPhoneState()) {<br />
this.controller.get('phonemsg').innerHTML = $L('On');<br />
RadioState.set('phone',true);<br />
}<br />
else {<br />
this.controller.get('phonemsg').innerHTML = $L('Off');<br />
RadioState.set('phone',false);<br />
}<br />
</source><br />
<br />
:Line 118:<br />
<source lang="JavaScript"><br />
this.controller.get('dm_phone').addEventListener(Mojo.Event.tap, this.togglePhoneList.bindAsEventListener(this));<br />
this.controller.get('phone_radio').addEventListener(Mojo.Event.tap, this.togglePhoneRadio.bindAsEventListener(this));<br />
</source><br />
<br />
:Line 173:<br />
<source lang="JavaScript"><br />
updatePhone: function() {<br />
if(this.barAssistant.getCurrentPhoneState()) {<br />
this.controller.get('phonemsg').innerHTML = $L('On');<br />
this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');<br />
RadioState.set('phone', true);<br />
}<br />
else {<br />
this.controller.get('phonemsg').innerHTML = $L('Off');<br />
this.controller.get('phone_radio').innerHTML = $L('Turn on Phone');<br />
RadioState.set('phone', false);<br />
}<br />
},<br />
<br />
togglePhoneRadio: function(event) {<br />
this.serviceRequest = new Mojo.Service.Request("palm://com.palm.vibrate", {<br />
method: 'vibrate', parameters: { 'period': 0,'duration': 250 }<br />
});<br />
if(RadioState.get('phone'))<br />
TelephonyService.tempPowerSet('off',false,null,null);<br />
else<br />
TelephonyService.tempPowerSet('on',false,null,null);<br />
this.toggleDeviceMenu();<br />
},<br />
<br />
togglePhoneList: function(event) {<br />
if(this.apModeInProgress)<br />
return;<br />
<br />
if (this.phonedrawer.mojo.getOpenState()) {<br />
this.controller.hideWidgetContainer(this.controller.get('phonedetails')); <br />
}<br />
else {<br />
if(RadioState.get('phone'))<br />
this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');<br />
else<br />
this.controller.get('phone_radio').innerHTML = $L('Turn on Phone'); <br />
<br />
this.controller.showWidgetContainer(this.controller.get('phonedetails'));<br />
}<br />
this.phonedrawer.mojo.setOpenState(!this.phonedrawer.mojo.getOpenState()); <br />
},<br />
</source><br />
<br />
:Line 921:<br />
<source lang="JavaScript"><br />
if(this.phonedrawer.mojo.getOpenState()) {<br />
this.controller.hideWidgetContainer(this.controller.get('phonedetails'));<br />
this.phonedrawer.mojo.setOpenState(false);<br />
}<br />
</source><br />
<br />
== Other Thoughts ==<br />
<br />
Please let me know if this doesn't work the way it's supposed to. I tried a few times to get it to work properly, and from what I can tell, it works for me. pEEf, thanks for getting me started. -[[User:HattCzech|HattCzech]]<br />
<br />
* Concerns for new method: Airplane mode still always turns the radio on regardless of the state before airplane mode was turned on. Otherwise, very nice.<br />
* Comments: For the Airplane mode: I may try to add in a way for it to remember the phone state, but I figured that was the point of Airplane mode, so I haven't looked into it yet. I will look through the code again and see if it's worth it. -[[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Original Version =<br />
<br />
I created this mod so I can turn off the cellular radio, but keep WiFi and Bluetooth on. Strangely, The Pre does not seem to have an existing way to do this, only the "Airplane Mode" which shuts off ALL radios!<br />
<br />
I currently do not have Sprint service on my Pre, and am just using it with WiFi. (See [/bypassing-activation Bypassing Activation] for info on how to do this.)<br />
<br />
This will also be useful for people wishing to save their battery if in a poor or no service area, yet still wanting to use WiFi.<br />
<br />
Another great use is shutting off the phone so calls will not disturb you while allowing the phone to do all of its network-related activity.<br />
<br />
How it works: Simply click the upper right of the screen where the status bar is (signal strength). You will get a drop-down menu, this is where the stock "Airplane Mode" is. I have added a "Toggle Radio Power" function here. If the radio is on it will turn it off, and vice-versa. It will not turn off WiFi or Bluetooth like Airplane mode does.<br />
<br />
== Note ==<br />
<br />
The Pre actually already lets you turn off the cell radio. You can just turn on Airplane Mode, then turn on WiFi, Bluetooth, or both. ~ lolaiba<br />
<br />
== Installation ==<br />
<br />
NOTE: If you have never modified any code on the phone, please see [/stock-application-mods Modifiying Stock Applications] first.<br />
<br />
This mod is simply additional code to be added to 3 files on your Pre. WARNING: MAKE BACKUPS FIRST!<br />
<br />
I will update the page later with proper diffs, but for now you can just get into the shell, make your backups, fire up vi (or nano) then paste in the relevant lines. Once you are done, you can test it without rebooting by forcing the Luna manager to reinitialize its cache:<br />
<code><pre><br />
luna-send -n 1 palm://com.palm.applicationManager/rescan {}<br />
</pre></code><br />
<br />
Here is the code, Enjoy!<br />
<br />
/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html Line 94:<br />
<code><pre><br />
<div class="palm-section-divider"></div><!-- Added by pEEf --><br />
<br />
<div id="dm_power" class="palm-row" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
<div id="dm_power_status" class="title truncating-text"> <br />
</div><br />
</div></div><br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js Line 2039:<br />
<code><pre><br />
//Returns the Radio Power. Called by DeviceMenu. Added by pEEf <br />
getPower: function() { <br />
return this.phoneRadioState;<br />
},<br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 59:<br />
<code><pre><br />
// Toggle for Radio Power - Added by pEEf<br />
if(this.barAssistant.getPower()) {<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn off Phone Radio');<br />
}<br />
else {<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn on Phone Radio');<br />
}<br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 107:<br />
<code><pre>this.controller.get('dm_power').addEventListener(Mojo.Event.tap, this.togglePower.bindAsEventListener(this));</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 126:<br />
<code><pre><br />
// Toggles the Radio Power - Added by pEEf <br />
<br />
togglePower: function() {<br />
this.serviceRequest = new Mojo.Service.Request("palm://com.palm.vibrate", {<br />
method: 'vibrate', parameters: { 'period': 0,'duration': 250 }<br />
});<br />
if(this.barAssistant.getPower()) {<br />
TelephonyService.tempPowerSet('off',false,null,null);<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn on Phone Radio');<br />
}<br />
else {<br />
TelephonyService.tempPowerSet('on',false,null,null);<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn off Phone Radio');<br />
}<br />
this.toggleDeviceMenu();<br />
},<br />
</pre></code><br />
<br />
== Concerns ==<br />
* Turn off the radio, then turn on airplane mode, and upon turning off airplane mode, the toggle displays the wrong message.<br />
* Turn on airplane mode, toggle displays wrong message<br />
<br />
== Credits ==<br />
Brought to you by pEEf.</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Messaging_Mods&diff=828Messaging Mods2009-07-20T15:01:08Z<p>HattCzech: /* Character Counter */ added syntax highlighting</p>
<hr />
<div>All files are located in '''/usr/palm/applications/com.palm.app.messaging/'''<br />
<br />
= Adding Timestamps to All Received Messages =<br />
<br />
== Introduction ==<br />
<br />
A number of users have requested adding timestamps to each message that arrives on the device.<br />
Palm actually goes out of their way to group messages that have arrived during various time intervals,<br />
but if you'd prefer to see a timestamp on each message, simply follow the instructions below.<br />
<br />
== Procedure ==<br />
<br />
# [[Portal:Accessing_Linux|Gain root access to your device]]<br />
# Remount the file system as read/write<br />
# cd to '''/usr/palm/applications/com.palm.app.messaging/app/controllers/'''<br />
# Backup '''chatview-assistant.js''' (just to be safe)<br />
# Open '''chatview-assistant.js''' and comment out the following lines:<br />
#* 1169 - line that starts with: '''if(!ChatFlags.'''<br />
#* 1177 - line that starts with: '''if(today-msg.'''<br />
#* 1179 - first closing bracket on its own line: '''}'''<br />
#* 1180 - second closing bracket on its own line: '''}'''<br />
# Save the file and exit the editor<br />
# Remount the file system as read-only<br />
# Logout of your root session<br />
# Reboot the device<br />
<br />
You should now see a full timestamp on all received messages.<br />
<br />
== Acknowledgements ==<br />
<br />
Thanks to [[User:tk102|tk102]] and [[User:scuba_steve|scuba_steve]] on [http://www.precentral.net/ PreCentral] for the mod.<br />
<br />
----<br />
<br />
= Make the messaging app create a new card for each conversation =<br />
<br />
== Introduction ==<br />
<br />
The message app can be a pain when you have multiple conversations going on. You often have to swipe back and then pick someone else. <br />
It gets annoying fast. This modification modifies the messaging application so that a new card is created whenever you click into a conversation.<br />
<br />
== Procedure ==<br />
<br />
Edit '''/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js''' and replace the launchChatView function with the following function:<br />
<br />
<code><pre><br />
launchChatView: function(chatThreadId) {<br />
//Need to jump to that stage if it exists<br />
var stageController = Mojo.Controller.appController.getStageController("messaging"+chatThreadId);<br />
if (stageController) {<br />
stageController.activate();<br />
return;<br />
}<br />
<br />
var params = {name: 'messaging' + chatThreadId,<br />
lightweight: Mojo.Controller.appInfo.lwStages<br />
};<br />
<br />
var callback = function(controller) {<br />
controller.pushScene('chatview',chatThreadId,{<br />
focusWindow: true<br />
}); <br />
};<br />
<br />
Mojo.Controller.getAppController().createStageWithCallback(params, callback); //doesnt create ifit exists sooo<br />
},<br />
<br />
clearListBadgeForChatThreadId: function(chatThreadId) {<br />
var badgeContainers = ["buddyBageContainer","historyBageContainer"];<br />
var listItem;<br />
for (var i = 0; i < badgeContainers.length; i++) {<br />
listItem = this.controller.get(badgeContainers[i] + chatThreadId);<br />
if (listItem && !listItem.hasClassName('hide-unread-count')) {<br />
listItem.addClassName('hide-unread-count');<br />
}<br />
} <br />
},<br />
</pre></code><br />
<br />
Now in '''/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js''', comment out lines 246 and 247.<br />
This change will ensure that if you use the "back gesture" in a chat, the application doesn't bring you back to the conversation list...or do anything else.<br />
<br />
To "comment out" a line, add // at the beginning. Example:<br />
<code><pre><br />
printf("This is code");<br />
//printf("This is commented out");<br />
</pre></code><br />
<br />
== Concerns ==<br />
There is some delay in creating the new cards. I'm not sure why though.<br />
As stated above, the cards are only opened when you click into the conversation. Responding to a notification will result in the reuse of the buddy list window, and you have disabled the back gesture.<br />
<br />
== Acknolwedgements ==<br />
<br />
Thanks to [[User:mikedg|mikedg]] for the mod.<br />
<br />
[[User:chris_phelps|chris_phelps]] is continuing to work on this modification to get it working more completely.<br />
The first step is to clean up the other launchChatNNN functionality in app-assistant.js which accepts Luna System calls from the notification dashboard items which are created when a new message is received on the phone. These code modifications are being tested currently, and will be posted when we figure out how to clear the new message counters in the main listview-assistant.js.<br />
<br />
----<br />
<br />
= Character Counter =<br />
<br />
One of the features I liked about my old Treo was the character counter built-in to the messaging application. I thought it would be useful on the Pre, so I modified the messaging application to show the current character count. I made this a separate page from the other modifications because it requires many code changes. Maybe the other messaging modifications could be rolled into this page as well.<br />
<br />
== Configuration ==<br />
<br />
''This modification is the same for both files, just inserted on different lines.''<br><br />
'''app/controllers/chatview-assistant.js''' Line 157:<br><br />
'''app/controllers/compose-assistant.js''' Line 115:<br />
<source lang="JavaScript"><br />
},<br />
charCounter: {<br />
charCountContainer: this.controller.get('charCounterContainer'),<br />
charCountElement: this.controller.get('charCounter'),<br />
setTextFieldValueFn: this.setTextFieldValue.bind(this)<br />
</source><br />
<br />
<br />
'''app/utilities/CharacterCounter.js''' Line 40:<br />
<source lang="JavaScript"><br />
var charCounterUI = {<br />
containerElement: null,<br />
valueElement: null<br />
};<br />
</source><br />
<br />
:Line 188:<br />
<source lang="JavaScript"><br />
var setCurrentCharCount = function(newCharCount) {<br />
if(charCounterUI.valueElement) {<br />
if (newCharCount > 0)<br />
charCounterUI.valueElement.update(newCharCount);<br />
else<br />
charCounterUI.valueElement.update('');<br />
}<br />
if(charCounterUI.containerElement) {<br />
if (newCharCount == 0) {<br />
if (charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.hide();<br />
} else {<br />
if (!charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.show();<br />
}<br />
}<br />
};<br />
</source><br />
<br />
:Line 286:<br />
<source lang="JavaScript"><br />
if(params.charCounter) {<br />
charCounterUI.containerElement = params.charCounter.charCountContainer;<br />
charCounterUI.valueElement = params.charCounter.charCountElement;<br />
if(params.charCounter.setTextFieldValueFn) {<br />
setTextFieldValueFn = params.charCounter.setTextFieldValueFn;<br />
} <br />
}<br />
</source><br />
<br />
:Line 331:<br />
<source lang="JavaScript"><br />
setCurrentCharCount(rawCharacterData.count);<br />
</source><br />
<br />
<br />
''Again, same code for both files, inserted on different lines.''<br><br />
'''app/views/chatview/chatview-scene.html''' Line 25:<br><br />
'''app/views/compose/compose-scene.html''' Line 8:<br />
<source lang="HTML4Strict"><br />
<div id="charCounterContainer"><br />
<div id="charCounter"><br />
</div><br />
</div><br />
</source><br />
<br />
<br />
'''stylesheets/messaging.css''' Line 839:<br />
<source lang="CSS"><br />
#messageContainer #charCounterContainer {<br />
line-height: 20px;<br />
display:block;<br />
height: 20px;<br />
border-width: 0px 10px 0px 9px;<br />
-webkit-border-image: url(../images/message-segment-badge.png) 0 10 0 9 stretch stretch;<br />
position: absolute;<br />
z-index: 3;<br />
top: 2px;<br />
left: 2px;<br />
}<br />
#messageContainer #charCounterContainer #charCounter {<br />
font-size: 12px;<br />
font-weight: bold;<br />
color: #679BC2;<br />
margin: 0px -4px 3px -3px;<br />
}<br />
</source><br />
If you don't like the location of the character counter (I have it configured for the top left of the text area), you can modify the #charCounterContainer section in the messaging.css above.<br />
<br />
== Use ==<br />
<br />
This will require LunaSysMgr to be restarted. A rescan will not work. After you've made the modifications listed above, run the following command:<br />
<code><pre><br />
pkill LunaSysMgr<br />
</pre></code><br />
<br />
== Credits ==<br />
<br />
* [[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Force Message send to an offline user without question dialog box. =<br />
<br />
<code><pre><br />
sudo mount -o remount,rw /<br />
sudo vi /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js<br />
/forceSendIfOffline =<br />
</pre></code><br />
<br />
Change the line to true (below) , writequit , remount, reload , enjoy <br />
<br />
<code><pre><br />
forceSendIfOffline = true; <br />
:wq <br />
sudo mount -o remount,ro /<br />
sudo stop LunaSysMgr ; sudo start LunaSysMgr<br />
</pre></code></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Help:Questions&diff=827Help:Questions2009-07-20T14:51:35Z<p>HattCzech: answered my own question</p>
<hr />
<div>Feel free to PUT some in here, and someone else may answer them!!!<br />
<br />
== Can I Move a Article? ==<br />
<br />
Of course you can, but make sure you're doing it for a valid reason (naming scheme, bad wording etc.) and that you fix all old links that went to said article. Make sure to place the old articles link into the [[Admin Changes]] article so that an admin can delete the old page node. If you do not place it there it may get cleaned up later, or work as a redirect.<br />
<br />
== I Want to Showcase an Application I Made ==<br />
<br />
Yep, applications are separated into [[Portal:webOS Applications|webOS applications]] and [[Portal:Linux Applications|Linux applications]]. Then follow the steps on the page to add your application.<br />
<br />
== Can we get some kind of syntax highlighting for code blocks? ==<br />
<br />
There is already syntax highlighting as described in the [[Help:Style_Guide|style guide]].</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Help:Questions&diff=826Help:Questions2009-07-20T14:47:37Z<p>HattCzech: question about syntax highlighting</p>
<hr />
<div>Feel free to PUT some in here, and someone else may answer them!!!<br />
<br />
== Can I Move a Article? ==<br />
<br />
Of course you can, but make sure you're doing it for a valid reason (naming scheme, bad wording etc.) and that you fix all old links that went to said article. Make sure to place the old articles link into the [[Admin Changes]] article so that an admin can delete the old page node. If you do not place it there it may get cleaned up later, or work as a redirect.<br />
<br />
== I Want to Showcase an Application I Made ==<br />
<br />
Yep, applications are separated into [[Portal:webOS Applications|webOS applications]] and [[Portal:Linux Applications|Linux applications]]. Then follow the steps on the page to add your application.<br />
<br />
== Can we get some kind of [http://www.mediawiki.org/wiki/Extension:SyntaxHighlighterAndCodeColorizer syntax highlighting] for code blocks? ==</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Portal:Accessing_Linux&diff=823Portal:Accessing Linux2009-07-20T14:29:16Z<p>HattCzech: </p>
<hr />
<div>__notoc__<br />
{{portal-one-column-blue<br />
|header=Accessing Linux (Rooting your Pre is the Old Inaccurate Term)<br />
|column1=<br />
The Palm pre is a Linux based device. As it is shipped, the linux is a fully installed and operational copy, and communicates with the outside world using the Novacomm protocols (the same as used by the iPhone.)<br />
<br />
Therefore, enabling access to the Pre was remarkably simple and is officially documented by Palm in the public emulator instructions. Typing in the "developers code" ( ''upupdowndownleftrightleftrightbastart'' ) enables communication between the Linux and the outside world using novacomm. <br />
<br />
After that, everything else is a process of installing a ''community standard library'' of Linux programs so that users have the same tools and options available to them. <br />
<br />
One of the first choices was installing a package manager for the OptWare library of over 1000 Linux programs, compiled for the Pre. <br />
<br />
Once this is done, basically, anything you can do on a Linux box, you can do on the Pre. The community is rapidly working on developing methods for Linux programs to interact with the end-user shell known as Luna or Mojo in addition to access via terminal programs. <br />
<br />
The following links will walk you through the process of obtaining access to the Linux system from a terminal program, and installing the community standard software package. <br />
<br />
It is necessary (as of this edit) to access the Linux operating system via a terminal program running on a separate PC. You can not achieve root access to the Linux operating system on the phone from the phone itself. However, once you have achieved secure root access, it is possible to make any changes you like to the underlying linux system on the phone.<br />
<br />
The process of obtaining access to the Linux is actually a fairly simple procedure. Look below.<br />
<br />
[http://www.youtube.com/watch?v=-LBXV0tYyyI Example of a Palm Pre with secure root access]<br />
<br />
[http://www.youtube.com/watch?v=xoIE7Y_pyEU YouTube how-to instructions]<br />
<br />
Note that if you are running the Pre emulator, you can achieve Linux access on the emulator (not on the real Pre) by using an ssh client (e.g. PuTTY on Windows) to connect to 'root@localhost' at port 5522 on the host machine (which is port forwarded by VirtualBox to the dropbear ssh daemon running on port 22 inside the emulator), and the instructions on this page are not required - you should go straight to the [[Next_steps|next steps]].<br />
<br />
}}<br />
<br />
{{portal-two-columns<br />
|column1=<br />
== Before you start == <br />
<br />
Please make a note of this page: [[How_to_recover|How to recover]]<br />
<br />
If you are unfamiliar with basic Linux command usage, you should visit this page: [[Basic_Linux_Use|Basic Linux Use]]<br />
<br />
You might also want to consider backing up any files you have in the usb drive portion of the Pre. <br />
|column2=<br />
== Procedure: ==<br />
<br />
There are four versions of the secure root access procedure: <br />
* [[deprecated|Windows XP via wifi]] '''This version is deprecated. Use the USB cable versions.'''<br />
* [[Accessing Linux From Windows|Windows XP or Windows Vista via USB cable (novaproxy) ]]<br />
* [[Accessing Linux From OSX|Mac OS X procedure via usb cable ]] <br />
* [[Accessing Linux From Linux|Linux procedure via usb cable ]]<br />
<br />
}}<br />
{{portal-two-columns<br />
|column1=<br />
== Next steps after Accessing Linux ==<br />
<br />
* [[Next_steps|Set up users, Optware, and access]]<br />
* [[Applying_patches|Applying Patches]]<br />
* [[Setup_SFTP|Setup SFTP]]<br />
* [[Tutorials_Linux_DDNS_for_EVDO|DDNS for EVDO]]<br />
<br />
|column2=<br />
== More Stuff ==<br />
<br />
*add here<br />
<br />
}}</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Messaging_Mods&diff=742Messaging Mods2009-07-20T04:16:45Z<p>HattCzech: /* Procedure */</p>
<hr />
<div>All files are located in '''/usr/palm/applications/com.palm.app.messaging/'''<br />
<br />
= Adding Timestamps to All Received Messages =<br />
<br />
== Introduction ==<br />
<br />
A number of users have requested adding timestamps to each message that arrives on the device.<br />
Palm actually goes out of their way to group messages that have arrived during various time intervals,<br />
but if you'd prefer to see a timestamp on each message, simply follow the instructions below.<br />
<br />
== Procedure ==<br />
<br />
# [[Portal:Accessing_Linux|Gain root access to your device]]<br />
# Remount the file system as read/write<br />
# cd to '''/usr/palm/applications/com.palm.app.messaging/app/controllers/'''<br />
# Backup '''chatview-assistant.js''' (just to be safe)<br />
# Open '''chatview-assistant.js''' and comment out the following lines:<br />
#* 1169 - line that starts with: '''if(!ChatFlags.'''<br />
#* 1177 - line that starts with: '''if(today-msg.'''<br />
#* 1179 - first closing bracket on its own line: '''}'''<br />
#* 1180 - second closing bracket on its own line: '''}'''<br />
# Save the file and exit the editor<br />
# Remount the file system as read-only<br />
# Logout of your root session<br />
# Reboot the device<br />
<br />
You should now see a full timestamp on all received messages.<br />
<br />
== Acknowledgements ==<br />
<br />
Thanks to [[User:tk102|tk102]] and [[User:scuba_steve|scuba_steve]] on [http://www.precentral.net/ PreCentral] for the mod.<br />
<br />
----<br />
<br />
= Make the messaging app create a new card for each conversation =<br />
<br />
== Introduction ==<br />
<br />
The message app can be a pain when you have multiple conversations going on. You often have to swipe back and then pick someone else. <br />
It gets annoying fast. This modification modifies the messaging application so that a new card is created whenever you click into a conversation.<br />
<br />
== Procedure ==<br />
<br />
Edit '''/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js''' and replace the launchChatView function with the following function:<br />
<br />
<code><pre><br />
launchChatView: function(chatThreadId) {<br />
//Need to jump to that stage if it exists<br />
var stageController = Mojo.Controller.appController.getStageController("messaging"+chatThreadId);<br />
if (stageController) {<br />
stageController.activate();<br />
return;<br />
}<br />
<br />
var params = {name: 'messaging' + chatThreadId,<br />
lightweight: Mojo.Controller.appInfo.lwStages<br />
};<br />
<br />
var callback = function(controller) {<br />
controller.pushScene('chatview',chatThreadId,{<br />
focusWindow: true<br />
}); <br />
};<br />
<br />
Mojo.Controller.getAppController().createStageWithCallback(params, callback); //doesnt create ifit exists sooo<br />
},<br />
<br />
clearListBadgeForChatThreadId: function(chatThreadId) {<br />
var badgeContainers = ["buddyBageContainer","historyBageContainer"];<br />
var listItem;<br />
for (var i = 0; i < badgeContainers.length; i++) {<br />
listItem = this.controller.get(badgeContainers[i] + chatThreadId);<br />
if (listItem && !listItem.hasClassName('hide-unread-count')) {<br />
listItem.addClassName('hide-unread-count');<br />
}<br />
} <br />
},<br />
</pre></code><br />
<br />
Now in '''/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js''', comment out lines 246 and 247.<br />
This change will ensure that if you use the "back gesture" in a chat, the application doesn't bring you back to the conversation list...or do anything else.<br />
<br />
To "comment out" a line, add // at the beginning. Example:<br />
<code><pre><br />
printf("This is code");<br />
//printf("This is commented out");<br />
</pre></code><br />
<br />
== Concerns ==<br />
There is some delay in creating the new cards. I'm not sure why though.<br />
As stated above, the cards are only opened when you click into the conversation. Responding to a notification will result in the reuse of the buddy list window, and you have disabled the back gesture.<br />
<br />
== Acknolwedgements ==<br />
<br />
Thanks to [[User:mikedg|mikedg]] for the mod.<br />
<br />
[[User:chris_phelps|chris_phelps]] is continuing to work on this modification to get it working more completely.<br />
The first step is to clean up the other launchChatNNN functionality in app-assistant.js which accepts Luna System calls from the notification dashboard items which are created when a new message is received on the phone. These code modifications are being tested currently, and will be posted when we figure out how to clear the new message counters in the main listview-assistant.js.<br />
<br />
----<br />
<br />
= Character Counter =<br />
<br />
One of the features I liked about my old Treo was the character counter built-in to the messaging application. I thought it would be useful on the Pre, so I modified the messaging application to show the current character count. I made this a separate page from the other modifications because it requires many code changes. Maybe the other messaging modifications could be rolled into this page as well.<br />
<br />
== Configuration ==<br />
<br />
''This modification is the same for both files, just inserted on different lines.''<br><br />
'''app/controllers/chatview-assistant.js''' Line 157:<br><br />
'''app/controllers/compose-assistant.js''' Line 115:<br />
<code lang="JavaScript"><pre><br />
},<br />
charCounter: {<br />
charCountContainer: this.controller.get('charCounterContainer'),<br />
charCountElement: this.controller.get('charCounter'),<br />
setTextFieldValueFn: this.setTextFieldValue.bind(this)<br />
</pre></code><br />
<br />
<br />
'''app/utilities/CharacterCounter.js''' Line 40:<br />
<code lang="JavaScript"><pre><br />
var charCounterUI = {<br />
containerElement: null,<br />
valueElement: null<br />
};<br />
</pre></code><br />
<br />
Line 188:<br />
<code lang="JavaScript"><pre><br />
var setCurrentCharCount = function(newCharCount) {<br />
if(charCounterUI.valueElement) {<br />
if (newCharCount > 0)<br />
charCounterUI.valueElement.update(newCharCount);<br />
else<br />
charCounterUI.valueElement.update('');<br />
}<br />
if(charCounterUI.containerElement) {<br />
if (newCharCount == 0) {<br />
if (charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.hide();<br />
} else {<br />
if (!charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.show();<br />
}<br />
}<br />
};<br />
</pre></code><br />
<br />
Line 286:<br />
<code lang="JavaScript"><pre><br />
if(params.charCounter) {<br />
charCounterUI.containerElement = params.charCounter.charCountContainer;<br />
charCounterUI.valueElement = params.charCounter.charCountElement;<br />
if(params.charCounter.setTextFieldValueFn) {<br />
setTextFieldValueFn = params.charCounter.setTextFieldValueFn;<br />
} <br />
}<br />
</pre></code><br />
<br />
Line 331:<br />
<code lang="JavaScript"><pre><br />
setCurrentCharCount(rawCharacterData.count);<br />
</pre></code><br />
<br />
<br />
''Again, same code for both files, inserted on different lines.''<br><br />
'''app/views/chatview/chatview-scene.html''' Line 25:<br><br />
'''app/views/compose/compose-scene.html''' Line 8:<br />
<code lang="HTML"><pre><br />
<div id="charCounterContainer"><br />
<div id="charCounter"><br />
</div><br />
</div><br />
</pre></code><br />
<br />
<br />
'''stylesheets/messaging.css''' Line 839:<br />
<code lang="CSS"><pre><br />
#messageContainer #charCounterContainer {<br />
line-height: 20px;<br />
display:block;<br />
height: 20px;<br />
border-width: 0px 10px 0px 9px;<br />
-webkit-border-image: url(../images/message-segment-badge.png) 0 10 0 9 stretch stretch;<br />
position: absolute;<br />
z-index: 3;<br />
top: 2px;<br />
left: 2px;<br />
}<br />
#messageContainer #charCounterContainer #charCounter {<br />
font-size: 12px;<br />
font-weight: bold;<br />
color: #679BC2;<br />
margin: 0px -4px 3px -3px;<br />
}<br />
</pre></code><br />
If you don't like the location of the character counter (I have it configured for the top left of the text area), you can modify the #charCounterContainer section in the messaging.css above.<br />
<br />
== Use ==<br />
<br />
This will require LunaSysMgr to be restarted. A rescan will not work. After you've made the modifications listed above, run the following command:<br />
<code><pre><br />
pkill LunaSysMgr<br />
</pre></code><br />
<br />
== Credits ==<br />
<br />
* [[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Force Message send to an offline user without question dialog box. =<br />
<br />
<code><pre><br />
sudo mount -o remount,rw /<br />
sudo vi /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js<br />
/forceSendIfOffline =<br />
</pre></code><br />
<br />
Change the line to true (below) , writequit , remount, reload , enjoy <br />
<br />
<code><pre><br />
forceSendIfOffline = true; <br />
;wq <br />
sudo mount -o remount,ro /<br />
sudo stop LunaSysMgr ; sudo start LunaSysMgr<br />
</pre></code></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=User:HattCzech&diff=741User:HattCzech2009-07-20T04:15:12Z<p>HattCzech: /* Modifications */</p>
<hr />
<div>= Modifications =<br />
<br />
* [[Radio_Power_Switch#Seamless_Interface|Phone On/Off Switch]]<br />
* [[Messaging_Mods#Character Counter|Character Counter]]<br />
<br />
= Projects =<br />
<br />
* Flashlight<br />
* More Messaging Mods</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=User:HattCzech&diff=740User:HattCzech2009-07-20T04:14:35Z<p>HattCzech: /* Modifications */</p>
<hr />
<div>= Modifications =<br />
<br />
[[Radio_Power_Switch#Seamless_Interface|Phone On/Off Switch]]<br />
[[Messaging_Mods#Character Counter|Character Counter]]<br />
<br />
= Projects =<br />
<br />
* Flashlight<br />
* More Messaging Mods</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Patch_webOS_Radio_Power_Switch&diff=739Patch webOS Radio Power Switch2009-07-20T04:12:47Z<p>HattCzech: /* Seamless Interface */</p>
<hr />
<div>= Seamless Interface =<br />
<br />
I took what pEEf did and made it look more like it fits. I liked the original idea, but as mentioned in the concerns below, when changing between Airplane mode and back, it doesn't have the correct information. I made mine look like the Bluetooth and Wi-Fi menus.<br />
<br />
== Configuration ==<br />
<br />
'''/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html''' Line 97:<br />
<code><pre><br />
<div class="palm-row" id="dm_phone" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
<div class="title truncating-text"><br />
<div class="label right" id="phonemsg">&nbsp;</div><br />
<span x-mojo-loc=''>Phone</span><br />
</div><br />
</div></div><br />
<br />
<div id='phonedetails' x-mojo-element="Drawer"><br />
<br />
<div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
<div id="phone_radio" class="title truncating-text"><br />
</div><br />
</div></div><br />
<br />
</div><br />
<br />
<div class="palm-section-divider"></div><br />
</pre></code><br />
<br />
<br />
'''/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js''' Line 690:<br />
<code><pre><br />
var stageController = Mojo.Controller.getAppController().getStageProxy("DeviceMenu");<br />
stageController.delegateToSceneAssistant("updatePhone");<br />
</pre></code><br />
<br />
Line 2302:<br />
<code><pre><br />
getCurrentPhoneState: function() {<br />
return this.phoneRadioState;<br />
},<br />
</pre></code><br />
<br />
<br />
'''/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js''' Line 1:<br />
<code><pre><br />
var RadioState = new Hash({wifi: undefined, bluetooth: undefined, phone: undefined});<br />
</pre></code><br />
<br />
Line 39:<br />
<code><pre><br />
this.controller.setupWidget('phonedetails', {modelProperty:'myOpenProperty'}, this.drawerModel);<br />
this.phonedrawer = this.controller.get('phonedetails');<br />
</pre></code><br />
<br />
Line 95:<br />
<code><pre><br />
if(this.barAssistant.getCurrentPhoneState()) {<br />
this.controller.get('phonemsg').innerHTML = $L('On');<br />
RadioState.set('phone',true);<br />
}<br />
else {<br />
this.controller.get('phonemsg').innerHTML = $L('Off');<br />
RadioState.set('phone',false);<br />
}<br />
</pre></code><br />
<br />
Line 118:<br />
<code><pre><br />
this.controller.get('dm_phone').addEventListener(Mojo.Event.tap, this.togglePhoneList.bindAsEventListener(this));<br />
this.controller.get('phone_radio').addEventListener(Mojo.Event.tap, this.togglePhoneRadio.bindAsEventListener(this));<br />
</pre></code><br />
<br />
Line 173:<br />
<code><pre><br />
updatePhone: function() {<br />
if(this.barAssistant.getCurrentPhoneState()) {<br />
this.controller.get('phonemsg').innerHTML = $L('On');<br />
this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');<br />
RadioState.set('phone', true);<br />
}<br />
else {<br />
this.controller.get('phonemsg').innerHTML = $L('Off');<br />
this.controller.get('phone_radio').innerHTML = $L('Turn on Phone');<br />
RadioState.set('phone', false);<br />
}<br />
},<br />
<br />
togglePhoneRadio: function(event) {<br />
this.serviceRequest = new Mojo.Service.Request("palm://com.palm.vibrate", {<br />
method: 'vibrate', parameters: { 'period': 0,'duration': 250 }<br />
});<br />
if(RadioState.get('phone'))<br />
TelephonyService.tempPowerSet('off',false,null,null);<br />
else<br />
TelephonyService.tempPowerSet('on',false,null,null);<br />
this.toggleDeviceMenu();<br />
},<br />
<br />
togglePhoneList: function(event) {<br />
if(this.apModeInProgress)<br />
return;<br />
<br />
if (this.phonedrawer.mojo.getOpenState()) {<br />
this.controller.hideWidgetContainer(this.controller.get('phonedetails')); <br />
}<br />
else {<br />
if(RadioState.get('phone'))<br />
this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');<br />
else<br />
this.controller.get('phone_radio').innerHTML = $L('Turn on Phone'); <br />
<br />
this.controller.showWidgetContainer(this.controller.get('phonedetails'));<br />
}<br />
this.phonedrawer.mojo.setOpenState(!this.phonedrawer.mojo.getOpenState()); <br />
},<br />
</pre></code><br />
<br />
Line 921:<br />
<code><pre><br />
if(this.phonedrawer.mojo.getOpenState()) {<br />
this.controller.hideWidgetContainer(this.controller.get('phonedetails'));<br />
this.phonedrawer.mojo.setOpenState(false);<br />
}<br />
</pre></code><br />
<br />
== Other Thoughts ==<br />
<br />
Please let me know if this doesn't work the way it's supposed to. I tried a few times to get it to work properly, and from what I can tell, it works for me. pEEf, thanks for getting me started. -[[User:HattCzech|HattCzech]]<br />
<br />
* Concerns for new method: Airplane mode still always turns the radio on regardless of the state before airplane mode was turned on. Otherwise, very nice.<br />
* Comments: For the Airplane mode: I may try to add in a way for it to remember the phone state, but I figured that was the point of Airplane mode, so I haven't looked into it yet. I will look through the code again and see if it's worth it. -[[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Original Version =<br />
<br />
I created this mod so I can turn off the cellular radio, but keep WiFi and Bluetooth on. Strangely, The Pre does not seem to have an existing way to do this, only the "Airplane Mode" which shuts off ALL radios!<br />
<br />
I currently do not have Sprint service on my Pre, and am just using it with WiFi. (See [/bypassing-activation Bypassing Activation] for info on how to do this.)<br />
<br />
This will also be useful for people wishing to save their battery if in a poor or no service area, yet still wanting to use WiFi.<br />
<br />
Another great use is shutting off the phone so calls will not disturb you while allowing the phone to do all of its network-related activity.<br />
<br />
How it works: Simply click the upper right of the screen where the status bar is (signal strength). You will get a drop-down menu, this is where the stock "Airplane Mode" is. I have added a "Toggle Radio Power" function here. If the radio is on it will turn it off, and vice-versa. It will not turn off WiFi or Bluetooth like Airplane mode does.<br />
<br />
== Note ==<br />
<br />
The Pre actually already lets you turn off the cell radio. You can just turn on Airplane Mode, then turn on WiFi, Bluetooth, or both. ~ lolaiba<br />
<br />
== Installation ==<br />
<br />
NOTE: If you have never modified any code on the phone, please see [/stock-application-mods Modifiying Stock Applications] first.<br />
<br />
This mod is simply additional code to be added to 3 files on your Pre. WARNING: MAKE BACKUPS FIRST!<br />
<br />
I will update the page later with proper diffs, but for now you can just get into the shell, make your backups, fire up vi (or nano) then paste in the relevant lines. Once you are done, you can test it without rebooting by forcing the Luna manager to reinitialize its cache:<br />
<code><pre><br />
luna-send -n 1 palm://com.palm.applicationManager/rescan {}<br />
</pre></code><br />
<br />
Here is the code, Enjoy!<br />
<br />
/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html Line 94:<br />
<code><pre><br />
<div class="palm-section-divider"></div><!-- Added by pEEf --><br />
<br />
<div id="dm_power" class="palm-row" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
<div id="dm_power_status" class="title truncating-text"> <br />
</div><br />
</div></div><br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js Line 2039:<br />
<code><pre><br />
//Returns the Radio Power. Called by DeviceMenu. Added by pEEf <br />
getPower: function() { <br />
return this.phoneRadioState;<br />
},<br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 59:<br />
<code><pre><br />
// Toggle for Radio Power - Added by pEEf<br />
if(this.barAssistant.getPower()) {<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn off Phone Radio');<br />
}<br />
else {<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn on Phone Radio');<br />
}<br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 107:<br />
<code><pre>this.controller.get('dm_power').addEventListener(Mojo.Event.tap, this.togglePower.bindAsEventListener(this));</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 126:<br />
<code><pre><br />
// Toggles the Radio Power - Added by pEEf <br />
<br />
togglePower: function() {<br />
this.serviceRequest = new Mojo.Service.Request("palm://com.palm.vibrate", {<br />
method: 'vibrate', parameters: { 'period': 0,'duration': 250 }<br />
});<br />
if(this.barAssistant.getPower()) {<br />
TelephonyService.tempPowerSet('off',false,null,null);<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn on Phone Radio');<br />
}<br />
else {<br />
TelephonyService.tempPowerSet('on',false,null,null);<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn off Phone Radio');<br />
}<br />
this.toggleDeviceMenu();<br />
},<br />
</pre></code><br />
<br />
== Concerns ==<br />
* Turn off the radio, then turn on airplane mode, and upon turning off airplane mode, the toggle displays the wrong message.<br />
* Turn on airplane mode, toggle displays wrong message<br />
<br />
== Credits ==<br />
Brought to you by pEEf.</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Patch_webOS_Radio_Power_Switch&diff=738Patch webOS Radio Power Switch2009-07-20T04:11:52Z<p>HattCzech: New page: = Seamless Interface = I took what pEEf did and made it look more like it fits. I liked the original idea, but as mentioned in the concerns above, when changing between Airplane mode and ...</p>
<hr />
<div>= Seamless Interface =<br />
<br />
I took what pEEf did and made it look more like it fits. I liked the original idea, but as mentioned in the concerns above, when changing between Airplane mode and back, it doesn't have the correct information. I made mine look like the Bluetooth and Wi-Fi menus.<br />
<br />
== Configuration ==<br />
<br />
'''/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html''' Line 97:<br />
<code><pre><br />
<div class="palm-row" id="dm_phone" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
<div class="title truncating-text"><br />
<div class="label right" id="phonemsg">&nbsp;</div><br />
<span x-mojo-loc=''>Phone</span><br />
</div><br />
</div></div><br />
<br />
<div id='phonedetails' x-mojo-element="Drawer"><br />
<br />
<div class="palm-row first" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
<div id="phone_radio" class="title truncating-text"><br />
</div><br />
</div></div><br />
<br />
</div><br />
<br />
<div class="palm-section-divider"></div><br />
</pre></code><br />
<br />
<br />
'''/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js''' Line 690:<br />
<code><pre><br />
var stageController = Mojo.Controller.getAppController().getStageProxy("DeviceMenu");<br />
stageController.delegateToSceneAssistant("updatePhone");<br />
</pre></code><br />
<br />
Line 2302:<br />
<code><pre><br />
getCurrentPhoneState: function() {<br />
return this.phoneRadioState;<br />
},<br />
</pre></code><br />
<br />
<br />
'''/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js''' Line 1:<br />
<code><pre><br />
var RadioState = new Hash({wifi: undefined, bluetooth: undefined, phone: undefined});<br />
</pre></code><br />
<br />
Line 39:<br />
<code><pre><br />
this.controller.setupWidget('phonedetails', {modelProperty:'myOpenProperty'}, this.drawerModel);<br />
this.phonedrawer = this.controller.get('phonedetails');<br />
</pre></code><br />
<br />
Line 95:<br />
<code><pre><br />
if(this.barAssistant.getCurrentPhoneState()) {<br />
this.controller.get('phonemsg').innerHTML = $L('On');<br />
RadioState.set('phone',true);<br />
}<br />
else {<br />
this.controller.get('phonemsg').innerHTML = $L('Off');<br />
RadioState.set('phone',false);<br />
}<br />
</pre></code><br />
<br />
Line 118:<br />
<code><pre><br />
this.controller.get('dm_phone').addEventListener(Mojo.Event.tap, this.togglePhoneList.bindAsEventListener(this));<br />
this.controller.get('phone_radio').addEventListener(Mojo.Event.tap, this.togglePhoneRadio.bindAsEventListener(this));<br />
</pre></code><br />
<br />
Line 173:<br />
<code><pre><br />
updatePhone: function() {<br />
if(this.barAssistant.getCurrentPhoneState()) {<br />
this.controller.get('phonemsg').innerHTML = $L('On');<br />
this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');<br />
RadioState.set('phone', true);<br />
}<br />
else {<br />
this.controller.get('phonemsg').innerHTML = $L('Off');<br />
this.controller.get('phone_radio').innerHTML = $L('Turn on Phone');<br />
RadioState.set('phone', false);<br />
}<br />
},<br />
<br />
togglePhoneRadio: function(event) {<br />
this.serviceRequest = new Mojo.Service.Request("palm://com.palm.vibrate", {<br />
method: 'vibrate', parameters: { 'period': 0,'duration': 250 }<br />
});<br />
if(RadioState.get('phone'))<br />
TelephonyService.tempPowerSet('off',false,null,null);<br />
else<br />
TelephonyService.tempPowerSet('on',false,null,null);<br />
this.toggleDeviceMenu();<br />
},<br />
<br />
togglePhoneList: function(event) {<br />
if(this.apModeInProgress)<br />
return;<br />
<br />
if (this.phonedrawer.mojo.getOpenState()) {<br />
this.controller.hideWidgetContainer(this.controller.get('phonedetails')); <br />
}<br />
else {<br />
if(RadioState.get('phone'))<br />
this.controller.get('phone_radio').innerHTML = $L('Turn off Phone');<br />
else<br />
this.controller.get('phone_radio').innerHTML = $L('Turn on Phone'); <br />
<br />
this.controller.showWidgetContainer(this.controller.get('phonedetails'));<br />
}<br />
this.phonedrawer.mojo.setOpenState(!this.phonedrawer.mojo.getOpenState()); <br />
},<br />
</pre></code><br />
<br />
Line 921:<br />
<code><pre><br />
if(this.phonedrawer.mojo.getOpenState()) {<br />
this.controller.hideWidgetContainer(this.controller.get('phonedetails'));<br />
this.phonedrawer.mojo.setOpenState(false);<br />
}<br />
</pre></code><br />
<br />
== Other Thoughts ==<br />
<br />
Please let me know if this doesn't work the way it's supposed to. I tried a few times to get it to work properly, and from what I can tell, it works for me. pEEf, thanks for getting me started. -[[User:HattCzech|HattCzech]]<br />
<br />
* Concerns for new method: Airplane mode still always turns the radio on regardless of the state before airplane mode was turned on. Otherwise, very nice.<br />
* Comments: For the Airplane mode: I may try to add in a way for it to remember the phone state, but I figured that was the point of Airplane mode, so I haven't looked into it yet. I will look through the code again and see if it's worth it. -[[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Original Version =<br />
<br />
I created this mod so I can turn off the cellular radio, but keep WiFi and Bluetooth on. Strangely, The Pre does not seem to have an existing way to do this, only the "Airplane Mode" which shuts off ALL radios!<br />
<br />
I currently do not have Sprint service on my Pre, and am just using it with WiFi. (See [/bypassing-activation Bypassing Activation] for info on how to do this.)<br />
<br />
This will also be useful for people wishing to save their battery if in a poor or no service area, yet still wanting to use WiFi.<br />
<br />
Another great use is shutting off the phone so calls will not disturb you while allowing the phone to do all of its network-related activity.<br />
<br />
How it works: Simply click the upper right of the screen where the status bar is (signal strength). You will get a drop-down menu, this is where the stock "Airplane Mode" is. I have added a "Toggle Radio Power" function here. If the radio is on it will turn it off, and vice-versa. It will not turn off WiFi or Bluetooth like Airplane mode does.<br />
<br />
== Note ==<br />
<br />
The Pre actually already lets you turn off the cell radio. You can just turn on Airplane Mode, then turn on WiFi, Bluetooth, or both. ~ lolaiba<br />
<br />
== Installation ==<br />
<br />
NOTE: If you have never modified any code on the phone, please see [/stock-application-mods Modifiying Stock Applications] first.<br />
<br />
This mod is simply additional code to be added to 3 files on your Pre. WARNING: MAKE BACKUPS FIRST!<br />
<br />
I will update the page later with proper diffs, but for now you can just get into the shell, make your backups, fire up vi (or nano) then paste in the relevant lines. Once you are done, you can test it without rebooting by forcing the Luna manager to reinitialize its cache:<br />
<code><pre><br />
luna-send -n 1 palm://com.palm.applicationManager/rescan {}<br />
</pre></code><br />
<br />
Here is the code, Enjoy!<br />
<br />
/usr/lib/luna/system/luna-systemui/app/views/devicemenu/devicemenu-scene.html Line 94:<br />
<code><pre><br />
<div class="palm-section-divider"></div><!-- Added by pEEf --><br />
<br />
<div id="dm_power" class="palm-row" x-mojo-tap-highlight='momentary'><div class="palm-row-wrapper"><br />
<div id="dm_power_status" class="title truncating-text"> <br />
</div><br />
</div></div><br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js Line 2039:<br />
<code><pre><br />
//Returns the Radio Power. Called by DeviceMenu. Added by pEEf <br />
getPower: function() { <br />
return this.phoneRadioState;<br />
},<br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 59:<br />
<code><pre><br />
// Toggle for Radio Power - Added by pEEf<br />
if(this.barAssistant.getPower()) {<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn off Phone Radio');<br />
}<br />
else {<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn on Phone Radio');<br />
}<br />
</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 107:<br />
<code><pre>this.controller.get('dm_power').addEventListener(Mojo.Event.tap, this.togglePower.bindAsEventListener(this));</pre></code><br />
<br />
/usr/lib/luna/system/luna-systemui/app/controllers/devicemenu-assistant.js Line 126:<br />
<code><pre><br />
// Toggles the Radio Power - Added by pEEf <br />
<br />
togglePower: function() {<br />
this.serviceRequest = new Mojo.Service.Request("palm://com.palm.vibrate", {<br />
method: 'vibrate', parameters: { 'period': 0,'duration': 250 }<br />
});<br />
if(this.barAssistant.getPower()) {<br />
TelephonyService.tempPowerSet('off',false,null,null);<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn on Phone Radio');<br />
}<br />
else {<br />
TelephonyService.tempPowerSet('on',false,null,null);<br />
this.controller.get('dm_power_status').innerHTML = $L('Turn off Phone Radio');<br />
}<br />
this.toggleDeviceMenu();<br />
},<br />
</pre></code><br />
<br />
== Concerns ==<br />
* Turn off the radio, then turn on airplane mode, and upon turning off airplane mode, the toggle displays the wrong message.<br />
* Turn on airplane mode, toggle displays wrong message<br />
<br />
== Credits ==<br />
Brought to you by pEEf.</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Portal:Misc&diff=726Portal:Misc2009-07-20T04:01:01Z<p>HattCzech: /* Pages */</p>
<hr />
<div>__notoc__<br />
{{portal-header|<br />
For anything that doesn't fit into the other portals. Place it here. Or if it's in another portal and feel people will come here first.<br />
}}<br />
==Pages==<br />
<br />
* [[Add/Delete_Pages_In_The_Launcher|Add/Delete Pages in the Launcher]]<br />
* [[Messaging_Mods|Messaging Modifications]]<br />
* [[Radio_Power_Switch|Phone On/Off Switch]]</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=User:HattCzech&diff=715User:HattCzech2009-07-20T03:48:26Z<p>HattCzech: New page: = Modifications = Character Counter = Projects = * Flashlight * More Messaging Mods</p>
<hr />
<div>= Modifications =<br />
<br />
[[Messaging_Mods#Character Counter|Character Counter]]<br />
<br />
= Projects =<br />
<br />
* Flashlight<br />
* More Messaging Mods</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Messaging_Mods&diff=714Messaging Mods2009-07-20T03:45:23Z<p>HattCzech: </p>
<hr />
<div>All files are located in '''/usr/palm/applications/com.palm.app.messaging/'''<br />
<br />
= Adding Timestamps to All Received Messages =<br />
<br />
== Introduction ==<br />
<br />
A number of users have requested adding timestamps to each message that arrives on the device.<br />
Palm actually goes out of their way to group messages that have arrived during various time intervals,<br />
but if you'd prefer to see a timestamp on each message, simply follow the instructions below.<br />
<br />
== Procedure ==<br />
<br />
# [[Portal:Accessing_Linux|Gain root access to your device]]<br />
# Remount the file system as read/write<br />
# cd to '''/usr/palm/applications/com.palm.app.messaging/app/controllers/'''<br />
# Backup '''chatview-assistant.js''' (just to be safe)<br />
# Open '''chatview-assistant.js''' and comment out the following lines:<br />
#* 1169 - line that starts with: '''if(!ChatFlags.'''<br />
#* 1177 - line that starts with: '''if(today-msg.'''<br />
#* 1179 - first closing bracket on its own line: '''}'''<br />
#* 1180 - second closing bracket on its own line: '''}'''<br />
# Save the file and exit the editor<br />
# Remount the file system as read-only<br />
# Logout of your root session<br />
# Reboot the device<br />
<br />
You should now see a full timestamp on all received messages.<br />
<br />
== Acknowledgements ==<br />
<br />
Thanks to [[User:tk102|tk102]] and [[User:scuba_steve|scuba_steve]] on [http://www.precentral.net/ PreCentral] for the mod.<br />
<br />
----<br />
<br />
= Make the messaging app create a new card for each conversation =<br />
<br />
== Introduction ==<br />
<br />
The message app can be a pain when you have multiple conversations going on. You often have to swipe back and then pick someone else. <br />
It gets annoying fast. This modification modifies the messaging application so that a new card is created whenever you click into a conversation.<br />
<br />
== Procedure ==<br />
<br />
Edit '''/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js''' and replace the launchChatView function with the following function:<br />
<br />
<code><pre><br />
launchChatView: function(chatThreadId) {<br />
//Need to jump to that stage if it exists<br />
var stageController = Mojo.Controller.appController.getStageController("messaging"+chatThreadId);<br />
if (stageController) {<br />
stageController.activate();<br />
return;<br />
}<br />
<br />
var params = {name: 'messaging' + chatThreadId,<br />
lightweight: Mojo.Controller.appInfo.lwStages<br />
};<br />
<br />
var callback = function(controller) {<br />
controller.pushScene('chatview',chatThreadId,{<br />
focusWindow: true<br />
}); <br />
};<br />
<br />
Mojo.Controller.getAppController().createStageWithCallback(params, callback); //doesnt create ifit exists sooo<br />
},<br />
<br />
clearListBadgeForChatThreadId: function(chatThreadId) {<br />
var badgeContainers = ["buddyBageContainer","historyBageContainer"];<br />
var listItem;<br />
for (var i = 0; i < badgeContainers.length; i++) {<br />
listItem = this.controller.get(badgeContainers[i] + chatThreadId);<br />
if (listItem && !listItem.hasClassName('hide-unread-count')) {<br />
listItem.addClassName('hide-unread-count');<br />
}<br />
} <br />
},<br />
<br />
<br />
</pre></code><br />
<br />
Now in '''/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js''', comment out lines 246 and 247.<br />
This change will ensure that if you use the "back gesture" in a chat, the application doesn't bring you back to the conversation list...or do anything else.<br />
<br />
To "comment out" a line, add // at the beginning. Example:<br />
<code><pre><br />
printf("This is code");<br />
//printf("This is commented out");<br />
</pre></code><br />
<br />
== Concerns ==<br />
There is some delay in creating the new cards. I'm not sure why though.<br />
As stated above, the cards are only opened when you click into the conversation. Responding to a notification will result in the reuse of the buddy list window, and you have disabled the back gesture.<br />
<br />
== Acknolwedgements ==<br />
<br />
Thanks to [[User:mikedg|mikedg]] for the mod.<br />
<br />
[[User:chris_phelps|chris_phelps]] is continuing to work on this modification to get it working more completely.<br />
The first step is to clean up the other launchChatNNN functionality in app-assistant.js which accepts Luna System calls from the notification dashboard items which are created when a new message is received on the phone. These code modifications are being tested currently, and will be posted when we figure out how to clear the new message counters in the main listview-assistant.js.<br />
<br />
----<br />
<br />
= Character Counter =<br />
<br />
One of the features I liked about my old Treo was the character counter built-in to the messaging application. I thought it would be useful on the Pre, so I modified the messaging application to show the current character count. I made this a separate page from the other modifications because it requires many code changes. Maybe the other messaging modifications could be rolled into this page as well.<br />
<br />
== Configuration ==<br />
<br />
''This modification is the same for both files, just inserted on different lines.''<br><br />
'''app/controllers/chatview-assistant.js''' Line 157:<br><br />
'''app/controllers/compose-assistant.js''' Line 115:<br />
<code lang="JavaScript"><pre><br />
},<br />
charCounter: {<br />
charCountContainer: this.controller.get('charCounterContainer'),<br />
charCountElement: this.controller.get('charCounter'),<br />
setTextFieldValueFn: this.setTextFieldValue.bind(this)<br />
</pre></code><br />
<br />
<br />
'''app/utilities/CharacterCounter.js''' Line 40:<br />
<code lang="JavaScript"><pre><br />
var charCounterUI = {<br />
containerElement: null,<br />
valueElement: null<br />
};<br />
</pre></code><br />
<br />
Line 188:<br />
<code lang="JavaScript"><pre><br />
var setCurrentCharCount = function(newCharCount) {<br />
if(charCounterUI.valueElement) {<br />
if (newCharCount > 0)<br />
charCounterUI.valueElement.update(newCharCount);<br />
else<br />
charCounterUI.valueElement.update('');<br />
}<br />
if(charCounterUI.containerElement) {<br />
if (newCharCount == 0) {<br />
if (charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.hide();<br />
} else {<br />
if (!charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.show();<br />
}<br />
}<br />
};<br />
</pre></code><br />
<br />
Line 286:<br />
<code lang="JavaScript"><pre><br />
if(params.charCounter) {<br />
charCounterUI.containerElement = params.charCounter.charCountContainer;<br />
charCounterUI.valueElement = params.charCounter.charCountElement;<br />
if(params.charCounter.setTextFieldValueFn) {<br />
setTextFieldValueFn = params.charCounter.setTextFieldValueFn;<br />
} <br />
}<br />
</pre></code><br />
<br />
Line 331:<br />
<code lang="JavaScript"><pre><br />
setCurrentCharCount(rawCharacterData.count);<br />
</pre></code><br />
<br />
<br />
''Again, same code for both files, inserted on different lines.''<br><br />
'''app/views/chatview/chatview-scene.html''' Line 25:<br><br />
'''app/views/compose/compose-scene.html''' Line 8:<br />
<code lang="HTML"><pre><br />
<div id="charCounterContainer"><br />
<div id="charCounter"><br />
</div><br />
</div><br />
</pre></code><br />
<br />
<br />
'''stylesheets/messaging.css''' Line 839:<br />
<code lang="CSS"><pre><br />
#messageContainer #charCounterContainer {<br />
line-height: 20px;<br />
display:block;<br />
height: 20px;<br />
border-width: 0px 10px 0px 9px;<br />
-webkit-border-image: url(../images/message-segment-badge.png) 0 10 0 9 stretch stretch;<br />
position: absolute;<br />
z-index: 3;<br />
top: 2px;<br />
left: 2px;<br />
}<br />
#messageContainer #charCounterContainer #charCounter {<br />
font-size: 12px;<br />
font-weight: bold;<br />
color: #679BC2;<br />
margin: 0px -4px 3px -3px;<br />
}<br />
</pre></code><br />
If you don't like the location of the character counter (I have it configured for the top left of the text area), you can modify the #charCounterContainer section in the messaging.css above.<br />
<br />
== Use ==<br />
<br />
This will require LunaSysMgr to be restarted. A rescan will not work. After you've made the modifications listed above, run the following command:<br />
<code><pre><br />
pkill LunaSysMgr<br />
</pre></code><br />
<br />
== Credits ==<br />
<br />
* [[User:HattCzech|HattCzech]]<br />
<br />
----<br />
<br />
= Force Message send to an offline user without question dialog box. =<br />
<br />
<code><pre><br />
sudo mount -o remount,rw /<br />
sudo vi /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js<br />
/forceSendIfOffline =<br />
</pre></code><br />
<br />
Change the line to true (below) , writequit , remount, reload , enjoy <br />
<br />
<code><pre><br />
forceSendIfOffline = true; <br />
;wq <br />
sudo mount -o remount,ro /<br />
sudo stop LunaSysMgr ; sudo start LunaSysMgr<br />
</pre></code></div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Help:Converting_Pages&diff=705Help:Converting Pages2009-07-20T03:21:56Z<p>HattCzech: </p>
<hr />
<div>Please help us convert pages from the old wiki. <br />
<br />
Here are the steps to follow: <br />
<br />
* Create a link to the new article on this wiki by editing a portal page, or the article that you want to be the parent of the new article. You create a link this way:<br />
<br />
<nowiki>[[Article Name|Article Description]]</nowiki> -> [[Article Name|Article Description]]<br />
<br />
* Please name your pages in TitleCase, with underscores between words, for instance, "Tutorial_Linux_Getting_Started". You can not put spaces in page names.<br />
* Click on that link to bring up the edit page. Type a title and save it. <br />
* Note the url of this new page. <br />
* In another window, go to the old page. <br />
* Choose edit. <br />
* Copy all the source off the old page, and paste it into your favorite editor. <br />
:: at the top of the old page, type the following line: <br />
:: <code><nowiki>[[module Redirect destination="http://www.example.com/base/"]]</nowiki></code> <br />
:: replacing the url with the url of your new page you noted in step 3.<br />
* Go back to your editor. <br />
* Replace all [[[ with [[ <br />
* Replace all ]]] with ]]<br />
* Replace all <tt>**</tt> with <tt><nowiki>'''</nowiki></tt><br />
* Replace all <tt>//</tt> with <tt><nowiki>''</nowiki></tt><br />
* Find all lines that start with + or ++ or +++ or ++++ <br />
* Edit them so that the line is enclosed in the same number of = signs == This is header 2 == (note that spaces are required.) <br />
* Paste the result into the new-page window in the new wiki <br />
* Save. <br />
* Perform any clean-up editing required. In particular you may need to edit links to other pages.<br />
<br />
'''[[A list of existing pages that need to be converted can be found here]]'''</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Messaging_Mods&diff=703Messaging Mods2009-07-20T03:18:58Z<p>HattCzech: New page: All files are located in '''/usr/palm/applications/com.palm.app.messaging/''' = Force Message send to an offline user without question dialog box. = <code><pre> sudo mount -o remount,rw /...</p>
<hr />
<div>All files are located in '''/usr/palm/applications/com.palm.app.messaging/'''<br />
= Force Message send to an offline user without question dialog box. =<br />
<br />
<code><pre><br />
sudo mount -o remount,rw /<br />
sudo vi /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js<br />
/forceSendIfOffline =<br />
</pre></code><br />
<br />
Change the line to true (below) , writequit , remount, reload , enjoy <br />
<br />
<code><pre><br />
forceSendIfOffline = true; <br />
;wq <br />
sudo mount -o remount,ro /<br />
sudo stop LunaSysMgr ; sudo start LunaSysMgr<br />
</pre></code><br />
<br />
------<br />
<br />
= Character Counter =<br />
<br />
One of the features I liked about my old Treo was the character counter built-in to the messaging application. I thought it would be useful on the Pre, so I modified the messaging application to show the current character count. I made this a separate page from the other modifications because it requires many code changes. Maybe the other messaging modifications could be rolled into this page as well.<br />
<br />
== Configuration ==<br />
<br />
''This modification is the same for both files, just inserted on different lines.''<br><br />
'''app/controllers/chatview-assistant.js''' Line 157:<br><br />
'''app/controllers/compose-assistant.js''' Line 115:<br />
<code lang="JavaScript"><pre><br />
},<br />
charCounter: {<br />
charCountContainer: this.controller.get('charCounterContainer'),<br />
charCountElement: this.controller.get('charCounter'),<br />
setTextFieldValueFn: this.setTextFieldValue.bind(this)<br />
</pre></code><br />
<br />
<br />
'''app/utilities/CharacterCounter.js''' Line 40:<br />
<code lang="JavaScript"><pre><br />
var charCounterUI = {<br />
containerElement: null,<br />
valueElement: null<br />
};<br />
</pre></code><br />
<br />
Line 188:<br />
<code lang="JavaScript"><pre><br />
var setCurrentCharCount = function(newCharCount) {<br />
if(charCounterUI.valueElement) {<br />
if (newCharCount > 0)<br />
charCounterUI.valueElement.update(newCharCount);<br />
else<br />
charCounterUI.valueElement.update('');<br />
}<br />
if(charCounterUI.containerElement) {<br />
if (newCharCount == 0) {<br />
if (charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.hide();<br />
} else {<br />
if (!charCounterUI.containerElement.visible())<br />
charCounterUI.containerElement.show();<br />
}<br />
}<br />
};<br />
</pre></code><br />
<br />
Line 286:<br />
<code lang="JavaScript"><pre><br />
if(params.charCounter) {<br />
charCounterUI.containerElement = params.charCounter.charCountContainer;<br />
charCounterUI.valueElement = params.charCounter.charCountElement;<br />
if(params.charCounter.setTextFieldValueFn) {<br />
setTextFieldValueFn = params.charCounter.setTextFieldValueFn;<br />
} <br />
}<br />
</pre></code><br />
<br />
Line 331:<br />
<code lang="JavaScript"><pre><br />
setCurrentCharCount(rawCharacterData.count);<br />
</pre></code><br />
<br />
<br />
''Again, same code for both files, inserted on different lines.''<br><br />
'''app/views/chatview/chatview-scene.html''' Line 25:<br><br />
'''app/views/compose/compose-scene.html''' Line 8:<br />
<code lang="HTML"><pre><br />
<div id="charCounterContainer"><br />
<div id="charCounter"><br />
</div><br />
</div><br />
</pre></code><br />
<br />
<br />
'''stylesheets/messaging.css''' Line 839:<br />
<code lang="CSS"><pre><br />
#messageContainer #charCounterContainer {<br />
line-height: 20px;<br />
display:block;<br />
height: 20px;<br />
border-width: 0px 10px 0px 9px;<br />
-webkit-border-image: url(../images/message-segment-badge.png) 0 10 0 9 stretch stretch;<br />
position: absolute;<br />
z-index: 3;<br />
top: 2px;<br />
left: 2px;<br />
}<br />
#messageContainer #charCounterContainer #charCounter {<br />
font-size: 12px;<br />
font-weight: bold;<br />
color: #679BC2;<br />
margin: 0px -4px 3px -3px;<br />
}<br />
</pre></code><br />
If you don't like the location of the character counter (I have it configured for the top left of the text area), you can modify the #charCounterContainer section in the messaging.css above.<br />
<br />
== Use ==<br />
<br />
This will require LunaSysMgr to be restarted. A rescan will not work. After you've made the modifications listed above, run the following command:<br />
<code><pre><br />
pkill LunaSysMgr<br />
</pre></code><br />
<br />
== Credits ==<br />
<br />
* HattCzech</div>HattCzechhttp://wiki.webos-internals.org/index.php?title=Portal:Misc&diff=658Portal:Misc2009-07-20T02:47:12Z<p>HattCzech: /* Pages */</p>
<hr />
<div>__notoc__<br />
{{portal-header|<br />
For anything that doesn't fit into the other portals. Place it here. Or if it's in another portal and feel people will come here first.<br />
}}<br />
==Pages==<br />
<br />
* [[Add/Delete_Pages_In_The_Launcher|Add/Delete Pages in the Launcher]]<br />
* [[Messaging_Mods|Messaging Modifications]]</div>HattCzech