| Page 1 of 1 | [ 6 posts ] |
|
We are using a custom url compression scheme to keep are combo urls short. I would like to be able to use the same scheme on the yui component urls. My first thought was using the "filter" param on the loader config, but this is quite limited. Aside from a patch, does anyone have a better idea?
|
|
This would require changes to the YUI combo service, not just Y.Loader.
|
|
We host our own combo handler.
|
|
I think you'll still need to patch the loader. In principle, configFn (undocumented, but search the source) might be able to handle it, but I'm not sure if you can modify the configFn for core YUI components without patching.
|
|
In 3.5.0, you should be able to hijack the resolve method and bypass it that way.
(One of the many, many reasons I put it there) |
Dylan OudykYUI Contributor
|
I think you might be able to get by without any patching. I hope I'm not too behind, I haven't used YUI since 3.2.0 but try this out, it's worth a shot at least.
The filter config is like as follows: Code: filter : { searchExp : ".+", //match the entire url string replaceStr : 'replacement' } Here's the thing though in JavaScript, string.replace takes a regex and a string to replace the pattern with but instead of a string you can alternatively pass in a function. Yeah that's right, a function. What I ended up doing was use this regex ".+" which will match anything. Then for replaceStr put in a function like: Code: filter : { searchExp: '.+' //match entire string , replaceStr : function (theEntirePath){ console.log(theEntirePath); //so you know what you're working with var myNewPath = ''; //your awesome string processing code here //... //... return myNewPath; } } Like I mentioned this worked as of version 3.2.0 (I'm behind I know) and I'm aware Dav is doing some rework on loader but hopefully this functionality isn't removed. If so then when I get back to porting again I'm in the same boat you are. Let me know how it goes please and good luck. |
| Page 1 of 1 | [ 6 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group