Peter Robinett <[email protected]> writes:

> Hi all,
>

[...]

> // Usage in boot.scala
> val myJsScript = new JsScript("flot" :: "jquery.flot.selectable.js" ::
> Nil)
> ResourceServer.allow(myJsScript.allowResource)
>
> // Usage in a normal snippet
> def mySnippet = {
>       <head>
>               { myJsScript.toHTML }
>       </head>
>       <div>
>               The rest of the snippet...
>       </div>
> }
>
> // Usage in a CometActor
> class myActor extends CometActor with JsScriptDependency {
>       override def scripts = List(new JsScript("flot" ::
> "jquery.flot.selectable.js" :: Nil));
> }
>
> What do you think? It's a really quite basic but I think such an
> approach could work well for things like as lift-flot.

It might be a start :-) I'm a little unsure if it supports the use case
I would like to see:

I'm using jqPlot (a flot-like lib) and would like to, in boot, just
initialize the widget:

jqPlot.init

jqPlot comes with numerous plugins and this should be handled by the
widget. Whether a plugin is loaded on a page depends on some higher
level structure. Ie. if I wish to draw a pie chart, the pie chart plugin
should be loaded.

Looking back at this, it seems like this could work with the above....

In init: register all plugins
In the specific charts, call toHtml on the plugins needed

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

Reply via email to