Welcome Guest, Not a member yet? Register   Sign In
Sparks and assets
#1

[eluser]mrbinky3000[/eluser]
I'm in the process of converting a scaffolding / datagrid class that I've used on a few projects into a spark. However it relies on jQuery, jQuery-UI, and a couple other jQuery plugins (some of which I wrote).

How do I include assets into my spark? Is it possible? Is there a plan to address that stuff in the future?

I typically leave JavaScript and CSS outside of the CI framework in a folder called assets. Should I move them into CI views? I would think you'd want to keep them separated, but perhaps other more experienced CI peeps can persuade me to think otherwise.

Thanks in advance for your help.

-mrb3k
#2

[eluser]eclarian[/eluser]
Right now the only dependencies you can have in a spark are other sparks.

One option is to use a CDN to link to your required assets (http://code.google.com/apis/libraries/de...l#jqueryUI). Otherwise, probably putting them in the views folder would be your best bet.

Remember that your package itself should stand alone without having to have any type of external folder structure. Check out the fire_log spark (http://getsparks.org/packages/fire_log/v.../HEAD/show) to get an example of spark that includes CSS.

Hope that helps!
#3

[eluser]mrbinky3000[/eluser]
Thanks.

I do use the Google CDN for jQuery and jQuery-UI, however I would still need to get my own jQuery plugins into the spark somehow. It looks like that spark you referred me to puts the CSS in a view. I guess that's the way they want to do it?

I'm going to keep all my CSS and JavaScript out of Code Igniter. I guess I'll just write in the documentation that they need to move my asset folder to whatever location they use to store their assets and then update the script.

My primary reason for converting my library into a spark is so I can quickly get it up and running on other new projects. If other folks want to use it, cool, but its not my main focus.

Thanks again for the tip.
#4

[eluser]Rok Biderman[/eluser]
Any chance for a preview link, mrbinky3000? Wink




Theme © iAndrew 2016 - Forum software by © MyBB