Commit graph

2278 commits

Author SHA1 Message Date
Leo Horie
e6d6db6123 Merge remote-tracking branch 'origin/next' into next 2015-06-09 16:22:20 -05:00
Leo Horie
f6d436da68 prevent nonsensical IE error 2015-06-09 16:21:55 -05:00
Leo Horie
4a946b2216 Merge pull request #649 from nasitra/remove-unused-variables
Remove unused variables
2015-06-08 12:15:53 -05:00
nasitra
756cbb1924 Remove unused variables 2015-06-07 20:38:08 +09:00
Leo Horie
ff5b04c823 Merge pull request #643 from statianzo/component-first-arg
accept component as first argument to m()
2015-06-03 20:18:36 -05:00
Leo Horie
a5acb12d0c Merge pull request #644 from pelonpelon/patch-10
Minor corrections to getting-started.md
2015-06-03 20:18:09 -05:00
Leo Horie
d3343f8c30 Merge pull request #645 from pelonpelon/patch-13
community.md -- link to github wiki
2015-06-03 20:17:53 -05:00
pelonpelon
25cbdbbad5 community.md -- link to github wiki 2015-06-03 13:11:47 -05:00
Jason Staten
a406de408a Triple equals 2015-06-02 06:44:42 -06:00
pelonpelon
3883d029f2 Minor corrections to getting-started.md 2015-06-01 20:27:04 -05:00
Jason Staten
d89810234a accept component as first argument to m() 2015-06-01 15:11:44 -06:00
Redstone Zhao
4c1d7892aa function() {} -> noop 2015-05-31 09:26:25 +08:00
pelonpelon
7ce8429bf4 Update components.md -- "Classic MVC" example
@ArthurClemens pointed out in this gitter comment:
https://gitter.im/lhorie/mithril.js?at=55664ba1d21e5ed02ff06e54
that the Classic MVC example is broken:
https://lhorie.github.io/mithril/components.html#classic-mvc

I wanted to show a working jsfiddle with these changes applied, but I couldn't figure out how to get a POST request working. I do, however, have a jsbin that is working, although there are significant changes in the code to allow for GET and POST.
http://jsbin.com/cokesu/2/edit?js,output

A redraw is called for every character entered in the jsbin but AFAICT, not in this PR. I don't know why. It's as though `oninput` is really `onchange`. It's possible to limit the redraw to once when the "save" button is clicked, but this requires a change in logic:

