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
d3981a08
authored
2012-08-14 16:54:37 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Build 0.3.4.
1 parent
614001a7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
31 deletions
lib/rivets.js
lib/rivets.min.js
package.json
src/rivets.coffee
lib/rivets.js
View file @
d3981a0
// rivets.js
// version: 0.3.
3
// version: 0.3.
4
// author: Michael Richards
// license: MIT
(
function
()
{
...
...
@@ -163,7 +163,7 @@
};
View
.
prototype
.
build
=
function
()
{
var
bindingRegExp
,
classRegExp
,
el
,
eventRegExp
,
iterationRegExp
,
iterator
,
node
,
parseNode
,
skipNodes
,
_i
,
_
len
,
_ref
,
_results
,
var
bindingRegExp
,
classRegExp
,
el
,
eventRegExp
,
iterationRegExp
,
iterator
,
node
,
parseNode
,
skipNodes
,
_i
,
_
j
,
_len
,
_len1
,
_ref
,
_ref1
,
_this
=
this
;
this
.
bindings
=
[];
skipNodes
=
[];
...
...
@@ -173,7 +173,7 @@
classRegExp
=
/^class-/
;
iterationRegExp
=
/^each-/
;
parseNode
=
function
(
node
)
{
var
a
,
attribute
,
binding
,
context
,
ctx
,
dependencies
,
keypath
,
model
,
n
,
options
,
path
,
pipe
,
pipes
,
splitPath
,
type
,
_i
,
_j
,
_k
,
_l
,
_len
,
_len1
,
_len2
,
_len3
,
_ref
,
_ref1
,
_ref2
,
_results
;
var
a
,
attribute
,
binding
,
context
,
ctx
,
dependencies
,
keypath
,
model
,
n
,
options
,
path
,
pipe
,
pipes
,
splitPath
,
type
,
_i
,
_j
,
_k
,
_l
,
_len
,
_len1
,
_len2
,
_len3
,
_ref
,
_ref1
,
_ref2
;
if
(
__indexOf
.
call
(
skipNodes
,
node
)
<
0
)
{
_ref
=
node
.
attributes
;
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
...
...
@@ -193,31 +193,30 @@
}
}
_ref2
=
iterator
||
node
.
attributes
;
_results
=
[];
for
(
_k
=
0
,
_len2
=
_ref2
.
length
;
_k
<
_len2
;
_k
++
)
{
attribute
=
_ref2
[
_k
];
if
(
bindingRegExp
.
test
(
attribute
.
name
))
{
options
=
{};
type
=
attribute
.
name
.
replace
(
bindingRegExp
,
''
);
pipes
=
(
function
()
{
var
_l
,
_len3
,
_ref3
,
_results
1
;
var
_l
,
_len3
,
_ref3
,
_results
;
_ref3
=
attribute
.
value
.
split
(
'|'
);
_results
1
=
[];
_results
=
[];
for
(
_l
=
0
,
_len3
=
_ref3
.
length
;
_l
<
_len3
;
_l
++
)
{
pipe
=
_ref3
[
_l
];
_results
1
.
push
(
pipe
.
trim
());
_results
.
push
(
pipe
.
trim
());
}
return
_results
1
;
return
_results
;
})();
context
=
(
function
()
{
var
_l
,
_len3
,
_ref3
,
_results
1
;
_ref3
=
pipes
.
shift
().
split
(
'
>
'
);
_results
1
=
[];
var
_l
,
_len3
,
_ref3
,
_results
;
_ref3
=
pipes
.
shift
().
split
(
'
<
'
);
_results
=
[];
for
(
_l
=
0
,
_len3
=
_ref3
.
length
;
_l
<
_len3
;
_l
++
)
{
ctx
=
_ref3
[
_l
];
_results
1
.
push
(
ctx
.
trim
());
_results
.
push
(
ctx
.
trim
());
}
return
_results
1
;
return
_results
;
})();
path
=
context
.
shift
();
splitPath
=
path
.
split
(
/
\.
|:/
);
...
...
@@ -251,31 +250,21 @@
a
=
iterator
[
_l
];
node
.
removeAttribute
(
a
.
name
);
}
_results
.
push
(
iterator
=
null
);
}
else
{
_results
.
push
(
void
0
);
iterator
=
null
;
}
}
return
_results
;
}
};
_ref
=
this
.
els
;
_results
=
[];
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
el
=
_ref
[
_i
];
parseNode
(
el
);
_results
.
push
((
function
()
{
var
_j
,
_len1
,
_ref1
,
_results1
;
_ref1
=
el
.
getElementsByTagName
(
'*'
);
_results1
=
[];
for
(
_j
=
0
,
_len1
=
_ref1
.
length
;
_j
<
_len1
;
_j
++
)
{
node
=
_ref1
[
_j
];
_results1
.
push
(
parseNode
(
node
)
);
parseNode
(
node
);
}
return
_results1
;
})());
}
return
_results
;
};
View
.
prototype
.
bind
=
function
()
{
...
...
@@ -454,16 +443,14 @@
formatters
:
Rivets
.
formatters
,
config
:
Rivets
.
config
,
configure
:
function
(
options
)
{
var
property
,
value
,
_results
;
var
property
,
value
;
if
(
options
==
null
)
{
options
=
{};
}
_results
=
[];
for
(
property
in
options
)
{
value
=
options
[
property
];
_results
.
push
(
Rivets
.
config
[
property
]
=
value
)
;
Rivets
.
config
[
property
]
=
value
;
}
return
_results
;
},
bind
:
function
(
el
,
models
)
{
var
view
;
...
...
lib/rivets.min.js
View file @
d3981a0
This diff is collapsed.
Click to expand it.
package.json
View file @
d3981a0
{
"name"
:
"rivets"
,
"description"
:
"Declarative data binding facility."
,
"version"
:
"0.3.
3
"
,
"version"
:
"0.3.
4
"
,
"author"
:
"Michael Richards"
,
"url"
:
"http://rivetsjs.com"
,
"main"
:
"./lib/rivets.js"
,
...
...
src/rivets.coffee
View file @
d3981a0
# rivets.js
# version : 0.3.
3
# version : 0.3.
4
# author : Michael Richards
# license : MIT
...
...
Please
register
or
sign in
to post a comment