package com.anchortab.snippet

import scala.xml._

import net.liftweb._
  import common._
  import http._
    import LiftRules._
    import rest._
    import js._
      import JE._
      import JsExp._
  import util._
    import Helpers._
  import json._
    import JsonDSL._
    import Extraction._
  import mongodb._
    import BsonDSL._

object Util extends Loggable {
  def snippetHandlers : SnippetPF = {
    case "ie-conditional" :: Nil => ieConditional _
    case "jquery" :: Nil => jquery
  }

  def ieConditional(xhtml:NodeSeq) = {
    val ieVersion = S.attr("version") openOr "IE"
    Unparsed("<!--[if " + ieVersion + "]>") ++ xhtml ++ Unparsed("<![endif]-->")
  }

  def jquery =
    "script" #> <script src="/javascripts/jquery-1.8.2.js" type="text/javascript"></script>
}

package com.anchortab.snippet

import net.liftweb._
  import common._
  import http._
    import LiftRules._
    import rest._
    import js._
      import JE._
      import JsExp._
  import util._
    import Helpers._
  import json._
    import JsonDSL._
    import Extraction._
  import mongodb._
    import BsonDSL._

object Util extends Loggable {
  def snippetHandlers : SnippetPF = {
    case "jquery" :: Nil => jquery
  }

  def jquery =
    "script" #> <script src="/javascripts/jquery-1.8.2.js" type="text/javascript"></script>
}

--- 
+++ 
@@ -1,4 +1,6 @@
 package com.anchortab.snippet
+
+import scala.xml._
 
 import net.liftweb._
   import common._
@@ -18,7 +20,13 @@
 
 object Util extends Loggable {
   def snippetHandlers : SnippetPF = {
+    case "ie-conditional" :: Nil => ieConditional _
     case "jquery" :: Nil => jquery
+  }
+
+  def ieConditional(xhtml:NodeSeq) = {
+    val ieVersion = S.attr("version") openOr "IE"
+    Unparsed("<!--[if " + ieVersion + "]>") ++ xhtml ++ Unparsed("<![endif]-->")
   }
 
   def jquery =
Implement snippet for IE conditional comments.
