Commit 41fbc7c5 authored by Sven Franck's avatar Sven Franck

rename and structure files

parent 511c391f
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
<html> <html>
<head> <head>
<title>Model Gadget</title> <title>Model Gadget</title>
<script src="rsvp.js"></script> <script src="lib/rsvp.js"></script>
<script src="renderjs.js"></script> <script src="lib/renderjs.js"></script>
<script src="jio.js"></script> <script src="lib/jio.js"></script>
<script src="gadget_model.js"></script> <script src="gadget_model.js"></script>
</head> </head>
<body> <body>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
<html> <html>
<head> <head>
<title>Router Gadget</title> <title>Router Gadget</title>
<script src="rsvp.js"></script> <script src="lib/rsvp.js"></script>
<script src="renderjs.js"></script> <script src="lib/renderjs.js"></script>
<script src="gadget_global.js"></script> <script src="gadget_global.js"></script>
<script src="gadget_router.js"></script> <script src="gadget_router.js"></script>
</head> </head>
<body> <body>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
switch (traverse) { switch (traverse) {
case 2: case 2:
return element.parentElement return element.parentElement
.parentElement.querySelectorAll(target); .parentElement.querySelectorAll(target);
case 0: case 0:
return element.querySelectorAll(target); return element.querySelectorAll(target);
} }
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
function setItemClass(o) { function setItemClass(o) {
return TODO + return TODO +
(o.completed ? COMPLETED : STR) + (o.completed ? COMPLETED : STR) +
(o.editing ? EDITING : STR); (o.editing ? EDITING : STR);
} }
function setHidden(root, hide) { function setHidden(root, hide) {
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
// let's go // let's go
rJS(window) rJS(window)
///////////////////////////// /////////////////////////////
// state // state
///////////////////////////// /////////////////////////////
.setState({ .setState({
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
query: '' query: ''
}) })
///////////////////////////// /////////////////////////////
// ready // ready
///////////////////////////// /////////////////////////////
.ready(function() { .ready(function() {
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
// published methods // published methods
///////////////////////////// /////////////////////////////
// router calls to update the DOM land here // router calls to update the DOM land here
.allowPublicAcquisition('setQuery', function(param_list) { .allowPublicAcquisition('setQuery', function(param_list) {
this.changeState({ this.changeState({
'query': param_list[0], 'query': param_list[0],
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
if (toggle_all) { if (toggle_all) {
toggle_all.checked = toggle_all.checked =
all_checked = all_checked =
getAllChecked(todo_list); getAllChecked(todo_list);
} }
// keep focus on todo being edited // keep focus on todo being edited
...@@ -294,7 +294,7 @@ ...@@ -294,7 +294,7 @@
dict.list) dict.list)
{ {
makeList(getElems(dict.list, 0, LI)) makeList(getElems(dict.list, 0, LI))
.forEach(function(li) { .forEach(function(li) {
var jio_id = li.getAttribute(JIO_ID); var jio_id = li.getAttribute(JIO_ID);
var obj = getObj(todo_list, jio_id).filter(Boolean).pop(); var obj = getObj(todo_list, jio_id).filter(Boolean).pop();
if (obj === undefined) { if (obj === undefined) {
...@@ -346,7 +346,7 @@ ...@@ -346,7 +346,7 @@
// set filter // set filter
makeList(getElems(element, 0, FILTERS)) makeList(getElems(element, 0, FILTERS))
.forEach(function(filter) { .forEach(function(filter) {
filter.classList.remove(SELECTED); filter.classList.remove(SELECTED);
if (filter.getAttribute(HREF) === window.location.hash) { if (filter.getAttribute(HREF) === window.location.hash) {
filter.classList.add(SELECTED); filter.classList.add(SELECTED);
...@@ -365,12 +365,12 @@ ...@@ -365,12 +365,12 @@
// onEvent // onEvent
///////////////////////////// /////////////////////////////
// new todo // new todo
.onEvent('submit', function(event) { .onEvent('submit', function(event) {
return this.storeItem(event.target.elements[0].value.trim()); return this.storeItem(event.target.elements[0].value.trim());
}, false, true) }, false, true)
// edit todo // edit todo
.onEvent('dblclick', function(event) { .onEvent('dblclick', function(event) {
var gadget = this; var gadget = this;
var dict = gadget.property_dict; var dict = gadget.property_dict;
...@@ -423,7 +423,7 @@ ...@@ -423,7 +423,7 @@
}); });
}, false, false) }, false, false)
// key inputs // key inputs
.onEvent('keydown', function(event) { .onEvent('keydown', function(event) {
var gadget = this; var gadget = this;
var dict = gadget.property_dict; var dict = gadget.property_dict;
...@@ -517,4 +517,3 @@ ...@@ -517,4 +517,3 @@
}, false, false); }, false, false);
}(window, rJS, RSVP, Handlebars, Boolean, promiseEventListener)); }(window, rJS, RSVP, Handlebars, Boolean, promiseEventListener));
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
<link rel="stylesheet" href="node_modules/todomvc-common/base.css"> <link rel="stylesheet" href="node_modules/todomvc-common/base.css">
<link rel="stylesheet" href="node_modules/todomvc-app-css/index.css"> <link rel="stylesheet" href="node_modules/todomvc-app-css/index.css">
<script src="rsvp.js"></script> <script src="lib/handlebars.js"></script>
<script src="renderjs.js"></script> <script src="lib/rsvp.js"></script>
<script src="jio.js"></script> <script src="lib/renderjs.js"></script>
<script src="node_modules/handlebars/dist/handlebars.js"></script>
<script src="gadget_global.js"></script> <script src="gadget_global.js"></script>
<script src="index.js"></script> <script src="gadget_todo.js"></script>
<script id="list_template" type="text/x-handlebars-template"> <script id="list_template" type="text/x-handlebars-template">
<section id="main" class="main {{#unless todo_exists}}hidden{{/unless}}"> <section id="main" class="main {{#unless todo_exists}}hidden{{/unless}}">
......
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"private": true,
"dependencies": {
"todomvc-common": "^1.0.0",
"todomvc-app-css": "^1.0.1"
}
}
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