Renamed more-icons-per-row-5x4-flare576
[webos-internals:adamrmcd-modifications.git] / messaging / messaging-enter-newline.patch
1 Patch to messaging to make the enter key insert a new-line character rather than sending the message.
2 Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
3 ===================================================================
4 --- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
5 +++ /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
6 @@ -87,7 +87,7 @@ var ChatviewAssistant = Class.create({
7                 this.attachFilePicker = this.attachFilePicker.bind(this);
8                 this.handleCancelAttachment = this.resetTextBox.bind(this, false);
9                 this.handleTextAreaChange = this.handleTextAreaChange.bind(this);
10 -               this.handleTextAreaKeyUp = this.handleTextAreaKeyUp.bind(this);
11 +               // this.handleTextAreaKeyUp = this.handleTextAreaKeyUp.bind(this);
12                 this.handleScreenStateChange = this.handleScreenStateChange.bind(this);
13                 this.handleFocus = this.handleFocus.bind(this);
14                 this.handleLoseFocus = this.handleLoseFocus.bind(this);
15 @@ -103,7 +103,7 @@ var ChatviewAssistant = Class.create({
16                         hintText: $L('Enter message here...'),
17                         multiline: true,
18                         focus: false,
19 -                       enterSubmits: true,
20 +                       enterSubmits: false,
21                         textFieldName: "messageTextElement",
22                         className: " ",
23                         changeOnKeyPress: true
24 @@ -146,7 +146,7 @@ var ChatviewAssistant = Class.create({
25                 
26                 this.cancelAttachment.observe(Mojo.Event.tap, this.handleCancelAttachment);
27         
28 -               this.messageTextElement.observe('keyup', this.handleTextAreaKeyUp);
29 +               // this.messageTextElement.observe('keyup', this.handleTextAreaKeyUp);
30                 this.messageTextWidget.observe(Mojo.Event.propertyChange, this.handleTextAreaChange);
31  
32                 // observe keydown/keyup on the text field WIDGET to handle height changes due to text forcing it to resize
33 @@ -207,7 +207,7 @@ var ChatviewAssistant = Class.create({
34                 this.messageTextWidget.stopObserving('keydown', this.handleTextFieldResize);
35                 this.messageTextWidget.stopObserving('keyup', this.handleTextFieldResize);
36                 this.messageTextWidget.stopObserving(Mojo.Event.propertyChange, this.handleTextAreaChange);
37 -               this.messageTextElement.stopObserving('keyup', this.handleTextAreaKeyUp);
38 +               // this.messageTextElement.stopObserving('keyup', this.handleTextAreaKeyUp);
39                 this.Messaging.DisplayState.stopObserving(this.handleScreenStateChange);
40                 this.controller.document.removeEventListener(Mojo.Event.stageActivate, this.handleFocus, false);
41                 this.controller.document.removeEventListener(Mojo.Event.stageDeactivate, this.handleLoseFocus, false);
42 @@ -1749,12 +1749,12 @@ var ChatviewAssistant = Class.create({
43                 } 
44         },
45  
46 -       handleTextAreaKeyUp: function(event) {
47 +       /* handleTextAreaKeyUp: function(event) {
48                 if (event && Mojo.Char.isEnterKey(event.keyCode)) {
49                         this.considerForSend();
50                         Event.stop(event);
51                 }               
52 -       },
53 +       }, */
54  
55         handleTextAreaChange: function() {
56                 if (this.messageTextElement && this.messageTextElement.value == '') {
57 Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
58 ===================================================================
59 --- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
60 +++ /usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
61 @@ -66,7 +66,7 @@ var ComposeAssistant = Class.create({
62                 this.considerForSend = this.considerForSend.bind(this);
63                 this.attachFilePicker = this.attachFilePicker.bind(this);
64                 this.handleTextAreaChange = this.handleTextAreaChange.bind(this);
65 -               this.handleTextAreaKeyUp = this.handleTextAreaKeyUp.bind(this);
66 +               // this.handleTextAreaKeyUp = this.handleTextAreaKeyUp.bind(this);
67                 this.handleCancelAttachment = this.resetTextBox.bind(this,false);               
68                 this.handleRecipientsChanged = this.handleRecipientsChanged.bind(this);
69         },
70 @@ -99,7 +99,7 @@ var ComposeAssistant = Class.create({
71             hintText: $L('Enter message here...'),
72             multiline: true,
73             focus: false,
74 -           enterSubmits: true,
75 +           enterSubmits: false,
76                 requiresEnterKey: true,
77             modelProperty: "value",
78                 changeOnKeyPress: true
79 @@ -126,7 +126,7 @@ var ComposeAssistant = Class.create({
80         });
81         
82         
83 -       this.messageTextElement.observe('keyup', this.handleTextAreaKeyUp);
84 +       // this.messageTextElement.observe('keyup', this.handleTextAreaKeyUp);
85         this.messageTextWidget.observe(Mojo.Event.propertyChange, this.handleTextAreaChange);
86         
87      // Observe add/delete to the addressing widget
88 @@ -302,12 +302,12 @@ var ComposeAssistant = Class.create({
89                 } 
90         },
91  
92 -       handleTextAreaKeyUp: function(event) {
93 +       /* handleTextAreaKeyUp: function(event) {
94                 if (event && Mojo.Char.isEnterKey(event.keyCode)) {
95                         this.considerForSend();
96                         Event.stop(event);
97                 }               
98 -       },
99 +       }, */
100  
101         handleTextAreaChange: function() {
102                 if (this.messageTextElement && this.messageTextElement.value == '') {
103 @@ -398,7 +398,7 @@ var ComposeAssistant = Class.create({
104        that.controller.stopListening('searchList',event,that.handleRecipientsChanged);
105      });
106         
107 -       this.messageTextElement.stopObserving('keyup', this.handleTextAreaKeyUp);
108 +       // this.messageTextElement.stopObserving('keyup', this.handleTextAreaKeyUp);
109         this.messageTextWidget.stopObserving(Mojo.Event.propertyChange, this.handleTextAreaChange);
110         
111         this.characterCounter.destroy();