Skip to content
This repository
Browse code

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...
commit b9e8a1bf2f8f885502d6afd1b077ace10d5f0cd7 2 parents c3205ad + 440e1be
Antonio Salazar Cardozo Shadowfiend authored
4 web/webkit/src/main/scala/net/liftweb/http/js/JsCommands.scala
@@ -822,6 +822,10 @@ object JsCmds {
822 822 def toJsCmd = "alert(" + text.encJs + ");"
823 823 }
824 824
  825 + case class Prompt(text: String, default: String = "") extends JsExp {
  826 + def toJsCmd = "prompt(" + text.encJs + "," + default.encJs + ")"
  827 + }
  828 +
825 829 case class Confirm(text: String, yes: JsCmd) extends JsCmd {
826 830 def toJsCmd = "if (confirm(" + text.encJs + ")) {" + yes.toJsCmd + "}"
827 831 }

0 comments on commit b9e8a1b

Please sign in to comment.
Something went wrong with that request. Please try again.