Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
c3c706d3
Commit
c3c706d3
authored
Jun 22, 2006
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Massive update, bugs, filesize, new features - getting ready for 1.0.
parent
ce6af8e8
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
641 additions
and
778 deletions
+641
-778
ajax.js
ajax/ajax.js
+18
-22
attr.js
attr/attr.js
+13
-0
event.js
event/event.js
+8
-9
form.js
form/form.js
+3
-3
fx.js
fx/fx.js
+153
-188
jquery.js
jquery/jquery.js
+446
-556
No files found.
ajax/ajax.js
View file @
c3c706d3
...
@@ -39,7 +39,7 @@ $.fn.load = function( url, params, callback ) {
...
@@ -39,7 +39,7 @@ $.fn.load = function( url, params, callback ) {
// If a callback function was provided
// If a callback function was provided
if
(
callback
&&
callback
.
constructor
==
Function
)
if
(
callback
&&
callback
.
constructor
==
Function
)
// Execute it within the context of the element
// Execute it within the context of the element
$
.
apply
(
self
,
callback
,
[
res
.
responseText
]
);
callback
.
apply
(
self
,
[
res
.
responseText
]
);
});
});
// Execute all the scripts inside of the newly-injected HTML
// Execute all the scripts inside of the newly-injected HTML
...
@@ -76,17 +76,14 @@ $.post = function( url, data, callback, type ) {
...
@@ -76,17 +76,14 @@ $.post = function( url, data, callback, type ) {
if
(
$
.
browser
==
"msie"
)
if
(
$
.
browser
==
"msie"
)
XMLHttpRequest
=
function
(){
XMLHttpRequest
=
function
(){
return
new
ActiveXObject
(
return
new
ActiveXObject
(
(
navigator
.
userAgent
.
toLowerCase
().
indexOf
(
'msie 5'
)
>=
0
)
?
(
navigator
.
userAgent
.
toLowerCase
().
indexOf
(
"msie 5"
)
>=
0
)
?
"Microsoft.XMLHTTP"
:
"Msxml2.XMLHTTP"
"Microsoft.XMLHTTP"
:
"Msxml2.XMLHTTP"
);
);
};
};
// Counter for holding the number of active queries
$
.
xmlActive
=
0
;
// Attach a bunch of functions for handling common AJAX events
// Attach a bunch of functions for handling common AJAX events
(
function
(){
(
function
(){
var
e
=
[
'ajaxStart'
,
'ajaxComplete'
,
'ajaxError'
,
'ajaxSuccess'
]
;
var
e
=
"ajaxStart.ajaxComplete.ajaxError.ajaxSuccess"
.
split
(
','
)
;
for
(
var
i
=
0
;
i
<
e
.
length
;
i
++
){
(
function
(){
for
(
var
i
=
0
;
i
<
e
.
length
;
i
++
){
(
function
(){
var
o
=
e
[
i
];
var
o
=
e
[
i
];
...
@@ -117,36 +114,32 @@ $.ajax = function( type, url, data, ret ) {
...
@@ -117,36 +114,32 @@ $.ajax = function( type, url, data, ret ) {
// Set the correct header, if data is being sent
// Set the correct header, if data is being sent
if
(
data
)
if
(
data
)
xml
.
setRequestHeader
(
'Content-Type'
,
'application/x-www-form-urlencoded'
);
xml
.
setRequestHeader
(
"Content-Type"
,
"application/x-www-form-urlencoded"
);
// Set header so calling script knows that it's an XMLHttpRequest
// Set header so calling script knows that it's an XMLHttpRequest
xml
.
setRequestHeader
(
'X-Requested-With'
,
'XMLHttpRequest'
);
xml
.
setRequestHeader
(
"X-Requested-With"
,
"XMLHttpRequest"
);
// Make sure the browser sends the right content length
// Make sure the browser sends the right content length
if
(
xml
.
overrideMimeType
)
if
(
xml
.
overrideMimeType
)
xml
.
setRequestHeader
(
'Connection'
,
'close'
);
xml
.
setRequestHeader
(
"Connection"
,
"close"
);
// Wait for a response to come back
// Wait for a response to come back
xml
.
onreadystatechange
=
function
(){
xml
.
onreadystatechange
=
function
(){
// Socket is openend
// Socket is openend
if
(
xml
.
readyState
==
1
)
{
if
(
xml
.
readyState
==
1
)
{
// Increase counter
// Increase counter
$
.
xmlA
ctive
++
;
$
.
ajax
.
a
ctive
++
;
// Show loader if needed
// Show 'loader'
if
(
$
.
xmlActive
>=
1
&&
$
.
xmlCreate
)
$
.
event
.
trigger
(
"ajaxStart"
);
$
.
event
.
trigger
(
'ajaxStart'
);
}
}
// Socket is closed and data is available
// Socket is closed and data is available
if
(
xml
.
readyState
==
4
)
{
if
(
xml
.
readyState
==
4
)
{
// Decrease counter
$
.
xmlActive
--
;
// Hide loader if needed
// Hide loader if needed
if
(
$
.
xmlActive
<=
0
&&
$
.
xmlDestroy
)
{
if
(
!
--
$
.
ajax
.
active
)
{
$
.
event
.
trigger
(
'ajaxComplete'
);
$
.
event
.
trigger
(
"ajaxComplete"
);
$
.
xmlA
ctive
=
0
$
.
ajax
.
a
ctive
=
0
}
}
// Make sure that the request was successful
// Make sure that the request was successful
...
@@ -156,7 +149,7 @@ $.ajax = function( type, url, data, ret ) {
...
@@ -156,7 +149,7 @@ $.ajax = function( type, url, data, ret ) {
if
(
success
)
success
(
xml
);
if
(
success
)
success
(
xml
);
// Fire the global callback
// Fire the global callback
$
.
event
.
trigger
(
'ajaxSuccess'
);
$
.
event
.
trigger
(
"ajaxSuccess"
);
// Otherwise, the request was not successful
// Otherwise, the request was not successful
}
else
{
}
else
{
...
@@ -164,7 +157,7 @@ $.ajax = function( type, url, data, ret ) {
...
@@ -164,7 +157,7 @@ $.ajax = function( type, url, data, ret ) {
if
(
error
)
error
(
xml
);
if
(
error
)
error
(
xml
);
// Fire the global callback
// Fire the global callback
$
.
event
.
trigger
(
'ajaxError'
);
$
.
event
.
trigger
(
"ajaxError"
);
}
}
// Process result
// Process result
...
@@ -176,10 +169,13 @@ $.ajax = function( type, url, data, ret ) {
...
@@ -176,10 +169,13 @@ $.ajax = function( type, url, data, ret ) {
xml
.
send
(
data
);
xml
.
send
(
data
);
};
};
// Counter for holding the number of active queries
$
.
ajax
.
active
=
0
;
// Determines if an XMLHttpRequest was successful or not
// Determines if an XMLHttpRequest was successful or not
$
.
httpSuccess
=
function
(
r
)
{
$
.
httpSuccess
=
function
(
r
)
{
return
(
r
.
status
&&
(
r
.
status
>=
200
&&
r
.
status
<
300
)
||
return
(
r
.
status
&&
(
r
.
status
>=
200
&&
r
.
status
<
300
)
||
r
.
status
==
304
)
||
!
r
.
status
&&
location
.
protocol
==
'file:'
;
r
.
status
==
304
)
||
!
r
.
status
&&
location
.
protocol
==
"file:"
;
};
};
// Get the data out of an XMLHttpRequest
// Get the data out of an XMLHttpRequest
...
...
attr/attr.js
View file @
c3c706d3
...
@@ -36,3 +36,16 @@ for ( var i = 0; i < posArg.length; i++ ) {
...
@@ -36,3 +36,16 @@ for ( var i = 0; i < posArg.length; i++ ) {
};
};
})();
})();
}
}
$
.
fn
.
text
=
function
(
e
)
{
e
=
e
||
this
.
cur
;
var
t
=
""
;
for
(
var
j
=
0
;
j
<
e
.
length
;
j
++
)
{
for
(
var
i
=
0
;
i
<
e
[
j
].
childNodes
.
length
;
i
++
)
{
t
+=
e
[
j
].
childNodes
[
i
].
nodeType
!=
1
?
e
[
j
].
childNodes
[
i
].
nodeValue
:
$
.
fn
.
text
(
e
[
j
].
childNodes
[
i
].
childNodes
);
}
}
return
t
;
};
event/event.js
View file @
c3c706d3
...
@@ -38,7 +38,7 @@ $.fn.hover = function(f,g) {
...
@@ -38,7 +38,7 @@ $.fn.hover = function(f,g) {
if
(
p
==
this
)
return
false
;
if
(
p
==
this
)
return
false
;
// Execute the right function
// Execute the right function
return
$
.
apply
(
this
,
e
.
type
==
'mouseover'
?
f
:
g
,[
e
]);
return
(
e
.
type
==
"mouseover"
?
f
:
g
).
apply
(
this
,[
e
]);
}
}
// Bind the function to the two event listeners
// Bind the function to the two event listeners
...
@@ -67,10 +67,9 @@ $.fn.ready = function(f) {
...
@@ -67,10 +67,9 @@ $.fn.ready = function(f) {
/*
/*
* Bind a number of event-handling functions, dynamically
* Bind a number of event-handling functions, dynamically
*/
*/
var
e
=
[
"blur"
,
"focus"
,
"contextmenu"
,
"load"
,
"resize"
,
"scroll"
,
"unload"
,
var
e
=
"blur,focus,contextmenu,load,resize,scroll,unload,click,dblclick,"
+
"click"
,
"dblclick"
,
"mousedown"
,
"mouseup"
,
"mouseenter"
,
"mouseleave"
,
"mousedown,mouseup,mouseenter,mouseleave,mousemove,mouseover,mouseout,"
+
"mousemove"
,
"mouseover"
,
"mouseout"
,
"change"
,
"reset"
,
"select"
,
"submit"
,
"change,reset,select,submit,keydown,keypress,keyup,abort,error,ready"
.
split
(
","
);
"keydown"
,
"keypress"
,
"keyup"
,
"abort"
,
"error"
,
"ready"
];
// Go through all the event names, but make sure that
// Go through all the event names, but make sure that
// it is enclosed properly
// it is enclosed properly
...
@@ -143,13 +142,13 @@ $.fn.ready = function(f) {
...
@@ -143,13 +142,13 @@ $.fn.ready = function(f) {
}
else
if
(
$
.
browser
==
"msie"
)
{
}
else
if
(
$
.
browser
==
"msie"
)
{
// Only works if you document.write() it
// Only works if you document.write() it
document
.
write
(
'<scr'
+
'ipt id=__ie_init defer=true '
+
document
.
write
(
"<scr"
+
"ipt id=__ie_init defer=true "
+
'src=javascript:void(0)><
\
/script>'
);
"src=javascript:void(0)><
\
/script>"
);
// Use the defer script hack
// Use the defer script hack
var
script
=
document
.
getElementById
(
'__ie_init'
);
var
script
=
document
.
getElementById
(
"__ie_init"
);
script
.
onreadystatechange
=
function
()
{
script
.
onreadystatechange
=
function
()
{
if
(
this
.
readyState
==
'complete'
)
if
(
this
.
readyState
==
"complete"
)
$
.
ready
();
$
.
ready
();
};
};
...
...
form/form.js
View file @
c3c706d3
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
* @param url form action override
* @param url form action override
* @param mth form method override
* @param mth form method override
* @return "this" object
* @return "this" object
* @see ajaxForm(), serialize(), load(), $.
xml
()
* @see ajaxForm(), serialize(), load(), $.
ajax
()
* @author Mark Constable (markc@renta.net)
* @author Mark Constable (markc@renta.net)
* @author G. vd Hoven, Mike Alsup, Sam Collett, John Resig
* @author G. vd Hoven, Mike Alsup, Sam Collett, John Resig
*/
*/
...
@@ -52,12 +52,12 @@ $.fn.ajaxSubmit = function(target, post_cb, pre_cb, url, mth) {
...
@@ -52,12 +52,12 @@ $.fn.ajaxSubmit = function(target, post_cb, pre_cb, url, mth) {
var
mth
=
mth
||
f
.
method
||
'POST'
;
var
mth
=
mth
||
f
.
method
||
'POST'
;
if
(
target
&&
target
.
constructor
==
Function
)
{
if
(
target
&&
target
.
constructor
==
Function
)
{
$
.
xml
(
mth
,
url
,
$
.
param
(
this
.
vars
),
target
);
$
.
ajax
(
mth
,
url
,
$
.
param
(
this
.
vars
),
target
);
}
else
if
(
target
&&
target
.
constructor
==
String
)
{
}
else
if
(
target
&&
target
.
constructor
==
String
)
{
$
(
target
).
load
(
url
,
this
.
vars
,
post_cb
);
$
(
target
).
load
(
url
,
this
.
vars
,
post_cb
);
}
else
{
}
else
{
this
.
vars
.
push
({
name
:
'evaljs'
,
value
:
1
});
this
.
vars
.
push
({
name
:
'evaljs'
,
value
:
1
});
$
.
xml
(
mth
,
url
,
$
.
param
(
this
.
vars
),
function
(
r
)
{
$
.
ajax
(
mth
,
url
,
$
.
param
(
this
.
vars
),
function
(
r
)
{
eval
(
r
.
responseText
);
eval
(
r
.
responseText
);
});
});
}
}
...
...
fx/fx.js
View file @
c3c706d3
$
.
speed
=
function
(
s
,
o
)
{
// overwrite the old show method
if
(
o
&&
o
.
constructor
==
Function
)
{
o
=
{
onComplete
:
o
};
}
$
.
fn
.
_show
=
$
.
fn
.
show
;
o
=
o
||
{};
var
ss
=
{
"crawl"
:
1200
,
"xslow"
:
850
,
"slow"
:
600
,
"medium"
:
400
,
"fast"
:
200
,
"xfast"
:
75
,
"normal"
:
400
};
o
.
duration
=
typeof
s
==
"number"
?
s
:
ss
[
s
]
||
400
;
o
.
oldComplete
=
o
.
onComplete
;
o
.
onComplete
=
function
(){
$
.
dequeue
(
this
,
'fx'
);
if
(
o
.
oldComplete
&&
o
.
oldComplete
.
constructor
==
Function
)
{
$
.
apply
(
this
,
o
.
oldComplete
);
}
};
return
o
;
/**
* The effects module overloads the show method to now allow
* for a speed to the show operation. What actually happens is
* that the height, width, and opacity to the matched elements
* are changed dynamically. The only three current speeds are
* "slow", "normal", and "fast". For example:
* $("p").show("slow");
* Note: You should not run the show method on things
* that are already shown. This can be circumvented by doing this:
* $("p:hidden").show("slow");
*/
$
.
fn
.
show
=
function
(
speed
,
callback
){
return
speed
?
this
.
animate
({
height
:
"show"
,
width
:
"show"
,
opacity
:
"show"
},
speed
,
callback
)
:
this
.
_show
();
};
};
$
.
queue
=
{};
// We're overwriting the old hide method
$
.
fn
.
_hide
=
$
.
fn
.
hide
;
$
.
dequeue
=
function
(
elem
,
type
){
type
=
type
||
'fx'
;
if
(
elem
.
$$queue
&&
elem
.
$$queue
[
type
]
)
{
// Remove self
elem
.
$$queue
[
type
].
shift
();
// Get next function
/**
var
f
=
elem
.
$$queue
[
type
][
0
];
* The hide function behaves very similary to the show function,
* but is just the opposite.
* $("p:visible").hide("slow");
*/
$
.
fn
.
hide
=
function
(
speed
,
callback
){
return
speed
?
this
.
animate
({
height
:
"hide"
,
width
:
"hide"
,
opacity
:
"hide"
},
speed
,
callback
)
:
this
.
_hide
();
};
if
(
f
)
{
/**
$
.
apply
(
elem
,
f
);
* This function increases the height and opacity for all matched
}
* elements. This is very similar to 'show', but does not change
}
* the width - creating a neat sliding effect.
* $("p:hidden").slideDown("slow");
*/
$
.
fn
.
slideDown
=
function
(
speed
,
callback
){
return
this
.
animate
({
height
:
"show"
},
speed
,
callback
);
};
};
$
.
fn
.
queue
=
function
(
type
,
fn
){
/**
if
(
!
fn
)
{
* Just like slideDown, only it hides all matched elements.
fn
=
type
;
* $("p:visible").slideUp("slow");
type
=
'fx'
;
*/
}
$
.
fn
.
slideUp
=
function
(
speed
,
callback
){
return
this
.
animate
({
height
:
"hide"
},
speed
,
callback
);
};
return
this
.
each
(
function
(){
/**
if
(
!
this
.
$$queue
)
{
* Adjusts the opacity of all matched elements from a hidden,
this
.
$$queue
=
{};
* to a fully visible, state.
}
* $("p:hidden").fadeIn("slow");
*/
$
.
fn
.
fadeIn
=
function
(
speed
,
callback
){
return
this
.
animate
({
opacity
:
"show"
},
speed
,
callback
);
};
if
(
!
this
.
$$queue
[
type
]
)
{
/**
this
.
$$queue
[
type
]
=
[];
* Same as fadeIn, but transitions from a visible, to a hidden state.
}
* $("p:visible").fadeOut("slow");
*/
$
.
fn
.
fadeOut
=
function
(
speed
,
callback
){
return
this
.
animate
({
opacity
:
"hide"
},
speed
,
callback
);
};
this
.
$$queue
[
type
].
push
(
fn
);
/**
* ...
*/
$
.
fn
.
fadeTo
=
function
(
speed
,
to
,
callback
){
return
this
.
animate
({
opacity
:
to
},
speed
,
callback
);
};
if
(
this
.
$$queue
[
type
].
length
==
1
)
{
/**
$
.
apply
(
this
,
fn
);
*
*/
$
.
fn
.
animate
=
function
(
prop
,
speed
,
callback
)
{
return
this
.
queue
(
function
(){
var
i
=
0
;
for
(
var
p
in
prop
)
{
var
e
=
new
fx
(
this
,
$
.
speed
(
speed
,
callback
,
i
++
),
p
);
if
(
prop
[
p
].
constructor
==
Number
)
e
.
custom
(
e
.
cur
(),
prop
[
p
]
);
else
e
[
prop
[
p
]
]();
}
}
});
});
};
};
$
.
fn
.
_hide
=
$
.
fn
.
hide
;
$
.
speed
=
function
(
s
,
o
,
i
)
{
o
=
o
||
{};
$
.
fn
.
hide
=
function
(
a
,
o
)
{
if
(
o
.
constructor
==
Function
)
o
=
$
.
speed
(
a
,
o
);
o
=
{
complete
:
o
};
return
a
?
this
.
queue
(
function
(){
new
$
.
fx
.
FadeSize
(
this
,
o
).
hide
();
})
:
this
.
_hide
();
};
$
.
fn
.
_show
=
$
.
fn
.
show
;
var
ss
=
{
"slow"
:
600
,
"fast"
:
200
};
o
.
duration
=
s
.
constructor
==
Number
?
s
:
ss
[
s
]
||
400
;
$
.
fn
.
show
=
function
(
a
,
o
)
{
// Queueing
o
=
$
.
speed
(
a
,
o
);
o
.
oldComplete
=
o
.
complete
;
return
a
?
this
.
queue
(
function
(){
o
.
complete
=
function
(){
new
$
.
fx
.
FadeSize
(
this
,
o
).
show
();
$
.
dequeue
(
this
,
"fx"
);
})
:
this
.
_show
();
if
(
o
.
oldComplete
&&
o
.
oldComplete
.
constructor
==
Function
)
};
o
.
oldComplete
.
apply
(
this
);
};
$
.
fn
.
slideDown
=
function
(
a
,
o
)
{
if
(
i
>
0
)
o
=
$
.
speed
(
a
,
o
);
o
.
complete
=
null
;
return
this
.
queue
(
function
(){
new
$
.
fx
.
Resize
(
this
,
o
).
show
(
"height"
);
});
};
$
.
fn
.
slideUp
=
function
(
a
,
o
)
{
return
o
;
o
=
$
.
speed
(
a
,
o
);
return
this
.
queue
(
function
(){
new
$
.
fx
.
Resize
(
this
,
o
).
hide
(
"height"
);
});
};
};
$
.
fn
.
fadeOut
=
function
(
a
,
o
)
{
$
.
queue
=
{};
o
=
$
.
speed
(
a
,
o
);
return
a
?
this
.
queue
(
function
(){
new
$
.
fx
.
Opacity
(
this
,
o
,
1
).
hide
();
})
:
this
.
_hide
();
};
$
.
fn
.
fadeIn
=
function
(
a
,
o
)
{
$
.
dequeue
=
function
(
elem
,
type
){
o
=
$
.
speed
(
a
,
o
);
type
=
type
||
"fx"
;
return
a
?
this
.
queue
(
function
(){
new
$
.
fx
.
Opacity
(
this
,
o
,
1
).
show
();
})
:
this
.
_show
();
};
$
.
fn
.
fadeTo
=
function
(
a
,
ev
,
o
)
{
if
(
elem
.
queue
&&
elem
.
queue
[
type
]
)
{
o
=
$
.
speed
(
a
,
o
);
// Remove self
return
a
?
this
.
queue
(
function
(){
elem
.
queue
[
type
].
shift
();
ef
=
new
$
.
fx
.
Opacity
(
this
,
o
);
ef
.
custom
(
ef
.
cur
(),
parseFloat
(
ev
));
ef
.
show
();
})
:
this
.
_show
();
};
$
.
fn
.
center
=
function
(
f
)
{
// Get next function
return
this
.
each
(
function
(){
var
f
=
elem
.
queue
[
type
][
0
];
if
(
!
f
&&
this
.
nodeName
==
'IMG'
&&
!
this
.
offsetWidth
&&
!
this
.
offsetHeight
)
{
if
(
f
)
var
self
=
this
;
f
.
apply
(
elem
);
setTimeout
(
function
(){
$
(
self
).
center
(
true
);
},
13
);
}
else
{
var
s
=
this
.
style
;
var
p
=
this
.
parentNode
;
if
(
$
.
css
(
p
,
"position"
)
==
'static'
)
{
p
.
style
.
position
=
'relative'
;
}
}
s
.
position
=
'absolute'
;
};
s
.
left
=
((
$
.
css
(
p
,
"width"
)
-
$
.
css
(
this
,
"width"
))
/
2
)
+
"px"
;
s
.
top
=
((
$
.
css
(
p
,
"height"
)
-
$
.
css
(
this
,
"height"
))
/
2
)
+
"px"
;
$
.
fn
.
queue
=
function
(
type
,
fn
){
if
(
!
fn
)
{
fn
=
type
;
type
=
"fx"
;
}
}
return
this
.
each
(
function
(){
if
(
!
this
.
queue
)
this
.
queue
=
{};
if
(
!
this
.
queue
[
type
]
)
this
.
queue
[
type
]
=
[];
this
.
queue
[
type
].
push
(
fn
);
if
(
this
.
queue
[
type
].
length
==
1
)
fn
.
apply
(
this
);
});
});
};
};
$
.
setAuto
=
function
(
e
,
p
)
{
$
.
setAuto
=
function
(
e
,
p
)
{
var
a
=
e
.
style
[
p
];
var
a
=
e
.
style
[
p
];
var
o
=
$
.
css
(
e
,
p
);
var
o
=
$
.
css
(
e
,
p
);
e
.
style
[
p
]
=
'auto'
;
e
.
style
[
p
]
=
"auto"
;
var
n
=
$
.
css
(
e
,
p
);
var
n
=
$
.
css
(
e
,
p
);
if
(
o
!=
n
)
{
if
(
o
!=
n
)
e
.
style
[
p
]
=
a
;
e
.
style
[
p
]
=
a
;
}
};
};
/*
/*
...
@@ -148,32 +168,42 @@ $.setAuto = function(e,p) {
...
@@ -148,32 +168,42 @@ $.setAuto = function(e,p) {
* people. You've been warned.
* people. You've been warned.
*/
*/
$
.
fx
=
function
(
el
,
op
,
ty
){
$
.
fx
=
function
(
elem
,
options
,
prop
){
var
z
=
this
;
var
z
=
this
;
// The users options
// The users options
z
.
o
=
{
z
.
o
=
{
duration
:
(
op
&&
op
.
duration
)
||
400
,
duration
:
options
.
duration
||
400
,
onComplete
:
(
op
&&
op
.
onComplete
)
||
op
complete
:
options
.
complete
};
};
// The element
// The element
z
.
el
=
el
;
z
.
el
=
el
em
;
// The styles
// The styles
var
y
=
z
.
el
.
style
;
var
y
=
z
.
el
.
style
;
// Simple function for setting a style value
// Simple function for setting a style value
z
.
a
=
function
(){
z
.
a
=
function
(){
z
.
el
.
style
[
ty
]
=
z
.
now
+
'px'
;
if
(
prop
==
"opacity"
)
{
if
(
z
.
now
==
1
)
z
.
now
=
0.9999
;
if
(
window
.
ActiveXObject
)
y
.
filter
=
"alpha(opacity="
+
z
.
now
*
100
+
")"
;
y
.
opacity
=
z
.
now
;
}
else
y
[
prop
]
=
z
.
now
+
"px"
;
};
};
// Figure out the maximum number to run to
// Figure out the maximum number to run to
z
.
max
=
function
(){
return
z
.
el
[
"$$orig"
+
ty
]
||
z
.
cur
();};
z
.
max
=
function
(){
return
z
.
el
[
"orig"
+
prop
]
||
z
.
cur
();
};
// Get the current size
// Get the current size
z
.
cur
=
function
(){
return
$
.
css
(
z
.
el
,
ty
);};
z
.
cur
=
function
(){
return
parseFloat
(
$
.
css
(
z
.
el
,
prop
)
);
};
// Start an animation from one number to another
// Start an animation from one number to another
z
.
custom
=
function
(
from
,
to
){
z
.
custom
=
function
(
from
,
to
){
...
@@ -196,25 +226,15 @@ $.fx = function(el,op,ty){
...
@@ -196,25 +226,15 @@ $.fx = function(el,op,ty){
// Simple 'hide' function
// Simple 'hide' function
z
.
hide
=
function
(){
z
.
hide
=
function
(){
// Remember where we started, so that we can go back to it later
// Remember where we started, so that we can go back to it later
z
.
el
[
"
$$orig"
+
ty
]
=
this
.
cur
();
z
.
el
[
"
orig"
+
prop
]
=
this
.
cur
();
// Begin the animation
// Begin the animation
z
.
custom
(
z
.
cur
(),
0
);
z
.
custom
(
z
.
cur
(),
0
);
};
};
// Toggle between showing and hiding an element
z
.
toggle
=
function
(){
if
(
z
.
cur
()
>
0
)
{
z
.
hide
();
}
else
{
z
.
show
();
}
};
// IE has trouble with opacity if it doesn't have layout
// IE has trouble with opacity if it doesn't have layout
if
(
$
.
browser
==
"msie"
&&
!
z
.
el
.
currentStyle
.
hasLayout
)
{
if
(
$
.
browser
==
"msie"
&&
!
z
.
el
.
currentStyle
.
hasLayout
)
y
.
zoom
=
1
;
y
.
zoom
=
1
;
}
// Remember the overflow of the element
// Remember the overflow of the element
z
.
oldOverflow
=
y
.
overflow
;
z
.
oldOverflow
=
y
.
overflow
;
...
@@ -239,21 +259,20 @@ $.fx = function(el,op,ty){
...
@@ -239,21 +259,20 @@ $.fx = function(el,op,ty){
// If the element was shown, and not using a custom number,
// If the element was shown, and not using a custom number,
// set its height and/or width to auto
// set its height and/or width to auto
if
(
(
ty
==
"height"
||
ty
==
"width"
)
&&
z
.
o
.
auto
)
{
if
(
(
prop
==
"height"
||
prop
==
"width"
)
&&
z
.
o
.
auto
)
$
.
setAuto
(
z
.
el
,
ty
);
$
.
setAuto
(
z
.
el
,
prop
);
}
// If a callback was provided, execute it
// If a callback was provided, execute it
if
(
z
.
o
.
onC
omplete
.
constructor
==
Function
)
{
if
(
z
.
o
.
c
omplete
.
constructor
==
Function
)
{
// Yes, this is a weird place for this, but it needs to be executed
// Yes, this is a weird place for this, but it needs to be executed
// only once per cluster of effects.
// only once per cluster of effects.
// If the element is, effectively, hidden - hide it
// If the element is, effectively, hidden - hide it
if
(
y
.
height
==
"0px"
||
y
.
width
==
"0px"
)
{
if
(
y
.
height
==
"0px"
||
y
.
width
==
"0px"
)
y
.
display
=
"none"
;
y
.
display
=
"none"
;
}
$
.
apply
(
z
.
el
,
z
.
o
.
onComplete
);
// Execute the complete function
z
.
o
.
complete
.
apply
(
z
.
el
);
}
}
}
else
{
}
else
{
// Figure out where in the animation we are and set the number
// Figure out where in the animation we are and set the number
...
@@ -266,57 +285,3 @@ $.fx = function(el,op,ty){
...
@@ -266,57 +285,3 @@ $.fx = function(el,op,ty){
};
};
};
};
$
.
fx
.
fn
=
[
"show"
,
"hide"
,
"toggle"
];
$
.
fx
.
ty
=
[
"Height"
,
"Width"
,
"Left"
,
"Top"
];
(
function
(){
for
(
var
$i
in
$
.
fx
.
ty
){(
function
(){
var
c
=
$
.
fx
.
ty
[
$i
];
$
.
fx
[
c
]
=
function
(
a
,
b
){
return
new
$
.
fx
(
a
,
b
,
c
.
toLowerCase
());
};
})();}
})();
$
.
fx
.
Opacity
=
function
(
a
,
b
,
sv
){
var
o
=
new
$
.
fx
(
a
,
b
,
"opacity"
);
o
.
cur
=
function
(){
return
parseFloat
(
o
.
el
.
style
.
opacity
);};
o
.
a
=
function
()
{
var
e
=
o
.
el
.
style
;
if
(
o
.
now
==
1
)
{
o
.
now
=
0.9999
;
}
if
(
window
.
ActiveXObject
)
{
e
.
filter
=
"alpha(opacity="
+
o
.
now
*
100
+
")"
;
}
e
.
opacity
=
o
.
now
;
};
o
.
io
=
o
.
now
=
(
sv
||
o
.
cur
());
o
.
a
();
return
o
;
};
$
.
fx
.
Resize
=
function
(
e
,
o
){
var
z
=
this
;
var
h
=
new
$
.
fx
.
Height
(
e
,
o
);
if
(
o
)
{
o
.
onComplete
=
null
;
}
var
w
=
new
$
.
fx
.
Width
(
e
,
o
);
function
c
(
a
,
b
,
d
){
return
(
!
a
||
a
==
d
||
b
==
d
);}
for
(
var
i
in
$
.
fx
.
fn
){(
function
(){
var
j
=
$
.
fx
.
fn
[
i
];
z
[
j
]
=
function
(
a
,
b
){
if
(
c
(
a
,
b
,
"height"
))
{
h
[
j
]();
}
if
(
c
(
a
,
b
,
"width"
))
{
w
[
j
]();
}
};
})();}
};
$
.
fx
.
FadeSize
=
function
(
e
,
o
){
var
z
=
this
;
var
r
=
new
$
.
fx
.
Resize
(
e
,
o
);
if
(
o
)
{
o
.
onComplete
=
null
;
}
var
p
=
new
$
.
fx
.
Opacity
(
e
,
o
,
1
);
for
(
var
i
in
$
.
fx
.
fn
){(
function
(){
var
j
=
$
.
fx
.
fn
[
i
];
z
[
j
]
=
function
(
a
,
b
){
p
[
j
]();
r
[
j
](
a
,
b
);};
})();}
};
jquery/jquery.js
View file @
c3c706d3
...
@@ -9,54 +9,40 @@
...
@@ -9,54 +9,40 @@
* $Rev$
* $Rev$
*/
*/
/* For JSLint (jslint.com): */
// Global undefined variable
/*extern ActiveXObject Prototype setTimeout setInterval clearInterval document window XMLHttpRequest navigator*/
window
.
undefined
=
window
.
undefined
;
function
$
(
a
,
c
)
{
function
jQuery
(
a
,
c
)
{
var
$a
=
a
||
$
.
context
||
document
;
this
.
cur
=
$
.
Select
(
var
$c
=
c
&&
c
.
$jquery
&&
c
.
get
(
0
)
||
c
;
a
||
$
.
context
||
document
,
c
&&
c
.
$jquery
&&
c
.
get
(
0
)
||
c
// Since we're using Prototype's $ function,
);
// be nice and have backwards compatability
}
if
(
typeof
Prototype
!=
"undefined"
)
{
if
(
$a
.
constructor
==
String
)
{
if
(
window
.
$
==
undefined
)
var
re
=
new
RegExp
(
"[^a-zA-Z0-9_-]"
);
var
$
=
function
(
a
,
c
)
{
if
(
!
re
.
test
(
$a
)
)
{
return
new
jQuery
(
a
,
c
);
$c
=
$c
&&
$c
.
documentElement
||
document
;
};
if
(
$c
.
getElementsByTagName
(
$a
).
length
===
0
)
{
var
obj
=
$c
.
getElementById
(
$a
);
if
(
obj
)
{
return
obj
;
}
}
}
}
else
if
(
$a
.
constructor
==
Array
)
{
return
$
.
map
(
$a
,
function
(
b
){
if
(
b
.
constructor
==
String
)
{
return
document
.
getElementById
(
b
);
}
return
b
;
});
}
}
// Load Dynamic Function List
jQuery
.
prototype
=
$
.
fn
=
{
var
self
=
{
cur
:
$
.
Select
(
$a
,
$c
),
$jquery
:
"$Rev$"
,
$jquery
:
"$Rev$"
,
// The only two getters
// The only two getters
size
:
function
()
{
return
this
.
get
().
length
;},
size
:
function
()
{
return
this
.
get
().
length
;
},
get
:
function
(
i
)
{
get
:
function
(
i
)
{
return
typeof
i
==
'undefined'
?
this
.
cur
:
this
.
cur
[
i
];
return
i
==
undefined
?
this
.
cur
:
this
.
cur
[
i
];
},
},
each
:
function
(
f
)
{
each
:
function
(
f
)
{
for
(
var
i
=
0
;
i
<
this
.
size
();
i
++
)
for
(
var
i
=
0
;
i
<
this
.
size
();
i
++
)
$
.
apply
(
this
.
get
(
i
),
f
,
[
i
]
);
f
.
apply
(
this
.
get
(
i
)
,
[
i
]
);
return
this
;
return
this
;
},
},
set
:
function
(
a
,
b
)
{
set
:
function
(
a
,
b
)
{
return
this
.
each
(
function
(){
return
this
.
each
(
function
(){
if
(
typeof
b
==
'undefined'
)
if
(
b
==
undefined
)
for
(
var
j
in
a
)
for
(
var
j
in
a
)
$
.
attr
(
this
,
j
,
a
[
j
]);
$
.
attr
(
this
,
j
,
a
[
j
]);
else
else
...
@@ -64,13 +50,23 @@ function $(a,c) {
...
@@ -64,13 +50,23 @@ function $(a,c) {
});
});
},
},
html
:
function
(
h
)
{
html
:
function
(
h
)
{
return
typeof
h
==
'undefined'
&&
this
.
size
()
?
return
h
==
undefined
&&
this
.
size
()
?
this
.
get
(
0
).
innerHTML
:
this
.
set
(
"innerHTML"
,
h
);
this
.
get
(
0
).
innerHTML
:
this
.
set
(
"innerHTML"
,
h
);
},
},
val
:
function
(
h
)
{
val
:
function
(
h
)
{
return
typeof
h
==
'undefined'
&&
this
.
size
()
?
return
h
==
undefined
&&
this
.
size
()
?
this
.
get
(
0
).
value
:
this
.
set
(
"value"
,
h
);
this
.
get
(
0
).
value
:
this
.
set
(
"value"
,
h
);
},
},
text
:
function
(
e
)
{
e
=
e
||
this
.
get
();
var
t
=
""
;
for
(
var
j
=
0
;
j
<
e
.
length
;
j
++
)
for
(
var
i
=
0
;
i
<
e
[
j
].
childNodes
.
length
;
i
++
)
t
+=
e
[
j
].
childNodes
[
i
].
nodeType
!=
1
?
e
[
j
].
childNodes
[
i
].
nodeValue
:
$
.
fn
.
text
(
e
[
j
].
childNodes
[
i
].
childNodes
);
return
t
;
},
css
:
function
(
a
,
b
)
{
css
:
function
(
a
,
b
)
{
return
a
.
constructor
!=
String
||
b
?
return
a
.
constructor
!=
String
||
b
?
...
@@ -84,50 +80,45 @@ function $(a,c) {
...
@@ -84,50 +80,45 @@ function $(a,c) {
},
},
toggle
:
function
()
{
toggle
:
function
()
{
return
this
.
each
(
function
(){
return
this
.
each
(
function
(){
var
d
=
$
.
getCSS
(
this
,
"display"
);
var
d
=
$
.
css
(
this
,
"display"
);
if
(
d
==
"none"
||
d
===
''
)
if
(
d
==
"none"
||
d
===
""
)
$
(
this
).
show
();
$
(
this
).
show
();
else
else
$
(
this
).
hide
();
$
(
this
).
hide
();
});
});
},
},
show
:
function
(
a
)
{
show
:
function
(
)
{
return
this
.
each
(
function
(){
return
this
.
each
(
function
(){
this
.
style
.
display
=
this
.
$$oldblock
?
this
.
$$oldblock
:
''
;
this
.
style
.
display
=
this
.
oldblock
?
this
.
oldblock
:
""
;
if
(
$
.
getCSS
(
this
,
"display"
)
==
"none"
)
if
(
$
.
css
(
this
,
"display"
)
==
"none"
)
this
.
style
.
display
=
'block'
;
this
.
style
.
display
=
"block"
;
});
});
},
},
hide
:
function
(
a
)
{
hide
:
function
(
)
{
return
this
.
each
(
function
(){
return
this
.
each
(
function
(){
this
.
$$oldblock
=
$
.
getCSS
(
this
,
"display"
);
this
.
oldblock
=
$
.
css
(
this
,
"display"
);
if
(
this
.
$$
oldblock
==
"none"
)
if
(
this
.
oldblock
==
"none"
)
this
.
$$oldblock
=
'block'
;
this
.
oldblock
=
"block"
;
this
.
style
.
display
=
'none'
;
this
.
style
.
display
=
"none"
;
});
});
},
},
addClass
:
function
(
c
)
{
addClass
:
function
(
c
)
{
return
this
.
each
(
function
(){
return
this
.
each
(
function
(){
if
(
$
.
hasWord
(
this
,
c
))
return
;
$
.
class
.
add
(
this
,
c
);
this
.
className
+=
(
this
.
className
.
length
>
0
?
" "
:
""
)
+
c
;
});
});
},
},
removeClass
:
function
(
c
)
{
removeClass
:
function
(
c
)
{
return
this
.
each
(
function
(){
return
this
.
each
(
function
(){
this
.
className
=
!
c
?
''
:
$
.
class
.
remove
(
this
,
c
);
this
.
className
.
replace
(
new
RegExp
(
'(^|
\\
s*
\\
b[^-])'
+
c
+
'($|
\\
b(?=[^-]))'
,
'g'
),
''
);
});
});
},
},
// TODO: Optomize
// TODO: Optomize
toggleClass
:
function
(
c
)
{
toggleClass
:
function
(
c
)
{
return
this
.
each
(
function
(){
return
this
.
each
(
function
(){
if
(
$
.
hasWord
(
this
,
c
))
if
(
$
.
hasWord
(
this
,
c
))
this
.
className
=
$
.
class
.
remove
(
this
,
c
);
this
.
className
.
replace
(
new
RegExp
(
'(
\\
s*
\\
b[^-])'
+
c
+
'($|
\\
b(?=[^-]))'
,
'g'
),
''
);
else
else
this
.
className
+=
(
this
.
className
.
length
>
0
?
" "
:
""
)
+
c
;
$
.
class
.
add
(
this
,
c
)
;
});
});
},
},
remove
:
function
()
{
remove
:
function
()
{
...
@@ -224,9 +215,7 @@ function $(a,c) {
...
@@ -224,9 +215,7 @@ function $(a,c) {
},
},
parent
:
function
(
a
)
{
parent
:
function
(
a
)
{
this
.
cur
=
$
.
map
(
this
.
cur
,
function
(
d
){
this
.
cur
=
$
.
map
(
this
.
cur
,
"d.parentNode"
);
return
d
.
parentNode
;
});
if
(
a
)
this
.
cur
=
$
.
filter
(
a
,
this
.
cur
).
r
;
if
(
a
)
this
.
cur
=
$
.
filter
(
a
,
this
.
cur
).
r
;
return
this
;
return
this
;
},
},
...
@@ -251,7 +240,7 @@ function $(a,c) {
...
@@ -251,7 +240,7 @@ function $(a,c) {
not
:
function
(
t
)
{
not
:
function
(
t
)
{
this
.
cur
=
t
.
constructor
==
String
?
this
.
cur
=
t
.
constructor
==
String
?
$
.
filter
(
t
,
this
.
cur
,
false
).
r
:
$
.
filter
(
t
,
this
.
cur
,
false
).
r
:
$
.
grep
(
this
.
cur
,
function
(
a
){
return
a
!=
t
;
});
$
.
grep
(
this
.
cur
,
function
(
a
){
return
a
!=
t
;
});
return
this
;
return
this
;
},
},
add
:
function
(
t
)
{
add
:
function
(
t
)
{
...
@@ -262,33 +251,42 @@ function $(a,c) {
...
@@ -262,33 +251,42 @@ function $(a,c) {
is
:
function
(
t
)
{
is
:
function
(
t
)
{
return
$
.
filter
(
t
,
this
.
cur
).
r
.
length
>
0
;
return
$
.
filter
(
t
,
this
.
cur
).
r
.
length
>
0
;
},
},
isNot
:
function
(
t
)
{
return
!
this
.
s
(
t
);
}
};
// TODO: Remove need to return this
/**
for
(
var
i
in
$
.
fn
)
{
* A wrapper function for each() to be used by append and prepend.
if
(
self
[
i
]
!==
null
)
* Handles cases where you're trying to modify the inner contents of
self
[
"_"
+
i
]
=
self
[
i
];
* a table, when you actually need to work with the tbody.
self
[
i
]
=
$
.
fn
[
i
];
*/
domManip
:
function
(
fn
){
return
this
.
each
(
function
(){
var
obj
=
this
;
if
(
this
.
nodeName
==
"TABLE"
)
{
var
tbody
=
this
.
getElementsByTagName
(
"tbody"
);
if
(
!
tbody
.
length
)
{
obj
=
document
.
createElement
(
"tbody"
);
this
.
appendChild
(
obj
);
}
else
obj
=
tbody
[
0
];
}
}
if
(
typeof
Prototype
!=
"undefined"
&&
$a
.
constructor
!=
String
)
{
fn
.
apply
(
obj
);
if
(
$c
)
$a
=
self
.
get
();
});
for
(
var
k
in
self
)
{(
function
(
j
){
try
{
if
(
!
$a
[
j
]
)
$a
[
j
]
=
function
()
{
return
$
.
apply
(
self
,
self
[
j
],
arguments
);
};
}
catch
(
e
)
{}
})(
k
);}
return
$a
;
}
}
};
return
self
;
$
.
class
=
{
}
add
:
function
(
o
,
c
){
if
(
$
.
hasWord
(
o
,
c
))
return
;
o
.
className
+=
(
o
.
className
.
length
>
0
?
" "
:
""
)
+
c
;
},
remove
:
function
(
o
,
c
){
o
.
className
=
!
c
?
""
:
o
.
className
.
replace
(
new
RegExp
(
"(^|
\\
s*
\\
b[^-])"
+
c
+
"($|
\\
b(?=[^-]))"
,
"g"
),
""
);
}
};
(
function
(){
(
function
(){
var
b
=
navigator
.
userAgent
.
toLowerCase
();
var
b
=
navigator
.
userAgent
.
toLowerCase
();
...
@@ -302,37 +300,21 @@ function $(a,c) {
...
@@ -302,37 +300,21 @@ function $(a,c) {
"other"
;
"other"
;
// Check to see if the W3C box model is being used
// Check to see if the W3C box model is being used
$
.
boxModel
=
(
$
.
browser
!=
"msie"
||
$
.
boxModel
=
(
$
.
browser
!=
"msie"
||
document
.
compatMode
==
"CSS1Compat"
);
document
.
compatMode
==
"CSS1Compat"
);
})();
})();
$
.
apply
=
function
(
o
,
f
,
a
)
{
$
.
css
=
function
(
e
,
p
)
{
a
=
a
||
[];
if
(
f
.
apply
)
return
f
.
apply
(
o
,
a
);
else
{
var
p
=
[];
for
(
var
i
=
0
;
i
<
a
.
length
;
i
++
)
p
[
i
]
=
'a['
+
i
+
']'
;
o
.
$$exec
=
this
;
var
r
=
eval
(
'o.$$exec('
+
p
.
join
(
','
)
+
')'
);
o
.
$$exec
=
null
;
return
r
;
}
};
$
.
getCSS
=
function
(
e
,
p
)
{
// Adapted from Prototype 1.4.0
// Adapted from Prototype 1.4.0
if
(
p
==
'height'
||
p
==
'width'
)
{
if
(
p
==
"height"
||
p
==
"width"
)
{
// Handle extra width/height provided by the W3C box model
// Handle extra width/height provided by the W3C box model
var
ph
=
(
!
$
.
boxModel
?
0
:
var
ph
=
(
!
$
.
boxModel
?
0
:
parseInt
(
$
.
css
(
e
,
"paddingTop"
))
+
parseInt
(
$
.
css
(
e
,
"paddingBottom"
)
)
+
$
.
css
(
e
,
"paddingTop"
)
+
$
.
css
(
e
,
"paddingBottom"
)
+
parseInt
(
$
.
css
(
e
,
"borderTopWidth"
))
+
parseInt
(
$
.
css
(
e
,
"borderBottomWidth"
)
))
||
0
;
$
.
css
(
e
,
"borderTopWidth"
)
+
$
.
css
(
e
,
"borderBottomWidth"
))
||
0
;
var
pw
=
(
!
$
.
boxModel
?
0
:
var
pw
=
(
!
$
.
boxModel
?
0
:
parseInt
(
$
.
css
(
e
,
"paddingLeft"
))
+
parseInt
(
$
.
css
(
e
,
"paddingRight"
)
)
+
$
.
css
(
e
,
"paddingLeft"
)
+
$
.
css
(
e
,
"paddingRight"
)
+
parseInt
(
$
.
css
(
e
,
"borderLeftWidth"
))
+
parseInt
(
$
.
css
(
e
,
"borderRightWidth"
)
))
||
0
;
$
.
css
(
e
,
"borderLeftWidth"
)
+
$
.
css
(
e
,
"borderRightWidth"
))
||
0
;
var
oHeight
,
oWidth
;
var
oHeight
,
oWidth
;
...
@@ -344,9 +326,9 @@ $.getCSS = function(e,p) {
...
@@ -344,9 +326,9 @@ $.getCSS = function(e,p) {
var
ov
=
els
.
visibility
;
var
ov
=
els
.
visibility
;
var
op
=
els
.
position
;
var
op
=
els
.
position
;
var
od
=
els
.
display
;
var
od
=
els
.
display
;
els
.
visibility
=
'hidden'
;
els
.
visibility
=
"hidden"
;
els
.
position
=
'absolute'
;
els
.
position
=
"absolute"
;
els
.
display
=
''
;
els
.
display
=
""
;
oHeight
=
e
.
clientHeight
||
parseInt
(
e
.
style
.
height
);
oHeight
=
e
.
clientHeight
||
parseInt
(
e
.
style
.
height
);
oWidth
=
e
.
clientWidth
||
parseInt
(
e
.
style
.
width
);
oWidth
=
e
.
clientWidth
||
parseInt
(
e
.
style
.
width
);
els
.
display
=
od
;
els
.
display
=
od
;
...
@@ -354,24 +336,25 @@ $.getCSS = function(e,p) {
...
@@ -354,24 +336,25 @@ $.getCSS = function(e,p) {
els
.
visibility
=
ov
;
els
.
visibility
=
ov
;
}
}
return
p
==
'height'
?
return
p
==
"height"
?
(
oHeight
-
ph
<
0
?
0
:
oHeight
-
ph
)
:
(
oHeight
-
ph
<
0
?
0
:
oHeight
-
ph
)
:
(
oWidth
-
pw
<
0
?
0
:
oWidth
-
pw
);
(
oWidth
-
pw
<
0
?
0
:
oWidth
-
pw
);
}
}
var
r
;
if
(
e
.
style
[
p
])
if
(
e
.
style
[
p
])
r
eturn
e
.
style
[
p
];
r
=
e
.
style
[
p
];
else
if
(
e
.
currentStyle
)
else
if
(
e
.
currentStyle
)
r
eturn
e
.
currentStyle
[
p
];
r
=
e
.
currentStyle
[
p
];
else
if
(
document
.
defaultView
&&
document
.
defaultView
.
getComputedStyle
)
{
else
if
(
document
.
defaultView
&&
document
.
defaultView
.
getComputedStyle
)
{
p
=
p
.
replace
(
/
([
A-Z
])
/g
,
"-$1"
).
toLowerCase
();
p
=
p
.
replace
(
/
([
A-Z
])
/g
,
"-$1"
).
toLowerCase
();
var
s
=
document
.
defaultView
.
getComputedStyle
(
e
,
""
);
var
s
=
document
.
defaultView
.
getComputedStyle
(
e
,
""
);
var
r
=
s
?
s
.
getPropertyValue
(
p
)
:
null
;
r
=
s
?
s
.
getPropertyValue
(
p
)
:
null
;
return
r
;
}
}
else
return
null
;
return
/top|right|left|bottom/i
.
test
(
p
)
?
parseFloat
(
r
)
:
r
;
};
};
$
.
css
=
$
.
getCSS
;
$
.
clean
=
function
(
a
)
{
$
.
clean
=
function
(
a
)
{
var
r
=
[];
var
r
=
[];
...
@@ -391,113 +374,94 @@ $.clean = function(a) {
...
@@ -391,113 +374,94 @@ $.clean = function(a) {
if
(
tr
||
td
)
{
if
(
tr
||
td
)
{
div
=
div
.
firstChild
.
firstChild
;
div
=
div
.
firstChild
.
firstChild
;
if
(
td
)
{
if
(
td
)
div
=
div
.
firstChild
;
div
=
div
.
firstChild
;
}
}
}
for
(
var
j
=
0
;
j
<
div
.
childNodes
.
length
;
j
++
)
{
for
(
var
j
=
0
;
j
<
div
.
childNodes
.
length
;
j
++
)
r
[
r
.
length
]
=
div
.
childNodes
[
j
];
r
[
r
.
length
]
=
div
.
childNodes
[
j
];
}
}
else
if
(
a
[
i
].
length
&&
!
a
[
i
].
nodeType
)
}
else
if
(
a
[
i
].
length
&&
!
a
[
i
].
nodeType
)
{
for
(
var
k
=
0
;
k
<
a
[
i
].
length
;
k
++
)
for
(
var
k
=
0
;
k
<
a
[
i
].
length
;
k
++
)
{
r
[
r
.
length
]
=
a
[
i
][
k
];
r
[
r
.
length
]
=
a
[
i
][
k
];
}
else
if
(
a
[
i
]
!==
null
)
}
else
if
(
a
[
i
]
!==
null
)
{
r
[
r
.
length
]
=
r
[
r
.
length
]
=
a
[
i
].
nodeType
?
a
[
i
]
:
document
.
createTextNode
(
a
[
i
].
toString
());
a
[
i
].
nodeType
?
a
[
i
]
:
document
.
createTextNode
(
a
[
i
].
toString
());
}
}
}
return
r
;
return
r
;
};
};
$
.
fn
=
{};
/**
* A wrapper function for each() to be used by append and prepend.
* Handles cases where you're trying to modify the inner contents of
* a table, when you actually need to work with the tbody.
*/
$
.
fn
.
domManip
=
function
(
fn
){
return
this
.
each
(
function
(){
var
obj
=
this
;
if
(
this
.
nodeName
==
'TABLE'
)
{
var
tbody
=
this
.
getElementsByTagName
(
"tbody"
);
if
(
!
tbody
.
length
)
{
obj
=
document
.
createElement
(
"tbody"
);
this
.
appendChild
(
obj
);
}
else
obj
=
tbody
[
0
];
}
$
.
apply
(
obj
,
fn
);
});
};
$
.
g
=
{
$
.
g
=
{
''
:
"m[2] == '*' || a.nodeName.toUpperCase() ==
m[2].toUpperCase()"
,
""
:
"m[2]== '*'||a.nodeName.toUpperCase()==
m[2].toUpperCase()"
,
'#'
:
"a.getAttribute('id') && a.getAttribute('id').nodeValue ==
m[2]"
,
"#"
:
"a.getAttribute('id')&&a.getAttribute('id')==
m[2]"
,
':'
:
{
":"
:
{
lt
:
"i
<
m[3]-0"
,
lt
:
"i
<
m[3]-0"
,
gt
:
"i
>
m[3]-0"
,
gt
:
"i
>
m[3]-0"
,
nth
:
"m[3]
- 0 ==
i"
,
nth
:
"m[3]
-0==
i"
,
eq
:
"m[3]
- 0 ==
i"
,
eq
:
"m[3]
-0==
i"
,
first
:
"i
==
0"
,
first
:
"i
==
0"
,
last
:
"i
== r.length -
1"
,
last
:
"i
==r.length-
1"
,
even
:
"i
% 2 ==
0"
,
even
:
"i
%2==
0"
,
odd
:
"i
% 2 ==
1"
,
odd
:
"i
%2==
1"
,
"first-child"
:
"$.sibling(a,0).cur"
,
"first-child"
:
"$.sibling(a,0).cur"
,
"nth-child"
:
"(m[3]
== 'even'?$.sibling(a,m[3]).n % 2 == 0 :(m[3] == 'odd'?$.sibling(a,m[3]).n % 2 ==
1:$.sibling(a,m[3]).cur))"
,
"nth-child"
:
"(m[3]
=='even'?$.sibling(a,m[3]).n%2==0:(m[3]=='odd'?$.sibling(a,m[3]).n%2==
1:$.sibling(a,m[3]).cur))"
,
"last-child"
:
"$.sibling(a,0,true).cur"
,
"last-child"
:
"$.sibling(a,0,true).cur"
,
"nth-last-child"
:
"$.sibling(a,m[3],true).cur"
,
"nth-last-child"
:
"$.sibling(a,m[3],true).cur"
,
"first-of-type"
:
"$.ofType(a,0)"
,
"first-of-type"
:
"$.ofType(a,0)"
,
"nth-of-type"
:
"$.ofType(a,m[3])"
,
"nth-of-type"
:
"$.ofType(a,m[3])"
,
"last-of-type"
:
"$.ofType(a,0,true)"
,
"last-of-type"
:
"$.ofType(a,0,true)"
,
"nth-last-of-type"
:
"$.ofType(a,m[3],true)"
,
"nth-last-of-type"
:
"$.ofType(a,m[3],true)"
,
"only-of-type"
:
"$.ofType(a)
==
1"
,
"only-of-type"
:
"$.ofType(a)
==
1"
,
"only-child"
:
"$.sibling(a).length
==
1"
,
"only-child"
:
"$.sibling(a).length
==
1"
,
parent
:
"a.childNodes.length
> 0
"
,
parent
:
"a.childNodes.length"
,
empty
:
"
a.childNodes.length == 0
"
,
empty
:
"
!a.childNodes.length
"
,
root
:
"a
== ( a.ownerDocument ? a.ownerDocument : document
).documentElement"
,
root
:
"a
==(a.ownerDocument||document
).documentElement"
,
contains
:
"(a.innerText
|| a.innerHTML).indexOf(m[3]) !=
-1"
,
contains
:
"(a.innerText
||a.innerHTML).indexOf(m[3])!=
-1"
,
visible
:
"(!a.type
|| a.type != 'hidden') && ($.getCSS(a,'display') != 'none' && $.getCSS(a,'visibility')
!= 'hidden')"
,
visible
:
"(!a.type
||a.type!='hidden')&&($.css(a,'display')!= 'none'&&$.css(a,'visibility')
!= 'hidden')"
,
hidden
:
"(a.type
&& a.type == 'hidden') || $.getCSS(a,'display') == 'none' || $.getCSS(a,'visibility')
== 'hidden'"
,
hidden
:
"(a.type
&&a.type == 'hidden')||$.css(a,'display')=='none'||$.css(a,'visibility')
== 'hidden'"
,
enabled
:
"a.disabled
==
false"
,
enabled
:
"a.disabled
==
false"
,
disabled
:
"a.disabled"
,
disabled
:
"a.disabled"
,
checked
:
"a.checked"
checked
:
"a.checked"
},
},
"."
:
"$.hasWord(a,m[2])"
,
"."
:
"$.hasWord(a,m[2])"
,
"@"
:
{
"@"
:
{
"="
:
"$.attr(a,m[3])
==
m[4]"
,
"="
:
"$.attr(a,m[3])
==
m[4]"
,
"!="
:
"$.attr(a,m[3])
!=
m[4]"
,
"!="
:
"$.attr(a,m[3])
!=
m[4]"
,
"~="
:
"$.hasWord($.attr(a,m[3]),m[4])"
,
"~="
:
"$.hasWord($.attr(a,m[3]),m[4])"
,
"|="
:
"
$.attr(a,m[3]).indexOf(m[4]) == 0
"
,
"|="
:
"
!$.attr(a,m[3]).indexOf(m[4])
"
,
"^="
:
"
$.attr(a,m[3]).indexOf(m[4]) == 0
"
,
"^="
:
"
!$.attr(a,m[3]).indexOf(m[4])
"
,
"$="
:
"$.attr(a,m[3]).substr( $.attr(a,m[3]).length - m[4].length,
m[4].length ) ==
m[4]"
,
"$="
:
"$.attr(a,m[3]).substr( $.attr(a,m[3]).length - m[4].length,
m[4].length )==
m[4]"
,
"*="
:
"$.attr(a,m[3]).indexOf(m[4])
>=
0"
,
"*="
:
"$.attr(a,m[3]).indexOf(m[4])
>=
0"
,
""
:
"m[3]
== '*' ? a.attributes.length > 0 :
$.attr(a,m[3])"
""
:
"m[3]
=='*'?a.attributes.length>0:
$.attr(a,m[3])"
},
},
"["
:
"$.Select(m[2],a).length
> 0
"
"["
:
"$.Select(m[2],a).length"
};
};
$
.
token
=
[
"
\\
.
\\
.|/
\\
.
\\
."
,
"a.parentNode"
,
">|/"
,
"$.sibling(a.firstChild)"
,
"
\\
+"
,
"$.sibling(a).next"
,
"~"
,
function
(
a
){
var
r
=
[];
var
s
=
$
.
sibling
(
a
);
if
(
s
.
n
>
0
)
for
(
var
i
=
s
.
n
;
i
<
s
.
length
;
i
++
)
r
[
r
.
length
]
=
s
[
i
];
return
r
;
}
];
$
.
Select
=
function
(
t
,
context
)
{
$
.
Select
=
function
(
t
,
context
)
{
context
=
context
||
$
.
context
||
document
;
context
=
context
||
$
.
context
||
document
;
if
(
t
.
constructor
!=
String
)
{
if
(
t
.
constructor
!=
String
)
return
[
t
];
return
[
t
];
}
if
(
t
.
indexOf
(
"//"
)
===
0
)
{
if
(
!
t
.
indexOf
(
"//"
)
)
{
context
=
context
.
documentElement
;
context
=
context
.
documentElement
;
t
=
t
.
substr
(
2
,
t
.
length
);
t
=
t
.
substr
(
2
,
t
.
length
);
}
else
if
(
t
.
indexOf
(
"/"
)
===
0
)
{
}
else
if
(
!
t
.
indexOf
(
"/"
)
)
{
context
=
context
.
documentElement
;
context
=
context
.
documentElement
;
t
=
t
.
substr
(
1
,
t
.
length
);
t
=
t
.
substr
(
1
,
t
.
length
);
// FIX Assume the root element is right :(
// FIX Assume the root element is right :(
if
(
t
.
indexOf
(
'/'
)
)
{
if
(
t
.
indexOf
(
"/"
)
>=
1
)
t
=
t
.
substr
(
t
.
indexOf
(
'/'
),
t
.
length
);
t
=
t
.
substr
(
t
.
indexOf
(
"/"
),
t
.
length
);
}
}
}
var
ret
=
[
context
];
var
ret
=
[
context
];
...
@@ -508,80 +472,45 @@ $.Select = function( t, context ) {
...
@@ -508,80 +472,45 @@ $.Select = function( t, context ) {
var
r
=
[];
var
r
=
[];
last
=
t
;
last
=
t
;
t
=
$
.
cleanSpaces
(
t
);
t
=
$
.
cleanSpaces
(
t
)
.
replace
(
/^
\/\/
/i
,
""
)
;
var
re
=
new
RegExp
(
"^//"
,
"i"
);
var
foundToken
=
false
;
t
=
t
.
replace
(
re
,
""
);
if
(
t
.
indexOf
(
'..'
)
===
0
||
t
.
indexOf
(
'/..'
)
===
0
)
{
for
(
var
i
=
0
;
i
<
$
.
token
.
length
;
i
+=
2
)
{
if
(
t
.
indexOf
(
'/'
)
===
0
)
{
var
re
=
new
RegExp
(
"^("
+
$
.
token
[
i
]
+
")"
);
t
=
t
.
substr
(
1
,
t
.
length
);
var
m
=
re
.
exec
(
t
);
}
r
=
$
.
map
(
ret
,
function
(
a
){
return
a
.
parentNode
;
}
);
if
(
m
)
{
t
=
t
.
substr
(
2
,
t
.
length
);
r
=
ret
=
$
.
map
(
ret
,
$
.
token
[
i
+
1
]
);
t
=
$
.
cleanSpaces
(
t
);
t
=
$
.
cleanSpaces
(
t
.
replace
(
re
,
""
)
);
}
else
if
(
t
.
indexOf
(
'>'
)
===
0
||
t
.
indexOf
(
'/'
)
===
0
)
{
foundToken
=
true
;
r
=
$
.
map
(
ret
,
function
(
a
){
return
(
a
.
childNodes
.
length
>
0
?
$
.
sibling
(
a
.
firstChild
)
:
null
);
}
);
t
=
t
.
substr
(
1
,
t
.
length
);
t
=
$
.
cleanSpaces
(
t
);
}
else
if
(
t
.
indexOf
(
'+'
)
===
0
)
{
r
=
$
.
map
(
ret
,
function
(
a
){
return
$
.
sibling
(
a
).
next
;
}
);
t
=
t
.
substr
(
1
,
t
.
length
);
t
=
$
.
cleanSpaces
(
t
);
}
else
if
(
t
.
indexOf
(
'~'
)
===
0
)
{
r
=
$
.
map
(
ret
,
function
(
a
){
var
r
=
[];
var
s
=
$
.
sibling
(
a
);
if
(
s
.
n
>
0
)
{
for
(
var
i
=
s
.
n
;
i
<
s
.
length
;
i
++
)
{
r
[
r
.
length
]
=
s
[
i
];
}
}
}
}
return
r
;
});
if
(
!
foundToken
)
{
t
=
t
.
substr
(
1
,
t
.
length
);
t
=
$
.
cleanSpaces
(
t
);
if
(
!
t
.
indexOf
(
","
)
||
!
t
.
indexOf
(
"|"
)
)
{
}
else
if
(
t
.
indexOf
(
','
)
===
0
||
t
.
indexOf
(
'|'
)
===
0
)
{
if
(
ret
[
0
]
==
context
)
ret
.
shift
();
if
(
ret
[
0
]
==
context
)
{
ret
.
shift
();
}
done
=
$
.
merge
(
done
,
ret
);
done
=
$
.
merge
(
done
,
ret
);
r
=
ret
=
[
context
];
r
=
ret
=
[
context
];
t
=
" "
+
t
.
substr
(
1
,
t
.
length
);
t
=
" "
+
t
.
substr
(
1
,
t
.
length
);
}
else
{
}
else
{
var
re2
=
new
RegExp
(
"^([#.]?)([a-z0-9
\\
*_-]*)"
,
"i"
)
;
var
re2
=
/^
([
#.
]?)([
a-z0-9
\\
*_-
]
*
)
/i
;
var
m
=
re2
.
exec
(
t
);
var
m
=
re2
.
exec
(
t
);
if
(
m
[
1
]
==
"#"
)
{
// Ummm, should make this work in all XML docs
if
(
m
[
1
]
==
"#"
)
{
// Ummm, should make this work in all XML docs
var
oid
=
document
.
getElementById
(
m
[
2
]);
var
oid
=
document
.
getElementById
(
m
[
2
]);
r
=
ret
=
oid
?
[
oid
]
:
[];
r
=
ret
=
oid
?
[
oid
]
:
[];
t
=
t
.
replace
(
re2
,
""
);
t
=
t
.
replace
(
re2
,
""
);
}
else
{
}
else
{
if
(
m
[
2
]
===
""
||
m
[
1
]
==
"."
)
{
m
[
2
]
=
"*"
;
}
if
(
!
m
[
2
]
||
m
[
1
]
==
"."
)
m
[
2
]
=
"*"
;
for
(
var
i
=
0
;
i
<
ret
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
ret
.
length
;
i
++
)
var
o
=
ret
[
i
];
r
=
$
.
merge
(
r
,
$
.
tag
(
ret
[
i
],
m
[
2
])
);
if
(
o
)
{
switch
(
m
[
2
]
)
{
case
'*'
:
r
=
$
.
merge
(
$
.
getAll
(
o
),
r
);
break
;
case
'text'
:
case
'radio'
:
case
'checkbox'
:
case
'hidden'
:
case
'button'
:
case
'submit'
:
case
'image'
:
case
'password'
:
case
'reset'
:
case
'file'
:
r
=
$
.
merge
(
$
.
grep
(
$
.
tag
(
o
,
"input"
),
function
(
a
){
return
a
.
type
==
m
[
2
];
}),
r
);
break
;
case
'input'
:
r
=
$
.
merge
(
$
.
tag
(
o
,
"input"
),
r
);
r
=
$
.
merge
(
$
.
tag
(
o
,
"select"
),
r
);
r
=
$
.
merge
(
$
.
tag
(
o
,
"textarea"
),
r
);
break
;
default
:
r
=
$
.
merge
(
r
,
$
.
tag
(
o
,
m
[
2
])
);
break
;
}
}
}
}
}
}
}
}
if
(
t
)
{
if
(
t
)
{
...
@@ -591,81 +520,76 @@ $.Select = function( t, context ) {
...
@@ -591,81 +520,76 @@ $.Select = function( t, context ) {
}
}
}
}
if
(
ret
&&
ret
[
0
]
==
context
)
{
ret
.
shift
();
}
if
(
ret
&&
ret
[
0
]
==
context
)
ret
.
shift
();
done
=
$
.
merge
(
done
,
ret
);
done
=
$
.
merge
(
done
,
ret
);
return
done
;
return
done
;
};
};
$
.
tag
=
function
(
a
,
b
){
$
.
tag
=
function
(
a
,
b
){
return
a
&&
typeof
a
.
getElementsByTagName
!=
'undefined'
?
return
a
&&
a
.
getElementsByTagName
!=
undefined
?
a
.
getElementsByTagName
(
b
)
:
[];
a
.
getElementsByTagName
(
b
)
:
[];
};
};
$
.
attr
=
function
(
o
,
a
,
v
){
$
.
attr
=
function
(
o
,
a
,
v
){
if
(
a
&&
a
.
constructor
==
String
)
{
if
(
a
&&
a
.
constructor
==
String
)
{
var
fix
=
{
var
fix
=
{
'for'
:
'htmlFor'
,
"for"
:
"htmlFor"
,
'text'
:
'cssText'
,
"class"
:
"className"
,
'class'
:
'className'
,
"float"
:
"cssFloat"
'float'
:
'cssFloat'
};
};
a
=
(
fix
[
a
]
&&
fix
[
a
].
replace
&&
fix
[
a
])
||
a
;
a
=
(
fix
[
a
]
&&
fix
[
a
].
replace
&&
fix
[
a
])
||
a
;
var
r
=
new
RegExp
(
"-([a-z])"
,
"ig"
)
;
var
r
=
/-
([
a-z
])
/ig
;
a
=
a
.
replace
(
r
,
function
(
z
,
b
){
return
b
.
toUpperCase
();});
a
=
a
.
replace
(
r
,
function
(
z
,
b
){
return
b
.
toUpperCase
();});
if
(
typeof
v
!=
'undefined'
)
{
if
(
v
!=
undefined
)
{
o
[
a
]
=
v
;
o
[
a
]
=
v
;
if
(
o
.
setAttribute
&&
a
!=
'disabled'
)
{
if
(
o
.
setAttribute
&&
a
!=
"disabled"
)
o
.
setAttribute
(
a
,
v
);
o
.
setAttribute
(
a
,
v
);
}
}
}
return
o
[
a
]
||
o
.
getAttribute
(
a
)
||
""
;
return
o
[
a
]
||
o
.
getAttribute
(
a
)
||
''
;
}
else
}
else
{
return
""
;
return
''
;
}
};
};
$
.
filter
=
function
(
t
,
r
,
not
)
{
$
.
filter
=
function
(
t
,
r
,
not
)
{
var
g
=
$
.
grep
;
var
g
=
$
.
grep
;
if
(
not
===
false
)
{
if
(
not
===
false
)
g
=
function
(
a
,
f
)
{
return
$
.
grep
(
a
,
f
,
true
);};
g
=
function
(
a
,
f
)
{
return
$
.
grep
(
a
,
f
,
true
);};
}
while
(
t
.
length
>
0
&&
t
.
match
(
/^
[
:
\\
.#
\\
[a-zA-Z
\\
*
]
/
)
)
{
while
(
t
&&
t
.
match
(
/^
[
:
\\
.#
\\
[a-zA-Z
\\
*
]
/
)
)
{
var
re
=
new
RegExp
(
"^
\\
[ *@([a-z0-9
\\
*
\\
(
\\
)_-]+) *([~!
\\
|
\\
*$^=]*) *'?
\"
?([^'
\"
]*)'?
\"
? *
\\
]"
,
"i"
)
;
var
re
=
/^
\[
*@
([
a-z0-9*()_-
]
+
)
*
([
~!|*$^=
]
*
)
*'
?
"
?([^
'"
]
*
)
'
?
"
?
*
\]
/i
;
var
m
=
re
.
exec
(
t
);
var
m
=
re
.
exec
(
t
);
if
(
m
!==
null
)
{
if
(
m
)
m
=
[
''
,
'@'
,
m
[
2
],
m
[
1
],
m
[
3
]];
m
=
[
""
,
"@"
,
m
[
2
],
m
[
1
],
m
[
3
]];
}
else
{
else
{
re
=
new
RegExp
(
"^(
\\
[) *([^
\\
]]*) *
\\
]"
,
"i"
)
;
re
=
/^
(\[)
*
([^\]]
*
)
*
\]
/i
;
m
=
re
.
exec
(
t
);
m
=
re
.
exec
(
t
);
if
(
m
===
null
)
{
if
(
!
m
)
{
re
=
new
RegExp
(
"^(:)([a-z0-9
\\
*_-]*)
\\
( *[
\"
']?([^
\\
)'
\"
]*)['
\"
]? *
\\
)"
,
"i"
)
;
re
=
/^
(
:
)([
a-z0-9*_-
]
*
)\(
*
[
"'
]?([^
\)
'"
]
*
)[
'"
]?
*
\)
/i
;
m
=
re
.
exec
(
t
);
m
=
re
.
exec
(
t
);
if
(
m
===
null
)
{
if
(
!
m
)
{
re
=
new
RegExp
(
"^([:
\\
.#]*)([a-z0-9
\\
*_-]*)"
,
"i"
)
;
re
=
/^
([
:
\.
#
]
*
)([
a-z0-9*_-
]
*
)
/i
;
m
=
re
.
exec
(
t
);
m
=
re
.
exec
(
t
);
}
}
}
}
}
}
t
=
t
.
replace
(
re
,
""
);
t
=
t
.
replace
(
re
,
""
);
if
(
m
[
1
]
==
":"
&&
m
[
2
]
==
"not"
)
{
if
(
m
[
1
]
==
":"
&&
m
[
2
]
==
"not"
)
r
=
$
.
filter
(
m
[
3
],
r
,
false
).
r
;
r
=
$
.
filter
(
m
[
3
],
r
,
false
).
r
;
}
else
{
else
{
var
f
=
null
;
var
f
=
null
;
if
(
$
.
g
[
m
[
1
]].
constructor
==
String
)
{
if
(
$
.
g
[
m
[
1
]].
constructor
==
String
)
f
=
$
.
g
[
m
[
1
]];
f
=
$
.
g
[
m
[
1
]];
}
else
if
(
$
.
g
[
m
[
1
]][
m
[
2
]]
)
{
else
if
(
$
.
g
[
m
[
1
]][
m
[
2
]]
)
f
=
$
.
g
[
m
[
1
]][
m
[
2
]];
f
=
$
.
g
[
m
[
1
]][
m
[
2
]];
}
if
(
f
!==
null
)
{
if
(
f
)
{
eval
(
'f = function(a,i){return '
+
f
+
'}'
);
eval
(
"f = function(a,i){return "
+
f
+
"}"
);
r
=
g
(
r
,
f
);
r
=
g
(
r
,
f
);
}
}
}
}
...
@@ -677,7 +601,7 @@ $.filter = function(t,r,not) {
...
@@ -677,7 +601,7 @@ $.filter = function(t,r,not) {
$
.
parents
=
function
(
a
){
$
.
parents
=
function
(
a
){
var
b
=
[];
var
b
=
[];
var
c
=
a
.
parentNode
;
var
c
=
a
.
parentNode
;
while
(
c
!==
null
&&
c
!=
document
)
{
while
(
c
&&
c
!=
document
)
{
b
[
b
.
length
]
=
c
;
b
[
b
.
length
]
=
c
;
c
=
c
.
parentNode
;
c
=
c
.
parentNode
;
}
}
...
@@ -685,27 +609,25 @@ $.parents = function(a){
...
@@ -685,27 +609,25 @@ $.parents = function(a){
};
};
$
.
cleanSpaces
=
function
(
t
){
$
.
cleanSpaces
=
function
(
t
){
return
t
.
replace
(
/^
\s
+|
\s
+$/g
,
''
);
return
t
.
replace
(
/^
\s
+|
\s
+$/g
,
""
);
};
};
$
.
ofType
=
function
(
a
,
n
,
e
)
{
$
.
ofType
=
function
(
a
,
n
,
e
)
{
var
t
=
$
.
grep
(
$
.
sibling
(
a
),
function
(
b
){
return
b
.
nodeName
==
a
.
nodeName
;
});
var
t
=
$
.
grep
(
$
.
sibling
(
a
),
function
(
b
){
return
b
.
nodeName
==
a
.
nodeName
;
});
if
(
e
)
{
n
=
t
.
length
-
n
-
1
;
}
if
(
e
)
n
=
t
.
length
-
n
-
1
;
return
typeof
n
!=
'undefined'
?
t
[
n
]
==
a
:
t
.
length
;
return
n
!=
undefined
?
t
[
n
]
==
a
:
t
.
length
;
};
};
$
.
sibling
=
function
(
a
,
n
,
e
)
{
$
.
sibling
=
function
(
a
,
n
,
e
)
{
var
type
=
[];
var
type
=
[];
var
tmp
=
a
.
parentNode
.
childNodes
;
var
tmp
=
a
.
parentNode
.
childNodes
;
for
(
var
i
=
0
;
i
<
tmp
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
tmp
.
length
;
i
++
)
{
if
(
tmp
[
i
].
nodeType
==
1
)
{
if
(
tmp
[
i
].
nodeType
==
1
)
type
[
type
.
length
]
=
tmp
[
i
];
type
[
type
.
length
]
=
tmp
[
i
];
}
if
(
tmp
[
i
]
==
a
)
if
(
tmp
[
i
]
==
a
)
{
type
.
n
=
type
.
length
-
1
;
type
.
n
=
type
.
length
-
1
;
}
}
}
if
(
e
)
n
=
type
.
length
-
n
-
1
;
if
(
e
)
{
n
=
type
.
length
-
n
-
1
;
}
type
.
cur
=
(
type
[
n
]
==
a
);
type
.
cur
=
(
type
[
n
]
==
a
);
type
.
prev
=
(
type
.
n
>
0
?
type
[
type
.
n
-
1
]
:
null
);
type
.
prev
=
(
type
.
n
>
0
?
type
[
type
.
n
-
1
]
:
null
);
type
.
next
=
(
type
.
n
<
type
.
length
-
1
?
type
[
type
.
n
+
1
]
:
null
);
type
.
next
=
(
type
.
n
<
type
.
length
-
1
?
type
[
type
.
n
+
1
]
:
null
);
...
@@ -713,60 +635,57 @@ $.sibling = function(a,n,e) {
...
@@ -713,60 +635,57 @@ $.sibling = function(a,n,e) {
};
};
$
.
hasWord
=
function
(
e
,
a
)
{
$
.
hasWord
=
function
(
e
,
a
)
{
if
(
typeof
e
==
'undefined'
)
{
return
false
;
}
if
(
e
==
undefined
)
return
;
if
(
e
.
className
!==
null
)
{
e
=
e
.
className
;
}
if
(
e
.
className
)
e
=
e
.
className
;
return
new
RegExp
(
"(^|
\\
s)"
+
a
+
"(
\\
s|$)"
).
test
(
e
);
return
new
RegExp
(
"(^|
\\
s)"
+
a
+
"(
\\
s|$)"
).
test
(
e
);
};
};
$
.
getAll
=
function
(
o
,
r
)
{
$
.
getAll
=
function
(
o
,
r
)
{
r
=
r
||
[];
r
=
r
||
[];
var
s
=
o
.
childNodes
;
var
s
=
o
.
childNodes
;
for
(
var
i
=
0
;
i
<
s
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
s
.
length
;
i
++
)
if
(
s
[
i
].
nodeType
==
1
)
{
if
(
s
[
i
].
nodeType
==
1
)
{
r
[
r
.
length
]
=
s
[
i
];
r
[
r
.
length
]
=
s
[
i
];
$
.
getAll
(
s
[
i
],
r
);
$
.
getAll
(
s
[
i
],
r
);
}
}
}
return
r
;
return
r
;
};
};
$
.
merge
=
function
(
a
,
b
)
{
$
.
merge
=
function
(
a
,
b
)
{
var
d
=
[];
var
d
=
[];
for
(
var
k
=
0
;
k
<
b
.
length
;
k
++
)
{
d
[
k
]
=
b
[
k
];
}
for
(
var
k
=
0
;
k
<
b
.
length
;
k
++
)
d
[
k
]
=
b
[
k
];
for
(
var
i
=
0
;
i
<
a
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
a
.
length
;
i
++
)
{
var
c
=
true
;
var
c
=
true
;
for
(
var
j
=
0
;
j
<
b
.
length
;
j
++
)
{
for
(
var
j
=
0
;
j
<
b
.
length
;
j
++
)
if
(
a
[
i
]
==
b
[
j
]
)
{
if
(
a
[
i
]
==
b
[
j
]
)
c
=
false
;
c
=
false
;
}
if
(
c
)
d
[
d
.
length
]
=
a
[
i
];
}
if
(
c
)
{
d
[
d
.
length
]
=
a
[
i
];
}
}
}
return
d
;
return
d
;
};
};
$
.
grep
=
function
(
a
,
f
,
s
)
{
$
.
grep
=
function
(
a
,
f
,
s
)
{
if
(
f
.
constructor
==
String
)
f
=
new
Function
(
"a"
,
"i"
,
"return "
+
f
);
var
r
=
[];
var
r
=
[];
if
(
typeof
a
!=
'undefined'
)
{
if
(
a
!=
undefined
)
for
(
var
i
=
0
;
i
<
a
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
a
.
length
;
i
++
)
if
(
(
!
s
&&
f
(
a
[
i
],
i
))
||
(
s
&&
!
f
(
a
[
i
],
i
))
)
{
if
(
(
!
s
&&
f
(
a
[
i
],
i
))
||
(
s
&&
!
f
(
a
[
i
],
i
))
)
r
[
r
.
length
]
=
a
[
i
];
r
[
r
.
length
]
=
a
[
i
];
}
}
}
return
r
;
return
r
;
};
};
$
.
map
=
function
(
a
,
f
)
{
$
.
map
=
function
(
a
,
f
)
{
if
(
f
.
constructor
==
String
)
f
=
new
Function
(
"a"
,
"return "
+
f
);
var
r
=
[];
var
r
=
[];
for
(
var
i
=
0
;
i
<
a
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
a
.
length
;
i
++
)
{
var
t
=
f
(
a
[
i
],
i
);
var
t
=
f
(
a
[
i
],
i
);
if
(
t
!==
null
)
{
if
(
t
!==
null
)
{
if
(
t
.
constructor
!=
Array
)
{
t
=
[
t
];
}
if
(
t
.
constructor
!=
Array
)
t
=
[
t
];
r
=
$
.
merge
(
t
,
r
);
r
=
$
.
merge
(
t
,
r
);
}
}
}
}
...
@@ -780,19 +699,17 @@ $.event = {};
...
@@ -780,19 +699,17 @@ $.event = {};
$
.
event
.
add
=
function
(
element
,
type
,
handler
)
{
$
.
event
.
add
=
function
(
element
,
type
,
handler
)
{
// For whatever reason, IE has trouble passing the window object
// For whatever reason, IE has trouble passing the window object
// around, causing it to be cloned in the process
// around, causing it to be cloned in the process
if
(
$
.
browser
==
"msie"
&&
typeof
element
.
setInterval
!=
"undefined"
)
{
if
(
$
.
browser
==
"msie"
&&
element
.
setInterval
!=
undefined
)
element
=
window
;
element
=
window
;
}
if
(
!
handler
.
$$guid
)
{
handler
.
$$guid
=
$
.
event
.
add
.
guid
++
;
}
if
(
!
handler
.
$$guid
)
handler
.
$$guid
=
$
.
event
.
add
.
guid
++
;
if
(
!
element
.
events
)
{
element
.
events
=
{};
}
if
(
!
element
.
events
)
element
.
events
=
{};
var
handlers
=
element
.
events
[
type
];
var
handlers
=
element
.
events
[
type
];
if
(
!
handlers
)
{
if
(
!
handlers
)
{
handlers
=
element
.
events
[
type
]
=
{};
handlers
=
element
.
events
[
type
]
=
{};
if
(
element
[
"on"
+
type
])
{
if
(
element
[
"on"
+
type
])
handlers
[
0
]
=
element
[
"on"
+
type
];
handlers
[
0
]
=
element
[
"on"
+
type
];
}
}
}
handlers
[
handler
.
$$guid
]
=
handler
;
handlers
[
handler
.
$$guid
]
=
handler
;
element
[
"on"
+
type
]
=
$
.
event
.
handle
;
element
[
"on"
+
type
]
=
$
.
event
.
handle
;
};
};
...
@@ -801,39 +718,32 @@ $.event.add.guid = 1;
...
@@ -801,39 +718,32 @@ $.event.add.guid = 1;
// Detach an event or set of events from an element
// Detach an event or set of events from an element
$
.
event
.
remove
=
function
(
element
,
type
,
handler
)
{
$
.
event
.
remove
=
function
(
element
,
type
,
handler
)
{
if
(
element
.
events
)
{
if
(
element
.
events
)
if
(
type
&&
element
.
events
[
type
])
{
if
(
type
&&
element
.
events
[
type
])
if
(
handler
)
{
if
(
handler
)
delete
element
.
events
[
type
][
handler
.
$$guid
];
delete
element
.
events
[
type
][
handler
.
$$guid
];
}
else
{
else
for
(
var
i
in
element
.
events
[
type
]
)
{
for
(
var
i
in
element
.
events
[
type
]
)
delete
element
.
events
[
type
][
i
];
delete
element
.
events
[
type
][
i
];
}
else
}
for
(
var
j
in
element
.
events
)
}
else
{
for
(
var
j
in
element
.
events
)
{
$
.
event
.
remove
(
element
,
j
);
$
.
event
.
remove
(
element
,
j
);
}
}
}
};
};
$
.
event
.
trigger
=
function
(
element
,
type
,
data
)
{
$
.
event
.
trigger
=
function
(
element
,
type
,
data
)
{
data
=
data
||
[
$
.
event
.
fix
({
type
:
type
})
];
data
=
data
||
[
$
.
event
.
fix
({
type
:
type
})
];
if
(
element
&&
element
[
"on"
+
type
]
)
{
if
(
element
&&
element
[
"on"
+
type
]
)
$
.
apply
(
element
,
element
[
"on"
+
type
],
data
);
element
[
"on"
+
type
].
apply
(
element
,
data
);
}
};
};
$
.
event
.
handle
=
function
(
event
)
{
$
.
event
.
handle
=
function
(
event
)
{
if
(
!
event
&&
!
window
.
event
)
{
return
null
;
}
if
(
!
event
&&
!
window
.
event
)
return
;
var
returnValue
=
true
,
handlers
=
[];
var
returnValue
=
true
,
handlers
=
[];
event
=
event
||
$
.
event
.
fix
(
window
.
event
);
event
=
event
||
$
.
event
.
fix
(
window
.
event
);
for
(
var
j
in
this
.
events
[
event
.
type
]
)
{
for
(
var
j
in
this
.
events
[
event
.
type
]
)
handlers
[
handlers
.
length
]
=
this
.
events
[
event
.
type
][
j
];
handlers
[
handlers
.
length
]
=
this
.
events
[
event
.
type
][
j
];
}
for
(
var
i
=
0
;
i
<
handlers
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
handlers
.
length
;
i
++
)
{
if
(
handlers
[
i
].
constructor
==
Function
)
{
if
(
handlers
[
i
].
constructor
==
Function
)
{
...
@@ -861,23 +771,3 @@ $.event.fix.preventDefault = function() {
...
@@ -861,23 +771,3 @@ $.event.fix.preventDefault = function() {
$
.
event
.
fix
.
stopPropagation
=
function
()
{
$
.
event
.
fix
.
stopPropagation
=
function
()
{
this
.
cancelBubble
=
true
;
this
.
cancelBubble
=
true
;
};
};
// Move to module
$
.
fn
.
text
=
function
(
e
)
{
e
=
e
||
this
.
cur
;
var
t
=
""
;
for
(
var
j
=
0
;
j
<
e
.
length
;
j
++
)
{
for
(
var
i
=
0
;
i
<
e
[
j
].
childNodes
.
length
;
i
++
)
{
t
+=
e
[
j
].
childNodes
[
i
].
nodeType
!=
1
?
e
[
j
].
childNodes
[
i
].
nodeValue
:
$
.
fn
.
text
(
e
[
j
].
childNodes
[
i
].
childNodes
);
}
}
return
t
;
};
/*setTimeout(function(){
if ( typeof Prototype != "undefined" && $.g == null && $.clean == null )
throw "Error: You are overwriting jQuery, please include jQuery last.";
}, 1000);*/
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