From 57c9cfa76b65425fed167fc731f5aa548c9fbfbd Mon Sep 17 00:00:00 2001 From: Mihail Diordiev Date: Thu, 20 Aug 2015 01:47:27 +0300 Subject: [PATCH 1/6] Fix SyntaxError in the render example --- docs/mithril.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/mithril.md b/docs/mithril.md index 95374a80..1f8025dd 100644 --- a/docs/mithril.md +++ b/docs/mithril.md @@ -105,7 +105,7 @@ m.render(document.body, [ m("a", {href: link.url}, link.title) ); }) - ]) + ) ]); ``` From a746d6726770dc1662bb02f1ee7ff3225c9f97a0 Mon Sep 17 00:00:00 2001 From: Mihail Diordiev Date: Sat, 22 Aug 2015 19:43:05 +0300 Subject: [PATCH 2/6] Fix typo in the example of data binding --- docs/mithril.prop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/mithril.prop.md b/docs/mithril.prop.md index a148a1cf..001ab852 100644 --- a/docs/mithril.prop.md +++ b/docs/mithril.prop.md @@ -40,7 +40,7 @@ var User = { this.name = m.prop(name); }, controller: function() { - this.user = new user.model("John Doe"); + this.user = new User.model("John Doe"); }, view: function(controller) { m.render("body", [ From 322ec7e120d85d262bd9b6669b7adf13cf2518a3 Mon Sep 17 00:00:00 2001 From: Deomitrus Date: Mon, 24 Aug 2015 21:08:40 -0400 Subject: [PATCH 3/6] Grammar/spelling fix --- docs/comparison.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/comparison.md b/docs/comparison.md index 750c9782..268c7cb7 100644 --- a/docs/comparison.md +++ b/docs/comparison.md @@ -48,7 +48,7 @@ Some of the older frameworks among the popular ones (out-of-the-box jQuery and B This can get noticeably bulky when you look at thing like collections: you often need to implement insertion code and deletion code, in addition to a "draw everything" routine for performance. And this is for every list that needs to be displayed in some way. -Mithril's view layer paradigm is designed be **declarative**, much like HTML, such that the same code implicitly does everything it needs to. As it turns out, this design decision is actually a compromise: it offers the benefit of decreased application code complexity at the cost of some performance loss. However, as the performance tests in the homepage show, this does not necessarily hurt Mithril in a meaningful way. +Mithril's view layer paradigm is designed to be **declarative**, much like HTML, such that the same code implicitly does everything it needs to. As it turns out, this design decision is actually a compromise: it offers the benefit of decreased application code complexity at the cost of some performance loss. However, as the performance tests in the homepage show, this does not necessarily hurt Mithril in a meaningful way. --- From dfa1da06522c818ae04b80fce13c656ffea3a828 Mon Sep 17 00:00:00 2001 From: Matheus Kautzmann Date: Thu, 27 Aug 2015 17:05:27 -0300 Subject: [PATCH 4/6] m.module -> m.mount: fix README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 036bf8a6..7bb8aee5 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ app.view = function(ctrl) { //initialize -m.module(document.getElementById("example"), app); +m.mount(document.getElementById("example"), app); ``` --- From 343ffc8d36dbef892d719f2e4005ac101a069765 Mon Sep 17 00:00:00 2001 From: Matheus Kautzmann Date: Fri, 28 Aug 2015 09:07:08 -0300 Subject: [PATCH 5/6] m.module -> m.mount: fix sample code in HTML files --- dragdrop.html | 8 ++++---- guide.html | 4 ++-- mvc.html | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dragdrop.html b/dragdrop.html index a7e70dd3..34b690d1 100644 --- a/dragdrop.html +++ b/dragdrop.html @@ -7,7 +7,7 @@ //drag and drop micro-library function dragdrop(element, options) { options = options || {} - + element.addEventListener("dragover", activate) element.addEventListener("dragleave", deactivate) element.addEventListener("dragend", deactivate) @@ -35,7 +35,7 @@ Uploader.upload = function(files) { for (var i = 0; i < files.length; i++) { formData.append("file" + i, files[i]) } - + return m.request({ method: "POST", url: "http://localhost/api/files", @@ -85,10 +85,10 @@ demo.view = function(ctrl) { ] } -m.module(document.body, demo) +m.mount(document.body, demo) //submodule helper function submodule(module, args) { return module.view.bind(this, new module.controller(args)) } - \ No newline at end of file + diff --git a/guide.html b/guide.html index 17bfd1f1..d82f9889 100644 --- a/guide.html +++ b/guide.html @@ -66,5 +66,5 @@ todo.view = function() { }; //initialize the application -m.module(document, {controller: todo.controller, view: todo.view}); - \ No newline at end of file +m.mount(document, {controller: todo.controller, view: todo.view}); + diff --git a/mvc.html b/mvc.html index c93d3fd6..74444ed2 100644 --- a/mvc.html +++ b/mvc.html @@ -62,14 +62,14 @@ var ContactForm = { }, view: function(ctrl) { var contact = ctrl.contact() - + return m("form", [ m("label", "Name"), m("input", {oninput: m.withAttr("value", contact.name), value: contact.name()}), - + m("label", "Email"), m("input", {oninput: m.withAttr("value", contact.email), value: contact.email()}), - + m("button[type=button]", {onclick: ctrl.createContact}, "Create") ]) } @@ -92,5 +92,5 @@ var ContactList = { } } -m.module(document.body, ContactsWidget) - \ No newline at end of file +m.mount(document.body, ContactsWidget) + From f9953b8f74b578b5fb3d4b6a6ab4b96402d08b7c Mon Sep 17 00:00:00 2001 From: Masayuki Takeda Date: Fri, 28 Aug 2015 22:18:46 +0900 Subject: [PATCH 6/6] m.request: fix sample code in documentation --- docs/mithril.request.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/mithril.request.md b/docs/mithril.request.md index 491cb537..e2e7b3af 100644 --- a/docs/mithril.request.md +++ b/docs/mithril.request.md @@ -408,7 +408,7 @@ demo.controller = function() { demo.view = function(ctrl) { //This view gets rendered before the request above completes //Calling .map doesn't throw an error because we defined the initial value to be an empty array, instead of undefined - return ctrl.users().map(function() { + return ctrl.users().map(function(user) { return m("div", user.name) }) }