Commit 77f0e099 authored by 杨博 (Yang Bo)'s avatar 杨博 (Yang Bo) Committed by Sam Saccone

Add learning bar for Binding.scala (#1664)

parent b8bd7bd2
......@@ -8,7 +8,7 @@ val indexHtml = taskKey[File]("Generate an index.html that follows TodoMVC's App
indexHtml := {
val linkedJs = (scalaJSLinkedFile in js in Compile).value.asInstanceOf[org.scalajs.core.tools.io.FileVirtualJSFile]
val document = <html>
val document = <html lang="en" data-framework="binding-scala">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
......
<!DOCTYPE html>
<html>
<html lang="en" data-framework="binding-scala">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
......
This diff is collapsed.
This diff is collapsed.
......@@ -88,8 +88,8 @@ import upickle.default.{read, write}
}
}
def ignoreEvent = { _: Event => }
@dom def blureHandler: Binding[Event => Any] = if (suppressOnBlur.bind) ignoreEvent else submit
val edit = <input class="edit" value={ todo.title } onblur={ blureHandler.bind } onkeydown={ keyDownHandler } />
@dom def blurHandler: Binding[Event => Any] = if (suppressOnBlur.bind) ignoreEvent else submit
val edit = <input class="edit" value={ todo.title } onblur={ blurHandler.bind } onkeydown={ keyDownHandler } />
def toggleHandler = { event: Event =>
allTodos.get(allTodos.get.indexOf(todo)) = Todo(todo.title, event.currentTarget.asInstanceOf[HTMLInputElement].checked)
}
......@@ -140,7 +140,7 @@ import upickle.default.{read, write}
</footer>
}
@JSExport @dom def todoapp: Binding[BindingSeq[Node]] = {
@dom def todoapp: Binding[BindingSeq[Node]] = {
<section class="todoapp">{ header.bind }{ mainSection.bind }{ footer.bind }</section>
<footer class="info">
<p>Double-click to edit a todo</p>
......
......@@ -361,6 +361,7 @@
<li><a href="examples/atmajs/">Atma.js</a></li>
<li><a href="examples/exoskeleton/">Exoskeleton</a></li>
<li><a href="examples/componentjs/">ComponentJS</a></li>
<li><a href="examples/binding-scala/">Binding.scala</a></li>
</ul>
</li>
<li>Updates have been made to apps including Vanilla, Angular, React, Backbone, Ember, jQuery &amp; many more.</li>
......
......@@ -1912,6 +1912,36 @@
}]
}]
},
"binding-scala": {
"name": "Binding.scala",
"description": "Binding.scala is a Reactive Web Frameworks that helps you create complicated interactive web pages with very simple code base. <br/>This Binding.scala's TodoMVC application has the least code size among all the TodoMVC implementations, only one source file, 154 lines of code!",
"homepage:": "github.com/ThoughtWorksInc/Binding.scala",
"examples": [{
"name": "This TodoMVC application",
"url": "examples/binding-scala",
"source_url": "https://github.com/ThoughtWorksInc/todo"
}, {
"name": "Other live DEMOs",
"url": "https://thoughtworksinc.github.io/Binding.scala/",
"source_url": "https://github.com/ThoughtWorksInc/Binding.scala-website"
}],
"link_groups": [{
"heading": "Official Resources",
"links": [{
"name": "Project Page",
"url": "https://github.com/ThoughtWorksInc/Binding.scala"
}, {
"name": "API documentation",
"url": "https://oss.sonatype.org/service/local/repositories/releases/archive/com/thoughtworks/binding/unidoc_2.11/7.0.3/unidoc_2.11-7.0.3-javadoc.jar/!/com/thoughtworks/binding/package.html"
}]
}, {
"heading": "Community",
"links": [{
"name": "Binding.scala on Gitter",
"url": "https://gitter.im/ThoughtWorksInc/Binding.scala"
}]
}]
},
"serenadejs": {
"name": "Serenade.js",
"description": "Serenade.js is a client side framework built on the MVC pattern. It makes it simple to create rich client side applications by freeing you from having to keep the DOM up to date with your data through powerful data bindings.",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment