Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
todomvc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eugene Shen
todomvc
Commits
5e56786e
Commit
5e56786e
authored
Jul 04, 2012
by
Peter Michaux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update to latest maria.js and associated changes in the app
parent
343db310
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
584 additions
and
76 deletions
+584
-76
labs/architecture-examples/maria/lib/maria/maria.js
labs/architecture-examples/maria/lib/maria/maria.js
+561
-58
labs/architecture-examples/maria/src/js/bootstrap.js
labs/architecture-examples/maria/src/js/bootstrap.js
+8
-4
labs/architecture-examples/maria/src/js/views/TodoView.js
labs/architecture-examples/maria/src/js/views/TodoView.js
+7
-4
labs/architecture-examples/maria/src/js/views/TodosAppView.js
.../architecture-examples/maria/src/js/views/TodosAppView.js
+0
-4
labs/architecture-examples/maria/src/js/views/TodosInputView.js
...rchitecture-examples/maria/src/js/views/TodosInputView.js
+0
-1
labs/architecture-examples/maria/src/js/views/TodosListView.js
...architecture-examples/maria/src/js/views/TodosListView.js
+0
-1
labs/architecture-examples/maria/src/js/views/TodosStatsView.js
...rchitecture-examples/maria/src/js/views/TodosStatsView.js
+4
-2
labs/architecture-examples/maria/src/js/views/TodosToolbarView.js
...hitecture-examples/maria/src/js/views/TodosToolbarView.js
+4
-2
No files found.
labs/architecture-examples/maria/lib/maria/maria.js
View file @
5e56786e
This diff is collapsed.
Click to expand it.
labs/architecture-examples/maria/src/js/bootstrap.js
View file @
5e56786e
...
...
@@ -2,15 +2,19 @@ maria.addEventListener(window, 'load', function() {
var
loading
=
document
.
getElementById
(
'
loading
'
);
loading
.
parentNode
.
removeChild
(
loading
);
var
model
;
if
((
typeof
localStorage
===
'
object
'
)
&&
(
typeof
JSON
===
'
object
'
))
{
var
store
=
localStorage
.
getItem
(
'
todos-maria
'
);
var
model
=
store
?
checkit
.
TodosModel
.
fromJSON
(
JSON
.
parse
(
store
))
:
new
checkit
.
TodosModel
();
model
=
store
?
checkit
.
TodosModel
.
fromJSON
(
JSON
.
parse
(
store
))
:
new
checkit
.
TodosModel
();
evento
.
addEventListener
(
model
,
'
change
'
,
function
()
{
localStorage
.
setItem
(
'
todos-maria
'
,
JSON
.
stringify
(
model
.
toJSON
()));
});
}
else
{
model
=
new
checkit
.
TodosModel
();
}
var
app
=
new
checkit
.
TodosAppView
(
model
);
document
.
body
.
appendChild
(
app
.
getRootEl
());
var
view
=
new
checkit
.
TodosAppView
(
model
);
document
.
body
.
appendChild
(
view
.
build
());
});
labs/architecture-examples/maria/src/js/views/TodoView.js
View file @
5e56786e
...
...
@@ -10,22 +10,25 @@ maria.ElementView.subclass(checkit, 'TodoView', {
'
blur .todo-input
'
:
'
onBlurInput
'
},
properties
:
{
update
:
function
()
{
buildData
:
function
()
{
var
model
=
this
.
getModel
();
var
content
=
model
.
getContent
();
this
.
find
(
'
.todo-content
'
).
innerHTML
=
content
.
replace
(
'
&
'
,
'
&
'
).
replace
(
'
<
'
,
'
<
'
);
this
.
find
(
'
.check
'
).
checked
=
model
.
isDone
();
aristocrat
[
model
.
isDone
()
?
'
addClass
'
:
'
removeClass
'
](
this
.
getRootEl
(),
'
done
'
);
aristocrat
[
model
.
isDone
()
?
'
addClass
'
:
'
removeClass
'
](
this
.
find
(
'
.todo
'
),
'
done
'
);
},
update
:
function
()
{
this
.
buildData
();
},
showEdit
:
function
()
{
var
input
=
this
.
find
(
'
.todo-input
'
);
input
.
value
=
this
.
getModel
().
getContent
();
aristocrat
.
addClass
(
this
.
getRootEl
(
),
'
editing
'
);
aristocrat
.
addClass
(
this
.
find
(
'
.todo
'
),
'
editing
'
);
input
.
select
();
},
showDisplay
:
function
()
{
aristocrat
.
removeClass
(
this
.
getRootEl
(
),
'
editing
'
);
aristocrat
.
removeClass
(
this
.
find
(
'
.todo
'
),
'
editing
'
);
},
getInputValue
:
function
()
{
return
this
.
find
(
'
.todo-input
'
).
value
;
...
...
labs/architecture-examples/maria/src/js/views/TodosAppView.js
View file @
5e56786e
...
...
@@ -8,10 +8,6 @@ maria.ElementView.subclass(checkit, 'TodosAppView', {
},
initialize
:
function
()
{
var
model
=
this
.
getModel
();
if
(
!
model
)
{
model
=
new
checkit
.
TodosModel
();
this
.
setModel
(
model
);
}
this
.
appendChild
(
new
checkit
.
TodosInputView
(
model
));
this
.
appendChild
(
new
checkit
.
TodosToolbarView
(
model
));
this
.
appendChild
(
new
checkit
.
TodosListView
(
model
));
...
...
labs/architecture-examples/maria/src/js/views/TodosInputView.js
View file @
5e56786e
maria
.
ElementView
.
subclass
(
checkit
,
'
TodosInputView
'
,
{
modelConstructor
:
checkit
.
TodosModel
,
uiActions
:
{
'
focus .new-todo
'
:
'
onFocusInput
'
,
'
blur .new-todo
'
:
'
onBlurInput
'
,
...
...
labs/architecture-examples/maria/src/js/views/TodosListView.js
View file @
5e56786e
maria
.
SetView
.
subclass
(
checkit
,
'
TodosListView
'
,
{
modelConstructor
:
checkit
.
TodosModel
,
properties
:
{
createChildView
:
function
(
todoModel
)
{
return
new
checkit
.
TodoView
(
todoModel
);
...
...
labs/architecture-examples/maria/src/js/views/TodosStatsView.js
View file @
5e56786e
maria
.
ElementView
.
subclass
(
checkit
,
'
TodosStatsView
'
,
{
modelConstructor
:
checkit
.
TodosModel
,
properties
:
{
update
:
function
()
{
buildData
:
function
()
{
this
.
find
(
'
.todos-count
'
).
innerHTML
=
this
.
getModel
().
length
;
},
update
:
function
()
{
this
.
buildData
();
}
}
});
labs/architecture-examples/maria/src/js/views/TodosToolbarView.js
View file @
5e56786e
maria
.
ElementView
.
subclass
(
checkit
,
'
TodosToolbarView
'
,
{
modelConstructor
:
checkit
.
TodosModel
,
uiActions
:
{
'
click .allCheckbox
'
:
'
onClickAllCheckbox
'
,
'
click .markallDone
'
:
'
onClickMarkAllDone
'
,
...
...
@@ -7,11 +6,14 @@ maria.ElementView.subclass(checkit, 'TodosToolbarView', {
'
click .deleteComplete
'
:
'
onClickDeleteDone
'
},
properties
:
{
update
:
function
()
{
buildData
:
function
()
{
var
model
=
this
.
getModel
();
var
checkbox
=
this
.
find
(
'
.allCheckbox
'
);
checkbox
.
checked
=
model
.
isAllDone
();
checkbox
.
disabled
=
model
.
isEmpty
();
},
update
:
function
()
{
this
.
buildData
();
}
}
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment