diff --git a/LICENSE b/LICENSE index 340559c95..f3beefff8 100755 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.2.44 - 2013-12-24 +* 4chan X - Version 1.2.44 - 2013-12-25 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 8edcc1bde..a43196151 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -22,7 +22,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.2.44 - 2013-12-24 +* 4chan X - Version 1.2.44 - 2013-12-25 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -3564,9 +3564,7 @@ } $.on(root, 'mousemove', o.hover); o.workaround = function(e) { - var _ref; - - if (_ref = e.target, __indexOf.call(root, _ref) < 0) { + if (!root.contains(e.target)) { return o.hoverend(); } }; @@ -4322,7 +4320,7 @@ return $.prepend(this.OP.nodes.root, ThreadHiding.makeButton(this, 'hide')); }, onIndexBuild: function(_arg) { - var i, nodes, root, thread, _i, _len, _ref; + var i, nodes, root, thread, _i, _len; nodes = _arg.detail; for (i = _i = 0, _len = nodes.length; _i < _len; i = _i += 2) { @@ -4333,7 +4331,7 @@ } if (!thread.stub) { nodes[i + 1].hidden = true; - } else if (_ref = thread.stub, __indexOf.call(root, _ref) < 0) { + } else if (!root.contains(thread.stub)) { ThreadHiding.makeStub(thread, root); } } @@ -7853,7 +7851,7 @@ return ImageExpand.toggle(Get.postFromNode(this)); }, toggleAll: function() { - var ID, file, func, post, _i, _len, _ref, _ref1, _ref2; + var ID, file, func, post, _i, _len, _ref, _ref1; $.event('CloseMenu'); if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) { @@ -7872,7 +7870,7 @@ for (_i = 0, _len = _ref1.length; _i < _len; _i++) { post = _ref1[_i]; file = post.file; - if (!(file && file.isImage && (_ref2 = post.nodes.root, __indexOf.call(doc, _ref2) >= 0))) { + if (!(file && file.isImage && doc.contains(post.nodes.root))) { continue; } if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || Conf['Expand from here'] && Header.getTopOf(file.thumb) < 0)) { @@ -8116,7 +8114,7 @@ var URL, post, src, timeoutID, _this = this; - if (__indexOf.call(doc, this) < 0) { + if (!doc.contains(this)) { return; } post = g.posts[this.dataset.fullID]; diff --git a/builds/crx/script.js b/builds/crx/script.js index 0eba1558f..9e825da8a 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.2.44 - 2013-12-24 +* 4chan X - Version 1.2.44 - 2013-12-25 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -4325,7 +4325,7 @@ return $.prepend(this.OP.nodes.root, ThreadHiding.makeButton(this, 'hide')); }, onIndexBuild: function(_arg) { - var i, nodes, root, thread, _i, _len, _ref; + var i, nodes, root, thread, _i, _len; nodes = _arg.detail; for (i = _i = 0, _len = nodes.length; _i < _len; i = _i += 2) { @@ -4336,7 +4336,7 @@ } if (!thread.stub) { nodes[i + 1].hidden = true; - } else if (_ref = thread.stub, __indexOf.call(root, _ref) < 0) { + } else if (!root.contains(thread.stub)) { ThreadHiding.makeStub(thread, root); } } @@ -7836,7 +7836,7 @@ return ImageExpand.toggle(Get.postFromNode(this)); }, toggleAll: function() { - var ID, file, func, post, _i, _len, _ref, _ref1, _ref2; + var ID, file, func, post, _i, _len, _ref, _ref1; $.event('CloseMenu'); if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) { @@ -7855,7 +7855,7 @@ for (_i = 0, _len = _ref1.length; _i < _len; _i++) { post = _ref1[_i]; file = post.file; - if (!(file && file.isImage && (_ref2 = post.nodes.root, __indexOf.call(doc, _ref2) >= 0))) { + if (!(file && file.isImage && doc.contains(post.nodes.root))) { continue; } if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || Conf['Expand from here'] && Header.getTopOf(file.thumb) < 0)) { @@ -8099,7 +8099,7 @@ var URL, post, src, timeoutID, _this = this; - if (__indexOf.call(doc, this) < 0) { + if (!doc.contains(this)) { return; } post = g.posts[this.dataset.fullID]; diff --git a/src/Filtering/ThreadHiding.coffee b/src/Filtering/ThreadHiding.coffee index 2400f55ed..d803c22bc 100755 --- a/src/Filtering/ThreadHiding.coffee +++ b/src/Filtering/ThreadHiding.coffee @@ -21,7 +21,7 @@ ThreadHiding = continue unless thread.isHidden unless thread.stub nodes[i + 1].hidden = true - else unless thread.stub in root + else unless root.contains thread.stub # When we come back to a page, the stub is already there. ThreadHiding.makeStub thread, root return diff --git a/src/General/UI.coffee b/src/General/UI.coffee index 844212ffe..2636bf415 100755 --- a/src/General/UI.coffee +++ b/src/General/UI.coffee @@ -326,7 +326,7 @@ UI = do -> $.on root, 'mousemove', o.hover <% if (type === 'userscript') { %> # Workaround for https://github.com/MayhemYDG/4chan-x/issues/377 - o.workaround = (e) -> o.hoverend() unless e.target in root + o.workaround = (e) -> o.hoverend() unless root.contains e.target $.on doc, 'mousemove', o.workaround <% } %> diff --git a/src/Images/ImageExpand.coffee b/src/Images/ImageExpand.coffee index d82a20fe2..135a50481 100755 --- a/src/Images/ImageExpand.coffee +++ b/src/Images/ImageExpand.coffee @@ -43,7 +43,7 @@ ImageExpand = for ID, post of g.posts for post in [post].concat post.clones {file} = post - continue unless file and file.isImage and post.nodes.root in doc + continue unless file and file.isImage and doc.contains post.nodes.root if ImageExpand.on and (!Conf['Expand spoilers'] and file.isSpoiler or Conf['Expand from here'] and Header.getTopOf(file.thumb) < 0) diff --git a/src/Images/ImageHover.coffee b/src/Images/ImageHover.coffee index e09cd55f3..9116a6c95 100755 --- a/src/Images/ImageHover.coffee +++ b/src/Images/ImageHover.coffee @@ -23,7 +23,7 @@ ImageHover = asapTest: -> el.naturalHeight $.on el, 'error', ImageHover.error error: -> - return unless @ in doc + return unless doc.contains @ post = g.posts[@dataset.fullID] src = @src.split '/'