From: Simon M. (JIRA) <jir...@ob...> - 2009-03-06 10:44:34
|
Patches to fix javascript detection ----------------------------------- Key: WONDER-240 URL: http://issues.objectstyle.org/jira/browse/WONDER-240 Project: Project Wonder Issue Type: Improvement Reporter: Simon McLean Assigned To: Anjo Krank Attachments: ERXComponent_Patch.txt, ERXDirectAction_Patch.txt, ERXSession_Patch.txt Attached are 3 patches to fix javascript detection plus a tiny image that is needed to in ERExtensions web server resources to make it all work. Quick overview of the changes: The old way of doing it has been stripped completely (which anjo confirmed wasn't working anyway!). The new way works by inserting a <noscript> tag into the end of the response document (done in appendToResponse of ERXComponent) that contains an img whose src tag is bound to a direct action (which is in ERXDirectAction) and which returns a transparent pixel image. When the user has javascript disabled this tag is rendered and hence the image is fetched and the javaScriptEnabled var in ERXSession is toggled to false. Once the var is false, the <noscript> tag is no longer inserted. Instead, a <script> tag is inserted which writes an img tag into the document whose src is the same DA, but with a value to indicated that js is enabled. This is so that if the user decides to switch js on, this script is fired and hence the var in ERXSession get's updated. All of this can be switched on with this property: er.component.jsDetect=true -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.objectstyle.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |