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
1c2abb79
Commit
1c2abb79
authored
May 10, 2015
by
Arthur Verschaeve
Committed by
Sindre Sorhus
May 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Close #1292 PR: Componentjs: Minor cleanup.
parent
9c6ae435
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
57 deletions
+54
-57
examples/componentjs/app/app-ui-composite-main.js
examples/componentjs/app/app-ui-composite-main.js
+1
-1
examples/componentjs/app/app-ui-widget-todo-model.js
examples/componentjs/app/app-ui-widget-todo-model.js
+1
-2
examples/componentjs/app/app-ui-widget-todo-view.js
examples/componentjs/app/app-ui-widget-todo-view.js
+5
-7
examples/componentjs/index.html
examples/componentjs/index.html
+47
-47
No files found.
examples/componentjs/app/app-ui-composite-main.js
View file @
1c2abb79
/* global cs, app, Router, $
, _
*/
/* global cs, app, Router, $ */
(
function
()
{
(
function
()
{
'
use strict
'
;
'
use strict
'
;
...
...
examples/componentjs/app/app-ui-widget-todo-model.js
View file @
1c2abb79
...
@@ -50,8 +50,7 @@
...
@@ -50,8 +50,7 @@
cs
(
self
).
value
(
'
data:status-items-remaining
'
,
remaining
);
cs
(
self
).
value
(
'
data:status-items-remaining
'
,
remaining
);
if
(
remaining
===
0
&&
completed
>
0
)
{
if
(
remaining
===
0
&&
completed
>
0
)
{
cs
(
self
).
value
(
'
state:all-item-selected
'
,
true
);
cs
(
self
).
value
(
'
state:all-item-selected
'
,
true
);
}
}
else
if
(
remaining
>
0
)
{
else
if
(
remaining
>
0
)
{
cs
(
self
).
value
(
'
state:all-item-selected
'
,
false
);
cs
(
self
).
value
(
'
state:all-item-selected
'
,
false
);
}
}
}
}
...
...
examples/componentjs/app/app-ui-widget-todo-view.js
View file @
1c2abb79
...
@@ -63,8 +63,7 @@
...
@@ -63,8 +63,7 @@
if
(
items
.
length
===
0
)
{
if
(
items
.
length
===
0
)
{
$
(
'
.todo__main
'
,
ui
).
addClass
(
'
hidden
'
);
$
(
'
.todo__main
'
,
ui
).
addClass
(
'
hidden
'
);
$
(
'
.todo__footer
'
,
ui
).
addClass
(
'
hidden
'
);
$
(
'
.todo__footer
'
,
ui
).
addClass
(
'
hidden
'
);
}
}
else
{
else
{
$
(
'
.todo__main
'
,
ui
).
removeClass
(
'
hidden
'
);
$
(
'
.todo__main
'
,
ui
).
removeClass
(
'
hidden
'
);
$
(
'
.todo__footer
'
,
ui
).
removeClass
(
'
hidden
'
);
$
(
'
.todo__footer
'
,
ui
).
removeClass
(
'
hidden
'
);
}
}
...
@@ -79,7 +78,7 @@
...
@@ -79,7 +78,7 @@
// one-way bind key-press and field blur interactions to leave editing mode
// one-way bind key-press and field blur interactions to leave editing mode
var
blur
=
function
(
el
,
takeTitle
)
{
var
blur
=
function
(
el
,
takeTitle
)
{
var
id
=
$
(
el
).
parent
().
data
(
'
id
'
)
+
''
;
var
id
=
String
(
$
(
el
).
parent
().
data
(
'
id
'
))
;
$
(
el
).
parent
().
removeClass
(
'
editing
'
);
$
(
el
).
parent
().
removeClass
(
'
editing
'
);
if
(
takeTitle
)
{
if
(
takeTitle
)
{
var
items
=
cs
(
self
).
value
(
'
data:item-list
'
);
var
items
=
cs
(
self
).
value
(
'
data:item-list
'
);
...
@@ -109,7 +108,7 @@
...
@@ -109,7 +108,7 @@
// one-way bind click interaction to toggle item completion
// one-way bind click interaction to toggle item completion
$
(
'
.todo__toggle
'
,
ui
).
click
(
function
(
ev
)
{
$
(
'
.todo__toggle
'
,
ui
).
click
(
function
(
ev
)
{
var
id
=
$
(
ev
.
target
).
parent
().
parent
().
data
(
'
id
'
)
+
''
;
var
id
=
String
(
$
(
ev
.
target
).
parent
().
parent
().
data
(
'
id
'
))
;
var
items
=
cs
(
self
).
value
(
'
data:item-list
'
);
var
items
=
cs
(
self
).
value
(
'
data:item-list
'
);
var
item
=
_
.
find
(
items
,
{
id
:
id
});
var
item
=
_
.
find
(
items
,
{
id
:
id
});
item
.
completed
=
!
item
.
completed
;
item
.
completed
=
!
item
.
completed
;
...
@@ -119,7 +118,7 @@
...
@@ -119,7 +118,7 @@
// one-way bind click interaction to remove item
// one-way bind click interaction to remove item
$
(
'
.todo__destroy
'
,
ui
).
click
(
function
(
ev
)
{
$
(
'
.todo__destroy
'
,
ui
).
click
(
function
(
ev
)
{
var
id
=
$
(
ev
.
target
).
parent
().
parent
().
data
(
'
id
'
)
+
''
;
var
id
=
String
(
$
(
ev
.
target
).
parent
().
parent
().
data
(
'
id
'
))
;
var
items
=
cs
(
self
).
value
(
'
data:item-list
'
);
var
items
=
cs
(
self
).
value
(
'
data:item-list
'
);
var
item
=
_
.
find
(
items
,
{
id
:
id
});
var
item
=
_
.
find
(
items
,
{
id
:
id
});
cs
(
self
).
value
(
'
data:item-list
'
,
_
.
without
(
items
,
item
));
cs
(
self
).
value
(
'
data:item-list
'
,
_
.
without
(
items
,
item
));
...
@@ -167,8 +166,7 @@
...
@@ -167,8 +166,7 @@
if
(
value
>
0
)
{
if
(
value
>
0
)
{
$
(
'
.todo__completed
'
,
ui
).
css
(
'
display
'
,
'
block
'
);
$
(
'
.todo__completed
'
,
ui
).
css
(
'
display
'
,
'
block
'
);
$
(
'
*[data-bind=
\'
data:status-items-completed
\'
]
'
,
ui
).
text
(
value
);
$
(
'
*[data-bind=
\'
data:status-items-completed
\'
]
'
,
ui
).
text
(
value
);
}
}
else
{
else
{
$
(
'
.todo__completed
'
,
ui
).
css
(
'
display
'
,
'
none
'
);
$
(
'
.todo__completed
'
,
ui
).
css
(
'
display
'
,
'
none
'
);
}
}
}
}
...
...
examples/componentjs/index.html
View file @
1c2abb79
<!doctype html>
<!doctype html>
<html
lang=
"en"
data-framework=
"componentjs"
>
<html
lang=
"en"
data-framework=
"componentjs"
>
<head>
<head>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<title>
ComponentJS • TodoMVC
</title>
<title>
ComponentJS • TodoMVC
</title>
<!-- load third-party libraries -->
<!-- load third-party libraries -->
<script
src=
"bower_components/lodash/dist/lodash.js"
></script>
<script
src=
"bower_components/lodash/dist/lodash.js"
></script>
<script
src=
"bower_components/uuid-js/lib/uuid.js"
></script>
<script
src=
"bower_components/uuid-js/lib/uuid.js"
></script>
<script
src=
"bower_components/nunjucks/browser/nunjucks.js"
></script>
<script
src=
"bower_components/nunjucks/browser/nunjucks.js"
></script>
<script
src=
"bower_components/jquery/jquery.js"
></script>
<script
src=
"bower_components/jquery/jquery.js"
></script>
<script
src=
"bower_components/jquery-markup/jquery.markup.js"
></script>
<script
src=
"bower_components/jquery-markup/jquery.markup.js"
></script>
<script
src=
"bower_components/director/build/director.js"
></script>
<script
src=
"bower_components/director/build/director.js"
></script>
<script
src=
"bower_components/componentjs/component.js"
></script>
<script
src=
"bower_components/componentjs/component.js"
></script>
<script
src=
"bower_components/componentjs/component.plugin.jquery.js"
></script>
<script
src=
"bower_components/componentjs/component.plugin.jquery.js"
></script>
<!-- load and call application initialization code -->
<!-- load and call application initialization code -->
<script
src=
"app/app.js"
></script>
<script
src=
"app/app.js"
></script>
<script
type=
"text/javascript"
>
app
.
boot
.
init
()
</script>
<script
>
app
.
boot
.
init
()
</script>
<!-- load the service and datamodel parts -->
<!-- load the service and datamodel parts -->
<script
src=
"app/app-dm.js"
></script>
<script
src=
"app/app-dm.js"
></script>
<script
src=
"app/app-sv.js"
></script>
<script
src=
"app/app-sv.js"
></script>
<!-- load the root UI component -->
<!-- load the root UI component -->
<script
src=
"app/app-ui-constants.js"
></script>
<script
src=
"app/app-ui-constants.js"
></script>
<script
src=
"app/app-ui-composite-root.js"
></script>
<script
src=
"app/app-ui-composite-root.js"
></script>
<link
href=
"app/app-ui-composite-root-style.css"
rel=
"stylesheet"
type=
"text/css
"
>
<link
href=
"app/app-ui-composite-root-style.css"
rel=
"stylesheet
"
>
<!-- load the main UI component -->
<!-- load the main UI component -->
<script
src=
"app/app-ui-composite-main.js"
></script>
<script
src=
"app/app-ui-composite-main.js"
></script>
<link
href=
"app/app-ui-composite-main-mask.html"
rel=
"markup"
type=
"text/x-markup-nunjucks"
>
<link
href=
"app/app-ui-composite-main-mask.html"
rel=
"markup"
type=
"text/x-markup-nunjucks"
>
<link
href=
"app/app-ui-composite-main-style.css"
rel=
"stylesheet"
type=
"text/css
"
>
<link
href=
"app/app-ui-composite-main-style.css"
rel=
"stylesheet
"
>
<!-- load the todo UI component -->
<!-- load the todo UI component -->
<script
src=
"app/app-ui-widget-todo-view.js"
></script>
<script
src=
"app/app-ui-widget-todo-view.js"
></script>
<script
src=
"app/app-ui-widget-todo-model.js"
></script>
<script
src=
"app/app-ui-widget-todo-model.js"
></script>
<link
href=
"app/app-ui-widget-todo-mask.html"
rel=
"markup"
type=
"text/x-markup-nunjucks"
>
<link
href=
"app/app-ui-widget-todo-mask.html"
rel=
"markup"
type=
"text/x-markup-nunjucks"
>
<link
href=
"app/app-ui-widget-todo-style.css"
rel=
"stylesheet"
type=
"text/css
"
>
<link
href=
"app/app-ui-widget-todo-style.css"
rel=
"stylesheet
"
>
<!-- load required todomvc.com integration functions -->
<!-- load required todomvc.com integration functions -->
<link
href=
"bower_components/todomvc-common/base.css"
rel=
"stylesheet"
type=
"text/css
"
>
<link
href=
"bower_components/todomvc-common/base.css"
rel=
"stylesheet
"
>
<script
src=
"bower_components/todomvc-common/base.js"
></script>
<script
src=
"bower_components/todomvc-common/base.js"
></script>
<!-- call application main code -->
<!-- call application main code -->
<script
type=
"text/javascript"
>
app
.
boot
.
main
()
</script>
<script
>
app
.
boot
.
main
()
</script>
</head>
</head>
<body>
<body>
</body>
</body>
</html>
</html>
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