Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
210 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package net.liftweb.seventhings.lib; | ||
|
||
public class BoxJ { | ||
|
||
private final static BoxJBridge j = new BoxJBridge(); | ||
|
||
public static BoxJBridge j() { | ||
return j; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package net.liftweb.seventhings.lib; | ||
|
||
import net.liftweb.http.js.JE; | ||
import net.liftweb.http.js.JsCmd; | ||
import net.liftweb.http.js.jquery.JqJE; | ||
import net.liftweb.http.js.jquery.JqJsCmds; | ||
import scala.xml.NodeSeq; | ||
|
||
public class JqJsCmdsJ { | ||
|
||
private final static JqJsCmdsJBridge j = new JqJsCmdsJBridge(); | ||
|
||
public static JsCmd appendHtml(String uid, NodeSeq content) { | ||
return (new JqJE.JqId(new JE.Str(uid)).$tilde$greater(new JqJE.JqAppend(content))).cmd(); | ||
} | ||
|
||
public static JqJsCmdsJBridge j() { | ||
return j; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package net.liftweb.seventhings.lib; | ||
|
||
import scala.collection.Seq; | ||
|
||
public class ListJ { | ||
|
||
public static Seq Nil() { | ||
return scala.collection.immutable.Nil$.MODULE$; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/java/net/liftweb/seventhings/snippet/AjaxRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package net.liftweb.seventhings.snippet; | ||
|
||
import net.liftweb.common.Box; | ||
import net.liftweb.common.Empty; | ||
import net.liftweb.http.SHtmlJ; | ||
import net.liftweb.http.js.JsCmd; | ||
import net.liftweb.http.js.JsExp; | ||
import net.liftweb.http.js.jquery.JqJsCmds; | ||
import net.liftweb.seventhings.lib.BoxJ; | ||
import net.liftweb.seventhings.lib.JqJsCmdsJ; | ||
import net.liftweb.util.Css; | ||
import scala.Function1; | ||
import scala.xml.Elem; | ||
import scala.xml.NodeSeq; | ||
import static net.liftweb.seventhings.lib.XmlJ.*; | ||
|
||
public class AjaxRunner { | ||
|
||
public Function1<NodeSeq, NodeSeq> render() { | ||
|
||
final scala.Tuple2<String, JsExp> ajax = SHtmlJ.j().ajaxInvoke(net.liftweb.util.Func.lift(new net.liftweb.util.Func0<JsCmd>() { | ||
public JsCmd apply() { | ||
final Elem el = elem("div", nselem("lift", "MyWizard", attr("ajax", "true"))); | ||
return new JqJsCmds.ModalDialog(toNodeSeq(el), (Box)BoxJ.j().empty()); | ||
} | ||
})); | ||
|
||
return Css.sel("* [onclick]", ((JsExp)ajax._2()).toJsCmd()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.