Commit c07982a9 authored by addyosmani's avatar addyosmani

updating sproutcore example to emberjs. Minor changes in namespacing required....

updating sproutcore example to emberjs. Minor changes in namespacing required. Switch from parentViews as required by last release of SC
parent 8d3c03c8
......@@ -54,7 +54,7 @@
<h5>Examples Included For:</h5>
<ul>
<li><a href="http://www.sproutcore.com/">SproutCore</a></li>
<li><a href="http://www.emberjs.com/">Ember.js (SproutCore 2.0)</a></li>
<li><a href="http://javascriptmvc.com/">JavaScriptMVC</a></li>
<li><a href="http://documentcloud.github.com/backbone/">Backbone.js</a></li>
<li><a href="http://spinejs.com/">Spine.js</a></li>
......@@ -70,7 +70,7 @@
<h5>0.2 Changelog</h5>
<ul>
<li>Patches to existing applications</li>
<li>Sylistic updates</li>
<li>Further updates</li>
<li><span class="label">New</span> AngularJS examples</li>
<li><span class="label">New</span> Broke.js example</li>
<li><span class="label">New</span> YUILibrary example</li>
......@@ -79,7 +79,7 @@
<h5>Live demos</h5>
<ul>
<li><a href="todo-example/sproutcore/index.html">SproutCore 2.0</a></li>
<li><a href="todo-example/emberjs/index.html">Ember.js</a></li>
<li><a href="todo-example/javascriptmvc/todo/todo/index.html">JavaScriptMVC</a></li>
<li><a href="todo-example/spine/index.html">Spine.js</a></li>
<li><a href="todo-example/backbone/index.html">Backbone.js</a></li>
......@@ -99,7 +99,7 @@
<li><a href="http://twitter.com/justinbmeyer">Justin Meyer</a></li>
<li><a href="http://twitter.com/macmann">Alex MacCaw</a></li>
<li><a href="">Ashish Sharma</a></li>
<li><a href="http://sproutcore.com">Tom Dale, Yehuda Katz</a></li>
<li><a href="http://emberjs.com">Tom Dale, Yehuda Katz</a></li>
<li><a href="http://cburgdorf.wordpress.com/">Christoph Burgdorf</a></li>
<li><a href="http://developer.yahoo.com">The YUI team</a></li>
<li><a href="https://github.com/jacobmumm">Jacob Mumm</a></li>
......@@ -149,7 +149,7 @@
<div class="span12">
<h2>Introduction</h2>
<p>Developers these days are spoiled with choice when it comes to selecting an <strong>MVC framework</strong> for structuring and organizing JavaScript web apps. Backbone, Spine, SproutCore, JavaScriptMVC..the list of new and stable solutions goes on and on, but just how do you <strong>decide</strong> on which to use in a sea of so many options?.</p>
<p>Developers these days are spoiled with choice when it comes to selecting an <strong>MVC framework</strong> for structuring and organizing JavaScript web apps. Backbone, Spine, Ember.js (SproutCore 2.0), JavaScriptMVC..the list of new and stable solutions goes on and on, but just how do you <strong>decide</strong> on which to use in a sea of so many options?.</p>
<p>To help solve this problem, I created <a href="http://github.com/addyosmani/todomvc">TodoMVC</a> - a project which offers the same Todo application implemented using MVC concepts in most of the popular JavaScript MVC frameworks of today. Solutions look and feel the same, have a common simple feature-set and make it <strong>easy</strong> for you to compare the syntax and structure of different frameworks so you can select the one you feel the most comfortable with.</p>
</div>
......
<!doctype html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]--> <!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]--> <!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]--> <!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>SproutCore</title>
<title>ember.js</title>
<meta name="description" content="">
<meta name="author" content="">
......@@ -36,20 +39,20 @@
{{/view}}
{{#view id="stats-area"}}
{{view SC.Checkbox class="mark-all-done"
{{view Ember.Checkbox class="mark-all-done"
title="Mark all as complete"
valueBinding="Todos.todosController.allAreDone"}}
{{#view id="todos"}}
{{#collection id="todo-list" contentBinding="Todos.todosController" tagName="ul" itemClassBinding="content.isDone"}}
{{view SC.Checkbox titleBinding="parentView.content.title"
valueBinding="parentView.content.isDone"}}
{{view Ember.Checkbox titleBinding="content.title"
valueBinding="content.isDone"}}
{{/collection}}
{{/view}}
<!-- Insert this after the CreateTodoView and before the collection. -->
{{#view Todos.StatsView id="todo-stats"}}
{{#view SC.Button classBinding="isActive"
{{#view Ember.Button classBinding="isActive"
target="Todos.todosController"
action="clearCompletedTodos"}}
Clear Completed
......@@ -66,12 +69,12 @@
<div id="credits">
Credits:
<br />
Tom Dale, SproutCore, Updates: Addy Osmani
Tom Dale, Addy Osmani
</div>
<script src="js/libs/jquery-1.6.4.min.js"></script>
<script src="js/libs/sproutcore-2.0.a.3.min.js"></script>
<script src="js/libs/jquery-1.7.1.min.js"></script>
<script src="js/libs/ember-0.9.min.js"></script>
<script src="js/app.js"></script>
</body>
</html>
Todos = SC.Application.create();
Todos = Ember.Application.create();
Todos.Todo = SC.Object.extend({
Todos.Todo = Ember.Object.extend({
title: null,
isDone: false
});
Todos.todosController = SC.ArrayProxy.create({
Todos.todosController = Ember.ArrayProxy.create({
content: [],
createTodo: function(title) {
......@@ -36,7 +36,7 @@ Todos.todosController = SC.ArrayProxy.create({
}.property('@each.isDone')
});
Todos.StatsView = SC.View.extend({
Todos.StatsView = Ember.View.extend({
remainingBinding: 'Todos.todosController.remaining',
remainingString: function() {
......@@ -45,7 +45,7 @@ Todos.StatsView = SC.View.extend({
}.property('remaining')
});
Todos.CreateTodoView = SC.TextField.extend({
Todos.CreateTodoView = Ember.TextField.extend({
insertNewline: function() {
var value = this.get('value');
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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