var ContactForm = {
    controller: function(args) {
        this.contact = m.prop(new Contact())
        this.save = function(contact) {
           Observable.trigger("saveContact", {contact: contact})
        }
    },
    view: function(ctrl, args) {
        var contact = ctrl.contact()

        return m("form", [
            m("label", "Name"),
            m("input[name=name]"),

            m("label", "Email"),
            m("input[name=email]"),

            m("button[type=button]", {onclick: function(){
              contact = {
                name: m.prop(this.parentNode.elements.name.value),
                email: m.prop(this.parentNode.elements.email.value)
              }
              ctrl.save(contact)
            
            }}, "Save")
        ])
    }
}
2015-05-28 03:47:40 -05:00
Leo Horie
26a6664cd0 Merge pull request #613 from bemurphy/bem-fix_component_example
Fix conversion in component stateless example
2015-05-11 10:23:35 -04:00
Brendon Murphy
7288afc18e Fix conversion in component stateless example 2015-05-08 20:16:12 -07:00
Leo Horie
0ec4ed451f Merge remote-tracking branch 'origin/next' into next 2015-05-07 20:46:37 -04:00
Leo Horie
390bf49e8c Merge pull request #610 from fuzetsu/next
components.md 'trigger', not 'broadcast'
2015-05-07 16:40:34 -04:00
Daniel Loomer
c622283877 components.md 'trigger', not 'broadcast' 2015-05-07 15:54:51 -04:00
Leo Horie
d4ccb09041 Merge pull request #609 from pelonpelon/patch-3
Clarification on m.mount() signature
2015-05-07 10:25:37 -04:00
pelonpelon
592f31ee3d Clarification on m.mount() signature 2015-05-07 08:51:36 -05:00
Leo Horie
6e139e42b7 Merge pull request #608 from glebcha/next
corrected typo
2015-05-07 08:50:25 -04:00
glebcha
809447ed19 corrected typo 2015-05-07 10:37:34 +05:00
Leo Horie
3b8d743c1b Merge pull request #606 from glebcha/next
added jsfiddle with extended todo app example
2015-05-06 08:57:03 -04:00
glebcha
7c55516d5d added jsfiddle with extended todo app example 2015-05-06 14:00:14 +05:00
Leo Horie
2d5d042131 allow m.redraw(true) to force-render component 2015-05-05 21:16:29 -04:00
Leo Horie
cd403225a2 try clean up archive folder 2015-05-05 14:31:47 -04:00
Leo Horie
cb5f7b0e12 as yaml 2015-05-05 10:40:06 -04:00
Leo Horie
8eb68edae6 Merge remote-tracking branch 'origin/next' into next 2015-05-05 10:37:20 -04:00
Leo Horie
509c4dab95 fix language reporting https://github.com/github/linguist#troubleshooting 2015-05-05 10:36:52 -04:00
Leo Horie
93105745d8 Merge pull request #599 from mindeavor/propify-catch
Add `catch` to promise-like objects
2015-05-04 11:21:14 -04:00
Leo Horie
aa9a87ac48 Merge pull request #600 from shibukawa/patch-3
Update components.md
2015-05-04 11:20:36 -04:00
Leo Horie
2f61c535fe Merge pull request #601 from shibukawa/patch-4
Update mithril.route.md
2015-05-04 11:20:06 -04:00
Leo Horie
9d4ba26f50 Merge pull request #602 from shibukawa/patch-5
Update mithril.component.md
2015-05-04 11:19:46 -04:00
Leo Horie
931dbabbcd fix typo 2015-05-03 19:31:05 -04:00
Yoshiki Shibukawa
b70b4191b7 Update mithril.component.md 2015-05-03 18:29:57 +09:00
Yoshiki Shibukawa
b58d772cb9 Update mithril.route.md
Fix sample code minor comment bug.
2015-05-02 22:55:10 +09:00
Yoshiki Shibukawa
39c3118070 Update components.md
Fix sample code. Contact.list() should return a list of Contact instances.
2015-05-02 07:49:02 +09:00
Gilbert
2a61907839 Test promise-like catch 2015-05-01 16:47:19 -05:00
Gilbert
dfb37fec9c Add catch to promise-like objects 2015-05-01 15:31:06 -05:00
Leo Horie
a3cc70863c fix link 2015-05-01 09:30:18 -04:00
Leo Horie
144818e316 fix link 2015-05-01 09:29:54 -04:00
Leo Horie
45c69ae97b build new pages 2015-05-01 09:24:28 -04:00
Leo Horie
b404d69d70 docs build 2015-04-30 22:02:06 -04:00
Leo Horie
7478ad948e v0.2.0 publish 2015-04-30 21:53:22 -04:00
Leo Horie
c45ba9600a add migration note 2015-04-30 21:52:38 -04:00
Leo Horie
cafedae62f Merge remote-tracking branch 'origin/next' into next 2015-04-29 21:44:00 -04:00
Leo Horie
6f1bdc916c fixed typo 2015-04-29 21:43:38 -04:00
Leo Horie
507c58395f Merge pull request #594 from pelonpelon/docs
Docs: mithril.component.m - Recommended changes
2015-04-29 14:15:10 -04:00
pelonpelon
dacd9f8ac4 Merge pull request #1 from pelonpelon/pelonpelon-patch-2
Docs: mithril.component.md - Recommended changes
2015-04-29 12:41:20 -05:00
pelonpelon
b48f8bf79c Docs: mithril.component.md - Recommended changes
These changes make the the text clearer to me. I did not want to change the voice of the text, but I tried to clear out some verbosity and improve consistency. I did my best not to interfere with the logic of the prose.

This document seems written to stand on its own, so I recommend the following changes:

- a general explanation of the args param as in `controller: function(args) {` and `view: function(ctrl, args) { ...` (when first used, well before the signature)
- a specific explanation of {data: args} in m.request() (mithril.request.md could use the same treatment)
- an explanation of the extras param as in `controller: function(args, extras) {` and `view: function(ctrl, args, extras) { ...`
- the term *rollback* should be explained or replaced
- caveat #3/#4: Should *root element* be changed to *top-most element* so as not to be confused with the element the component is mounted on ?
- in testing, explain why the first param to view is `null`

I hope you can find some of this useful.
2015-04-29 12:39:10 -05:00