Destroy Rhode Island

The code:

class JSDialog {
  // build the button... when pressed, present
  // a dialog based on running the _jsdialog_confirm
  // template
  def button(in: NodeSeq) =
  ajaxButton(in,
             () => S.runTemplate(List("_jsdialog_confirm")).
             map(ns => ModalDialog(ns)) openOr
             Alert("Couldn't find _jsdialog_confirm template"))

  // the template needs to bind to either server-side behavior
  // and unblock the UI
  def confirm(in: NodeSeq) =
  bind("confirm", in,
       "yes" -> ((b: NodeSeq) => ajaxButton(b, () =>
        {println("Rhode Island Destroyed")
         Unblock & Alert("Rhode Island Destroyed")})),
       "no" -> ((b: NodeSeq) => <button onclick={Unblock.toJsCmd}>{b}</button>))
}