From 8bad58920a7f769ad1b050140c1cf070c8f50588 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Tue, 24 Dec 2013 16:31:09 -0700 Subject: [PATCH] Fix not var in obj, var not in obj --- builds/4chan-X.user.js | 12 ++++++------ builds/crx/script.js | 12 ++++++------ src/Archive/Redirect.coffee | 2 +- src/Filtering/Filter.coffee | 2 +- src/Miscellaneous/CatalogLinks.coffee | 2 +- src/Posting/QuickReply.coffee | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 6b21fcf3e..8edcc1bde 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -3661,7 +3661,7 @@ } filter = filter.replace(regexp[0], ''); boards = ((_ref1 = filter.match(/boards:([^;]+)/)) != null ? _ref1[1].toLowerCase() : void 0) || 'global'; - if (boards !== 'global' && (_ref2 = !g.BOARD.ID, __indexOf.call(boards.split(','), _ref2) >= 0)) { + if (boards !== 'global' && (_ref2 = g.BOARD.ID, __indexOf.call(boards.split(','), _ref2) < 0)) { continue; } if (key === 'uniqueID' || key === 'MD5') { @@ -6152,7 +6152,7 @@ _ref = match, match = _ref[0], type = _ref[1], val = _ref[2]; item = item.replace(match, ''); boards = ((_ref1 = item.match(/boards:([^;]+)/i)) != null ? _ref1[1].toLowerCase() : void 0) || 'global'; - if (boards !== 'global' && (_ref2 = !g.BOARD.ID, __indexOf.call(boards.split(','), _ref2) >= 0)) { + if (boards !== 'global' && (_ref2 = g.BOARD.ID, __indexOf.call(boards.split(','), _ref2) < 0)) { return; } if (type === 'password') { @@ -6502,7 +6502,7 @@ return $.rmClass(QR.nodes.filename, 'edit'); }); } - if (e.target.nodeName === 'INPUT' || (e.keyCode && ((_ref = !e.keyCode) === 32 || _ref === 13)) || e.ctrlKey) { + if (e.target.nodeName === 'INPUT' || (e.keyCode && ((_ref = e.keyCode) !== 32 && _ref !== 13)) || e.ctrlKey) { return; } e.preventDefault(); @@ -9994,7 +9994,7 @@ file: {} }, init: function() { - var archive, boardID, boards, data, id, name, type, _i, _len, _ref, _ref1, _ref2, _ref3; + var archive, boardID, boards, data, id, name, type, _i, _len, _ref, _ref1, _ref2; _ref = Conf['selectedArchives']; for (boardID in _ref) { @@ -10022,7 +10022,7 @@ if (!(boardID in Redirect.data.post || archive.software !== 'foolfuuka')) { Redirect.data.post[boardID] = archive; } - if (!(boardID in Redirect.data.file || (_ref3 = !boardID, __indexOf.call(archive.files, _ref3) >= 0))) { + if (!(boardID in Redirect.data.file || __indexOf.call(archive.files, boardID) < 0)) { Redirect.data.file[boardID] = archive; } } @@ -10395,7 +10395,7 @@ _ref = $$("#board-list a:not(.catalog), #boardNavDesktopFoot a"); for (_i = 0, _len = _ref.length; _i < _len; _i++) { a = _ref[_i]; - if (((_ref1 = !a.hostname) === 'boards.4chan.org' || _ref1 === 'catalog.neet.tv' || _ref1 === '4index.gropes.us') || !(board = a.pathname.split('/')[1]) || (board === 'f' || board === 'status' || board === '4chan')) { + if (((_ref1 = a.hostname) !== 'boards.4chan.org' && _ref1 !== 'catalog.neet.tv' && _ref1 !== '4index.gropes.us') || !(board = a.pathname.split('/')[1]) || (board === 'f' || board === 'status' || board === '4chan')) { continue; } a.href = generateURL(board); diff --git a/builds/crx/script.js b/builds/crx/script.js index 11e028f82..0eba1558f 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -3664,7 +3664,7 @@ } filter = filter.replace(regexp[0], ''); boards = ((_ref1 = filter.match(/boards:([^;]+)/)) != null ? _ref1[1].toLowerCase() : void 0) || 'global'; - if (boards !== 'global' && (_ref2 = !g.BOARD.ID, __indexOf.call(boards.split(','), _ref2) >= 0)) { + if (boards !== 'global' && (_ref2 = g.BOARD.ID, __indexOf.call(boards.split(','), _ref2) < 0)) { continue; } if (key === 'uniqueID' || key === 'MD5') { @@ -6160,7 +6160,7 @@ _ref = match, match = _ref[0], type = _ref[1], val = _ref[2]; item = item.replace(match, ''); boards = ((_ref1 = item.match(/boards:([^;]+)/i)) != null ? _ref1[1].toLowerCase() : void 0) || 'global'; - if (boards !== 'global' && (_ref2 = !g.BOARD.ID, __indexOf.call(boards.split(','), _ref2) >= 0)) { + if (boards !== 'global' && (_ref2 = g.BOARD.ID, __indexOf.call(boards.split(','), _ref2) < 0)) { return; } if (type === 'password') { @@ -6510,7 +6510,7 @@ return $.rmClass(QR.nodes.filename, 'edit'); }); } - if (e.target.nodeName === 'INPUT' || (e.keyCode && ((_ref = !e.keyCode) === 32 || _ref === 13)) || e.ctrlKey) { + if (e.target.nodeName === 'INPUT' || (e.keyCode && ((_ref = e.keyCode) !== 32 && _ref !== 13)) || e.ctrlKey) { return; } e.preventDefault(); @@ -9983,7 +9983,7 @@ file: {} }, init: function() { - var archive, boardID, boards, data, id, name, type, _i, _len, _ref, _ref1, _ref2, _ref3; + var archive, boardID, boards, data, id, name, type, _i, _len, _ref, _ref1, _ref2; _ref = Conf['selectedArchives']; for (boardID in _ref) { @@ -10011,7 +10011,7 @@ if (!(boardID in Redirect.data.post || archive.software !== 'foolfuuka')) { Redirect.data.post[boardID] = archive; } - if (!(boardID in Redirect.data.file || (_ref3 = !boardID, __indexOf.call(archive.files, _ref3) >= 0))) { + if (!(boardID in Redirect.data.file || __indexOf.call(archive.files, boardID) < 0)) { Redirect.data.file[boardID] = archive; } } @@ -10384,7 +10384,7 @@ _ref = $$("#board-list a:not(.catalog), #boardNavDesktopFoot a"); for (_i = 0, _len = _ref.length; _i < _len; _i++) { a = _ref[_i]; - if (((_ref1 = !a.hostname) === 'boards.4chan.org' || _ref1 === 'catalog.neet.tv' || _ref1 === '4index.gropes.us') || !(board = a.pathname.split('/')[1]) || (board === 'f' || board === 'status' || board === '4chan')) { + if (((_ref1 = a.hostname) !== 'boards.4chan.org' && _ref1 !== 'catalog.neet.tv' && _ref1 !== '4index.gropes.us') || !(board = a.pathname.split('/')[1]) || (board === 'f' || board === 'status' || board === '4chan')) { continue; } a.href = generateURL(board); diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index b4aa7137b..b6451c6fa 100755 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -17,7 +17,7 @@ Redirect = Redirect.data.thread[boardID] = archive unless boardID of Redirect.data.post or archive.software isnt 'foolfuuka' Redirect.data.post[boardID] = archive - unless boardID of Redirect.data.file or not boardID in archive.files + unless boardID of Redirect.data.file or boardID not in archive.files Redirect.data.file[boardID] = archive return diff --git a/src/Filtering/Filter.coffee b/src/Filtering/Filter.coffee index e6a8bd27f..934a5fa5f 100755 --- a/src/Filtering/Filter.coffee +++ b/src/Filtering/Filter.coffee @@ -21,7 +21,7 @@ Filter = # and it's not specifically applicable to the current board. # Defaults to global. boards = filter.match(/boards:([^;]+)/)?[1].toLowerCase() or 'global' - if boards isnt 'global' and not g.BOARD.ID in boards.split ',' + if boards isnt 'global' and g.BOARD.ID not in boards.split ',' continue if key in ['uniqueID', 'MD5'] diff --git a/src/Miscellaneous/CatalogLinks.coffee b/src/Miscellaneous/CatalogLinks.coffee index b60b7623c..e123e537c 100755 --- a/src/Miscellaneous/CatalogLinks.coffee +++ b/src/Miscellaneous/CatalogLinks.coffee @@ -33,7 +33,7 @@ CatalogLinks = (board) -> a.href = "/#{board}/#{path}" for a in $$ """#board-list a:not(.catalog), #boardNavDesktopFoot a""" - continue if not a.hostname in ['boards.4chan.org', 'catalog.neet.tv', '4index.gropes.us'] or + continue if a.hostname not in ['boards.4chan.org', 'catalog.neet.tv', '4index.gropes.us'] or !(board = a.pathname.split('/')[1]) or board in ['f', 'status', '4chan'] diff --git a/src/Posting/QuickReply.coffee b/src/Posting/QuickReply.coffee index 296fbc6a5..1b1dfd397 100755 --- a/src/Posting/QuickReply.coffee +++ b/src/Posting/QuickReply.coffee @@ -228,7 +228,7 @@ QR = item = item.replace match, '' boards = item.match(/boards:([^;]+)/i)?[1].toLowerCase() or 'global' - return if boards isnt 'global' and not g.BOARD.ID in boards.split ',' + return if boards isnt 'global' and g.BOARD.ID not in boards.split ',' if type is 'password' QR.persona.pwd = val @@ -492,7 +492,7 @@ QR = $.addClass QR.nodes.filename, 'edit' QR.nodes.filename.focus() return $.on QR.nodes.filename, 'blur', -> $.rmClass QR.nodes.filename, 'edit' - return if e.target.nodeName is 'INPUT' or (e.keyCode and not e.keyCode in [32, 13]) or e.ctrlKey + return if e.target.nodeName is 'INPUT' or (e.keyCode and e.keyCode not in [32, 13]) or e.ctrlKey e.preventDefault() QR.nodes.fileInput.click()