🐢 Adding css

This commit is contained in:
Kent C. Dodds 2015-08-10 06:28:06 -06:00
parent 80e3ad69c8
commit 86330e922d
5 changed files with 390 additions and 268 deletions

634
bundle.js

File diff suppressed because one or more lines are too long

View File

@ -3,8 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>VanillaJS • TodoMVC</title> <title>VanillaJS • TodoMVC</title>
<link rel="stylesheet" href="node_modules/todomvc-common/base.css"> <script src="bundle.js"></script>
<link rel="stylesheet" href="node_modules/todomvc-app-css/index.css">
</head> </head>
<body> <body>
<section class="todoapp"> <section class="todoapp">
@ -39,6 +38,5 @@
<p>Refactored by <a href="https://github.com/cburgmer">Christoph Burgmer</a></p> <p>Refactored by <a href="https://github.com/cburgmer">Christoph Burgmer</a></p>
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p> <p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
</footer> </footer>
<script src="bundle.js"></script>
</body> </body>
</html> </html>

View File

@ -1,5 +1,6 @@
/*global app, $on */ /*global app, $on */
require('todomvc-common'); require('todomvc-common/base.css');
require('todomvc-app-css/index.css');
require('./view'); require('./view');
require('./helpers'); require('./helpers');
require('./controller'); require('./controller');
@ -22,11 +23,15 @@ require('./template');
this.controller = new app.Controller(this.model, this.view); this.controller = new app.Controller(this.model, this.view);
} }
var todo = new Todo('todos-vanillajs'); var todo;
function setView() { function setView() {
todo.controller.setView(document.location.hash); todo.controller.setView(document.location.hash);
} }
$on(window, 'load', setView);
$on(window, 'load', function() {
todo = new Todo('todos-vanillajs');
setView();
});
$on(window, 'hashchange', setView); $on(window, 'hashchange', setView);
})(); })();

View File

@ -8,7 +8,9 @@
"babel": "5.8.21", "babel": "5.8.21",
"babel-core": "5.8.21", "babel-core": "5.8.21",
"babel-loader": "5.3.2", "babel-loader": "5.3.2",
"css-loader": "0.15.6",
"jasmine-core": "2.3.4", "jasmine-core": "2.3.4",
"style-loader": "0.12.3",
"webpack": "1.11.0" "webpack": "1.11.0"
} }
} }

View File

@ -6,7 +6,12 @@ module.exports = {
filename: 'bundle.js', filename: 'bundle.js',
path: here() path: here()
}, },
context: here('js') context: here('js'),
module: {
loaders: [
{test: /\.css$/, loaders: ['style', 'css']}
]
}
}; };
function here(d) { function here(d) {