From: "Adrian Crum" <adrian.c...@yahoo.com>
When the JavaScriptEnabled user setting was introduced, there was no way to 
determine if the browser had JavaScript enabled. I
don't know if that has changed recently.

We can use http://plugins.jquery.com/project/Cookie, it's already embeded in 
OFBiz.
1) We try to create a cookie using it
2) We test if the cookie has been just created
3) If yes we can use javascript else not

The only way to test for JavaScript being enabled is to include a small script 
in the login screen that adds the JavaScriptEnabled
parameter to the login form. If the user has JavaScript enabled, then the 
parameter will be included in the login form, and
ultimately in the login request URL.

Yes instead of current "Y".equals(request.getParameter("JavaScriptEnabled") as 
I suggested below

I believe the setting is saved in user preferences, so it is persistent during 
the user's session.

Yes it's is, just under the snippet above, in LoginWorker.login()[456]

If a user has JavaScript enabled when they log in, and then disable it, OFBiz 
won't know about the change - since it is updated
only during login.

This is user's problem; not OFBiz we can't take care of all subtilities. But we 
should explain this to users. We could add an
obivous (colored?) label  in the header (javascript enabled). Then they should 
be aware and it's their responsabilites. BTW I was
surprised that Ryan and you put the access to preferences and languages 
features in the footer. It's not always visible and seems a
bit weird to me

As long as users have the option to turn off JavaScript, then there will be the 
possibility that they will use OFBiz with it
turned off. The OFBiz framework accommodates that: lookups are turned off and 
Ajax requests are converted to a page refresh. So,
OFBiz still works with JavaScript turned off. In addition, the Flat Grey visual 
theme does not require JavaScript.

Yes that a good point for this theme! But again, not all is now working (as 
it's still in R10.04, ie stable demo) see OFBIZ-2413 and
the collapse feature for instance. Also you can't use
* the quick access in Product main page  (- Product Jump -), and
* expand all
* no Lookups
* no calendars
I'm almost sure there are more...

Jacques

-Adrian

--- On Sun, 1/16/11, Jacques Le Roux <jacques.le.r...@les7arts.com> wrote:
Actually on the backend we already
rely heavily on javascript enabled, try to disabled it when
you launch initially with the default
theme...
That's why I asked this question. Moreover sometimes OFBIz
reacts as if javascript was disabled when actually it's not
(not sure why
yet, but have a look at https://issues.apache.org/jira/browse/OFBIZ-2413)

More to the point (your question actually): we could try to
create a cookie using javascript at the beginning of the
session
(LoginWorker.login) and if it's not there we would know
that somehow we can't use it.
Because I have not digged deep but I can't understant why
we use "Y".equals(request.getParameter("JavaScriptEnabled")
there and rely
on it further. It seems to me that it's not reliable.

I think there is more to say about all that. Because if, by
a way or another, we know that it's not usable, then we also
know that
some features are not active (again, for instance
OFBIZ-2413) and we should mark them as disabled, which is
obviously not done at
the moment

Jacques

From: "Adrian Crum" <adrian.c...@yahoo.com>
> How do we determine the user's browser setting?
>
> -Adrian
>
> --- On Sun, 1/16/11, Jacques Le Roux <jacques.le.r...@les7arts.com>
wrote:
>> Hi,
>>
>> What was the intial reason to introduce
JavaScriptEnabled?
>> Should we not rather rely on the browser setting
to set it
>> in user prefs?
>>
>> Thanks
>>
>> Jacques
>>
>>
>
>
>
>









Reply via email to