From ef1477fb8e4c2492111c42d8fe79327e247546a1 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Tue, 28 May 2013 06:45:17 -0700 Subject: [PATCH] remove __indexOf --- LICENSE | 2 +- builds/4chan-X.js | 9 ++++----- builds/4chan-X.user.js | 9 ++++----- builds/crx/script.js | 6 +++--- src/Miscellaneous/AnnouncementHiding.coffee | 2 +- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/LICENSE b/LICENSE index 235153176..5ffac315b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.2.12 - 2013-05-27 +* 4chan X - Version 1.2.12 - 2013-05-28 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.js b/builds/4chan-X.js index d810fa624..1f3213fc9 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -19,7 +19,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.12 - 2013-05-27 +* 4chan X - Version 1.2.12 - 2013-05-28 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -113,8 +113,7 @@ __slice = [].slice, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; + __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; Config = { main: { @@ -8124,12 +8123,12 @@ hiddenPSAs: null }; $.get(items, function(_arg) { - var hiddenPSA, hiddenPSAs, _ref; + var hiddenPSA, hiddenPSAs; hiddenPSA = _arg.hiddenPSA, hiddenPSAs = _arg.hiddenPSAs; if (hiddenPSAs) { $["delete"]('hiddenPSAs'); - if (_ref = psa.textContent.replace(/\W+/g, '').toLowerCase(), __indexOf.call(hiddenPSAs, _ref) >= 0) { + if (hiddenPSAs.contains(psa.textContent.replace(/\W+/g, '').toLowerCase())) { hiddenPSA = +$.id('globalMessage').dataset.utc; $.set('hiddenPSA', hiddenPSA); } diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 0cd01dfa2..bb0970cd2 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -19,7 +19,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.12 - 2013-05-27 +* 4chan X - Version 1.2.12 - 2013-05-28 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -113,8 +113,7 @@ __slice = [].slice, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; + __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; Config = { main: { @@ -8118,12 +8117,12 @@ hiddenPSAs: null }; $.get(items, function(_arg) { - var hiddenPSA, hiddenPSAs, _ref; + var hiddenPSA, hiddenPSAs; hiddenPSA = _arg.hiddenPSA, hiddenPSAs = _arg.hiddenPSAs; if (hiddenPSAs) { $["delete"]('hiddenPSAs'); - if (_ref = psa.textContent.replace(/\W+/g, '').toLowerCase(), __indexOf.call(hiddenPSAs, _ref) >= 0) { + if (hiddenPSAs.contains(psa.textContent.replace(/\W+/g, '').toLowerCase())) { hiddenPSA = +$.id('globalMessage').dataset.utc; $.set('hiddenPSA', hiddenPSA); } diff --git a/builds/crx/script.js b/builds/crx/script.js index 74e1c01ca..a0f126ff4 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.2.12 - 2013-05-27 +* 4chan X - Version 1.2.12 - 2013-05-28 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -8101,12 +8101,12 @@ hiddenPSAs: null }; $.get(items, function(_arg) { - var hiddenPSA, hiddenPSAs, _ref; + var hiddenPSA, hiddenPSAs; hiddenPSA = _arg.hiddenPSA, hiddenPSAs = _arg.hiddenPSAs; if (hiddenPSAs) { $["delete"]('hiddenPSAs'); - if (_ref = psa.textContent.replace(/\W+/g, '').toLowerCase(), __indexOf.call(hiddenPSAs, _ref) >= 0) { + if (hiddenPSAs.contains(psa.textContent.replace(/\W+/g, '').toLowerCase())) { hiddenPSA = +$.id('globalMessage').dataset.utc; $.set('hiddenPSA', hiddenPSA); } diff --git a/src/Miscellaneous/AnnouncementHiding.coffee b/src/Miscellaneous/AnnouncementHiding.coffee index 13ae4331d..81dd3954e 100644 --- a/src/Miscellaneous/AnnouncementHiding.coffee +++ b/src/Miscellaneous/AnnouncementHiding.coffee @@ -38,7 +38,7 @@ PSAHiding = $.get items, ({hiddenPSA, hiddenPSAs}) -> if hiddenPSAs $.delete 'hiddenPSAs' - if psa.textContent.replace(/\W+/g, '').toLowerCase() in hiddenPSAs + if hiddenPSAs.contains psa.textContent.replace(/\W+/g, '').toLowerCase() hiddenPSA = +$.id('globalMessage').dataset.utc $.set 'hiddenPSA', hiddenPSA PSAHiding.sync hiddenPSA