Created
November 18, 2008 01:32
-
-
Save tjweir/26017 to your computer and use it in GitHub Desktop.
undefined
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
package com.quotelibrary.snippet | |
import _root_.net.liftweb.http._ | |
import S._ | |
import SHtml._ | |
import js._ | |
import JsCmds._ | |
import JE._ | |
import _root_.net.liftweb.util._ | |
import Helpers._ | |
import _root_.scala.xml._ | |
// Foo | |
class Json { | |
object json extends JsonHandler { | |
def apply(in: Any): JsCmd = | |
SetHtml("json_result", in match { | |
case JsonCmd("show", _, p: String, _) => Text(in.toString) | |
case JsonCmd("count", _, p: String, _) => Text(p.length+" Characters") | |
case x => <b>Problem... didn't handle JSON message {x}</b> | |
}) | |
} | |
def sample = { | |
<span> | |
{Script(json.jsCmd)} | |
<textarea id="json_question" rows="4" cols="50"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment