Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
b3622841
Commit
b3622841
authored
Jul 03, 2012
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove jquery.hook.js, no longer used.
parent
af5301d2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
78 deletions
+0
-78
jquery.hook.js
jquery.hook.js
+0
-78
No files found.
jquery.hook.js
deleted
100644 → 0
View file @
af5301d2
/*!
* jQuery.hook v1.0
*
* Copyright (c) 2009 Aaron Heckmann
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
/**
* Provides the ability to hook into any jQuery.fn[method]
* with onbeforeMETHOD, onMETHOD, and onafterMETHOD.
*
* Pass in a string or array of method names you want
* to hook with onbefore, on, or onafter.
*
* Example:
* jQuery.hook('show');
* jQuery(selector).bind('onbeforeshow', function (e) { alert(e.type);});
* jQuery(selector).show() -> alerts 'onbeforeshow'
*
* jQuery.hook(['show','hide']);
* jQuery(selector)
* .bind('onbeforeshow', function (e) { alert(e.type);})
* .bind('onshow', function (e) { alert(e.type);})
* .bind('onaftershow', function (e) { alert(e.type);})
* .bind('onafterhide', function (e) { alert("The element is now hidden.");});
* jQuery(selector).show().hide()
* -> alerts 'onbeforeshow' then alerts 'onshow', then alerts 'onaftershow',
* then after the element is hidden alerts 'The element is now hidden.'
*
*
* You can also unhook what you've hooked into by calling jQuery.unhook() passing
* in your string or array of method names to unhook.
*
*/
(
function
(
$
){
$
.
hook
=
function
(
fns
)
{
fns
=
typeof
fns
===
'
string
'
?
fns
.
split
(
'
'
)
:
$
.
makeArray
(
fns
)
;
jQuery
.
each
(
fns
,
function
(
i
,
method
)
{
var
old
=
$
.
fn
[
method
];
if
(
old
&&
!
old
.
__hookold
)
{
$
.
fn
[
method
]
=
function
()
{
this
.
triggerHandler
(
'
onbefore
'
+
method
);
this
.
triggerHandler
(
'
on
'
+
method
);
var
ret
=
old
.
apply
(
this
,
arguments
);
this
.
triggerHandler
(
'
onafter
'
+
method
);
return
ret
;
};
$
.
fn
[
method
].
__hookold
=
old
;
}
});
};
$
.
unhook
=
function
(
fns
)
{
fns
=
typeof
fns
===
'
string
'
?
fns
.
split
(
'
'
)
:
$
.
makeArray
(
fns
)
;
jQuery
.
each
(
$
.
makeArray
(
fns
),
function
(
i
,
method
)
{
var
cur
=
$
.
fn
[
method
];
if
(
cur
&&
cur
.
__hookold
)
{
$
.
fn
[
method
]
=
cur
.
__hookold
;
}
});
};
})(
jQuery
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment