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
9a391f34
authored
2013-04-07 18:09:19 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Build 0.4.8.
1 parent
f5528f7a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
28 deletions
component.json
lib/rivets.js
lib/rivets.min.js
package.json
src/rivets.coffee
component.json
View file @
9a391f3
...
...
@@ -2,7 +2,7 @@
"name"
:
"rivets"
,
"repo"
:
"mikeric/rivets"
,
"description"
:
"Declarative data binding facility."
,
"version"
:
"0.4.
7
"
,
"version"
:
"0.4.
8
"
,
"keywords"
:
[
"data binding"
,
"templating"
],
"scripts"
:
[
"lib/rivets.js"
],
"main"
:
"lib/rivets.js"
,
...
...
lib/rivets.js
View file @
9a391f3
// rivets.js
// version: 0.4.
7
// version: 0.4.
8
// author: Michael Richards
// license: MIT
(
function
()
{
...
...
@@ -405,21 +405,31 @@
getInputValue
=
function
(
el
)
{
var
o
,
_i
,
_len
,
_results
;
switch
(
el
.
type
)
{
case
'checkbox'
:
return
el
.
checked
;
case
'select-multiple'
:
_results
=
[];
for
(
_i
=
0
,
_len
=
el
.
length
;
_i
<
_len
;
_i
++
)
{
o
=
el
[
_i
];
if
(
o
.
selected
)
{
_results
.
push
(
o
.
value
);
if
(
window
.
jQuery
!=
null
)
{
el
=
jQuery
(
el
);
switch
(
el
[
0
].
type
)
{
case
'checkbox'
:
return
el
.
is
(
':checked'
);
default
:
return
el
.
val
();
}
}
else
{
switch
(
el
.
type
)
{
case
'checkbox'
:
return
el
.
checked
;
case
'select-multiple'
:
_results
=
[];
for
(
_i
=
0
,
_len
=
el
.
length
;
_i
<
_len
;
_i
++
)
{
o
=
el
[
_i
];
if
(
o
.
selected
)
{
_results
.
push
(
o
.
value
);
}
}
}
return
_results
;
break
;
default
:
return
el
.
value
;
return
_results
;
break
;
default
:
return
el
.
value
;
}
}
};
...
...
@@ -482,18 +492,25 @@
return
unbindEvent
(
el
,
'change'
,
this
.
currentListener
);
},
routine
:
function
(
el
,
value
)
{
var
o
,
_i
,
_len
,
_ref
,
_ref1
,
_results
;
if
(
el
.
type
===
'select-multiple'
)
{
if
(
value
!=
null
)
{
_results
=
[];
for
(
_i
=
0
,
_len
=
el
.
length
;
_i
<
_len
;
_i
++
)
{
o
=
el
[
_i
];
_results
.
push
(
o
.
selected
=
(
_ref
=
o
.
value
,
__indexOf
.
call
(
value
,
_ref
)
>=
0
));
var
o
,
_i
,
_len
,
_ref
,
_ref1
,
_ref2
,
_results
;
if
(
window
.
jQuery
!=
null
)
{
el
=
jQuery
(
el
);
if
((
value
!=
null
?
value
.
toString
()
:
void
0
)
!==
((
_ref
=
el
.
val
())
!=
null
?
_ref
.
toString
()
:
void
0
))
{
return
el
.
val
(
value
!=
null
?
value
:
''
);
}
}
else
{
if
(
el
.
type
===
'select-multiple'
)
{
if
(
value
!=
null
)
{
_results
=
[];
for
(
_i
=
0
,
_len
=
el
.
length
;
_i
<
_len
;
_i
++
)
{
o
=
el
[
_i
];
_results
.
push
(
o
.
selected
=
(
_ref1
=
o
.
value
,
__indexOf
.
call
(
value
,
_ref1
)
>=
0
));
}
return
_results
;
}
return
_results
;
}
else
if
((
value
!=
null
?
value
.
toString
()
:
void
0
)
!==
((
_ref2
=
el
.
value
)
!=
null
?
_ref2
.
toString
()
:
void
0
))
{
return
el
.
value
=
value
!=
null
?
value
:
''
;
}
}
else
if
((
value
!=
null
?
value
.
toString
()
:
void
0
)
!==
((
_ref1
=
el
.
value
)
!=
null
?
_ref1
.
toString
()
:
void
0
))
{
return
el
.
value
=
value
!=
null
?
value
:
''
;
}
}
},
...
...
lib/rivets.min.js
View file @
9a391f3
This diff is collapsed.
Click to expand it.
package.json
View file @
9a391f3
{
"name"
:
"rivets"
,
"description"
:
"Declarative data binding facility."
,
"version"
:
"0.4.
7
"
,
"version"
:
"0.4.
8
"
,
"author"
:
"Michael Richards"
,
"url"
:
"http://rivetsjs.com"
,
"main"
:
"./lib/rivets.js"
,
...
...
src/rivets.coffee
View file @
9a391f3
# rivets.js
# version : 0.4.
7
# version : 0.4.
8
# author : Michael Richards
# license : MIT
...
...
Please
register
or
sign in
to post a comment