• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

IE problems with handleRequest

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
29 posts • Page 2 of 2 • 1, 2

Postby bcc » Wed Oct 18, 2006 10:31 pm

I think it should set canupdatenexttime to true in any case if the command was update.

else if (cmd == "update")
{
this.canupdatenexttime = true;
}
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby bcc » Wed Oct 18, 2006 10:39 pm

Actually, when is handleResponse called?

What if the browser does not get a response from the server for one of the requests? Then canupdatenexttime is never set to true again?
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby phpfreechat » Thu Oct 19, 2006 8:19 am

You are right, it could be a problem, I will use your suggestion :
else if (cmd == "update")
{
this.canupdatenexttime = true;
}

Thank you for correcting my code :)
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby phpfreechat » Thu Oct 19, 2006 8:22 am

bcc wrote:What if the browser does not get a response from the server for one of the requests? Then canupdatenexttime is never set to true again?

If this happend, then it will stop updating the chat ... it could be a problem but what do you suggest to fix that ?
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bcc » Thu Oct 19, 2006 2:13 pm

I guess we would have to mess with xajax libs themselves.

But a simple solution might be to have a timestamp in addition to the canupdatenexttime, and some max value in parameters.
So for the sendRequest for update, we would check both the boolean value and the timestamp of the last time we succesfully got a response for an update request.

So if on the reuqest the value of canupdatenexttime is false, we also check the timestamp, and if it's older than some max... parameter then we would still go ahead and send another request.

That's messy, but I think it would be easier than trying to call the ajax libs and checking if the previous update request completed (or failed).
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby bcc » Thu Oct 19, 2006 2:14 pm

The max... parameter would be something like 2 minutes by default, while the refresh is 5 seconds.

If there is a momentary problem with the access the the server then at least the browser would resume updating the chat 2 minutes later.

This solution sucks, but I don't know more about the libs and the chat itself to suggest anything else :(
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby phpfreechat » Thu Oct 19, 2006 7:55 pm

I like this solution.
Do you have time to work on it ? I'm very busy these days (I'm buying a house) and it would be great to integrate that in the next 1.0-beta7 release.

If you can't, I will do it later. :)
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bcc » Fri Oct 20, 2006 10:56 am

Is the stuff in the trunk much different than beta6?
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby bcc » Fri Oct 20, 2006 10:59 am

I can try.
What's a good place to stick the parameters in? Obviously, I can't reference them from within js files, only from tpl rendered to js with all parameters resolved.

Without it, the max age of the last update would have to be hardcoded.
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby phpfreechat » Fri Oct 20, 2006 2:26 pm

Yes, I suggest you take the lastest version by subversion. See : http://sourceforge.net/svn/?group_id=158880

What's a good place to stick the parameters in?

You can create some attributes in pfcClient javascript class.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bcc » Fri Oct 20, 2006 5:24 pm

How about this?

http://www.goudkov.com/temp/pfc_max_refresh.patch
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby phpfreechat » Fri Oct 20, 2006 9:16 pm

Great.
I just integrated your patch!
Thanks you for your help. I think it will work well but I will test it some times on the official demo page before to release the 1.0-beta7 (I need also to fix other small bugs).
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bcc » Fri Oct 20, 2006 9:25 pm

Great. There is also one annoying bug that I submitted through sourceforge. IE doesn't scroll down completely when you have more than 20 messages in the visible buffer.

I use this right now. I still don't get the difference between elttoscroll and this.getChatContentFromTabId(tabid). But that does the job.

Code: Select all
  scrollDown: function(tabid, elttoscroll)
  {
    if (this.getTabId() != tabid)
    {
      if (!this.elttoscroll[tabid]) this.elttoscroll[tabid] = Array();
      this.elttoscroll[tabid].push(elttoscroll);
      return;
    }
    var content = this.getChatContentFromTabId(tabid);
        //scrolls to the bottom of the screen, safer than incremental scrolling with both IE and FF
        var cSH = content.scrollHeight;
        var eSH = elttoscroll.scrollHeight;
        var cST = (content.scrollHeight >= elttoscroll.scrollHeight) ? content.scrollHeight : elttoscroll.scrollHeight;
    content.scrollTop = cST;
    this.scrollpos[tabid] = cST;
  },

I'm not posting a diff because it's just to illustrate a concept.
Aside from making sure it scrolls to the bottom for IE, it also scrolls to the bottom on each new message. It's more annoying if you are trying to read past messages, but I have a lot of older visitors who are not computer savvy. So they don't realize they need to scroll down to read new messages.

In any case, once I understand the code better, I'll probably add a parameter so that chat operators can choose incremental vs total scrolling on each new message. Or maybe you could do that once you have more time :)
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby eber » Fri Dec 08, 2006 9:21 am

Hi I'm using 0.x of the freechat. it also exhibited this scroll problem in both IE6 and 7. Anybody has a code fragment to fix this?

Update: I've updated my code with bcc's code fragment. Now with evey message entered it WILL scroll to the bottom. how ever, the scrolling still "skips" to somewhere in the middle of the textbox, making the chat really disorientating.

Firefox has no such problems though. but most of my users are on IE.
Last edited by eber on Fri Dec 08, 2006 9:26 am, edited 1 time in total.
eber
New member
 
Posts: 1
Joined: Fri Dec 08, 2006 8:50 am
Top

Previous

Post a reply
29 posts • Page 2 of 2 • 1, 2

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 9 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub