Ideas of enhancement

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

Jérôme Vieilledent

Member since:
09 January 2008

Posts: 77

Thursday 29 October 2009 5:50:44 am

Hi !

Thanks for this great extension (which I use in Noven Image Cropper). I'd like to submit some enhancement ideas :

1. Add possibility to choose a "media host" for JS/CSS. Useful to serve media files through a specific CDN and/or a server lighter (such as LightHTTPD)
2. Add a solution for Crossdomain issues (such as flXHR (http://flxhr.flensed.com)
3. When using tpl operators such as ezscript_require, it seems that JS files are not put in <head> but directly in the body. Is this an issue ?

Thanks !
Up

Gaetano Giunta

Member since:
09 January 2008

Posts: 152

Thursday 29 October 2009 6:05:50 am

2 - I think you can already do it:

a - using Yui 3 support for x-domain requests

b - with the next version of ggwebservices (soon to be released), you will be able to both:

- use a provided js function to make ajax calls using on the wire the jsonrpc protocol instead of the ezjscore one (while still accessing your ezjscore-defined methods in php/tpl)

- call a server-side webservice proxy that can connect to external-domain services via soap, post, jsonrpc or xmlrpc and forward the response to the browser in jsonrpc format
Up

Jérôme Vieilledent

Member since:
09 January 2008

Posts: 77

Thursday 29 October 2009 6:25:11 am

Thanks Gaetano

Yahoo UI supports x-domain via SWF indeed, but this is not the case of jQuery (by default). So I wanted to suggest a generic way to do that (flXRH provides a plugin for number of JS frameworks)

Here's another feature request : A simple server function which provides the ezroot. Indeed, although $.ez() or Y.ez() functions can be used in most cases, sometimes you just cannot use them. That was my case for Noven Image Cropper, and I simply added a very simple server function : http://svn.projects.ez.no/novenim...lasses/novimgcropserverfunctions.php (method getURLPrefix())
Up

André R.

Member since:
14 January 2008

Posts: 145

Thursday 29 October 2009 5:12:17 pm

1. for the packaged js / css files?

3. This only happens if you use it in pagelayout, as in after ezscript_load has been called.
Just thought of a way to solve that, not very 'clean' though: make ez*_load write a unique html comment in source code and if ez*_require is called after that, make it string replace the output buffer instead of outputing it to template.

4. (root url), almost what you want: jQuery.ez.url / Y.io.ez.url (just add .replace( 'ezjscore/', '' ), and your there). I can easily add root parameter for next version.

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

Gaetano Giunta

Member since:
09 January 2008

Posts: 152

Friday 30 October 2009 2:17:48 am

4. (root url), almost what you want: jQuery.ez.url / Y.io.ez.url (just add .replace( 'ezjscore/', '' ), and your there). I can easily add root parameter for next version.

mmm, yummi!
So I can get it from there and not need anymore to make my own js function generated dynamically
Up

Jérôme Vieilledent

Member since:
09 January 2008

Posts: 77

Friday 30 October 2009 2:25:45 am

1. for the packaged js / css files?

Yes. At the moment, I have to hack your operator to add the media host (needed in my current project)

3. This only happens if you use it in pagelayout, as in after ezscript_load has been called.








4. (root url), almost what you want: jQuery.ez.url / Y.io.ez.url (just add .replace( 'ezjscore/', '' ), and your there). I can easily add root parameter for next version.

Thanks, gotta test it :-)
Up

André R.

Member since:
14 January 2008

Posts: 145

Saturday 31 October 2009 1:24:04 am


OK Got it. But ezscript_require is in a view template embedded via node_view_gui in the pagelayout. I'm not sure I understand your solution :-/


It still means it is executed after <head> in your pagelayout template aka after ezscript_load() has being called. In these cases it outputs the script directly.
So my experimental idea of fixing it is make ezscript_load also output a html comment like <!-- #ezscript_load#replace#mark# --> and replace that with script tag when ezscript_require is called afterwards. using some vodoo on ob_get_contents or something.

EDIT: Thinking a bit more about it, and this is not cache safe. Ack..

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.