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 {
...
@@ -5,7 +5,7 @@ class Todo {
String
title
;
String
title
;
bool
completed
;
bool
completed
;
Todo
(
this
.
id
,
this
.
title
,
{
this
.
completed
:
false
});
Todo
(
this
.
id
,
this
.
title
,
{
this
.
completed
:
false
});
Todo
.
fromJson
(
Map
json
)
{
Todo
.
fromJson
(
Map
json
)
{
id
=
json
[
'id'
];
id
=
json
[
'id'
];
...
@@ -15,10 +15,6 @@ class Todo {
...
@@ -15,10 +15,6 @@ class Todo {
// this is automatically called by JSON.encode
// this is automatically called by JSON.encode
Map
toJson
()
{
Map
toJson
()
{
return
{
return
{
'id'
:
id
,
'title'
:
title
,
'completed'
:
completed
};
'id'
:
id
,
'title'
:
title
,
'completed'
:
completed
};
}
}
}
}
examples/vanilladart/web/dart/TodoApp.dart
View file @
cbbdbae6
part of
todomvc
;
part of
todomvc
;
class
TodoApp
{
class
TodoApp
{
List
<
TodoWidget
>
todoWidgets
=
new
List
<
TodoWidget
>();
List
<
TodoWidget
>
todoWidgets
=
new
List
<
TodoWidget
>();
Element
todoListElement
=
querySelector
(
'#todo-list'
);
Element
todoListElement
=
querySelector
(
'#todo-list'
);
...
@@ -12,7 +11,8 @@ class TodoApp {
...
@@ -12,7 +11,8 @@ class TodoApp {
Element
clearCompletedElement
=
querySelector
(
'#clear-completed'
);
Element
clearCompletedElement
=
querySelector
(
'#clear-completed'
);
Element
showAllElement
=
querySelector
(
'#filters a[href="#/"]'
);
Element
showAllElement
=
querySelector
(
'#filters a[href="#/"]'
);
Element
showActiveElement
=
querySelector
(
'#filters a[href="#/active"]'
);
Element
showActiveElement
=
querySelector
(
'#filters a[href="#/active"]'
);
Element
showCompletedElement
=
querySelector
(
'#filters a[href="#/completed"]'
);
Element
showCompletedElement
=
querySelector
(
'#filters a[href="#/completed"]'
);
TodoApp
()
{
TodoApp
()
{
initLocalStorage
();
initLocalStorage
();
...
@@ -93,7 +93,8 @@ class TodoApp {
...
@@ -93,7 +93,8 @@ class TodoApp {
var
complete
=
todoWidgets
.
where
((
w
)
=>
w
.
todo
.
completed
).
length
;
var
complete
=
todoWidgets
.
where
((
w
)
=>
w
.
todo
.
completed
).
length
;
checkAllCheckboxElement
.
checked
=
(
complete
==
todoWidgets
.
length
);
checkAllCheckboxElement
.
checked
=
(
complete
==
todoWidgets
.
length
);
var
left
=
todoWidgets
.
length
-
complete
;
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
)
{
if
(
complete
==
0
)
{
clearCompletedElement
.
style
.
display
=
'none'
;
clearCompletedElement
.
style
.
display
=
'none'
;
}
else
{
}
else
{
...
@@ -108,7 +109,7 @@ class TodoApp {
...
@@ -108,7 +109,7 @@ class TodoApp {
}
}
void
updateFilter
()
{
void
updateFilter
()
{
switch
(
window
.
location
.
hash
)
{
switch
(
window
.
location
.
hash
)
{
case
'#/active'
:
case
'#/active'
:
showActive
();
showActive
();
break
;
break
;
...
...
examples/vanilladart/web/dart/TodoWidget.dart
View file @
cbbdbae6
part of
todomvc
;
part of
todomvc
;
class
TodoWidget
{
class
TodoWidget
{
static
const
HtmlEscape
htmlEscape
=
const
HtmlEscape
();
static
const
HtmlEscape
htmlEscape
=
const
HtmlEscape
();
TodoApp
todoApp
;
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