Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
8926b0a8
Commit
8926b0a8
authored
Apr 11, 2010
by
webchick
Browse files
#724642
by casey: Upgrade jQuery BBQ library to 1.2.1.
parent
bdb7e561
Changes
3
Show whitespace changes
Inline
Side-by-side
misc/jquery.ba-bbq.js
View file @
8926b0a8
// $Id$
/*
* jQuery BBQ: Back Button & Query Library - v1.
0.2
-
10
/1
0
/200
9
* jQuery BBQ: Back Button & Query Library - v1.
2.1
-
2
/1
7
/20
1
0
* http://benalman.com/projects/jquery-bbq-plugin/
*
* Copyright (c) 200
9
"Cowboy" Ben Alman
* Copyright (c) 20
1
0 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(
function
(
$
,
c
){
var
g
,
k
=
document
.
location
,
i
=
Array
.
prototype
.
slice
,
E
=
decodeURIComponent
,
a
=
$
.
param
,
m
,
d
,
p
,
n
=
$
.
bbq
=
$
.
bbq
||
{},
o
,
e
,
z
,
b
=
"
hashchange
"
,
v
=
"
querystring
"
,
y
=
"
fragment
"
,
q
=
"
hash
"
,
x
=
"
elemUrlAttr
"
,
h
=
"
href
"
,
D
=
"
src
"
,
C
=
$
.
browser
,
l
=
C
.
msie
&&
C
.
version
<
8
,
j
=
"
on
"
+
b
in
c
&&!
l
,
r
=
/^.*
\?
|#.*$/g
,
A
=
/^.*
\#
/
,
t
=
{};
function
s
(
F
){
return
typeof
F
===
"
string
"
}
function
w
(
G
){
var
F
=
i
.
call
(
arguments
,
1
);
return
function
(){
return
G
.
apply
(
this
,
F
.
concat
(
i
.
call
(
arguments
)))}}
function
f
(
G
,
O
,
F
,
H
,
K
){
var
M
,
L
,
J
,
N
,
I
;
if
(
H
!==
g
){
J
=
F
.
match
(
G
?
/^
([^
#
]
*
)\#?(
.*
)
$/
:
/^
([^
#?
]
*
)\??([^
#
]
*
)(
#
?
.*
)
/
);
I
=
J
[
3
]
||
""
;
if
(
K
===
2
&&
s
(
H
)){
L
=
H
.
replace
(
O
,
""
)}
else
{
N
=
d
(
J
[
2
]);
H
=
s
(
H
)?
d
[
G
?
y
:
v
](
H
):
H
;
L
=
K
===
2
?
H
:
K
===
1
?
$
.
extend
({},
H
,
N
):
$
.
extend
({},
N
,
H
);
L
=
a
(
L
)}
M
=
J
[
1
]
+
(
G
?
"
#
"
:
L
||!
J
[
1
]?
"
?
"
:
""
)
+
L
+
I
}
else
{
if
(
F
){
M
=
F
.
replace
(
O
,
""
)}
else
{
M
=
G
?
k
[
q
]?
k
[
h
].
replace
(
O
,
""
):
""
:
k
.
search
.
replace
(
/^
\??
/
,
""
)}}
return
M
}
a
[
v
]
=
w
(
f
,
0
,
r
);
a
[
y
]
=
m
=
w
(
f
,
1
,
A
);
$
.
deparam
=
d
=
function
(
I
,
G
){
var
H
=
{},
F
=
{
"
true
"
:
!
0
,
"
false
"
:
!
1
,
"
null
"
:
null
};
$
.
each
(
I
.
replace
(
/
\+
/g
,
"
"
).
split
(
"
&
"
),
function
(
M
,
O
){
var
L
=
O
.
split
(
"
=
"
),
P
=
E
(
L
[
0
]),
K
,
Q
=
H
,
N
=
0
,
R
=
P
.
split
(
"
][
"
),
J
=
R
.
length
-
1
;
if
(
/
\[
/
.
test
(
R
[
0
])
&&
/
\]
$/
.
test
(
R
[
J
])){
R
[
J
]
=
R
[
J
].
replace
(
/
\]
$/
,
""
);
R
=
R
.
shift
().
split
(
"
[
"
).
concat
(
R
);
J
=
R
.
length
-
1
}
else
{
J
=
0
}
if
(
L
.
length
===
2
){
K
=
E
(
L
[
1
]);
if
(
G
){
K
=
K
&&!
isNaN
(
K
)?
+
K
:
K
===
"
undefined
"
?
g
:
F
[
K
]
!==
g
?
F
[
K
]:
K
}
if
(
J
){
for
(;
N
<=
J
;
N
++
){
P
=
R
[
N
]
===
""
?
Q
.
length
:
R
[
N
];
Q
=
Q
[
P
]
=
N
<
J
?
Q
[
P
]
||
(
R
[
N
+
1
]
&&
isNaN
(
R
[
N
+
1
])?{}:[]):
K
}}
else
{
if
(
$
.
isArray
(
H
[
P
])){
H
[
P
].
push
(
K
)}
else
{
if
(
H
[
P
]
!==
g
){
H
[
P
]
=
[
H
[
P
],
K
]}
else
{
H
[
P
]
=
K
}}}}
else
{
if
(
P
){
H
[
P
]
=
G
?
g
:
""
}}});
return
H
};
function
u
(
I
,
H
,
G
,
F
){
if
(
G
===
g
||
typeof
G
===
"
boolean
"
){
F
=
G
;
G
=
a
[
I
]()}
else
{
G
=
s
(
G
)?
G
.
replace
(
H
,
""
):
G
}
return
d
(
G
,
F
)}
d
[
v
]
=
w
(
u
,
v
,
r
);
d
[
y
]
=
p
=
w
(
u
,
y
,
A
);
$
[
x
]
||
(
$
[
x
]
=
function
(
F
){
return
$
.
extend
(
t
,
F
)})({
a
:
h
,
base
:
h
,
iframe
:
D
,
img
:
D
,
input
:
D
,
form
:
"
action
"
,
link
:
h
,
script
:
D
});
e
=
$
[
x
];
function
B
(
I
,
F
,
H
,
G
){
if
(
!
s
(
H
)
&&
typeof
H
!==
"
object
"
){
G
=
H
;
H
=
F
;
F
=
g
}
return
this
.
each
(
function
(){
var
L
=
$
(
this
),
J
=
F
||
e
()[(
this
.
nodeName
||
""
).
toLowerCase
()]
||
""
,
K
=
J
&&
L
.
attr
(
J
)
||
""
;
L
.
attr
(
J
,
a
[
I
](
K
,
H
,
G
))})}
$
.
fn
[
v
]
=
w
(
B
,
v
);
$
.
fn
[
y
]
=
w
(
B
,
y
);
n
.
pushState
=
o
=
function
(
I
,
H
){
if
(
s
(
I
)
&&
/^#/
.
test
(
I
)
&&
H
===
g
){
H
=
2
}
var
G
=
I
!==
g
,
F
=
m
(
k
[
h
],
G
?
I
:{},
G
?
H
:
2
);
k
[
h
]
=
F
+
(
/#/
.
test
(
F
)?
""
:
"
#
"
)};
n
.
getState
=
function
(
G
,
F
){
return
G
===
g
||
typeof
G
===
"
boolean
"
?
p
(
G
):
p
(
F
)[
G
]};
n
.
pollDelay
=
100
;
$
.
event
.
special
[
b
]
=
{
setup
:
function
(){
if
(
j
){
return
false
}
z
.
start
()},
teardown
:
function
(){
if
(
j
){
return
false
}
z
.
stop
()},
add
:
function
(
F
,
H
,
G
){
return
function
(
J
){
var
I
=
J
[
y
]
=
m
();
J
.
getState
=
function
(
L
,
K
){
return
L
===
g
||
typeof
L
===
"
boolean
"
?
d
(
I
,
L
):
d
(
I
,
K
)[
L
]};
F
.
apply
(
this
,
arguments
)}}};
z
=
(
function
(){
var
G
=
{},
K
,
F
,
H
,
J
;
function
I
(){
H
=
J
=
function
(
L
){
return
L
};
if
(
l
){
F
=
$
(
'
<iframe src="javascript:0"/>
'
).
hide
().
appendTo
(
"
body
"
)[
0
].
contentWindow
;
J
=
function
(){
return
F
.
document
.
location
[
q
].
replace
(
/^#/
,
""
)};
H
=
function
(
N
,
L
){
if
(
N
!==
L
){
var
M
=
F
.
document
;
M
.
open
();
M
.
close
();
M
.
location
[
q
]
=
"
#
"
+
N
}};
H
(
m
())}}
G
.
start
=
function
(){
if
(
K
){
return
}
var
M
=
m
();
H
||
I
();(
function
L
(){
var
O
=
m
(),
N
=
J
(
M
);
if
(
O
!==
M
){
H
(
M
=
O
,
N
);
$
(
c
).
trigger
(
b
)}
else
{
if
(
N
!==
M
){
o
(
"
#
"
+
N
)}}
K
=
setTimeout
(
L
,
n
.
pollDelay
)})()};
G
.
stop
=
function
(){
if
(
!
F
){
K
&&
clearTimeout
(
K
);
K
=
0
}};
return
G
})()})(
jQuery
,
this
);
\ No newline at end of file
(
function
(
$
,
p
){
var
i
,
m
=
Array
.
prototype
.
slice
,
r
=
decodeURIComponent
,
a
=
$
.
param
,
c
,
l
,
v
,
b
=
$
.
bbq
=
$
.
bbq
||
{},
q
,
u
,
j
,
e
=
$
.
event
.
special
,
d
=
"
hashchange
"
,
A
=
"
querystring
"
,
D
=
"
fragment
"
,
y
=
"
elemUrlAttr
"
,
g
=
"
location
"
,
k
=
"
href
"
,
t
=
"
src
"
,
x
=
/^.*
\?
|#.*$/g
,
w
=
/^.*
\#
/
,
h
,
C
=
{};
function
E
(
F
){
return
typeof
F
===
"
string
"
}
function
B
(
G
){
var
F
=
m
.
call
(
arguments
,
1
);
return
function
(){
return
G
.
apply
(
this
,
F
.
concat
(
m
.
call
(
arguments
)))}}
function
n
(
F
){
return
F
.
replace
(
/^
[^
#
]
*#
?(
.*
)
$/
,
"
$1
"
)}
function
o
(
F
){
return
F
.
replace
(
/
(?:
^
[^
?#
]
*
\?([^
#
]
*
)
.*$
)?
.*/
,
"
$1
"
)}
function
f
(
H
,
M
,
F
,
I
,
G
){
var
O
,
L
,
K
,
N
,
J
;
if
(
I
!==
i
){
K
=
F
.
match
(
H
?
/^
([^
#
]
*
)\#?(
.*
)
$/
:
/^
([^
#?
]
*
)\??([^
#
]
*
)(
#
?
.*
)
/
);
J
=
K
[
3
]
||
""
;
if
(
G
===
2
&&
E
(
I
)){
L
=
I
.
replace
(
H
?
w
:
x
,
""
)}
else
{
N
=
l
(
K
[
2
]);
I
=
E
(
I
)?
l
[
H
?
D
:
A
](
I
):
I
;
L
=
G
===
2
?
I
:
G
===
1
?
$
.
extend
({},
I
,
N
):
$
.
extend
({},
N
,
I
);
L
=
a
(
L
);
if
(
H
){
L
=
L
.
replace
(
h
,
r
)}}
O
=
K
[
1
]
+
(
H
?
"
#
"
:
L
||!
K
[
1
]?
"
?
"
:
""
)
+
L
+
J
}
else
{
O
=
M
(
F
!==
i
?
F
:
p
[
g
][
k
])}
return
O
}
a
[
A
]
=
B
(
f
,
0
,
o
);
a
[
D
]
=
c
=
B
(
f
,
1
,
n
);
c
.
noEscape
=
function
(
G
){
G
=
G
||
""
;
var
F
=
$
.
map
(
G
.
split
(
""
),
encodeURIComponent
);
h
=
new
RegExp
(
F
.
join
(
"
|
"
),
"
g
"
)};
c
.
noEscape
(
"
,/
"
);
$
.
deparam
=
l
=
function
(
I
,
F
){
var
H
=
{},
G
=
{
"
true
"
:
!
0
,
"
false
"
:
!
1
,
"
null
"
:
null
};
$
.
each
(
I
.
replace
(
/
\+
/g
,
"
"
).
split
(
"
&
"
),
function
(
L
,
Q
){
var
K
=
Q
.
split
(
"
=
"
),
P
=
r
(
K
[
0
]),
J
,
O
=
H
,
M
=
0
,
R
=
P
.
split
(
"
][
"
),
N
=
R
.
length
-
1
;
if
(
/
\[
/
.
test
(
R
[
0
])
&&
/
\]
$/
.
test
(
R
[
N
])){
R
[
N
]
=
R
[
N
].
replace
(
/
\]
$/
,
""
);
R
=
R
.
shift
().
split
(
"
[
"
).
concat
(
R
);
N
=
R
.
length
-
1
}
else
{
N
=
0
}
if
(
K
.
length
===
2
){
J
=
r
(
K
[
1
]);
if
(
F
){
J
=
J
&&!
isNaN
(
J
)?
+
J
:
J
===
"
undefined
"
?
i
:
G
[
J
]
!==
i
?
G
[
J
]:
J
}
if
(
N
){
for
(;
M
<=
N
;
M
++
){
P
=
R
[
M
]
===
""
?
O
.
length
:
R
[
M
];
O
=
O
[
P
]
=
M
<
N
?
O
[
P
]
||
(
R
[
M
+
1
]
&&
isNaN
(
R
[
M
+
1
])?{}:[]):
J
}}
else
{
if
(
$
.
isArray
(
H
[
P
])){
H
[
P
].
push
(
J
)}
else
{
if
(
H
[
P
]
!==
i
){
H
[
P
]
=
[
H
[
P
],
J
]}
else
{
H
[
P
]
=
J
}}}}
else
{
if
(
P
){
H
[
P
]
=
F
?
i
:
""
}}});
return
H
};
function
z
(
H
,
F
,
G
){
if
(
F
===
i
||
typeof
F
===
"
boolean
"
){
G
=
F
;
F
=
a
[
H
?
D
:
A
]()}
else
{
F
=
E
(
F
)?
F
.
replace
(
H
?
w
:
x
,
""
):
F
}
return
l
(
F
,
G
)}
l
[
A
]
=
B
(
z
,
0
);
l
[
D
]
=
v
=
B
(
z
,
1
);
$
[
y
]
||
(
$
[
y
]
=
function
(
F
){
return
$
.
extend
(
C
,
F
)})({
a
:
k
,
base
:
k
,
iframe
:
t
,
img
:
t
,
input
:
t
,
form
:
"
action
"
,
link
:
k
,
script
:
t
});
j
=
$
[
y
];
function
s
(
I
,
G
,
H
,
F
){
if
(
!
E
(
H
)
&&
typeof
H
!==
"
object
"
){
F
=
H
;
H
=
G
;
G
=
i
}
return
this
.
each
(
function
(){
var
L
=
$
(
this
),
J
=
G
||
j
()[(
this
.
nodeName
||
""
).
toLowerCase
()]
||
""
,
K
=
J
&&
L
.
attr
(
J
)
||
""
;
L
.
attr
(
J
,
a
[
I
](
K
,
H
,
F
))})}
$
.
fn
[
A
]
=
B
(
s
,
A
);
$
.
fn
[
D
]
=
B
(
s
,
D
);
b
.
pushState
=
q
=
function
(
I
,
F
){
if
(
E
(
I
)
&&
/^#/
.
test
(
I
)
&&
F
===
i
){
F
=
2
}
var
H
=
I
!==
i
,
G
=
c
(
p
[
g
][
k
],
H
?
I
:{},
H
?
F
:
2
);
p
[
g
][
k
]
=
G
+
(
/#/
.
test
(
G
)?
""
:
"
#
"
)};
b
.
getState
=
u
=
function
(
F
,
G
){
return
F
===
i
||
typeof
F
===
"
boolean
"
?
v
(
F
):
v
(
G
)[
F
]};
b
.
removeState
=
function
(
F
){
var
G
=
{};
if
(
F
!==
i
){
G
=
u
();
$
.
each
(
$
.
isArray
(
F
)?
F
:
arguments
,
function
(
I
,
H
){
delete
G
[
H
]})}
q
(
G
,
2
)};
e
[
d
]
=
$
.
extend
(
e
[
d
],{
add
:
function
(
F
){
var
H
;
function
G
(
J
){
var
I
=
J
[
D
]
=
c
();
J
.
getState
=
function
(
K
,
L
){
return
K
===
i
||
typeof
K
===
"
boolean
"
?
l
(
I
,
K
):
l
(
I
,
L
)[
K
]};
H
.
apply
(
this
,
arguments
)}
if
(
$
.
isFunction
(
F
)){
H
=
F
;
return
G
}
else
{
H
=
F
.
handler
;
F
.
handler
=
G
}}})})(
jQuery
,
this
);
/*
* jQuery hashchange event - v1.2 - 2/11/2010
* http://benalman.com/projects/jquery-hashchange-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(
function
(
$
,
i
,
b
){
var
j
,
k
=
$
.
event
.
special
,
c
=
"
location
"
,
d
=
"
hashchange
"
,
l
=
"
href
"
,
f
=
$
.
browser
,
g
=
document
.
documentMode
,
h
=
f
.
msie
&&
(
g
===
b
||
g
<
8
),
e
=
"
on
"
+
d
in
i
&&!
h
;
function
a
(
m
){
m
=
m
||
i
[
c
][
l
];
return
m
.
replace
(
/^
[^
#
]
*#
?(
.*
)
$/
,
"
$1
"
)}
$
[
d
+
"
Delay
"
]
=
100
;
k
[
d
]
=
$
.
extend
(
k
[
d
],{
setup
:
function
(){
if
(
e
){
return
false
}
$
(
j
.
start
)},
teardown
:
function
(){
if
(
e
){
return
false
}
$
(
j
.
stop
)}});
j
=
(
function
(){
var
m
=
{},
r
,
n
,
o
,
q
;
function
p
(){
o
=
q
=
function
(
s
){
return
s
};
if
(
h
){
n
=
$
(
'
<iframe src="javascript:0"/>
'
).
hide
().
insertAfter
(
"
body
"
)[
0
].
contentWindow
;
q
=
function
(){
return
a
(
n
.
document
[
c
][
l
])};
o
=
function
(
u
,
s
){
if
(
u
!==
s
){
var
t
=
n
.
document
;
t
.
open
().
close
();
t
[
c
].
hash
=
"
#
"
+
u
}};
o
(
a
())}}
m
.
start
=
function
(){
if
(
r
){
return
}
var
t
=
a
();
o
||
p
();(
function
s
(){
var
v
=
a
(),
u
=
q
(
t
);
if
(
v
!==
t
){
o
(
t
=
v
,
u
);
$
(
i
).
trigger
(
d
)}
else
{
if
(
u
!==
t
){
i
[
c
][
l
]
=
i
[
c
][
l
].
replace
(
/#.*/
,
""
)
+
"
#
"
+
u
}}
r
=
setTimeout
(
s
,
$
[
d
+
"
Delay
"
])})()};
m
.
stop
=
function
(){
if
(
!
n
){
r
&&
clearTimeout
(
r
);
r
=
0
}};
return
m
})()})(
jQuery
,
this
);
modules/overlay/overlay-parent.js
View file @
8926b0a8
...
...
@@ -862,13 +862,8 @@ Drupal.overlay.fragmentizeLink = function (link) {
// Preserve existing query and fragment parameters in the URL.
var
destination
=
path
+
link
.
search
+
link
.
hash
;
// Assemble the overlay-ready link.
var
newLink
=
$
.
param
.
fragment
(
window
.
location
.
href
,
{
overlay
:
destination
});
// $.param.fragment() escaped slashes in the overlay part: unescape them.
var
regexp
=
new
RegExp
(
"
[#&]overlay=
"
+
encodeURIComponent
(
path
));
newLink
=
newLink
.
replace
(
regexp
,
decodeURIComponent
);
return
newLink
;
// Assemble and return the overlay-ready link.
return
$
.
param
.
fragment
(
window
.
location
.
href
,
{
overlay
:
destination
});
};
/**
...
...
modules/system/system.module
View file @
8926b0a8
...
...
@@ -1087,7 +1087,7 @@ function system_library() {
$libraries
[
'jquery-bbq'
]
=
array
(
'title'
=>
'jQuery BBQ'
,
'website'
=>
'http://benalman.com/projects/jquery-bbq-plugin/'
,
'version'
=>
'1.
0.2
'
,
'version'
=>
'1.
2.1
'
,
'js'
=>
array
(
'misc/jquery.ba-bbq.js'
=>
array
(),
),
...
...
Write
Preview
Supports
Markdown
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