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
3a93bc0a
Commit
3a93bc0a
authored
Jun 14, 2015
by
Arthur Verschaeve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `classnames` directly
parent
fc92daa5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
58 additions
and
6 deletions
+58
-6
examples/react-backbone/.gitignore
examples/react-backbone/.gitignore
+3
-0
examples/react-backbone/index.html
examples/react-backbone/index.html
+1
-0
examples/react-backbone/js/footer.jsx
examples/react-backbone/js/footer.jsx
+3
-5
examples/react-backbone/js/todoItem.jsx
examples/react-backbone/js/todoItem.jsx
+1
-1
examples/react-backbone/node_modules/classnames/index.js
examples/react-backbone/node_modules/classnames/index.js
+49
-0
examples/react-backbone/package.json
examples/react-backbone/package.json
+1
-0
No files found.
examples/react-backbone/.gitignore
View file @
3a93bc0a
...
...
@@ -15,6 +15,9 @@ node_modules/react/dist/*
!node_modules/react/dist/react-with-addons.js
!node_modules/react/dist/JSXTransformer.js
node_modules/classnames/*
!node_modules/classnames/index.js
node_modules/todomvc-app-css/*
!node_modules/todomvc-app-css/index.css
...
...
examples/react-backbone/index.html
View file @
3a93bc0a
...
...
@@ -18,6 +18,7 @@
<script
src=
"node_modules/todomvc-common/base.js"
></script>
<script
src=
"node_modules/react/dist/react-with-addons.js"
></script>
<script
src=
"node_modules/react/dist/JSXTransformer.js"
></script>
<script
src=
"node_modules/classnames/index.js"
></script>
<script
src=
"node_modules/jquery/dist/jquery.js"
></script>
<script
src=
"node_modules/underscore/underscore.js"
></script>
<script
src=
"node_modules/backbone/backbone.js"
></script>
...
...
examples/react-backbone/js/footer.jsx
View file @
3a93bc0a
...
...
@@ -26,8 +26,6 @@ var app = app || {};
);
}
// React idiom for shortcutting to `classSet` since it'll be used often
var
cx
=
React
.
addons
.
classSet
;
var
nowShowing
=
this
.
props
.
nowShowing
;
return
(
<
footer
id=
"footer"
>
...
...
@@ -38,7 +36,7 @@ var app = app || {};
<
li
>
<
a
href=
"#/"
className=
{
c
x
({
selected
:
nowShowing
===
app
.
ALL_TODOS
})
}
>
className=
{
c
lassNames
({
selected
:
nowShowing
===
app
.
ALL_TODOS
})
}
>
All
</
a
>
</
li
>
...
...
@@ -46,7 +44,7 @@ var app = app || {};
<
li
>
<
a
href=
"#/active"
className=
{
c
x
({
selected
:
nowShowing
===
app
.
ACTIVE_TODOS
})
}
>
className=
{
c
lassNames
({
selected
:
nowShowing
===
app
.
ACTIVE_TODOS
})
}
>
Active
</
a
>
</
li
>
...
...
@@ -54,7 +52,7 @@ var app = app || {};
<
li
>
<
a
href=
"#/completed"
className=
{
c
x
({
selected
:
nowShowing
===
app
.
COMPLETED_TODOS
})
}
>
className=
{
c
lassNames
({
selected
:
nowShowing
===
app
.
COMPLETED_TODOS
})
}
>
Completed
</
a
>
</
li
>
...
...
examples/react-backbone/js/todoItem.jsx
View file @
3a93bc0a
...
...
@@ -58,7 +58,7 @@ var app = app || {};
render
:
function
()
{
return
(
<
li
className=
{
React
.
addons
.
classSet
({
<
li
className=
{
classNames
({
completed
:
this
.
props
.
todo
.
get
(
'
completed
'
),
editing
:
this
.
props
.
editing
})
}
>
...
...
examples/react-backbone/node_modules/classnames/index.js
0 → 100644
View file @
3a93bc0a
/*!
Copyright (c) 2015 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
(
function
()
{
'
use strict
'
;
function
classNames
()
{
var
classes
=
''
;
for
(
var
i
=
0
;
i
<
arguments
.
length
;
i
++
)
{
var
arg
=
arguments
[
i
];
if
(
!
arg
)
continue
;
var
argType
=
typeof
arg
;
if
(
'
string
'
===
argType
||
'
number
'
===
argType
)
{
classes
+=
'
'
+
arg
;
}
else
if
(
Array
.
isArray
(
arg
))
{
classes
+=
'
'
+
classNames
.
apply
(
null
,
arg
);
}
else
if
(
'
object
'
===
argType
)
{
for
(
var
key
in
arg
)
{
if
(
arg
.
hasOwnProperty
(
key
)
&&
arg
[
key
])
{
classes
+=
'
'
+
key
;
}
}
}
}
return
classes
.
substr
(
1
);
}
if
(
typeof
define
===
'
function
'
&&
typeof
define
.
amd
===
'
object
'
&&
define
.
amd
)
{
// AMD. Register as an anonymous module.
define
(
function
()
{
return
classNames
;
});
}
else
if
(
typeof
module
!==
'
undefined
'
&&
module
.
exports
)
{
module
.
exports
=
classNames
;
}
else
{
window
.
classNames
=
classNames
;
}
}());
examples/react-backbone/package.json
100755 → 100644
View file @
3a93bc0a
...
...
@@ -3,6 +3,7 @@
"dependencies"
:
{
"backbone"
:
"^1.1.2"
,
"backbone.localstorage"
:
"^1.1.7"
,
"classnames"
:
"^2.1.2"
,
"jquery"
:
"^2.1.0"
,
"react"
:
"^0.13.3"
,
"todomvc-app-css"
:
"^1.0.0"
,
...
...
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