ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonatan Soto <seniledemen...@gmail.com>
Subject Re: Excessive jQuery Scripts?
Date Thu, 24 Feb 2011 08:18:22 GMT
Sure.Note that it is WIP. http://test.japanflavour.com/ecomm/traditional

If you navigate through the site you'll find that all the buttons, tabs,
accordions, dialogs, etc. have the same appearance . They can be changed
very easily just setting up the look and feel you prefer on the theme
rolling page (http://jqueryui.com/themeroller/<http://jqueryui.com/themeroller/>),
I put the necessary files I've got in the jquery ui folder. Ex:

<ofbiz-installation>/framework/images/webapp/images/jquery/ui/css/<custom-theme>/jquery-ui-x.x.x.custom.min.css
<ofbiz-installation>/framework/images/webapp/images/jquery/ui/js/jquery-ui-x.x.x.custom.min.js
(if the version is different)

In common-screens for the ecommerce app, the main-decorator is defined  the
js OOTB:
<set field="layoutSettings.javaScripts[+0]"
value="/images/jquery/ui/js/jquery-ui-x.x.x.custom.min.js" global="true"/>

I added  this record to the VISUAL_THEME_RESOURCE table:
| <THEME_ID>   | VT_STYLESHEET         | 06          |
/images/jquery/ui/css/custom-theme/jquery-ui-x.x.x.custom.css |
NULL                | NULL                  | NULL                |
NULL                |

-------------------

BTW, I think we are talking the same thing, as I understood you want to
remove this line because it is not used and I agree. What I don't think is
necessary is to delete the entire ui folder.

It is very versatile since all the jQuery UI widgets have at the bottom of
each documentation page a guideline with the generated css classes. It is
good for override the normal behavior with a little effort.

HTH



On Thu, Feb 24, 2011 at 7:41 AM, Sascha Rodekamp <sascha.rodekamp.lynx.de@
googlemail.com> wrote:

> Hey Joanatan of course it is, but it's not part of the OOTB Ecommerce App
> :-). Maybe you could provide an example implementation; I would love to see
> it!
> But till then I prefer to remove all not needed JS Libs form the main
> decorator. When someone needs jQuery in the ecommerce app he can simply add
> everything he wants but there is no overhead anymore. It's everytime better
> to load JS Libs only in the screens where they are needed and not every
> library in the main decorator. :-)
>
>
>
> @Sam You're welcome.
>
> Have a good day
> Sascha
>
>
> 2011/2/24 Sam Hamilton <sam@sh81.com>
>
> > Many thanks Sascha!
> >
> >
> > On 24 Feb 2011, at 03:34, Sascha Rodekamp wrote:
> >
> > > Hey *,
> > > ok a checked the ecommerce up. And you're right we don't need all the
> > jQuery
> > > UI Stuff. I will remove and committ the changes.
> > >
> > > Thanks Guys
> > > Cheers
> > > Sascha
> > >
> > > 2011/2/23 Jonatan Soto <seniledementia@gmail.com>
> > >
> > >> Hi,
> > >>
> > >> I remember I asked for a similar question some months ago. These are
> my
> > >> conclusions:
> > >>
> > >> AFAIK jQuery UI is not entirely used OOTB in Ofbiz. Those heavy js and
> > css
> > >> files can be reduced a lot if you don't have plans to use all the
> > >> components
> > >> of jQuery UI. If you do, you can customize the theme roller with every
> > >> components you would need such ui core, interactions, widgets and
> > effects.
> > >> It is pretty customizable and allows to select subcomponents of them
> > when
> > >> you finish to custom the theme.
> > >> In my case I've decided to use jQuery UI for theme rolling purposes so
> > all
> > >> the widgets included in the library will be widely altered easily. I
> > just
> > >> added a record for the css to my custom ofbiz theme. I used the one
> I've
> > >> got
> > >> after customization from http://jqueryui.com/themeroller/ and copied
> > into
> > >> ofbiz\framework\images\webapp\images\jquery\ui\css\"custom-theme". If
> > the
> > >> version of the js file is different it's also recommendable to change
> > it.
> > >> It
> > >> is located in ofbiz\framework\images\webapp\images\jquery\ui\js.
> > >>
> > >> HTH
> > >>
> > >> On Wed, Feb 23, 2011 at 10:57 AM, Sam Hamilton <sam@sh81.com> wrote:
> > >>
> > >>> Hi Sascha & Jacques
> > >>>
> > >>> If you view the source of any of the /ecommerce/ pages you should
> see:
> > >>>
> > >>> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
> > >>> <title>Featured Products: OFBiz E-Commerce Store</title>
> > >>> <link rel="shortcut icon" href="/images/ofbiz.ico" />
> > >>> <script type="text/javascript"
> > >>> src="/images/jquery/jquery-1.4.2.min.js"></script>
> > >>> <script type="text/javascript"
> > >>>
> > >>
> >
> src="/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-en_US.js"></script>
> > >>> <script type="text/javascript"
> > >>>
> > >>
> >
> src="/images/jquery/ui/development-bundle/ui/jquery.ui.datepicker.js"></script>
> > >>> <script type="text/javascript"
> > >>>
> src="/images/jquery/plugins/validate/jquery.validate.min.js"></script>
> > >>> <script type="text/javascript"
> > >>> src="/images/jquery/ui/js/jquery-ui-1.8.6.custom.min.js"></script>
> > >>> <script type="text/javascript"
> > >>>
> > >>
> >
> src="/images/jquery/plugins/datetimepicker/jquery-ui-timepicker-addon-0.9.3.min.js"></script>
> > >>> <script type="text/javascript" src="/images/fieldlookup.js"></script>
> > >>> <script type="text/javascript" src="/images/selectall.js"></script>
> > >>> <link rel="stylesheet" href="/ecommerce/images/blog.css"
> > >> type="text/css"/>
> > >>> <link rel="stylesheet" href="/images/ecommain.css" type="text/css"/>
> > >>> <link rel="stylesheet" href="/content/images/contentForum.css"
> > >>> type="text/css"/>
> > >>>
> > >>> I found the 404 because I was running www.webpagetest.org against
> the
> > >> home
> > >>> page and in the waterfall I spotted the 2 jquery files - test results
> > are
> > >>> here if you fancy a distraction for 2 mins
> > >>> http://www.webpagetest.org/result/110223_1A_1N7C/
> > >>>
> > >>> Sam
> > >>>
> > >>>
> > >>>
> > >>> On 23 Feb 2011, at 17:19, Sascha Rodekamp wrote:
> > >>>
> > >>>> Hey Sam, hey Jacques,
> > >>>> i 'm also not sure. But i'll double check this tonight. And if
it is
> > >>> really
> > >>>> obsolete i'll remove it :-)
> > >>>>
> > >>>> Cheers guys
> > >>>>
> > >>>>
> > >>>> 2011/2/23 Jacques Le Roux <jacques.le.roux@les7arts.com>
> > >>>>
> > >>>>> From: "Sam Hamilton" <sam@sh81.com>
> > >>>>>
> > >>>>>> Afraid I don't know how to tell the difference when a script
calls
> > >>> jquery
> > >>>>>> or jquery ui?
> > >>>>>>
> > >>>>>
> > >>>>> Honestly I think we don't use jQuery UI OOTB. You could try
to
> remove
> > >> it
> > >>>>> and see what happens...
> > >>>>>
> > >>>>>
> > >>>>> Sorry don't understand what you mean by "default and handled
> > >> internally"
> > >>> -
> > >>>>>> the page is pointing to a missing script which it might
or might
> not
> > >>> need -
> > >>>>>> again not sure how to tell....
> > >>>>>>
> > >>>>>
> > >>>>> How did you get this URL? The software should not send you
there...
> > >>>>>
> > >>>>> Jacques
> > >>>>>
> > >>>>>
> > >>>>> Sam
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>> On 22 Feb 2011, at 15:43, Jacques Le Roux wrote:
> > >>>>>>
> > >>>>>> I did not check if we use jQuery UI in eCommerce. Indeed
205 913
> > >> bytes
> > >>>>>>> is not negligible, but we should be sure before removing
it that
> we
> > >>> are not
> > >>>>>>> using it OOTB, did you check?
> > >>>>>>> For jquery.ui.datepicker-en_US.js is not provided by
jQuery UI
> > >> because
> > >>>>>>> it's the default and handled internally.
> > >>>>>>>
> > >>>>>>> Jacques
> > >>>>>>>
> > >>>>>>> From: "Sam Hamilton" <sam@sh81.com>
> > >>>>>>>
> > >>>>>>>> Was just running round the ecommerce site when
I noticed that
> both
> > >>>>>>>> jquery-1.4.2.min.js and jquery-ui-1.8.6.custom.min.js
are served
> > >> when
> > >>>>>>>> loading /ecommerce/ pages? Isn't that rather excessive
and only
> > >>>>>>>> jquery-1.4.2.min.js should be called?
> > >>>>>>>>
> > >>>>>>>> On another note
> > >>>>>>>>
> > >>>
> > >>
> >
> http://demo-trunk.ofbiz.apache.org/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-en_US.jsis404ingout
> > .
> > >>>>>>>>
> > >>>>>>>> Sam
> > >>>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>
> > >>>>>
> > >>>>
> > >>>>
> > >>>> --
> > >>>> Sascha Rodekamp
> > >>>>   Lynx-Consulting GmbH
> > >>>>   Johanniskirchplatz 6
> > >>>>   D-33615 Bielefeld
> > >>>>   http://www.lynx.de
> > >>>
> > >>>
> > >>
> > >>
> > >> --
> > >> -----
> > >>
> > >> Jonatan Soto
> > >>
> > >
> > >
> > >
> > > --
> > > Sascha Rodekamp
> > >    Lynx-Consulting GmbH
> > >    Johanniskirchplatz 6
> > >    D-33615 Bielefeld
> > >    http://www.lynx.de
> >
> >
>
>
> --
> Sascha Rodekamp
>    Lynx-Consulting GmbH
>    Johanniskirchplatz 6
>    D-33615 Bielefeld
>    http://www.lynx.de
>



-- 
-----

Jonatan Soto

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message