http://wiki.webos-internals.org/api.php?action=feedcontributions&user=Tcurtin&feedformat=atomWebOS Internals - User contributions [en]2024-03-28T21:58:30ZUser contributionsMediaWiki 1.35.1http://wiki.webos-internals.org/index.php?title=Backing_Up_via_Rsync&diff=4038Backing Up via Rsync2009-08-07T20:22:12Z<p>Tcurtin: /* On the host */</p>
<hr />
<div>=Synopsis=<br />
<br />
The rsync remote-update protocol allows rsync to transfer just the differences between two sets of files across the network link, using an efficient checksum-search algorithm. <br />
<br />
Some of the additional features of rsync are:<br />
<br />
* support for copying links, devices, owners, groups and permissions<br />
* exclude and exclude-from options similar to GNU tar<br />
* a CVS exclude mode for ignoring the same files that CVS would ignore<br />
* can use any transparent remote shell, including rsh or ssh<br />
* does not require root privileges<br />
* pipelining of file transfers to minimize latency costs<br />
* support for anonymous or authenticated rsync servers (ideal for mirroring)<br />
<br />
=Background & Purpose=<br />
<br />
Using rsync as a means to make full backups of the Pre, both for disaster recovery and convenience. I have been using Rsync as a means to backup all my Gentoo and FreeBSD servers, and even a 4TB volume on our NetApp. I was able to restore every system simply by using rsync to push the files to a new disk/array. Using a special string of commands, rsync backups are nearly as depth-oriented as 'dd', while still being much more convenient.<br />
<br />
=Requirements=<br />
<br />
*1 Unix-based computer (with access to the same WIFI or [[USBnet_networking_setup | usbnet]] subnet as the Pre)<br />
*On your Palm Pre, you need to have [[Portal:Accessing_Linux | access to linux]] and have completed the [[Next_steps|next steps]] after accessing linux.<br />
<br />
The Unix-based computer will be consistently referred to as the "host".<br />
<br />
The rsync binary is part of Palm's original package, so it is possible to make a wrap-around gui-based ipk for users who do not want access to linux.<br />
<br />
=Backup Procedure=<br />
<br />
==Notice==<br />
The backup method has been tested, but there are '''no guarantees''' explicitly or implicitly given for data replication and retention. These tools have worked exceptionally well for me, but they might not work for you.<br />
<br />
Out of respect for Sprint, I will only document how to use rsync over WIFI or [[USBnet_networking_setup | usbnet]]. '''I strongly disadvise against using rsync over EVDO (even through SSH). This process is bandwidth intensive and we don't want Sprint complaining to Palm.'''<br />
<br />
==Quick Overview==<br />
1. We will set up the rsync daemon on the Palm Pre and make it acccessible by the host.<br />
<br />
2. The host will be set up to download the Pre's files.<br />
<br />
3. The transfer will take place.<br />
<br />
4. The daemon on the Pre will be killed to prevent anyone else from gaining access.<br />
<br />
==Setting up the Pre==<br />
1. Access your Pre via WIFI or [[USBnet_networking_setup | usbnet]].<br />
<br />
2. Edit '''/etc/rsyncd.conf''' and make sure you fill in the host IP address (your computer)<br />
<br />
pid file = /var/run/rsyncd.pid<br />
uid = root<br />
gid = root<br />
hosts allow = '''FILL_YOUR_HOST_IP_HERE'''<br />
hosts deny = *<br />
use chroot = no<br />
<br />
[root]<br />
path = /<br />
<br />
<br />
3. Start the rsync daemon and allow the rsync daemon to communicate with the host. Make sure you fill in the host IP address (your computer):<br />
export IPADDRESS='''enter the IP Address of your host'''<br />
rsync --daemon && /usr/sbin/iptables -A INPUT -p TCP --dport 873 -s $IPADDRESS<br />
<br />
==Setting up the host==<br />
1. Make sure you are the root user.<br />
<source lang=bash><br />
sudo -i<br />
</source><br />
<br />
or<br />
<br />
<source lang=bash><br />
su -l<br />
</source><br />
<br />
2. On the host, you will need to create a directory where the Palm Pre will back up the files. My example will be '''/media/pre-backup'''<br />
<source lang=bash><br />
mkdir /media/pre-backup<br />
</source><br />
<br />
==Running the transfer==<br />
===On the host===<br />
<br />
1. If you want to exclude any directories you are already backing up (or simply don't want to include), add --exclude=/path/to/your/dir after "-stats" in the command (in Step 4). You will need to do this for every directory you wish to NOT include in the transfer. Until the restore process is verified, I'm including the special filesystems /dev, /proc and /sys in the backup.<br />
<br />
2. Fill your IP Address in the command below, along with your excludes (if you have any), and begin the transfer from the host computer. '''Make sure to set the correct backup directory (if you deviated from /media/pre-backup), otherwise you could overwrite data on your host machine.'''<br />
<source lang=bash><br />
export IPADDRESS='''enter the IP Address of your Pre'''<br />
rsync -HrlptgoDPvvS --force --delete --del --stats rsync://root@$IPADDRESS/root/ /media/pre-backup/<br />
</source><br />
<br />
2a. Every time you run the transfer, it will retain the exact same file-structure of the Pre, only deleting files that don't exist and only sending files that have changed.<br />
<br />
==Disabling the rsync daemon on the Pre==<br />
<br />
1. You need to disable the rsync daemon on the Pre to prevent anyone from gaining access to your files. To kill the rsync daemon, you will need to find the Process ID first, then kill the process.<br />
<source lang=bash><br />
ps auxw | grep rsync <br />
root 11567 0.0 0.0 10480 624 ? Ss 09:18 0:00 rsync --daemon<br />
root 11576 0.0 0.0 6124 640 pts/1 S+ 09:18 0:00 grep rsync (IGNORE THIS ONE)<br />
</source><br />
<br />
Then kill the process:<br />
<source lang=bash><br />
kill 11567<br />
</source><br />
<br />
=Restore Procedure=<br />
==Quick Overview==<br />
1. Set up the host's rsync daemon<br />
<br />
2. Gain access to the Pre's Linux.<br />
<br />
3. Transfer the backed-up files to the pre and pray it works.<br />
<br />
==Setting up the host==<br />
1. Edit '''/etc/rsyncd.conf''' (or '''/usr/local/etc/rsyncd.conf''' for FreeBSD). Check your documentation. Be sure to fill in the Pre's IP Address, and set the correct directory for the Pre backup (my example will be '''/media/pre-backup''').<br />
<br />
pid file = /var/run/rsyncd.pid<br />
uid = root<br />
gid = root<br />
hosts allow = '''FILL_YOUR_PALM_PRE_IP_HERE'''<br />
hosts deny = *<br />
use chroot = no<br />
<br />
[root]<br />
path = /<br />
<br />
<br />
2. Start the rsync daemon (you can use an init script, I'm using the command below just for simplicity. Check your documentation)<br />
<source lang=bash><br />
rsync --daemon<br />
</source><br />
<br />
==Setting up the Pre and restoring==<br />
<br />
A. For the scope of this guide, the requirements above still apply for the Palm Pre: you need to have [[Portal:Accessing_Linux | access to linux]].<br />
<br />
1. Access the Pre via WIFI or usbnet.<br />
<br />
2. Turn off the GUI while we restore all the files.<br />
<source lang=bash><br />
/sbin/initctl stop LunaSysMgr<br />
</source><br />
<br />
3. Fill your IP Address in the command below, and start the transfer. This command will take everything from your Host system and overwrite '''EVERYTHING''' on the Pre.<br />
<br />
export IPADDRESS='''enter the IP Address of your host'''<br />
cd /<br />
mount -o remount,rw /<br />
mount -o remount,rw /boot<br />
mount -o remount,rw /media/internal<br />
rsync -HrlptgoDPvvS --force --delete --del --stats rsync://root@$IPADDRESS/pre-backup/ /<br />
<br />
3a. If you have any "Out of Space" issues, try removing the ''--delete --del'' and replacing it with ''--delete-before''<br />
<br />
4. Reboot immediately and pray it works.<br />
<source lang=bash><br />
reboot<br />
</source><br />
<br />
=Development/Improvement Ideas=<br />
*I need someone to test the restore process and get back to me with suggestions.<br />
*It would be awesome if the Palm Pre supported NFS, otherwise we're stuck to setting up '''/etc/rsyncd.conf''' on the Pre (for backup) and the Host (for restore).<br />
*A gui wrapper is possible because the Palm Pre comes shipped with rsync. Also, there needs to be an easy Windows server program to make this mainstream, only thing to use at the moment that's Windows based is cygwin. Otherwise we're stuck with Unix.<br />
*It's possible to create a cron job to run the backup every evening over WIFI (especially if you dock you're phone overnight). The cron job would be run from the Host computer. It's also recommended to set up iptables for allowing port 873 only for the host on the interface eth0 or usb0.<br />
<br />
=Contributor(s)=<br />
*hopspitfire</div>Tcurtinhttp://wiki.webos-internals.org/index.php?title=Backing_Up_via_Rsync&diff=4037Backing Up via Rsync2009-08-07T20:21:41Z<p>Tcurtin: /* On the host */</p>
<hr />
<div>=Synopsis=<br />
<br />
The rsync remote-update protocol allows rsync to transfer just the differences between two sets of files across the network link, using an efficient checksum-search algorithm. <br />
<br />
Some of the additional features of rsync are:<br />
<br />
* support for copying links, devices, owners, groups and permissions<br />
* exclude and exclude-from options similar to GNU tar<br />
* a CVS exclude mode for ignoring the same files that CVS would ignore<br />
* can use any transparent remote shell, including rsh or ssh<br />
* does not require root privileges<br />
* pipelining of file transfers to minimize latency costs<br />
* support for anonymous or authenticated rsync servers (ideal for mirroring)<br />
<br />
=Background & Purpose=<br />
<br />
Using rsync as a means to make full backups of the Pre, both for disaster recovery and convenience. I have been using Rsync as a means to backup all my Gentoo and FreeBSD servers, and even a 4TB volume on our NetApp. I was able to restore every system simply by using rsync to push the files to a new disk/array. Using a special string of commands, rsync backups are nearly as depth-oriented as 'dd', while still being much more convenient.<br />
<br />
=Requirements=<br />
<br />
*1 Unix-based computer (with access to the same WIFI or [[USBnet_networking_setup | usbnet]] subnet as the Pre)<br />
*On your Palm Pre, you need to have [[Portal:Accessing_Linux | access to linux]] and have completed the [[Next_steps|next steps]] after accessing linux.<br />
<br />
The Unix-based computer will be consistently referred to as the "host".<br />
<br />
The rsync binary is part of Palm's original package, so it is possible to make a wrap-around gui-based ipk for users who do not want access to linux.<br />
<br />
=Backup Procedure=<br />
<br />
==Notice==<br />
The backup method has been tested, but there are '''no guarantees''' explicitly or implicitly given for data replication and retention. These tools have worked exceptionally well for me, but they might not work for you.<br />
<br />
Out of respect for Sprint, I will only document how to use rsync over WIFI or [[USBnet_networking_setup | usbnet]]. '''I strongly disadvise against using rsync over EVDO (even through SSH). This process is bandwidth intensive and we don't want Sprint complaining to Palm.'''<br />
<br />
==Quick Overview==<br />
1. We will set up the rsync daemon on the Palm Pre and make it acccessible by the host.<br />
<br />
2. The host will be set up to download the Pre's files.<br />
<br />
3. The transfer will take place.<br />
<br />
4. The daemon on the Pre will be killed to prevent anyone else from gaining access.<br />
<br />
==Setting up the Pre==<br />
1. Access your Pre via WIFI or [[USBnet_networking_setup | usbnet]].<br />
<br />
2. Edit '''/etc/rsyncd.conf''' and make sure you fill in the host IP address (your computer)<br />
<br />
pid file = /var/run/rsyncd.pid<br />
uid = root<br />
gid = root<br />
hosts allow = '''FILL_YOUR_HOST_IP_HERE'''<br />
hosts deny = *<br />
use chroot = no<br />
<br />
[root]<br />
path = /<br />
<br />
<br />
3. Start the rsync daemon and allow the rsync daemon to communicate with the host. Make sure you fill in the host IP address (your computer):<br />
export IPADDRESS='''enter the IP Address of your host'''<br />
rsync --daemon && /usr/sbin/iptables -A INPUT -p TCP --dport 873 -s $IPADDRESS<br />
<br />
==Setting up the host==<br />
1. Make sure you are the root user.<br />
<source lang=bash><br />
sudo -i<br />
</source><br />
<br />
or<br />
<br />
<source lang=bash><br />
su -l<br />
</source><br />
<br />
2. On the host, you will need to create a directory where the Palm Pre will back up the files. My example will be '''/media/pre-backup'''<br />
<source lang=bash><br />
mkdir /media/pre-backup<br />
</source><br />
<br />
==Running the transfer==<br />
===On the host===<br />
<br />
1. If you want to exclude any directories you are already backing up (or simply don't want to include), add --exclude=/path/to/your/dir after "-stats" in the command (in Step 4). You will need to do this for every directory you wish to NOT include in the transfer. Until the restore process is verified, I'm including the special filesystems /dev, /proc and /sys in the backup.<br />
<br />
2. Fill your IP Address in the command below, along with your excludes (if you have any), and begin the transfer from the host computer. '''Make sure to set the correct backup directory (if you deviated from /media/pre-backup), otherwise you could overwrite data on your host machine.'''<br />
<source lang=bash><br />
export IPADDRESS=enter the IP Address of your Pre<br />
rsync -HrlptgoDPvvS --force --delete --del --stats rsync://root@$IPADDRESS/root/ /media/pre-backup/<br />
</source><br />
<br />
2a. Every time you run the transfer, it will retain the exact same file-structure of the Pre, only deleting files that don't exist and only sending files that have changed.<br />
<br />
==Disabling the rsync daemon on the Pre==<br />
<br />
1. You need to disable the rsync daemon on the Pre to prevent anyone from gaining access to your files. To kill the rsync daemon, you will need to find the Process ID first, then kill the process.<br />
<source lang=bash><br />
ps auxw | grep rsync <br />
root 11567 0.0 0.0 10480 624 ? Ss 09:18 0:00 rsync --daemon<br />
root 11576 0.0 0.0 6124 640 pts/1 S+ 09:18 0:00 grep rsync (IGNORE THIS ONE)<br />
</source><br />
<br />
Then kill the process:<br />
<source lang=bash><br />
kill 11567<br />
</source><br />
<br />
=Restore Procedure=<br />
==Quick Overview==<br />
1. Set up the host's rsync daemon<br />
<br />
2. Gain access to the Pre's Linux.<br />
<br />
3. Transfer the backed-up files to the pre and pray it works.<br />
<br />
==Setting up the host==<br />
1. Edit '''/etc/rsyncd.conf''' (or '''/usr/local/etc/rsyncd.conf''' for FreeBSD). Check your documentation. Be sure to fill in the Pre's IP Address, and set the correct directory for the Pre backup (my example will be '''/media/pre-backup''').<br />
<br />
pid file = /var/run/rsyncd.pid<br />
uid = root<br />
gid = root<br />
hosts allow = '''FILL_YOUR_PALM_PRE_IP_HERE'''<br />
hosts deny = *<br />
use chroot = no<br />
<br />
[root]<br />
path = /<br />
<br />
<br />
2. Start the rsync daemon (you can use an init script, I'm using the command below just for simplicity. Check your documentation)<br />
<source lang=bash><br />
rsync --daemon<br />
</source><br />
<br />
==Setting up the Pre and restoring==<br />
<br />
A. For the scope of this guide, the requirements above still apply for the Palm Pre: you need to have [[Portal:Accessing_Linux | access to linux]].<br />
<br />
1. Access the Pre via WIFI or usbnet.<br />
<br />
2. Turn off the GUI while we restore all the files.<br />
<source lang=bash><br />
/sbin/initctl stop LunaSysMgr<br />
</source><br />
<br />
3. Fill your IP Address in the command below, and start the transfer. This command will take everything from your Host system and overwrite '''EVERYTHING''' on the Pre.<br />
<br />
export IPADDRESS='''enter the IP Address of your host'''<br />
cd /<br />
mount -o remount,rw /<br />
mount -o remount,rw /boot<br />
mount -o remount,rw /media/internal<br />
rsync -HrlptgoDPvvS --force --delete --del --stats rsync://root@$IPADDRESS/pre-backup/ /<br />
<br />
3a. If you have any "Out of Space" issues, try removing the ''--delete --del'' and replacing it with ''--delete-before''<br />
<br />
4. Reboot immediately and pray it works.<br />
<source lang=bash><br />
reboot<br />
</source><br />
<br />
=Development/Improvement Ideas=<br />
*I need someone to test the restore process and get back to me with suggestions.<br />
*It would be awesome if the Palm Pre supported NFS, otherwise we're stuck to setting up '''/etc/rsyncd.conf''' on the Pre (for backup) and the Host (for restore).<br />
*A gui wrapper is possible because the Palm Pre comes shipped with rsync. Also, there needs to be an easy Windows server program to make this mainstream, only thing to use at the moment that's Windows based is cygwin. Otherwise we're stuck with Unix.<br />
*It's possible to create a cron job to run the backup every evening over WIFI (especially if you dock you're phone overnight). The cron job would be run from the Host computer. It's also recommended to set up iptables for allowing port 873 only for the host on the interface eth0 or usb0.<br />
<br />
=Contributor(s)=<br />
*hopspitfire</div>Tcurtinhttp://wiki.webos-internals.org/index.php?title=Messaging_Mods&diff=2079Messaging Mods2009-07-24T16:51:49Z<p>Tcurtin: /* charcounter.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 (webOS 1.1: '''1242''') - line that starts with: '''if(!ChatFlags.'''<br />
#* 1177 (webOS 1.1: '''1250''') - line that starts with: '''if(today-msg.'''<br />
#* 1179 (webOS 1.1: '''1252''') - first closing bracket on its own line: '''}'''<br />
#* 1180 (webOS 1.1: '''1253''') - 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 />
<br />
<br />
Post os1.1 update, you will need to swap in the following for the utilities/CharacterCounter.js section: (mod confirmed working by tcurtin, 7/24/09)<br />
<br />
<source lang="diff"><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-24 12:20:12.000000000 -0500<br />
@@ -39,6 +39,11 @@<br />
containerElement: null,<br />
valueElement: null<br />
};<br />
+ var charCounterUI = {<br />
+ containerElement: null,<br />
+ valueElement: null<br />
+ };<br />
+<br />
<br />
<br />
// TODO: eventually we might want to implement some cleverness that counts<br />
@@ -51,6 +56,10 @@<br />
var message = textAreaElement.value;<br />
return {count:message.length, message:message};<br />
};<br />
+ var charCounterUI = {<br />
+ containerElement: null,<br />
+ valueElement: null<br />
+ };<br />
<br />
var setOverLimit = function(isOver) {<br />
if (isOver) {<br />
@@ -185,6 +194,21 @@<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 />
+<br />
return {<br />
<br />
init: function(controller,platform,textElement,params) {<br />
@@ -265,7 +289,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 +334,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 />
</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>Tcurtinhttp://wiki.webos-internals.org/index.php?title=Patch_Tasks_Always_Show_Details_of_New_Tasks&diff=2037Patch Tasks Always Show Details of New Tasks2009-07-24T15:05:57Z<p>Tcurtin: /* Directions */</p>
<hr />
<div>[[Image:Tasks.png|right]]<br />
== Description==<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.<br />
<br />
Mod: When you add a task, a 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 />
Rooting your Pre is required. These directions assume you have already done so.<br />
<br />
== Disclaimer==<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 />
== Directions==<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//</div>Tcurtin