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
cbbdbae6
Commit
cbbdbae6
authored
Mar 15, 2015
by
Mathieu Lorber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New formatter on all vanilladart code
parent
fe473ce1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
234 additions
and
238 deletions
+234
-238
examples/vanilladart/lib/models.dart
examples/vanilladart/lib/models.dart
+3
-7
examples/vanilladart/web/dart/TodoApp.dart
examples/vanilladart/web/dart/TodoApp.dart
+149
-148
examples/vanilladart/web/dart/TodoWidget.dart
examples/vanilladart/web/dart/TodoWidget.dart
+82
-83
No files found.
examples/vanilladart/lib/models.dart
View file @
cbbdbae6
...
...
@@ -5,7 +5,7 @@ class Todo {
String
title
;
bool
completed
;
Todo
(
this
.
id
,
this
.
title
,
{
this
.
completed
:
false
});
Todo
(
this
.
id
,
this
.
title
,
{
this
.
completed
:
false
});
Todo
.
fromJson
(
Map
json
)
{
id
=
json
[
'id'
];
...
...
@@ -15,10 +15,6 @@ class Todo {
// this is automatically called by JSON.encode
Map
toJson
()
{
return
{
'id'
:
id
,
'title'
:
title
,
'completed'
:
completed
};
return
{
'id'
:
id
,
'title'
:
title
,
'completed'
:
completed
};
}
}
examples/vanilladart/web/dart/TodoApp.dart
View file @
cbbdbae6
part of
todomvc
;
class
TodoApp
{
List
<
TodoWidget
>
todoWidgets
=
new
List
<
TodoWidget
>();
Element
todoListElement
=
querySelector
(
'#todo-list'
);
...
...
@@ -12,7 +11,8 @@ class TodoApp {
Element
clearCompletedElement
=
querySelector
(
'#clear-completed'
);
Element
showAllElement
=
querySelector
(
'#filters a[href="#/"]'
);
Element
showActiveElement
=
querySelector
(
'#filters a[href="#/active"]'
);
Element
showCompletedElement
=
querySelector
(
'#filters a[href="#/completed"]'
);
Element
showCompletedElement
=
querySelector
(
'#filters a[href="#/completed"]'
);
TodoApp
()
{
initLocalStorage
();
...
...
@@ -93,7 +93,8 @@ class TodoApp {
var
complete
=
todoWidgets
.
where
((
w
)
=>
w
.
todo
.
completed
).
length
;
checkAllCheckboxElement
.
checked
=
(
complete
==
todoWidgets
.
length
);
var
left
=
todoWidgets
.
length
-
complete
;
countElement
.
innerHtml
=
'<strong>
$left
</strong> item
${left != 1 ? 's' : ''}
left'
;
countElement
.
innerHtml
=
'<strong>
$left
</strong> item
${left != 1 ? 's' : ''}
left'
;
if
(
complete
==
0
)
{
clearCompletedElement
.
style
.
display
=
'none'
;
}
else
{
...
...
@@ -108,7 +109,7 @@ class TodoApp {
}
void
updateFilter
()
{
switch
(
window
.
location
.
hash
)
{
switch
(
window
.
location
.
hash
)
{
case
'#/active'
:
showActive
();
break
;
...
...
examples/vanilladart/web/dart/TodoWidget.dart
View file @
cbbdbae6
part of
todomvc
;
class
TodoWidget
{
static
const
HtmlEscape
htmlEscape
=
const
HtmlEscape
();
TodoApp
todoApp
;
...
...
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