This commit is contained in:
Zixaphir 2013-05-05 15:05:10 -07:00
parent 057c7af8cc
commit 8d07da9866
5 changed files with 32 additions and 9 deletions

View File

@ -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.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE

View File

@ -18,7 +18,7 @@
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
// ==/UserScript==
/*
* 4chan X - Version 1.1.9 - 2013-05-03
* 4chan X - Version 1.1.9 - 2013-05-05
*
* Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
@ -2541,6 +2541,7 @@
}
});
$.on(root, endEvents, o.hoverend);
$.on(d, 'keydown', o.hoverend);
return $.on(root, 'mousemove', o.hover);
};
hover = function(e) {
@ -2557,9 +2558,13 @@
style.left = left;
return style.right = right;
};
hoverend = function() {
hoverend = function(e) {
if (e.type === 'keydown' && e.keyCode !== 13) {
return;
}
$.rm(this.el);
$.off(this.root, this.endEvents, this.hoverend);
$.off(d, 'keydown', this.hoverend);
$.off(this.root, 'mousemove', this.hover);
if (this.cb) {
return this.cb.call(this);

View File

@ -18,7 +18,7 @@
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
// ==/UserScript==
/*
* 4chan X - Version 1.1.9 - 2013-05-03
* 4chan X - Version 1.1.9 - 2013-05-05
*
* Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
@ -2537,6 +2537,7 @@
}
});
$.on(root, endEvents, o.hoverend);
$.on(d, 'keydown', o.hoverend);
return $.on(root, 'mousemove', o.hover);
};
hover = function(e) {
@ -2553,9 +2554,13 @@
style.left = left;
return style.right = right;
};
hoverend = function() {
hoverend = function(e) {
if (e.type === 'keydown' && e.keyCode !== 13) {
return;
}
$.rm(this.el);
$.off(this.root, this.endEvents, this.hoverend);
$.off(d, 'keydown', this.hoverend);
$.off(this.root, 'mousemove', this.hover);
if (this.cb) {
return this.cb.call(this);

View File

@ -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.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
@ -2539,6 +2539,7 @@
}
});
$.on(root, endEvents, o.hoverend);
$.on(d, 'keydown', o.hoverend);
return $.on(root, 'mousemove', o.hover);
};
hover = function(e) {
@ -2555,9 +2556,13 @@
style.left = left;
return style.right = right;
};
hoverend = function() {
hoverend = function(e) {
if (e.type === 'keydown' && e.keyCode !== 13) {
return;
}
$.rm(this.el);
$.off(this.root, this.endEvents, this.hoverend);
$.off(d, 'keydown', this.hoverend);
$.off(this.root, 'mousemove', this.hover);
if (this.cb) {
return this.cb.call(this);

View File

@ -203,7 +203,6 @@ UI = do ->
@parseEntry subEntry
return
dragstart = (e) ->
return if e.type is 'mousedown' and e.button isnt 0 # not LMB
# prevent text selection
@ -245,11 +244,13 @@ UI = do ->
o.up = dragend.bind o
$.on d, 'mousemove', o.move
$.on d, 'mouseup', o.up
touchmove = (e) ->
for touch in e.changedTouches
if touch.identifier is @identifier
drag.call @, touch
return
drag = (e) ->
{clientX, clientY} = e
@ -284,11 +285,13 @@ UI = do ->
style.right = right
style.top = top
style.bottom = bottom
touchend = (e) ->
for touch in e.changedTouches
if touch.identifier is @identifier
dragend.call @
return
dragend = ->
if @isTouching
$.off d, 'touchmove', @move
@ -318,7 +321,9 @@ UI = do ->
o.hover o.latestEvent if el.parentNode
$.on root, endEvents, o.hoverend
$.on d, 'keydown', o.hoverend
$.on root, 'mousemove', o.hover
hover = (e) ->
@latestEvent = e
height = @el.offsetHeight
@ -341,9 +346,12 @@ UI = do ->
style.top = top + 'px'
style.left = left
style.right = right
hoverend = ->
hoverend = (e) ->
return if e.type is 'keydown' and e.keyCode isnt 13
$.rm @el
$.off @root, @endEvents, @hoverend
$.off d, 'keydown', @hoverend
$.off @root, 'mousemove', @hover
@cb.call @ if @cb