developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#688 closed enhancement (fixed)

jForms: always include jQuery when using HTML builder

Reported by: Julien Owned by: laurentj
Priority: high Milestone: Jelix 1.1 beta 1
Component: jelix:forms Version: trunk
Severity: normal Keywords:
Cc: Blocked By:
Blocking: #687 Documentation needed: no
Hosting Provider: Php version:

Description

Right now, jQuery is only included when we need Wymeditor. But changes in #687 make it needed for every form. This is not a problem, because we'll need it to support datepicker in forms too (#196}.

So I suggest including jQuery for every jForm Html rendering.

Attachments (1)

688-jForms-always-include-jQuery.diff (1.1 KB) - added by Julien 12 years ago.

Download all attachments as: .zip

Change History (11)

Changed 12 years ago by Julien

comment:1 Changed 12 years ago by Julien

  • Status changed from new to assigned

blocking #687 because committing #687 without committing this ticket will break jforms.js

comment:2 Changed 12 years ago by laurentj

  • Milestone set to Jelix 1.1 beta 1

should we really include jquery everytime we use the html builder of jquery ? that is the question. Because even for little forms, we will have 55ko of javascript loaded in the page...

we have to discuss about that point...

comment:3 Changed 12 years ago by Julien

maybe I could write the patches another way, but I think we should remember :

  • jquery.js will be cached in browsers
  • jQuery is needed by Wymeditor, the future datepicker, ajax for jForms, etc...

So I think that default inclusion may be a really good thing that does not cost that much perf.

Maybe we should write an alternative builder ? The problem is that #687 make jforms.js require jQuery for triggering pre-check event. So we may need 2 jforms.js, one for each builder.

Or jforms.js could check jQuery availability before binding that event ?

comment:4 Changed 12 years ago by laurentj

  • Version changed from 1.0.5 to trunk

comment:5 Changed 12 years ago by laurentj

  • Owner changed from Julien to laurentj
  • Status changed from assigned to new

Ok, we decided to include jQuery for the html builder. But at the same time, I would like a htmllight builder.

I'm currently creating this htmllight builder and integrate your patch...

comment:6 Changed 12 years ago by Julien

Laurent,

just added a variant of the patch for #687

It does not make jQuery required thanks to a simple test on jQuery function presence in jforms.js

So the current ticket may be invalid.

I say that, because if you write a htmllight builder, you will still need to check for jQuery availability in jforms.js, or have a jforms-ligh.js or something....

So please take a look at the second version of the patch for #687, it may save your time ;)

comment:7 follow-up: Changed 12 years ago by laurentj

because if you write a htmllight builder, you will still need to check for jQuery availability in jforms.js, or have a jforms-ligh.js or something....

Yes, I know ;-)

it may save your time

too late...

comment:8 in reply to: ↑ 7 Changed 12 years ago by Julien

Replying to laurentj:

too late...

;(

we'll see the differences between both builders. If the only difference is the default inclusion of jQuery, maybe second version of the #687 patch is still better...

comment:9 Changed 12 years ago by laurentj

  • Resolution set to fixed
  • review review? deleted
  • Status changed from new to closed

Done. Commited in the trunk.

the html builder now includes always jquery and has its own javascript file, jforms_jquery.js. A new builder, htmllight, won't use jquery except for the html editor, and have its own javascript file jforms_light.js

we can now improve jforms_jquery.js to use all features we need of jquery. And you can patch jforms_light.js to fix bug #687.

comment:10 Changed 12 years ago by Julien

ok, I just made a third version of the patch for #687

Note: See TracTickets for help on using tickets.