Difference between revisions of "Patch Messaging Change "Enter Key" To Create Newline"

From WebOS Internals
Jump to navigation Jump to search
(Undo revision 4836 by Hernie (Talk))
Line 12: Line 12:
 
# Change '''compose-assistant.js''' (line 87) and '''chatview-assistant.js''' (line 100) and set '''enterSubmits''' to be '''false'''.
 
# Change '''compose-assistant.js''' (line 87) and '''chatview-assistant.js''' (line 100) and set '''enterSubmits''' to be '''false'''.
 
# Comment out the '''handleTextAreaKeyUp''' function in '''compose-assistant.js''' (lines 278 to 283) and '''chatview-assistant.js''' (lines 1678 to 1683).
 
# Comment out the '''handleTextAreaKeyUp''' function in '''compose-assistant.js''' (lines 278 to 283) and '''chatview-assistant.js''' (lines 1678 to 1683).
 
      Don't comment out the whole '''handleTextAreaKeyUp''' function only comment out the part that says /*this.considerForSend();
 
                                                                                                        Event.stop(event);*/
 
 
 
# To actually display newlines in the chatview: In '''chatview-assistant.js''', in the ''ChatviewAssisant::preFormatChatList'' method (around line 1220), locate the lines:
 
# To actually display newlines in the chatview: In '''chatview-assistant.js''', in the ''ChatviewAssisant::preFormatChatList'' method (around line 1220), locate the lines:
 
#: <source lang="text">if(msg.messageText && !ChatFlags.isTransient(msg.flags)) {  
 
#: <source lang="text">if(msg.messageText && !ChatFlags.isTransient(msg.flags)) {  

Revision as of 15:29, 27 August 2009


Description

I know a lot of people really like sending messages that are coherent, and a great way to do that is with the newline character. However, pressing the ENTER key in the messaging app sends a message, rather than typing a newline character. This page will show you how to (easily) change that action.

Prerequisites

  • Rooted phone.

Process

  1. Log in as root.
  2. Mount the file system as RW.
  3. Enter the /usr/palm/applications/com.palm.app.messaging/app/controllers directory.
  4. Change compose-assistant.js (line 87) and chatview-assistant.js (line 100) and set enterSubmits to be false.
  5. Comment out the handleTextAreaKeyUp function in compose-assistant.js (lines 278 to 283) and chatview-assistant.js (lines 1678 to 1683).
  6. To actually display newlines in the chatview: In chatview-assistant.js, in the ChatviewAssisant::preFormatChatList method (around line 1220), locate the lines:
    <source lang="text">if(msg.messageText && !ChatFlags.isTransient(msg.flags)) {
    msg.messageText = msg.messageText.escapeHTML(); </source>
    and add the following just after:
    <source lang="text">msg.messageText = msg.messageText.replace(/\n/g,"
    "); </source>
  7. Mount the file system as RO.
  8. Reboot.

Post-Mod Screenshots

Messaging-newline1.jpg Messaging-newline2.jpg

Issues

  • When moving down a line, you can't get the first character to be lower-case.

Further Development

  • I'm sure this is quite simple, but as I said before, I haven't put too much time into this yet... It would be really nice if we could use a SHIFT+ENTER to type a newline, and only pressing ENTER would send the message as it does now. That way, everybody wins.

Author(s)

  • xluryan