@@ -14,24 +14,24 @@ $(function(){
1414
1515 // Default attributes for the todo.
1616 defaults : {
17- Content : "empty todo..." ,
18- Done : false
17+ content : "empty todo..." ,
18+ done : false
1919 } ,
2020
2121 // Ensure that each todo created has `content`.
2222 initialize : function ( ) {
23- if ( ! this . get ( "Content " ) ) {
24- this . set ( { "Content " : this . defaults . Content } ) ;
23+ if ( ! this . get ( "content " ) ) {
24+ this . set ( { "content " : this . defaults . content } ) ;
2525 }
2626 } ,
2727
2828 // Toggle the `done` state of this todo item.
2929 toggle : function ( ) {
30- this . save ( { Done : ! this . get ( "Done " ) } ) ;
30+ this . save ( { done : ! this . get ( "done " ) } ) ;
3131 } ,
3232
3333 url : function ( ) {
34- return this . get ( "Id " ) ? 'todos/' + this . get ( "Id " ) : 'todos' ;
34+ return this . get ( "id " ) ? 'todos/' + this . get ( "id " ) : 'todos' ;
3535 } ,
3636
3737 // Remove this Todo from *localStorage* and delete its view.
@@ -58,7 +58,7 @@ $(function(){
5858
5959 // Filter down the list of all todo items that are finished.
6060 done : function ( ) {
61- return this . filter ( function ( todo ) { return todo . get ( 'Done ' ) ; } ) ;
61+ return this . filter ( function ( todo ) { return todo . get ( 'done ' ) ; } ) ;
6262 } ,
6363
6464 // Filter down the list to only todo items that are still not finished.
@@ -70,12 +70,12 @@ $(function(){
7070 // GUID in the database. This generates the next order number for new items.
7171 nextOrder : function ( ) {
7272 if ( ! this . length ) return 1 ;
73- return this . last ( ) . get ( 'Order ' ) + 1 ;
73+ return this . last ( ) . get ( 'order ' ) + 1 ;
7474 } ,
7575
7676 // Todos are sorted by their original insertion order.
7777 comparator : function ( todo ) {
78- return todo . get ( 'Order ' ) ;
78+ return todo . get ( 'order ' ) ;
7979 }
8080
8181 } ) ;
@@ -122,7 +122,7 @@ $(function(){
122122 // To avoid XSS (not that it would be harmful in this particular app),
123123 // we use `jQuery.text` to set the contents of the todo item.
124124 setContent : function ( ) {
125- var content = this . model . get ( 'Content ' ) ;
125+ var content = this . model . get ( 'content ' ) ;
126126 this . $ ( '.todo-content' ) . text ( content ) ;
127127 this . input = this . $ ( '.todo-input' ) ;
128128 this . input . bind ( 'blur' , this . close ) ;
@@ -142,7 +142,7 @@ $(function(){
142142
143143 // Close the `"editing"` mode, saving changes to the todo.
144144 close : function ( ) {
145- this . model . save ( { Content : this . input . val ( ) } ) ;
145+ this . model . save ( { content : this . input . val ( ) } ) ;
146146 $ ( this . el ) . removeClass ( "editing" ) ;
147147 } ,
148148
@@ -201,11 +201,10 @@ $(function(){
201201 // Re-rendering the App just means refreshing the statistics -- the rest
202202 // of the app doesn't change.
203203 render : function ( ) {
204- var done = Todos . done ( ) . length ;
205204 this . $ ( '#todo-stats' ) . html ( this . statsTemplate ( {
206- Total : Todos . length ,
207- Done : Todos . done ( ) . length ,
208- Remaining : Todos . remaining ( ) . length
205+ total : Todos . length ,
206+ done : Todos . done ( ) . length ,
207+ remaining : Todos . remaining ( ) . length
209208 } ) ) ;
210209 } ,
211210
@@ -224,9 +223,9 @@ $(function(){
224223 // Generate the attributes for a new Todo item.
225224 newAttributes : function ( ) {
226225 return {
227- Content : this . input . val ( ) ,
228- Order : Todos . nextOrder ( ) ,
229- Done : false
226+ content : this . input . val ( ) ,
227+ order : Todos . nextOrder ( ) ,
228+ done : false
230229 } ;
231230 } ,
232231
0 commit comments