Difference between revisions of "Messaging Mods"

From WebOS Internals
Jump to navigation Jump to search
(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 /...)
 
 
(34 intermediate revisions by 8 users not shown)
Line 1: Line 1:
 
All files are located in '''/usr/palm/applications/com.palm.app.messaging/'''
 
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>
+
[[Patch Messaging Adding Timestamps to All Received Messages]]
sudo mount -o remount,rw /
 
sudo vi /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
 
/forceSendIfOffline =
 
</pre></code>
 
  
Change the line to true (below) , writequit , remount, reload , enjoy
+
[[Patch Messaging New Cards For Each Conversation]]
  
<code><pre>
+
[[Patch Messaging Character Counter]]
forceSendIfOffline = true;
 
;wq
 
sudo mount -o remount,ro /
 
sudo stop LunaSysMgr ; sudo start LunaSysMgr
 
</pre></code>
 
  
------
+
[[Messaging Mod Force Offline Send Without Dialog]]
  
= Character Counter =
+
[[Patch Messaging Forward Messages]]
 
 
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.
 
 
 
== Configuration ==
 
 
 
''This modification is the same for both files, just inserted on different lines.''<br>
 
'''app/controllers/chatview-assistant.js''' Line 157:<br>
 
'''app/controllers/compose-assistant.js''' Line 115:
 
<code lang="JavaScript"><pre>
 
},
 
charCounter: {
 
charCountContainer: this.controller.get('charCounterContainer'),
 
charCountElement: this.controller.get('charCounter'),
 
setTextFieldValueFn: this.setTextFieldValue.bind(this)
 
</pre></code>
 
 
 
 
 
'''app/utilities/CharacterCounter.js''' Line 40:
 
<code lang="JavaScript"><pre>
 
var charCounterUI = {
 
containerElement: null,
 
valueElement: null
 
};
 
</pre></code>
 
 
 
Line 188:
 
<code lang="JavaScript"><pre>
 
var setCurrentCharCount = function(newCharCount) {
 
if(charCounterUI.valueElement) {
 
if (newCharCount > 0)
 
charCounterUI.valueElement.update(newCharCount);
 
else
 
charCounterUI.valueElement.update('');
 
}
 
if(charCounterUI.containerElement) {
 
if (newCharCount == 0) {
 
if (charCounterUI.containerElement.visible())
 
charCounterUI.containerElement.hide();
 
} else {
 
if (!charCounterUI.containerElement.visible())
 
charCounterUI.containerElement.show();
 
}
 
}
 
};
 
</pre></code>
 
 
 
Line 286:
 
<code lang="JavaScript"><pre>
 
if(params.charCounter) {
 
charCounterUI.containerElement = params.charCounter.charCountContainer;
 
charCounterUI.valueElement = params.charCounter.charCountElement;
 
if(params.charCounter.setTextFieldValueFn) {
 
setTextFieldValueFn = params.charCounter.setTextFieldValueFn;
 
}
 
}
 
</pre></code>
 
 
 
Line 331:
 
<code lang="JavaScript"><pre>
 
setCurrentCharCount(rawCharacterData.count);
 
</pre></code>
 
 
 
 
 
''Again, same code for both files, inserted on different lines.''<br>
 
'''app/views/chatview/chatview-scene.html''' Line 25:<br>
 
'''app/views/compose/compose-scene.html''' Line 8:
 
<code lang="HTML"><pre>
 
<div id="charCounterContainer">
 
<div id="charCounter">
 
</div>
 
</div>
 
</pre></code>
 
 
 
 
 
'''stylesheets/messaging.css''' Line 839:
 
<code lang="CSS"><pre>
 
#messageContainer #charCounterContainer {
 
line-height: 20px;
 
display:block;
 
height: 20px;
 
border-width: 0px 10px 0px 9px;
 
-webkit-border-image: url(../images/message-segment-badge.png) 0 10 0 9 stretch stretch;
 
position: absolute;
 
z-index: 3;
 
top: 2px;
 
left: 2px;
 
}
 
#messageContainer #charCounterContainer #charCounter {
 
font-size: 12px;
 
font-weight: bold;
 
color: #679BC2;
 
margin: 0px -4px 3px -3px;
 
}
 
</pre></code>
 
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.
 
 
 
== Use ==
 
 
 
This will require LunaSysMgr to be restarted. A rescan will not work. After you've made the modifications listed above, run the following command:
 
<code><pre>
 
pkill LunaSysMgr
 
</pre></code>
 
 
 
== Credits ==
 
 
 
* HattCzech
 

Latest revision as of 00:13, 2 August 2009