RE: t5: 5.2.4 and IE8

2011-01-25 Thread Wechsung, Wulf
Hello Donny, Hello Angelo,

today I faced exactly the same issue and wasted hours on google before finding 
and implementing your fix. Thanks for sharing!

IE8 really is a piece of work ... wasted hours yesterday trying to force it to 
not display my intranet site in compatibility mode because the meta tag that 
should do this doesn't work. The solution for this btw is to set a header via 
RequestFilter:

In service():
response.setHeader(X-UA-Compatible, IE=8);


Once I accomplished that, the Javascript errors started to appear ... 

I know it's not exactly t5-only specific but maybe there could be a section on 
the t5 site IE8 and you that collects these workarounds.


Kind Regards,
Wulf

-Original Message-
From: Donny Nadolny [mailto:donny.nado...@gmail.com] 
Sent: Dienstag, 18. Januar 2011 14:06
To: Tapestry users
Subject: Re: t5: 5.2.4 and IE8

Hi Angelo,

I had this exact problem - jQuery and Prototype don't work out in IE8 (I
vaguely remember reading something about IE8 trying to be smart and load/run
scripts in parallel, which cause problems). Sometimes prototype code would
run, but $ would be referencing jQuery even though I had called noConflict
on jQuery.

Here's my solution, which I'm using in my app right now:
 - Download the un-minified source of jQuery, whichever version you're using
 - Modify it so that it never assigns the $ variable in the first place (in
version 1.4.3 it's line 901: return (window.jQuery = window.$ = jQuery);
just remove the  = window.$ part.
 - Minify it (I used yahoo's javascript compressor -
http://developer.yahoo.com/yui/compressor/)
And then everything works.

You can grab it from my site if you like (
http://www.deliverthedeals.com/js/jquery-1.4.3.min.js) to verify that it
works. My version has an extra line at the end though, which assigns jQuery
to $j.

Donny

On Tue, Jan 18, 2011 at 6:09 AM, Angelo C. angelochen...@gmail.com wrote:


 Thanks for the code. It seems to me, T5.2.4 app with jQuery will fail in IE
 8, from what I found out in Google, running jQuery's noConflict() ahead of
 Prototype might solve the problem, but with this issue:
 https://issues.apache.org/jira/browse/TAP5-1416 , jQuery is not combined
 into the single js file, there is no way to call nonConflict() ahead of
 Prototype, that seems the problem.
 --
 View this message in context:
 http://tapestry.1045711.n5.nabble.com/t5-5-2-4-and-IE8-tp3345797p3346002.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: t5: 5.2.4 and IE8

2011-01-19 Thread LLTYK

I suspect you simply need to add noConflict to the end of the jquery js
(without having to reminify). As long as it is in the same file it'll
satisfy IE8.
-- 
View this message in context: 
http://tapestry-users.832.n2.nabble.com/t5-5-2-4-and-IE8-tp5934819p5940730.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: t5: 5.2.4 and IE8

2011-01-19 Thread Donny Nadolny
That's how I had it before, it doesn't work. I tried adding it to the end of
the normal minified jQuery, and that worked on most browsers (I tested FF
3.6, IE 6, IE 7, and some version of chrome), but it doesn't work on IE 8. I
got errors in Tapestry's JS when jQuery was included even with noConflict,
and it seems like Angelo experienced it too.

On Wed, Jan 19, 2011 at 1:10 PM, LLTYK ll...@mailinator.com wrote:


 I suspect you simply need to add noConflict to the end of the jquery js
 (without having to reminify). As long as it is in the same file it'll
 satisfy IE8.
 --
 View this message in context:
 http://tapestry-users.832.n2.nabble.com/t5-5-2-4-and-IE8-tp5934819p5940730.html
 Sent from the Tapestry Users mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org




Re: t5: 5.2.4 and IE8

2011-01-18 Thread Joost Schouten (ml)

 Haven't tested it but something like this will probably do the trick:

@AfterRender
private void afterRender(MarkupWriter writer) {
Element foundIEMode = 
writer.getDocument().find(html/head/meta[@http-equiv='X-UA-Compatible']);

Element head = writer.getDocument().find(html/head);
if(foundIEMode != null) {
foundIEMode.moveToTop(head);
}
}

Cheers,
Joost

On 18/01/11 9:24 AM, Angelo C. wrote:

Hi,

after upgrading, my app has problem with IE8 all the time, I need to put
this as the first entry in the head section:

  meta http-equiv=X-UA-Compatible content=IE=EmulateIE7 /

but T5.2.4 always has scripts inserted first:

  script
src=/tapestry5-hotel-booking/assets/1.2-SNAPSHOT/stack/en/core.js...

any approach to force that meta tag to be the first? Thanks,

Angelo





-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: t5: 5.2.4 and IE8

2011-01-18 Thread Joost Schouten (ml)

 I did test it now and it doesn't work. The code should have been:

@AfterRender
private void afterRender(MarkupWriter writer) throws JaxenException {

Element foundIEMode = 
TapestryXPath.xpath(html/head/meta[@http-equiv='X-UA-Compatible']).selectSingleElement(writer.getDocument());

Element head = writer.getDocument().find(html/head);
if(foundIEMode != null) {
foundIEMode.moveToTop(head);
}
}

But that still doesn't work as like you said the css and js are added to 
the page at a later stage in the rendering phase. Sounds like you need 
to do the reordering after the css/js is added. I guess you can decorate 
the service which does this. Unfortunatly I don't know where this is 
done of the top of my head. Have a look at the source or maybe someone 
else can comment.


Good luck,
Joost


On 18/01/11 9:50 AM, Joost Schouten (ml) wrote:

 Haven't tested it but something like this will probably do the trick:

@AfterRender
private void afterRender(MarkupWriter writer) {
Element foundIEMode = 
writer.getDocument().find(html/head/meta[@http-equiv='X-UA-Compatible']);

Element head = writer.getDocument().find(html/head);
if(foundIEMode != null) {
foundIEMode.moveToTop(head);
}
}

Cheers,
Joost

On 18/01/11 9:24 AM, Angelo C. wrote:

Hi,

after upgrading, my app has problem with IE8 all the time, I need to put
this as the first entry in the head section:

meta http-equiv=X-UA-Compatible content=IE=EmulateIE7 /

but T5.2.4 always has scripts inserted first:

  script
src=/tapestry5-hotel-booking/assets/1.2-SNAPSHOT/stack/en/core.js...

any approach to force that meta tag to be the first? Thanks,

Angelo







-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: t5: 5.2.4 and IE8

2011-01-18 Thread Angelo C.

Thanks for the code. It seems to me, T5.2.4 app with jQuery will fail in IE
8, from what I found out in Google, running jQuery's noConflict() ahead of
Prototype might solve the problem, but with this issue:
https://issues.apache.org/jira/browse/TAP5-1416 , jQuery is not combined
into the single js file, there is no way to call nonConflict() ahead of
Prototype, that seems the problem.
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/t5-5-2-4-and-IE8-tp3345797p3346002.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: t5: 5.2.4 and IE8

2011-01-18 Thread Donny Nadolny
Hi Angelo,

I had this exact problem - jQuery and Prototype don't work out in IE8 (I
vaguely remember reading something about IE8 trying to be smart and load/run
scripts in parallel, which cause problems). Sometimes prototype code would
run, but $ would be referencing jQuery even though I had called noConflict
on jQuery.

Here's my solution, which I'm using in my app right now:
 - Download the un-minified source of jQuery, whichever version you're using
 - Modify it so that it never assigns the $ variable in the first place (in
version 1.4.3 it's line 901: return (window.jQuery = window.$ = jQuery);
just remove the  = window.$ part.
 - Minify it (I used yahoo's javascript compressor -
http://developer.yahoo.com/yui/compressor/)
And then everything works.

You can grab it from my site if you like (
http://www.deliverthedeals.com/js/jquery-1.4.3.min.js) to verify that it
works. My version has an extra line at the end though, which assigns jQuery
to $j.

Donny

On Tue, Jan 18, 2011 at 6:09 AM, Angelo C. angelochen...@gmail.com wrote:


 Thanks for the code. It seems to me, T5.2.4 app with jQuery will fail in IE
 8, from what I found out in Google, running jQuery's noConflict() ahead of
 Prototype might solve the problem, but with this issue:
 https://issues.apache.org/jira/browse/TAP5-1416 , jQuery is not combined
 into the single js file, there is no way to call nonConflict() ahead of
 Prototype, that seems the problem.
 --
 View this message in context:
 http://tapestry.1045711.n5.nabble.com/t5-5-2-4-and-IE8-tp3345797p3346002.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org




Re: t5: 5.2.4 and IE8

2011-01-18 Thread Angelo C.

works! you saved my day, thanks for sharing!
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/t5-5-2-4-and-IE8-tp3345797p3346241.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org