[Lift] NodeSeq to JsExp how to?

2010-03-09 Thread Stuart Roebuck
I'm trying to produce a web page with editable content. When the user clicks an edit button on a line it uses jQuery to display a modal dialog which allows fields of that line to be edited. I can easily produce a snippet to produce the lines using the backend data and an XHTML template and

Re: [Lift] NodeSeq to JsExp how to?

2010-03-09 Thread Ross Mellgren
Try this (I haven't tested it, so there could be lurking bugs): case class JQueryNodeSeq(ns: NodeSeq) extends JsExp with JQueryLeft with HtmlFixer { override def toJsCmd = jQuery( + JsStr(fixHtml(NodeSeqDialog, ns)).toJsCmd + ) } Then JQueryNodeSeq(ns) ~ JsFunc(dialog) -Ross On Mar 9,

Re: [Lift] NodeSeq to JsExp how to?

2010-03-09 Thread Ross Mellgren
Whoops, I meant Str(fixHtml(...)) not JsStr(fixHtml(...)) -Ross On Mar 9, 2010, at 12:14 PM, Ross Mellgren wrote: Try this (I haven't tested it, so there could be lurking bugs): case class JQueryNodeSeq(ns: NodeSeq) extends JsExp with JQueryLeft with HtmlFixer { override def toJsCmd =

Re: [Lift] NodeSeq to JsExp how to?

2010-03-09 Thread David Pollak
On Tue, Mar 9, 2010 at 9:14 AM, Ross Mellgren dri...@gmail.com wrote: Try this (I haven't tested it, so there could be lurking bugs): case class JQueryNodeSeq(ns: NodeSeq) extends JsExp with JQueryLeft with HtmlFixer { override def toJsCmd = jQuery( + JsStr(fixHtml(NodeSeqDialog,

Re: [Lift] NodeSeq to JsExp how to?

2010-03-09 Thread Ross Mellgren
Ah yes, the reason I went through the fixHtml route is because Stuart specifically mentioned he wanted to process those. Stuart, you should make sure to properly secure this stuff -- either as an admin-only thing (understanding that that person has as much rights as you) or by scrubbing the