Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
7d09acab
Commit
7d09acab
authored
Jun 27, 2018
by
Cecilia Vela Gurovic
Committed by
Robert Lyon
Aug 08, 2018
Browse files
Bug 1776816: Update jquery-mobile - fix bind/unbind
behatnotneeded Change-Id: I0072124f0f7efa0974fb439ca63daf8495ddac46
parent
6213b3d1
Changes
9
Hide whitespace changes
Inline
Side-by-side
htdocs/js/jquery/jquery-mobile/README.Mahara
View file @
7d09acab
...
...
@@ -10,9 +10,13 @@ Changes:
* Have only included the Touch events to allow us to use swipe event
features of this library via http://jquerymobile.com/download-builder/
* Upgraded to alpha version for the virtual mouse part of the code.
It breaks with jQuery 3 and its fixed in alpha version.
For this lib we make a custom download only with the touch events
(this part wasn't changed in alpha version) but this comes with
3 core components: Namespace, touch support test and virtual mouse.
\ No newline at end of file
3 core components: Namespace, touch support test and virtual mouse.
* jquery methods bind() & unbind() are being deprecated in jQuery 3
Replaced them for the on() & off() methods as specified in jQuery documentation.
Need to keep an eye on
https://github.com/jquery/jquery-mobile/blob/master/js/events/touch.js
If it gets updated, we need to upgrade this library again
htdocs/js/jquery/jquery-mobile/jquery.mobile.custom.min.js
View file @
7d09acab
/*! jQuery Mobile v1.5.0-alpha.1 | Copyright jQuery Foundation, Inc. | jquery.org/license */
(
function
(
e
,
t
,
n
){
typeof
define
==
"
function
"
&&
define
.
amd
?
define
([
"
jquery
"
],
function
(
r
){
return
n
(
r
,
e
,
t
),
r
.
mobile
}):
n
(
e
.
jQuery
,
e
,
t
)})(
this
,
document
,
function
(
e
,
t
,
n
,
r
){(
function
(
t
){
typeof
define
==
"
function
"
&&
define
.
amd
?
define
(
"
vmouse
"
,[
"
jquery
"
],
t
):
t
(
e
)})(
function
(
e
){
function
T
(
e
){
while
(
e
&&
typeof
e
.
originalEvent
!=
"
undefined
"
)
e
=
e
.
originalEvent
;
return
e
}
function
N
(
t
,
n
){
var
i
=
t
.
type
,
o
,
a
,
l
,
c
,
h
,
p
,
d
,
v
,
m
;
t
=
e
.
Event
(
t
),
t
.
type
=
n
,
o
=
t
.
originalEvent
,
a
=
u
,
i
.
search
(
/^
(
mouse|click
)
/
)
>-
1
&&
(
a
=
f
);
if
(
o
)
for
(
d
=
a
.
length
;
d
;)
c
=
a
[
--
d
],
t
[
c
]
=
o
[
c
];
i
.
search
(
/mouse
(
down|up
)
|click/
)
>-
1
&&!
t
.
which
&&
(
t
.
which
=
1
);
if
(
i
.
search
(
/^touch/
)
!==-
1
){
l
=
T
(
o
),
i
=
l
.
touches
,
h
=
l
.
changedTouches
,
p
=
i
&&
i
.
length
?
i
[
0
]:
h
&&
h
.
length
?
h
[
0
]:
r
;
if
(
p
)
for
(
v
=
0
,
m
=
s
.
length
;
v
<
m
;
v
++
)
c
=
s
[
v
],
t
[
c
]
=
p
[
c
]}
return
t
}
function
C
(
n
){
var
r
=
{},
i
,
s
;
while
(
n
){
i
=
e
.
data
(
n
,
t
);
for
(
s
in
i
)
i
[
s
]
&&
(
r
[
s
]
=
r
.
hasVirtualBinding
=!
0
);
n
=
n
.
parentNode
}
return
r
}
function
k
(
n
,
r
){
var
i
;
while
(
n
){
i
=
e
.
data
(
n
,
t
);
if
(
i
&&
(
!
r
||
i
[
r
]))
return
n
;
n
=
n
.
parentNode
}
return
null
}
function
L
(){
g
=!
1
}
function
A
(){
g
=!
0
}
function
O
(){
E
=
0
,
v
.
length
=
0
,
m
=!
1
,
A
()}
function
M
(){
L
()}
function
_
(){
c
&&
(
clearTimeout
(
c
),
c
=
0
)}
function
D
(){
_
(),
c
=
setTimeout
(
function
(){
c
=
0
,
O
()},
e
.
vmouse
.
resetTimerDuration
)}
function
P
(
t
,
n
,
r
){
var
i
;
if
(
r
&&
r
[
t
]
||!
r
&&
k
(
n
.
target
,
t
))
i
=
N
(
n
,
t
),
e
(
n
.
target
).
trigger
(
i
);
return
i
}
function
H
(
t
){
var
n
=
e
.
data
(
t
.
target
,
i
),
r
;
t
.
type
===
"
click
"
&&
e
.
data
(
t
.
target
,
"
lastTouchType
"
)
===
"
touchstart
"
&&
setTimeout
(
function
(){
e
.
data
(
t
.
target
,
"
lastTouchType
"
)
===
"
touchstart
"
&&
(
O
(),
delete
e
.
data
(
t
.
target
).
lastTouchType
,
H
(
t
))},
e
.
vmouse
.
maximumTimeBetweenTouches
),
!
m
&&
(
!
E
||
E
!==
n
)
&&
(
r
=
P
(
"
v
"
+
t
.
type
,
t
),
r
&&
(
r
.
isDefaultPrevented
()
&&
t
.
preventDefault
(),
r
.
isPropagationStopped
()
&&
t
.
stopPropagation
(),
r
.
isImmediatePropagationStopped
()
&&
t
.
stopImmediatePropagation
()))}
function
B
(
t
){
var
n
=
T
(
t
).
touches
,
r
,
s
,
o
;
n
&&
n
.
length
===
1
&&
(
r
=
t
.
target
,
s
=
C
(
r
),
e
.
data
(
t
.
target
,
"
lastTouchType
"
,
t
.
type
),
s
.
hasVirtualBinding
&&
(
E
=
w
++
,
e
.
data
(
r
,
i
,
E
),
_
(),
M
(),
d
=!
1
,
o
=
T
(
t
).
touches
[
0
],
h
=
o
.
pageX
,
p
=
o
.
pageY
,
P
(
"
vmouseover
"
,
t
,
s
),
P
(
"
vmousedown
"
,
t
,
s
)))}
function
j
(
t
){
if
(
g
)
return
;
d
||
P
(
"
vmousecancel
"
,
t
,
C
(
t
.
target
)),
e
.
data
(
t
.
target
,
"
lastTouchType
"
,
t
.
type
),
d
=!
0
,
D
()}
function
F
(
t
){
if
(
g
)
return
;
var
n
=
T
(
t
).
touches
[
0
],
r
=
d
,
i
=
e
.
vmouse
.
moveDistanceThreshold
,
s
=
C
(
t
.
target
);
e
.
data
(
t
.
target
,
"
lastTouchType
"
,
t
.
type
),
d
=
d
||
Math
.
abs
(
n
.
pageX
-
h
)
>
i
||
Math
.
abs
(
n
.
pageY
-
p
)
>
i
,
d
&&!
r
&&
P
(
"
vmousecancel
"
,
t
,
s
),
P
(
"
vmousemove
"
,
t
,
s
),
D
()}
function
I
(
t
){
if
(
g
||
e
.
data
(
t
.
target
,
"
lastTouchType
"
)
===
r
)
return
;
A
(),
delete
e
.
data
(
t
.
target
).
lastTouchType
;
var
n
=
C
(
t
.
target
),
i
,
s
;
P
(
"
vmouseup
"
,
t
,
n
),
d
||
(
i
=
P
(
"
vclick
"
,
t
,
n
),
i
&&
i
.
isDefaultPrevented
()
&&
(
s
=
T
(
t
).
changedTouches
[
0
],
v
.
push
({
touchID
:
E
,
x
:
s
.
clientX
,
y
:
s
.
clientY
}),
m
=!
0
)),
P
(
"
vmouseout
"
,
t
,
n
),
d
=!
1
,
D
()}
function
q
(
n
){
var
r
=
e
.
data
(
n
,
t
),
i
;
if
(
r
)
for
(
i
in
r
)
if
(
r
[
i
])
return
!
0
;
return
!
1
}
function
R
(){}
function
U
(
n
){
var
r
=
n
.
substr
(
1
);
return
{
setup
:
function
(){
q
(
this
)
||
e
.
data
(
this
,
t
,{});
var
i
=
e
.
data
(
this
,
t
);
i
[
n
]
=!
0
,
l
[
n
]
=
(
l
[
n
]
||
0
)
+
1
,
l
[
n
]
===
1
&&
b
.
bind
(
r
,
H
),
e
(
this
).
bind
(
r
,
R
),
y
&&
(
l
.
touchstart
=
(
l
.
touchstart
||
0
)
+
1
,
l
.
touchstart
===
1
&&
b
.
bind
(
"
touchstart
"
,
B
).
bind
(
"
touchend
"
,
I
).
bind
(
"
touchmove
"
,
F
).
bind
(
"
scroll
"
,
j
))},
teardown
:
function
(){
--
l
[
n
],
l
[
n
]
||
b
.
unbind
(
r
,
H
),
y
&&
(
--
l
.
touchstart
,
l
.
touchstart
||
b
.
unbind
(
"
touchstart
"
,
B
).
unbind
(
"
touchmove
"
,
F
).
unbind
(
"
touchend
"
,
I
).
unbind
(
"
scroll
"
,
j
));
var
i
=
e
(
this
),
s
=
e
.
data
(
this
,
t
);
s
&&
(
s
[
n
]
=!
1
),
i
.
unbind
(
r
,
R
),
q
(
this
)
||
i
.
removeData
(
t
)}}}
var
t
=
"
virtualMouseBindings
"
,
i
=
"
virtualTouchID
"
,
s
=
"
clientX clientY pageX pageY screenX screenY
"
.
split
(
"
"
),
o
=
"
vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel
"
.
split
(
"
"
),
u
=
"
altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which
"
.
split
(
"
"
),
a
=
e
.
event
.
mouseHooks
?
e
.
event
.
mouseHooks
.
props
:[],
f
=
u
.
concat
(
a
),
l
=
{},
c
=
0
,
h
=
0
,
p
=
0
,
d
=!
1
,
v
=
[],
m
=!
1
,
g
=!
1
,
y
=
"
addEventListener
"
in
n
,
b
=
e
(
n
),
w
=
1
,
E
=
0
,
S
,
x
;
e
.
vmouse
=
{
moveDistanceThreshold
:
10
,
clickDistanceThreshold
:
10
,
resetTimerDuration
:
1500
,
maximumTimeBetweenTouches
:
100
};
for
(
x
=
0
;
x
<
o
.
length
;
x
++
)
e
.
event
.
special
[
o
[
x
]]
=
U
(
o
[
x
]);
y
&&
n
.
addEventListener
(
"
click
"
,
function
(
t
){
var
n
=
v
.
length
,
r
=
t
.
target
,
s
,
o
,
u
,
a
,
f
,
l
;
if
(
n
){
s
=
t
.
clientX
,
o
=
t
.
clientY
,
S
=
e
.
vmouse
.
clickDistanceThreshold
,
u
=
r
;
while
(
u
){
for
(
a
=
0
;
a
<
n
;
a
++
){
f
=
v
[
a
],
l
=
0
;
if
(
u
===
r
&&
Math
.
abs
(
f
.
x
-
s
)
<
S
&&
Math
.
abs
(
f
.
y
-
o
)
<
S
||
e
.
data
(
u
,
i
)
===
f
.
touchID
){
t
.
preventDefault
(),
t
.
stopPropagation
();
return
}}
u
=
u
.
parentNode
}}},
!
0
)}),
function
(
t
){
typeof
define
==
"
function
"
&&
define
.
amd
?
define
(
"
ns
"
,[
"
jquery
"
],
t
):
t
(
e
)}(
function
(
e
){
return
e
.
mobile
=
{
version
:
"
@VERSION
"
},
e
.
mobile
}),
function
(
t
){
typeof
define
==
"
function
"
&&
define
.
amd
?
define
(
"
support/touch
"
,[
"
jquery
"
,
"
../ns
"
],
t
):
t
(
e
)}(
function
(
e
){
var
t
=
{
touch
:
"
ontouchend
"
in
n
};
return
e
.
mobile
.
support
=
e
.
mobile
.
support
||
{},
e
.
extend
(
e
.
support
,
t
),
e
.
extend
(
e
.
mobile
.
support
,
t
),
e
.
support
}),
function
(
t
){
typeof
define
==
"
function
"
&&
define
.
amd
?
define
(
"
events/touch
"
,[
"
jquery
"
,
"
../vmouse
"
,
"
../support/touch
"
],
t
):
t
(
e
)}(
function
(
e
){
function
f
(
t
,
n
,
i
,
s
){
var
o
=
i
.
type
;
i
.
type
=
n
,
s
?
e
.
event
.
trigger
(
i
,
r
,
t
):
e
.
event
.
dispatch
.
call
(
t
,
i
),
i
.
type
=
o
}
var
i
=
e
(
n
),
s
=
e
.
mobile
.
support
.
touch
,
o
=
s
?
"
touchstart
"
:
"
mousedown
"
,
u
=
s
?
"
touchend
"
:
"
mouseup
"
,
a
=
s
?
"
touchmove
"
:
"
mousemove
"
;
return
e
.
each
(
"
touchstart touchmove touchend tap taphold swipe swipeleft swiperight
"
.
split
(
"
"
),
function
(
t
,
n
){
e
.
fn
[
n
]
=
function
(
e
){
return
e
?
this
.
bind
(
n
,
e
):
this
.
trigger
(
n
)},
e
.
attrFn
&&
(
e
.
attrFn
[
n
]
=!
0
)}),
e
.
event
.
special
.
tap
=
{
tapholdThreshold
:
750
,
emitTapOnTaphold
:
!
0
,
setup
:
function
(){
var
t
=
this
,
n
=
e
(
t
),
r
=!
1
;
n
.
bind
(
"
vmousedown
"
,
function
(
s
){
function
l
(){
u
&&
(
n
.
bind
(
"
vclick
"
,
a
),
clearTimeout
(
u
))}
function
c
(){
l
(),
n
.
unbind
(
"
vclick
"
,
a
).
unbind
(
"
vmouseup
"
,
l
),
i
.
unbind
(
"
vmousecancel
"
,
c
)}
r
=!
1
;
if
(
s
.
which
&&
s
.
which
!==
1
)
return
!
0
;
var
o
=
s
.
target
,
u
,
a
;
a
=
function
(
e
){
c
(),
!
r
&&
o
===
e
.
target
?
f
(
t
,
"
tap
"
,
e
):
r
&&
e
.
preventDefault
()},
n
.
bind
(
"
vmouseup
"
,
l
),
i
.
bind
(
"
vmousecancel
"
,
c
),
u
=
setTimeout
(
function
(){
e
.
event
.
special
.
tap
.
emitTapOnTaphold
||
(
r
=!
0
),
u
=
0
,
f
(
t
,
"
taphold
"
,
e
.
Event
(
"
taphold
"
,{
target
:
o
}))},
e
.
event
.
special
.
tap
.
tapholdThreshold
)})},
teardown
:
function
(){
e
(
this
).
unbind
(
"
vmousedown
"
).
unbind
(
"
vclick
"
).
unbind
(
"
vmouseup
"
),
i
.
unbind
(
"
vmousecancel
"
)}},
e
.
event
.
special
.
swipe
=
{
scrollSupressionThreshold
:
30
,
durationThreshold
:
1
e3
,
horizontalDistanceThreshold
:
t
.
devicePixelRatio
>=
2
?
15
:
30
,
verticalDistanceThreshold
:
t
.
devicePixelRatio
>=
2
?
15
:
30
,
getLocation
:
function
(
e
){
var
n
=
t
.
pageXOffset
,
r
=
t
.
pageYOffset
,
i
=
e
.
clientX
,
s
=
e
.
clientY
;
if
(
e
.
pageY
===
0
&&
Math
.
floor
(
s
)
>
Math
.
floor
(
e
.
pageY
)
||
e
.
pageX
===
0
&&
Math
.
floor
(
i
)
>
Math
.
floor
(
e
.
pageX
))
i
-=
n
,
s
-=
r
;
else
if
(
s
<
e
.
pageY
-
r
||
i
<
e
.
pageX
-
n
)
i
=
e
.
pageX
-
n
,
s
=
e
.
pageY
-
r
;
return
{
x
:
i
,
y
:
s
}},
start
:
function
(
t
){
var
n
=
t
.
originalEvent
.
touches
?
t
.
originalEvent
.
touches
[
0
]:
t
,
r
=
e
.
event
.
special
.
swipe
.
getLocation
(
n
);
return
{
time
:(
new
Date
).
getTime
(),
coords
:[
r
.
x
,
r
.
y
],
origin
:
e
(
t
.
target
)}},
stop
:
function
(
t
){
var
n
=
t
.
originalEvent
.
touches
?
t
.
originalEvent
.
touches
[
0
]:
t
,
r
=
e
.
event
.
special
.
swipe
.
getLocation
(
n
);
return
{
time
:(
new
Date
).
getTime
(),
coords
:[
r
.
x
,
r
.
y
]}},
handleSwipe
:
function
(
t
,
n
,
r
,
i
){
if
(
n
.
time
-
t
.
time
<
e
.
event
.
special
.
swipe
.
durationThreshold
&&
Math
.
abs
(
t
.
coords
[
0
]
-
n
.
coords
[
0
])
>
e
.
event
.
special
.
swipe
.
horizontalDistanceThreshold
&&
Math
.
abs
(
t
.
coords
[
1
]
-
n
.
coords
[
1
])
<
e
.
event
.
special
.
swipe
.
verticalDistanceThreshold
){
var
s
=
t
.
coords
[
0
]
>
n
.
coords
[
0
]?
"
swipeleft
"
:
"
swiperight
"
;
return
f
(
r
,
"
swipe
"
,
e
.
Event
(
"
swipe
"
,{
target
:
i
,
swipestart
:
t
,
swipestop
:
n
}),
!
0
),
f
(
r
,
s
,
e
.
Event
(
s
,{
target
:
i
,
swipestart
:
t
,
swipestop
:
n
}),
!
0
),
!
0
}
return
!
1
},
eventInProgress
:
!
1
,
setup
:
function
(){
var
t
,
n
=
this
,
r
=
e
(
n
),
s
=
{};
t
=
e
.
data
(
this
,
"
mobile-events
"
),
t
||
(
t
=
{
length
:
0
},
e
.
data
(
this
,
"
mobile-events
"
,
t
)),
t
.
length
++
,
t
.
swipe
=
s
,
s
.
start
=
function
(
t
){
if
(
e
.
event
.
special
.
swipe
.
eventInProgress
)
return
;
e
.
event
.
special
.
swipe
.
eventInProgress
=!
0
;
var
r
,
o
=
e
.
event
.
special
.
swipe
.
start
(
t
),
f
=
t
.
target
,
l
=!
1
;
s
.
move
=
function
(
t
){
if
(
!
o
||
t
.
isDefaultPrevented
())
return
;
r
=
e
.
event
.
special
.
swipe
.
stop
(
t
),
l
||
(
l
=
e
.
event
.
special
.
swipe
.
handleSwipe
(
o
,
r
,
n
,
f
),
l
&&
(
e
.
event
.
special
.
swipe
.
eventInProgress
=!
1
)),
Math
.
abs
(
o
.
coords
[
0
]
-
r
.
coords
[
0
])
>
e
.
event
.
special
.
swipe
.
scrollSupressionThreshold
&&
t
.
preventDefault
()},
s
.
stop
=
function
(){
l
=!
0
,
e
.
event
.
special
.
swipe
.
eventInProgress
=!
1
,
i
.
off
(
a
,
s
.
move
),
s
.
move
=
null
},
i
.
on
(
a
,
s
.
move
).
one
(
u
,
s
.
stop
)},
r
.
on
(
o
,
s
.
start
)},
teardown
:
function
(){
var
t
,
n
;
t
=
e
.
data
(
this
,
"
mobile-events
"
),
t
&&
(
n
=
t
.
swipe
,
delete
t
.
swipe
,
t
.
length
--
,
t
.
length
===
0
&&
e
.
removeData
(
this
,
"
mobile-events
"
)),
n
&&
(
n
.
start
&&
e
(
this
).
off
(
o
,
n
.
start
),
n
.
move
&&
i
.
off
(
a
,
n
.
move
),
n
.
stop
&&
i
.
off
(
u
,
n
.
stop
))}},
e
.
each
({
taphold
:
"
tap
"
,
swipeleft
:
"
swipe.left
"
,
swiperight
:
"
swipe.right
"
},
function
(
t
,
n
){
e
.
event
.
special
[
t
]
=
{
setup
:
function
(){
e
(
this
).
bind
(
n
,
e
.
noop
)},
teardown
:
function
(){
e
(
this
).
unbind
(
n
)}}}),
e
.
event
.
special
})});
\ No newline at end of file
(
function
(
e
,
t
,
n
){
typeof
define
==
"
function
"
&&
define
.
amd
?
define
([
"
jquery
"
],
function
(
r
){
return
n
(
r
,
e
,
t
),
r
.
mobile
}):
n
(
e
.
jQuery
,
e
,
t
)})(
this
,
document
,
function
(
e
,
t
,
n
,
r
){(
function
(
t
){
typeof
define
==
"
function
"
&&
define
.
amd
?
define
(
"
vmouse
"
,[
"
jquery
"
],
t
):
t
(
e
)})(
function
(
e
){
function
T
(
e
){
while
(
e
&&
typeof
e
.
originalEvent
!=
"
undefined
"
)
e
=
e
.
originalEvent
;
return
e
}
function
N
(
t
,
n
){
var
i
=
t
.
type
,
o
,
a
,
l
,
c
,
h
,
p
,
d
,
v
,
m
;
t
=
e
.
Event
(
t
),
t
.
type
=
n
,
o
=
t
.
originalEvent
,
a
=
u
,
i
.
search
(
/^
(
mouse|click
)
/
)
>-
1
&&
(
a
=
f
);
if
(
o
)
for
(
d
=
a
.
length
;
d
;)
c
=
a
[
--
d
],
t
[
c
]
=
o
[
c
];
i
.
search
(
/mouse
(
down|up
)
|click/
)
>-
1
&&!
t
.
which
&&
(
t
.
which
=
1
);
if
(
i
.
search
(
/^touch/
)
!==-
1
){
l
=
T
(
o
),
i
=
l
.
touches
,
h
=
l
.
changedTouches
,
p
=
i
&&
i
.
length
?
i
[
0
]:
h
&&
h
.
length
?
h
[
0
]:
r
;
if
(
p
)
for
(
v
=
0
,
m
=
s
.
length
;
v
<
m
;
v
++
)
c
=
s
[
v
],
t
[
c
]
=
p
[
c
]}
return
t
}
function
C
(
n
){
var
r
=
{},
i
,
s
;
while
(
n
){
i
=
e
.
data
(
n
,
t
);
for
(
s
in
i
)
i
[
s
]
&&
(
r
[
s
]
=
r
.
hasVirtualBinding
=!
0
);
n
=
n
.
parentNode
}
return
r
}
function
k
(
n
,
r
){
var
i
;
while
(
n
){
i
=
e
.
data
(
n
,
t
);
if
(
i
&&
(
!
r
||
i
[
r
]))
return
n
;
n
=
n
.
parentNode
}
return
null
}
function
L
(){
g
=!
1
}
function
A
(){
g
=!
0
}
function
O
(){
E
=
0
,
v
.
length
=
0
,
m
=!
1
,
A
()}
function
M
(){
L
()}
function
_
(){
c
&&
(
clearTimeout
(
c
),
c
=
0
)}
function
D
(){
_
(),
c
=
setTimeout
(
function
(){
c
=
0
,
O
()},
e
.
vmouse
.
resetTimerDuration
)}
function
P
(
t
,
n
,
r
){
var
i
;
if
(
r
&&
r
[
t
]
||!
r
&&
k
(
n
.
target
,
t
))
i
=
N
(
n
,
t
),
e
(
n
.
target
).
trigger
(
i
);
return
i
}
function
H
(
t
){
var
n
=
e
.
data
(
t
.
target
,
i
),
r
;
t
.
type
===
"
click
"
&&
e
.
data
(
t
.
target
,
"
lastTouchType
"
)
===
"
touchstart
"
&&
setTimeout
(
function
(){
e
.
data
(
t
.
target
,
"
lastTouchType
"
)
===
"
touchstart
"
&&
(
O
(),
delete
e
.
data
(
t
.
target
).
lastTouchType
,
H
(
t
))},
e
.
vmouse
.
maximumTimeBetweenTouches
),
!
m
&&
(
!
E
||
E
!==
n
)
&&
(
r
=
P
(
"
v
"
+
t
.
type
,
t
),
r
&&
(
r
.
isDefaultPrevented
()
&&
t
.
preventDefault
(),
r
.
isPropagationStopped
()
&&
t
.
stopPropagation
(),
r
.
isImmediatePropagationStopped
()
&&
t
.
stopImmediatePropagation
()))}
function
B
(
t
){
var
n
=
T
(
t
).
touches
,
r
,
s
,
o
;
n
&&
n
.
length
===
1
&&
(
r
=
t
.
target
,
s
=
C
(
r
),
e
.
data
(
t
.
target
,
"
lastTouchType
"
,
t
.
type
),
s
.
hasVirtualBinding
&&
(
E
=
w
++
,
e
.
data
(
r
,
i
,
E
),
_
(),
M
(),
d
=!
1
,
o
=
T
(
t
).
touches
[
0
],
h
=
o
.
pageX
,
p
=
o
.
pageY
,
P
(
"
vmouseover
"
,
t
,
s
),
P
(
"
vmousedown
"
,
t
,
s
)))}
function
j
(
t
){
if
(
g
)
return
;
d
||
P
(
"
vmousecancel
"
,
t
,
C
(
t
.
target
)),
e
.
data
(
t
.
target
,
"
lastTouchType
"
,
t
.
type
),
d
=!
0
,
D
()}
function
F
(
t
){
if
(
g
)
return
;
var
n
=
T
(
t
).
touches
[
0
],
r
=
d
,
i
=
e
.
vmouse
.
moveDistanceThreshold
,
s
=
C
(
t
.
target
);
e
.
data
(
t
.
target
,
"
lastTouchType
"
,
t
.
type
),
d
=
d
||
Math
.
abs
(
n
.
pageX
-
h
)
>
i
||
Math
.
abs
(
n
.
pageY
-
p
)
>
i
,
d
&&!
r
&&
P
(
"
vmousecancel
"
,
t
,
s
),
P
(
"
vmousemove
"
,
t
,
s
),
D
()}
function
I
(
t
){
if
(
g
||
e
.
data
(
t
.
target
,
"
lastTouchType
"
)
===
r
)
return
;
A
(),
delete
e
.
data
(
t
.
target
).
lastTouchType
;
var
n
=
C
(
t
.
target
),
i
,
s
;
P
(
"
vmouseup
"
,
t
,
n
),
d
||
(
i
=
P
(
"
vclick
"
,
t
,
n
),
i
&&
i
.
isDefaultPrevented
()
&&
(
s
=
T
(
t
).
changedTouches
[
0
],
v
.
push
({
touchID
:
E
,
x
:
s
.
clientX
,
y
:
s
.
clientY
}),
m
=!
0
)),
P
(
"
vmouseout
"
,
t
,
n
),
d
=!
1
,
D
()}
function
q
(
n
){
var
r
=
e
.
data
(
n
,
t
),
i
;
if
(
r
)
for
(
i
in
r
)
if
(
r
[
i
])
return
!
0
;
return
!
1
}
function
R
(){}
function
U
(
n
){
var
r
=
n
.
substr
(
1
);
return
{
setup
:
function
(){
q
(
this
)
||
e
.
data
(
this
,
t
,{});
var
i
=
e
.
data
(
this
,
t
);
i
[
n
]
=!
0
,
l
[
n
]
=
(
l
[
n
]
||
0
)
+
1
,
l
[
n
]
===
1
&&
b
.
on
(
r
,
H
),
e
(
this
).
on
(
r
,
R
),
y
&&
(
l
.
touchstart
=
(
l
.
touchstart
||
0
)
+
1
,
l
.
touchstart
===
1
&&
b
.
on
(
"
touchstart
"
,
B
).
on
(
"
touchend
"
,
I
).
on
(
"
touchmove
"
,
F
).
on
(
"
scroll
"
,
j
))},
teardown
:
function
(){
--
l
[
n
],
l
[
n
]
||
b
.
off
(
r
,
H
),
y
&&
(
--
l
.
touchstart
,
l
.
touchstart
||
b
.
off
(
"
touchstart
"
,
B
).
off
(
"
touchmove
"
,
F
).
off
(
"
touchend
"
,
I
).
off
(
"
scroll
"
,
j
));
var
i
=
e
(
this
),
s
=
e
.
data
(
this
,
t
);
s
&&
(
s
[
n
]
=!
1
),
i
.
off
(
r
,
R
),
q
(
this
)
||
i
.
removeData
(
t
)}}}
var
t
=
"
virtualMouseBindings
"
,
i
=
"
virtualTouchID
"
,
s
=
"
clientX clientY pageX pageY screenX screenY
"
.
split
(
"
"
),
o
=
"
vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel
"
.
split
(
"
"
),
u
=
"
altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which
"
.
split
(
"
"
),
a
=
e
.
event
.
mouseHooks
?
e
.
event
.
mouseHooks
.
props
:[],
f
=
u
.
concat
(
a
),
l
=
{},
c
=
0
,
h
=
0
,
p
=
0
,
d
=!
1
,
v
=
[],
m
=!
1
,
g
=!
1
,
y
=
"
addEventListener
"
in
n
,
b
=
e
(
n
),
w
=
1
,
E
=
0
,
S
,
x
;
e
.
vmouse
=
{
moveDistanceThreshold
:
10
,
clickDistanceThreshold
:
10
,
resetTimerDuration
:
1500
,
maximumTimeBetweenTouches
:
100
};
for
(
x
=
0
;
x
<
o
.
length
;
x
++
)
e
.
event
.
special
[
o
[
x
]]
=
U
(
o
[
x
]);
y
&&
n
.
addEventListener
(
"
click
"
,
function
(
t
){
var
n
=
v
.
length
,
r
=
t
.
target
,
s
,
o
,
u
,
a
,
f
,
l
;
if
(
n
){
s
=
t
.
clientX
,
o
=
t
.
clientY
,
S
=
e
.
vmouse
.
clickDistanceThreshold
,
u
=
r
;
while
(
u
){
for
(
a
=
0
;
a
<
n
;
a
++
){
f
=
v
[
a
],
l
=
0
;
if
(
u
===
r
&&
Math
.
abs
(
f
.
x
-
s
)
<
S
&&
Math
.
abs
(
f
.
y
-
o
)
<
S
||
e
.
data
(
u
,
i
)
===
f
.
touchID
){
t
.
preventDefault
(),
t
.
stopPropagation
();
return
}}
u
=
u
.
parentNode
}}},
!
0
)}),
function
(
t
){
typeof
define
==
"
function
"
&&
define
.
amd
?
define
(
"
ns
"
,[
"
jquery
"
],
t
):
t
(
e
)}(
function
(
e
){
return
e
.
mobile
=
{
version
:
"
@VERSION
"
},
e
.
mobile
}),
function
(
t
){
typeof
define
==
"
function
"
&&
define
.
amd
?
define
(
"
support/touch
"
,[
"
jquery
"
,
"
../ns
"
],
t
):
t
(
e
)}(
function
(
e
){
var
t
=
{
touch
:
"
ontouchend
"
in
n
};
return
e
.
mobile
.
support
=
e
.
mobile
.
support
||
{},
e
.
extend
(
e
.
support
,
t
),
e
.
extend
(
e
.
mobile
.
support
,
t
),
e
.
support
}),
function
(
t
){
typeof
define
==
"
function
"
&&
define
.
amd
?
define
(
"
events/touch
"
,[
"
jquery
"
,
"
../vmouse
"
,
"
../support/touch
"
],
t
):
t
(
e
)}(
function
(
e
){
function
f
(
t
,
n
,
i
,
s
){
var
o
=
i
.
type
;
i
.
type
=
n
,
s
?
e
.
event
.
trigger
(
i
,
r
,
t
):
e
.
event
.
dispatch
.
call
(
t
,
i
),
i
.
type
=
o
}
var
i
=
e
(
n
),
s
=
e
.
mobile
.
support
.
touch
,
o
=
s
?
"
touchstart
"
:
"
mousedown
"
,
u
=
s
?
"
touchend
"
:
"
mouseup
"
,
a
=
s
?
"
touchmove
"
:
"
mousemove
"
;
return
e
.
each
(
"
touchstart touchmove touchend tap taphold swipe swipeleft swiperight
"
.
split
(
"
"
),
function
(
t
,
n
){
e
.
fn
[
n
]
=
function
(
e
){
return
e
?
this
.
on
(
n
,
e
):
this
.
trigger
(
n
)},
e
.
attrFn
&&
(
e
.
attrFn
[
n
]
=!
0
)}),
e
.
event
.
special
.
tap
=
{
tapholdThreshold
:
750
,
emitTapOnTaphold
:
!
0
,
setup
:
function
(){
var
t
=
this
,
n
=
e
(
t
),
r
=!
1
;
n
.
on
(
"
vmousedown
"
,
function
(
s
){
function
l
(){
u
&&
(
n
.
on
(
"
vclick
"
,
a
),
clearTimeout
(
u
))}
function
c
(){
l
(),
n
.
off
(
"
vclick
"
,
a
).
off
(
"
vmouseup
"
,
l
),
i
.
off
(
"
vmousecancel
"
,
c
)}
r
=!
1
;
if
(
s
.
which
&&
s
.
which
!==
1
)
return
!
0
;
var
o
=
s
.
target
,
u
,
a
;
a
=
function
(
e
){
c
(),
!
r
&&
o
===
e
.
target
?
f
(
t
,
"
tap
"
,
e
):
r
&&
e
.
preventDefault
()},
n
.
on
(
"
vmouseup
"
,
l
),
i
.
on
(
"
vmousecancel
"
,
c
),
u
=
setTimeout
(
function
(){
e
.
event
.
special
.
tap
.
emitTapOnTaphold
||
(
r
=!
0
),
u
=
0
,
f
(
t
,
"
taphold
"
,
e
.
Event
(
"
taphold
"
,{
target
:
o
}))},
e
.
event
.
special
.
tap
.
tapholdThreshold
)})},
teardown
:
function
(){
e
(
this
).
off
(
"
vmousedown
"
).
off
(
"
vclick
"
).
off
(
"
vmouseup
"
),
i
.
off
(
"
vmousecancel
"
)}},
e
.
event
.
special
.
swipe
=
{
scrollSupressionThreshold
:
30
,
durationThreshold
:
1
e3
,
horizontalDistanceThreshold
:
t
.
devicePixelRatio
>=
2
?
15
:
30
,
verticalDistanceThreshold
:
t
.
devicePixelRatio
>=
2
?
15
:
30
,
getLocation
:
function
(
e
){
var
n
=
t
.
pageXOffset
,
r
=
t
.
pageYOffset
,
i
=
e
.
clientX
,
s
=
e
.
clientY
;
if
(
e
.
pageY
===
0
&&
Math
.
floor
(
s
)
>
Math
.
floor
(
e
.
pageY
)
||
e
.
pageX
===
0
&&
Math
.
floor
(
i
)
>
Math
.
floor
(
e
.
pageX
))
i
-=
n
,
s
-=
r
;
else
if
(
s
<
e
.
pageY
-
r
||
i
<
e
.
pageX
-
n
)
i
=
e
.
pageX
-
n
,
s
=
e
.
pageY
-
r
;
return
{
x
:
i
,
y
:
s
}},
start
:
function
(
t
){
var
n
=
t
.
originalEvent
.
touches
?
t
.
originalEvent
.
touches
[
0
]:
t
,
r
=
e
.
event
.
special
.
swipe
.
getLocation
(
n
);
return
{
time
:(
new
Date
).
getTime
(),
coords
:[
r
.
x
,
r
.
y
],
origin
:
e
(
t
.
target
)}},
stop
:
function
(
t
){
var
n
=
t
.
originalEvent
.
touches
?
t
.
originalEvent
.
touches
[
0
]:
t
,
r
=
e
.
event
.
special
.
swipe
.
getLocation
(
n
);
return
{
time
:(
new
Date
).
getTime
(),
coords
:[
r
.
x
,
r
.
y
]}},
handleSwipe
:
function
(
t
,
n
,
r
,
i
){
if
(
n
.
time
-
t
.
time
<
e
.
event
.
special
.
swipe
.
durationThreshold
&&
Math
.
abs
(
t
.
coords
[
0
]
-
n
.
coords
[
0
])
>
e
.
event
.
special
.
swipe
.
horizontalDistanceThreshold
&&
Math
.
abs
(
t
.
coords
[
1
]
-
n
.
coords
[
1
])
<
e
.
event
.
special
.
swipe
.
verticalDistanceThreshold
){
var
s
=
t
.
coords
[
0
]
>
n
.
coords
[
0
]?
"
swipeleft
"
:
"
swiperight
"
;
return
f
(
r
,
"
swipe
"
,
e
.
Event
(
"
swipe
"
,{
target
:
i
,
swipestart
:
t
,
swipestop
:
n
}),
!
0
),
f
(
r
,
s
,
e
.
Event
(
s
,{
target
:
i
,
swipestart
:
t
,
swipestop
:
n
}),
!
0
),
!
0
}
return
!
1
},
eventInProgress
:
!
1
,
setup
:
function
(){
var
t
,
n
=
this
,
r
=
e
(
n
),
s
=
{};
t
=
e
.
data
(
this
,
"
mobile-events
"
),
t
||
(
t
=
{
length
:
0
},
e
.
data
(
this
,
"
mobile-events
"
,
t
)),
t
.
length
++
,
t
.
swipe
=
s
,
s
.
start
=
function
(
t
){
if
(
e
.
event
.
special
.
swipe
.
eventInProgress
)
return
;
e
.
event
.
special
.
swipe
.
eventInProgress
=!
0
;
var
r
,
o
=
e
.
event
.
special
.
swipe
.
start
(
t
),
f
=
t
.
target
,
l
=!
1
;
s
.
move
=
function
(
t
){
if
(
!
o
||
t
.
isDefaultPrevented
())
return
;
r
=
e
.
event
.
special
.
swipe
.
stop
(
t
),
l
||
(
l
=
e
.
event
.
special
.
swipe
.
handleSwipe
(
o
,
r
,
n
,
f
),
l
&&
(
e
.
event
.
special
.
swipe
.
eventInProgress
=!
1
)),
Math
.
abs
(
o
.
coords
[
0
]
-
r
.
coords
[
0
])
>
e
.
event
.
special
.
swipe
.
scrollSupressionThreshold
&&
t
.
preventDefault
()},
s
.
stop
=
function
(){
l
=!
0
,
e
.
event
.
special
.
swipe
.
eventInProgress
=!
1
,
i
.
off
(
a
,
s
.
move
),
s
.
move
=
null
},
i
.
on
(
a
,
s
.
move
).
one
(
u
,
s
.
stop
)},
r
.
on
(
o
,
s
.
start
)},
teardown
:
function
(){
var
t
,
n
;
t
=
e
.
data
(
this
,
"
mobile-events
"
),
t
&&
(
n
=
t
.
swipe
,
delete
t
.
swipe
,
t
.
length
--
,
t
.
length
===
0
&&
e
.
removeData
(
this
,
"
mobile-events
"
)),
n
&&
(
n
.
start
&&
e
(
this
).
off
(
o
,
n
.
start
),
n
.
move
&&
i
.
off
(
a
,
n
.
move
),
n
.
stop
&&
i
.
off
(
u
,
n
.
stop
))}},
e
.
each
({
taphold
:
"
tap
"
,
swipeleft
:
"
swipe.left
"
,
swiperight
:
"
swipe.right
"
},
function
(
t
,
n
){
e
.
event
.
special
[
t
]
=
{
setup
:
function
(){
e
(
this
).
on
(
n
,
e
.
noop
)},
teardown
:
function
(){
e
(
this
).
off
(
n
)}}}),
e
.
event
.
special
})});
test/behat/features/settings/anonymous_view.feature
View file @
7d09acab
...
...
@@ -38,11 +38,13 @@ Scenario: Testing that views & collections are collated properly
Given
I log in as
"UserB"
with password
"Kupuh1pa!"
And
I am on homepage
And
I scroll to the id 'bottom-pane'
Then
I should see
"(Author's name hidden)"
And
I log out
Given
I log in as
"admin"
with password
"Kupuh1pa!"
And
I am on homepage
And
I scroll to the id 'bottom-pane'
Then
should see
"(Author's name hidden)"
And
I follow
"(Author's name hidden)"
Then
I should see
"UserA"
test/behat/features/site_features/install_framework.feature
View file @
7d09acab
...
...
@@ -101,6 +101,7 @@ Scenario: Installing framework module and activating for an institution
# Try as another admin
Given
I log in as
"UserA"
with password
"Kupuh1pa!"
And
I wait
"1"
seconds
And
I follow
"Collection admin_01"
And
I click on the matrix point
"3,4"
And
I wait
"1"
seconds
...
...
test/behat/features/site_features/recent_forum_posts.feature
View file @
7d09acab
...
...
@@ -39,6 +39,8 @@ Scenario: Create forum and add block to group page
And
I press
"Post"
And
I log out
And
I log in as
"UserB"
with password
"Kupuh1pa!"
And
I wait
"1"
seconds
And
I scroll to the id 'inboxblock'
And
I follow
"Taking photos of cats"
And
I follow
"Topic"
And
I follow
"Reply"
...
...
test/behat/features/site_features/unsubscribe_watchlist.feature
View file @
7d09acab
...
...
@@ -34,6 +34,7 @@ Scenario: Viewing a list of pages I watch from the dashboard (Bug 1444784)
And
I unsubscribe from
"Page UserA_01"
owned by
"UserB"
And
I should see
"You have unsubscribed successfully"
And
I am on homepage
And
I scroll to the id 'bottom-pane'
And
I follow
"Page UserA_01"
And
I press
"More..."
And
I should see
"Add page to watchlist"
test/behat/features/social/make_comment_public.feature
View file @
7d09acab
...
...
@@ -36,6 +36,7 @@ Background:
And
I log out
And
I log in as
"UserB"
with password
"Kupuh1pa!"
And
I scroll to the base of id 'bottom-pane'
And
I follow
"Page UserA_03"
And
I fill in
"This is comment 1"
in editor
"Comment"
And
I disable the switch
"Make comment public"
...
...
@@ -106,6 +107,7 @@ Background:
And
I log out
And
I log in as
"UserB"
with password
"Kupuh1pa!"
And
I scroll to the id 'bottom-pane'
And
I follow
"Collection UserA_01"
And
I should see
"This is comment 3"
And
I should not see
"This is comment 2"
...
...
test/behat/features/social/send_multiple_messages.feature
View file @
7d09acab
...
...
@@ -37,6 +37,7 @@ Scenario: Sending messages between user and admin (Bug 1426983)
Then
I log in as
"UserA"
with password
"Kupuh1pa!"
# Confirming all messages has been received
And
I am on homepage
And
I scroll to the id 'bottom-pane'
And
I should see
"Hi there"
And
I choose
"mail"
from user menu by id
And
I should see
"Hi there"
...
...
test/behat/features/social/social_media_buttons.feature
View file @
7d09acab
...
...
@@ -59,6 +59,7 @@ Scenario: Creating and accessing social media buttons (Bug 1448948)
And
I log out
# Logging in as UserB to try see the buttons
Given
I log in as
"UserB"
with password
"Kupuh1pa!"
And
I scroll to the id 'bottom-pane'
And
I follow
"Page UserA_01"
And
I should see
"Social Media"
And
I should see
"Facebook"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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