From 467ff7682d034933f1a900ad6ee91d604d0ceae1 Mon Sep 17 00:00:00 2001 From: Jay Phelps Date: Fri, 13 Jul 2012 00:50:27 -0700 Subject: [PATCH] a little clean up of the testing fake todos app that doesnt do anything really yet --- test/todos/ApplicationDelegate.js | 10 +--------- test/todos/ListItemView.js | 4 ++-- test/todos/ListView.js | 14 ++++---------- test/todos/ListViewController.js | 8 ++------ test/todos/index.html | 15 +++++++++++++++ 5 files changed, 24 insertions(+), 27 deletions(-) diff --git a/test/todos/ApplicationDelegate.js b/test/todos/ApplicationDelegate.js index 977bb20..8492fcc 100644 --- a/test/todos/ApplicationDelegate.js +++ b/test/todos/ApplicationDelegate.js @@ -1,12 +1,4 @@ -Handlebars.registerHelper("view", function(text) { - //text = Handlebars.Utils.escapeExpression(text); - //url = Handlebars.Utils.escapeExpression(url); - - var result = ""; - console.log(arguments) - - return ""//new Handlebars.SafeString(result); -}); +CBImport("ListViewController.js"); /** * @class diff --git a/test/todos/ListItemView.js b/test/todos/ListItemView.js index 9b009a9..893d877 100644 --- a/test/todos/ListItemView.js +++ b/test/todos/ListItemView.js @@ -10,11 +10,11 @@ Todos.ListItemView = CB.View.extend({ taskName: "", __taskNameDidChange: function (value) { - this.setInnerText(value); + this.innerText = value; }, renderInContext: function (context) { - context.drawElement(this.getTagName(), function () { + context.drawElement(this.tagName, function () { this.drawDiv(function () { this.drawSpan() .setClassName("TEST") diff --git a/test/todos/ListView.js b/test/todos/ListView.js index f7c657b..7e7266d 100644 --- a/test/todos/ListView.js +++ b/test/todos/ListView.js @@ -1,3 +1,5 @@ +CBImport("ListItemView.js"); + /** * @class * @extends CB.View @@ -18,11 +20,10 @@ Todos.ListView = CB.View.extend({ var listItemView = new Todos.ListItemView(); - listItemView.setTaskName(listItem.name); + listItem.view = listItemView; + listItemView.taskName = listItem.name; this.appendChild(listItemView); - - listItem.view = listItemView; }, removeListItem: function (listItem) { @@ -31,13 +32,6 @@ Todos.ListView = CB.View.extend({ listItem = listItems.splice(index, 1)[0]; this.removeChild(listItem.view); - }, - - _renderd: function (context) { - context.begin(); - var layer = context.createElement(this.tagName); - context.push("Hello world"); - context.end(); } }); \ No newline at end of file diff --git a/test/todos/ListViewController.js b/test/todos/ListViewController.js index cd61b5e..455eb2a 100644 --- a/test/todos/ListViewController.js +++ b/test/todos/ListViewController.js @@ -1,3 +1,5 @@ +CBImport("ListView.js"); + /** * @class * @extends CB.ViewController @@ -18,12 +20,6 @@ Todos.ListViewController = CB.ViewController.extend({ listView.addListItem(item1); listView.addListItem(item2); - - CB.delay(function () { - //listView.removeListItem(item1); - }, 1000); - - } }); \ No newline at end of file diff --git a/test/todos/index.html b/test/todos/index.html index f7e830c..2fe2861 100644 --- a/test/todos/index.html +++ b/test/todos/index.html @@ -6,8 +6,23 @@ } + +