From 228eba30fbf21aa2ae08d51a00b6558d761a46f8 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sat, 22 Mar 2014 12:32:06 -0700 Subject: [PATCH 1/3] Fuck protocols. Conflicts: LICENSE builds/4chan-X.user.js builds/crx/script.js --- LICENSE | 2 +- builds/4chan-X.user.js | 4 ++-- builds/crx/script.js | 4 ++-- src/Linkification/Linkify.coffee | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/LICENSE b/LICENSE index c371fb8c8..96d8515f9 100755 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.4.1 - 2014-03-21 +* 4chan X - Version 1.4.1 - 2014-03-22 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 98f5fdf95..b42eb1ab7 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -24,7 +24,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.4.1 - 2014-03-21 +* 4chan X - Version 1.4.1 - 2014-03-22 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE @@ -8566,7 +8566,7 @@ range.setEnd(range.endContainer, range.endOffset - i); } } - if (!/(https?|mailto|git|magnet|ftp|irc):/.test(text)) { + if (!/(mailto:|.+:\/\/)/.test(text)) { text = (/@/.test(text) ? 'mailto:' : 'http://') + text; } a = $.el('a', { diff --git a/builds/crx/script.js b/builds/crx/script.js index 661285298..ec5953a36 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.4.1 - 2014-03-21 +* 4chan X - Version 1.4.1 - 2014-03-22 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE @@ -8581,7 +8581,7 @@ range.setEnd(range.endContainer, range.endOffset - i); } } - if (!/(https?|mailto|git|magnet|ftp|irc):/.test(text)) { + if (!/(mailto:|.+:\/\/)/.test(text)) { text = (/@/.test(text) ? 'mailto:' : 'http://') + text; } a = $.el('a', { diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index 682b33cf4..1748cbd7f 100755 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -116,7 +116,7 @@ Linkify = range.setEnd range.endContainer, range.endOffset - i # Make our link 'valid' if it is formatted incorrectly. - unless /(https?|mailto|git|magnet|ftp|irc):/.test text + unless /(mailto:|.+:\/\/)/.test text text = ( if /@/.test text 'mailto:' From 55e43147edeeff07e5c69fddb934aa8e54467ff8 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sun, 23 Mar 2014 12:32:40 -0700 Subject: [PATCH 2/3] Redundant --- LICENSE | 2 +- builds/4chan-X.user.js | 5 +---- builds/crx/script.js | 5 +---- src/General/Index.coffee | 2 -- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/LICENSE b/LICENSE index 96d8515f9..d40318abb 100755 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.4.1 - 2014-03-22 +* 4chan X - Version 1.4.1 - 2014-03-23 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index b42eb1ab7..97c1ad627 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -24,7 +24,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.4.1 - 2014-03-22 +* 4chan X - Version 1.4.1 - 2014-03-23 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE @@ -2526,9 +2526,6 @@ }); $.on(this.button, 'click', this.update); Header.addShortcut(this.button, 1); - if (g.BOARD.ID === 'f') { - return; - } this.db = new DataBoard('pinnedThreads'); Thread.callbacks.push({ name: 'Thread Pinning', diff --git a/builds/crx/script.js b/builds/crx/script.js index ec5953a36..adb9060f0 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.4.1 - 2014-03-22 +* 4chan X - Version 1.4.1 - 2014-03-23 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE @@ -2585,9 +2585,6 @@ }); $.on(this.button, 'click', this.update); Header.addShortcut(this.button, 1); - if (g.BOARD.ID === 'f') { - return; - } this.db = new DataBoard('pinnedThreads'); Thread.callbacks.push({ name: 'Thread Pinning', diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 46c6e8cf3..b48016e69 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -13,8 +13,6 @@ Index = $.on @button, 'click', @update Header.addShortcut @button, 1 - return if g.BOARD.ID is 'f' - @db = new DataBoard 'pinnedThreads' Thread.callbacks.push name: 'Thread Pinning' From 2da04a635b34f0779a26bfa277d5c6dde4039a2a Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sun, 23 Mar 2014 14:28:42 -0700 Subject: [PATCH 3/3] Thread Updater Increment issue. --- builds/4chan-X.user.js | 9 ++++++--- builds/crx/script.js | 9 ++++++--- src/Monitoring/ThreadUpdater.coffee | 8 +++++--- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 97c1ad627..9bdd85bea 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -9597,7 +9597,8 @@ ThreadUpdater.root = this.OP.nodes.root.parentNode; ThreadUpdater.lastPost = +this.posts.keys[this.posts.keys.length - 1]; ThreadUpdater.cb.interval.call($.el('input', { - value: Conf['Interval'] + value: Conf['Interval'], + name: 'Interval' })); $.on(window, 'online offline', ThreadUpdater.cb.online); $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost); @@ -9663,14 +9664,16 @@ return !d.hidden; }; }, - interval: function() { + interval: function(e) { var val; val = parseInt(this.value, 10); if (val < 1) { val = 1; } ThreadUpdater.interval = this.value = val; - return $.cb.value.call(this); + if (e) { + return $.cb.value.call(this); + } }, load: function(e) { var klass, req, text, _ref; diff --git a/builds/crx/script.js b/builds/crx/script.js index adb9060f0..1e4c864fc 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -9612,7 +9612,8 @@ ThreadUpdater.root = this.OP.nodes.root.parentNode; ThreadUpdater.lastPost = +this.posts.keys[this.posts.keys.length - 1]; ThreadUpdater.cb.interval.call($.el('input', { - value: Conf['Interval'] + value: Conf['Interval'], + name: 'Interval' })); $.on(window, 'online offline', ThreadUpdater.cb.online); $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost); @@ -9678,14 +9679,16 @@ return !d.hidden; }; }, - interval: function() { + interval: function(e) { var val; val = parseInt(this.value, 10); if (val < 1) { val = 1; } ThreadUpdater.interval = this.value = val; - return $.cb.value.call(this); + if (e) { + return $.cb.value.call(this); + } }, load: function(e) { var klass, req, text, _ref; diff --git a/src/Monitoring/ThreadUpdater.coffee b/src/Monitoring/ThreadUpdater.coffee index d35d187cb..59208ff4a 100755 --- a/src/Monitoring/ThreadUpdater.coffee +++ b/src/Monitoring/ThreadUpdater.coffee @@ -97,7 +97,9 @@ ThreadUpdater = ThreadUpdater.root = @OP.nodes.root.parentNode ThreadUpdater.lastPost = +@posts.keys[@posts.keys.length - 1] - ThreadUpdater.cb.interval.call $.el 'input', value: Conf['Interval'] + ThreadUpdater.cb.interval.call $.el 'input', + value: Conf['Interval'] + name: 'Interval' $.on window, 'online offline', ThreadUpdater.cb.online $.on d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost @@ -147,11 +149,11 @@ ThreadUpdater = -> true else -> not d.hidden - interval: -> + interval: (e) -> val = parseInt @value, 10 if val < 1 then val = 1 ThreadUpdater.interval = @value = val - $.cb.value.call @ + $.cb.value.call @ if e load: (e) -> {req} = ThreadUpdater switch req.status