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
f6c70967
authored
2012-09-22 17:50:45 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Build 0.3.9.
1 parent
d9641ee9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
15 deletions
lib/rivets.js
lib/rivets.min.js
package.json
src/rivets.coffee
lib/rivets.js
View file @
f6c7096
// rivets.js
// version: 0.3.
8
// version: 0.3.
9
// author: Michael Richards
// license: MIT
(
function
()
{
...
...
@@ -73,8 +73,7 @@
Binding
.
prototype
.
set
=
function
(
value
)
{
value
=
value
instanceof
Function
&&
this
.
options
.
special
!==
'event'
?
this
.
formattedValue
(
value
.
call
(
this
.
model
))
:
this
.
formattedValue
(
value
);
if
(
this
.
options
.
special
===
'event'
)
{
this
.
routine
(
this
.
el
,
value
,
this
.
currentListener
);
return
this
.
currentListener
=
value
;
return
this
.
currentListener
=
this
.
routine
(
this
.
el
,
this
.
model
,
value
,
this
.
currentListener
);
}
else
if
(
this
.
options
.
special
===
'iteration'
)
{
return
this
.
routine
(
this
.
el
,
value
,
this
);
}
else
{
...
...
@@ -344,20 +343,25 @@
})();
bindEvent
=
function
(
el
,
event
,
fn
)
{
bindEvent
=
function
(
el
,
event
,
handler
,
context
)
{
var
fn
;
fn
=
function
(
e
)
{
return
handler
.
call
(
context
,
e
);
};
if
(
window
.
jQuery
!=
null
)
{
el
=
jQuery
(
el
);
if
(
el
.
on
!=
null
)
{
return
el
.
on
(
event
,
fn
);
el
.
on
(
event
,
fn
);
}
else
{
return
el
.
bind
(
event
,
fn
);
el
.
bind
(
event
,
fn
);
}
}
else
if
(
window
.
addEventListener
!=
null
)
{
return
el
.
addEventListener
(
event
,
fn
,
false
);
el
.
addEventListener
(
event
,
fn
,
false
);
}
else
{
event
=
'on'
+
event
;
return
el
.
attachEvent
(
event
,
fn
);
el
.
attachEvent
(
event
,
fn
);
}
return
fn
;
};
unbindEvent
=
function
(
el
,
event
,
fn
)
{
...
...
@@ -386,13 +390,11 @@
};
eventBinding
=
function
(
event
)
{
return
function
(
el
,
bind
,
unbind
)
{
if
(
bind
)
{
bindEvent
(
el
,
event
,
bind
);
}
return
function
(
el
,
context
,
bind
,
unbind
)
{
if
(
unbind
)
{
return
unbindEvent
(
el
,
event
,
unbind
);
unbindEvent
(
el
,
event
,
unbind
);
}
return
bindEvent
(
el
,
event
,
bind
,
context
);
};
};
...
...
lib/rivets.min.js
View file @
f6c7096
This diff is collapsed.
Click to expand it.
package.json
View file @
f6c7096
{
"name"
:
"rivets"
,
"description"
:
"Declarative data binding facility."
,
"version"
:
"0.3.
8
"
,
"version"
:
"0.3.
9
"
,
"author"
:
"Michael Richards"
,
"url"
:
"http://rivetsjs.com"
,
"main"
:
"./lib/rivets.js"
,
...
...
src/rivets.coffee
View file @
f6c7096
# rivets.js
# version : 0.3.
8
# version : 0.3.
9
# author : Michael Richards
# license : MIT
...
...
Please
register
or
sign in
to post a comment