Merge branch 'next' of https://github.com/lhorie/mithril.js into patch-2

This commit is contained in:
impinball 2015-11-13 21:55:36 -05:00
commit 37266a2b8f
9 changed files with 30 additions and 25 deletions

View file

@ -84,7 +84,7 @@
}],
"space-before-keywords": 2,
"space-in-parens": 2,
"space-infix-ops": [2, {"int32Hint": false}],
"space-infix-ops": [2, {"int32Hint": true}],
"space-unary-ops": 2,
"spaced-comment": [2, "always"],
"max-depth": [2, 4],

View file

@ -1,7 +1,8 @@
/* eslint-env node */
module.exports = function (grunt) { // eslint-disable-line
var version = "0.2.1"
var pkg = grunt.file.readJSON("package.json")
var currentYear = grunt.template.today("yyyy")
var inputFolder = "./docs"
var tempFolder = "./temp"
var archiveFolder = "./archive"
@ -72,7 +73,7 @@ module.exports = function (grunt) { // eslint-disable-line
makeTasks("guide", guide)
makeTasks("api", api)
var currentVersionArchiveFolder = archiveFolder + "/v" + version
var currentVersionArchiveFolder = archiveFolder + "/v" + pkg.version
grunt.initConfig({
// Keep this in sync with the .eslintignore
@ -107,10 +108,10 @@ module.exports = function (grunt) { // eslint-disable-line
options: {
banner: [
"/*",
"Mithril v" + version,
"http://github.com/lhorie/mithril.js",
"(c) Leo Horie",
"License: MIT",
"Mithril v" + pkg.version,
pkg.homepage,
"(c) 2014-" + currentYear + " " + pkg.author.name,
"License: " + pkg.license,
"*/",
].join("\n"),
sourceMap: true,
@ -135,7 +136,7 @@ module.exports = function (grunt) { // eslint-disable-line
force: true,
patterns: [
{match: /\.md/g, replacement: ".html"},
{match: /\$version/g, replacement: version},
{match: /\$version/g, replacement: pkg.version},
],
},
@ -232,7 +233,7 @@ module.exports = function (grunt) { // eslint-disable-line
expand: true,
cwd: currentVersionArchiveFolder,
src: "./**",
dest: outputFolder + "/archive/v" + version,
dest: outputFolder + "/archive/v" + pkg.version,
},
},

View file

@ -1,6 +1,5 @@
[![JS.ORG](https://img.shields.io/badge/js.org-mithril-ffb400.svg?style=flat-square)](http://js.org)
[![Join the chat at https://gitter.im/lhorie/mithril.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/lhorie/mithril.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Support and Consulting Services](https://s3-us-west-2.amazonaws.com/supportedsourceassets/buttons/supportandservices1.png)](http://supportedsource.org/consulting-services-and-support/Mithril)
[![Build Status](https://travis-ci.org/lhorie/mithril.js.svg?branch=master)](https://travis-ci.org/lhorie/mithril.js)
# Mithril

View file

@ -419,14 +419,14 @@ Often, you will want to do some work before the component is unloaded (i.e. clea
var MyComponent = {
controller: function() {
return {
onunload = function() {
onunload: function() {
console.log("unloading my component");
}
}
},
view: function() {
return m("div", "test")
};
}
};
m.mount(document.body, MyComponent);

View file

@ -1,7 +1,7 @@
(function (global, factory) {
void (function (global, factory) { // eslint-disable-line
"use strict"
/* eslint-disable no-undef */
var m = factory(window)
var m = factory(typeof window !== "undefined" ? window : {})
if (typeof module === "object" && module != null && module.exports) {
module.exports = m
} else if (typeof define === "function" && define.amd) {
@ -510,7 +510,10 @@
editable.innerHTML = data
} else {
// was a trusted string
if (nodes[0].nodeType === 1 || nodes.length > 1) {
if (nodes[0].nodeType === 1 ||
nodes.length > 1 ||
(nodes[0].nodeValue.trim && !nodes[0].nodeValue.trim())
) {
clear(cached.nodes, cached)
nodes = [$document.createTextNode(data)]
}

2
mithril.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -44,8 +44,8 @@ var ContactsWidget = {
},
view: function(ctrl) {
return [
m.module(ContactForm),
m.module(ContactList)
m.component(ContactForm),
m.component(ContactList)
]
}
}

View file

@ -2,10 +2,18 @@
"name": "mithril",
"description": "Mithril.js beta build - use this to help us test the releases before they are released",
"version": "0.2.1",
"homepage": "http://mithril.js.org",
"license": "MIT",
"author": {
"name": "Leo Horie"
},
"repository": {
"type": "git",
"url": "git@github.com:lhorie/mithril.js.git"
},
"bugs": {
"url" : "http://github.com/lhorie/mithril.js/issues"
},
"scripts": {
"test": "grunt test"
},
@ -33,12 +41,6 @@
"sinon": "^1.17.2",
"sinon-chai": "^2.8.0"
},
"licenses": [
{
"type": "MIT",
"url": "http://opensource.org/licenses/MIT"
}
],
"files": [
"mithril.min.js",
"mithril.min.js.map",