Messaging Mods

From WebOS Internals
Revision as of 04:18, 20 July 2009 by HattCzech (talk | contribs) (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 /...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

All files are located in /usr/palm/applications/com.palm.app.messaging/

Force Message send to an offline user without question dialog box.

sudo mount -o remount,rw /
sudo vi /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
/forceSendIfOffline =

Change the line to true (below) , writequit , remount, reload , enjoy

forceSendIfOffline = true; 
;wq 
sudo mount -o remount,ro /
sudo stop LunaSysMgr ; sudo start LunaSysMgr

Character Counter

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.
app/controllers/chatview-assistant.js Line 157:
app/controllers/compose-assistant.js Line 115:

},
charCounter: {
	charCountContainer: this.controller.get('charCounterContainer'),
	charCountElement: this.controller.get('charCounter'),
	setTextFieldValueFn: this.setTextFieldValue.bind(this)


app/utilities/CharacterCounter.js Line 40:

var charCounterUI = {
	containerElement: null,
	valueElement: null
};

Line 188:

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();
		}
	}
};

Line 286:

if(params.charCounter) {
	charCounterUI.containerElement = params.charCounter.charCountContainer;
	charCounterUI.valueElement = params.charCounter.charCountElement;
	if(params.charCounter.setTextFieldValueFn) {
		setTextFieldValueFn = params.charCounter.setTextFieldValueFn;
	}						
}

Line 331:

setCurrentCharCount(rawCharacterData.count);


Again, same code for both files, inserted on different lines.
app/views/chatview/chatview-scene.html Line 25:
app/views/compose/compose-scene.html Line 8:

<div id="charCounterContainer">
	<div id="charCounter">
	</div>
</div>


stylesheets/messaging.css Line 839:

#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;
}

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:

pkill LunaSysMgr

Credits

  • HattCzech