Created
September 5, 2018 20:05
-
-
Save olafurpg/3d71a100ce43c4222b311ed8c5ab67bc to your computer and use it in GitHub Desktop.
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
diff --git a/repos/framework/core/common/src/test/scala/net/liftweb/common/ConversionsSpec.scala b/repos/framework/core/common/src/test/scala/net/liftweb/common/ConversionsSpec.scala | |
index e663a48bbe..fa0cc0bed6 100644 | |
--- a/repos/framework/core/common/src/test/scala/net/liftweb/common/ConversionsSpec.scala | |
+++ b/repos/framework/core/common/src/test/scala/net/liftweb/common/ConversionsSpec.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package common | |
+import scala.xml.quote._ | |
import xml.{NodeSeq, Text} | |
import org.specs2.matcher.XmlMatchers | |
@@ -35,13 +36,13 @@ class ConversionsSpec extends Specification with XmlMatchers { | |
} | |
"convert from an Elem" in { | |
- val sns: StringOrNodeSeq = <b/> | |
- sns.nodeSeq must ==/(<b/>) | |
+ val sns: StringOrNodeSeq = xml"<b/>" | |
+ sns.nodeSeq must ==/(xml"<b/>") | |
} | |
"convert from a Seq[Node]" in { | |
- val sns: StringOrNodeSeq = List(<a/>, <b/>) | |
- sns.nodeSeq must ==/(List(<a/>, <b/>): NodeSeq) | |
+ val sns: StringOrNodeSeq = List(xml"<a/>", xml"<b/>") | |
+ sns.nodeSeq must ==/(List(xml"<a/>", xml"<b/>"): NodeSeq) | |
} | |
} | |
@@ -77,29 +78,29 @@ class ConversionsSpec extends Specification with XmlMatchers { | |
"A NodeSeqFunc" should { | |
"be created by a NodeSeq constant" in { | |
- val sf: NodeSeqFunc = <b>Foo</b> | |
+ val sf: NodeSeqFunc = xml"<b>Foo</b>" | |
- sf.func() must ==/(<b>Foo</b>) | |
+ sf.func() must ==/(xml"<b>Foo</b>") | |
} | |
"be created by a NodeSeq Function" in { | |
- val sf: NodeSeqFunc = () => <i>Bar</i> | |
+ val sf: NodeSeqFunc = () => xml"<i>Bar</i>" | |
- sf.func() must ==/(<i>Bar</i>) | |
+ sf.func() must ==/(xml"<i>Bar</i>") | |
} | |
"be created by a constant that can be converted to a NodeSeq" in { | |
- implicit def intToNS(in: Int): NodeSeq = <a>{in}</a> | |
+ implicit def intToNS(in: Int): NodeSeq = xml"<a>${in}</a>" | |
val sf: NodeSeqFunc = 55 | |
- sf.func() must ==/(<a>55</a>) | |
+ sf.func() must ==/(xml"<a>55</a>") | |
} | |
"be created by a function that can be converted to a NodeSeq" in { | |
- implicit def intToNodeSeq(in: Int): NodeSeq = <a>{in}</a> | |
+ implicit def intToNodeSeq(in: Int): NodeSeq = xml"<a>${in}</a>" | |
val sf: NodeSeqFunc = () => 55 | |
- sf.func() must ==/(<a>55</a>) | |
+ sf.func() must ==/(xml"<a>55</a>") | |
} | |
} | |
} | |
diff --git a/repos/framework/core/json/src/test/scala/net/liftweb/json/JsonQueryExamples.scala b/repos/framework/core/json/src/test/scala/net/liftweb/json/JsonQueryExamples.scala | |
index b3e41b606a..4f3b2e19d8 100644 | |
--- a/repos/framework/core/json/src/test/scala/net/liftweb/json/JsonQueryExamples.scala | |
+++ b/repos/framework/core/json/src/test/scala/net/liftweb/json/JsonQueryExamples.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package json | |
+import scala.xml.quote._ | |
import org.specs2.mutable.Specification | |
/** | |
@@ -42,14 +43,14 @@ object JsonQueryExamples extends Specification { | |
"List of IPs converted to XML" in { | |
val ipsList = (json \\ "ip").obj | |
- val ips = <ips>{ | |
+ val ips = xml"""<ips>${ | |
for { | |
field <-ipsList | |
JString(ip) <- field.value | |
- } yield <ip>{ ip }</ip> | |
- }</ips> | |
+ } yield xml"<ip>${ ip }</ip>" | |
+ }</ips>""" | |
- ips mustEqual <ips><ip>192.168.1.125</ip><ip>192.168.1.126</ip><ip>192.168.1.127</ip><ip>192.168.2.125</ip><ip>192.168.2.126</ip></ips> | |
+ ips mustEqual xml"<ips><ip>192.168.1.125</ip><ip>192.168.1.126</ip><ip>192.168.1.127</ip><ip>192.168.2.125</ip><ip>192.168.2.126</ip></ips>" | |
} | |
"List of IPs in cluster2" in { | |
diff --git a/repos/framework/core/json/src/test/scala/net/liftweb/json/XmlBugs.scala b/repos/framework/core/json/src/test/scala/net/liftweb/json/XmlBugs.scala | |
index 18d85ce1e4..e997baea6e 100644 | |
--- a/repos/framework/core/json/src/test/scala/net/liftweb/json/XmlBugs.scala | |
+++ b/repos/framework/core/json/src/test/scala/net/liftweb/json/XmlBugs.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package json | |
+import scala.xml.quote._ | |
import org.specs2.mutable.Specification | |
object XmlBugs extends Specification { | |
@@ -24,25 +25,25 @@ object XmlBugs extends Specification { | |
import scala.xml.{Group, Text} | |
"HarryH's XML parses correctly" in { | |
- val xml1 = <venue><id>123</id></venue> | |
- val xml2 = <venue> <id>{"1"}{"23"}</id> </venue> | |
+ val xml1 = xml"<venue><id>123</id></venue>" | |
+ val xml2 = xml"<venue> <id>${"1"}${"23"}</id> </venue>" | |
Xml.toJson(xml1) must_== Xml.toJson(xml2) | |
} | |
"HarryH's XML with attributes parses correctly" in { | |
val json = | |
- toJson(<tips><group type="Nearby"><tip><id>10</id></tip></group></tips>) | |
+ toJson(xml"""<tips><group type="Nearby"><tip><id>10</id></tip></group></tips>""") | |
compactRender(json) mustEqual """{"tips":{"group":{"type":"Nearby","tip":{"id":"10"}}}}""" | |
} | |
"Jono's XML with attributes parses correctly" in { | |
val example1 = | |
- <word term="example" self="http://localhost:8080/word/example" available="true">content</word> | |
+ xml"""<word term="example" self="http://localhost:8080/word/example" available="true">content</word>""" | |
val expected1 = | |
"""{"word":"content","self":"http://localhost:8080/word/example","term":"example","available":"true"}""" | |
val example2 = | |
- <word term="example" self="http://localhost:8080/word/example" available="true"></word> | |
+ xml"""<word term="example" self="http://localhost:8080/word/example" available="true"></word>""" | |
val expected2 = | |
"""{"self":"http://localhost:8080/word/example","term":"example","available":"true"}""" | |
@@ -53,10 +54,10 @@ object XmlBugs extends Specification { | |
} | |
"Nodes with attributes converted to correct JSON" in { | |
- val xml = <root> | |
+ val xml = xml"""<root> | |
<n id="10" x="abc" /> | |
<n id="11" x="bcd" /> | |
- </root> | |
+ </root>""" | |
val expected = | |
"""{"root":{"n":[{"x":"abc","id":"10"},{"x":"bcd","id":"11"}]}}""" | |
val expected210 = | |
@@ -67,7 +68,7 @@ object XmlBugs extends Specification { | |
"XML with empty node is converted correctly to JSON" in { | |
val xml = | |
- <tips><group type="Foo"></group><group type="Bar"><tip><text>xxx</text></tip><tip><text>yyy</text></tip></group></tips> | |
+ xml"""<tips><group type="Foo"></group><group type="Bar"><tip><text>xxx</text></tip><tip><text>yyy</text></tip></group></tips>""" | |
val expected = | |
"""{"tips":{"group":[{"type":"Foo"},{"type":"Bar","tip":[{"text":"xxx"},{"text":"yyy"}]}]}}""" | |
compactRender(toJson(xml)) mustEqual expected | |
diff --git a/repos/framework/core/json/src/test/scala/net/liftweb/json/XmlExamples.scala b/repos/framework/core/json/src/test/scala/net/liftweb/json/XmlExamples.scala | |
index 9cab13db77..ebdc11ce4c 100644 | |
--- a/repos/framework/core/json/src/test/scala/net/liftweb/json/XmlExamples.scala | |
+++ b/repos/framework/core/json/src/test/scala/net/liftweb/json/XmlExamples.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package json | |
+import scala.xml.quote._ | |
import org.specs2.mutable.Specification | |
object XmlExamples extends Specification { | |
@@ -46,7 +47,7 @@ object XmlExamples extends Specification { | |
} | |
"Primitive array example" in { | |
- val xml = <chars><char>a</char><char>b</char><char>c</char></chars> | |
+ val xml = xml"<chars><char>a</char><char>b</char><char>c</char></chars>" | |
compactRender(toJson(xml)) mustEqual """{"chars":{"char":["a","b","c"]}}""" | |
} | |
@@ -64,7 +65,7 @@ object XmlExamples extends Specification { | |
JField("numbers", flattenArray(nums)) | |
}) | |
- printer.format(xml(0)) mustEqual printer.format(<lotto> | |
+ printer.format(xml(0)) mustEqual printer.format(xml"""<lotto> | |
<id>5</id> | |
<winning-numbers>2,45,34,23,7,5,3</winning-numbers> | |
<winners> | |
@@ -75,7 +76,7 @@ object XmlExamples extends Specification { | |
<winner-id>54</winner-id> | |
<numbers>52,3,12,11,18,22</numbers> | |
</winners> | |
- </lotto>) | |
+ </lotto>""") | |
} | |
"Band example with namespaces" in { | |
@@ -98,7 +99,7 @@ object XmlExamples extends Specification { | |
}""") | |
} | |
- val band = <b:band> | |
+ val band = xml"""<b:band> | |
<name>The Fall</name> | |
<genre>rock</genre> | |
<influence/> | |
@@ -112,14 +113,14 @@ object XmlExamples extends Specification { | |
<song>My new house</song> | |
</playlist> | |
</playlists> | |
- </b:band> | |
+ </b:band>""" | |
"Grouped text example" in { | |
val json = toJson(groupedText) | |
compactRender(json) mustEqual """{"g":{"group":"foobar","url":"http://example.com/test"}}""" | |
} | |
- val users1 = <users count="2"> | |
+ val users1 = xml"""<users count="2"> | |
<user disabled="true"> | |
<id>1</id> | |
<name>Harry</name> | |
@@ -128,20 +129,20 @@ object XmlExamples extends Specification { | |
<id>2</id> | |
<name nickname="Dave">David</name> | |
</user> | |
- </users> | |
+ </users>""" | |
- val users2 = <users> | |
+ val users2 = xml"""<users> | |
<user> | |
<id>1</id> | |
<name>Harry</name> | |
</user> | |
- </users> | |
+ </users>""" | |
val url = "test" | |
- val groupedText = <g> | |
- <group>{ Group(List(Text("foo"), Text("bar"))) }</group> | |
- <url>http://example.com/{ url }</url> | |
- </g> | |
+ val groupedText = xml"""<g> | |
+ <group>${ Group(List(Text("foo"), Text("bar"))) }</group> | |
+ <url>http://example.com/${ url }</url> | |
+ </g>""" | |
// Examples by Jonathan Ferguson. See http://groups.google.com/group/liftweb/browse_thread/thread/f3bdfcaf1c21c615/c311a91e44f9c178?show_docid=c311a91e44f9c178 | |
// This example shows how to use a transformation function to correct JSON generated by | |
@@ -172,20 +173,20 @@ object XmlExamples extends Specification { | |
} | |
val messageXml1 = | |
- <message expiry_date="20091126" text="text" word="ant" self="me"> | |
+ xml"""<message expiry_date="20091126" text="text" word="ant" self="me"> | |
<stats count="0"></stats> | |
<messages href="https://domain.com/message/ant"></messages> | |
- </message> | |
+ </message>""" | |
val expected1 = | |
"""{"message":{"expiry_date":"20091126","word":"ant","text":"text","self":"me","stats":{"count":0},"messages":{"href":"https://domain.com/message/ant"}}}""" | |
- val messageXml2 = <message expiry_date="20091126"> | |
+ val messageXml2 = xml"""<message expiry_date="20091126"> | |
<stats count="0"></stats> | |
- </message> | |
+ </message>""" | |
val messageXml3 = | |
- <message expiry_date="20091126"><stats count="0"></stats></message> | |
+ xml"""<message expiry_date="20091126"><stats count="0"></stats></message>""" | |
val expected2 = | |
"""{"message":{"expiry_date":"20091126","stats":{"count":0}}}""" | |
diff --git a/repos/framework/core/util/src/main/scala/net/liftweb/util/CssSel.scala b/repos/framework/core/util/src/main/scala/net/liftweb/util/CssSel.scala | |
index f68c3c1f5b..6c9a2c71d2 100644 | |
--- a/repos/framework/core/util/src/main/scala/net/liftweb/util/CssSel.scala | |
+++ b/repos/framework/core/util/src/main/scala/net/liftweb/util/CssSel.scala | |
@@ -1,6 +1,7 @@ | |
package net.liftweb | |
package util | |
+import scala.xml.quote._ | |
import common._ | |
import xml._ | |
import collection.mutable.ListBuffer | |
@@ -761,12 +762,12 @@ trait CssBind extends CssSel { | |
def apply(in: NodeSeq): NodeSeq = css match { | |
case Full(c) => selectorMap(in) | |
- case _ => Helpers.errorDiv(<div> | |
+ case _ => Helpers.errorDiv(xml"""<div> | |
Syntax error in CSS selector definition: | |
- {stringSelector openOr "N/A"} | |
+ ${stringSelector openOr "N/A"} | |
. | |
The selector will not be applied. | |
- </div>) openOr NodeSeq.Empty | |
+ </div>""") openOr NodeSeq.Empty | |
} | |
/** | |
diff --git a/repos/framework/core/util/src/main/scala/net/liftweb/util/HtmlHelpers.scala b/repos/framework/core/util/src/main/scala/net/liftweb/util/HtmlHelpers.scala | |
index 1c566ac4ff..bf38981435 100644 | |
--- a/repos/framework/core/util/src/main/scala/net/liftweb/util/HtmlHelpers.scala | |
+++ b/repos/framework/core/util/src/main/scala/net/liftweb/util/HtmlHelpers.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package util | |
+import scala.xml.quote._ | |
import scala.language.higherKinds | |
import StringHelpers._ | |
@@ -314,14 +315,14 @@ trait HtmlHelpers extends CssBindImplicits { | |
def errorDiv(body: NodeSeq): Box[NodeSeq] = { | |
Props.mode match { | |
case Props.RunModes.Development | Props.RunModes.Test => | |
- Full(<div class="snippeterror" style="display: block; padding: 4px; margin: 8px; border: 2px solid red"> | |
- {body} | |
+ Full(xml"""<div class="snippeterror" style="display: block; padding: 4px; margin: 8px; border: 2px solid red"> | |
+ ${body} | |
<i>note: this error is displayed in the browser because | |
your application is running in "development" or "test" mode.If you | |
set the system property run.mode=production, this error will not | |
be displayed, but there will be errors in the output logs. | |
</i> | |
- </div>) | |
+ </div>""") | |
case _ => Empty | |
} | |
diff --git a/repos/framework/core/util/src/test/scala/net/liftweb/util/BundleBuilderSpec.scala b/repos/framework/core/util/src/test/scala/net/liftweb/util/BundleBuilderSpec.scala | |
index fe7c505bc0..0ff688ab3b 100644 | |
--- a/repos/framework/core/util/src/test/scala/net/liftweb/util/BundleBuilderSpec.scala | |
+++ b/repos/framework/core/util/src/test/scala/net/liftweb/util/BundleBuilderSpec.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package util | |
+import scala.xml.quote._ | |
import java.util.Locale | |
import xml.NodeSeq | |
@@ -33,30 +34,30 @@ object BundleBuilderSpec extends Specification with XmlMatchers { | |
"BundleBuilder" should { | |
"Build a Bundle" in { | |
val b = BundleBuilder | |
- .convert(<div> | |
+ .convert(xml"""<div> | |
<div name="dog" lang="en">Dog</div> | |
<div name="dog" lang="fr">Chien</div> | |
<div name="cat"><div>hi</div></div> | |
- </div>, | |
+ </div>""", | |
Locale.US) | |
.openOrThrowException("Test") | |
b.getObject("dog") must_== "Dog" | |
- b.getObject("cat").asInstanceOf[NodeSeq] must ==/(<div>hi</div>) | |
+ b.getObject("cat").asInstanceOf[NodeSeq] must ==/(xml"<div>hi</div>") | |
} | |
"Build a Bundle must support default" in { | |
val b = BundleBuilder | |
- .convert(<div> | |
+ .convert(xml"""<div> | |
<div name="dog" lang="zz">Dog</div> | |
<div name="dog" lang="fr" default="true" >Chien</div> | |
<div name="cat"><div>hi</div></div> | |
- </div>, | |
+ </div>""", | |
Locale.US) | |
.openOrThrowException("Test") | |
b.getObject("dog") must_== "Chien" | |
- b.getObject("cat").asInstanceOf[NodeSeq] must ==/(<div>hi</div>) | |
+ b.getObject("cat").asInstanceOf[NodeSeq] must ==/(xml"<div>hi</div>") | |
} | |
} | |
} | |
diff --git a/repos/framework/core/util/src/test/scala/net/liftweb/util/CssSelectorSpec.scala b/repos/framework/core/util/src/test/scala/net/liftweb/util/CssSelectorSpec.scala | |
index 933810a0c0..5c22c7d3b4 100644 | |
--- a/repos/framework/core/util/src/test/scala/net/liftweb/util/CssSelectorSpec.scala | |
+++ b/repos/framework/core/util/src/test/scala/net/liftweb/util/CssSelectorSpec.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package util | |
+import scala.xml.quote._ | |
import org.specs2.matcher.XmlMatchers | |
import org.specs2.mutable.Specification | |
@@ -277,22 +278,22 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
"css bind helpers" should { | |
"clear clearable" in { | |
- ClearClearable(<b><span class="clearable"/></b>) must ==/(<b/>) | |
+ ClearClearable(xml"""<b><span class="clearable"/></b>""") must ==/(xml"<b/>") | |
} | |
"substitute a String by id" in { | |
- ("#foo" #> "hello").apply(<b><span id="foo"/></b>) must ==/(<b>hello</b>) | |
+ ("#foo" #> "hello").apply(xml"""<b><span id="foo"/></b>""") must ==/(xml"<b>hello</b>") | |
} | |
"not duplicate classes" in { | |
def anchor(quesType: String, value: String) = { | |
- <a href="foo" class="selected">(value)</a> | |
+ xml"""<a href="foo" class="selected">(value)</a>""" | |
} | |
var page = 1 | |
var elements = List("1", "2", "3", "4") | |
- val xml = <div class="lift:Bug.attack bug"> | |
+ val xml = xml"""<div class="lift:Bug.attack bug"> | |
<div id="question" class="question"> | |
<a href="#" class="L">1</a> | |
<a href="#" class="U">1</a> | |
@@ -301,7 +302,7 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
<div class="navigation"> | |
<button class="previous">Previous</button> <button class="next">Next</button> | |
</div> | |
- </div> | |
+ </div>""" | |
val sel = | |
".question" #> elements.map( | |
@@ -320,42 +321,42 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
"Compound selector" in { | |
val res = (".foo [href]" #> "http://dog.com" & ".bar [id]" #> "moo") | |
- .apply(<a class="foo bar" href="#"/>) | |
+ .apply(xml"""<a class="foo bar" href="#"/>""") | |
(res \ "@href").text must_== "http://dog.com" | |
(res \ "@id").text must_== "moo" | |
} | |
"not stack overflow on Elem" in { | |
val xf = | |
- "* [id]" #> "xx" & "* [style]" #> "border:thin solid black" & "* *" #> <a/> | |
+ "* [id]" #> "xx" & "* [style]" #> "border:thin solid black" & "* *" #> xml"<a/>" | |
success | |
} | |
"not stack overflow on Elem" in { | |
val xf = | |
- "* [id]" #> "xx" & "* [style]" #> "border:thin solid black" & "* *+" #> <a/> | |
+ "* [id]" #> "xx" & "* [style]" #> "border:thin solid black" & "* *+" #> xml"<a/>" | |
- xf(<div/>) | |
+ xf(xml"<div/>") | |
success | |
} | |
"not stack overflow on Elem" in { | |
val xf = | |
- "* [id]" #> "xx" & "* [style]" #> "border:thin solid black" & "* -*" #> <a/> | |
+ "* [id]" #> "xx" & "* [style]" #> "border:thin solid black" & "* -*" #> xml"<a/>" | |
- xf(<div/>) | |
+ xf(xml"<div/>") | |
success | |
} | |
"data-name selector works" in { | |
- val xf = ";frog" #> <b>hi</b> | |
+ val xf = ";frog" #> xml"<b>hi</b>" | |
- xf(<div><span data-name="frog">Moose</span></div>) must ==/( | |
- <div><b data-name="frog">hi</b></div>) | |
+ xf(xml"""<div><span data-name="frog">Moose</span></div>""") must ==/( | |
+ xml"""<div><b data-name="frog">hi</b></div>""") | |
} | |
"support modifying attributes along with body" in { | |
- val org = <a>foo</a> | |
+ val org = xml"<a>foo</a>" | |
val func = "a [href]" #> "dog" & "a *" #> "bar" | |
val res = func(org) | |
@@ -363,41 +364,41 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
} | |
"substitute a String by id" in { | |
- ("#foo" replaceWith "hello").apply(<b><span id="foo"/></b>) must ==/( | |
- <b>hello</b>) | |
+ ("#foo" replaceWith "hello").apply(xml"""<b><span id="foo"/></b>""") must ==/( | |
+ xml"<b>hello</b>") | |
} | |
"substitute a String by nested class" in { | |
("div .foo" #> "hello").apply( | |
- <b><div><span class="foo"/></div><span><span class="foo"/></span></b>) must ==/( | |
- <b><div>hello</div><span><span class="foo"/></span></b>) | |
+ xml"""<b><div><span class="foo"/></div><span><span class="foo"/></span></b>""") must ==/( | |
+ xml"""<b><div>hello</div><span><span class="foo"/></span></b>""") | |
} | |
"substitute a String by deep nested class" in { | |
("#baz div .foo" #> "hello").apply( | |
- <b><span id="baz"><div><span class="foo"/></div></span><span><span class="foo"/></span></b>) must ==/( | |
- <b><span id="baz"><div>hello</div></span><span><span class="foo"/></span></b>) | |
+ xml"""<b><span id="baz"><div><span class="foo"/></div></span><span><span class="foo"/></span></b>""") must ==/( | |
+ xml"""<b><span id="baz"><div>hello</div></span><span><span class="foo"/></span></b>""") | |
} | |
"insert a String by deep nested class" in { | |
("#baz div .foo *" #> "hello").apply( | |
- <b><span id="baz"><div><span class="foo"/></div></span><span><div><span class="foo"/></div></span></b>) must ==/( | |
- <b><span id="baz"><div><span class="foo">hello</span></div></span><span><div><span class="foo"/></div></span></b>) | |
+ xml"""<b><span id="baz"><div><span class="foo"/></div></span><span><div><span class="foo"/></div></span></b>""") must ==/( | |
+ xml"""<b><span id="baz"><div><span class="foo">hello</span></div></span><span><div><span class="foo"/></div></span></b>""") | |
} | |
"Only apply to the top elem" in { | |
val xf = "^ [href]" #> "wombat" | |
- xf(<a><b>stuff</b></a>) must ==/(<a href="wombat"><b>stuff</b></a>) | |
+ xf(xml"<a><b>stuff</b></a>") must ==/(xml"""<a href="wombat"><b>stuff</b></a>""") | |
} | |
"Select a node" in { | |
- ("#foo ^^" #> "hello").apply(<div><span id="foo"/></div>) must ==/( | |
- <span id="foo"/>) | |
+ ("#foo ^^" #> "hello").apply(xml"""<div><span id="foo"/></div>""") must ==/( | |
+ xml"""<span id="foo"/>""") | |
} | |
"Another nested select" in { | |
- val template = <span> | |
+ val template = xml"""<span> | |
<div id="meow"> | |
<lift:loc locid="asset.import.chooseFile"></lift:loc> | |
<span id="file_upload"></span> | |
@@ -408,9 +409,9 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
<span id="file_upload"></span> | |
<input type="submit" value="import" /><br></br> | |
</div> | |
- </span> | |
+ </span>""" | |
- val xf = "#get ^^" #> "ignore" & "#file_upload" #> <input type="moose"/> | |
+ val xf = "#get ^^" #> "ignore" & "#file_upload" #> xml"""<input type="moose"/>""" | |
val ret = xf(template) | |
@@ -424,7 +425,7 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
} | |
"Child nested select" in { | |
- val template = <span> | |
+ val template = xml"""<span> | |
<div id="meow"> | |
<lift:loc locid="asset.import.chooseFile"></lift:loc> | |
<span id="file_upload"></span> | |
@@ -435,9 +436,9 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
<span id="file_upload"></span> | |
<input type="submit" value="import" /><br></br> | |
</div> | |
- </span> | |
+ </span>""" | |
- val xf = "#get ^*" #> "ignore" & "#file_upload" #> <input type="moose"/> | |
+ val xf = "#get ^*" #> "ignore" & "#file_upload" #> xml"""<input type="moose"/>""" | |
val ret = xf(template) | |
@@ -449,7 +450,7 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
} | |
"Select a node and transform stuff" in { | |
- val ret = ("#foo ^^" #> "hello" & "span [id]" #> "bar")(<span id="foo"/>) | |
+ val ret = ("#foo ^^" #> "hello" & "span [id]" #> "bar")(xml"""<span id="foo"/>""") | |
ret(0).asInstanceOf[Elem].label must_== "span" | |
ret.length must_== 1 | |
@@ -458,7 +459,7 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
"Select a node and transform stuff deeply nested" in { | |
val ret = ("#foo ^^" #> "hello" & "span [id]" #> "bar")( | |
- <div><div><span id="foo"/></div></div>) | |
+ xml"""<div><div><span id="foo"/></div></div>""") | |
ret(0).asInstanceOf[Elem].label must_== "span" | |
ret.length must_== 1 | |
@@ -467,7 +468,7 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
"Select a node and transform stuff deeply nested 2" in { | |
val ret = ("#foo ^^" #> "hello" & "span [id]" #> "bar")( | |
- <div><div><span id="foo2"/><span id="foo3"/><span dog="woof" id="foo"/></div></div>) | |
+ xml"""<div><div><span id="foo2"/><span id="foo3"/><span dog="woof" id="foo"/></div></div>""") | |
ret(0).asInstanceOf[Elem].label must_== "span" | |
ret.length must_== 1 | |
@@ -477,13 +478,13 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
"substitute multiple Strings by id" in { | |
("#foo" #> "hello" & "#baz" #> "bye")( | |
- <b><div id="baz">Hello</div><span id="foo"/></b>) must be_==( | |
- NodeSeq fromSeq <b>{Text("bye")}{Text("hello")}</b>) | |
+ xml"""<b><div id="baz">Hello</div><span id="foo"/></b>""") must be_==( | |
+ NodeSeq fromSeq xml"<b>${Text("bye")}${Text("hello")}</b>") | |
} | |
"bind href and None content" in { | |
val opt: Option[String] = None | |
- val res = ("top *" #> opt & "top [href]" #> "frog")(<top>cat</top>) | |
+ val res = ("top *" #> opt & "top [href]" #> "frog")(xml"<top>cat</top>") | |
res.text must_== "" | |
(res \ "@href").text.mkString must_== "frog" | |
@@ -491,7 +492,7 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
"bind href and Some content" in { | |
val opt: Option[String] = Some("Dog") | |
- val res = ("top *" #> opt & "top [href]" #> "frog")(<top>cat</top>) | |
+ val res = ("top *" #> opt & "top [href]" #> "frog")(xml"<top>cat</top>") | |
res.text must_== "Dog" | |
(res \ "@href").text.mkString must_== "frog" | |
@@ -501,7 +502,7 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
val opt: Option[String] = Some("Dog") | |
val res = | |
("top *" #> opt & "top [meow]" #> "woof" & "top [href]" #> "frog")( | |
- <top href="#">cat</top>) | |
+ xml"""<top href="#">cat</top>""") | |
res.text must_== "Dog" | |
(res \ "@href").text.mkString must_== "frog" | |
@@ -510,31 +511,31 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
"option transform on *" in { | |
val opt: Option[String] = None | |
- val res = ("* *" #> opt.map(ignore => "Dog")).apply(<top>cat</top>) | |
- res.head must_== <top></top> | |
+ val res = ("* *" #> opt.map(ignore => "Dog")).apply(xml"<top>cat</top>") | |
+ res.head must_== xml"<top></top>" | |
} | |
"append attribute to a class with spaces" in { | |
val stuff = List("a", "b") | |
- val res = ("* [class+]" #> stuff).apply(<top class="q">cat</top>) | |
+ val res = ("* [class+]" #> stuff).apply(xml"""<top class="q">cat</top>""") | |
(res \ "@class").text must_== "q a b" | |
} | |
"append attribute to an href" in { | |
val stuff = List("&a=b", "&b=d") | |
- val res = ("* [href+]" #> stuff).apply(<top href="q?z=r">cat</top>) | |
+ val res = ("* [href+]" #> stuff).apply(xml"""<top href="q?z=r">cat</top>""") | |
(res \ "@href").text must_== "q?z=r&a=b&b=d" | |
} | |
"remove an attribute from a class" in { | |
val func = ".foo [class!]" #> "andOther" | |
- (func(<span class="foo andOther" />) \ "@class").text must_== "foo" | |
+ (func(xml"""<span class="foo andOther" />""") \ "@class").text must_== "foo" | |
} | |
"remove an attribute from a class and the attribute if it's the only one left" in { | |
val func = ".foo [class!]" #> "foo" | |
- val res = func(<span class="foo" />) | |
+ val res = func(xml"""<span class="foo" />""") | |
(res \ "@class").length must_== 0 | |
} | |
@@ -542,50 +543,50 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
"Remove a subnode's class attribute" in { | |
val func = ".removeme !!" #> ("td [class!]" #> "removeme") | |
- val res = func.apply(<tr><td class="removeme fish">Hi</td></tr>) | |
+ val res = func.apply(xml"""<tr><td class="removeme fish">Hi</td></tr>""") | |
((res \ "td") \ "@class").text must_== "fish" | |
} | |
"not remove a non-existant class" in { | |
val func = ".foo [class!]" #> "bar" | |
- val res = func(<span class="foo" />) | |
+ val res = func(xml"""<span class="foo" />""") | |
(res \ "@class").text must_== "foo" | |
} | |
"remove an attribute from an attribute" in { | |
val func = "span [href!]" #> "foo" | |
- val res = func(<span href="foo" />) | |
+ val res = func(xml"""<span href="foo" />""") | |
(res \ "@href").length must_== 0 | |
} | |
"not remove a non-existant href" in { | |
val func = "span [href!]" #> "bar" | |
- val res = func(<span href="foo bar" />) | |
+ val res = func(xml"""<span href="foo bar" />""") | |
(res \ "@href").text must_== "foo bar" | |
} | |
"option transform on *" in { | |
val opt: Option[Int] = Full(44) | |
- val res = ("* *" #> opt.map(ignore => "Dog")).apply(<top>cat</top>) | |
- res must ==/(<top>Dog</top>) | |
+ val res = ("* *" #> opt.map(ignore => "Dog")).apply(xml"<top>cat</top>") | |
+ res must ==/(xml"<top>Dog</top>") | |
} | |
"Java number support" in { | |
val f = "a *" #> Full(new java.lang.Long(12)) | |
- val xml = <a>Hello</a> | |
+ val xml = xml"<a>Hello</a>" | |
- f(xml) must ==/(<a>12</a>) | |
+ f(xml) must ==/(xml"<a>12</a>") | |
} | |
"Surround kids" in { | |
- val f = "a <*>" #> <div></div> | |
- val xml = <b>Meow <a href="dog">Cat</a> woof</b> | |
+ val f = "a <*>" #> xml"<div></div>" | |
+ val xml = xml"""<b>Meow <a href="dog">Cat</a> woof</b>""" | |
- f(xml) must ==/(<b>Meow <a href="dog"><div>Cat</div></a> woof</b>) | |
+ f(xml) must ==/(xml"""<b>Meow <a href="dog"><div>Cat</div></a> woof</b>""") | |
} | |
"Andreas's thing doesn't blow up" in { | |
@@ -620,7 +621,7 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
def render = { | |
- "*" #> ((ns: NodeSeq) => renderBlogEntrySummary.apply(ns) ++ <a>hi</a>) | |
+ "*" #> ((ns: NodeSeq) => renderBlogEntrySummary.apply(ns) ++ xml"<a>hi</a>") | |
} | |
render | |
@@ -630,143 +631,143 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
"option transform on *" in { | |
val opt: Box[String] = Empty | |
- val res = ("* *" #> opt.map(ignore => "Dog")).apply(<top>cat</top>) | |
- res.head must_== <top></top> | |
+ val res = ("* *" #> opt.map(ignore => "Dog")).apply(xml"<top>cat</top>") | |
+ res.head must_== xml"<top></top>" | |
} | |
"option transform on *" in { | |
val opt: Box[Int] = Some(44) | |
- val res = ("* *" #> opt.map(ignore => "Dog")).apply(<top>cat</top>) | |
- res must ==/(<top>Dog</top>) | |
+ val res = ("* *" #> opt.map(ignore => "Dog")).apply(xml"<top>cat</top>") | |
+ res must ==/(xml"<top>Dog</top>") | |
} | |
"transform on *" in { | |
- val res = ("* *" #> "Dog").apply(<top>cat</top>) | |
- res must ==/(<top>Dog</top>) | |
+ val res = ("* *" #> "Dog").apply(xml"<top>cat</top>") | |
+ res must ==/(xml"<top>Dog</top>") | |
} | |
"transform child content on *+" in { | |
- val res = ("* *+" #> "moose").apply(<a>I like </a>) | |
+ val res = ("* *+" #> "moose").apply(xml"<a>I like </a>") | |
res.text must_== "I like moose" | |
} | |
"transform child content on -*" in { | |
- val res = ("* -*" #> "moose").apply(<a> I like</a>) | |
+ val res = ("* -*" #> "moose").apply(xml"<a> I like</a>") | |
res.text must_== "moose I like" | |
} | |
"transform on li" in { | |
val res = ("li *" #> List("Woof", "Bark") & ClearClearable)( | |
- <ul><li>meow</li><li class="clearable">a</li><li class="clearable">a</li></ul>) | |
- res must ==/(<ul><li>Woof</li><li>Bark</li></ul>) | |
+ xml"""<ul><li>meow</li><li class="clearable">a</li><li class="clearable">a</li></ul>""") | |
+ res must ==/(xml"<ul><li>Woof</li><li>Bark</li></ul>") | |
} | |
"substitute multiple Strings by id" in { | |
(("#foo" replaceWith "hello") & ("#baz" replaceWith "bye"))( | |
- <b><div id="baz">Hello</div><span id="foo"/></b> | |
- ) must_== (NodeSeq fromSeq <b>{Text("bye")}{Text("hello")}</b>) | |
+ xml"""<b><div id="baz">Hello</div><span id="foo"/></b>""" | |
+ ) must_== (NodeSeq fromSeq xml"<b>${Text("bye")}${Text("hello")}</b>") | |
} | |
"substitute multiple Strings with a List by id" in { | |
("#foo" #> "hello" & "#baz" #> List("bye", "bye"))( | |
- <b><div id="baz">Hello</div><span id="foo"/></b>) must_== | |
- (NodeSeq fromSeq <b>{Text("bye")}{Text("bye")}{Text("hello")}</b>) | |
+ xml"""<b><div id="baz">Hello</div><span id="foo"/></b>""") must_== | |
+ (NodeSeq fromSeq xml"<b>${Text("bye")}${Text("bye")}${Text("hello")}</b>") | |
} | |
"substitute multiple Strings with a List by id" in { | |
(("#foo" replaceWith "hello") & ("#baz" replaceWith List("bye", "bye")))( | |
- <b><div id="baz">Hello</div><span id="foo"/></b>) must_== | |
- (NodeSeq fromSeq <b>{Text("bye")}{Text("bye")}{Text("hello")}</b>) | |
+ xml"""<b><div id="baz">Hello</div><span id="foo"/></b>""") must_== | |
+ (NodeSeq fromSeq xml"<b>${Text("bye")}${Text("bye")}${Text("hello")}</b>") | |
} | |
"substitute multiple Strings with a List of XML by id" in { | |
val answer = | |
- ("#foo" #> "hello" & "#baz" #> List[NodeSeq](<i/>, <i>Meow</i>))( | |
- <b><div frog="dog" id="baz">Hello</div><span id="foo"/></b>) | |
+ ("#foo" #> "hello" & "#baz" #> List[NodeSeq](xml"<i/>", xml"<i>Meow</i>"))( | |
+ xml"""<b><div frog="dog" id="baz">Hello</div><span id="foo"/></b>""") | |
(answer \ "i").length must_== 2 | |
- (answer \ "i")(0) must ==/(<i id="baz" frog="dog"/>) | |
- (answer \ "i")(1) must ==/(<i frog="dog">Meow</i>) | |
+ (answer \ "i")(0) must ==/(xml"""<i id="baz" frog="dog"/>""") | |
+ (answer \ "i")(1) must ==/(xml"""<i frog="dog">Meow</i>""") | |
} | |
"substitute multiple Strings with a List of XML by id" in { | |
val answer = (("#foo" replaceWith "hello") & | |
- ("#baz" replaceWith List[NodeSeq](<i/>, <i>Meow</i>)))( | |
- <b><div frog="dog" id="baz">Hello</div><span id="foo"/></b>) | |
+ ("#baz" replaceWith List[NodeSeq](xml"<i/>", xml"<i>Meow</i>")))( | |
+ xml"""<b><div frog="dog" id="baz">Hello</div><span id="foo"/></b>""") | |
(answer \ "i").length must_== 2 | |
- (answer \ "i")(0) must ==/(<i id="baz" frog="dog"/>) | |
- (answer \ "i")(1) must ==/(<i frog="dog">Meow</i>) | |
+ (answer \ "i")(0) must ==/(xml"""<i id="baz" frog="dog"/>""") | |
+ (answer \ "i")(1) must ==/(xml"""<i frog="dog">Meow</i>""") | |
} | |
"substitute by name" in { | |
- val answer = ("name=moose" #> <input name="goof"/>) | |
- .apply(<div><input name="moose" value="start" id="79"/></div>) | |
+ val answer = ("name=moose" #> xml"""<input name="goof"/>""") | |
+ .apply(xml"""<div><input name="moose" value="start" id="79"/></div>""") | |
(answer \ "input")(0) must ==/( | |
- <input name="goof" value="start" id="79"/>) | |
+ xml"""<input name="goof" value="start" id="79"/>""") | |
} | |
"Deal with NodeSeq as a NodeSeq" in { | |
val f = | |
"h6 *" #> | |
- ((Text("Some awesome ") ++ <strong>text</strong> ++ Text(" here.")): NodeSeq) | |
- val xml = <h6>Dude, where's my car?</h6> | |
+ ((Text("Some awesome ") ++ xml"<strong>text</strong>" ++ Text(" here.")): NodeSeq) | |
+ val xml = xml"<h6>Dude, where's my car?</h6>" | |
val res = f(xml) | |
- res must ==/(<h6>Some awesome <strong>text</strong> here.</h6>) | |
+ res must ==/(xml"<h6>Some awesome <strong>text</strong> here.</h6>") | |
} | |
"substitute by name" in { | |
- val answer = ("name=moose" replaceWith <input name="goof"/>) | |
- .apply(<div><input name="moose" value="start" id="79"/></div>) | |
+ val answer = ("name=moose" replaceWith xml"""<input name="goof"/>""") | |
+ .apply(xml"""<div><input name="moose" value="start" id="79"/></div>""") | |
(answer \ "input")(0) must ==/( | |
- <input name="goof" value="start" id="79"/>) | |
+ xml"""<input name="goof" value="start" id="79"/>""") | |
} | |
"substitute by name with attrs" in { | |
- val answer = ("name=moose" #> <input name="goof" value="8" id="88"/>) | |
- .apply(<div><input name="moose" value="start" id="79"/></div>) | |
+ val answer = ("name=moose" #> xml"""<input name="goof" value="8" id="88"/>""") | |
+ .apply(xml"""<div><input name="moose" value="start" id="79"/></div>""") | |
- (answer \ "input")(0) must ==/(<input name="goof" value="8" id="88"/>) | |
+ (answer \ "input")(0) must ==/(xml"""<input name="goof" value="8" id="88"/>""") | |
} | |
"substitute by name with attrs" in { | |
val answer = | |
- ("name=moose" replaceWith <input name="goof" value="8" id="88"/>) | |
- .apply(<div><input name="moose" value="start" id="79"/></div>) | |
+ ("name=moose" replaceWith xml"""<input name="goof" value="8" id="88"/>""") | |
+ .apply(xml"""<div><input name="moose" value="start" id="79"/></div>""") | |
- (answer \ "input")(0) must ==/(<input name="goof" value="8" id="88"/>) | |
+ (answer \ "input")(0) must ==/(xml"""<input name="goof" value="8" id="88"/>""") | |
} | |
"substitute by a selector with attrs" in { | |
val answer = | |
- ("cute=moose" #> <input name="goof" value="8" id="88"/>).apply( | |
- <div><input name="meow" cute="moose" value="start" id="79"/></div>) | |
+ ("cute=moose" #> xml"""<input name="goof" value="8" id="88"/>""").apply( | |
+ xml"""<div><input name="meow" cute="moose" value="start" id="79"/></div>""") | |
(answer \ "input")(0) must ==/( | |
- <input cute="moose" name="goof" value="8" id="88"/>) | |
+ xml"""<input cute="moose" name="goof" value="8" id="88"/>""") | |
} | |
"substitute by a selector with attrs" in { | |
val answer = | |
- ("cute=moose" replaceWith <input name="goof" value="8" id="88"/>) | |
+ ("cute=moose" replaceWith xml"""<input name="goof" value="8" id="88"/>""") | |
.apply( | |
- <div><input name="meow" cute="moose" value="start" id="79"/></div>) | |
+ xml"""<div><input name="meow" cute="moose" value="start" id="79"/></div>""") | |
(answer \ "input")(0) must ==/( | |
- <input cute="moose" name="goof" value="8" id="88"/>) | |
+ xml"""<input cute="moose" name="goof" value="8" id="88"/>""") | |
} | |
"Map of funcs" in { | |
val func: NodeSeq => NodeSeq = | |
"#horse" #> List(1, 2, 3).map(".item *" #> _) | |
val answer: NodeSeq = func( | |
- <span><div id="horse">frog<span class="item">i</span></div></span>) | |
+ xml"""<span><div id="horse">frog<span class="item">i</span></div></span>""") | |
answer must ==/( | |
- <span><div id="horse">frog<span class="item">1</span></div><div>frog<span class="item">2</span></div><div>frog<span class="item">3</span></div></span>) | |
+ xml"""<span><div id="horse">frog<span class="item">1</span></div><div>frog<span class="item">2</span></div><div>frog<span class="item">3</span></div></span>""") | |
} | |
"maintain unique id attributes provided by transform" in { | |
@@ -777,70 +778,70 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
".thing [id]" #> t | |
})) | |
val answer = | |
- func(<ul class="thinglist"><li id="other" class="thing" /></ul>) | |
+ func(xml"""<ul class="thinglist"><li id="other" class="thing" /></ul>""") | |
answer must ==/( | |
- <ul class="thinglist"><li class="thing" id="xx1"></li><li class="thing" id="xx2"></li><li id="other" class="thing"></li><li class="thing"></li><li class="thing" id="xx4"></li></ul>) | |
+ xml"""<ul class="thinglist"><li class="thing" id="xx1"></li><li class="thing" id="xx2"></li><li id="other" class="thing"></li><li class="thing"></li><li class="thing" id="xx4"></li></ul>""") | |
} | |
"merge classes" in { | |
val answer = | |
- ("cute=moose" #> <input class="a" name="goof" value="8" id="88"/>) | |
+ ("cute=moose" #> xml"""<input class="a" name="goof" value="8" id="88"/>""") | |
.apply( | |
- <div><input name="meow" class="b" cute="moose" value="start" id="79"/></div>) | |
+ xml"""<div><input name="meow" class="b" cute="moose" value="start" id="79"/></div>""") | |
(answer \ "input")(0) must ==/( | |
- <input class="a b" cute="moose" name="goof" value="8" id="88"/>) | |
+ xml"""<input class="a b" cute="moose" name="goof" value="8" id="88"/>""") | |
} | |
"merge classes" in { | |
val answer = | |
- ("cute=moose" replaceWith <input class="a" name="goof" value="8" id="88"/>) | |
+ ("cute=moose" replaceWith xml"""<input class="a" name="goof" value="8" id="88"/>""") | |
.apply( | |
- <div><input name="meow" class="b" cute="moose" value="start" id="79"/></div>) | |
+ xml"""<div><input name="meow" class="b" cute="moose" value="start" id="79"/></div>""") | |
(answer \ "input")(0) must ==/( | |
- <input class="a b" cute="moose" name="goof" value="8" id="88"/>) | |
+ xml"""<input class="a b" cute="moose" name="goof" value="8" id="88"/>""") | |
} | |
"list of strings" in { | |
val answer = | |
- ("#moose *" #> List("a", "b", "c", "woof") & ClearClearable).apply(<ul> | |
+ ("#moose *" #> List("a", "b", "c", "woof") & ClearClearable).apply(xml"""<ul> | |
<li id="moose">first</li> | |
<li class="clearable">second</li> | |
<li class="clearable">Third</li> | |
- </ul>) | |
+ </ul>""") | |
val lis = (answer \ "li").toList | |
lis.length must_== 4 | |
- lis(0) must ==/(<li id="moose">a</li>) | |
- lis(3) must ==/(<li>woof</li>) | |
+ lis(0) must ==/(xml"""<li id="moose">a</li>""") | |
+ lis(3) must ==/(xml"<li>woof</li>") | |
} | |
"list of Nodes" in { | |
val answer = | |
- ("#moose *" #> List[NodeSeq](<i>"a"</i>, | |
+ ("#moose *" #> List[NodeSeq](xml"""<i>"a"</i>""", | |
Text("b"), | |
Text("c"), | |
- <b>woof</b>) & ClearClearable).apply(<ul> | |
+ xml"<b>woof</b>") & ClearClearable).apply(xml"""<ul> | |
<li id="moose">first</li> | |
<li class="clearable">second</li> | |
<li class="clearable">Third</li> | |
- </ul>) | |
+ </ul>""") | |
val lis = (answer \ "li").toList | |
lis.length must_== 4 | |
- lis(0) must ==/(<li id="moose"><i>"a"</i></li>) | |
- lis(3) must ==/(<li><b>woof</b></li>) | |
+ lis(0) must ==/(xml"""<li id="moose"><i>"a"</i></li>""") | |
+ lis(3) must ==/(xml"<li><b>woof</b></li>") | |
} | |
"set href" in { | |
val answer = ("#moose [href]" #> "Hi" & ClearClearable).apply( | |
- <ul><a id="moose" href="meow">first</a><li class="clearable">second</li><li class="clearable">Third</li></ul>) | |
+ xml"""<ul><a id="moose" href="meow">first</a><li class="clearable">second</li><li class="clearable">Third</li></ul>""") | |
(answer \ "a" \ "@href").text must_== "Hi" | |
(answer \ "li").length must_== 0 | |
@@ -848,7 +849,7 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
"set href and subnodes" in { | |
val answer = ("#moose [href]" #> "Hi" & ClearClearable).apply( | |
- <ul><a id="moose" href="meow">first<li class="clearable">second</li><li class="clearable">Third</li></a></ul>) | |
+ xml"""<ul><a id="moose" href="meow">first<li class="clearable">second</li><li class="clearable">Third</li></a></ul>""") | |
(answer \ "a" \ "@href").text must_== "Hi" | |
(answer \\ "li").length must_== 0 | |
@@ -857,26 +858,26 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
"list of strings" in { | |
val answer = | |
(("#moose *" replaceWith List("a", "b", "c", "woof")) & ClearClearable) | |
- .apply(<ul> | |
+ .apply(xml"""<ul> | |
<li id="moose">first</li> | |
<li class="clearable">second</li> | |
<li class="clearable">Third</li> | |
- </ul>) | |
+ </ul>""") | |
val lis = (answer \ "li").toList | |
lis.length must_== 4 | |
- lis(0) must ==/(<li id="moose">a</li>) | |
- lis(3) must ==/(<li>woof</li>) | |
+ lis(0) must ==/(xml"""<li id="moose">a</li>""") | |
+ lis(3) must ==/(xml"<li>woof</li>") | |
} | |
"bind must bind to subnodes" in { | |
- val html = <ul class="users"> | |
+ val html = xml"""<ul class="users"> | |
<li class="user" userid=""> | |
<img class="userimg" src=""/> | |
</li> | |
- </ul> | |
+ </ul>""" | |
val lst = List(1, 2, 3) | |
@@ -888,27 +889,27 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
"list of Nodes" in { | |
val answer = | |
- (("#moose *" replaceWith List[NodeSeq](<i>"a"</i>, | |
+ (("#moose *" replaceWith List[NodeSeq](xml"""<i>"a"</i>""", | |
Text("b"), | |
Text("c"), | |
- <b>woof</b>)) & ClearClearable) | |
- .apply(<ul> | |
+ xml"<b>woof</b>")) & ClearClearable) | |
+ .apply(xml"""<ul> | |
<li id="moose">first</li> | |
<li class="clearable">second</li> | |
<li class="clearable">Third</li> | |
- </ul>) | |
+ </ul>""") | |
val lis = (answer \ "li").toList | |
lis.length must_== 4 | |
- lis(0) must ==/(<li id="moose"><i>"a"</i></li>) | |
- lis(3) must ==/(<li><b>woof</b></li>) | |
+ lis(0) must ==/(xml"""<li id="moose"><i>"a"</i></li>""") | |
+ lis(3) must ==/(xml"<li><b>woof</b></li>") | |
} | |
"set href" in { | |
val answer = (("#moose [href]" replaceWith "Hi") & ClearClearable).apply( | |
- <ul><a id="moose" href="meow">first</a><li class="clearable">second</li><li class="clearable">Third</li></ul>) | |
+ xml"""<ul><a id="moose" href="meow">first</a><li class="clearable">second</li><li class="clearable">Third</li></ul>""") | |
(answer \ "a" \ "@href").text must_== "Hi" | |
(answer \ "li").length must_== 0 | |
@@ -916,7 +917,7 @@ object CssBindHelpersSpec extends Specification with XmlMatchers { | |
"set href and subnodes" in { | |
val answer = (("#moose [href]" replaceWith "Hi") & ClearClearable).apply( | |
- <ul><a id="moose" href="meow">first<li class="clearable">second</li><li class="clearable">Third</li></a></ul>) | |
+ xml"""<ul><a id="moose" href="meow">first<li class="clearable">second</li><li class="clearable">Third</li></a></ul>""") | |
(answer \ "a" \ "@href").text must_== "Hi" | |
(answer \\ "li").length must_== 0 | |
@@ -934,18 +935,18 @@ object CheckTheImplicitConversionsForToCssBindPromoter { | |
"foo" #> "baz" | |
bog #> "Hello" | |
- bog #> <span/> | |
+ bog #> xml"<span/>" | |
bog #> 1 | |
bog #> 'foo | |
bog #> 44L | |
bog #> 1.22 | |
bog #> false | |
- bog #> List(<span/>) | |
- bog #> Full(<span/>) | |
+ bog #> List(xml"<span/>") | |
+ bog #> Full(xml"<span/>") | |
val e: Box[String] = Empty | |
bog #> e | |
- bog #> Some(<span/>) | |
+ bog #> Some(xml"<span/>") | |
val n: Option[String] = None | |
bog #> n | |
@@ -971,18 +972,18 @@ object CheckTheImplicitConversionsForToCssBindPromoter { | |
bog #> nsToSeqString _ | |
val nsf: NodeSeq => NodeSeq = | |
- bog #> "Hello" & bog #> <span/> & bog #> 1 & bog #> 'foo & bog #> 44L & bog #> false | |
+ bog #> "Hello" & bog #> xml"<span/>" & bog #> 1 & bog #> 'foo & bog #> 44L & bog #> false | |
"foo" #> "Hello" | |
- "foo" #> <span/> | |
+ "foo" #> xml"<span/>" | |
"foo" #> 1 | |
"foo" #> 'foo | |
"foo" #> 44L | |
"foo" #> false | |
- "foo" #> List(<span/>) | |
- "foo" #> Full(<span/>) | |
- "foo" #> Some(<span/>) | |
+ "foo" #> List(xml"<span/>") | |
+ "foo" #> Full(xml"<span/>") | |
+ "foo" #> Some(xml"<span/>") | |
"foo" #> List("Hello") | |
"foo" #> Full("Dog") | |
@@ -1005,7 +1006,7 @@ object CheckTheImplicitConversionsForToCssBindPromoter { | |
"#foo" #> Set("a", "b", "c") | |
val nsf2: NodeSeq => NodeSeq = | |
- "foo" #> "Hello" & "foo" #> <span/> & "foo" #> 1 & "foo" #> 'foo & "foo" #> 44L & "foo" #> false | |
+ "foo" #> "Hello" & "foo" #> xml"<span/>" & "foo" #> 1 & "foo" #> 'foo & "foo" #> 44L & "foo" #> false | |
"bar" #> List("1", "2", "3").map(s => "baz" #> s) | |
diff --git a/repos/framework/core/util/src/test/scala/net/liftweb/util/Html5ParserSpec.scala b/repos/framework/core/util/src/test/scala/net/liftweb/util/Html5ParserSpec.scala | |
index 1568d14044..03e7b41d60 100644 | |
--- a/repos/framework/core/util/src/test/scala/net/liftweb/util/Html5ParserSpec.scala | |
+++ b/repos/framework/core/util/src/test/scala/net/liftweb/util/Html5ParserSpec.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package util | |
+import scala.xml.quote._ | |
import xml.Elem | |
import org.specs2.mutable.Specification | |
@@ -35,11 +36,11 @@ object Html5ParserSpec | |
"Htm5 Writer" should { | |
"Write &" in { | |
- toString(<foo baz="&dog"/>) must_== """<foo baz="&dog"></foo>""" | |
+ toString(xml"""<foo baz="&dog"/>""") must_== """<foo baz="&dog"></foo>""" | |
} | |
"ignore attributes that are null" in { | |
- toString(<foo id={None}/>) must_== """<foo></foo>""" | |
+ toString(xml"<foo id=${None}/>") must_== """<foo></foo>""" | |
} | |
} | |
diff --git a/repos/framework/core/util/src/test/scala/net/liftweb/util/HtmlHelpersSpec.scala b/repos/framework/core/util/src/test/scala/net/liftweb/util/HtmlHelpersSpec.scala | |
index 757cdcb333..44c5c209cf 100644 | |
--- a/repos/framework/core/util/src/test/scala/net/liftweb/util/HtmlHelpersSpec.scala | |
+++ b/repos/framework/core/util/src/test/scala/net/liftweb/util/HtmlHelpersSpec.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package util | |
+import scala.xml.quote._ | |
import xml._ | |
import org.specs2.matcher.XmlMatchers | |
@@ -33,15 +34,15 @@ object HtmlHelpersSpec | |
"findBox" should { | |
"find an id" in { | |
- val xml = <foo><bar/>Dog<b><woof id="3"/></b></foo> | |
+ val xml = xml"""<foo><bar/>Dog<b><woof id="3"/></b></foo>""" | |
findBox(xml) { e => | |
e.attribute("id").filter(_.text == "3").map(i => e) | |
- }.openOrThrowException("Test") must ==/(<woof id="3"/>) | |
+ }.openOrThrowException("Test") must ==/(xml"""<woof id="3"/>""") | |
} | |
"not find an ide" in { | |
- val xml = <foo><bar/>Dog<b><woof ide="3"/></b></foo> | |
+ val xml = xml"""<foo><bar/>Dog<b><woof ide="3"/></b></foo>""" | |
findBox(xml) { e => | |
e.attribute("id").filter(_.text == "3").map(i => e) | |
@@ -49,7 +50,7 @@ object HtmlHelpersSpec | |
} | |
"not find a the wrong id" in { | |
- val xml = <foo><bar/>Dog<b><woof ide="4"/></b></foo> | |
+ val xml = xml"""<foo><bar/>Dog<b><woof ide="4"/></b></foo>""" | |
findBox(xml) { e => | |
e.attribute("id").filter(_.text == "3").map(i => e) | |
@@ -59,15 +60,15 @@ object HtmlHelpersSpec | |
"findOption" should { | |
"find an id" in { | |
- val xml = <foo><bar/>Dog<b><woof id="3"/></b></foo> | |
+ val xml = xml"""<foo><bar/>Dog<b><woof id="3"/></b></foo>""" | |
findOption(xml) { e => | |
e.attribute("id").filter(_.text == "3").map(i => e) | |
- }.get must ==/(<woof id="3"/>) | |
+ }.get must ==/(xml"""<woof id="3"/>""") | |
} | |
"not find an ide" in { | |
- val xml = <foo><bar/>Dog<b><woof ide="3"/></b></foo> | |
+ val xml = xml"""<foo><bar/>Dog<b><woof ide="3"/></b></foo>""" | |
findOption(xml) { e => | |
e.attribute("id").filter(_.text == "3").map(i => e) | |
@@ -75,7 +76,7 @@ object HtmlHelpersSpec | |
} | |
"not find a the wrong id" in { | |
- val xml = <foo><bar/>Dog<b><woof ide="4"/></b></foo> | |
+ val xml = xml"""<foo><bar/>Dog<b><woof ide="4"/></b></foo>""" | |
findOption(xml) { e => | |
e.attribute("id").filter(_.text == "3").map(i => e) | |
@@ -84,15 +85,15 @@ object HtmlHelpersSpec | |
} | |
"findId" should { | |
- val xml = <whoa> | |
+ val xml = xml"""<whoa> | |
<thing id="boom">Boom</thing> | |
<other-thing id="other-boom">Other boom</other-thing> | |
- </whoa> | |
+ </whoa>""" | |
"find the element with a requested id in a NodeSeq" in { | |
findId(xml, "boom") must beLike { | |
case Some(element) => | |
- element must ==/(<thing id="boom">Boom</thing>) | |
+ element must ==/(xml"""<thing id="boom">Boom</thing>""") | |
} | |
} | |
@@ -105,33 +106,33 @@ object HtmlHelpersSpec | |
} | |
"provide an Empty if no ide is foud in a NodeSeq when no id is requested" in { | |
- findId(<test />) must_== Empty | |
+ findId(xml"<test />") must_== Empty | |
} | |
} | |
"head removal" should { | |
"remove <head>" in { | |
- Helpers.stripHead(<head><i>hello</i></head>) must ==/(<i>hello</i>) | |
+ Helpers.stripHead(xml"<head><i>hello</i></head>") must ==/(xml"<i>hello</i>") | |
} | |
"ignore non-head" in { | |
- Helpers.stripHead(<head3><i>hello</i></head3>) must ==/( | |
- <head3><i>hello</i></head3>) | |
+ Helpers.stripHead(xml"<head3><i>hello</i></head3>") must ==/( | |
+ xml"<head3><i>hello</i></head3>") | |
} | |
"String subhead" in { | |
- Helpers.stripHead(<head3><i><head>hello</head></i></head3>) must ==/( | |
- <head3><i>hello</i></head3>) | |
+ Helpers.stripHead(xml"<head3><i><head>hello</head></i></head3>") must ==/( | |
+ xml"<head3><i>hello</i></head3>") | |
} | |
} | |
"removeAttribute" should { | |
- val element = <boom attribute="hello" otherAttribute="good-bye" /> | |
+ val element = xml"""<boom attribute="hello" otherAttribute="good-bye" />""" | |
"remove the specified attribute from a provided element" in { | |
val removed = removeAttribute("attribute", element) | |
- removed must ==/(<boom otherAttribute="good-bye" />) | |
+ removed must ==/(xml"""<boom otherAttribute="good-bye" />""") | |
} | |
"remove the specified attribute from a provided MetaData list" in { | |
@@ -144,22 +145,22 @@ object HtmlHelpersSpec | |
"addCssClass" should { | |
"add a new attribute if no class attribute exists" in { | |
- (addCssClass("foo", <b/>) \ "@class").text must_== "foo" | |
+ (addCssClass("foo", xml"<b/>") \ "@class").text must_== "foo" | |
} | |
"append to an existing class attribute if it already exists" in { | |
- (addCssClass("foo", <b class="dog"/>) \ "@class").text must_== "dog foo" | |
+ (addCssClass("foo", xml"""<b class="dog"/>""") \ "@class").text must_== "dog foo" | |
} | |
} | |
"ensureUniqueId" should { | |
"leave things unchanged if no ids collide" in { | |
- val xml = <boom id="thing"> | |
+ val xml = xml"""<boom id="thing"> | |
<hello id="other-thing" /> | |
<bye id="third-thing" /> | |
- </boom> | |
+ </boom>""" | |
- val uniqued = <wrapper>{ensureUniqueId(xml).head}</wrapper> | |
+ val uniqued = xml"<wrapper>${ensureUniqueId(xml).head}</wrapper>" | |
(uniqued must \("boom", "id" -> "thing")) and | |
(uniqued must \\("hello", "id" -> "other-thing")) and | |
@@ -168,27 +169,27 @@ object HtmlHelpersSpec | |
"strip the ids if elements have an id matching a previous one" in { | |
val xml = Group( | |
- <boom id="thing" /> | |
+ xml"""<boom id="thing" /> | |
<hello id="thing" /> | |
- <bye id="thing" /> | |
+ <bye id="thing" />""" | |
) | |
val uniqued = NodeSeq.seqToNodeSeq(ensureUniqueId(xml).flatten) | |
uniqued must ==/( | |
- <boom id="thing" /> | |
+ xml"""<boom id="thing" /> | |
<hello /> | |
- <bye /> | |
+ <bye />""" | |
) | |
} | |
"leave child element ids alone even if they match the ids of the root element or each other" in { | |
- val xml = <boom id="thing"> | |
+ val xml = xml"""<boom id="thing"> | |
<hello id="thing" /> | |
<bye id="thing" /> | |
- </boom> | |
+ </boom>""" | |
- val uniqued = <wrapper>{ensureUniqueId(xml).head}</wrapper> | |
+ val uniqued = xml"<wrapper>${ensureUniqueId(xml).head}</wrapper>" | |
(uniqued must \\("hello", "id" -> "thing")) and | |
(uniqued must \\("bye", "id" -> "thing")) | |
@@ -197,12 +198,12 @@ object HtmlHelpersSpec | |
"deepEnsureUniqueId" should { | |
"leave things unchanged if no ids collide" in { | |
- val xml = <boom id="thing"> | |
+ val xml = xml"""<boom id="thing"> | |
<hello id="other-thing" /> | |
<bye id="third-thing" /> | |
- </boom> | |
+ </boom>""" | |
- val uniqued = <wrapper>{deepEnsureUniqueId(xml).head}</wrapper> | |
+ val uniqued = xml"<wrapper>${deepEnsureUniqueId(xml).head}</wrapper>" | |
(uniqued must \("boom", "id" -> "thing")) and | |
(uniqued must \\("hello", "id" -> "other-thing")) and | |
@@ -211,33 +212,33 @@ object HtmlHelpersSpec | |
"strip the ids if elements have an id matching a previous one" in { | |
val xml = Group( | |
- <boom id="thing" /> | |
+ xml"""<boom id="thing" /> | |
<hello id="thing" /> | |
- <bye id="thing" /> | |
+ <bye id="thing" />""" | |
) | |
val uniqued = NodeSeq.seqToNodeSeq(deepEnsureUniqueId(xml).flatten) | |
uniqued must ==/( | |
- <boom id="thing" /> | |
+ xml"""<boom id="thing" /> | |
<hello /> | |
- <bye /> | |
+ <bye />""" | |
) | |
} | |
"strip child element ids alone if they match the ids of the root element or each other" in { | |
- val xml = <boom id="thing"> | |
+ val xml = xml"""<boom id="thing"> | |
<hello id="thing" /> | |
<good id="other-thing">Boom</good> | |
<bye id="other-thing"> | |
<other id="other-thing" /> | |
</bye> | |
- </boom> | |
+ </boom>""" | |
- val uniqued = <wrapper>{deepEnsureUniqueId(xml).head}</wrapper> | |
+ val uniqued = xml"<wrapper>${deepEnsureUniqueId(xml).head}</wrapper>" | |
uniqued must ==/( | |
- <wrapper> | |
+ xml"""<wrapper> | |
<boom id="thing"> | |
<hello /> | |
<good id="other-thing">Boom</good> | |
@@ -245,54 +246,54 @@ object HtmlHelpersSpec | |
<other /> | |
</bye> | |
</boom> | |
- </wrapper> | |
+ </wrapper>""" | |
) | |
} | |
} | |
"ensureId" should { | |
"if the first element has an id, replace it with the specified one" in { | |
- val xml = <boom id="thing"> | |
+ val xml = xml"""<boom id="thing"> | |
<hello id="thing" /> | |
<good id="other-thing">Boom</good> | |
<bye id="other-thing"> | |
<other id="other-thing" /> | |
</bye> | |
- </boom> | |
+ </boom>""" | |
- val uniqued = <wrapper>{ensureId(xml, "other-thinger").head}</wrapper> | |
+ val uniqued = xml"<wrapper>${ensureId(xml, "other-thinger").head}</wrapper>" | |
uniqued must \("boom", "id" -> "other-thinger") | |
} | |
"if the first element has no id, give it the specified one" in { | |
- val xml = <boom> | |
+ val xml = xml"""<boom> | |
<hello id="thing" /> | |
<good id="other-thing">Boom</good> | |
<bye id="other-thing"> | |
<other id="other-thing" /> | |
</bye> | |
- </boom> | |
+ </boom>""" | |
- val uniqued = <wrapper>{ensureId(xml, "other-thinger").head}</wrapper> | |
+ val uniqued = xml"<wrapper>${ensureId(xml, "other-thinger").head}</wrapper>" | |
uniqued must \("boom", "id" -> "other-thinger") | |
} | |
"not affect other elements" in { | |
val xml = Group( | |
- <boom id="thing" /> | |
+ xml"""<boom id="thing" /> | |
<hello id="thing" /> | |
- <bye id="thing" /> | |
+ <bye id="thing" />""" | |
) | |
val uniqued = | |
NodeSeq.seqToNodeSeq(ensureId(xml, "other-thinger").flatten) | |
uniqued must ==/( | |
- <boom id="other-thinger" /> | |
+ xml"""<boom id="other-thinger" /> | |
<hello id="thing" /> | |
- <bye id="thing" /> | |
+ <bye id="thing" />""" | |
) | |
} | |
} | |
diff --git a/repos/framework/core/util/src/test/scala/net/liftweb/util/HttpHelpersSpec.scala b/repos/framework/core/util/src/test/scala/net/liftweb/util/HttpHelpersSpec.scala | |
index 508c73bed3..2b195bf6a2 100644 | |
--- a/repos/framework/core/util/src/test/scala/net/liftweb/util/HttpHelpersSpec.scala | |
+++ b/repos/framework/core/util/src/test/scala/net/liftweb/util/HttpHelpersSpec.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package util | |
+import scala.xml.quote._ | |
import org.specs2.matcher.XmlMatchers | |
import org.specs2.mutable.Specification | |
@@ -69,10 +70,10 @@ object HttpHelpersSpec | |
} | |
"a noHtmlTag" in { | |
"returning true if a xml node doesn't contain the html tag" in { | |
- noHtmlTag(<a><b></b></a>) must beTrue | |
+ noHtmlTag(xml"<a><b></b></a>") must beTrue | |
} | |
"returning false if a xml node contains the html tag" in { | |
- noHtmlTag(<a><html></html></a>) must beFalse | |
+ noHtmlTag(xml"<a><html></html></a>") must beFalse | |
} | |
} | |
"a toHashMap function transforming a Map to a mutable HashMap" in { | |
@@ -94,10 +95,10 @@ object HttpHelpersSpec | |
} | |
"a findOrAddId function" in { | |
"returning an element and its id if found" in { | |
- findOrAddId(<a id="1"></a>) must_== (<a id="1"></a>, "1") | |
+ findOrAddId(xml"""<a id="1"></a>""") must_== (xml"""<a id="1"></a>""", "1") | |
} | |
"returning an element with a random id if not found" in { | |
- val (e, id) = findOrAddId(<a></a>) | |
+ val (e, id) = findOrAddId(xml"<a></a>") | |
e must \("@id") | |
// id must beMatching("R\\[a-zA-Z0-9]*") | |
} | |
diff --git a/repos/framework/core/util/src/test/scala/net/liftweb/util/MailerSpec.scala b/repos/framework/core/util/src/test/scala/net/liftweb/util/MailerSpec.scala | |
index 2366751f81..7adfa576e0 100644 | |
--- a/repos/framework/core/util/src/test/scala/net/liftweb/util/MailerSpec.scala | |
+++ b/repos/framework/core/util/src/test/scala/net/liftweb/util/MailerSpec.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package util | |
+import scala.xml.quote._ | |
import javax.mail.internet.{MimeMessage, MimeMultipart} | |
import org.specs2.mutable.Specification | |
@@ -100,7 +101,7 @@ object MailerSpec extends Specification { | |
Subject("This is a rich email"), | |
To("recipient@nowhere.com"), | |
XHTMLMailBodyType( | |
- <html> <body>Here is some rich text</body> </html>) | |
+ xml"<html> <body>Here is some rich text</body> </html>") | |
) | |
} | |
@@ -121,7 +122,7 @@ object MailerSpec extends Specification { | |
Subject("This is a mixed email"), | |
To("recipient@nowhere.com"), | |
XHTMLPlusImages( | |
- <html> <body>Here is some rich text</body> </html>, | |
+ xml"<html> <body>Here is some rich text</body> </html>", | |
PlusImageHolder("awesome.pdf", | |
"text/html", | |
attachmentBytes, | |
diff --git a/repos/framework/core/util/src/test/scala/net/liftweb/util/PCDataXmlParserSpec.scala b/repos/framework/core/util/src/test/scala/net/liftweb/util/PCDataXmlParserSpec.scala | |
index 0b214cb9cb..544df9fe69 100644 | |
--- a/repos/framework/core/util/src/test/scala/net/liftweb/util/PCDataXmlParserSpec.scala | |
+++ b/repos/framework/core/util/src/test/scala/net/liftweb/util/PCDataXmlParserSpec.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package util | |
+import scala.xml.quote._ | |
import org.specs2.matcher.XmlMatchers | |
import org.specs2.mutable.Specification | |
@@ -67,12 +68,12 @@ object PCDataXmlParserSpec extends Specification with XmlMatchers { | |
"PCDataMarkupParser" should { | |
"Parse a document with whitespace" in { | |
PCDataXmlParser(data1).openOrThrowException("Test") must ==/( | |
- <html>dude</html>) | |
+ xml"<html>dude</html>") | |
} | |
"Parse a document with doctype" in { | |
PCDataXmlParser(data2).openOrThrowException("Test") must ==/( | |
- <html>dude</html>) | |
+ xml"<html>dude</html>") | |
} | |
"Parse a document with xml and doctype" in { | |
diff --git a/repos/framework/core/util/src/test/scala/net/liftweb/util/XmlParserSpec.scala b/repos/framework/core/util/src/test/scala/net/liftweb/util/XmlParserSpec.scala | |
index 86712a5b0b..ff6d57d165 100644 | |
--- a/repos/framework/core/util/src/test/scala/net/liftweb/util/XmlParserSpec.scala | |
+++ b/repos/framework/core/util/src/test/scala/net/liftweb/util/XmlParserSpec.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package util | |
+import scala.xml.quote._ | |
import java.io.ByteArrayInputStream | |
import xml.{Text, Unparsed} | |
@@ -32,13 +33,13 @@ object XmlParserSpec extends Specification with XmlMatchers { | |
"Multiple attributes with same name, but different namespace" should { | |
"parse correctly" >> { | |
- val actual = <lift:surround with="base" at="body"> | |
+ val actual = xml"""<lift:surround with="base" at="body"> | |
<lift:Menu.builder li_path:class="p" li_item:class="i"/> | |
- </lift:surround> | |
+ </lift:surround>""" | |
- val expected = <lift:surround with="base" at="body"> | |
+ val expected = xml"""<lift:surround with="base" at="body"> | |
<lift:Menu.builder li_path:class="p" li_item:class="i"/> | |
- </lift:surround> | |
+ </lift:surround>""" | |
val bis = new ByteArrayInputStream(actual.toString.getBytes("UTF-8")) | |
val parsed = PCDataXmlParser(bis).openOrThrowException("Test") | |
@@ -47,9 +48,9 @@ object XmlParserSpec extends Specification with XmlMatchers { | |
} | |
"XML can contain PCData" in { | |
- val data = <foo>{ | |
+ val data = xml"""<foo>${ | |
PCData("Hello Yak") | |
- }</foo> | |
+ }</foo>""" | |
val str = AltXML.toXML(data, false, true) | |
@@ -57,9 +58,9 @@ object XmlParserSpec extends Specification with XmlMatchers { | |
} | |
"XML can contain Unparsed" in { | |
- val data = <foo>{ | |
+ val data = xml"""<foo>${ | |
Unparsed("Hello & goodbye > <yak Yak") | |
- }</foo> | |
+ }</foo>""" | |
val str = AltXML.toXML(data, false, true) | |
@@ -67,17 +68,17 @@ object XmlParserSpec extends Specification with XmlMatchers { | |
} | |
"XML cannot contain Control characters" in { | |
- val data = <foo> | |
- { | |
+ val data = xml"""<foo> | |
+ ${ | |
'\u0085' | |
- }{ | |
+ }${ | |
Text("hello \u0000 \u0085 \u0080") | |
- }{ | |
+ }${ | |
"hello \u0000 \u0003 \u0085 \u0080" | |
- }{ | |
+ }${ | |
'\u0003' | |
} | |
- </foo> | |
+ </foo>""" | |
val str = AltXML.toXML(data, false, true) | |
diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/AjaxMapper.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/AjaxMapper.scala | |
index 1271eac6be..8ca0e74561 100644 | |
--- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/AjaxMapper.scala | |
+++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/AjaxMapper.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package mapper | |
+import scala.xml.quote._ | |
import scala.xml.Node | |
import net.liftweb.http.SHtml | |
@@ -28,11 +29,11 @@ trait AjaxEditableField[FieldType, OwnerType <: Mapper[OwnerType]] | |
extends MappedField[FieldType, OwnerType] { | |
override def asHtml: Node = | |
if (editableField) { | |
- <xml:group>{ | |
+ xml"""<xml:group>${ | |
toForm.map { form => | |
SHtml.ajaxEditable(super.asHtml, form, () => {fieldOwner.save; onSave; net.liftweb.http.js.JsCmds.Noop}) | |
} openOr super.asHtml | |
- }</xml:group> | |
+ }</xml:group>""" | |
} else { | |
super.asHtml | |
} | |
diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedDate.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedDate.scala | |
index 8eea509e16..1f547007a8 100644 | |
--- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedDate.scala | |
+++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedDate.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package mapper | |
+import scala.xml.quote._ | |
import java.sql.{ResultSet, Types} | |
import java.util.Date | |
import java.lang.reflect.Method | |
@@ -152,9 +153,9 @@ abstract class MappedDate[T <: Mapper[T]](val fieldOwner: T) | |
S.fmapFunc({ s: List[String] => | |
this.setFromAny(s) | |
}) { funcName => | |
- Full(appendFieldId(<input type={formInputType} | |
- name={funcName} | |
- value={get match {case null => "" case s => format(s)}}/>)) | |
+ Full(appendFieldId(xml"""<input type=${formInputType} | |
+ name=${funcName} | |
+ value=${get match {case null => "" case s => format(s)}}/>""")) | |
} | |
override def setFromAny(f: Any): Date = f match { | |
diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedDateTime.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedDateTime.scala | |
index c89982643c..59386d7821 100644 | |
--- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedDateTime.scala | |
+++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedDateTime.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package mapper | |
+import scala.xml.quote._ | |
import java.sql.{ResultSet, Types} | |
import java.util.Date | |
import java.lang.reflect.Method | |
@@ -145,9 +146,9 @@ abstract class MappedDateTime[T <: Mapper[T]](val fieldOwner: T) | |
S.fmapFunc({ s: List[String] => | |
this.setFromAny(s) | |
}) { funcName => | |
- Full(appendFieldId(<input type={formInputType} | |
- name={funcName} | |
- value={get match {case null => "" case s => format(s)}}/>)) | |
+ Full(appendFieldId(xml"""<input type=${formInputType} | |
+ name=${funcName} | |
+ value=${get match {case null => "" case s => format(s)}}/>""")) | |
} | |
override def setFromAny(f: Any): Date = f match { | |
diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedField.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedField.scala | |
index 7dd2a521a7..2e8237fcb4 100644 | |
--- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedField.scala | |
+++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedField.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package mapper | |
+import scala.xml.quote._ | |
import scala.collection.mutable._ | |
import java.lang.reflect.Method | |
import scala.xml._ | |
@@ -248,14 +249,14 @@ trait MappedNullableField[ | |
S.fmapFunc({ s: List[String] => | |
this.setFromAny(s) | |
}) { funcName => | |
- Full(appendFieldId(<input type={formInputType} | |
- name={funcName} | |
- value={get match { | |
+ Full(appendFieldId(xml"""<input type=${formInputType} | |
+ name=${funcName} | |
+ value=${get match { | |
case null => "" | |
case Full(null) => "" | |
case Full(s) => s.toString | |
case _ => "" | |
- }}/>)) | |
+ }}/>""")) | |
} | |
} | |
@@ -479,9 +480,9 @@ trait MappedField[FieldType <: Any, OwnerType <: Mapper[OwnerType]] | |
S.fmapFunc({ s: List[String] => | |
this.setFromAny(s) | |
}) { funcName => | |
- Full(appendFieldId(<input type={formInputType} | |
- name={funcName} | |
- value={get match {case null => "" case s => s.toString}}/>)) | |
+ Full(appendFieldId(xml"""<input type=${formInputType} | |
+ name=${funcName} | |
+ value=${get match {case null => "" case s => s.toString}}/>""")) | |
} | |
/** | |
diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedForeignKey.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedForeignKey.scala | |
index ad753b5c48..58f86a7043 100644 | |
--- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedForeignKey.scala | |
+++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedForeignKey.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package mapper | |
+import scala.xml.quote._ | |
import common._ | |
import scala.xml.{NodeSeq, Text, Elem} | |
@@ -105,7 +106,7 @@ trait MappedForeignKey[ | |
case xs => | |
Full(SHtml.selectObj(xs, Full(this.get), this.set)) | |
- }.openOr(<span>{immutableMsg}</span>)) | |
+ }.openOr(xml"<span>${immutableMsg}</span>")) | |
/** | |
* Is the key defined | |
diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedPassword.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedPassword.scala | |
index 9c762974e2..8c30ae6e4a 100644 | |
--- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedPassword.scala | |
+++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedPassword.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package mapper | |
+import scala.xml.quote._ | |
import net.liftweb.util.Helpers._ | |
import net.liftweb.util.FatLazy | |
import java.sql.{ResultSet, Types} | |
@@ -202,10 +203,10 @@ abstract class MappedPassword[T <: Mapper[T]](val fieldOwner: T) | |
S.fmapFunc({ s: List[String] => | |
this.setFromAny(s) | |
}) { funcName => | |
- Full(<span>{appendFieldId(<input type={formInputType} name={funcName} | |
- value={get.toString}/>)} {S.?("repeat")} <input | |
- type={formInputType} name={funcName} | |
- value={get.toString}/></span>) | |
+ Full(xml"""<span>${appendFieldId(xml"""<input type=${formInputType} name=${funcName} | |
+ value=${get.toString}/>""")} ${S.?("repeat")} <input | |
+ type=${formInputType} name=${funcName} | |
+ value=${get.toString}/></span>""") | |
} | |
} | |
diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedString.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedString.scala | |
index 3228f60fb1..c28b004c7e 100644 | |
--- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedString.scala | |
+++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedString.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package mapper | |
+import scala.xml.quote._ | |
import java.sql.{ResultSet, Types} | |
import java.lang.reflect.Method | |
import util._ | |
@@ -155,9 +156,9 @@ abstract class MappedString[T <: Mapper[T]](val fieldOwner: T, val maxLen: Int) | |
this.setFromAny(s) | |
}) { name => | |
Full( | |
- appendFieldId(<input type={formInputType} maxlength={maxLen.toString} | |
- name={name} | |
- value={get match {case null => "" case s => s.toString}}/>)) | |
+ appendFieldId(xml"""<input type=${formInputType} maxlength=${maxLen.toString} | |
+ name=${name} | |
+ value=${get match {case null => "" case s => s.toString}}/>""")) | |
} | |
protected def i_obscure_!(in: String): String = { | |
diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedTextarea.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedTextarea.scala | |
index 1d6d2fa815..18ccad5194 100644 | |
--- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedTextarea.scala | |
+++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedTextarea.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package mapper | |
+import scala.xml.quote._ | |
import scala.xml.{NodeSeq, Elem} | |
import net.liftweb.http.S | |
import net.liftweb.http.S._ | |
@@ -33,12 +34,12 @@ abstract class MappedTextarea[T <: Mapper[T]](owner: T, maxLen: Int) | |
S.fmapFunc({ s: List[String] => | |
this.setFromAny(s) | |
}) { funcName => | |
- Full(appendFieldId(<textarea name={funcName} | |
- rows={textareaRows.toString} | |
- cols={textareaCols.toString}>{ | |
+ Full(appendFieldId(xml"""<textarea name=${funcName} | |
+ rows=${textareaRows.toString} | |
+ cols=${textareaCols.toString}>${ | |
get match { | |
case null => "" | |
- case s => s}}</textarea>)) | |
+ case s => s}}</textarea>""")) | |
} | |
} | |
diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedTime.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedTime.scala | |
index 150b8ab030..c4b3fb490a 100644 | |
--- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedTime.scala | |
+++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedTime.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package mapper | |
+import scala.xml.quote._ | |
import java.sql.{ResultSet, Types} | |
import java.util.Date | |
import java.lang.reflect.Method | |
@@ -152,9 +153,9 @@ abstract class MappedTime[T <: Mapper[T]](val fieldOwner: T) | |
S.fmapFunc({ s: List[String] => | |
this.setFromAny(s) | |
}) { funcName => | |
- Full(appendFieldId(<input type={formInputType} | |
- name={funcName} | |
- value={get match {case null => "" case s => format(s)}}/>)) | |
+ Full(appendFieldId(xml"""<input type=${formInputType} | |
+ name=${funcName} | |
+ value=${get match {case null => "" case s => format(s)}}/>""")) | |
} | |
override def setFromAny(f: Any): Date = f match { | |
diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/Mapper.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/Mapper.scala | |
index 6545b78e76..d3ab342b96 100644 | |
--- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/Mapper.scala | |
+++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/Mapper.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package mapper | |
+import scala.xml.quote._ | |
import scala.xml.{Elem, NodeSeq} | |
import net.liftweb.http.S | |
import net.liftweb.http.js._ | |
@@ -231,12 +232,12 @@ trait Mapper[A <: Mapper[A]] | |
def toForm(button: Box[String], f: A => Any): NodeSeq = | |
getSingleton.toForm(this) ++ S | |
.fmapFunc((ignore: List[String]) => f(this)) { (name: String) => | |
- ( <input type='hidden' name={name} value="n/a" />) | |
+ ( xml"""<input type='hidden' name=${name} value="n/a" />""") | |
} ++ | |
(button.map(b => | |
getSingleton.formatFormElement( | |
- <xml:group> </xml:group>, | |
- <input type="submit" value={b}/>)) openOr scala.xml.Text("")) | |
+ xml"<xml:group> </xml:group>", | |
+ xml"""<input type="submit" value=${b}/>""")) openOr scala.xml.Text("")) | |
def toForm(button: Box[String], | |
redoSnippet: NodeSeq => NodeSeq, | |
@@ -253,11 +254,11 @@ trait Mapper[A <: Mapper[A]] | |
getSingleton.toForm(this) ++ S.fmapFunc( | |
(ignore: List[String]) => doSubmit())( | |
- name => <input type='hidden' name={name} value="n/a" />) ++ | |
+ name => xml"""<input type='hidden' name=${name} value="n/a" />""") ++ | |
(button.map(b => | |
getSingleton.formatFormElement( | |
- <xml:group> </xml:group>, | |
- <input type="submit" value={b}/>)) openOr scala.xml.Text("")) | |
+ xml"<xml:group> </xml:group>", | |
+ xml"""<input type="submit" value=${b}/>""")) openOr scala.xml.Text("")) | |
} | |
def saved_? : Boolean = getSingleton.saved_?(this) | |
diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MetaMapper.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MetaMapper.scala | |
index 98b5f3349f..b351050bd1 100644 | |
--- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MetaMapper.scala | |
+++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MetaMapper.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package mapper | |
+import scala.xml.quote._ | |
import java.lang.reflect.Method | |
import java.sql.{ResultSet, Types, PreparedStatement} | |
import java.util.{Date, Locale} | |
@@ -61,7 +62,7 @@ object MapperRules extends Factory { | |
* will be used for all MetaMappers, unless they've been | |
* explicitly changed. | |
*/ | |
- var displayNameToHeaderElement: String => NodeSeq = in => <th>{in}</th> | |
+ var displayNameToHeaderElement: String => NodeSeq = in => xml"<th>${in}</th>" | |
/** | |
* This function converts an element into the appropriate | |
@@ -71,7 +72,7 @@ object MapperRules extends Factory { | |
* will be used for all MetaMappers, unless they've been | |
* explicitly changed. | |
*/ | |
- var displayFieldAsLineElement: NodeSeq => NodeSeq = in => <td>{in}</td> | |
+ var displayFieldAsLineElement: NodeSeq => NodeSeq = in => xml"<td>${in}</td>" | |
/** | |
* This function is the global (for all MetaMappers that have | |
@@ -82,10 +83,10 @@ object MapperRules extends Factory { | |
* you can change the function to display something else. | |
*/ | |
var formatFormElement: (NodeSeq, NodeSeq) => NodeSeq = (name, form) => | |
- <xml:group><tr> | |
- <td>{name}</td> | |
- <td>{form}</td> | |
- </tr></xml:group> | |
+ xml"""<xml:group><tr> | |
+ <td>${name}</td> | |
+ <td>${form}</td> | |
+ </tr></xml:group>""" | |
/** | |
* What are the rules and mechanisms for putting quotes around table names? | |
@@ -1503,7 +1504,7 @@ trait MetaMapper[A <: Mapper[A]] extends BaseMetaMapper with Mapper[A] { | |
mft <- mappedFieldList if mft.field.dbDisplay_? | |
field = ??(mft.method, toLine) | |
} yield { | |
- <span>{field.displayName}={field.asHtml} </span> | |
+ xml"<span>${field.displayName}=${field.asHtml} </span>" | |
}) ::: List(Text(" }")) | |
/** | |
diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/ProtoUser.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/ProtoUser.scala | |
index 5d6fa88ff8..805e0faf35 100644 | |
--- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/ProtoUser.scala | |
+++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/ProtoUser.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package mapper | |
+import scala.xml.quote._ | |
import net.liftweb.http._ | |
import js._ | |
import JsCmds._ | |
@@ -176,7 +177,7 @@ trait ProtoUser[T <: ProtoUser[T]] | |
case _ => email.get | |
} | |
- def niceNameWEmailLink = <a href={"mailto:"+email.get}>{niceName}</a> | |
+ def niceNameWEmailLink = xml"<a href=${"mailto:"+email.get}>${niceName}</a>" | |
} | |
/** | |
diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/view/TableEditor.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/view/TableEditor.scala | |
index 0df6b4e756..edc30da0f3 100644 | |
--- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/view/TableEditor.scala | |
+++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/view/TableEditor.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package mapper | |
package view | |
+import scala.xml.quote._ | |
import xml.{NodeSeq, Text} | |
import common.{Box, Full, Empty} | |
@@ -268,7 +269,7 @@ trait ItemsListEditor[T <: Mapper[T]] { | |
def customBind(item: T): NodeSeq => NodeSeq = (ns: NodeSeq) => ns | |
def edit: (NodeSeq) => NodeSeq = { | |
- def unsavedScript = ( <head>{Script(Run(""" | |
+ def unsavedScript = ( xml"""<head>${Script(Run(""" | |
var safeToContinue = false | |
window.onbeforeunload = function(evt) {{ // thanks Tim! | |
if(!safeToContinue) {{ | |
@@ -278,7 +279,7 @@ trait ItemsListEditor[T <: Mapper[T]] { | |
return reply; | |
}} | |
}} | |
- """))}</head>) | |
+ """))}</head>""") | |
val noPrompt = "onclick" -> "safeToContinue=true" | |
val optScript = | |
if ((items.added.length + items.removed.length == 0) && | |
@@ -291,7 +292,7 @@ trait ItemsListEditor[T <: Mapper[T]] { | |
val bindRemovedItems = items.removed.map { item => | |
"^" #> customBind(item) andThen ".fields" #> eachField(item, { | |
f: MappedField[_, T] => | |
- ".form" #> <strike>{f.asHtml}</strike> | |
+ ".form" #> xml"<strike>${f.asHtml}</strike>" | |
}) & ".removeBtn" #> SHtml.submit(?("Remove"), | |
() => onRemove(item), | |
noPrompt) & ".msg" #> Text( | |
@@ -311,7 +312,7 @@ trait ItemsListEditor[T <: Mapper[T]] { | |
else if (item.dirty_?) Text(?("Unsaved")) | |
else NodeSeq.Empty | |
case errors => | |
- <ul>{errors.flatMap(e => <li>{e.msg}</li>)}</ul> | |
+ xml"<ul>${errors.flatMap(e => xml"<li>${e.msg}</li>")}</ul>" | |
} | |
} | |
} | |
diff --git a/repos/framework/persistence/mapper/src/test/scala/net/liftweb/mapper/MapperSpecsModel.scala b/repos/framework/persistence/mapper/src/test/scala/net/liftweb/mapper/MapperSpecsModel.scala | |
index 00319d5d5e..21eea69e77 100644 | |
--- a/repos/framework/persistence/mapper/src/test/scala/net/liftweb/mapper/MapperSpecsModel.scala | |
+++ b/repos/framework/persistence/mapper/src/test/scala/net/liftweb/mapper/MapperSpecsModel.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package mapper | |
+import scala.xml.quote._ | |
import java.util.Locale | |
import common._ | |
@@ -263,7 +264,7 @@ object User extends User with MetaMegaProtoUser[User] { | |
// define the DB table name | |
override def screenWrap = | |
Full( | |
- <lift:surround with="default" at="content"><lift:bind/></lift:surround>) | |
+ xml"""<lift:surround with="default" at="content"><lift:bind/></lift:surround>""") | |
// define the order fields will appear in forms and output | |
override def fieldOrder = | |
diff --git a/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/DBRefField.scala b/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/DBRefField.scala | |
index c507a66ab0..6d52ca042d 100644 | |
--- a/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/DBRefField.scala | |
+++ b/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/DBRefField.scala | |
@@ -19,6 +19,7 @@ package mongodb | |
package record | |
package field | |
+import scala.xml.quote._ | |
import net.liftweb.common.{Box, Empty, Failure, Full} | |
import net.liftweb.http.js.JE.Str | |
import net.liftweb.json.JsonAST.{JNothing, JObject, JValue} | |
@@ -64,7 +65,7 @@ class DBRefField[ | |
def setFromJValue(jvalue: JValue) = Empty // not implemented | |
- def asXHtml = <div></div> | |
+ def asXHtml = xml"<div></div>" | |
def defaultValue = new DBRef("", null) | |
diff --git a/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/DateField.scala b/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/DateField.scala | |
index 1864a11baf..27f09b7d1c 100644 | |
--- a/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/DateField.scala | |
+++ b/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/DateField.scala | |
@@ -16,6 +16,7 @@ package mongodb | |
package record | |
package field | |
+import scala.xml.quote._ | |
import java.util.Date | |
import scala.xml.NodeSeq | |
@@ -60,10 +61,10 @@ trait DateTypedField extends TypedField[Date] { | |
private def elem = | |
S.fmapFunc(S.SFuncHolder(this.setFromAny(_))) { funcName => | |
- <input type="text" | |
- name={funcName} | |
- value={valueBox.map(v => formats.dateFormat.format(v)) openOr ""} | |
- tabindex={tabIndex.toString}/> | |
+ xml"""<input type="text" | |
+ name=${funcName} | |
+ value=${valueBox.map(v => formats.dateFormat.format(v)) openOr ""} | |
+ tabindex=${tabIndex.toString}/>""" | |
} | |
def toForm = | |
diff --git a/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/MongoPasswordField.scala b/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/MongoPasswordField.scala | |
index 8fa95120ce..8c47225a3e 100644 | |
--- a/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/MongoPasswordField.scala | |
+++ b/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/MongoPasswordField.scala | |
@@ -19,6 +19,7 @@ package mongodb | |
package record | |
package field | |
+import scala.xml.quote._ | |
import scala.xml.{Node, NodeSeq, Text} | |
import net.liftweb.common.{Box, Empty, Failure, Full} | |
@@ -70,10 +71,10 @@ class MongoPasswordField[OwnerType <: BsonRecord[OwnerType]]( | |
private def elem = S.fmapFunc(S.SFuncHolder(this.setPassword(_))) { | |
funcName => | |
- <input type="password" | |
- name={funcName} | |
+ xml"""<input type="password" | |
+ name=${funcName} | |
value="" | |
- tabindex={tabIndex.toString}/> | |
+ tabindex=${tabIndex.toString}/>""" | |
} | |
diff --git a/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/ObjectIdField.scala b/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/ObjectIdField.scala | |
index ac24fc0656..88ff714bfc 100644 | |
--- a/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/ObjectIdField.scala | |
+++ b/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/ObjectIdField.scala | |
@@ -19,6 +19,7 @@ package mongodb | |
package record | |
package field | |
+import scala.xml.quote._ | |
import scala.xml.NodeSeq | |
import java.util.Date | |
@@ -69,10 +70,10 @@ class ObjectIdField[OwnerType <: BsonRecord[OwnerType]](rec: OwnerType) | |
private def elem = | |
S.fmapFunc(S.SFuncHolder(this.setFromAny(_))) { funcName => | |
- <input type="text" | |
- name={funcName} | |
- value={valueBox.map(s => s.toString) openOr ""} | |
- tabindex={tabIndex.toString}/> | |
+ xml"""<input type="text" | |
+ name=${funcName} | |
+ value=${valueBox.map(s => s.toString) openOr ""} | |
+ tabindex=${tabIndex.toString}/>""" | |
} | |
def toForm = | |
diff --git a/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/UUIDField.scala b/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/UUIDField.scala | |
index 1544467d3e..9bf84a2ea6 100644 | |
--- a/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/UUIDField.scala | |
+++ b/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/UUIDField.scala | |
@@ -16,6 +16,7 @@ package mongodb | |
package record | |
package field | |
+import scala.xml.quote._ | |
import java.util.UUID | |
import scala.xml.NodeSeq | |
@@ -63,10 +64,10 @@ class UUIDField[OwnerType <: BsonRecord[OwnerType]](rec: OwnerType) | |
private def elem = | |
S.fmapFunc(S.SFuncHolder(this.setFromAny(_))) { funcName => | |
- <input type="text" | |
- name={funcName} | |
- value={valueBox.map(v => v.toString) openOr ""} | |
- tabindex={tabIndex.toString}/> | |
+ xml"""<input type="text" | |
+ name=${funcName} | |
+ value=${valueBox.map(v => v.toString) openOr ""} | |
+ tabindex=${tabIndex.toString}/>""" | |
} | |
def toForm = | |
diff --git a/repos/framework/persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/CustomSerializersSpec.scala b/repos/framework/persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/CustomSerializersSpec.scala | |
index acfefeb296..12c948c34b 100644 | |
--- a/repos/framework/persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/CustomSerializersSpec.scala | |
+++ b/repos/framework/persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/CustomSerializersSpec.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package mongodb | |
package record | |
+import scala.xml.quote._ | |
import common._ | |
import field._ | |
import http.js.JE._ | |
@@ -313,7 +314,7 @@ object CustomSerializersSpec extends Specification with MongoTestKit { | |
nfl.id.asJValue mustEqual JString(nfl.id.value.toString) | |
val session = new LiftSession("", randomString(20), Empty) | |
val formPattern = | |
- <input name=".*" type="text" tabindex="1" value={nfl.id.value.toString} id="_id_id"></input> | |
+ xml"""<input name=".*" type="text" tabindex="1" value=${nfl.id.value.toString} id="_id_id"></input>""" | |
S.initIfUninitted(session) { | |
val form = nfl.id.toForm | |
form.isDefined must_== true | |
@@ -386,7 +387,7 @@ object CustomSerializersSpec extends Specification with MongoTestKit { | |
List(JField("$oid", JString(nfl.id.value.toString)))) | |
val session = new LiftSession("", randomString(20), Empty) | |
val formPattern = | |
- <input name=".*" type="text" tabindex="1" value={nfl.id.value.toString} id="_id_id"></input> | |
+ xml"""<input name=".*" type="text" tabindex="1" value=${nfl.id.value.toString} id="_id_id"></input>""" | |
S.initIfUninitted(session) { | |
val form = nfl.id.toForm | |
form.isDefined must_== true | |
diff --git a/repos/framework/persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/MongoFieldSpec.scala b/repos/framework/persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/MongoFieldSpec.scala | |
index ec3a61a7da..704a4b03e3 100644 | |
--- a/repos/framework/persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/MongoFieldSpec.scala | |
+++ b/repos/framework/persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/MongoFieldSpec.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package mongodb | |
package record | |
+import scala.xml.quote._ | |
import java.util.{Calendar, Date, UUID} | |
import java.util.regex.Pattern | |
@@ -253,7 +254,7 @@ object MongoFieldSpec extends Specification with MongoTestKit with AroundEach { | |
rec.mandatoryDateField, | |
JsObj(("$dt", Str(nowStr))), | |
JObject(List(JField("$dt", JString(nowStr)))), | |
- Full(<input name=".*" type="text" tabindex="1" value={nowStr} id="mandatoryDateField_id"></input>) | |
+ Full(xml"""<input name=".*" type="text" tabindex="1" value=${nowStr} id="mandatoryDateField_id"></input>""") | |
) | |
} | |
@@ -295,7 +296,7 @@ object MongoFieldSpec extends Specification with MongoTestKit with AroundEach { | |
rec.mandatoryObjectIdField, | |
JsObj(("$oid", oid.toString)), | |
JObject(List(JField("$oid", JString(oid.toString)))), | |
- Full(<input name=".*" type="text" tabindex="1" value={oid.toString} id="mandatoryObjectIdField_id"></input>) | |
+ Full(xml"""<input name=".*" type="text" tabindex="1" value=${oid.toString} id="mandatoryObjectIdField_id"></input>""") | |
) | |
rec.mandatoryObjectIdField(oid) | |
@@ -337,7 +338,7 @@ object MongoFieldSpec extends Specification with MongoTestKit with AroundEach { | |
rec.mandatoryUUIDField, | |
JsObj(("$uuid", Str(uuid.toString))), | |
JObject(List(JField("$uuid", JString(uuid.toString)))), | |
- Full(<input name=".*" type="text" tabindex="1" value={uuid.toString} id="mandatoryUUIDField_id"></input>) | |
+ Full(xml"""<input name=".*" type="text" tabindex="1" value=${uuid.toString} id="mandatoryUUIDField_id"></input>""") | |
) | |
} | |
diff --git a/repos/framework/persistence/proto/src/main/scala/net/liftweb/proto/Crudify.scala b/repos/framework/persistence/proto/src/main/scala/net/liftweb/proto/Crudify.scala | |
index 7b3a44a70e..d8693e81c1 100644 | |
--- a/repos/framework/persistence/proto/src/main/scala/net/liftweb/proto/Crudify.scala | |
+++ b/repos/framework/persistence/proto/src/main/scala/net/liftweb/proto/Crudify.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package proto | |
+import scala.xml.quote._ | |
import sitemap._ | |
import Loc._ | |
import http._ | |
@@ -149,11 +150,11 @@ trait Crudify { | |
def fieldsForEditing: List[FieldPointerType] = fieldsForDisplay | |
def pageWrapper(body: NodeSeq): NodeSeq = | |
- <lift:surround with="default" at="content"> | |
- { | |
+ xml"""<lift:surround with="default" at="content"> | |
+ ${ | |
body | |
} | |
- </lift:surround> | |
+ </lift:surround>""" | |
/** | |
* The menu item for listing items (make this "Empty" to disable) | |
@@ -331,8 +332,8 @@ trait Crudify { | |
* page wrapping. | |
*/ | |
protected def _editTemplate = { | |
- <div data-lift="crud.edit?form=post"> | |
- <table id={editId} class={editClass}> | |
+ xml"""<div data-lift="crud.edit?form=post"> | |
+ <table id=${editId} class=${editClass}> | |
<tr class="field"> | |
<td class="name"></td> | |
<td class="form"></td> | |
@@ -340,10 +341,10 @@ trait Crudify { | |
<tr> | |
<td> </td> | |
- <td><button type="submit">{editButton}</button></td> | |
+ <td><button type="submit">${editButton}</button></td> | |
</tr> | |
</table> | |
- </div> | |
+ </div>""" | |
} | |
def editButton = S.?("Save") | |
@@ -450,8 +451,8 @@ trait Crudify { | |
* page wrapping. | |
*/ | |
def _deleteTemplate = { | |
- <div data-lift="crud.delete?form=post"> | |
- <table id={deleteId} class={deleteClass}> | |
+ xml"""<div data-lift="crud.delete?form=post"> | |
+ <table id=${deleteId} class=${deleteClass}> | |
<tr class="field"> | |
<td class="name"></td> | |
<td class="value"></td> | |
@@ -459,10 +460,10 @@ trait Crudify { | |
<tr> | |
<td> </td> | |
- <td><button type="submit">{deleteButton}</button></td> | |
+ <td><button type="submit">${deleteButton}</button></td> | |
</tr> | |
</table> | |
- </div> | |
+ </div>""" | |
} | |
def deleteButton = S.?("Delete") | |
@@ -483,8 +484,8 @@ trait Crudify { | |
* page wrapping. | |
*/ | |
def _createTemplate = { | |
- <div data-lift="crud.create?form=post"> | |
- <table id={createId} class={createClass}> | |
+ xml"""<div data-lift="crud.create?form=post"> | |
+ <table id=${createId} class=${createClass}> | |
<tr class="field"> | |
<td class="name"></td> | |
<td class="form"></td> | |
@@ -492,10 +493,10 @@ trait Crudify { | |
<tr> | |
<td> </td> | |
- <td><button type="submit">{createButton}</button></td> | |
+ <td><button type="submit">${createButton}</button></td> | |
</tr> | |
</table> | |
- </div> | |
+ </div>""" | |
} | |
def createButton = S.?("Create") | |
@@ -516,14 +517,14 @@ trait Crudify { | |
* page wrapping. | |
*/ | |
def _viewTemplate = { | |
- <div data-lift="crud.view"> | |
- <table id={viewId} class={viewClass}> | |
+ xml"""<div data-lift="crud.view"> | |
+ <table id=${viewId} class=${viewClass}> | |
<tr class="row"> | |
<td class="name"></td> | |
<td class="value"></td> | |
</tr> | |
</table> | |
- </div> | |
+ </div>""" | |
} | |
def showAllMenuName = S.?("List", displayName) | |
@@ -542,8 +543,8 @@ trait Crudify { | |
* page wrapping | |
*/ | |
def _showAllTemplate = { | |
- <div data-lift="crud.all"> | |
- <table id={showAllId} class={showAllClass}> | |
+ xml"""<div data-lift="crud.all"> | |
+ <table id=${showAllId} class=${showAllClass}> | |
<thead> | |
<tr> | |
<th class="header-item"></th> | |
@@ -558,20 +559,20 @@ trait Crudify { | |
<tr class="row"> | |
<td class="row-item"></td> | |
- <td><a class="view" href="view-uri">{S ? "View"}</a></td> | |
- <td><a class="edit" href="edit-uri">{S ? "Edit"}</a></td> | |
- <td><a class="delete" href="delete-uri">{S ? "Delete"}</a></td> | |
+ <td><a class="view" href="view-uri">${S ? "View"}</a></td> | |
+ <td><a class="edit" href="edit-uri">${S ? "Edit"}</a></td> | |
+ <td><a class="delete" href="delete-uri">${S ? "Delete"}</a></td> | |
</tr> | |
</tbody> | |
<tfoot> | |
<tr> | |
- <td colspan="3" class="previous">{previousWord}</td> | |
- <td colspan="3" class="next">{nextWord}</td> | |
+ <td colspan="3" class="previous">${previousWord}</td> | |
+ <td colspan="3" class="next">${nextWord}</td> | |
</tr> | |
</tfoot> | |
</table> | |
- </div> | |
+ </div>""" | |
} | |
def nextWord = S.?("Next") | |
@@ -672,9 +673,9 @@ trait Crudify { | |
if (first < rowsPerPage) { | |
ClearNodes | |
} else { | |
- "^ <*>" #> <a href={listPathString+ | |
+ "^ <*>" #> xml"""<a href=${listPathString+ | |
"?first="+(0L max (first - | |
- rowsPerPage.toLong))}></a> | |
+ rowsPerPage.toLong))}></a>""" | |
} | |
} | |
@@ -686,8 +687,8 @@ trait Crudify { | |
if (first < rowsPerPage) { | |
ClearNodes | |
} else { | |
- "^ <*>" #> <a href={listPathString+"?first="+(first + | |
- rowsPerPage.toLong)}></a> | |
+ "^ <*>" #> xml"""<a href=${listPathString+"?first="+(first + | |
+ rowsPerPage.toLong)}></a>""" | |
} | |
} | |
@@ -744,7 +745,7 @@ trait Crudify { | |
*/ | |
def wrapNameInRequired(fieldName: NodeSeq, required: Boolean): NodeSeq = { | |
if (required) { | |
- <span class="required_field">{fieldName}</span> | |
+ xml"""<span class="required_field">${fieldName}</span>""" | |
} else { | |
fieldName | |
} | |
@@ -762,7 +763,7 @@ trait Crudify { | |
.filter(_._3 == fid) | |
.flatMap(err => | |
List(Text(" "), | |
- <span class={editErrorClass}>{err._2}</span>)) | |
+ xml"<span class=${editErrorClass}>${err._2}</span>")) | |
case _ => NodeSeq.Empty | |
} | |
diff --git a/repos/framework/persistence/proto/src/main/scala/net/liftweb/proto/ProtoUser.scala b/repos/framework/persistence/proto/src/main/scala/net/liftweb/proto/ProtoUser.scala | |
index 2c0be0940b..584f9d9616 100644 | |
--- a/repos/framework/persistence/proto/src/main/scala/net/liftweb/proto/ProtoUser.scala | |
+++ b/repos/framework/persistence/proto/src/main/scala/net/liftweb/proto/ProtoUser.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package proto | |
+import scala.xml.quote._ | |
import net.liftweb.http._ | |
import js._ | |
import JsCmds._ | |
@@ -135,7 +136,7 @@ trait ProtoUser { | |
* Get an email link | |
*/ | |
def niceNameWEmailLink = | |
- <a href={"mailto:"+urlEncode(getEmail)}>{niceName}</a> | |
+ xml"<a href=${"mailto:"+urlEncode(getEmail)}>${niceName}</a>" | |
} | |
/** | |
@@ -567,7 +568,7 @@ trait ProtoUser { | |
val li = loggedIn_? | |
ItemList | |
.filter(i => i.display && i.loggedIn == li) | |
- .map(i => ( <a href={i.pathStr}>{i.name}</a>)) | |
+ .map(i => ( xml"<a href=${i.pathStr}>${i.name}</a>")) | |
} | |
protected def snarfLastItem: String = | |
@@ -667,30 +668,30 @@ trait ProtoUser { | |
def currentUser: Box[TheUserType] = curUser.get | |
def signupXhtml(user: TheUserType) = { | |
- ( <form method="post" action={S.uri}><table><tr><td | |
- colspan="2">{ S.?("sign.up") }</td></tr> | |
- {localForm(user, false, signupFields)} | |
+ ( xml"""<form method="post" action=${S.uri}><table><tr><td | |
+ colspan="2">${ S.?("sign.up") }</td></tr> | |
+ ${localForm(user, false, signupFields)} | |
<tr><td> </td><td><input type="submit" /></td></tr> | |
- </table></form>) | |
+ </table></form>""") | |
} | |
def signupMailBody(user: TheUserType, validationLink: String): Elem = { | |
- ( <html> | |
+ ( xml"""<html> | |
<head> | |
- <title>{S.?("sign.up.confirmation")}</title> | |
+ <title>${S.?("sign.up.confirmation")}</title> | |
</head> | |
<body> | |
- <p>{S.?("dear")} {user.getFirstName}, | |
+ <p>${S.?("dear")} ${user.getFirstName}, | |
<br/> | |
<br/> | |
- {S.?("sign.up.validation.link")} | |
- <br/><a href={validationLink}>{validationLink}</a> | |
+ ${S.?("sign.up.validation.link")} | |
+ <br/><a href=${validationLink}>${validationLink}</a> | |
<br/> | |
<br/> | |
- {S.?("thank.you")} | |
+ ${S.?("thank.you")} | |
</p> | |
</body> | |
- </html>) | |
+ </html>""") | |
} | |
def signupMailSubject = S.?("sign.up.confirmation") | |
@@ -833,13 +834,13 @@ trait ProtoUser { | |
def userNameNotFoundString: String = S.?("email.address.not.found") | |
def loginXhtml = { | |
- ( <form method="post" action={S.uri}><table><tr><td | |
- colspan="2">{S.?("log.in")}</td></tr> | |
- <tr><td>{userNameFieldString}</td><td><input type="text" class="email" /></td></tr> | |
- <tr><td>{S.?("password")}</td><td><input type="password" class="password" /></td></tr> | |
- <tr><td><a href={lostPasswordPath.mkString("/", "/", "")} | |
- >{S.?("recover.password")}</a></td><td><input type="submit" /></td></tr></table> | |
- </form>) | |
+ ( xml"""<form method="post" action=${S.uri}><table><tr><td | |
+ colspan="2">${S.?("log.in")}</td></tr> | |
+ <tr><td>${userNameFieldString}</td><td><input type="text" class="email" /></td></tr> | |
+ <tr><td>${S.?("password")}</td><td><input type="password" class="password" /></td></tr> | |
+ <tr><td><a href=${lostPasswordPath.mkString("/", "/", "")} | |
+ >${S.?("recover.password")}</a></td><td><input type="submit" /></td></tr></table> | |
+ </form>""") | |
} | |
/** | |
@@ -918,32 +919,32 @@ trait ProtoUser { | |
} | |
def lostPasswordXhtml = { | |
- ( <form method="post" action={S.uri}> | |
+ ( xml"""<form method="post" action=${S.uri}> | |
<table><tr><td | |
- colspan="2">{S.?("enter.email")}</td></tr> | |
- <tr><td>{userNameFieldString}</td><td><input type="text" class="email" /></td></tr> | |
+ colspan="2">${S.?("enter.email")}</td></tr> | |
+ <tr><td>${userNameFieldString}</td><td><input type="text" class="email" /></td></tr> | |
<tr><td> </td><td><input type="submit" /></td></tr> | |
</table> | |
- </form>) | |
+ </form>""") | |
} | |
def passwordResetMailBody(user: TheUserType, resetLink: String): Elem = { | |
- ( <html> | |
+ ( xml"""<html> | |
<head> | |
- <title>{S.?("reset.password.confirmation")}</title> | |
+ <title>${S.?("reset.password.confirmation")}</title> | |
</head> | |
<body> | |
- <p>{S.?("dear")} {user.getFirstName}, | |
+ <p>${S.?("dear")} ${user.getFirstName}, | |
<br/> | |
<br/> | |
- {S.?("click.reset.link")} | |
- <br/><a href={resetLink}>{resetLink}</a> | |
+ ${S.?("click.reset.link")} | |
+ <br/><a href=${resetLink}>${resetLink}</a> | |
<br/> | |
<br/> | |
- {S.?("thank.you")} | |
+ ${S.?("thank.you")} | |
</p> | |
</body> | |
- </html>) | |
+ </html>""") | |
} | |
/** | |
@@ -1006,13 +1007,13 @@ trait ProtoUser { | |
} | |
def passwordResetXhtml = { | |
- ( <form method="post" action={S.uri}> | |
- <table><tr><td colspan="2">{S.?("reset.your.password")}</td></tr> | |
- <tr><td>{S.?("enter.your.new.password")}</td><td><input type="password" /></td></tr> | |
- <tr><td>{S.?("repeat.your.new.password")}</td><td><input type="password" /></td></tr> | |
+ ( xml"""<form method="post" action=${S.uri}> | |
+ <table><tr><td colspan="2">${S.?("reset.your.password")}</td></tr> | |
+ <tr><td>${S.?("enter.your.new.password")}</td><td><input type="password" /></td></tr> | |
+ <tr><td>${S.?("repeat.your.new.password")}</td><td><input type="password" /></td></tr> | |
<tr><td> </td><td><input type="submit" /></td></tr> | |
</table> | |
- </form>) | |
+ </form>""") | |
} | |
def passwordReset(id: String) = | |
@@ -1047,14 +1048,14 @@ trait ProtoUser { | |
} | |
def changePasswordXhtml = { | |
- ( <form method="post" action={S.uri}> | |
- <table><tr><td colspan="2">{S.?("change.password")}</td></tr> | |
- <tr><td>{S.?("old.password")}</td><td><input type="password" class="old-password" /></td></tr> | |
- <tr><td>{S.?("new.password")}</td><td><input type="password" class="new-password" /></td></tr> | |
- <tr><td>{S.?("repeat.password")}</td><td><input type="password" class="new-password" /></td></tr> | |
+ ( xml"""<form method="post" action=${S.uri}> | |
+ <table><tr><td colspan="2">${S.?("change.password")}</td></tr> | |
+ <tr><td>${S.?("old.password")}</td><td><input type="password" class="old-password" /></td></tr> | |
+ <tr><td>${S.?("new.password")}</td><td><input type="password" class="new-password" /></td></tr> | |
+ <tr><td>${S.?("repeat.password")}</td><td><input type="password" class="new-password" /></td></tr> | |
<tr><td> </td><td><input type="submit" /></td></tr> | |
</table> | |
- </form>) | |
+ </form>""") | |
} | |
def changePassword = { | |
@@ -1095,12 +1096,12 @@ trait ProtoUser { | |
} | |
def editXhtml(user: TheUserType) = { | |
- ( <form method="post" action={S.uri}> | |
- <table><tr><td colspan="2">{S.?("edit")}</td></tr> | |
- {localForm(user, true, editFields)} | |
+ ( xml"""<form method="post" action=${S.uri}> | |
+ <table><tr><td colspan="2">${S.?("edit")}</td></tr> | |
+ ${localForm(user, true, editFields)} | |
<tr><td> </td><td><input type="submit" /></td></tr> | |
</table> | |
- </form>) | |
+ </form>""") | |
} | |
object editFunc extends RequestVar[Box[() => NodeSeq]](Empty) { | |
@@ -1167,7 +1168,7 @@ trait ProtoUser { | |
field <- computeFieldFromPointer(user, pointer).toList if field.show_? && | |
(!ignorePassword || !pointer.isPasswordField_?) | |
form <- field.toForm.toList | |
- } yield <tr><td>{field.displayName}</td><td>{form}</td></tr> | |
+ } yield xml"<tr><td>${field.displayName}</td><td>${form}</td></tr>" | |
} | |
protected def wrapIt(in: NodeSeq): NodeSeq = | |
diff --git a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/Field.scala b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/Field.scala | |
index 01d6eb24fe..ef66f1ade6 100644 | |
--- a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/Field.scala | |
+++ b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/Field.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package record | |
+import scala.xml.quote._ | |
import net.liftweb.common._ | |
import net.liftweb.http.S | |
import net.liftweb.http.js.{JsExp} | |
@@ -128,7 +129,7 @@ trait BaseField extends FieldIdentifier with util.BaseField { | |
override def uniqueFieldId: Box[String] = Full(name + "_id") | |
def label: NodeSeq = uniqueFieldId match { | |
- case Full(id) => <label for={id}>{displayName}</label> | |
+ case Full(id) => xml"<label for=${id}>${displayName}</label>" | |
case _ => NodeSeq.Empty | |
} | |
@@ -486,11 +487,11 @@ trait DisplayWithLabel[OwnerType <: Record[OwnerType]] | |
extends OwnedField[OwnerType] { | |
override abstract def toForm: Box[NodeSeq] = | |
for (id <- uniqueFieldId; control <- super.toForm) yield | |
- <div id={ id + "_holder" }> | |
- <div><label for={ id }>{ displayName }</label></div> | |
- { control } | |
- <lift:msg id={id} errorClass="lift_error"/> | |
- </div> | |
+ xml"""<div id=${ id + "_holder" }> | |
+ <div><label for=${ id }>${ displayName }</label></div> | |
+ ${ control } | |
+ <lift:msg id=${id} errorClass="lift_error"/> | |
+ </div>""" | |
} | |
trait KeyField[ | |
diff --git a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/MetaRecord.scala b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/MetaRecord.scala | |
index 85ebd36c43..517f8b6a91 100644 | |
--- a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/MetaRecord.scala | |
+++ b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/MetaRecord.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package record | |
+import scala.xml.quote._ | |
import scala.language.existentials | |
import java.lang.reflect.Modifier | |
@@ -348,7 +349,7 @@ trait MetaRecord[BaseRecord <: Record[BaseRecord]] { self: BaseRecord => | |
fieldByName(name.toString, inst) | |
.map(_.uniqueFieldId match { | |
case Full(id) => | |
- <lift:msg id={id}/> | |
+ xml"<lift:msg id=${id}/>" | |
case _ => NodeSeq.Empty | |
}) | |
.openOr(NodeSeq.Empty) | |
diff --git a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/ProtoUser.scala b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/ProtoUser.scala | |
index 19213970e0..f9ed8e25a9 100644 | |
--- a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/ProtoUser.scala | |
+++ b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/ProtoUser.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package record | |
+import scala.xml.quote._ | |
import net.liftweb.http.S | |
import net.liftweb.http.S._ | |
import net.liftweb.http.js._ | |
@@ -174,7 +175,7 @@ trait ProtoUser[T <: ProtoUser[T]] extends Record[T] { self: T => | |
case _ => email.get | |
} | |
- def niceNameWEmailLink = <a href={"mailto:"+email.get}>{niceName}</a> | |
+ def niceNameWEmailLink = xml"<a href=${"mailto:"+email.get}>${niceName}</a>" | |
} | |
/** | |
diff --git a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/Record.scala b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/Record.scala | |
index d6c5f4e238..5606c213d9 100644 | |
--- a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/Record.scala | |
+++ b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/Record.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package record | |
+import scala.xml.quote._ | |
import common._ | |
import http.js.{JsExp, JsObj} | |
import http.{Req, SHtml} | |
@@ -118,7 +119,7 @@ trait Record[MyType <: Record[MyType]] extends FieldContainer { self: MyType => | |
*/ | |
def toForm(button: Box[String])(f: MyType => Unit): NodeSeq = { | |
meta.toForm(this) ++ (SHtml.hidden(() => f(this))) ++ | |
- ((button.map(b => ( <input type="submit" value={b}/>)) openOr scala.xml | |
+ ((button.map(b => ( xml"""<input type="submit" value=${b}/>""")) openOr scala.xml | |
.Text(""))) | |
} | |
diff --git a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/DateTimeField.scala b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/DateTimeField.scala | |
index a0640a1144..dfc3996df1 100644 | |
--- a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/DateTimeField.scala | |
+++ b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/DateTimeField.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package record | |
package field | |
+import scala.xml.quote._ | |
import scala.xml._ | |
import net.liftweb.common._ | |
import net.liftweb.http.{S} | |
@@ -52,10 +53,10 @@ trait DateTimeTypedField extends TypedField[Calendar] { | |
private def elem = | |
S.fmapFunc(SFuncHolder(this.setFromAny(_))) { funcName => | |
- <input type={formInputType} | |
- name={funcName} | |
- value={valueBox.map(s => toInternetDate(s.getTime)) openOr ""} | |
- tabindex={tabIndex.toString}/> | |
+ xml"""<input type=${formInputType} | |
+ name=${funcName} | |
+ value=${valueBox.map(s => toInternetDate(s.getTime)) openOr ""} | |
+ tabindex=${tabIndex.toString}/>""" | |
} | |
def toForm: Box[NodeSeq] = | |
diff --git a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/NumericField.scala b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/NumericField.scala | |
index 1bb323b697..e603dbf548 100644 | |
--- a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/NumericField.scala | |
+++ b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/NumericField.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package record | |
package field | |
+import scala.xml.quote._ | |
import net.liftweb.http.{S} | |
import net.liftweb.http.js._ | |
import net.liftweb.util._ | |
@@ -43,7 +44,7 @@ trait NumericTypedField[MyType] extends TypedField[MyType] { | |
private def elem = S.fmapFunc((s: List[String]) => setFromAny(s)) { | |
funcName => | |
- <input type={formInputType} name={funcName} value={valueBox.map(_.toString) openOr ""} tabindex={tabIndex.toString}/> | |
+ xml"<input type=${formInputType} name=${funcName} value=${valueBox.map(_.toString) openOr ""} tabindex=${tabIndex.toString}/>" | |
} | |
/** | |
diff --git a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/PasswordField.scala b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/PasswordField.scala | |
index 4537f70b9d..44f1b27b89 100644 | |
--- a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/PasswordField.scala | |
+++ b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/PasswordField.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package record | |
package field | |
+import scala.xml.quote._ | |
import xml._ | |
import common._ | |
@@ -99,10 +100,10 @@ trait PasswordTypedField extends TypedField[String] { | |
override def formInputType = "password" | |
private def elem = S.fmapFunc(SFuncHolder(this.setFromAny(_))) { funcName => | |
- <input type={formInputType} | |
- name={funcName} | |
- value={valueBox openOr ""} | |
- tabindex={tabIndex.toString}/> | |
+ xml"""<input type=${formInputType} | |
+ name=${funcName} | |
+ value=${valueBox openOr ""} | |
+ tabindex=${tabIndex.toString}/>""" | |
} | |
diff --git a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/StringField.scala b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/StringField.scala | |
index 1d0526d9d8..6a8aeb135a 100644 | |
--- a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/StringField.scala | |
+++ b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/StringField.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package record | |
package field | |
+import scala.xml.quote._ | |
import xml._ | |
import common._ | |
@@ -46,10 +47,10 @@ trait StringTypedField extends TypedField[String] with StringValidators { | |
} | |
private def elem = S.fmapFunc(SFuncHolder(this.setFromAny(_))) { funcName => | |
- <input type={formInputType} maxlength={maxLength.toString} | |
- name={funcName} | |
- value={valueBox openOr ""} | |
- tabindex={tabIndex.toString}/> | |
+ xml"""<input type=${formInputType} maxlength=${maxLength.toString} | |
+ name=${funcName} | |
+ value=${valueBox openOr ""} | |
+ tabindex=${tabIndex.toString}/>""" | |
} | |
def toForm: Box[NodeSeq] = | |
diff --git a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/TextareaField.scala b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/TextareaField.scala | |
index 6978363281..363b331f4e 100644 | |
--- a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/TextareaField.scala | |
+++ b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/TextareaField.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package record | |
package field | |
+import scala.xml.quote._ | |
import scala.xml._ | |
import net.liftweb.util._ | |
import net.liftweb.common._ | |
@@ -27,10 +28,10 @@ import Helpers._ | |
trait TextareaTypedField extends StringTypedField { | |
private def elem = S.fmapFunc(SFuncHolder(this.setFromAny(_))) { funcName => | |
- <textarea name={funcName} | |
- rows={textareaRows.toString} | |
- cols={textareaCols.toString} | |
- tabindex={tabIndex.toString}>{valueBox openOr ""}</textarea> | |
+ xml"""<textarea name=${funcName} | |
+ rows=${textareaRows.toString} | |
+ cols=${textareaCols.toString} | |
+ tabindex=${tabIndex.toString}>${valueBox openOr ""}</textarea>""" | |
} | |
override def toForm: Box[NodeSeq] = | |
diff --git a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/joda/JodaTimeField.scala b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/joda/JodaTimeField.scala | |
index cd59d1a12b..72fe10c224 100644 | |
--- a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/joda/JodaTimeField.scala | |
+++ b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/joda/JodaTimeField.scala | |
@@ -19,6 +19,7 @@ package record | |
package field | |
package joda | |
+import scala.xml.quote._ | |
import scala.xml._ | |
import common._ | |
@@ -46,10 +47,10 @@ trait JodaTimeTypedField extends TypedField[DateTime] with JodaHelpers { | |
private def elem = | |
S.fmapFunc(SFuncHolder(this.setFromAny(_))) { funcName => | |
- <input type={formInputType} | |
- name={funcName} | |
- value={valueBox.map(v => dateTimeFormatter.print(v)) openOr ""} | |
- tabindex={tabIndex.toString}/> | |
+ xml"""<input type=${formInputType} | |
+ name=${funcName} | |
+ value=${valueBox.map(v => dateTimeFormatter.print(v)) openOr ""} | |
+ tabindex=${tabIndex.toString}/>""" | |
} | |
def toForm: Box[NodeSeq] = | |
diff --git a/repos/framework/persistence/record/src/test/scala/net/liftweb/record/FieldSpec.scala b/repos/framework/persistence/record/src/test/scala/net/liftweb/record/FieldSpec.scala | |
index 742c60e458..d4f32061c7 100644 | |
--- a/repos/framework/persistence/record/src/test/scala/net/liftweb/record/FieldSpec.scala | |
+++ b/repos/framework/persistence/record/src/test/scala/net/liftweb/record/FieldSpec.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package record | |
+import scala.xml.quote._ | |
import field.{Countries, PasswordField, StringField} | |
import common.{Box, Empty, Failure, Full} | |
@@ -329,7 +330,7 @@ object FieldSpec extends Specification { | |
rec.mandatoryBooleanField, | |
JsTrue, | |
JBool(bool), | |
- Full(<input checked="checked" tabindex="1" value="true" type="checkbox" name=".*" id="mandatoryBooleanField_id"></input><input value="false" type="hidden" name=".*"></input>) | |
+ Full(xml"""<input checked="checked" tabindex="1" value="true" type="checkbox" name=".*" id="mandatoryBooleanField_id"></input><input value="false" type="hidden" name=".*"></input>""") | |
) | |
"support java.lang.Boolean" in { | |
rec.mandatoryBooleanField.setFromAny(java.lang.Boolean.TRUE) | |
@@ -367,7 +368,7 @@ object FieldSpec extends Specification { | |
rec.mandatoryCountryField, | |
Str(country.toString), | |
JInt(country.id), | |
- Full(<select tabindex="1" name=".*" id="mandatoryCountryField_id"><option value=".*" selected="selected">{country.toString}</option></select>) | |
+ Full(xml"""<select tabindex="1" name=".*" id="mandatoryCountryField_id"><option value=".*" selected="selected">${country.toString}</option></select>""") | |
) | |
} | |
} | |
@@ -390,7 +391,7 @@ object FieldSpec extends Specification { | |
rec.mandatoryDateTimeField, | |
Str(dtStr), | |
JString(dtStr), | |
- Full(<input name=".*" type="text" tabindex="1" value={dtStr} id="mandatoryDateTimeField_id"></input>) | |
+ Full(xml"""<input name=".*" type="text" tabindex="1" value=${dtStr} id="mandatoryDateTimeField_id"></input>""") | |
) | |
} | |
@@ -404,7 +405,7 @@ object FieldSpec extends Specification { | |
rec.customFormatDateTimeField, | |
Str(dtStr), | |
JString(dtStr), | |
- Full(<input name=".*" type="text" tabindex="1" value={toInternetDate(dt.getTime)} id="customFormatDateTimeField_id"></input>) | |
+ Full(xml"""<input name=".*" type="text" tabindex="1" value=${toInternetDate(dt.getTime)} id="customFormatDateTimeField_id"></input>""") | |
) | |
} | |
@@ -422,7 +423,7 @@ object FieldSpec extends Specification { | |
rec.mandatoryDecimalField, | |
JsRaw(bd.toString), | |
JString(bd.toString), | |
- Full(<input name=".*" type="text" tabindex="1" value={bd.toString} id="mandatoryDecimalField_id"></input>) | |
+ Full(xml"""<input name=".*" type="text" tabindex="1" value=${bd.toString} id="mandatoryDecimalField_id"></input>""") | |
) | |
} | |
@@ -440,7 +441,7 @@ object FieldSpec extends Specification { | |
rec.mandatoryDoubleField, | |
JsRaw(d.toString), | |
JDouble(d), | |
- Full(<input name=".*" type="text" tabindex="1" value={d.toString} id="mandatoryDoubleField_id"></input>) | |
+ Full(xml"""<input name=".*" type="text" tabindex="1" value=${d.toString} id="mandatoryDoubleField_id"></input>""") | |
) | |
"get set from JInt" in { | |
@@ -464,7 +465,7 @@ object FieldSpec extends Specification { | |
rec.mandatoryEmailField, | |
Str(email), | |
JString(email), | |
- Full(<input name=".*" type="text" maxlength="100" tabindex="1" value={email} id="mandatoryEmailField_id"></input>) | |
+ Full(xml"""<input name=".*" type="text" maxlength="100" tabindex="1" value=${email} id="mandatoryEmailField_id"></input>""") | |
) | |
"pass validation if field is optional and value is Empty" in { | |
S.initIfUninitted(session) { | |
@@ -506,7 +507,7 @@ object FieldSpec extends Specification { | |
rec.mandatoryEnumField, | |
Str(ev.toString), | |
JInt(ev.id), | |
- Full(<select tabindex="1" name=".*" id="mandatoryEnumField_id"><option value=".*" selected="selected">{ev.toString}</option></select>) | |
+ Full(xml"""<select tabindex="1" name=".*" id="mandatoryEnumField_id"><option value=".*" selected="selected">${ev.toString}</option></select>""") | |
) | |
} | |
@@ -524,7 +525,7 @@ object FieldSpec extends Specification { | |
rec.mandatoryIntField, | |
JsRaw(num.toString), | |
JInt(num), | |
- Full(<input name=".*" type="text" tabindex="1" value={num.toString} id="mandatoryIntField_id"></input>) | |
+ Full(xml"""<input name=".*" type="text" tabindex="1" value=${num.toString} id="mandatoryIntField_id"></input>""") | |
) | |
"get set from JDouble" in { | |
@@ -541,7 +542,7 @@ object FieldSpec extends Specification { | |
rec.customIntField, | |
JsRaw(num.toString), | |
JInt(num), | |
- Full(<input name=".*" type="number" tabindex="1" value={num.toString} id="customIntField_id"></input>) | |
+ Full(xml"""<input name=".*" type="number" tabindex="1" value=${num.toString} id="customIntField_id"></input>""") | |
) | |
} | |
@@ -576,7 +577,7 @@ object FieldSpec extends Specification { | |
rec.mandatoryLongField, | |
JsRaw(lng.toString), | |
JInt(lng), | |
- Full(<input name=".*" type="text" tabindex="1" value={lng.toString} id="mandatoryLongField_id"></input>) | |
+ Full(xml"""<input name=".*" type="text" tabindex="1" value=${lng.toString} id="mandatoryLongField_id"></input>""") | |
) | |
"get set from JDouble" in { | |
@@ -628,7 +629,7 @@ object FieldSpec extends Specification { | |
rec.mandatoryPostalCodeField, | |
Str(zip), | |
JString(zip), | |
- Full(<input name=".*" type="text" maxlength="32" tabindex="1" value={zip} id="mandatoryPostalCodeField_id"></input>) | |
+ Full(xml"""<input name=".*" type="text" maxlength="32" tabindex="1" value=${zip} id="mandatoryPostalCodeField_id"></input>""") | |
) | |
"pass validation if field is optional and value is Empty" in { | |
S.initIfUninitted(session) { | |
@@ -671,7 +672,7 @@ object FieldSpec extends Specification { | |
rec.mandatoryStringField, | |
Str(str), | |
JString(str), | |
- Full(<input name=".*" type="text" maxlength="100" tabindex="1" value={str} id="mandatoryStringField_id"></input>) | |
+ Full(xml"""<input name=".*" type="text" maxlength="100" tabindex="1" value=${str} id="mandatoryStringField_id"></input>""") | |
) | |
} | |
@@ -763,7 +764,7 @@ object FieldSpec extends Specification { | |
rec.mandatoryTextareaField, | |
Str(txt), | |
JString(txt), | |
- Full(<textarea name=".*" rows="8" tabindex="1" cols="20" id="mandatoryTextareaField_id">{txt}</textarea>) | |
+ Full(xml"""<textarea name=".*" rows="8" tabindex="1" cols="20" id="mandatoryTextareaField_id">${txt}</textarea>""") | |
) | |
} | |
@@ -787,7 +788,7 @@ object FieldSpec extends Specification { | |
rec.mandatoryTimeZoneField, | |
Str(example), | |
JString(example), | |
- Full(<select tabindex="1" name=".*" id="mandatoryTimeZoneField_id"><option value=".*" selected="selected">{example}</option></select>) | |
+ Full(xml"""<select tabindex="1" name=".*" id="mandatoryTimeZoneField_id"><option value=".*" selected="selected">${example}</option></select>""") | |
) | |
} | |
@@ -807,7 +808,7 @@ object FieldSpec extends Specification { | |
rec.mandatoryJodaTimeField, | |
Num(dt.getMillis), | |
JInt(dt.getMillis), | |
- Full(<input name=".*" type="text" tabindex="1" value={dtStr} id="mandatoryJodaTimeField_id"></input>) | |
+ Full(xml"""<input name=".*" type="text" tabindex="1" value=${dtStr} id="mandatoryJodaTimeField_id"></input>""") | |
) | |
} | |
} | |
diff --git a/repos/framework/project/Developers.scala b/repos/framework/project/Developers.scala | |
index 0ad921620e..332875b483 100644 | |
--- a/repos/framework/project/Developers.scala | |
+++ b/repos/framework/project/Developers.scala | |
@@ -14,6 +14,7 @@ | |
* limitations under the License. | |
*/ | |
+import scala.xml.quote._ | |
object Developers { | |
lazy val members = Map( | |
"andreak" -> "Andreas Joseph Krogh", | |
@@ -50,13 +51,13 @@ object Developers { | |
) | |
def toXml = | |
- <developers> | |
- {members map { m => | |
- <developer> | |
- <id>{m._1}</id> | |
- <name>{m._2}</name> | |
- <url>http://github.com/{m._1}</url> | |
- </developer> | |
+ xml"""<developers> | |
+ ${members map { m => | |
+ xml"""<developer> | |
+ <id>${m._1}</id> | |
+ <name>${m._2}</name> | |
+ <url>http://github.com/${m._1}</url> | |
+ </developer>""" | |
}} | |
- </developers> | |
+ </developers>""" | |
} | |
diff --git a/repos/framework/web/testkit/src/test/scala/net/liftweb/http/testing/MockHttpRequestSpec.scala b/repos/framework/web/testkit/src/test/scala/net/liftweb/http/testing/MockHttpRequestSpec.scala | |
index fca1eb07c0..7cc3d8c0c6 100644 | |
--- a/repos/framework/web/testkit/src/test/scala/net/liftweb/http/testing/MockHttpRequestSpec.scala | |
+++ b/repos/framework/web/testkit/src/test/scala/net/liftweb/http/testing/MockHttpRequestSpec.scala | |
@@ -16,6 +16,7 @@ | |
package net.liftweb | |
package mocks | |
+import scala.xml.quote._ | |
import org.specs2.mutable.Specification | |
import json.JsonDSL._ | |
@@ -116,7 +117,7 @@ object MockHttpRequestSpec extends Specification { | |
"properly set a default content type for XML" in { | |
val testRequest = new MockHttpServletRequest(TEST_URL, "/test") | |
- testRequest.body = <test/> | |
+ testRequest.body = xml"<test/>" | |
testRequest.contentType must_== "text/xml" | |
} | |
@@ -124,7 +125,7 @@ object MockHttpRequestSpec extends Specification { | |
"properly set a user-specificed content type for XML" in { | |
val testRequest = new MockHttpServletRequest(TEST_URL, "/test") | |
- testRequest.body_=(<test/>, "application/xml") | |
+ testRequest.body_=(xml"<test/>", "application/xml") | |
testRequest.contentType must_== "application/xml" | |
} | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/CSS.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/CSS.scala | |
index 6b1dd58c2f..d09475cb11 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/CSS.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/CSS.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package builtin | |
package snippet | |
+import scala.xml.quote._ | |
import net.liftweb.http._ | |
import scala.xml._ | |
@@ -45,13 +46,13 @@ object CSS extends DispatchSnippet { | |
* (screen and print media) | |
*/ | |
def blueprint: NodeSeq = { | |
- <xml:group> | |
- <link rel="stylesheet" href={"/" + LiftRules.resourceServerPath + | |
+ xml"""<xml:group> | |
+ <link rel="stylesheet" href=${"/" + LiftRules.resourceServerPath + | |
"/blueprint/screen.css"} type="text/css" | |
media="screen, projection"/> | |
- <link rel="stylesheet" href={"/" + LiftRules.resourceServerPath + | |
+ <link rel="stylesheet" href=${"/" + LiftRules.resourceServerPath + | |
"/blueprint/print.css"} type="text/css" media="print"/> | |
- </xml:group> ++ Unparsed(""" | |
+ </xml:group>""" ++ Unparsed(""" | |
<!--[if IE]><link rel="stylesheet" href=""" + '"' + | |
S.contextPath + """/""" + LiftRules.resourceServerPath + | |
"""/blueprint/ie.css" type="text/css" media="screen, projection"><![endif]--> | |
@@ -70,8 +71,8 @@ object CSS extends DispatchSnippet { | |
* (screen media) | |
*/ | |
def fancyType: NodeSeq = { | |
- <link rel="stylesheet" href={"/" + LiftRules.resourceServerPath + | |
+ xml"""<link rel="stylesheet" href=${"/" + LiftRules.resourceServerPath + | |
"/blueprint/plugins/fancy-type/screen.css"} | |
- type="text/css" media="screen, projection"/> | |
+ type="text/css" media="screen, projection"/>""" | |
} | |
} | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Comet.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Comet.scala | |
index 29e20fd71f..833ad6df2f 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Comet.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Comet.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package builtin | |
package snippet | |
+import scala.xml.quote._ | |
import scala.xml._ | |
import net.liftweb.http._ | |
import net.liftweb.util._ | |
@@ -135,7 +136,7 @@ object Comet extends DispatchSnippet with LazyLoggable { | |
abstract class CometFailureException(msg: String) | |
extends SnippetFailureException(msg) { | |
override def buildStackTrace: NodeSeq = | |
- <div>{msg}</div> ++ super.buildStackTrace | |
+ xml"<div>${msg}</div>" ++ super.buildStackTrace | |
} | |
object NoCometTypeException | |
extends CometFailureException( | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Form.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Form.scala | |
index 08c9e35ec0..90732650db 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Form.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Form.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package builtin | |
package snippet | |
+import scala.xml.quote._ | |
import scala.xml._ | |
import net.liftweb.http._ | |
import net.liftweb.util._ | |
@@ -64,7 +65,7 @@ object Form extends DispatchSnippet { | |
})) | |
new Elem(null, "form", meta, e.scope, e.minimizeEmpty, e.child: _*) | |
} else { | |
- <form method="post" action={S.uri}>{kids}</form> | |
+ xml"""<form method="post" action=${S.uri}>${kids}</form>""" | |
} | |
S.attr("multipart") match { | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/LazyLoad.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/LazyLoad.scala | |
index 57e20f292c..eec517abd0 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/LazyLoad.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/LazyLoad.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package builtin | |
package snippet | |
+import scala.xml.quote._ | |
import xml._ | |
import http._ | |
import common._ | |
@@ -70,12 +71,12 @@ object LazyLoad extends DispatchSnippet { | |
for { | |
templatePath <- S.attr("template") | |
renderedTemplate <- S.eval( | |
- <lift:embed what={templatePath} />) | |
+ xml"<lift:embed what=${templatePath} />") | |
} yield { | |
renderedTemplate | |
} | |
} openOr { | |
- <div><img src="/images/ajax-loader.gif" alt="Loading"/></div> | |
+ xml"""<div><img src="/images/ajax-loader.gif" alt="Loading"/></div>""" | |
} | |
) | |
} | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Menu.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Menu.scala | |
index 3da3f3257f..dcbb124d2b 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Menu.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Menu.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package builtin | |
package snippet | |
+import scala.xml.quote._ | |
import scala.language.existentials | |
import http.{S, DispatchSnippet, LiftRules} | |
@@ -157,7 +158,7 @@ object Menu extends DispatchSnippet { | |
TopScope, | |
true, | |
// Is a placeholder useful if we don't display the kids? I say no (DCB, 20101108) | |
- <xml:group> <span>{text}</span>{buildUlLine(kids)}</xml:group>) % | |
+ xml"<xml:group> <span>${text}</span>${buildUlLine(kids)}</xml:group>") % | |
(if (m.path) | |
S.prefixedAttrsToMetaData("li_path", liMap) else Null) % | |
(if (m.current) S.prefixedAttrsToMetaData("li_item", liMap) | |
@@ -172,7 +173,7 @@ object Menu extends DispatchSnippet { | |
Null, | |
TopScope, | |
true, | |
- <xml:group> <a href={uri}>{text}</a>{ifExpandCurrent(buildUlLine(kids))}</xml:group>) % S | |
+ xml"<xml:group> <a href=${uri}>${text}</a>${ifExpandCurrent(buildUlLine(kids))}</xml:group>") % S | |
.prefixedAttrsToMetaData("li_item", liMap)) | |
case MenuItem(text, uri, kids, true, _, _) => | |
@@ -184,7 +185,7 @@ object Menu extends DispatchSnippet { | |
Null, | |
TopScope, | |
true, | |
- <xml:group> <span>{text}</span>{ifExpandCurrent(buildUlLine(kids))}</xml:group>) % S | |
+ xml"<xml:group> <span>${text}</span>${ifExpandCurrent(buildUlLine(kids))}</xml:group>") % S | |
.prefixedAttrsToMetaData("li_item", liMap)) | |
// Not current, but on the path, so we need to expand children to show the current one | |
@@ -197,7 +198,7 @@ object Menu extends DispatchSnippet { | |
Null, | |
TopScope, | |
true, | |
- <xml:group> <a href={uri}>{text}</a>{buildUlLine(kids)}</xml:group>) % S | |
+ xml"<xml:group> <a href=${uri}>${text}</a>${buildUlLine(kids)}</xml:group>") % S | |
.prefixedAttrsToMetaData("li_path", liMap)) | |
case MenuItem(text, uri, kids, _, _, _) => | |
@@ -209,7 +210,7 @@ object Menu extends DispatchSnippet { | |
Null, | |
TopScope, | |
true, | |
- <xml:group> <a href={uri}>{text}</a>{ifExpandAll(buildUlLine(kids))}</xml:group>) % li) | |
+ xml"<xml:group> <a href=${uri}>${text}</a>${ifExpandAll(buildUlLine(kids))}</xml:group>") % li) | |
} | |
} | |
@@ -223,7 +224,7 @@ object Menu extends DispatchSnippet { | |
Null, | |
TopScope, | |
true, | |
- <xml:group>{in.flatMap(buildANavItem)}</xml:group>) % S | |
+ xml"<xml:group>${in.flatMap(buildANavItem)}</xml:group>") % S | |
.prefixedAttrsToMetaData("ul") | |
} else { | |
in.flatMap(buildANavItem) | |
@@ -328,7 +329,7 @@ object Menu extends DispatchSnippet { | |
str + " " + rts | |
} | |
- <title>{bodyStr}</title> % attrs | |
+ xml"<title>${bodyStr}</title>" % attrs | |
} | |
} openOr text | |
} | |
@@ -502,7 +503,7 @@ object Menu extends DispatchSnippet { | |
} yield { | |
Helpers.addCssClass( | |
typedLoc.cssClassForMenuItem, | |
- <a href={link}></a> % S.prefixedAttrsToMetaData("a")) | |
+ xml"<a href=${link}></a>" % S.prefixedAttrsToMetaData("a")) | |
}) openOr { | |
Text("") | |
} | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Msg.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Msg.scala | |
index 87b4eefe77..3325f65509 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Msg.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Msg.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package builtin | |
package snippet | |
+import scala.xml.quote._ | |
import net.liftweb.http._ | |
import net.liftweb.http.S._ | |
import scala.xml._ | |
@@ -81,7 +82,7 @@ object Msg extends DispatchSnippet { | |
(attr("noticeClass") or attr("noticeclass")) | |
.map(cls => MsgNoticeMeta += (id -> cls)) | |
- <span id={id}>{renderIdMsgs(id)}</span> ++ effects(id) | |
+ xml"<span id=${id}>${renderIdMsgs(id)}</span>" ++ effects(id) | |
} | |
case _ => NodeSeq.Empty | |
} | |
@@ -106,7 +107,7 @@ object Msg extends DispatchSnippet { | |
case msgList => | |
style match { | |
case Some(s) => | |
- msgList.flatMap(t => <span>{t}</span> % ("class" -> s)) | |
+ msgList.flatMap(t => xml"<span>${t}</span>" % ("class" -> s)) | |
case _ => msgList flatMap (n => n) | |
} | |
} | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Msgs.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Msgs.scala | |
index 25d9bdf431..72c934f88e 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Msgs.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Msgs.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package builtin | |
package snippet | |
+import scala.xml.quote._ | |
import http._ | |
import scala.xml._ | |
import net.liftweb.util.Helpers._ | |
@@ -95,7 +96,7 @@ object Msgs extends DispatchSnippet { | |
// Delegate the actual rendering to a shared method so that we don't | |
// duplicate code for the AJAX pipeline | |
- (<div>{renderNotices()}</div> % ("id" -> LiftRules.noticesContainerId)) ++ noticesFadeOut( | |
+ (xml"<div>${renderNotices()}</div>" % ("id" -> LiftRules.noticesContainerId)) ++ noticesFadeOut( | |
NoticeType.Notice) ++ noticesFadeOut(NoticeType.Warning) ++ noticesFadeOut( | |
NoticeType.Error) ++ effects(NoticeType.Notice) ++ effects( | |
NoticeType.Warning) ++ effects(NoticeType.Error) | |
@@ -124,10 +125,10 @@ object Msgs extends DispatchSnippet { | |
val styles = ajaxStorage.get.flatMap(_.cssClasses) | |
// Compute the resulting div | |
- f(messages).toList.map(e => ( <li>{e}</li>)) match { | |
+ f(messages).toList.map(e => ( xml"<li>${e}</li>")) match { | |
case Nil => Nil | |
case msgList => { | |
- val ret = <div id={noticeType.id}>{title}<ul>{msgList}</ul></div> | |
+ val ret = xml"<div id=${noticeType.id}>${title}<ul>${msgList}</ul></div>" | |
styles.foldLeft(ret)((xml, style) => | |
xml % new UnprefixedAttribute("class", Text(style), Null)) | |
} | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Tail.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Tail.scala | |
index 833b57350a..36eff3c853 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Tail.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/Tail.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package builtin | |
package snippet | |
+import scala.xml.quote._ | |
import http._ | |
import util._ | |
import scala.xml._ | |
@@ -27,7 +28,7 @@ object Tail extends DispatchSnippet { | |
case _ => render _ | |
} | |
- def render(xhtml: NodeSeq): NodeSeq = <tail>{xhtml}</tail> | |
+ def render(xhtml: NodeSeq): NodeSeq = xml"<tail>${xhtml}</tail>" | |
} | |
/** | |
@@ -64,12 +65,12 @@ object Head extends DispatchSnippet { | |
val xhtml = validHeadTagsOnly(_xhtml) | |
- <head>{ | |
+ xml"""<head>${ | |
if ((S.attr("withResourceId") or S.attr("withresourceid")).filter(Helpers.toBoolean).isDefined) { | |
WithResourceId.render(xhtml) | |
} else { | |
xhtml | |
} | |
- }</head> | |
+ }</head>""" | |
} | |
} | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/CometActor.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/CometActor.scala | |
index fdda64a579..d5afdec17b 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/CometActor.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/CometActor.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import net.liftweb.common._ | |
import net.liftweb.actor._ | |
import net.liftweb.util.Helpers._ | |
@@ -624,7 +625,7 @@ trait BaseCometActor | |
def hasOuter = true | |
- def parentTag = <div style="display: inline"/> | |
+ def parentTag = xml"""<div style="display: inline"/>""" | |
/** | |
* Return the list of ListenerIds of all long poll agents that | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/ContentParser.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/ContentParser.scala | |
index 6091835d00..7bd9571910 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/ContentParser.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/ContentParser.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import java.io.InputStream | |
import net.liftweb.common.Box | |
@@ -71,7 +72,7 @@ object ContentParser { | |
* template being surrounded by `default.html` with the content located at `id=content`. | |
*/ | |
val defaultSurround: NodeSeq => NodeSeq = { elems => | |
- <lift:surround with="default" at="content">{elems}</lift:surround> | |
+ xml"""<lift:surround with="default" at="content">${elems}</lift:surround>""" | |
} | |
/** | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/HtmlProperties.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/HtmlProperties.scala | |
index c9de9caef5..d2c47edef2 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/HtmlProperties.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/HtmlProperties.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import net.liftweb.common._ | |
import scala.xml.{Node, NodeSeq, Elem} | |
import net.liftweb.util._ | |
@@ -275,7 +276,7 @@ final case class OldHtmlProperties(userAgent: Box[String]) | |
} | |
} | |
def encoding: Box[String] = | |
- Full(LiftRules.calculateXmlHeader(null, <ignore/>, contentType)) | |
+ Full(LiftRules.calculateXmlHeader(null, xml"<ignore/>", contentType)) | |
def contentType: Box[String] = { | |
val req = S.request | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/LiftMerge.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/LiftMerge.scala | |
index 5b812fbde8..89e6c3b82c 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/LiftMerge.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/LiftMerge.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import scala.collection.Map | |
import scala.collection.mutable.{HashMap, ArrayBuffer, ListBuffer} | |
import scala.xml._ | |
@@ -63,7 +64,7 @@ private[http] trait LiftMerge { self: LiftSession => | |
private def pageScopedScriptFileWith(cmd: JsCmd) = { | |
pageScript(Full(JavaScriptResponse(cmd, Nil, Nil, 200))) | |
- <script type="text/javascript" src={scriptUrl(s"page/${RenderVersion.get}.js")}></script> | |
+ xml"""<script type="text/javascript" src=${scriptUrl(s"page/${RenderVersion.get}.js")}></script>""" | |
} | |
/** | |
@@ -110,9 +111,9 @@ private[http] trait LiftMerge { self: LiftSession => | |
}.isDefined | |
var htmlElement = | |
- <html xmlns="http://www.w3.org/1999/xhtml" xmlns:lift='http://liftweb.net'/> | |
- var headElement = <head/> | |
- var bodyElement = <body/> | |
+ xml"""<html xmlns="http://www.w3.org/1999/xhtml" xmlns:lift='http://liftweb.net'/>""" | |
+ var headElement = xml"<head/>" | |
+ var bodyElement = xml"<body/>" | |
val headChildren = new ListBuffer[Node] | |
val bodyChildren = new ListBuffer[Node] | |
val addlHead = new ListBuffer[Node] | |
@@ -255,8 +256,8 @@ private[http] trait LiftMerge { self: LiftSession => | |
// Appends ajax script to body | |
if (LiftRules.autoIncludeAjaxCalc.vend().apply(this)) { | |
bodyChildren += | |
- <script src={S.encodeURL(contextPath + "/"+LiftRules.resourceServerPath+"/lift.js")} | |
- type="text/javascript"/> | |
+ xml"""<script src=${S.encodeURL(contextPath + "/"+LiftRules.resourceServerPath+"/lift.js")} | |
+ type="text/javascript"/>""" | |
bodyChildren += nl | |
} | |
@@ -309,7 +310,7 @@ private[http] trait LiftMerge { self: LiftSession => | |
import scala.xml.transform._ | |
val errors: NodeSeq = xs.map(e => | |
- <div style="border: red solid 2px">XHTML Validation error:{e.msg}at line{e.line + 1}and column{e.col}</div>) | |
+ xml"""<div style="border: red solid 2px">XHTML Validation error:${e.msg}at line${e.line + 1}and column${e.col}</div>""") | |
val rule = new RewriteRule { | |
override def transform(n: Node) = n match { | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/LiftRules.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/LiftRules.scala | |
index 723a4b41b0..96696c02a7 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/LiftRules.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/LiftRules.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import common._ | |
import util._ | |
import util.Helpers._ | |
@@ -1243,16 +1244,16 @@ class LiftRules() extends Factory with FormVendor with LazyLoggable { | |
{ failure: Failure => | |
{ | |
if (Props.devMode) | |
- <div style="border: red solid 2px">A lift:parallel snippet failed to render.Message:{failure.msg}{failure.exception match { | |
+ xml"""<div style="border: red solid 2px">A lift:parallel snippet failed to render.Message:${failure.msg}${failure.exception match { | |
case Full(e) => | |
- <pre>{e.getStackTrace.map(_.toString).mkString("\n")}</pre> | |
+ xml"<pre>${e.getStackTrace.map(_.toString).mkString("\n")}</pre>" | |
case _ => NodeSeq.Empty | |
}}<i>note: this error is displayed in the browser because | |
your application is running in "development" mode.If you | |
set the system property run.mode=production, this error will not | |
be displayed, but there will be errors in the output logs. | |
</i> | |
- </div> | |
+ </div>""" | |
else NodeSeq.Empty | |
} | |
}) {} | |
@@ -1264,7 +1265,7 @@ class LiftRules() extends Factory with FormVendor with LazyLoggable { | |
val deferredSnippetTimeout: FactoryMaker[NodeSeq] = new FactoryMaker( | |
() => | |
{ | |
- if (Props.devMode) <div style="border: red solid 2px"> | |
+ if (Props.devMode) xml"""<div style="border: red solid 2px"> | |
A deferred snippet timed out during render. | |
<i>note: this error is displayed in the browser because | |
@@ -1272,7 +1273,7 @@ class LiftRules() extends Factory with FormVendor with LazyLoggable { | |
set the system property run.mode=production, this error will not | |
be displayed, but there will be errors in the output logs. | |
</i> | |
- </div> | |
+ </div>""" | |
else NodeSeq.Empty | |
}) {} | |
@@ -1671,7 +1672,7 @@ class LiftRules() extends Factory with FormVendor with LazyLoggable { | |
r.uri.toString, | |
e) | |
XhtmlResponse( | |
- ( <html> <body>Exception occured while processing {r.uri}<pre>{showException(e)}</pre> </body> </html>), | |
+ ( xml"<html> <body>Exception occured while processing ${r.uri}<pre>${showException(e)}</pre> </body> </html>"), | |
S.htmlProperties.docType, | |
List("Content-Type" -> "text/html; charset=utf-8"), | |
Nil, | |
@@ -1683,7 +1684,7 @@ class LiftRules() extends Factory with FormVendor with LazyLoggable { | |
r.uri.toString, | |
e) | |
XhtmlResponse( | |
- ( <html> <body>Something unexpected happened while serving the page at {r.uri}</body> </html>), | |
+ ( xml"<html> <body>Something unexpected happened while serving the page at ${r.uri}</body> </html>"), | |
S.htmlProperties.docType, | |
List("Content-Type" -> "text/html; charset=utf-8"), | |
Nil, | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/LiftScreen.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/LiftScreen.scala | |
index 3ceb1c9e17..3a94536547 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/LiftScreen.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/LiftScreen.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import xml._ | |
import reflect.Manifest | |
@@ -93,13 +94,13 @@ trait AbstractScreen extends Factory with Loggable { | |
def screenTitle: NodeSeq = screenNameAsHtml | |
- def cancelButton: Elem = <button> | |
- {S.?("Cancel")} | |
- </button> | |
+ def cancelButton: Elem = xml"""<button> | |
+ ${S.?("Cancel")} | |
+ </button>""" | |
- def finishButton: Elem = <button> | |
- {S.?("Finish")} | |
- </button> | |
+ def finishButton: Elem = xml"""<button> | |
+ ${S.?("Finish")} | |
+ </button>""" | |
implicit def boxOfScreen[T <: AbstractScreen](in: T): Box[T] = Box !! in | |
@@ -1099,9 +1100,9 @@ trait AbstractScreen extends Factory with Loggable { | |
trait ScreenWizardRendered extends Loggable { | |
protected def wrapInDiv(in: NodeSeq): Elem = | |
- <div style="display: inline" id={FormGUID.get}> | |
- {in} | |
- </div> | |
+ xml"""<div style="display: inline" id=${FormGUID.get}> | |
+ ${in} | |
+ </div>""" | |
def formName: String | |
@@ -1348,9 +1349,9 @@ trait ScreenWizardRendered extends Loggable { | |
val snapshot = createSnapshot | |
val ret = | |
- (<form id={nextId._1} action={url} | |
- method="post">{S.formGroup(-1)(SHtml.hidden(() => | |
- snapshot.restore()) % liftScreenAttr("restoreAction"))}{fields}{ | |
+ (xml"""<form id=${nextId._1} action=${url} | |
+ method="post">${S.formGroup(-1)(SHtml.hidden(() => | |
+ snapshot.restore()) % liftScreenAttr("restoreAction"))}${fields}${ | |
S.formGroup(4)( | |
SHtml.hidden(() => | |
{val res = nextId._2(); | |
@@ -1360,9 +1361,9 @@ trait ScreenWizardRendered extends Loggable { | |
localSnapshot.restore | |
})} | |
res | |
- })) % liftScreenAttr("nextAction") }</form> % theScreen.additionalAttributes) ++ prevId.toList.map { | |
+ })) % liftScreenAttr("nextAction") }</form>""" % theScreen.additionalAttributes) ++ prevId.toList.map { | |
case (id, func) => | |
- <form id={id} action={url} method="post">{ | |
+ xml"""<form id=${id} action=${url} method="post">${ | |
SHtml.hidden(() => {snapshot.restore(); | |
val res = func(); | |
if (!ajax_?) { | |
@@ -1370,15 +1371,15 @@ trait ScreenWizardRendered extends Loggable { | |
S.seeOther(url, () => localSnapshot.restore) | |
} | |
res | |
- }) % liftScreenAttr("restoreAction")}</form> | |
- } ++ <form id={cancelId._1} action={url} method="post">{SHtml.hidden(() => { | |
+ }) % liftScreenAttr("restoreAction")}</form>""" | |
+ } ++ xml"""<form id=${cancelId._1} action=${url} method="post">${SHtml.hidden(() => { | |
snapshot.restore(); | |
val res = cancelId._2() // WizardRules.deregisterWizardSession(CurrentSession.is) | |
if (!ajax_?) { | |
S.seeOther(Referer.get) | |
} | |
res | |
- }) % liftScreenAttr("restoreAction")}</form> | |
+ }) % liftScreenAttr("restoreAction")}</form>""" | |
if (ajax_?) { | |
SHtml.makeFormsAjax(ret) | |
@@ -1443,7 +1444,7 @@ trait ScreenWizardRendered extends Loggable { | |
protected def allTemplate: NodeSeq | |
protected def allTemplateNodeSeq: NodeSeq = { | |
- <div> | |
+ xml"""<div> | |
<div class="screenInfo"> | |
Page <span class="screenNumber"></span> of <span class="totalScreens"></span> | |
</div> | |
@@ -1477,7 +1478,7 @@ trait ScreenWizardRendered extends Loggable { | |
</div> | |
<div class="screenBottom"></div> | |
<div class="wizardBottom"></div> | |
- </div> | |
+ </div>""" | |
} | |
protected trait Snapshot { | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/LiftSession.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/LiftSession.scala | |
index e265e469a5..ee8103f22e 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/LiftSession.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/LiftSession.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import java.lang.reflect.Method | |
import java.util.concurrent.ConcurrentHashMap | |
@@ -1544,20 +1545,20 @@ class LiftSession(private[http] val _contextPath: String, | |
overrideResponseCode.set(LiftRules.devModeFailureResponseCodeOverride) | |
} | |
- Helpers.errorDiv(<div>Error processing snippet: | |
+ Helpers.errorDiv(xml"""<div>Error processing snippet: | |
<b> | |
- {snippetName openOr "N/A"} | |
+ ${snippetName openOr "N/A"} | |
</b> <br/> | |
Reason: | |
<b> | |
- {why}{addlMsg} | |
+ ${why}${addlMsg} | |
</b> <br/> | |
XML causing this error: | |
<br/> | |
<pre style="background: lightgrey; padding: 6px; border: 1px solid"> | |
- {whole.toString} | |
+ ${whole.toString} | |
</pre> | |
- </div>) openOr NodeSeq.Empty | |
+ </div>""") openOr NodeSeq.Empty | |
} | |
} | |
@@ -1858,14 +1859,14 @@ class LiftSession(private[http] val _contextPath: String, | |
snippetName, | |
LiftRules.SnippetFailures.MethodNotFound, | |
if (intersection.isEmpty) NodeSeq.Empty | |
- else <div>There are possible matching methods ( | |
- {intersection} | |
+ else xml"""<div>There are possible matching methods ( | |
+ ${intersection} | |
), | |
but none has the required signature: | |
<pre>def | |
- {method} | |
+ ${method} | |
(in: NodeSeq): NodeSeq</pre> | |
- </div>, | |
+ </div>""", | |
wholeTag) | |
} | |
} | |
@@ -1947,9 +1948,9 @@ class LiftSession(private[http] val _contextPath: String, | |
} | |
case Some(ft) => | |
- <form action={S.uri} method={ft}> | |
- {ret} | |
- </form> % checkMultiPart(attrs) % LiftRules.formAttrs.vend | |
+ xml"""<form action=${S.uri} method=${ft}> | |
+ ${ret} | |
+ </form>""" % checkMultiPart(attrs) % LiftRules.formAttrs.vend | |
.foldLeft[MetaData](Null)((base, | |
name) => checkAttr(name, attrs, base)) | |
@@ -2069,7 +2070,7 @@ class LiftSession(private[http] val _contextPath: String, | |
val renderVersion = RenderVersion.get | |
- val theNode = <lift_deferred:node id={nodeId}/> | |
+ val theNode = xml"<lift_deferred:node id=${nodeId}/>" | |
// take a snapshot of the hashmap used to communicate between threads | |
val hash = deferredSnippets.is | |
@@ -2301,7 +2302,7 @@ class LiftSession(private[http] val _contextPath: String, | |
override def hasOuter = false | |
- override def parentTag = <div style="display: none"/> | |
+ override def parentTag = xml"""<div style="display: none"/>""" | |
override def lowPriority: PartialFunction[Any, Unit] = | |
new PartialFunction[Any, Unit] { | |
@@ -2720,21 +2721,21 @@ class LiftSession(private[http] val _contextPath: String, | |
} | |
private def failedFind(in: Failure): NodeSeq = | |
- <html xmlns:lift="http://liftweb.net" xmlns="http://www.w3.org/1999/xhtml"> | |
+ xml"""<html xmlns:lift="http://liftweb.net" xmlns="http://www.w3.org/1999/xhtml"> | |
<head/> | |
<body> | |
- {Helpers.errorDiv( | |
- <div>Error locating template. | |
+ ${Helpers.errorDiv( | |
+ xml"""<div>Error locating template. | |
<br/> | |
Message: | |
<b> | |
- {in.msg} | |
- </b> <br/>{in.exception.map(e => <pre> | |
- {e.toString}{e.getStackTrace.map(_.toString).mkString("\n")} | |
- </pre>).openOr(NodeSeq.Empty)} | |
- </div>) openOr NodeSeq.Empty} | |
+ ${in.msg} | |
+ </b> <br/>${in.exception.map(e => xml"""<pre> | |
+ ${e.toString}${e.getStackTrace.map(_.toString).mkString("\n")} | |
+ </pre>""").openOr(NodeSeq.Empty)} | |
+ </div>""") openOr NodeSeq.Empty} | |
</body> | |
- </html> | |
+ </html>""" | |
private[liftweb] def findAndMerge( | |
templateName: Box[String], atWhat: => Map[String, NodeSeq]): NodeSeq = { | |
@@ -2798,7 +2799,7 @@ class LiftSession(private[http] val _contextPath: String, | |
override def hasOuter = false | |
- override def parentTag = <div style="display: none"/> | |
+ override def parentTag = xml"""<div style="display: none"/>""" | |
override def lowPriority: PartialFunction[Any, Unit] = { | |
case jsCmd: JsCmd => | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/NamedCometActorSnippet.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/NamedCometActorSnippet.scala | |
index 8f1f0439f9..e4528d3271 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/NamedCometActorSnippet.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/NamedCometActorSnippet.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import common.Full | |
import xml.NodeSeq | |
@@ -54,6 +55,6 @@ trait NamedCometActorSnippet { | |
Full(name), | |
CometName(name) | |
) | |
- <lift:comet type={cometClass} name={name}>{xhtml}</lift:comet> | |
+ xml"<lift:comet type=${cometClass} name=${name}>${xhtml}</lift:comet>" | |
} | |
} | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/Paginator.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/Paginator.scala | |
index 009e0e4285..774e1ac42f 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/Paginator.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/Paginator.scala | |
@@ -16,6 +16,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import xml.{NodeSeq, Text} | |
import common.Loggable | |
@@ -222,7 +223,7 @@ trait PaginatorSnippet[T] extends Paginator[T] { | |
*/ | |
def pageXml(newFirst: Long, ns: NodeSeq): NodeSeq = | |
if (first == newFirst || newFirst < 0 || newFirst >= count) ns | |
- else <a href={pageUrl(newFirst)}>{ns}</a> | |
+ else xml"<a href=${pageUrl(newFirst)}>${ns}</a>" | |
/** | |
* Generates links to multiple pages with arbitrary XML delimiting them. | |
@@ -341,7 +342,7 @@ trait SortedPaginatorSnippet[T, C] | |
val headerTransforms = headers.zipWithIndex.map { | |
case ((binding, _), colIndex) => | |
s".$binding *" #> { ns: NodeSeq => | |
- <a href={sortedPageUrl(first, sortedBy(colIndex))}>{ns}</a> | |
+ xml"<a href=${sortedPageUrl(first, sortedBy(colIndex))}>${ns}</a>" | |
} | |
} | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/Req.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/Req.scala | |
index f0facc6d6f..9999394c7b 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/Req.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/Req.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import java.io.{InputStream, ByteArrayInputStream, File, FileInputStream, FileOutputStream} | |
import scala.xml._ | |
@@ -707,7 +708,7 @@ object Req { | |
private[liftweb] def defaultCreateNotFound(in: Req) = | |
XhtmlResponse( | |
- ( <html> <body>The Requested URL {in.contextPath + in.uri} was not found on this server</body> </html>), | |
+ ( xml"<html> <body>The Requested URL ${in.contextPath + in.uri} was not found on this server</body> </html>"), | |
LiftRules.htmlProperties.vend(in).docType, | |
List("Content-Type" -> "text/html; charset=utf-8"), | |
Nil, | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/SHtml.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/SHtml.scala | |
index 1d5b4e4931..6caabf1fcb 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/SHtml.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/SHtml.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import S._ | |
import common._ | |
import util._ | |
@@ -333,8 +334,8 @@ trait SHtml extends Loggable { | |
*/ | |
def ajaxButton(text: NodeSeq, func: () => JsCmd, attrs: ElemAttr*): Elem = { | |
attrs.foldLeft(fmapFunc((func))(name => | |
- <button onclick={makeAjaxCall(Str(name + "=true")).toJsCmd + | |
- "; return false;"}>{text}</button>))((e, f) => f(e)) | |
+ xml"""<button onclick=${makeAjaxCall(Str(name + "=true")).toJsCmd + | |
+ "; return false;"}>${text}</button>"""))((e, f) => f(e)) | |
} | |
/** | |
@@ -363,7 +364,7 @@ trait SHtml extends Loggable { | |
def idMemoize(f: IdMemoizeTransform => NodeSeqFuncOrSeqNodeSeqFunc) | |
: IdMemoizeTransform = { | |
new IdMemoizeTransform { | |
- var latestElem: Elem = <span/> | |
+ var latestElem: Elem = xml"<span/>" | |
var latestKids: NodeSeq = NodeSeq.Empty | |
@@ -409,8 +410,8 @@ trait SHtml extends Loggable { | |
ajaxContext: JsonContext, | |
attrs: ElemAttr*): Elem = { | |
attrs.foldLeft(fmapFunc((func))( | |
- name => <button onclick={makeAjaxCall(Str(name + "=true"), ajaxContext).toJsCmd + | |
- "; return false;"}>{text}</button>))((e, f) => f(e)) | |
+ name => xml"""<button onclick=${makeAjaxCall(Str(name + "=true"), ajaxContext).toJsCmd + | |
+ "; return false;"}>${text}</button>"""))((e, f) => f(e)) | |
} | |
/** | |
@@ -427,8 +428,8 @@ trait SHtml extends Loggable { | |
func: String => JsCmd, | |
attrs: ElemAttr*): Elem = { | |
attrs.foldLeft(fmapFunc((SFuncHolder(func)))(name => | |
- <button onclick={makeAjaxCall(JsRaw(name.encJs + "+'='+encodeURIComponent(" + jsExp.toJsCmd + ")")).toJsCmd + | |
- "; return false;"}>{text}</button>))((e, f) => f(e)) | |
+ xml"""<button onclick=${makeAjaxCall(JsRaw(name.encJs + "+'='+encodeURIComponent(" + jsExp.toJsCmd + ")")).toJsCmd + | |
+ "; return false;"}>${text}</button>"""))((e, f) => f(e)) | |
} | |
/** | |
@@ -450,8 +451,8 @@ trait SHtml extends Loggable { | |
attrs: ElemAttr*)( | |
implicit dummy: AvoidTypeErasureIssues1): Elem = { | |
attrs.foldLeft(jsonFmapFunc(func)( | |
- name => <button onclick={makeAjaxCall(JsRaw(name.encJs + "+'='+ encodeURIComponent(JSON.stringify(" + jsExp.toJsCmd + "))"), ajaxContext).toJsCmd + | |
- "; return false;"}>{text}</button>))(_ % _) | |
+ name => xml"""<button onclick=${makeAjaxCall(JsRaw(name.encJs + "+'='+ encodeURIComponent(JSON.stringify(" + jsExp.toJsCmd + "))"), ajaxContext).toJsCmd + | |
+ "; return false;"}>${text}</button>"""))(_ % _) | |
} | |
/** | |
@@ -470,7 +471,7 @@ trait SHtml extends Loggable { | |
func: () => JsCmd, | |
attrs: ElemAttr*): Elem = { | |
attrs.foldLeft(fmapFunc((func))(name => | |
- <button onclick={deferCall(Str(name + "=true"), jsFunc).toJsCmd + "; return false;"}>{text}</button>))( | |
+ xml"<button onclick=${deferCall(Str(name + "=true"), jsFunc).toJsCmd + "; return false;"}>${text}</button>"))( | |
_ % _) | |
} | |
@@ -544,26 +545,26 @@ trait SHtml extends Loggable { | |
.cmd & swapJsCmd(show, hide)) | |
def displayMarkup: NodeSeq = | |
- displayContents ++ Text(" ") ++ <input value={S.?("edit")} type="button" onclick={setAndSwap(editName, editMarkup, dispName).toJsCmd + " return false;"} /> | |
+ displayContents ++ Text(" ") ++ xml"""<input value=${S.?("edit")} type="button" onclick=${setAndSwap(editName, editMarkup, dispName).toJsCmd + " return false;"} />""" | |
def editMarkup: NodeSeq = { | |
val formData: NodeSeq = | |
- editForm ++ <input type="submit" value={S.?("ok")} /> ++ hidden( | |
- onSubmit) ++ <input type="button" onclick={swapJsCmd(dispName,editName).toJsCmd + " return false;"} value={S.?("cancel")} /> | |
+ editForm ++ xml"""<input type="submit" value=${S.?("ok")} />""" ++ hidden( | |
+ onSubmit) ++ xml"""<input type="button" onclick=${swapJsCmd(dispName,editName).toJsCmd + " return false;"} value=${S.?("cancel")} />""" | |
ajaxForm(formData, | |
Noop, | |
setAndSwap(dispName, displayMarkup, editName)) | |
} | |
- <div> | |
- <div id={dispName}> | |
- {displayMarkup} | |
+ xml"""<div> | |
+ <div id=${dispName}> | |
+ ${displayMarkup} | |
</div> | |
- <div id={editName} style="display: none;"> | |
- {editMarkup} | |
+ <div id=${editName} style="display: none;"> | |
+ ${editMarkup} | |
</div> | |
- </div> | |
+ </div>""" | |
} | |
/** | |
@@ -575,7 +576,7 @@ trait SHtml extends Loggable { | |
*/ | |
def a(func: () => JsCmd, body: NodeSeq, attrs: ElemAttr*): Elem = { | |
attrs.foldLeft(fmapFunc((func))(name => | |
- <a href="javascript://" onclick={makeAjaxCall(Str(name + "=true")).toJsCmd + "; return false;"}>{body}</a>))( | |
+ xml"""<a href="javascript://" onclick=${makeAjaxCall(Str(name + "=true")).toJsCmd + "; return false;"}>${body}</a>"""))( | |
_ % _) | |
} | |
@@ -594,7 +595,7 @@ trait SHtml extends Loggable { | |
body: NodeSeq, | |
attrs: ElemAttr*): Elem = { | |
attrs.foldLeft(fmapFunc((func))(name => | |
- <a href="javascript://" onclick={deferCall(Str(name + "=true"), jsFunc).toJsCmd + "; return false;"}>{body}</a>))( | |
+ xml"""<a href="javascript://" onclick=${deferCall(Str(name + "=true"), jsFunc).toJsCmd + "; return false;"}>${body}</a>"""))( | |
_ % _) | |
} | |
@@ -604,7 +605,7 @@ trait SHtml extends Loggable { | |
attrs: ElemAttr*): Elem = { | |
attrs.foldLeft(fmapFunc((func))(name => | |
- <a href="javascript://" onclick={makeAjaxCall(Str(name + "=true"), jsonContext).toJsCmd + "; return false;"}>{body}</a>))( | |
+ xml"""<a href="javascript://" onclick=${makeAjaxCall(Str(name + "=true"), jsonContext).toJsCmd + "; return false;"}>${body}</a>"""))( | |
_ % _) | |
} | |
@@ -629,14 +630,14 @@ trait SHtml extends Loggable { | |
* Create an anchor that will run a JavaScript command when clicked | |
*/ | |
def a(body: NodeSeq, cmd: JsCmd, attrs: ElemAttr*): Elem = | |
- attrs.foldLeft(<a href="javascript://" | |
- onclick={cmd.toJsCmd + "; return false;"}>{body}</a>)(_ % _) | |
+ attrs.foldLeft(xml"""<a href="javascript://" | |
+ onclick=${cmd.toJsCmd + "; return false;"}>${body}</a>""")(_ % _) | |
/** | |
* Create a span that will run a JavaScript command when clicked | |
*/ | |
def span(body: NodeSeq, cmd: JsCmd, attrs: ElemAttr*): Elem = | |
- attrs.foldLeft(<span onclick={cmd.toJsCmd}>{body}</span>)(_ % _) | |
+ attrs.foldLeft(xml"<span onclick=${cmd.toJsCmd}>${body}</span>")(_ % _) | |
def toggleKids( | |
head: Elem, visible: Boolean, func: () => JsCmd, kids: Elem): NodeSeq = { | |
@@ -670,7 +671,7 @@ trait SHtml extends Loggable { | |
json: JsExp => JsCmd, | |
attrs: ElemAttr*): Elem = | |
(attrs.foldLeft( | |
- <input type="text" value={value match {case null => "" case s => s}}/>)( | |
+ xml"""<input type="text" value=${value match {case null => "" case s => s}}/>""")( | |
_ % _)) % ("onkeypress" -> """liftUtils.lift_blurIfReturn(event)""") % | |
(if (ignoreBlur) Null else ("onblur" -> (json(JE.JsRaw("this.value"))))) | |
@@ -740,7 +741,7 @@ trait SHtml extends Loggable { | |
val key = formFuncName | |
fmapFunc((func)) { funcName => | |
- (attrs.foldLeft(<input type="text" value={value}/>)(_ % _)) % | |
+ (attrs.foldLeft(xml"""<input type="text" value=${value}/>""")(_ % _)) % | |
("onkeypress" -> """liftUtils.lift_blurIfReturn(event)""") % | |
(if (ignoreBlur) Null | |
else | |
@@ -768,7 +769,7 @@ trait SHtml extends Loggable { | |
*/ | |
def jsonTextarea( | |
value: String, json: JsExp => JsCmd, attrs: ElemAttr*): Elem = | |
- (attrs.foldLeft(<textarea>{value}</textarea>)(_ % _)) % | |
+ (attrs.foldLeft(xml"<textarea>${value}</textarea>")(_ % _)) % | |
("onblur" -> (json(JE.JsRaw("this.value")))) | |
/** | |
@@ -803,7 +804,7 @@ trait SHtml extends Loggable { | |
val key = formFuncName | |
fmapFunc((func)) { funcName => | |
- (attrs.foldLeft(<textarea>{value}</textarea>)(_ % _)) % | |
+ (attrs.foldLeft(xml"<textarea>${value}</textarea>")(_ % _)) % | |
("onblur" -> | |
(jsFunc match { | |
case Full(f) => | |
@@ -849,7 +850,7 @@ trait SHtml extends Loggable { | |
*/ | |
def area(shape: AreaShape, alt: String, attrs: ElemAttr*): Elem = | |
attrs.foldLeft( | |
- <area alt={alt} shape={shape.shape} coords={shape.coords} />)(_ % _) | |
+ xml"<area alt=${alt} shape=${shape.shape} coords=${shape.coords} />")(_ % _) | |
/** | |
* Generate an Area tag | |
@@ -931,7 +932,7 @@ trait SHtml extends Loggable { | |
val key = formFuncName | |
fmapFunc((func)) { funcName => | |
- (attrs.foldLeft(<input type="checkbox"/>)(_ % _)) % checked(value) % | |
+ (attrs.foldLeft(xml"""<input type="checkbox"/>""")(_ % _)) % checked(value) % | |
("onclick" -> | |
(jsFunc match { | |
case Full(f) => | |
@@ -959,8 +960,8 @@ trait SHtml extends Loggable { | |
{ | |
ChoiceItem( | |
v, | |
- attrs.foldLeft(<input type="radio" name={groupName} | |
- value={Helpers.nextFuncName}/>)(_ % _) % checked( | |
+ attrs.foldLeft(xml"""<input type="radio" name=${groupName} | |
+ value=${Helpers.nextFuncName}/>""")(_ % _) % checked( | |
deflt == Full(v)) % | |
("onclick" -> ajaxCall(Str(""), ignore => ajaxFunc(v))._2.toJsCmd)) | |
} | |
@@ -1151,10 +1152,10 @@ trait SHtml extends Loggable { | |
}, | |
func.owner) | |
fmapFunc((testFunc)) { funcName => | |
- (attrs.foldLeft(<select>{opts.flatMap { | |
+ (attrs.foldLeft(xml"""<select>${opts.flatMap { | |
case option => | |
optionToElem(option) % selected(deflt.exists(_ == option.value)) | |
- }}</select>)(_ % _)) % | |
+ }}</select>""")(_ % _)) % | |
("onchange" -> | |
(jsFunc match { | |
case Full(f) => | |
@@ -1176,8 +1177,8 @@ trait SHtml extends Loggable { | |
val (rs, sid) = findOrAddId(shown) | |
val (rh, hid) = findOrAddId(hidden) | |
val ui = LiftRules.jsArtifacts | |
- ( <span>{rs % ("onclick" -> (ui.hide(sid).cmd & | |
- ui.showAndFocus(hid).cmd & JsRaw("return false;")))}{dealWithBlur(rh % ("style" -> "display: none"), (ui.show(sid).cmd & ui.hide(hid).cmd))}</span>) | |
+ ( xml"""<span>${rs % ("onclick" -> (ui.hide(sid).cmd & | |
+ ui.showAndFocus(hid).cmd & JsRaw("return false;")))}${dealWithBlur(rh % ("style" -> "display: none"), (ui.show(sid).cmd & ui.hide(hid).cmd))}</span>""") | |
} | |
def swappable(shown: Elem, hidden: String => Elem): Elem = { | |
@@ -1186,8 +1187,8 @@ trait SHtml extends Loggable { | |
val ui = LiftRules.jsArtifacts | |
val rh = | |
- <span id={hid}>{hidden(ui.show(sid).toJsCmd + ";" + ui.hide(hid).toJsCmd + ";")}</span> | |
- ( <span>{rs % ("onclick" -> (ui.hide(sid).toJsCmd + ";" + ui.show(hid).toJsCmd + "; return false;"))}{(rh % ("style" -> "display: none"))}</span>) | |
+ xml"<span id=${hid}>${hidden(ui.show(sid).toJsCmd + ";" + ui.hide(hid).toJsCmd + ";")}</span>" | |
+ ( xml"<span>${rs % ("onclick" -> (ui.hide(sid).toJsCmd + ";" + ui.show(hid).toJsCmd + "; return false;"))}${(rh % ("style" -> "display: none"))}</span>") | |
} | |
private def dealWithBlur(elem: Elem, blurCmd: String): Elem = { | |
@@ -1212,14 +1213,14 @@ trait SHtml extends Loggable { | |
to: String, func: () => Any, body: NodeSeq, attrs: ElemAttr*): Elem = { | |
fmapFunc((a: List[String]) => { func(); true })(key => | |
attrs.foldLeft( | |
- <a href={Helpers.appendFuncToURL(to, key + "=_")}>{body}</a>)( | |
+ xml"<a href=${Helpers.appendFuncToURL(to, key + "=_")}>${body}</a>")( | |
_ % _)) | |
} | |
private def makeFormElement( | |
name: String, func: AFuncHolder, attrs: ElemAttr*): Elem = | |
fmapFunc(func)(funcName => | |
- attrs.foldLeft(<input type={name} name={funcName}/>)(_ % _)) | |
+ attrs.foldLeft(xml"<input type=${name} name=${funcName}/>")(_ % _)) | |
def text_*(value: String, func: AFuncHolder, attrs: ElemAttr*): Elem = | |
text_*(value, func, Empty, attrs: _*) | |
@@ -1526,7 +1527,7 @@ trait SHtml extends Loggable { | |
checkBoxName match { | |
// if we've got a single checkbox, add a hidden false checkbox | |
case Full(name) if checkBoxCnt == 1 => { | |
- ret ++ <input type="hidden" name={name} value="false"/> | |
+ ret ++ xml"""<input type="hidden" name=${name} value="false"/>""" | |
} | |
case _ => ret | |
@@ -1757,8 +1758,8 @@ trait SHtml extends Loggable { | |
attrs: ElemAttr*): Elem = { | |
def doit: Elem = { | |
attrs.foldLeft(fmapFunc((func))( | |
- name => <button type="submit" name={name} value="_">{ | |
- strOrNodeSeq.nodeSeq}</button>))(_ % _) | |
+ name => xml"""<button type="submit" name=${name} value="_">${ | |
+ strOrNodeSeq.nodeSeq}</button>"""))(_ % _) | |
} | |
_formGroup.is match { | |
@@ -1800,7 +1801,7 @@ trait SHtml extends Loggable { | |
val funcName = "z" + Helpers.nextFuncName | |
addFunctionMap(funcName, (func)) | |
- (attrs.foldLeft(<input type="submit" name={funcName}/>)(_ % _)) % new UnprefixedAttribute( | |
+ (attrs.foldLeft(xml"""<input type="submit" name=${funcName}/>""")(_ % _)) % new UnprefixedAttribute( | |
"value", Text(value), Null) % | |
("onclick" -> ("lift.setUriSuffix('" + funcName + "=_'); return true;")) | |
} | |
@@ -1862,7 +1863,7 @@ trait SHtml extends Loggable { | |
* | |
* @param body The form body. This should not include the <form> tag. | |
*/ | |
- def ajaxForm(body: NodeSeq) = ( <lift:form>{body}</lift:form>) | |
+ def ajaxForm(body: NodeSeq) = ( xml"<lift:form>${body}</lift:form>") | |
/** | |
* Takes a form and wraps it so that it will be submitted via AJAX. | |
@@ -1871,7 +1872,7 @@ trait SHtml extends Loggable { | |
* @param onSubmit JavaScript code to execute on the client prior to submission | |
*/ | |
def ajaxForm(body: NodeSeq, onSubmit: JsCmd) = | |
- ( <lift:form onsubmit={onSubmit.toJsCmd}>{body}</lift:form>) | |
+ ( xml"<lift:form onsubmit=${onSubmit.toJsCmd}>${body}</lift:form>") | |
/** | |
* Takes a form and wraps it so that it will be submitted via AJAX. This also | |
@@ -1881,7 +1882,7 @@ trait SHtml extends Loggable { | |
* @param postSubmit Code that should be executed after a successful submission | |
*/ | |
def ajaxForm(body: NodeSeq, onSubmit: JsCmd, postSubmit: JsCmd) = | |
- ( <lift:form onsubmit={onSubmit.toJsCmd} postsubmit={postSubmit.toJsCmd}>{body}</lift:form>) | |
+ ( xml"<lift:form onsubmit=${onSubmit.toJsCmd} postsubmit=${postSubmit.toJsCmd}>${body}</lift:form>") | |
/** | |
* Having a regular form, this method can be used to send the serialized content of the form. | |
@@ -1991,7 +1992,7 @@ trait SHtml extends Loggable { | |
private def optionToElem(option: SelectableOption[String]): Elem = | |
option.attrs.foldLeft( | |
- <option value={option.value}>{option.label}</option>)(_ % _) | |
+ xml"<option value=${option.value}>${option.label}</option>")(_ % _) | |
private final case class SelectableOptionWithNonce[+T]( | |
value: T, nonce: String, label: String, attrs: ElemAttr*) | |
@@ -2091,10 +2092,10 @@ trait SHtml extends Loggable { | |
func.owner) | |
attrs.foldLeft(fmapFunc(testFunc) { fn => | |
- <select name={fn}>{opts.flatMap { | |
+ xml"""<select name=${fn}>${opts.flatMap { | |
case option => | |
optionToElem(option) % selected(deflt.exists(_ == option.value)) | |
- }}</select> | |
+ }}</select>""" | |
})(_ % _) | |
} | |
@@ -2127,10 +2128,10 @@ trait SHtml extends Loggable { | |
func: AFuncHolder, | |
attrs: ElemAttr*): Elem = | |
fmapFunc(func) { funcName => | |
- attrs.foldLeft(<select name={funcName}>{opts.flatMap { | |
+ attrs.foldLeft(xml"""<select name=${funcName}>${opts.flatMap { | |
case option => | |
optionToElem(option) % selected(deflt.exists(_ == option.value)) | |
- }}</select>)(_ % _) | |
+ }}</select>""")(_ % _) | |
} | |
/** | |
@@ -2166,11 +2167,11 @@ trait SHtml extends Loggable { | |
NodeSeq.fromSeq( | |
List( | |
attrs.foldLeft( | |
- <select multiple="true" name={funcName}>{opts.flatMap { | |
+ xml"""<select multiple="true" name=${funcName}>${opts.flatMap { | |
case option => | |
optionToElem(option) % selected(deflt.contains(option.value)) | |
- }}</select>)(_ % _), | |
- <input type="hidden" value={hiddenId} name={funcName}/> | |
+ }}</select>""")(_ % _), | |
+ xml"""<input type="hidden" value=${hiddenId} name=${funcName}/>""" | |
) | |
) | |
} | |
@@ -2244,10 +2245,10 @@ trait SHtml extends Loggable { | |
fmapFunc(contextFuncBuilder(testFunc)) { | |
import net.liftweb.http.js.JsCmds.JsCrVar | |
funcName => | |
- (attrs.foldLeft(<select>{ opts.flatMap { | |
+ (attrs.foldLeft(xml"""<select>${ opts.flatMap { | |
case option => | |
optionToElem(option) % selected(deflt.exists(_ == option.value)) | |
- } }</select>)(_ % _)) % | |
+ } }</select>""")(_ % _)) % | |
("onchange" -> | |
(jsFunc match { | |
case Full(f) => | |
@@ -2340,7 +2341,7 @@ trait SHtml extends Loggable { | |
fmapFunc(func)( | |
funcName => | |
attrs.foldLeft( | |
- <select multiple="true" name={funcName}>{opts.flatMap(o => optionToElem(o) % selected(deflt.contains(o.value)))}</select>)( | |
+ xml"""<select multiple="true" name=${funcName}>${opts.flatMap(o => optionToElem(o) % selected(deflt.contains(o.value)))}</select>""")( | |
_ % _)) | |
def textarea(value: String, func: String => Any, attrs: ElemAttr*): Elem = | |
@@ -2354,7 +2355,7 @@ trait SHtml extends Loggable { | |
fmapFunc(func)( | |
funcName => | |
attrs.foldLeft( | |
- <textarea name={funcName}>{value match {case null => "" case s => s}}</textarea>)( | |
+ xml"<textarea name=${funcName}>${value match {case null => "" case s => s}}</textarea>")( | |
_ % _)) | |
def radio(opts: Seq[String], | |
@@ -2384,13 +2385,13 @@ trait SHtml extends Loggable { | |
val items = possible.zipWithIndex.map { | |
case ((id, value), idx) => { | |
val radio = | |
- attrs.foldLeft(<input type="radio" | |
- name={name} value={id}/>)(_ % _) % checked( | |
+ attrs.foldLeft(xml"""<input type="radio" | |
+ name=${name} value=${id}/>""")(_ % _) % checked( | |
deflt.filter(_ == value).isDefined) | |
val elem = | |
if (idx == 0) { | |
- radio ++ <input type="hidden" value={hiddenId} name={name}/> | |
+ radio ++ xml"""<input type="hidden" value=${hiddenId} name=${name}/>""" | |
} else { | |
radio | |
} | |
@@ -2413,7 +2414,7 @@ trait SHtml extends Loggable { | |
v => | |
ChoiceItem( | |
v, | |
- attrs.foldLeft(<input type="radio" name={name} value={v}/>)( | |
+ attrs.foldLeft(xml"""<input type="radio" name=${name} value=${v}/>""")( | |
_ % _) % checked( | |
deflt.filter((s: String) => s == v).isDefined))) | |
ChoiceHolder(itemList) | |
@@ -2495,7 +2496,7 @@ trait SHtml extends Loggable { | |
def fileUpload(func: FileParamHolder => Any, attrs: ElemAttr*): Elem = { | |
val f2: FileParamHolder => Any = fp => if (fp.length > 0) func(fp) | |
fmapFunc(BinFuncHolder(f2)) { name => | |
- attrs.foldLeft(<input type="file" name={ name }/>) { _ % _ } | |
+ attrs.foldLeft(xml"""<input type="file" name=${ name }/>""") { _ % _ } | |
} | |
} | |
@@ -2528,7 +2529,7 @@ trait SHtml extends Loggable { | |
/** Convert a ChoiceItem into a span containing the control and the toString of the key */ | |
var htmlize: ChoiceItem[_] => NodeSeq = c => | |
- ( <span>{c.xhtml} {c.key.toString}<br/> </span>) | |
+ ( xml"<span>${c.xhtml} ${c.key.toString}<br/> </span>") | |
} | |
private def checked(in: Boolean) = | |
@@ -2569,10 +2570,10 @@ trait SHtml extends Loggable { | |
ChoiceItem( | |
possibleChoice._1, | |
attrs.foldLeft( | |
- <input type="checkbox" name={name} value={possibleChoice._2.toString}/>)( | |
+ xml"""<input type="checkbox" name=${name} value=${possibleChoice._2.toString}/>""")( | |
_ % _) % checked(actual.contains(possibleChoice._1)) ++ { | |
if (possibleChoice._2 == 0) | |
- <input type="hidden" name={name} value="-1"/> | |
+ xml"""<input type="hidden" name=${name} value="-1"/>""" | |
else Nil | |
} | |
) | |
@@ -2637,9 +2638,9 @@ trait SHtml extends Loggable { | |
attrs: ElemAttr*): NodeSeq = { | |
fmapFunc(func)( | |
name => | |
- (attrs.foldLeft(<input type="checkbox" name={name} value="true"/>)( | |
+ (attrs.foldLeft(xml"""<input type="checkbox" name=${name} value="true"/>""")( | |
_ % _) % checked(value) % setId(id)) ++ | |
- (<input type="hidden" name={name} value="false"/>)) | |
+ (xml"""<input type="hidden" name=${name} value="false"/>""")) | |
} | |
} | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/Templates.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/Templates.scala | |
index 09d94f0fe2..a75ab485d2 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/Templates.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/Templates.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import common._ | |
import java.util.Locale | |
import scala.xml._ | |
@@ -213,12 +214,12 @@ object Templates { | |
case e: ValidationException | |
if Props.devMode | Props.testMode => | |
return Helpers.errorDiv( | |
- <div>Error locating template: <b>{name}</b><br/> | |
- Message: <b>{e.getMessage}</b><br/> | |
- { | |
- <pre>{e.toString}{e.getStackTrace.map(_.toString).mkString("\n")}</pre> | |
+ xml"""<div>Error locating template: <b>${name}</b><br/> | |
+ Message: <b>${e.getMessage}</b><br/> | |
+ ${ | |
+ xml"<pre>${e.toString}${e.getStackTrace.map(_.toString).mkString("\n")}</pre>" | |
} | |
- </div>) | |
+ </div>""") | |
case e: ValidationException => Empty | |
} | |
@@ -234,15 +235,15 @@ object Templates { | |
val msg = xmlb.asInstanceOf[Failure].msg | |
val e = xmlb.asInstanceOf[Failure].exception | |
return Helpers.errorDiv( | |
- <div>Error locating template: <b>{name}</b><br/>Message: <b>{msg}</b><br/>{ | |
+ xml"""<div>Error locating template: <b>${name}</b><br/>Message: <b>${msg}</b><br/>${ | |
{ | |
e match { | |
case Full(e) => | |
- <pre>{e.toString}{e.getStackTrace.map(_.toString).mkString("\n")}</pre> | |
+ xml"<pre>${e.toString}${e.getStackTrace.map(_.toString).mkString("\n")}</pre>" | |
case _ => NodeSeq.Empty | |
} | |
}} | |
- </div>) | |
+ </div>""") | |
} | |
} | |
} | |
@@ -331,7 +332,7 @@ abstract class SnippetFailureException(msg: String) | |
!cn.startsWith("java.lang") && !cn.startsWith("sun.") | |
} | |
}.take(10).toList.map { e => | |
- <code><span><br/>{e.toString}</span></code> | |
+ xml"<code><span><br/>${e.toString}</span></code>" | |
} | |
} | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/WiringUI.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/WiringUI.scala | |
index d11a65d093..9164652230 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/WiringUI.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/WiringUI.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import common._ | |
import util._ | |
@@ -138,7 +139,7 @@ object WiringUI { | |
case e: Elem => true | |
case _ => false | |
}.map(_.asInstanceOf[Elem]) | |
- .getOrElse(<span id={Helpers.nextFuncName}>{in}</span>) | |
+ .getOrElse(xml"<span id=${Helpers.nextFuncName}>${in}</span>") | |
addHistJsFunc(cell, (old: Box[T], nw: T) => f(old, nw, in)) | |
@@ -267,7 +268,7 @@ object WiringUI { | |
case e: Elem => true | |
case _ => false | |
}.map(_.asInstanceOf[Elem]) | |
- .getOrElse(<span id={Helpers.nextFuncName}>{in}</span>) | |
+ .getOrElse(xml"<span id=${Helpers.nextFuncName}>${in}</span>") | |
val (elem: Elem, id: String) = Helpers.findOrAddId(myElem) | |
addJsFunc(cell, | |
@@ -306,7 +307,7 @@ object WiringUI { | |
case e: Elem => true | |
case _ => false | |
}.map(_.asInstanceOf[Elem]) | |
- .getOrElse(<span id={Helpers.nextFuncName}>{in}</span>) | |
+ .getOrElse(xml"<span id=${Helpers.nextFuncName}>${in}</span>") | |
val (elem: Elem, id: String) = Helpers.findOrAddId(myElem) | |
addJsFunc(cell, | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/Wizard.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/Wizard.scala | |
index a6ab13614e..5b429e19bf 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/Wizard.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/Wizard.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import net.liftweb._ | |
import http._ | |
import js._ | |
@@ -368,21 +369,21 @@ trait Wizard extends StatefulSnippet with Factory with ScreenWizardRendered { | |
*/ | |
def calcFirstScreen: Box[Screen] = screens.headOption | |
- def nextButton: Elem = <button> | |
- {S.?("Next")} | |
- </button> | |
+ def nextButton: Elem = xml"""<button> | |
+ ${S.?("Next")} | |
+ </button>""" | |
- def prevButton: Elem = <button> | |
- {S.?("Previous")} | |
- </button> | |
+ def prevButton: Elem = xml"""<button> | |
+ ${S.?("Previous")} | |
+ </button>""" | |
- def cancelButton: Elem = <button> | |
- {S.?("Cancel")} | |
- </button> | |
+ def cancelButton: Elem = xml"""<button> | |
+ ${S.?("Cancel")} | |
+ </button>""" | |
- def finishButton: Elem = <button> | |
- {S.?("Finish")} | |
- </button> | |
+ def finishButton: Elem = xml"""<button> | |
+ ${S.?("Finish")} | |
+ </button>""" | |
def currentScreen: Box[Screen] = CurrentScreen.is | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/js/JsCommands.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/js/JsCommands.scala | |
index 739bd230b2..1c7e06773b 100755 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/js/JsCommands.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/js/JsCommands.scala | |
@@ -17,6 +17,7 @@ package net.liftweb | |
package http | |
package js | |
+import scala.xml.quote._ | |
import scala.xml.{NodeSeq, Group, Unparsed, Elem} | |
import net.liftweb.util.Helpers._ | |
import net.liftweb.common._ | |
@@ -716,11 +717,11 @@ object JsCmds { | |
object Script { | |
def apply(script: JsCmd): Node = | |
- <script type="text/javascript">{Unparsed(""" | |
+ xml"""<script type="text/javascript">${Unparsed(""" | |
// <![CDATA[ | |
""" + fixEndScriptTag(script.toJsCmd) + """ | |
// ]]> | |
-""")}</script> | |
+""")}</script>""" | |
private def fixEndScriptTag(in: String): String = | |
"""\<\/script\>""".r.replaceAllIn(in, """<\\/script>""") | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/package.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/package.scala | |
index 52f5fcf5be..c1d836fdc6 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/package.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/package.scala | |
@@ -16,6 +16,7 @@ | |
package net.liftweb | |
+import scala.xml.quote._ | |
import scala.concurrent.{ExecutionContext, Future} | |
import scala.xml.{Comment, NodeSeq} | |
@@ -60,7 +61,7 @@ package object http { | |
concreteResolvable, | |
resolvedResult => deferredRender(resolvedResult)) | |
- <div id={placeholderId}><img src="/images/ajax-loader.gif" alt="Loading..." /></div> | |
+ xml"""<div id=${placeholderId}><img src="/images/ajax-loader.gif" alt="Loading..." /></div>""" | |
} openOr { | |
Comment( | |
"FIX" + "ME: Asynchronous rendering failed for unknown reason.") | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/rest/XMLApiHelper.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/rest/XMLApiHelper.scala | |
index 988a6d7cd7..1b5c78c96a 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/rest/XMLApiHelper.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/rest/XMLApiHelper.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package http | |
package rest | |
+import scala.xml.quote._ | |
import net.liftweb.common._ | |
import net.liftweb._ | |
import util._ | |
@@ -86,7 +87,7 @@ trait XMLApiHelper { | |
* the "in" parameter. | |
*/ | |
implicit def boolToResponse(in: Boolean): LiftResponse = | |
- buildResponse(in, Empty, <xml:group/>) | |
+ buildResponse(in, Empty, xml"<xml:group/>") | |
/** | |
* Converts a boxed boolean into a response of a root element with | |
@@ -98,7 +99,7 @@ trait XMLApiHelper { | |
buildResponse(in openOr false, in match { | |
case Failure(msg, _, _) => Full(Text(msg)) | |
case _ => Empty | |
- }, <xml:group/>) | |
+ }, xml"<xml:group/>") | |
/** | |
* Converts a boxed Seq[Node] into a response. If the Box is a Full, | |
@@ -129,7 +130,7 @@ trait XMLApiHelper { | |
* attribute set to the value of the second element of the pair. | |
*/ | |
implicit def pairToResponse(in: (Boolean, String)): LiftResponse = | |
- buildResponse(in._1, Full(Text(in._2)), <xml:group/>) | |
+ buildResponse(in._1, Full(Text(in._2)), xml"<xml:group/>") | |
/** | |
* Converts a given LiftResponse into a Full[LiftResponse] | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/sitemap/FlexMenuBuilder.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/sitemap/FlexMenuBuilder.scala | |
index eef7f845cf..9871f4a7c8 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/sitemap/FlexMenuBuilder.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/sitemap/FlexMenuBuilder.scala | |
@@ -16,6 +16,7 @@ | |
package net.liftweb.sitemap | |
+import scala.xml.quote._ | |
import net.liftweb.common._ | |
import net.liftweb.http.{LiftRules, S} | |
import xml.{Elem, Text, NodeSeq} | |
@@ -118,7 +119,7 @@ trait FlexMenuBuilder { | |
*/ | |
protected def buildInnerTag( | |
contents: NodeSeq, path: Boolean, current: Boolean): Elem = | |
- updateForCurrent(updateForPath(<li>{contents}</li>, path), current) | |
+ updateForCurrent(updateForPath(xml"<li>${contents}</li>", path), current) | |
/** | |
* Render a placeholder | |
@@ -126,7 +127,7 @@ trait FlexMenuBuilder { | |
protected def renderPlaceholder( | |
item: MenuItem, renderInner: Seq[MenuItem] => NodeSeq): Elem = { | |
buildInnerTag( | |
- <xml:group><span>{item.text}</span>{renderInner(item.kids)}</xml:group>, | |
+ xml"<xml:group><span>${item.text}</span>${renderInner(item.kids)}</xml:group>", | |
item.path, | |
item.current) | |
} | |
@@ -136,8 +137,8 @@ trait FlexMenuBuilder { | |
*/ | |
protected def renderSelfLinked( | |
item: MenuItem, renderInner: Seq[MenuItem] => NodeSeq): Elem = | |
- buildInnerTag(<xml:group>{renderLink(item.uri, item.text, item.path, | |
- item.current)}{renderInner(item.kids)}</xml:group>, | |
+ buildInnerTag(xml"""<xml:group>${renderLink(item.uri, item.text, item.path, | |
+ item.current)}${renderInner(item.kids)}</xml:group>""", | |
item.path, | |
item.current) | |
@@ -147,29 +148,29 @@ trait FlexMenuBuilder { | |
protected def renderSelfNotLinked( | |
item: MenuItem, renderInner: Seq[MenuItem] => NodeSeq): Elem = | |
buildInnerTag( | |
- <xml:group>{renderSelf(item)}{renderInner(item.kids)}</xml:group>, | |
+ xml"<xml:group>${renderSelf(item)}${renderInner(item.kids)}</xml:group>", | |
item.path, | |
item.current) | |
/** | |
* Render the currently selected menu item | |
*/ | |
- protected def renderSelf(item: MenuItem): NodeSeq = <span>{item.text}</span> | |
+ protected def renderSelf(item: MenuItem): NodeSeq = xml"<span>${item.text}</span>" | |
/** | |
* Render a generic link | |
*/ | |
protected def renderLink( | |
uri: NodeSeq, text: NodeSeq, path: Boolean, current: Boolean): NodeSeq = | |
- <a href={uri}>{text}</a> | |
+ xml"<a href=${uri}>${text}</a>" | |
/** | |
* Render an item in the current path | |
*/ | |
protected def renderItemInPath( | |
item: MenuItem, renderInner: Seq[MenuItem] => NodeSeq): Elem = | |
- buildInnerTag(<xml:group>{renderLink(item.uri, item.text, item.path, | |
- item.current)}{renderInner(item.kids)}</xml:group>, | |
+ buildInnerTag(xml"""<xml:group>${renderLink(item.uri, item.text, item.path, | |
+ item.current)}${renderInner(item.kids)}</xml:group>""", | |
item.path, | |
item.current) | |
@@ -178,8 +179,8 @@ trait FlexMenuBuilder { | |
*/ | |
protected def renderItem( | |
item: MenuItem, renderInner: Seq[MenuItem] => NodeSeq): Elem = | |
- buildInnerTag(<xml:group>{renderLink(item.uri, item.text, item.path, | |
- item.current)}{renderInner(item.kids)}</xml:group>, | |
+ buildInnerTag(xml"""<xml:group>${renderLink(item.uri, item.text, item.path, | |
+ item.current)}${renderInner(item.kids)}</xml:group>""", | |
item.path, | |
item.current) | |
@@ -187,7 +188,7 @@ trait FlexMenuBuilder { | |
* Render the outer tag for a group of menu items | |
*/ | |
protected def renderOuterTag(inner: NodeSeq, top: Boolean): NodeSeq = | |
- <ul>{inner}</ul> | |
+ xml"<ul>${inner}</ul>" | |
/** | |
* The default set of MenuItems to be rendered | |
diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/sitemap/SiteMap.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/sitemap/SiteMap.scala | |
index 9c9e760a57..b313a5e503 100644 | |
--- a/repos/framework/web/webkit/src/main/scala/net/liftweb/sitemap/SiteMap.scala | |
+++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/sitemap/SiteMap.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package sitemap | |
+import scala.xml.quote._ | |
import http._ | |
import util._ | |
import common._ | |
@@ -243,7 +244,7 @@ sealed class SiteMapSingleton { | |
case x if x.length > 0 => x | |
case _ => loc.linkText openOr Text(loc.name) | |
} | |
- <a href={link}>{linkText}</a> | |
+ xml"<a href=${link}>${linkText}</a>" | |
} | |
options.headOption getOrElse NodeSeq.Empty | |
diff --git a/repos/framework/web/webkit/src/test/scala/bootstrap/liftweb/Boot.scala b/repos/framework/web/webkit/src/test/scala/bootstrap/liftweb/Boot.scala | |
index 2f4efa5f51..3d2920a211 100644 | |
--- a/repos/framework/web/webkit/src/test/scala/bootstrap/liftweb/Boot.scala | |
+++ b/repos/framework/web/webkit/src/test/scala/bootstrap/liftweb/Boot.scala | |
@@ -16,6 +16,7 @@ | |
package bootstrap.liftweb | |
+import scala.xml.quote._ | |
import net.liftweb.util._ | |
import net.liftweb.http._ | |
import net.liftweb.sitemap._ | |
@@ -45,18 +46,18 @@ object ContainerVarTests extends RestHelper { | |
// object CaseVar extends ContainerVar(Moose("dog")) | |
serve { | |
- case "cv_int" :: Nil Get _ => <int>{IntVar.is}</int> | |
+ case "cv_int" :: Nil Get _ => xml"<int>${IntVar.is}</int>" | |
case "cv_int" :: AsInt(i) :: _ Get _ => { | |
IntVar.set(i) | |
- <int>{IntVar.is}</int> | |
+ xml"<int>${IntVar.is}</int>" | |
} | |
} | |
serve { | |
- case "cv_str" :: Nil Get _ => <str>{StrVar.is}</str> | |
+ case "cv_str" :: Nil Get _ => xml"<str>${StrVar.is}</str>" | |
case "cv_str" :: str :: _ Get _ => { | |
StrVar.set(str) | |
- <str>{StrVar.is}</str> | |
+ xml"<str>${StrVar.is}</str>" | |
} | |
} | |
} | |
diff --git a/repos/framework/web/webkit/src/test/scala/net/liftweb/builtin/snippet/MsgSpec.scala b/repos/framework/web/webkit/src/test/scala/net/liftweb/builtin/snippet/MsgSpec.scala | |
index 86e0c762e8..69804dafd9 100644 | |
--- a/repos/framework/web/webkit/src/test/scala/net/liftweb/builtin/snippet/MsgSpec.scala | |
+++ b/repos/framework/web/webkit/src/test/scala/net/liftweb/builtin/snippet/MsgSpec.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package builtin.snippet | |
+import scala.xml.quote._ | |
import xml._ | |
import org.specs2.matcher.XmlMatchers | |
import org.specs2.mutable.Specification | |
@@ -47,11 +48,11 @@ object MsgSpec extends Specification with XmlMatchers { | |
"id", | |
Text("foo"), | |
new UnprefixedAttribute("noticeClass", Text("funky"), Null))) { | |
- secureXML.loadString(Msg.render(<div/>).toString) | |
+ secureXML.loadString(Msg.render(xml"<div/>").toString) | |
} | |
result must ==/( | |
- <span id="foo">Error, <span class="funky">Notice</span></span>) | |
+ xml"""<span id="foo">Error, <span class="funky">Notice</span></span>""") | |
} | |
} | |
@@ -67,7 +68,7 @@ object MsgSpec extends Specification with XmlMatchers { | |
"id", | |
Text("foo"), | |
new UnprefixedAttribute("noticeClass", Text("funky"), Null))) { | |
- Msg.render(<div/>).toString // render this first so attrs get captured | |
+ Msg.render(xml"<div/>").toString // render this first so attrs get captured | |
LiftRules.noticesToJsCmd().toString.replace("\n", "") | |
} | |
diff --git a/repos/framework/web/webkit/src/test/scala/net/liftweb/builtin/snippet/MsgsSpec.scala b/repos/framework/web/webkit/src/test/scala/net/liftweb/builtin/snippet/MsgsSpec.scala | |
index 2c38794914..cd78a8fc0c 100644 | |
--- a/repos/framework/web/webkit/src/test/scala/net/liftweb/builtin/snippet/MsgsSpec.scala | |
+++ b/repos/framework/web/webkit/src/test/scala/net/liftweb/builtin/snippet/MsgsSpec.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package builtin.snippet | |
+import scala.xml.quote._ | |
import org.specs2.matcher.XmlMatchers | |
import org.specs2.mutable.Specification | |
@@ -44,12 +45,12 @@ object MsgsSpec extends Specification with XmlMatchers { | |
// We reparse due to inconsistencies with UnparsedAttributes | |
secureXML.loadString(Msgs | |
.render( | |
- <lift:warning_msg>Warning:</lift:warning_msg><lift:notice_class>funky</lift:notice_class> | |
+ xml"<lift:warning_msg>Warning:</lift:warning_msg><lift:notice_class>funky</lift:notice_class>" | |
) | |
.toString) | |
} | |
- result must ==/(<div id="lift__noticesContainer__"> | |
+ result must ==/(xml"""<div id="lift__noticesContainer__"> | |
<div id="lift__noticesContainer___error"> | |
<ul> | |
<li>Error</li> | |
@@ -65,7 +66,7 @@ object MsgsSpec extends Specification with XmlMatchers { | |
<li>Notice</li> | |
</ul> | |
</div> | |
- </div>) | |
+ </div>""") | |
} | |
"Properly render AJAX content" in { | |
diff --git a/repos/framework/web/webkit/src/test/scala/net/liftweb/http/BindingsSpec.scala b/repos/framework/web/webkit/src/test/scala/net/liftweb/http/BindingsSpec.scala | |
index 202a37ec93..a19c3718b7 100644 | |
--- a/repos/framework/web/webkit/src/test/scala/net/liftweb/http/BindingsSpec.scala | |
+++ b/repos/framework/web/webkit/src/test/scala/net/liftweb/http/BindingsSpec.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import xml.{NodeSeq, Text} | |
import org.specs2.matcher.XmlMatchers | |
import org.specs2.mutable.Specification | |
@@ -59,19 +60,19 @@ object BindingsSpec extends Specification with XmlMatchers { | |
} | |
*/ | |
- val template = <div> | |
+ val template = xml"""<div> | |
<span><myclass:str/></span> | |
<span><myclass:i/></span> | |
<myclass:other> | |
<span><other:foo/></span> | |
</myclass:other> | |
- </div> | |
+ </div>""" | |
- val expected = <div> | |
+ val expected = xml"""<div> | |
<span>#hi#</span> | |
<span>1</span> | |
<span>%bar%</span> | |
- </div> | |
+ </div>""" | |
/* | |
"Bindings.binder with an available implicit databinding" should { | |
"allow the application of that databinding to an appropriate object" in { | |
@@ -99,7 +100,7 @@ object BindingsSpec extends Specification with XmlMatchers { | |
val session = new LiftSession("hello", "", Empty) | |
S.initIfUninitted(session) { | |
- val org = <span><input id="frog" class="dog cat"/></span> | |
+ val org = xml"""<span><input id="frog" class="dog cat"/></span>""" | |
val res = ("#frog" #> SHtml.text("", s => ())).apply(org) | |
diff --git a/repos/framework/web/webkit/src/test/scala/net/liftweb/http/HtmlNormalizerSpec.scala b/repos/framework/web/webkit/src/test/scala/net/liftweb/http/HtmlNormalizerSpec.scala | |
index 3ca750f553..dc9612ec8d 100644 | |
--- a/repos/framework/web/webkit/src/test/scala/net/liftweb/http/HtmlNormalizerSpec.scala | |
+++ b/repos/framework/web/webkit/src/test/scala/net/liftweb/http/HtmlNormalizerSpec.scala | |
@@ -1,6 +1,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import scala.xml._ | |
import org.specs2._ | |
@@ -22,7 +23,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
"leave the HTML structure unchanged" in { | |
val result = HtmlNormalizer | |
.normalizeHtmlAndEventHandlers( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<script src="testscript"></script> | |
<link href="testlink" /> | |
@@ -38,14 +39,14 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies</p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
"/context-path", | |
false | |
) | |
.nodes | |
result must ==/( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<script src="testscript"></script> | |
<link href="testlink" /> | |
@@ -61,14 +62,14 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies</p> | |
<p>More thingies</p> | |
</body> | |
- </html> | |
+ </html>""" | |
) | |
} | |
"extract events from all elements at any depth" in { | |
val NodesAndEventJs(html, js) = | |
HtmlNormalizer.normalizeHtmlAndEventHandlers( | |
- <html onevent="testJs1"> | |
+ xml"""<html onevent="testJs1"> | |
<head onresult="testJs2"> | |
<script src="testscript" onmagic="testJs3"></script> | |
<link href="testlink" onthing="testJs4" /> | |
@@ -84,7 +85,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
<p onkeyup="testJs9">Thingies</p> | |
<p ondragstart="testJs10">More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
"/context-path", | |
false | |
) | |
@@ -111,19 +112,19 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
"reuse ids when they are already on an element with an event" in { | |
val NodesAndEventJs(html, js) = | |
HtmlNormalizer.normalizeHtmlAndEventHandlers( | |
- <myelement id="testid" onevent="doStuff" />, | |
+ xml"""<myelement id="testid" onevent="doStuff" />""", | |
"/context-path", | |
false | |
) | |
- html must ==/(<myelement id="testid" />) | |
+ html must ==/(xml"""<myelement id="testid" />""") | |
js.toJsCmd must_== """lift.onEvent("testid","event",function(event) {doStuff;});""" | |
} | |
"generate ids for elements with events if they don't have one" in { | |
val NodesAndEventJs(html, js) = | |
HtmlNormalizer.normalizeHtmlAndEventHandlers( | |
- <myelement onevent="doStuff" />, | |
+ xml"""<myelement onevent="doStuff" />""", | |
"/context-path", | |
false | |
) | |
@@ -138,11 +139,11 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
"extract event js correctly for multiple elements" in { | |
val NodesAndEventJs(_, js) = | |
HtmlNormalizer.normalizeHtmlAndEventHandlers( | |
- <div> | |
+ xml"""<div> | |
<myelement onevent="doStuff" /> | |
<myelement id="hello" onevent="doStuff2" /> | |
<myelement onevent="doStuff3" /> | |
- </div>, | |
+ </div>""", | |
"/context-path", | |
false | |
) | |
@@ -160,7 +161,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
"extract events from hrefs and actions" in { | |
val NodesAndEventJs(html, js) = | |
HtmlNormalizer.normalizeHtmlAndEventHandlers( | |
- <div> | |
+ xml"""<div> | |
<myelement href="javascript:doStuff" /> | |
<myelement id="hello" action="javascript:doStuff2" /> | |
<myelement id="hello2" href="javascript://doStuff3" /> | |
@@ -168,7 +169,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
// is *processed as JavaScript* but it is *invalid JavaScript* | |
// (i.e., it corresponds to a JS expression that starts with `/`). | |
<myelement action="javascript:/doStuff4" /> | |
- </div>, | |
+ </div>""", | |
"/context-path", | |
false | |
) | |
@@ -189,12 +190,12 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
"not extract events from hrefs and actions without the proper prefix" in { | |
val NodesAndEventJs(html, js) = | |
HtmlNormalizer.normalizeHtmlAndEventHandlers( | |
- <div> | |
+ xml"""<div> | |
<myelement href="doStuff" /> | |
<myelement id="hello" action="javascrip:doStuff2" /> | |
<myelement id="hello2" href="javascrip://doStuff3" /> | |
<myelement action="doStuff4" /> | |
- </div>, | |
+ </div>""", | |
"/context-path", | |
false | |
) | |
@@ -209,7 +210,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
"normalize absolute link hrefs everywhere" in { | |
val result = HtmlNormalizer | |
.normalizeHtmlAndEventHandlers( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<script src="testscript"></script> | |
<link href="/testlink" /> | |
@@ -225,7 +226,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies</p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
"/context-path", | |
false | |
) | |
@@ -238,7 +239,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
"normalize absolute script srcs everywhere" in { | |
val result = HtmlNormalizer | |
.normalizeHtmlAndEventHandlers( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<script src="/testscript"></script> | |
<link href="testlink" /> | |
@@ -255,7 +256,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies</p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
"/context-path", | |
false | |
) | |
@@ -268,7 +269,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
"normalize absolute a hrefs everywhere" in { | |
val result = HtmlNormalizer | |
.normalizeHtmlAndEventHandlers( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<a href="/testa1">Booyan</a> | |
</head> | |
@@ -285,7 +286,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies <a href="/testa6">Booyan</a></p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
"/context-path", | |
false | |
) | |
@@ -298,7 +299,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
"normalize absolute form actions everywhere" in { | |
val result = HtmlNormalizer | |
.normalizeHtmlAndEventHandlers( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<form action="/testform1">Booyan</form> | |
</head> | |
@@ -315,7 +316,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies <form action="/testform6">Booyan</form></p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
"/context-path", | |
false | |
) | |
@@ -329,7 +330,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
val result = URLRewriter.doWith((_: String) => "rewritten") { | |
HtmlNormalizer | |
.normalizeHtmlAndEventHandlers( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<script src="testscript"></script> | |
</head> | |
@@ -344,7 +345,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies</p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
"/context-path", | |
false | |
) | |
@@ -359,7 +360,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
val result = URLRewriter.doWith((_: String) => "rewritten") { | |
HtmlNormalizer | |
.normalizeHtmlAndEventHandlers( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<link href="testlink" /> | |
</head> | |
@@ -374,7 +375,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies</p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
"/context-path", | |
false | |
) | |
@@ -389,7 +390,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
val result = URLRewriter.doWith((_: String) => "rewritten") { | |
HtmlNormalizer | |
.normalizeHtmlAndEventHandlers( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<a href="testa"></a> | |
</head> | |
@@ -404,7 +405,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies</p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
"/context-path", | |
false | |
) | |
@@ -419,7 +420,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
val result = URLRewriter.doWith((_: String) => "rewritten") { | |
HtmlNormalizer | |
.normalizeHtmlAndEventHandlers( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<form action="testform" /> | |
</head> | |
@@ -434,7 +435,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies</p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
"/context-path", | |
false | |
) | |
diff --git a/repos/framework/web/webkit/src/test/scala/net/liftweb/http/LiftMergeSpec.scala b/repos/framework/web/webkit/src/test/scala/net/liftweb/http/LiftMergeSpec.scala | |
index 70c47f69b3..905995a180 100644 | |
--- a/repos/framework/web/webkit/src/test/scala/net/liftweb/http/LiftMergeSpec.scala | |
+++ b/repos/framework/web/webkit/src/test/scala/net/liftweb/http/LiftMergeSpec.scala | |
@@ -1,6 +1,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import scala.xml._ | |
import org.specs2._ | |
@@ -74,7 +75,7 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
"merge head segments in the page body in order into main head" in new WithRules( | |
testRules) { | |
val result = testSession.merge( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<script src="testscript"></script> | |
</head> | |
@@ -91,23 +92,23 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
</p> | |
</div> | |
</body> | |
- </html>, | |
+ </html>""", | |
mockReq | |
) | |
(result \ "head" \ "_") must_== | |
(Seq( | |
- <script src="testscript"></script>, | |
- <script src="testscript2"></script>, | |
- <link href="testlink" />, | |
- <link href="testlink2" /> | |
+ xml"""<script src="testscript"></script>""", | |
+ xml"""<script src="testscript2"></script>""", | |
+ xml"""<link href="testlink" />""", | |
+ xml"""<link href="testlink2" />""" | |
): NodeSeq) | |
} | |
"merge tail segments in the page body in order at the end of the body" in new WithRules( | |
testRules) { | |
val result = testSession.merge( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<script src="testscript"></script> | |
</head> | |
@@ -127,21 +128,21 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies</p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
mockReq | |
) | |
(result \ "body" \ "_").takeRight(3) must_== | |
(Seq( | |
- <script src="testscript2"></script>, | |
- <link href="testlink" />, | |
- <link href="testlink2" /> | |
+ xml"""<script src="testscript2"></script>""", | |
+ xml"""<link href="testlink" />""", | |
+ xml"""<link href="testlink2" />""" | |
): NodeSeq) | |
} | |
"not merge tail segments in the head" in new WithRules(testRules) { | |
val result = testSession.merge( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<tail> | |
<script src="testscript"></script> | |
@@ -163,22 +164,22 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies</p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
mockReq | |
) | |
(result \ "body" \ "_").takeRight(3) must_== | |
(Seq( | |
- <script src="testscript2"></script>, | |
- <link href="testlink" />, | |
- <link href="testlink2" /> | |
+ xml"""<script src="testscript2"></script>""", | |
+ xml"""<link href="testlink" />""", | |
+ xml"""<link href="testlink2" />""" | |
): NodeSeq) | |
} | |
"normalize absolute link hrefs everywhere" in new WithLiftContext( | |
testRules, testSession) { | |
val result = testSession.merge( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<script src="testscript"></script> | |
<link href="/testlink" /> | |
@@ -199,7 +200,7 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies</p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
mockReq | |
) | |
@@ -210,7 +211,7 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
"normalize absolute script srcs everywhere" in new WithLiftContext( | |
testRules, testSession) { | |
val result = testSession.merge( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<script src="/testscript"></script> | |
<link href="testlink" /> | |
@@ -231,7 +232,7 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies</p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
mockReq | |
) | |
@@ -242,7 +243,7 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
"normalize absolute a hrefs everywhere" in new WithLiftContext( | |
testRules, testSession) { | |
val result = testSession.merge( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<a href="/testa1">Booyan</a> | |
</head> | |
@@ -263,7 +264,7 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies <a href="/testa6">Booyan</a></p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
mockReq | |
) | |
@@ -274,7 +275,7 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
"normalize absolute form actions everywhere" in new WithLiftContext( | |
testRules, testSession) { | |
val result = testSession.merge( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<form action="/testform1">Booyan</form> | |
</head> | |
@@ -295,7 +296,7 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies <form action="/testform6">Booyan</form></p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
mockReq | |
) | |
@@ -307,7 +308,7 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
testSession) { | |
val result = URLRewriter.doWith((_: String) => "rewritten") { | |
testSession.merge( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<script src="testscript"></script> | |
</head> | |
@@ -326,7 +327,7 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies</p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
mockReq | |
) | |
} | |
@@ -339,7 +340,7 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
testSession) { | |
val result = URLRewriter.doWith((_: String) => "rewritten") { | |
testSession.merge( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<link href="testlink" /> | |
</head> | |
@@ -358,7 +359,7 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies</p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
mockReq | |
) | |
} | |
@@ -370,7 +371,7 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
"rewrite a hrefs everywhere" in new WithLiftContext(testRules, testSession) { | |
val result = URLRewriter.doWith((_: String) => "rewritten") { | |
testSession.merge( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<a href="testa"></a> | |
</head> | |
@@ -389,7 +390,7 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies</p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
mockReq | |
) | |
} | |
@@ -402,7 +403,7 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
testSession) { | |
val result = URLRewriter.doWith((_: String) => "rewritten") { | |
testSession.merge( | |
- <html> | |
+ xml"""<html> | |
<head> | |
<form action="testform" /> | |
</head> | |
@@ -421,7 +422,7 @@ class LiftMergeSpec extends Specification with XmlMatchers with Mockito { | |
<p>Thingies</p> | |
<p>More thingies</p> | |
</body> | |
- </html>, | |
+ </html>""", | |
mockReq | |
) | |
} | |
diff --git a/repos/framework/web/webkit/src/test/scala/net/liftweb/http/SHtmlSpec.scala b/repos/framework/web/webkit/src/test/scala/net/liftweb/http/SHtmlSpec.scala | |
index c7fb2fe075..93751c36c3 100644 | |
--- a/repos/framework/web/webkit/src/test/scala/net/liftweb/http/SHtmlSpec.scala | |
+++ b/repos/framework/web/webkit/src/test/scala/net/liftweb/http/SHtmlSpec.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import org.specs2.matcher.XmlMatchers | |
import org.specs2.mutable.Specification | |
import util._ | |
@@ -26,7 +27,7 @@ import net.liftweb.mockweb.MockWeb._ | |
object SHtmlSpec extends Specification with XmlMatchers { | |
"SHtmlSpec Specification".title | |
- val html1 = <span><input id="number"></input></span> | |
+ val html1 = xml"""<span><input id="number"></input></span>""" | |
val inputField1 = | |
testS("/")(("#number" #> SHtml.number(0, println(_), 0, 100)).apply(html1)) | |
diff --git a/repos/framework/web/webkit/src/test/scala/net/liftweb/http/SnippetSpec.scala b/repos/framework/web/webkit/src/test/scala/net/liftweb/http/SnippetSpec.scala | |
index a3e8e62389..738bdefc20 100644 | |
--- a/repos/framework/web/webkit/src/test/scala/net/liftweb/http/SnippetSpec.scala | |
+++ b/repos/framework/web/webkit/src/test/scala/net/liftweb/http/SnippetSpec.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package http | |
+import scala.xml.quote._ | |
import xml._ | |
import org.specs2.matcher.XmlMatchers | |
import org.specs2.mutable.Specification | |
@@ -45,47 +46,47 @@ object SnippetSpec extends Specification with XmlMatchers { | |
"Templates" should { | |
"Correctly process lift:content_id" in { | |
- val ret = Templates.checkForContentId(<html lift:content_id="content"> | |
+ val ret = Templates.checkForContentId(xml"""<html lift:content_id="content"> | |
<head/> | |
<body> | |
<div id="content" class="lift:surround"/> | |
</body> | |
- </html>) | |
+ </html>""") | |
- ret must ==/(<div id="content" class="lift:surround"/>) | |
+ ret must ==/(xml"""<div id="content" class="lift:surround"/>""") | |
} | |
"Correctly process body class" in { | |
- val ret = Templates.checkForContentId(<html> | |
+ val ret = Templates.checkForContentId(xml"""<html> | |
<head/> | |
<body class="lift:content_id=frog"> | |
<div><span> mooose dog | |
<div id="frog" class="lift:surround"/> | |
</span></div> | |
</body> | |
- </html>) | |
+ </html>""") | |
- ret must ==/(<div id="frog" class="lift:surround"/>) | |
+ ret must ==/(xml"""<div id="frog" class="lift:surround"/>""") | |
} | |
"Correctly process l:content_id" in { | |
- val ret = Templates.checkForContentId(<html l:content_id="dog"> | |
+ val ret = Templates.checkForContentId(xml"""<html l:content_id="dog"> | |
<head/> | |
<body> | |
<lift:surround id="dog"><div/></lift:surround> | |
</body> | |
- </html>) | |
+ </html>""") | |
- ret must ==/(<lift:surround id="dog"><div/></lift:surround>) | |
+ ret must ==/(xml"""<lift:surround id="dog"><div/></lift:surround>""") | |
} | |
"Correctly process not lift:designer_friendly" in { | |
- val xml = <html> | |
+ val xml = xml"""<html> | |
<head/> | |
<body> | |
<div class="lift:surround"/> | |
</body> | |
- </html> | |
+ </html>""" | |
val ret = Templates.checkForContentId(xml) | |
@@ -93,14 +94,14 @@ object SnippetSpec extends Specification with XmlMatchers { | |
} | |
"Snippet invocation works <lift:xxx/>" in { | |
- val res = <div/> | |
+ val res = xml"<div/>" | |
val ret = S.statelessInit(Req.nil) { | |
S.mapSnippetsWith("foo" -> ((a: NodeSeq) => a)) { | |
for { | |
s <- S.session | |
} yield | |
- s.processSurroundAndInclude("test", <lift:foo>{res}</lift:foo>) | |
+ s.processSurroundAndInclude("test", xml"<lift:foo>${res}</lift:foo>") | |
} | |
} | |
@@ -108,13 +109,13 @@ object SnippetSpec extends Specification with XmlMatchers { | |
} | |
"Snippet invocation works <l:xxx/>" in { | |
- val res = <div/> | |
+ val res = xml"<div/>" | |
val ret = S.statelessInit(Req.nil) { | |
S.mapSnippetsWith("foo" -> ((a: NodeSeq) => a)) { | |
for { | |
s <- S.session | |
- } yield s.processSurroundAndInclude("test", <l:foo>{res}</l:foo>) | |
+ } yield s.processSurroundAndInclude("test", xml"<l:foo>${res}</l:foo>") | |
} | |
} | |
@@ -122,13 +123,13 @@ object SnippetSpec extends Specification with XmlMatchers { | |
} | |
"Snippet invocation works class='l:foo'" in { | |
- val res = <div/> | |
+ val res = xml"<div/>" | |
val ret = S.statelessInit(Req.nil) { | |
S.mapSnippetsWith("foo" -> ((a: NodeSeq) => a)) { | |
for { | |
s <- S.session | |
- } yield s.processSurroundAndInclude("test", <div class="l:foo" />) | |
+ } yield s.processSurroundAndInclude("test", xml"""<div class="l:foo" />""") | |
} | |
} | |
@@ -136,7 +137,7 @@ object SnippetSpec extends Specification with XmlMatchers { | |
} | |
"Snippet invocation works class='l:foo' and ? for attr sep" in { | |
- val res = <div/> | |
+ val res = xml"<div/>" | |
def testAttrs(in: NodeSeq): NodeSeq = { | |
S.attr("bing") must_== Full("bong") | |
@@ -152,7 +153,7 @@ object SnippetSpec extends Specification with XmlMatchers { | |
} yield | |
s.processSurroundAndInclude( | |
"test", | |
- <div class="l:foo?bing=bong?fuzz=faz+snark?noodle=FatPoodle" />) | |
+ xml"""<div class="l:foo?bing=bong?fuzz=faz+snark?noodle=FatPoodle" />""") | |
} | |
} | |
@@ -160,7 +161,7 @@ object SnippetSpec extends Specification with XmlMatchers { | |
} | |
"Snippet invocation works class='l:foo' and ; for attr sep" in { | |
- val res = <div/> | |
+ val res = xml"<div/>" | |
def testAttrs(in: NodeSeq): NodeSeq = { | |
S.attr("bing") must_== Full("bong") | |
@@ -176,7 +177,7 @@ object SnippetSpec extends Specification with XmlMatchers { | |
} yield | |
s.processSurroundAndInclude( | |
"test", | |
- <div class="l:foo?bing=bong;fuzz=faz+snark;noodle=FatPoodle" />) | |
+ xml"""<div class="l:foo?bing=bong;fuzz=faz+snark;noodle=FatPoodle" />""") | |
} | |
} | |
@@ -184,7 +185,7 @@ object SnippetSpec extends Specification with XmlMatchers { | |
} | |
"Snippet invocation works class='l:foo' and & for attr sep" in { | |
- val res = <div/> | |
+ val res = xml"<div/>" | |
def testAttrs(in: NodeSeq): NodeSeq = { | |
S.attr("bing") must_== Full("bong") | |
@@ -198,7 +199,7 @@ object SnippetSpec extends Specification with XmlMatchers { | |
val clStr = "l:foo?bing=bong&fuzz=faz+snark&noodle=FatPoodle" | |
for { | |
s <- S.session | |
- } yield s.processSurroundAndInclude("test", <div class={clStr} />) | |
+ } yield s.processSurroundAndInclude("test", xml"<div class=${clStr} />") | |
} | |
} | |
@@ -206,7 +207,7 @@ object SnippetSpec extends Specification with XmlMatchers { | |
} | |
"Snippet invocation works class='l:foo' and mixed attr sep" in { | |
- val res = <div/> | |
+ val res = xml"<div/>" | |
def testAttrs(in: NodeSeq): NodeSeq = { | |
S.attr("bing") must_== Full("bong") | |
@@ -222,7 +223,7 @@ object SnippetSpec extends Specification with XmlMatchers { | |
} yield | |
s.processSurroundAndInclude( | |
"test", | |
- <div class="l:foo?bing=bong?fuzz=faz+snark;noodle=FatPoodle" />) | |
+ xml"""<div class="l:foo?bing=bong?fuzz=faz+snark;noodle=FatPoodle" />""") | |
} | |
} | |
@@ -230,13 +231,13 @@ object SnippetSpec extends Specification with XmlMatchers { | |
} | |
"Snippet invocation works class='lift:foo'" in { | |
- val res = <div/> | |
+ val res = xml"<div/>" | |
val ret = S.statelessInit(Req.nil) { | |
S.mapSnippetsWith("foo" -> ((a: NodeSeq) => a)) { | |
for { | |
s <- S.session | |
- } yield s.processSurroundAndInclude("test", <div class='lift:foo' />) | |
+ } yield s.processSurroundAndInclude("test", xml"<div class='lift:foo' />") | |
} | |
} | |
@@ -248,7 +249,7 @@ object SnippetSpec extends Specification with XmlMatchers { | |
S.mapSnippetsWith("foo" -> ((a: NodeSeq) => a)) { | |
for { | |
s <- S.session | |
- } yield s.processSurroundAndInclude("test", <div class="lift:bar" />) | |
+ } yield s.processSurroundAndInclude("test", xml"""<div class="lift:bar" />""") | |
} | |
} | |
@@ -272,14 +273,14 @@ object SnippetSpec extends Specification with XmlMatchers { | |
} | |
"Snippet invocation fails in stateless mode" in { | |
- val res = <div>dog</div> | |
+ val res = xml"<div>dog</div>" | |
val ret = S.statelessInit(Req.nil) { | |
S.mapSnippetsWith("foo" -> ChangeVar.foo _) { | |
for { | |
s <- S.session | |
} yield | |
- s.processSurroundAndInclude("test", <lift:foo>{res}</lift:foo>) | |
+ s.processSurroundAndInclude("test", xml"<lift:foo>${res}</lift:foo>") | |
} | |
} | |
@@ -287,7 +288,7 @@ object SnippetSpec extends Specification with XmlMatchers { | |
} | |
"Snippet invocation succeeds in normal mode" in { | |
- val res = <div>dog</div> | |
+ val res = xml"<div>dog</div>" | |
val session = new LiftSession("", "hello", Empty) | |
val ret = S.init(makeReq, session) { | |
@@ -295,7 +296,7 @@ object SnippetSpec extends Specification with XmlMatchers { | |
for { | |
s <- S.session | |
} yield | |
- s.processSurroundAndInclude("test", <lift:foo>{res}</lift:foo>) | |
+ s.processSurroundAndInclude("test", xml"<lift:foo>${res}</lift:foo>") | |
} | |
} | |
@@ -303,14 +304,14 @@ object SnippetSpec extends Specification with XmlMatchers { | |
} | |
"Snippet invocation fails in stateless mode (function table)" in { | |
- val res = <div>dog</div> | |
+ val res = xml"<div>dog</div>" | |
val ret = S.statelessInit(Req.nil) { | |
S.mapSnippetsWith("foo" -> Funky.foo _) { | |
for { | |
s <- S.session | |
} yield | |
- s.processSurroundAndInclude("test", <lift:foo>{res}</lift:foo>) | |
+ s.processSurroundAndInclude("test", xml"<lift:foo>${res}</lift:foo>") | |
} | |
} | |
@@ -318,7 +319,7 @@ object SnippetSpec extends Specification with XmlMatchers { | |
} | |
"Snippet invocation succeeds in normal mode (function table)" in { | |
- val res = <div>dog</div> | |
+ val res = xml"<div>dog</div>" | |
val session = new LiftSession("", "hello", Empty) | |
val ret = S.init(makeReq, session) { | |
@@ -326,7 +327,7 @@ object SnippetSpec extends Specification with XmlMatchers { | |
for { | |
s <- S.session | |
} yield | |
- s.processSurroundAndInclude("test", <lift:foo>{res}</lift:foo>) | |
+ s.processSurroundAndInclude("test", xml"<lift:foo>${res}</lift:foo>") | |
} | |
} | |
@@ -337,7 +338,7 @@ object SnippetSpec extends Specification with XmlMatchers { | |
val session = new LiftSession("", "hello", Empty) | |
S.init(makeReq, session) { | |
- val ret = SHtml.onSubmit(s => ())(<input/>) | |
+ val ret = SHtml.onSubmit(s => ())(xml"<input/>") | |
ret.size must_== 1 | |
(ret \ "@name").text.length must be > 0 | |
@@ -348,7 +349,7 @@ object SnippetSpec extends Specification with XmlMatchers { | |
val session = new LiftSession("", "hello", Empty) | |
S.init(makeReq, session) { | |
- val ret = SHtml.onSubmitBoolean(s => ())(<input type="checkbox"/>) | |
+ val ret = SHtml.onSubmitBoolean(s => ())(xml"""<input type="checkbox"/>""") | |
ret.size must_== 2 | |
(ret \\ "input").flatMap(_ \ "@name").map(_.text).mkString.length must be > 0 | |
@@ -397,7 +398,7 @@ object SnippetSpec extends Specification with XmlMatchers { | |
} yield | |
s.processSurroundAndInclude( | |
"test", | |
- <div class="l:foo?eager_eval=true">a<lift:foo>b</lift:foo></div>) | |
+ xml"""<div class="l:foo?eager_eval=true">a<lift:foo>b</lift:foo></div>""") | |
} | |
myInfo.is must_== "ab" | |
} | |
diff --git a/repos/framework/web/webkit/src/test/scala/net/liftweb/http/rest/XMLApiSpec.scala b/repos/framework/web/webkit/src/test/scala/net/liftweb/http/rest/XMLApiSpec.scala | |
index ffc258b743..d4e085d641 100644 | |
--- a/repos/framework/web/webkit/src/test/scala/net/liftweb/http/rest/XMLApiSpec.scala | |
+++ b/repos/framework/web/webkit/src/test/scala/net/liftweb/http/rest/XMLApiSpec.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package http | |
package rest | |
+import scala.xml.quote._ | |
import xml._ | |
import org.specs2.mutable.Specification | |
@@ -35,7 +36,7 @@ object XmlApiSpec extends Specification { | |
object XMLApiExample extends XMLApiHelper { | |
// Define our root tag | |
- def createTag(contents: NodeSeq): Elem = <api>{contents}</api> | |
+ def createTag(contents: NodeSeq): Elem = xml"<api>${contents}</api>" | |
// This method exists to test the non-XML implicit conversions on XMLApiHelper | |
def produce(in: Any): LiftResponse = in match { | |
@@ -47,10 +48,10 @@ object XmlApiSpec extends Specification { | |
// Tests pairToResponse | |
case i: Int if i == 42 => (true, "But what is the question?") | |
// These test the listElemToResponse conversion | |
- case f: Float if f == 42f => ( <float>perfect</float>: Elem) | |
- case f: Float if f == 0f => ( <float>zero</float>: Node) | |
- case f: Float if f > 0f => ( <float>positive</float>: NodeSeq) | |
- case f: Float if f < 0f => ( <float>negative</float>: Seq[Node]) | |
+ case f: Float if f == 42f => ( xml"<float>perfect</float>": Elem) | |
+ case f: Float if f == 0f => ( xml"<float>zero</float>": Node) | |
+ case f: Float if f > 0f => ( xml"<float>positive</float>": NodeSeq) | |
+ case f: Float if f < 0f => ( xml"<float>negative</float>": Seq[Node]) | |
} | |
// This method tests the XML implicit conversions on XMLApiHelper | |
@@ -78,7 +79,7 @@ object XmlApiSpec extends Specification { | |
tryo { | |
(r.param("args") | |
.map { args => | |
- <result>{args.split(",").map(_.toInt).reduceLeft(operation)}</result> | |
+ xml"<result>${args.split(",").map(_.toInt).reduceLeft(operation)}</result>" | |
}) ?~ "Missing args" | |
} match { | |
case Full(x) => x | |
@@ -122,16 +123,16 @@ object XmlApiSpec extends Specification { | |
"Convert booleans to LiftResponses" in { | |
produce("true") must matchXmlResponse( | |
- <api success="true"><xml:group/></api>) | |
+ xml"""<api success="true"><xml:group/></api>""") | |
produce("false") must matchXmlResponse( | |
- <api success="false"><xml:group/></api>) | |
+ xml"""<api success="false"><xml:group/></api>""") | |
} | |
"Convert Boxed booleans to LiftResponses" in { | |
produce("42") must matchXmlResponse( | |
- <api success="true"><xml:group/></api>) | |
+ xml"""<api success="true"><xml:group/></api>""") | |
produce("1") must matchXmlResponse( | |
- <api success="false"><xml:group/></api>) | |
+ xml"""<api success="false"><xml:group/></api>""") | |
val failure = produce("invalidInt") | |
@@ -146,18 +147,18 @@ object XmlApiSpec extends Specification { | |
"Convert Pairs to responses" in { | |
produce(42) must matchXmlResponse( | |
- <api success="true" msg="But what is the question?"><xml:group/></api>) | |
+ xml"""<api success="true" msg="But what is the question?"><xml:group/></api>""") | |
} | |
"Convert various XML types to a response" in { | |
produce(0f) must matchXmlResponse( | |
- <api success="true"><float>zero</float></api>) | |
+ xml"""<api success="true"><float>zero</float></api>""") | |
produce(-1f) must matchXmlResponse( | |
- <api success="true"><float>negative</float></api>) | |
+ xml"""<api success="true"><float>negative</float></api>""") | |
produce(1f) must matchXmlResponse( | |
- <api success="true"><float>positive</float></api>) | |
+ xml"""<api success="true"><float>positive</float></api>""") | |
produce(42f) must matchXmlResponse( | |
- <api success="true"><float>perfect</float></api>) | |
+ xml"""<api success="true"><float>perfect</float></api>""") | |
} | |
} | |
} | |
diff --git a/repos/framework/web/webkit/src/test/scala/net/liftweb/mockweb/WebSpecSpec.scala b/repos/framework/web/webkit/src/test/scala/net/liftweb/mockweb/WebSpecSpec.scala | |
index 0d0eadb7b9..1360cbe29e 100644 | |
--- a/repos/framework/web/webkit/src/test/scala/net/liftweb/mockweb/WebSpecSpec.scala | |
+++ b/repos/framework/web/webkit/src/test/scala/net/liftweb/mockweb/WebSpecSpec.scala | |
@@ -16,6 +16,7 @@ | |
package net.liftweb | |
package mockweb | |
+import scala.xml.quote._ | |
import common.Full | |
import http._ | |
import http.rest._ | |
@@ -135,12 +136,12 @@ class WebSpecSpec extends WebSpec(WebSpecSpecBoot.boot _) { | |
} | |
} | |
- "properly set an XML body" withSFor (testUrl) withPost (<test/>) in { | |
+ "properly set an XML body" withSFor (testUrl) withPost (xml"<test/>") in { | |
S.request match { | |
case Full(req) => | |
req.xml_? must_== true | |
req.post_? must_== true | |
- req.xml must_== Full(<test/>) | |
+ req.xml must_== Full(xml"<test/>") | |
case _ => failure("No request found in S") | |
} | |
} | |
diff --git a/repos/framework/web/webkit/src/test/scala/net/liftweb/mockweb/snippet/WebSpecSpecSnippet.scala b/repos/framework/web/webkit/src/test/scala/net/liftweb/mockweb/snippet/WebSpecSpecSnippet.scala | |
index afb8464ee3..c30ad695b3 100644 | |
--- a/repos/framework/web/webkit/src/test/scala/net/liftweb/mockweb/snippet/WebSpecSpecSnippet.scala | |
+++ b/repos/framework/web/webkit/src/test/scala/net/liftweb/mockweb/snippet/WebSpecSpecSnippet.scala | |
@@ -15,8 +15,9 @@ package net.liftweb.mockweb.snippet | |
* See the License for the specific language governing permissions and | |
* limitations under the License. | |
*/ | |
+import scala.xml.quote._ | |
import xml.NodeSeq | |
class WebSpecSpecSnippet { | |
- def render: NodeSeq = <h1>Hello, WebSpec!</h1> | |
+ def render: NodeSeq = xml"<h1>Hello, WebSpec!</h1>" | |
} | |
diff --git a/repos/framework/web/webkit/src/test/scala/net/liftweb/sitemap/FlexMenuBuilderSpec.scala b/repos/framework/web/webkit/src/test/scala/net/liftweb/sitemap/FlexMenuBuilderSpec.scala | |
index 9b730c391e..a50a0232e4 100644 | |
--- a/repos/framework/web/webkit/src/test/scala/net/liftweb/sitemap/FlexMenuBuilderSpec.scala | |
+++ b/repos/framework/web/webkit/src/test/scala/net/liftweb/sitemap/FlexMenuBuilderSpec.scala | |
@@ -16,6 +16,7 @@ | |
package net.liftweb.sitemap | |
+import scala.xml.quote._ | |
import net.liftweb.http.{S, LiftRules} | |
import net.liftweb.common.{Full, Empty} | |
import net.liftweb.mockweb.WebSpec | |
@@ -24,7 +25,7 @@ import xml.{Elem, Group, NodeSeq} | |
object FlexMenuBuilderSpec extends WebSpec(FlexMenuBuilderSpecBoot.boot _) { | |
"FlexMenuBuilder Specification".title | |
- val html1 = <div data-lift="MenuBuilder.builder?group=hometabsv2"></div> | |
+ val html1 = xml"""<div data-lift="MenuBuilder.builder?group=hometabsv2"></div>""" | |
"FlexMenuBuilder" should { | |
val testUrl = "http://foo.com/help" | |
@@ -35,7 +36,7 @@ object FlexMenuBuilderSpec extends WebSpec(FlexMenuBuilderSpecBoot.boot _) { | |
override def linkToSelf = true | |
} | |
val linkToSelf = | |
- <ul><li><a href="/index">Home</a></li><li><a href="/help">Help</a></li><li><a href="/help2">Help2</a></li></ul> | |
+ xml"""<ul><li><a href="/index">Home</a></li><li><a href="/help">Help</a></li><li><a href="/help2">Help2</a></li></ul>""" | |
val actual = MenuBuilder.render | |
linkToSelf must beEqualToIgnoringSpace(actual) | |
} | |
@@ -45,7 +46,7 @@ object FlexMenuBuilderSpec extends WebSpec(FlexMenuBuilderSpecBoot.boot _) { | |
override def expandAll = true | |
} | |
val expandAll: NodeSeq = | |
- <ul><li><a href="/index">Home</a></li><li><span>Help</span><ul><li><a href="/index1">Home1</a></li><li><a href="/index2">Home2</a></li></ul></li><li><a href="/help2">Help2</a><ul><li><a href="/index3">Home3</a></li><li><a href="/index4">Home4</a></li></ul></li></ul> | |
+ xml"""<ul><li><a href="/index">Home</a></li><li><span>Help</span><ul><li><a href="/index1">Home1</a></li><li><a href="/index2">Home2</a></li></ul></li><li><a href="/help2">Help2</a><ul><li><a href="/index3">Home3</a></li><li><a href="/index4">Home4</a></li></ul></li></ul>""" | |
val actual = MenuBuilder.render | |
expandAll.toString must_== actual.toString | |
} | |
@@ -61,7 +62,7 @@ object FlexMenuBuilderSpec extends WebSpec(FlexMenuBuilderSpecBoot.boot _) { | |
} | |
} | |
val itemInPath: NodeSeq = | |
- <ul><li><a href="/index">Home</a></li><li class="active"><a href="/help">Help</a><ul><li class="active"><span>Home1</span></li><li><a href="/index2">Home2</a></li></ul></li><li><a href="/help2">Help2</a></li></ul> | |
+ xml"""<ul><li><a href="/index">Home</a></li><li class="active"><a href="/help">Help</a><ul><li class="active"><span>Home1</span></li><li><a href="/index2">Home2</a></li></ul></li><li><a href="/help2">Help2</a></li></ul>""" | |
val actual = MenuBuilder.render | |
itemInPath.toString must_== actual.toString | |
} | |
@@ -77,7 +78,7 @@ object FlexMenuBuilderSpec extends WebSpec(FlexMenuBuilderSpecBoot.boot _) { | |
} | |
} | |
val itemInPath: NodeSeq = | |
- <ul><li><a href="/index">Home</a></li><li class="active"><span>Help</span></li><li><a href="/help2">Help2</a></li></ul> | |
+ xml"""<ul><li><a href="/index">Home</a></li><li class="active"><span>Help</span></li><li><a href="/help2">Help2</a></li></ul>""" | |
val actual = MenuBuilder.render | |
itemInPath.toString must_== actual.toString | |
} | |
diff --git a/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/OneShot.scala b/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/OneShot.scala | |
index 85c3c31df9..b29f124952 100644 | |
--- a/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/OneShot.scala | |
+++ b/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/OneShot.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package webapptest | |
+import scala.xml.quote._ | |
import org.specs2.matcher.XmlMatchers | |
import org.specs2.mutable.Specification | |
@@ -65,7 +66,7 @@ object OneShot extends Specification with RequestKit with XmlMatchers { | |
xml <- resp.xml | |
} yield xml | |
- bx.openOrThrowException("legacy code") must ==/(<int>45</int>) | |
+ bx.openOrThrowException("legacy code") must ==/(xml"<int>45</int>") | |
.when(jetty.running) | |
} finally { | |
LiftRules.sessionCreator = tmp | |
@@ -83,7 +84,7 @@ object OneShot extends Specification with RequestKit with XmlMatchers { | |
xml <- resp2.xml | |
} yield xml | |
- bx.openOrThrowException("legacy code") must ==/(<int>33</int>) | |
+ bx.openOrThrowException("legacy code") must ==/(xml"<int>33</int>") | |
.when(jetty.running) | |
} finally { | |
LiftRules.sessionCreator = tmp | |
@@ -103,9 +104,9 @@ object OneShot extends Specification with RequestKit with XmlMatchers { | |
xml2 <- resp3.xml | |
} yield (xml, xml2) | |
- bx.openOrThrowException("legacy code")._1 must ==/(<int>33</int>) | |
+ bx.openOrThrowException("legacy code")._1 must ==/(xml"<int>33</int>") | |
.when(jetty.running) | |
- bx.openOrThrowException("legacy code")._2 must ==/(<int>45</int>) | |
+ bx.openOrThrowException("legacy code")._2 must ==/(xml"<int>45</int>") | |
.when(jetty.running) | |
} finally { | |
LiftRules.sessionCreator = tmp | |
@@ -126,9 +127,9 @@ object OneShot extends Specification with RequestKit with XmlMatchers { | |
xml2 <- resp3.xml | |
} yield (xml, xml2) | |
- bx.openOrThrowException("legacy code")._1 must ==/(<int>33</int>) | |
+ bx.openOrThrowException("legacy code")._1 must ==/(xml"<int>33</int>") | |
.when(jetty.running) | |
- bx.openOrThrowException("legacy code")._2 must ==/(<str>meow</str>) | |
+ bx.openOrThrowException("legacy code")._2 must ==/(xml"<str>meow</str>") | |
.when(jetty.running) | |
} finally { | |
LiftRules.sessionCreator = tmp | |
diff --git a/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/ToHeadUsages.scala b/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/ToHeadUsages.scala | |
index bd1feec20a..430e60cee0 100644 | |
--- a/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/ToHeadUsages.scala | |
+++ b/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/ToHeadUsages.scala | |
@@ -17,6 +17,7 @@ | |
package net.liftweb | |
package webapptest | |
+import scala.xml.quote._ | |
import java.net.{URL, InetAddress} | |
import org.specs2.mutable.Specification | |
@@ -191,20 +192,20 @@ object ToHeadUsages extends Specification { | |
"Exclude from context rewriting" in { | |
val first = http.Req.fixHtml("/wombat", | |
- <span> | |
+ xml"""<span> | |
<a href="/foo" id="foo">foo</a> | |
<a href="/bar" id="bar">bar</a> | |
- </span>) | |
+ </span>""") | |
def excludeBar(in: String): Boolean = in.startsWith("/bar") | |
val second = | |
LiftRules.excludePathFromContextPathRewriting.doWith(excludeBar _) { | |
Req.fixHtml("/wombat", | |
- <span> | |
+ xml"""<span> | |
<a href="/foo" id="foo">foo</a> | |
<a href="/bar" id="bar">bar</a> | |
- </span>) | |
+ </span>""") | |
} | |
((first \\ "a").filter(e => (e \ "@id").text == "foo") \ "@href").text must be_==( | |
diff --git a/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/snippet/DeferredSnippet.scala b/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/snippet/DeferredSnippet.scala | |
index 2d4286cef5..81af13ef58 100644 | |
--- a/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/snippet/DeferredSnippet.scala | |
+++ b/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/snippet/DeferredSnippet.scala | |
@@ -18,6 +18,7 @@ package net.liftweb | |
package webapptest | |
package snippet | |
+import scala.xml.quote._ | |
import net.liftweb.http._ | |
import scala.xml._ | |
@@ -26,23 +27,23 @@ class DeferredSnippet { | |
def first: NodeSeq = { | |
MyNumber.set(44) | |
- <span id="first">first</span> | |
+ xml"""<span id="first">first</span>""" | |
} | |
def secondLazy: NodeSeq = { | |
val old = MyNumber.is | |
MyNumber.set(99) | |
- <span id="second">Very lazy {old}</span> | |
+ xml"""<span id="second">Very lazy ${old}</span>""" | |
} | |
def third: NodeSeq = { | |
- <span id="third">third {MyNumber.is}</span> | |
+ xml"""<span id="third">third ${MyNumber.is}</span>""" | |
} | |
def stackWhack: NodeSeq = { | |
val inActor: Boolean = Thread.currentThread.getStackTrace | |
.exists(_.getClassName.contains("net.liftweb.actor.")) | |
- <span id={"actor_"+inActor}>stackWhack</span> | |
+ xml"<span id=${"actor_"+inActor}>stackWhack</span>" | |
} | |
} | |
diff --git a/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/snippet/HeadTestSnippet.scala b/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/snippet/HeadTestSnippet.scala | |
index 7616f101c6..a0527b7ca5 100644 | |
--- a/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/snippet/HeadTestSnippet.scala | |
+++ b/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/snippet/HeadTestSnippet.scala | |
@@ -18,13 +18,14 @@ package net.liftweb | |
package webapptest | |
package snippet | |
+import scala.xml.quote._ | |
class HeadTestSnippet { | |
def withHead = { | |
- <div> | |
+ xml"""<div> | |
<head> | |
<script type="text/javascript" src="snippet.js"></script> | |
</head> | |
- <span>Welcome to webtest1 at {new java.util.Date}</span> | |
- </div> | |
+ <span>Welcome to webtest1 at ${new java.util.Date}</span> | |
+ </div>""" | |
} | |
} | |
diff --git a/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/snippet/HelloWorld.scala b/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/snippet/HelloWorld.scala | |
index d5369a5f83..e56d25b779 100644 | |
--- a/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/snippet/HelloWorld.scala | |
+++ b/repos/framework/web/webkit/src/test/scala/net/liftweb/webapptest/snippet/HelloWorld.scala | |
@@ -18,15 +18,16 @@ package net.liftweb | |
package webapptest | |
package snippet | |
+import scala.xml.quote._ | |
class HelloWorld { | |
- def howdy = <span>Welcome to webtest1 at {new java.util.Date}</span> | |
+ def howdy = xml"<span>Welcome to webtest1 at ${new java.util.Date}</span>" | |
} | |
import scala.xml._ | |
import net.liftweb.http._ | |
class Meow extends Function1[NodeSeq, NodeSeq] { | |
- def apply(in: NodeSeq): NodeSeq = <yak/> | |
+ def apply(in: NodeSeq): NodeSeq = xml"<yak/>" | |
} | |
class Meower { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment