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
c5fd5f1b
authored
2012-07-05 00:14:31 -0700
by
Patrick Gibson
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Recompile!
1 parent
7cf880b2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
lib/rivets.js
lib/rivets.js
View file @
c5fd5f1
// Generated by CoffeeScript 1.3.
1
// Generated by CoffeeScript 1.3.
3
(
function
()
{
var
Rivets
,
attributeBinding
,
bidirectionals
,
getInputValue
,
rivets
,
stateBinding
,
__bind
=
function
(
fn
,
me
){
return
function
(){
return
fn
.
apply
(
me
,
arguments
);
};
},
...
...
@@ -8,8 +8,6 @@
Rivets
.
Binding
=
(
function
()
{
Binding
.
name
=
'Binding'
;
function
Binding
(
el
,
type
,
context
,
keypath
,
formatters
)
{
this
.
el
=
el
;
this
.
type
=
type
;
...
...
@@ -48,7 +46,9 @@
return
_this
.
set
(
value
);
});
if
(
_ref
=
this
.
type
,
__indexOf
.
call
(
bidirectionals
,
_ref
)
>=
0
)
{
return
this
.
el
.
addEventListener
(
'change'
,
function
(
el
)
{
return
this
.
el
.
addEventListener
(
'change'
,
function
(
e
)
{
var
el
;
el
=
e
.
target
||
e
.
srcElement
;
return
Rivets
.
config
.
adapter
.
publish
(
_this
.
context
,
_this
.
keypath
,
getInputValue
(
el
));
});
}
...
...
@@ -60,8 +60,6 @@
Rivets
.
View
=
(
function
()
{
View
.
name
=
'View'
;
function
View
(
el
,
contexts
)
{
this
.
el
=
el
;
this
.
contexts
=
contexts
;
...
...
@@ -85,8 +83,9 @@
};
View
.
prototype
.
build
=
function
()
{
var
attribute
,
context
,
dataRegExp
,
keypath
,
node
,
path
,
pipes
,
type
,
_i
,
_len
,
_ref
,
_results
;
var
attribute
,
bindingRegExp
,
context
,
keypath
,
node
,
path
,
pipes
,
type
,
_i
,
_len
,
_ref
,
_results
;
this
.
bindings
=
[];
bindingRegExp
=
this
.
bindingRegExp
();
_ref
=
this
.
el
.
getElementsByTagName
(
'*'
);
_results
=
[];
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
...
...
@@ -97,9 +96,8 @@
_results1
=
[];
for
(
_j
=
0
,
_len1
=
_ref1
.
length
;
_j
<
_len1
;
_j
++
)
{
attribute
=
_ref1
[
_j
];
dataRegExp
=
new
RegExp
(
this
.
data
,
'g'
);
if
(
this
.
bindingRegExp
().
test
(
attribute
.
name
))
{
type
=
attribute
.
name
.
replace
(
this
.
bindingRegExp
(),
''
);
if
(
bindingRegExp
.
test
(
attribute
.
name
))
{
type
=
attribute
.
name
.
replace
(
bindingRegExp
,
''
);
pipes
=
attribute
.
value
.
split
(
'|'
).
map
(
function
(
pipe
)
{
return
pipe
.
trim
();
});
...
...
Please
register
or
sign in
to post a comment