Question about ezscript_require

You need to be logged in to post messages in the forums. New users may register here.

Carlos Revillo

Member since:
09 January 2008

Posts: 48

Thursday 03 September 2009 2:32:26 am

Hi. I'm starting with ezjscore because i'm using ezstarrating.

Previously, i was usign jquery for another custom extensions we need for this project.
so, in one of my design.ini.append.php, i had something like

































































Up

André R.

Member since:
14 January 2008

Posts: 145

Thursday 03 September 2009 4:47:29 am

I guess you only have this issue in admin?

One solution could be to remove (override and remove) this code block in 'design/admin/templates/pagelayout.tpl':

































































eZ Online Editor 5.1: http://projects.ez.no/ezoe || eZJSCore 1.1(Ajax): http://projects.ez.no/ezjscore || eZSearch++(better search results): http://projects.ez.no/ezsearchpro
@: http://twitter.com/andrerom

Up

Carlos Revillo

Member since:
09 January 2008

Posts: 48

Thursday 03 September 2009 5:05:49 am

Sorry about the concat. it was my fault.
just rests of the test i did related to
http://projects.ez.no/ezstarratin...eral/jquery_code_for_voting#msg19068

there we talked about choosing yui3 or jquery.

Your solution seems to work. Thank you again.
Up

André R.

Member since:
14 January 2008

Posts: 145

Thursday 03 September 2009 5:10:27 am

Ok, nop :)

Which of the solutions?

eZ Online Editor 5.1: http://projects.ez.no/ezoe || eZJSCore 1.1(Ajax): http://projects.ez.no/ezjscore || eZSearch++(better search results): http://projects.ez.no/ezsearchpro
@: http://twitter.com/andrerom

Up

Carlos Revillo

Member since:
09 January 2008

Posts: 48

Thursday 03 September 2009 5:21:08 am

First one. Seems to be more elegant than having to add that piece of code if we need more extensions in the future
Best Regards.
Up

André R.

Member since:
14 January 2008

Posts: 145

Thursday 03 September 2009 6:34:47 am

Ok, thanks for testing :)
Will try to get the need changes to 4.2 pagelayout templates so this doesn't happen there.

BTW: bundled jquery-1.3.2.min now.

eZ Online Editor 5.1: http://projects.ez.no/ezoe || eZJSCore 1.1(Ajax): http://projects.ez.no/ezjscore || eZSearch++(better search results): http://projects.ez.no/ezsearchpro
@: http://twitter.com/andrerom

Up

Carlos Revillo

Member since:
09 January 2008

Posts: 48

Friday 04 September 2009 1:43:22 am

Hi again.

Following with my question, now i have another issue. After testing your solution my design.ini.append.php looks like




































































Up

André R.

Member since:
14 January 2008

Posts: 145

Friday 04 September 2009 4:02:14 am

What if you do it like:
























eZ Online Editor 5.1: http://projects.ez.no/ezoe || eZJSCore 1.1(Ajax): http://projects.ez.no/ezjscore || eZSearch++(better search results): http://projects.ez.no/ezsearchpro
@: http://twitter.com/andrerom

Up

Carlos Revillo

Member since:
09 January 2008

Posts: 48

Friday 04 September 2009 4:17:07 am

Yeah. Both forms work, but:
- The first one requires me to add jquery in every templates where i need jquery
- The second one will load jquery.treeview and jquery.cookie.js in every 'page', even i don't need them...

Would be too hard change the way that files are added to the packed one? I mean, it seems that actually, ezscript_require calls in templates are readed before JavaScriptSettings in ini files...
If this could be changed to "read ini files first and then add all what templates need", all will be ok for me.

But i'm afraid this is not an easy one...

Up

André R.

Member since:
14 January 2008

Posts: 145

Friday 04 September 2009 5:21:39 am

I can do that, but I got the impression that you had to add the code* you mentioned anywhere you used it anyway.


*







eZ Online Editor 5.1: http://projects.ez.no/ezoe || eZJSCore 1.1(Ajax): http://projects.ez.no/ezjscore || eZSearch++(better search results): http://projects.ez.no/ezsearchpro
@: http://twitter.com/andrerom

Up

Carlos Revillo

Member since:
09 January 2008

Posts: 48

Friday 04 September 2009 5:32:27 am

Sorry. Would you mean i will have to add this line of code everywhere or only everywhere where i need those scripts?
i mean this line
















Up

André R.

Member since:
14 January 2008

Posts: 145

Friday 04 September 2009 5:53:36 am

Forget it, to many lost in translation threads today, I'll just fix it.

UPDATE: Fixed in svn, please test.

eZ Online Editor 5.1: http://projects.ez.no/ezoe || eZJSCore 1.1(Ajax): http://projects.ez.no/ezjscore || eZSearch++(better search results): http://projects.ez.no/ezsearchpro
@: http://twitter.com/andrerom

Up

Carlos Revillo

Member since:
09 January 2008

Posts: 48

Friday 04 September 2009 7:47:23 am

It works like a charm!

Thanks a lot.
Carlos.
Up

André R.

Member since:
14 January 2008

Posts: 145

Tuesday 08 September 2009 11:12:13 am

Hi!

Small update: Fix for the issue you had earlier in admin design where "JavaScriptList" files would override scripts from "ezscript_require" is now fixed in eZ Publish 4.2:
http://issues.ez.no/IssueView.php?Id=15440&

Additionally it's now possible to use ezcss_require() for both admin and webin design out of the box (So we for instance don't have to load css with javascript in ezstarrating) ;-)

eZ Online Editor 5.1: http://projects.ez.no/ezoe || eZJSCore 1.1(Ajax): http://projects.ez.no/ezjscore || eZSearch++(better search results): http://projects.ez.no/ezsearchpro
@: http://twitter.com/andrerom

Up

You need to be logged in to post messages in the forums. New users may register here.