Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 2 of 2
Goto page Previous  1, 2
 
Reply with quote Download Post 
Post Re: [SOLVED] Chat Problem With Internet Explorer 
 
spydie wrote: [View Post]
but XP died as well some time ago, if I'm not wrong


That is beside the point of what jefazo666 had to overcome.

And if I'm not wrong - And I usually am - - -

php - mysql trim() is server-side while javascript trim() is client-side so while javascript/ajax is moving along to do some of the processes that php and mysql normally does, IE8 doesn't get upgraded any longer to add any new javascript  processes that comes along.

So all jefazo666 did was to patch, or upgrade IE8 if you wish so that it functions like the latest browsers do.

And as for XP dying some time ago - Vista died a hell of a lot faster as one of MS's worst ever OS's, Win7 wasn't much better and that's probably why there are still so many XP users.  
 



 
mortSend private message  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: [SOLVED] Chat Problem With Internet Explorer 
 
In my opinion winxp keeps it 42% because some reasons:

- People does not know how to change.
- People does not like changes.
- Some user's computers have not hardware enough to support it or they will work slower with all w7 features. My girlfriend is an example of this.
- Winxp is installed in a lot of jobs offices and that users really don't care about upgrade it's computer or simply they are not allowed to do it.


This last reason makes me think that it is impossible that win7 has that 43% of Global users. Really I can't believe this is true, but that was the only study I founded (in spanish) made this year, so I will accept the data.
 



 
jefazo666Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: [SOLVED] Chat Problem With Internet Explorer 
 
I got a bit lost because of XP disquisition.

Can you tell me if your problem is solved or not?
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Chat Problem With Internet Explorer 
 
Yeah, we did get carried away a little - or off-topic as it's generally known.  

But in amongst the "Disquisition" => He fixed it here.

http://www.icyphoenix.com/viewtopic.php?p=57431#p57431
 



 
mortSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Chat Problem With Internet Explorer 
 
Thanks for finding the problem - and the fix...

jefazo666 wrote: [View Post]
I see that you edited your answer. Anyway I will explain this script:

Code: [Download] [Hide] [Select]
if(typeof String.prototype.trim !== 'function') { // If string prototype does not have trim function
          String.prototype.trim = function() { // create trim function for String prototype
            return this.replace(/^\s+|\s+$/g, '');  // implementation with RE for trim function.
          }
    }


I think now is more clear. For understand the RE take a look at wikipedia, because is a bit longer to explain, and my english level is not enough.

I hope again this can help anybody.
I did do fairly extensive testing, with multiple users, and I thought I had tested IE8 standards mode and quirks mode on XP, but that one obviously slipped through...

[Edit]
Since we're using jQuery, the simplest solution is to replace the two offending lines
Code: [Download] [Hide] [Select]
bah.trim()
with
Code: [Download] [Hide] [Select]
$.trim(blah)

[/Edit]

jefazo666 wrote: [View Post]

I would like to add further information:

If you clear the trim() at the lines with the problems (2 in total), the chat works fine in all browsers without adding anything.
The point is that as I said before, I have no Idea about AJAX and maybe you are doing this trim on every message for security reasons. If this is the case, then the best fix is to add the code I posted.
If the only reason is visual design, then is better to clear the trim() calling at line 665 from  ./templates/default/ajax_shoutbox_functions_js.tpl and line 36 of ./templates/default/ajax_shoutbox_js.tpl and the chat will work fine in all browsers too.

I don't know how, but the spaces are cleared the same without the trim().

The checkStatus() function is miscommented, it actually disables the submit button if there *is* a message - once the spaces have been removed. This is simply to stop the user resubmitting the message as Ajax is asynchronous. Once the message has been sent (and a reply given) the message is cleared and the button is re-enabled.

Thanks again,

John
 



 
jhlSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: [SOLVED] Chat Problem With Internet Explorer 
 
Ajax is obviously asynchronous, that's its very meaning (the first A).

For trim, you should usually avoid to monkey patch base classes, but shiming is not a problem.
It's IMHO a better idea to add
Code: [Download] [Hide]
  1. var p; 
  2. (p = String.prototype).trim || (p.trim = function () { return this.replace(/^\s+|\s+$/g, ''); }); 
Than to edit everywhere ;). It should probably be included anyway
 



 
InformproSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: [SOLVED] Chat Problem With Internet Explorer 
 
Informpro wrote: [View Post]
Ajax is obviously asynchronous, that's its very meaning (the first A).

Beware old acronyms! Not necessarily asynchronous, nor XML, but still Javascript!

Informpro wrote: [View Post]
For trim, you should usually avoid to monkey patch base classes, but shiming is not a problem.
It's IMHO a better idea to add
Code: [Download] [Hide]
  1. var p; 
  2. (p = String.prototype).trim || (p.trim = function () { return this.replace(/^\s+|\s+$/g, ''); }); 
Than to edit everywhere ;). It should probably be included anyway

Why bother if there aready is a browser compatible library function? A little refactoring can't be that bad surely?

John
 



 
jhlSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: [SOLVED] Chat Problem With Internet Explorer 
 
Then you're using the wrong acronym :). Use SJAJson for synchronous javascript and json :p (or at least SJAX).
 



 
InformproSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Chat Problem With Internet Explorer 
 
As I said before, I have no idea about AJAX, so I will trust you even if your advice is to put some fuel on server and throw fire on it.

As jhl said, changing the sintax of the trim and use Jquery is better solution, as we don't need to implement the trim function.

The final solution is here:
at line 665 from  ./templates/default/ajax_shoutbox_functions_js.tpl

find
Code: [Download] [Hide] [Select]
var text = inputText.val().trim();

change for
Code: [Download] [Hide] [Select]
var text = $.trim(inputText.val());


at line 36 of ./templates/default/ajax_shoutbox_js.tpl

find
Code: [Download] [Hide] [Select]
submit.attr("disabled", ((text.val().trim() != "") || (focusState == "active")) ? false : true);

change for
Code: [Download] [Hide] [Select]
submit.attr("disabled", (($.trim(text.val()) != "") || (focusState == "active")) ? false : true);


don't use the prototype definition explained above.
 



 
jefazo666Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Chat Problem With Internet Explorer 
 
Exactly. I've sent a pull request to Luca (Mighty Gorgon) on github.

John
 



 
jhlSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Chat Problem With Internet Explorer 
 
Should this be marked solved guys?
 




____________
www.DutchaGoGo.com (development/under construction ...Forever?¿?)
 
Joshua203Send private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Chat Problem With Internet Explorer 
 
Joshua203 wrote: [View Post]
Should this be marked solved guys?
I don't know how many times I did it!    

Did this changes if there is a new answer or something like that?  
 



 
jefazo666Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Chat Problem With Internet Explorer 
 
I don't think so... but thank you very much for marking it  

EDIT:
No, after my post the solved tag stays  
 




____________
www.DutchaGoGo.com (development/under construction ...Forever?¿?)
 
Joshua203Send private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Chat Problem With Internet Explorer 
 
Now merged in Github: https://github.com/MightyGorgon/icy_phoenix/pull/23

John
 



 
jhlSend private message  
Back to topPage bottom
Post new topic  Reply to topic  Page 2 of 2
Goto page Previous  1, 2


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron