Browse files

Merge pull request #1360 from melezov/master

Add prompt expression to JsCommands

The input box will be filled with an empty string by
default, identical to invoking the prompt javascript
function without the second argument.
  • Loading branch information...
2 parents c3205ad + 440e1be commit b9e8a1bf2f8f885502d6afd1b077ace10d5f0cd7 @Shadowfiend Shadowfiend committed Nov 13, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 web/webkit/src/main/scala/net/liftweb/http/js/JsCommands.scala
View
4 web/webkit/src/main/scala/net/liftweb/http/js/JsCommands.scala
@@ -822,6 +822,10 @@ object JsCmds {
def toJsCmd = "alert(" + text.encJs + ");"
}
+ case class Prompt(text: String, default: String = "") extends JsExp {
+ def toJsCmd = "prompt(" + text.encJs + "," + default.encJs + ")"
+ }
+
case class Confirm(text: String, yes: JsCmd) extends JsCmd {
def toJsCmd = "if (confirm(" + text.encJs + ")) {" + yes.toJsCmd + "}"
}

0 comments on commit b9e8a1b

Please sign in to comment.