Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
rivets
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
b17d2fc7
authored
2013-06-04 18:00:47 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Build 0.5.6.
1 parent
b775faa8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
4 deletions
component.json
dist/rivets.js
dist/rivets.min.js
package.json
src/rivets.coffee
component.json
View file @
b17d2fc
...
...
@@ -2,7 +2,7 @@
"name"
:
"rivets"
,
"repo"
:
"mikeric/rivets"
,
"description"
:
"Declarative data binding facility."
,
"version"
:
"0.5.
5
"
,
"version"
:
"0.5.
6
"
,
"keywords"
:
[
"data binding"
,
"templating"
],
"scripts"
:
[
"dist/rivets.js"
],
"main"
:
"dist/rivets.js"
,
...
...
dist/rivets.js
View file @
b17d2fc
// Rivets.js
// version: 0.5.
5
// version: 0.5.
6
// author: Michael Richards
// license: MIT
(
function
()
{
...
...
@@ -588,6 +588,63 @@
return
el
.
textContent
=
value
!=
null
?
value
:
''
;
}
},
"if"
:
{
block
:
true
,
bind
:
function
(
el
)
{
var
attr
,
declaration
;
if
(
this
.
marker
==
null
)
{
attr
=
[
'data'
,
this
.
view
.
config
.
prefix
,
this
.
type
].
join
(
'-'
).
replace
(
'--'
,
'-'
);
declaration
=
el
.
getAttribute
(
attr
);
this
.
marker
=
document
.
createComment
(
" rivets: "
+
this
.
type
+
" "
+
declaration
+
" "
);
el
.
removeAttribute
(
attr
);
el
.
parentNode
.
insertBefore
(
this
.
marker
,
el
);
return
el
.
parentNode
.
removeChild
(
el
);
}
},
unbind
:
function
()
{
var
_ref
;
return
(
_ref
=
this
.
nested
)
!=
null
?
_ref
.
unbind
()
:
void
0
;
},
routine
:
function
(
el
,
value
)
{
var
key
,
model
,
models
,
options
,
_ref
;
if
(
value
===
(
this
.
nested
==
null
))
{
if
(
value
)
{
models
=
{};
_ref
=
this
.
view
.
models
;
for
(
key
in
_ref
)
{
model
=
_ref
[
key
];
models
[
key
]
=
model
;
}
options
=
{
binders
:
this
.
view
.
options
.
binders
,
formatters
:
this
.
view
.
options
.
formatters
,
config
:
this
.
view
.
options
.
config
};
(
this
.
nested
=
new
Rivets
.
View
(
el
,
models
,
options
)).
bind
();
return
this
.
marker
.
parentNode
.
insertBefore
(
el
,
this
.
marker
.
nextSibling
);
}
else
{
el
.
parentNode
.
removeChild
(
el
);
this
.
nested
.
unbind
();
return
delete
this
.
nested
;
}
}
}
},
unless
:
{
block
:
true
,
bind
:
function
(
el
)
{
return
rivets
.
binders
[
"if"
].
bind
.
call
(
this
,
el
);
},
unbind
:
function
()
{
return
rivets
.
binders
[
"if"
].
unbind
.
call
(
this
);
},
routine
:
function
(
el
,
value
)
{
return
rivets
.
binders
[
"if"
].
routine
.
call
(
this
,
el
,
!
value
);
}
},
"on-*"
:
{
"function"
:
true
,
unbind
:
function
(
el
)
{
...
...
dist/rivets.min.js
View file @
b17d2fc
This diff is collapsed.
Click to expand it.
package.json
View file @
b17d2fc
{
"name"
:
"rivets"
,
"description"
:
"Declarative data binding facility."
,
"version"
:
"0.5.
5
"
,
"version"
:
"0.5.
6
"
,
"author"
:
"Michael Richards"
,
"url"
:
"http://rivetsjs.com"
,
"main"
:
"./dist/rivets.js"
,
...
...
src/rivets.coffee
View file @
b17d2fc
# Rivets.js
# =========
# > version: 0.5.
5
# > version: 0.5.
6
# > author: Michael Richards
# > license: MIT
# >
...
...
Please
register
or
sign in
to post a comment