Reply
Thread Tools
Posts: 6 | Thanked: 4 times | Joined on Jan 2010
#81
Great work with the custmiisation- I also prefer the first config.

However, I havent seen any comments about the date and time order of the sms messages. I find it annoying that the most recent messages appear at the bottom of the screen.

I find that most email, text applications ( even bank statements ) have the most recent entry/message at the top of the screen.

Any ideas on changing the chronological order.. most recent on top?
 
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#82
Originally Posted by Schturman View Post
Thanks

I need write something like this (for bicolored shadow) ?:
sorry if my post was too unclear.
i'll try to make it more precise:

Code:
/* shadow with edged shape - right 3px and below 2px */
text-shadow:black 3px 2px;

/*shadow with round shape - same as above plus 4px cross-fade effect (the transition to background/second shadow looks smoother) */
text-shadow:black 3px 2px 4px;

/* two shadows - 5px transition black in red shadow */
text-shadow:black 0 0 5px, red 5px 5px 3px;
best is to add these lines anywhere on top of the block.

if that doesn't work maybe your placement isn't that good, try some lines below. (don't know why but it seems to be a little bit *****y *g*)
if some css-command doesn't work at all after all. the function could not be available in the version rtcomm uses.



Originally Posted by claud001 View Post
Great work with the custmiisation- I also prefer the first config.

However, I havent seen any comments about the date and time order of the sms messages. I find it annoying that the most recent messages appear at the bottom of the screen.

I find that most email, text applications ( even bank statements ) have the most recent entry/message at the top of the screen.

Any ideas on changing the chronological order.. most recent on top?
of course that's possible. you have to edit the js-file.
first of all there is a block "flushBuffer" for making a group of the latest messages (here you can change the load-behaviour too i guess). the second one is named "onScroll" which adds more messages to the first group if you're starting to scroll around:

Code:
/*
 * Flushes the given amount of messages from the buffer to renderer
 */
function
MessagingWidgetsRenderer_flushBuffer (amount)
{
    if (messagesBuffer.length > 0) {
        if (amount < 0)
            amount = messagesBuffer.length;
        var fragment = document.createDocumentFragment();
        for (var i = 0; i < amount; i++) {
            if (messagesBuffer.length <= 0)
                break;

            var item = messagesBuffer.shift();
            new_message = MessagingWidgetsRenderer_messageNode (item, true);

            if (fragment.childNodes.length > 0)
                fragment.insertBefore(new_message, fragment.firstChild);
            else
                fragment.appendChild(new_message);
        }

        /* Restore scroll position */
        var savedScrollPos =
            document.body.scrollHeight - window.pageYOffset;
        document.body.insertBefore(fragment, document.body.firstChild);
        window.sizeToContent();
        window.scrollTo(0, (document.body.scrollHeight - savedScrollPos));
    }
}

/* Scroll event handler to potentially add more past history */
function
MessagingWidgetsRenderer_onScroll ()
{
    MessagingWidgetsRenderer_clearHighlight();

    /* Buffer flushing if there isn't already one running. */
    if (window.pageYOffset < 100 && messagesBuffer.length > 0) {

        /* Add a page of messages (about 4 screen-full) to renderer */
        MessagingWidgetsRenderer_flushBuffer(HISTORY_PAGE_SIZE);
    }

    /* If we run out of messages in buffer and history hasn't finished,
     * request for more
     */
    if (messagesBuffer.length == 0 &&
        myBatchRequested == HISTORY_FETCHING_NOREQUEST &&
        myBatchesAdded > 0)
    {
        myBatchRequested = HISTORY_BATCH_SIZE;
        alert("history-request:" + HISTORY_BATCH_SIZE);
    }
}
these to blocks work with two other functions: "addMessage" which will make a 'screenfull' message-buffer and "batchAdded" for adding additional messages for scrolling (as far as i understand the code):

Code:
/**
 * MessagingWidgetsRenderer_addMessage:
 * @type:             Type of the message (normal/action/notice/autoreply)
 * @time_str:         The time string to show in the screen
 * @delivery_str:     The delivery time string to possibly show in the screen
 * @name_str:         The name string to show in the screen
 * @message_str:      The actual message to show
 * @self:             TRUE if message is from self
 * @id_str:           The ID of the message for access
 * @avatar:           path(/url?) to avatar image
 * @presence:         presence icon of sender
 * @business_icon:    path to business card icon
 * @status_icon:      path to message status icon (pending/failed)
 * @contact_info_str: Additional contact information
 * @add_to_top:       Add the new message to the top of the list
 *
 * Queues messages to buffer and triggers flush schedule. Also forces
 * an immediate flush if there are 8 messages already in buffer for
 * the first time. It's a screenful of messages shown to the user in
 * first opportunity.
 **/
function
MessagingWidgetsRenderer_addMessage (
    type, time_str, delivery_str, name_str, message_str, self, id_str,
    avatar, presence, business_icon, status_icon, contact_info_str, add_to_top)
{
    var item =
        new MessagingWidgetsRenderer_messageObject (type, time_str,
                                                    delivery_str,
                                                    name_str, message_str,
                                                    self, id_str, avatar,
                                                    presence, business_icon,
                                                    status_icon,
                                                    contact_info_str);

    if (add_to_top) {
        /* Queue the top (history) message in buffer. */
        messagesBuffer[messagesBuffer.length] = item;

        /* Force flush if there's already screenful of messages to show for
         * the first time.
         */
        if (firstFlush == true &&
            messagesBuffer.length >= HISTORY_SCREENFULL_SIZE)
        {
            firstFlush = false;
            MessagingWidgetsRenderer_flushBuffer(HISTORY_SCREENFULL_SIZE);
      }
    } else {
        /* If the message is bottom, add it directly without queuing. */
        var new_message =
            MessagingWidgetsRenderer_messageNode (item, false);

        var savedScrollPos =
            document.body.scrollHeight - window.pageYOffset;
        document.body.appendChild (new_message);

        /* In case, we don't want to scroll down on new incoming messages:
        /* window.scrollTo(0, (document.body.scrollHeight - savedScrollPos));
         */

        /* In case, we want to only scroll down on incoming message when
         * scrollbar is close by: if (savedScrollPos < 100) ...
         */

        /* For now, scroll down anyways.*/
        window.sizeToContent();
        new_message.scrollIntoView (false);
    }
}

/**
 * MessagingWidgetsRenderer_batchAdded:
 * @messages_fetched: Number of messages fetched from log. Note that all
 *                    fetched messages are not necessarily added to the view.
 *
 * History batch has been added to renderer
 **/
function MessagingWidgetsRenderer_batchAdded (messages_fetched)
{
    myBatchesAdded++;

    /* Force flush if there hasn't been anything shown yet.
     * This happens because the first batch was smaller than
     * HISTORY_SCREENFULL_SIZE.
     */
    if (firstFlush == true && messagesBuffer.length >= 0) {
        firstFlush = false;
        MessagingWidgetsRenderer_flushBuffer(-1);
    }

    /* If there was no request made, then it's the first batch pushed.
     * The subsequent batch is requested after a delay of 1s to allow
     * first screenfull to be rendered properly.
     */
    if (myBatchRequested == HISTORY_FETCHING_NOREQUEST) {
        if (flushTimeout != 0)
            clearTimeout(flushTimeout);
        flushTimeout = setTimeout("MessagingWidgetsRenderer_onScroll();",
                                  1000);
    } else if (myBatchRequested > 0) {
        /* If there was a request, check if we got everything.
         * If fetched messages is the amount requested, we could
         * continue fetching more, otherwise there is no more history
         * to fetch.
         */
        if (messages_fetched < myBatchRequested) {
            myBatchRequested = HISTORY_FETCHING_DONE; /* No more history */
        } else {
            myBatchRequested = HISTORY_FETCHING_NOREQUEST; /* Batch delivered */
        }

        /* Check if anything needs to be rendered at this scroll position */
        MessagingWidgetsRenderer_onScroll();
    }
}

Last edited by b666m; 2010-01-27 at 12:52.
 

The Following 2 Users Say Thank You to b666m For This Useful Post:
Posts: 5 | Thanked: 0 times | Joined on Jan 2010
#83
I have managed to configure colours, style etc, but cannot get my own avatar to work.
I have taken an image, resized it to 64px by 64px and saved it 'avatar.png'. I then copied it into (...html) folded and renamed it 'avatar.png' because it was named 'avatar.png.jpg'. I cannot find to code where to link this picture to my own avatar.
Can any one help?
 
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#84
Originally Posted by Coolmac View Post
Can any one help?
hehe ^^
this was just a dirty trick because i didn't get the normal pic-link and absolute paths to work.
so i just wrote a short piece of code which loads the "avatar.png" if the message came from me
some sites back there should be a SMSConversation.zip which contains the edited .js-file for loading the picture.
 
Posts: 5 | Thanked: 0 times | Joined on Jan 2010
#85
I re-saved the.js file and created a new 'avatar.png' but still doesn't work. Did you modify line 420?
 
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#86
Originally Posted by Coolmac View Post
I re-saved the.js file and created a new 'avatar.png' but still doesn't work. Did you modify line 420?
this is the code:

Code:
    /* Creation of an avatar image */
    if (item.self == false) { 
        if (item.avatar != "") {
            avatar_img.style.backgroundImage =  "url('"+item.avatar+"')";
            avatar_img.onclick = MessagingWidgetsRenderer_avatarClicked;
        }
    } 
    else {
	avatar_img.style.backgroundImage =  "url('avatar.png')";      
	avatar_img.onclick = MessagingWidgetsRenderer_avatarClicked;
   }
i just added a new else-case
maybe you could try how the path in "url('...')" has to be to make it work
(tried file:///user/.... and file://user ... and /user/ ... and /user/ ... nothing happened )
 
Posts: 8 | Thanked: 8 times | Joined on Jan 2010 @ Russia, Moscow
#87
I use this style for grouping IM messages by senders.
Code:
div.Self + div.Self img.MessageAvatar,
div.Other + div.Other img.MessageAvatar,
div.Other + div.Other .MessageNameField,
.Self .MessageNameField /* hidden your name all the time */
 {
  display: none;
}
Add it to the bottom of /urs/share/rtcom-massaging-ui/html/MessagingWidgetsChatConversation.css

I my example (in attachment) i additionally use styles for hidden borders and margins/paddings.

P.S. Sorry for possible grammatical errors. And maybe this advise has been here, but i cant read all of posts
Attached Images
 

Last edited by termi_uc; 2010-01-28 at 09:35.
 
Posts: 5 | Thanked: 0 times | Joined on Jan 2010
#88
Finally i've cracked it. Just renamed the image and changed the code. For some strange reason it worked.
Thanks b666m for your help. I hate to be beaten by things like this.
 
Posts: 8 | Thanked: 8 times | Joined on Jan 2010 @ Russia, Moscow
#89
Finally i made what i like - it simple and it black, with mutable background and messages grouping by sender
Check it out, it's looks realy nice

Hint: All you need is download attach zip and place all files from it (exept *NOT_OPTIMIZE.css) to /usr/share/rtcom-messaging-ui/html

MessagingWidgetsChatConversation_NOT_OPTIMIZE.css is for those peoples why want to edit it





how worse my english is? sorry
Attached Files
File Type: zip css_conv.zip (35.0 KB, 444 views)

Last edited by termi_uc; 2010-01-29 at 11:16.
 

The Following 6 Users Say Thank You to termi_uc For This Useful Post:
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#90
Originally Posted by b666m View Post
sorry if my post was too unclear.
i'll try to make it more precise:

Code:
/* shadow with edged shape - right 3px and below 2px */
text-shadow:black 3px 2px;

/*shadow with round shape - same as above plus 4px cross-fade effect (the transition to background/second shadow looks smoother) */
text-shadow:black 3px 2px 4px;

/* two shadows - 5px transition black in red shadow */
text-shadow:black 0 0 5px, red 5px 5px 3px;
best is to add these lines anywhere on top of the block.

if that doesn't work maybe your placement isn't that good, try some lines below. (don't know why but it seems to be a little bit *****y *g*)
if some css-command doesn't work at all after all. the function could not be available in the version rtcomm uses.
Thank you very much. It's work how I wanted
 
Reply

Tags
bada rox, his lunchbox

Thread Tools

 
Forum Jump


All times are GMT. The time now is 12:55.