Fix #155
This commit is contained in:
parent
057c7af8cc
commit
8d07da9866
2
LICENSE
2
LICENSE
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.1.9 - 2013-05-03
|
* 4chan X - Version 1.1.9 - 2013-05-05
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
|
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.1.9 - 2013-05-03
|
* 4chan X - Version 1.1.9 - 2013-05-05
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
||||||
@ -2541,6 +2541,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
$.on(root, endEvents, o.hoverend);
|
$.on(root, endEvents, o.hoverend);
|
||||||
|
$.on(d, 'keydown', o.hoverend);
|
||||||
return $.on(root, 'mousemove', o.hover);
|
return $.on(root, 'mousemove', o.hover);
|
||||||
};
|
};
|
||||||
hover = function(e) {
|
hover = function(e) {
|
||||||
@ -2557,9 +2558,13 @@
|
|||||||
style.left = left;
|
style.left = left;
|
||||||
return style.right = right;
|
return style.right = right;
|
||||||
};
|
};
|
||||||
hoverend = function() {
|
hoverend = function(e) {
|
||||||
|
if (e.type === 'keydown' && e.keyCode !== 13) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$.rm(this.el);
|
$.rm(this.el);
|
||||||
$.off(this.root, this.endEvents, this.hoverend);
|
$.off(this.root, this.endEvents, this.hoverend);
|
||||||
|
$.off(d, 'keydown', this.hoverend);
|
||||||
$.off(this.root, 'mousemove', this.hover);
|
$.off(this.root, 'mousemove', this.hover);
|
||||||
if (this.cb) {
|
if (this.cb) {
|
||||||
return this.cb.call(this);
|
return this.cb.call(this);
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
|
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.1.9 - 2013-05-03
|
* 4chan X - Version 1.1.9 - 2013-05-05
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
||||||
@ -2537,6 +2537,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
$.on(root, endEvents, o.hoverend);
|
$.on(root, endEvents, o.hoverend);
|
||||||
|
$.on(d, 'keydown', o.hoverend);
|
||||||
return $.on(root, 'mousemove', o.hover);
|
return $.on(root, 'mousemove', o.hover);
|
||||||
};
|
};
|
||||||
hover = function(e) {
|
hover = function(e) {
|
||||||
@ -2553,9 +2554,13 @@
|
|||||||
style.left = left;
|
style.left = left;
|
||||||
return style.right = right;
|
return style.right = right;
|
||||||
};
|
};
|
||||||
hoverend = function() {
|
hoverend = function(e) {
|
||||||
|
if (e.type === 'keydown' && e.keyCode !== 13) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$.rm(this.el);
|
$.rm(this.el);
|
||||||
$.off(this.root, this.endEvents, this.hoverend);
|
$.off(this.root, this.endEvents, this.hoverend);
|
||||||
|
$.off(d, 'keydown', this.hoverend);
|
||||||
$.off(this.root, 'mousemove', this.hover);
|
$.off(this.root, 'mousemove', this.hover);
|
||||||
if (this.cb) {
|
if (this.cb) {
|
||||||
return this.cb.call(this);
|
return this.cb.call(this);
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.1.9 - 2013-05-03
|
* 4chan X - Version 1.1.9 - 2013-05-05
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
||||||
@ -2539,6 +2539,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
$.on(root, endEvents, o.hoverend);
|
$.on(root, endEvents, o.hoverend);
|
||||||
|
$.on(d, 'keydown', o.hoverend);
|
||||||
return $.on(root, 'mousemove', o.hover);
|
return $.on(root, 'mousemove', o.hover);
|
||||||
};
|
};
|
||||||
hover = function(e) {
|
hover = function(e) {
|
||||||
@ -2555,9 +2556,13 @@
|
|||||||
style.left = left;
|
style.left = left;
|
||||||
return style.right = right;
|
return style.right = right;
|
||||||
};
|
};
|
||||||
hoverend = function() {
|
hoverend = function(e) {
|
||||||
|
if (e.type === 'keydown' && e.keyCode !== 13) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$.rm(this.el);
|
$.rm(this.el);
|
||||||
$.off(this.root, this.endEvents, this.hoverend);
|
$.off(this.root, this.endEvents, this.hoverend);
|
||||||
|
$.off(d, 'keydown', this.hoverend);
|
||||||
$.off(this.root, 'mousemove', this.hover);
|
$.off(this.root, 'mousemove', this.hover);
|
||||||
if (this.cb) {
|
if (this.cb) {
|
||||||
return this.cb.call(this);
|
return this.cb.call(this);
|
||||||
|
|||||||
@ -203,7 +203,6 @@ UI = do ->
|
|||||||
@parseEntry subEntry
|
@parseEntry subEntry
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
dragstart = (e) ->
|
dragstart = (e) ->
|
||||||
return if e.type is 'mousedown' and e.button isnt 0 # not LMB
|
return if e.type is 'mousedown' and e.button isnt 0 # not LMB
|
||||||
# prevent text selection
|
# prevent text selection
|
||||||
@ -245,11 +244,13 @@ UI = do ->
|
|||||||
o.up = dragend.bind o
|
o.up = dragend.bind o
|
||||||
$.on d, 'mousemove', o.move
|
$.on d, 'mousemove', o.move
|
||||||
$.on d, 'mouseup', o.up
|
$.on d, 'mouseup', o.up
|
||||||
|
|
||||||
touchmove = (e) ->
|
touchmove = (e) ->
|
||||||
for touch in e.changedTouches
|
for touch in e.changedTouches
|
||||||
if touch.identifier is @identifier
|
if touch.identifier is @identifier
|
||||||
drag.call @, touch
|
drag.call @, touch
|
||||||
return
|
return
|
||||||
|
|
||||||
drag = (e) ->
|
drag = (e) ->
|
||||||
{clientX, clientY} = e
|
{clientX, clientY} = e
|
||||||
|
|
||||||
@ -284,11 +285,13 @@ UI = do ->
|
|||||||
style.right = right
|
style.right = right
|
||||||
style.top = top
|
style.top = top
|
||||||
style.bottom = bottom
|
style.bottom = bottom
|
||||||
|
|
||||||
touchend = (e) ->
|
touchend = (e) ->
|
||||||
for touch in e.changedTouches
|
for touch in e.changedTouches
|
||||||
if touch.identifier is @identifier
|
if touch.identifier is @identifier
|
||||||
dragend.call @
|
dragend.call @
|
||||||
return
|
return
|
||||||
|
|
||||||
dragend = ->
|
dragend = ->
|
||||||
if @isTouching
|
if @isTouching
|
||||||
$.off d, 'touchmove', @move
|
$.off d, 'touchmove', @move
|
||||||
@ -318,7 +321,9 @@ UI = do ->
|
|||||||
o.hover o.latestEvent if el.parentNode
|
o.hover o.latestEvent if el.parentNode
|
||||||
|
|
||||||
$.on root, endEvents, o.hoverend
|
$.on root, endEvents, o.hoverend
|
||||||
|
$.on d, 'keydown', o.hoverend
|
||||||
$.on root, 'mousemove', o.hover
|
$.on root, 'mousemove', o.hover
|
||||||
|
|
||||||
hover = (e) ->
|
hover = (e) ->
|
||||||
@latestEvent = e
|
@latestEvent = e
|
||||||
height = @el.offsetHeight
|
height = @el.offsetHeight
|
||||||
@ -341,9 +346,12 @@ UI = do ->
|
|||||||
style.top = top + 'px'
|
style.top = top + 'px'
|
||||||
style.left = left
|
style.left = left
|
||||||
style.right = right
|
style.right = right
|
||||||
hoverend = ->
|
|
||||||
|
hoverend = (e) ->
|
||||||
|
return if e.type is 'keydown' and e.keyCode isnt 13
|
||||||
$.rm @el
|
$.rm @el
|
||||||
$.off @root, @endEvents, @hoverend
|
$.off @root, @endEvents, @hoverend
|
||||||
|
$.off d, 'keydown', @hoverend
|
||||||
$.off @root, 'mousemove', @hover
|
$.off @root, 'mousemove', @hover
|
||||||
@cb.call @ if @cb
|
@cb.call @ if @cb
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user