|
Determine if javascript is available using jQuery cookie plugin
--------------------------------------------------------------- Key: OFBIZ-4121 URL: https://issues.apache.org/jira/browse/OFBIZ-4121 Project: OFBiz Issue Type: Sub-task Components: framework Affects Versions: SVN trunk Reporter: Jacques Le Roux Priority: Minor Not depend on the javascripEnabled=Y parameter passed from the login URL (it's stored in the session) to determine if we use javascript or not. But to use jQuery cookie plugin to test if we can create a cookie, else we know that javascrip is not available -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
[ https://issues.apache.org/jira/browse/OFBIZ-4121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12982705#action_12982705 ] Jacques Le Roux commented on OFBIZ-4121: ---------------------------------------- I think it's possible using http://download.oracle.com/javase/6/docs/technotes/guides/scripting/programmer_guide/index.html#evalfile? We need to load jQuery and the cookie plugin before. So we would need to have the last jquery version concatened with the last version of the cookie plugin (we have them at hand) and after an expression like jQuery.cookie("javascripEnabled", "just testing", { path: '/' } concatened. It should work, we have then to test if the cookie has just been created. Seems doable, to be revisited... > Determine if javascript is available using jQuery cookie plugin > --------------------------------------------------------------- > > Key: OFBIZ-4121 > URL: https://issues.apache.org/jira/browse/OFBIZ-4121 > Project: OFBiz > Issue Type: Sub-task > Components: framework > Affects Versions: SVN trunk > Reporter: Jacques Le Roux > Priority: Minor > > Not depend on the javascripEnabled=Y parameter passed from the login URL (it's stored in the session) to determine if we use javascript or not. But to use jQuery cookie plugin to test if we can create a cookie, else we know that javascrip is not available -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12982742#action_12982742 ] Adrian Crum commented on OFBIZ-4121: ------------------------------------ Jacques, How would this method be any different than the one we use now? You're still running a script that works only when JavaScript is enabled. > Determine if javascript is available using jQuery cookie plugin > --------------------------------------------------------------- > > Key: OFBIZ-4121 > URL: https://issues.apache.org/jira/browse/OFBIZ-4121 > Project: OFBiz > Issue Type: Sub-task > Components: framework > Affects Versions: SVN trunk > Reporter: Jacques Le Roux > Priority: Minor > > Not depend on the javascripEnabled=Y parameter passed from the login URL (it's stored in the session) to determine if we use javascript or not. But to use jQuery cookie plugin to test if we can create a cookie, else we know that javascrip is not available -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12982763#action_12982763 ] Jacques Le Roux commented on OFBIZ-4121: ---------------------------------------- Now it's arbitrary, it's set on an URL when login but does not determine really if javascript is enabled (usable actually) or not. The code is (LoginWorker.login[450...]) {code} // check on JavaScriptEnabled String javaScriptEnabled = "N"; if ("Y".equals(request.getParameter("JavaScriptEnabled"))) { javaScriptEnabled = "Y"; } {code} With the change above, we will now if we can really use javascript or not (test: can we create a cookie using javacscript and check it's there locally still using javascript). BTW there is maybe an easier way than creating a local cookie, just a quick test with an exception? > Determine if javascript is available using jQuery cookie plugin > --------------------------------------------------------------- > > Key: OFBIZ-4121 > URL: https://issues.apache.org/jira/browse/OFBIZ-4121 > Project: OFBiz > Issue Type: Sub-task > Components: framework > Affects Versions: SVN trunk > Reporter: Jacques Le Roux > Priority: Minor > > Not depend on the javascripEnabled=Y parameter passed from the login URL (it's stored in the session) to determine if we use javascript or not. But to use jQuery cookie plugin to test if we can create a cookie, else we know that javascrip is not available -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12982764#action_12982764 ] Jacques Le Roux commented on OFBIZ-4121: ---------------------------------------- We will then be able to inform the user about it by a way or another > Determine if javascript is available using jQuery cookie plugin > --------------------------------------------------------------- > > Key: OFBIZ-4121 > URL: https://issues.apache.org/jira/browse/OFBIZ-4121 > Project: OFBiz > Issue Type: Sub-task > Components: framework > Affects Versions: SVN trunk > Reporter: Jacques Le Roux > Priority: Minor > > Not depend on the javascripEnabled=Y parameter passed from the login URL (it's stored in the session) to determine if we use javascript or not. But to use jQuery cookie plugin to test if we can create a cookie, else we know that javascrip is not available -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12982773#action_12982773 ] Jacques Le Roux commented on OFBIZ-4121: ---------------------------------------- Ha sorry, I did miss this snippet in login.ftl, you mean ? {code} <script language="JavaScript" type="text/javascript"> document.loginform.JavaScriptEnabled.value = "Y"; <#if focusName> document.loginform.USERNAME.focus(); <#else> document.loginform.PASSWORD.focus(); </#if> </script> {code} But then I wonder why I had to put in into my local login URL *to have javascript always correctly working* and also why it's on the OFBIz main site URL to trunk demo which is https://demo-trunk.ofbiz.apache.org/catalog/control/login/main?USERNAME=flexadmin&PASSWORD=ofbiz&JavaScriptEnabled=Y > Determine if javascript is available using jQuery cookie plugin > --------------------------------------------------------------- > > Key: OFBIZ-4121 > URL: https://issues.apache.org/jira/browse/OFBIZ-4121 > Project: OFBiz > Issue Type: Sub-task > Components: framework > Affects Versions: SVN trunk > Reporter: Jacques Le Roux > Priority: Minor > > Not depend on the javascripEnabled=Y parameter passed from the login URL (it's stored in the session) to determine if we use javascript or not. But to use jQuery cookie plugin to test if we can create a cookie, else we know that javascrip is not available -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12982776#action_12982776 ] Adrian Crum commented on OFBIZ-4121: ------------------------------------ The script in the login screen is what I was referring to. If JavaScript is turned off, the JavaScriptEnabled field will not be set to "Y". It's an easy way to determine if JavaScript is enabled. If a user has JavaScript enabled, then "JavaScriptEnabled=Y" will be added to the login request URL. That is why you need to include it in any URL that bypasses the login screen. Setting a cookie and then testing its existence is another way to do the same thing, but It's not any easier. > Determine if javascript is available using jQuery cookie plugin > --------------------------------------------------------------- > > Key: OFBIZ-4121 > URL: https://issues.apache.org/jira/browse/OFBIZ-4121 > Project: OFBiz > Issue Type: Sub-task > Components: framework > Affects Versions: SVN trunk > Reporter: Jacques Le Roux > Priority: Minor > > Not depend on the javascripEnabled=Y parameter passed from the login URL (it's stored in the session) to determine if we use javascript or not. But to use jQuery cookie plugin to test if we can create a cookie, else we know that javascrip is not available -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux closed OFBIZ-4121. ---------------------------------- Resolution: Not A Problem Ho, I think I know why now (though I was not able to reproduce). I was logging using this URL https://localhost:28443/catalog/control/login?USERNAME=admin&PASSWORD=ofbiz, so I guess maybe I was bypassing the login screen hence the JavaScriptEnabled initialisation... Forget it :) > Determine if javascript is available using jQuery cookie plugin > --------------------------------------------------------------- > > Key: OFBIZ-4121 > URL: https://issues.apache.org/jira/browse/OFBIZ-4121 > Project: OFBiz > Issue Type: Sub-task > Components: framework > Affects Versions: SVN trunk > Reporter: Jacques Le Roux > Priority: Minor > > Not depend on the javascripEnabled=Y parameter passed from the login URL (it's stored in the session) to determine if we use javascript or not. But to use jQuery cookie plugin to test if we can create a cookie, else we know that javascrip is not available -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12982787#action_12982787 ] Adrian Crum commented on OFBIZ-4121: ------------------------------------ I agree that it would be helpful to let the user know they will have a better experience if JavaScript is enabled. That information and other helpful tips could be in a Help page that is accessed via the Help link on the Login page. > Determine if javascript is available using jQuery cookie plugin > --------------------------------------------------------------- > > Key: OFBIZ-4121 > URL: https://issues.apache.org/jira/browse/OFBIZ-4121 > Project: OFBiz > Issue Type: Sub-task > Components: framework > Affects Versions: SVN trunk > Reporter: Jacques Le Roux > Priority: Minor > > Not depend on the javascripEnabled=Y parameter passed from the login URL (it's stored in the session) to determine if we use javascript or not. But to use jQuery cookie plugin to test if we can create a cookie, else we know that javascrip is not available -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12982804#action_12982804 ] Jacques Le Roux commented on OFBIZ-4121: ---------------------------------------- So we need to create a specific Help link on the login screen (because the Online Help needs javascript) . Can we simply put a small sentence there? and maybe in the header or footer (if javascript is disabled else nothing) > Determine if javascript is available using jQuery cookie plugin > --------------------------------------------------------------- > > Key: OFBIZ-4121 > URL: https://issues.apache.org/jira/browse/OFBIZ-4121 > Project: OFBiz > Issue Type: Sub-task > Components: framework > Affects Versions: SVN trunk > Reporter: Jacques Le Roux > Priority: Minor > > Not depend on the javascripEnabled=Y parameter passed from the login URL (it's stored in the session) to determine if we use javascript or not. But to use jQuery cookie plugin to test if we can create a cookie, else we know that javascrip is not available -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12982818#action_12982818 ] Adrian Crum commented on OFBIZ-4121: ------------------------------------ Actually, that Help link needs its own Jira issue. You can't view the Help page without being already logged in. Plus, it would preferable if JavaScript wasn't required to get basic help when logging in. > Determine if javascript is available using jQuery cookie plugin > --------------------------------------------------------------- > > Key: OFBIZ-4121 > URL: https://issues.apache.org/jira/browse/OFBIZ-4121 > Project: OFBiz > Issue Type: Sub-task > Components: framework > Affects Versions: SVN trunk > Reporter: Jacques Le Roux > Priority: Minor > > Not depend on the javascripEnabled=Y parameter passed from the login URL (it's stored in the session) to determine if we use javascript or not. But to use jQuery cookie plugin to test if we can create a cookie, else we know that javascrip is not available -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12983037#action_12983037 ] Jacques Le Roux commented on OFBIZ-4121: ---------------------------------------- Adrian, It's not really about "better experience". We should warn them that w/out js they will not be able to achieve some of their goals. There are 444 calls of <a href="javascript: in FTL files. Not all are mandatory (for instance you don't need a lookup to fill a field, same for calendar). But I doubt that in certain cases you can seriously do it without lookups for instance. For security reasons there are 248 actions which needs javascript: in FTL files (ie javascript is mandatory for those actions to work). Just look for <a href="javascript:document. in *.ftl... There are 1353 occurences of the word javascript at all in FTL files, 343 in XML files but there I think it's rarely mandatory. So I really think it's now wishful thinking to hope using OFBIz w/out js enabled... > Determine if javascript is available using jQuery cookie plugin > --------------------------------------------------------------- > > Key: OFBIZ-4121 > URL: https://issues.apache.org/jira/browse/OFBIZ-4121 > Project: OFBiz > Issue Type: Sub-task > Components: framework > Affects Versions: SVN trunk > Reporter: Jacques Le Roux > Priority: Minor > > Not depend on the javascripEnabled=Y parameter passed from the login URL (it's stored in the session) to determine if we use javascript or not. But to use jQuery cookie plugin to test if we can create a cookie, else we know that javascrip is not available -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
| Free forum by Nabble | Edit this page |
