From 3e7240dd7945b49439d3bc2c763079484b925bbb Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 9 Apr 2013 18:50:29 +0200 Subject: [PATCH 01/16] Add a label to the custom CSS checkbox. --- src/features.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/features.coffee b/src/features.coffee index bbdb3e3b2..d270edf92 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -673,7 +673,9 @@ Settings =
- Custom CSS + + +
From 1be56f8f05e628523c33d3410cdc40af0088d3bf Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 9 Apr 2013 22:09:46 +0200 Subject: [PATCH 02/16] Fix the post menu -> filter not being applied instantly in the setting textarea. --- src/features.coffee | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/features.coffee b/src/features.coffee index d270edf92..6e6d537a1 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -1101,16 +1101,16 @@ Filter = re $.set type, save - # Open the settings and display & focus the relevant filter textarea. - Settings.open 'Filter' - section = $ '.section-container' - select = $ 'select[name=filter]', section - select.value = type - Settings.selectFilter.call select - ta = $ 'textarea', section - tl = ta.textLength - ta.setSelectionRange tl, tl - ta.focus() + # Open the settings and display & focus the relevant filter textarea. + Settings.open 'Filter' + section = $ '.section-container' + select = $ 'select[name=filter]', section + select.value = type + Settings.selectFilter.call select + ta = $ 'textarea', section + tl = ta.textLength + ta.setSelectionRange tl, tl + ta.focus() ThreadHiding = init: -> From a472dae321ce1a8f58aacd061ce16547984ef635 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 10 Apr 2013 01:35:16 +0200 Subject: [PATCH 03/16] Alert v2 users that v2 needs to be disabled. --- src/main.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.coffee b/src/main.coffee index 02650cce5..7cf9ab4af 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -464,6 +464,9 @@ Main = Main.callbackNodes Thread, threads Main.callbackNodes Post, posts + if $.hasClass d.body, 'fourchan_x' + alert '4chan X v2 detected: Disable it or v3 will break.' + $.event '4chanXInitFinished' Main.checkUpdate() From 8116b48d084364e1472c72e16323bce95c8dcb22 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 10 Apr 2013 01:50:05 +0200 Subject: [PATCH 04/16] Fix missing default when using the menu to filter. Don't add `;op:yes` since that's the default already. --- src/features.coffee | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/features.coffee b/src/features.coffee index 6e6d537a1..b0c840570 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -1083,16 +1083,13 @@ Filter = else "\\#{c}" - re = - if type in ['uniqueID', 'MD5'] - "/#{re}/" - else - "/^#{re}$/" - unless Filter.menu.post.isReply - re += ';op:yes' + re = if type in ['uniqueID', 'MD5'] + "/#{re}/" + else + "/^#{re}$/" # Add a new line before the regexp unless the text is empty. - $.get type, '', (item) -> + $.get type, Conf[type], (item) -> save = item[type] save = if save From 0a00fc4228773bc118d86ccc53add47c278e049a Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 10 Apr 2013 02:45:03 +0200 Subject: [PATCH 05/16] Update compress deps. --- Gruntfile.js | 7 ++++--- package.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 9e7acb52b..b51ae6de0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -104,13 +104,14 @@ module.exports = function(grunt) { compress: { crx: { options: { - archive: 'builds/4chan-X.zip', + archive: 'builds/<%= pkg.name %>.zip', level: 9, pretty: true }, expand: true, - cwd: 'builds/crx/', - src: '**' + flatten: true, + src: 'builds/crx/*', + dest: '/' } }, clean: { diff --git a/package.json b/package.json index 1877b74e6..3cde77411 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "grunt-bump": "~0.0.0", "grunt-contrib-clean": "~0.4.0", "grunt-contrib-coffee": "~0.6.5", - "grunt-contrib-compress": "~0.4.7", + "grunt-contrib-compress": "~0.4.9", "grunt-contrib-concat": "~0.1.3", "grunt-contrib-copy": "~0.4.1", "grunt-contrib-watch": "~0.3.1", From 050094e17a88835242add391d406dbbe2b2c85ed Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 10 Apr 2013 10:11:57 +0200 Subject: [PATCH 06/16] The metadata description should use the package description. --- src/metadata.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/metadata.js b/src/metadata.js index 62ffec242..8371b5a41 100644 --- a/src/metadata.js +++ b/src/metadata.js @@ -2,7 +2,7 @@ // @name <%= meta.name %> // @version <%= version %> // @namespace <%= name %> -// @description Cross-browser userscript for maximum lurking on 4chan. +// @description <%= description %> // @copyright 2009-2011 James Campos // @copyright 2012-<%= grunt.template.today('yyyy') %> Nicolas Stepien // @license MIT; http://en.wikipedia.org/wiki/Mit_license From 24f4e0d8d8175877855a795544e8475dc4650675 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 10 Apr 2013 14:18:00 +0200 Subject: [PATCH 07/16] Fix #1011 --- src/features.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/features.coffee b/src/features.coffee index b0c840570..257c47c72 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -1778,7 +1778,8 @@ Keybinds = return unless /(Esc|Alt|Ctrl|Meta)/.test key threadRoot = Nav.getThread() - thread = Get.postFromNode($('.op', threadRoot)).thread + if op = $ '.op', threadRoot + thread = Get.postFromNode(op).thread switch key # QR & Options when Conf['Toggle board list'] From 6425a2a36d08712a6241158df5fd4bb04c780cd9 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 10 Apr 2013 15:42:34 +0200 Subject: [PATCH 08/16] Update deps. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3cde77411..eca7ee556 100644 --- a/package.json +++ b/package.json @@ -19,9 +19,9 @@ "grunt": "~0.4.1", "grunt-bump": "~0.0.0", "grunt-contrib-clean": "~0.4.0", - "grunt-contrib-coffee": "~0.6.5", + "grunt-contrib-coffee": "~0.6.6", "grunt-contrib-compress": "~0.4.9", - "grunt-contrib-concat": "~0.1.3", + "grunt-contrib-concat": "~0.2.0", "grunt-contrib-copy": "~0.4.1", "grunt-contrib-watch": "~0.3.1", "grunt-exec": "~0.4.0" From 182046f254f038016533fcd8807173d00eed84ad Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 10 Apr 2013 21:53:06 +0200 Subject: [PATCH 09/16] Close #1003. --- src/features.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/features.coffee b/src/features.coffee index 257c47c72..29696f9a7 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -54,6 +54,8 @@ Header = @setBarVisibility Conf['Header auto-hide'] $.sync 'Header auto-hide', @setBarVisibility + $.on d, 'CreateNotification', @createNotification + $.asap (-> d.body), -> return unless Main.isThisPageLegit() # Wait for #boardNavMobile instead of #boardNavDesktop, @@ -188,6 +190,11 @@ Header = menuToggle: (e) -> Header.menu.toggle e, @, g + createNotification: (e) -> + {type, content, lifetime, cb} = e.detail + notif = new Notification type, content, lifetime + cb notif if cb + class Notification constructor: (type, content, @timeout) -> @add = add.bind @ From 0e42ac6476f3962abcecd94df82a21bd4b19cbfe Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 10 Apr 2013 22:34:58 +0200 Subject: [PATCH 10/16] Warn Firefox <20 users. --- src/main.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.coffee b/src/main.coffee index 7cf9ab4af..95fcc6f47 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -466,6 +466,8 @@ Main = if $.hasClass d.body, 'fourchan_x' alert '4chan X v2 detected: Disable it or v3 will break.' + if /Firefox\/1/.test navigator.userAgent + alert 'Your version of Firefox is incompatible with 4chan X v3. Firefox 20+ is required.' $.event '4chanXInitFinished' Main.checkUpdate() From 48b0e7d863dc3a531f8c8872d68d6de0e1c970c1 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 10 Apr 2013 22:40:35 +0200 Subject: [PATCH 11/16] Release 4chan X v3.0.3. --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 234582144..1f1e3ab63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 3.0.3 - *2013-04-10* + +- Minor fixes. + ### 3.0.2 - *2013-04-09* - Added a setting in the Header's menu to move it at the bottom of the screen. diff --git a/package.json b/package.json index eca7ee556..8f6d5276e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "4chan-X", - "version": "3.0.2", + "version": "3.0.3", "description": "Cross-browser extension for productive lurking on 4chan.", "meta": { "name": "4chan X", From 195a5cb241ffe392f710fd62a36be031738ac5c1 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 11 Apr 2013 03:05:36 +0200 Subject: [PATCH 12/16] Send the tags first. --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index b51ae6de0..577bbe493 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -81,7 +81,7 @@ module.exports = function(grunt) { stdout: true }, push: { - command: 'git push origin --all && git push origin --tags -f', + command: 'git push origin --tags -f && git push origin --all', stdout: true } }, From 13c44dbf50bd589293f78f88a9a9b9ebbe7f5945 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 11 Apr 2013 10:36:16 +0200 Subject: [PATCH 13/16] Fix #1016 --- src/features.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features.coffee b/src/features.coffee index 29696f9a7..c34b8f844 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -738,7 +738,7 @@ Settings = """ togglecss: -> - if $('textarea', @parentNode.parentNode).disabled = !@checked + if $('textarea[name=usercss]', $.x 'ancestor::fieldset[1]', @).disabled = !@checked CustomCSS.rmStyle() else CustomCSS.addStyle() From 5d824c934518c82e33414f164c5abffe538651e5 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 11 Apr 2013 10:43:01 +0200 Subject: [PATCH 14/16] Fix #1015 --- src/qr.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qr.coffee b/src/qr.coffee index aa1f79318..6670cc192 100644 --- a/src/qr.coffee +++ b/src/qr.coffee @@ -834,6 +834,7 @@ QR = if g.BOARD.ID is 'f' filetag = QR.nodes.flashTag.value threadID = QR.nodes.thread.value + thread = g.BOARD.threads[threadID] # prevent errors if threadID is 'new' @@ -846,7 +847,7 @@ QR = err = 'You can\'t reply to this thread anymore.' else unless post.com or post.file err = 'No file selected.' - else if post.file and g.BOARD.threads[threadID].fileLimit + else if post.file and thread.fileLimit and !thread.isSticky err = 'Max limit of image replies has been reached.' if QR.captcha.isEnabled and !err From 174c6a9e98466241d5545a1d2f3d8623015c38d4 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 11 Apr 2013 10:44:07 +0200 Subject: [PATCH 15/16] Release 4chan X v3.0.4. --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f1e3ab63..a71bbf936 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 3.0.4 - *2013-04-11* + +- More minor fixes. + ### 3.0.3 - *2013-04-10* - Minor fixes. diff --git a/package.json b/package.json index 8f6d5276e..065c3ed6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "4chan-X", - "version": "3.0.3", + "version": "3.0.4", "description": "Cross-browser extension for productive lurking on 4chan.", "meta": { "name": "4chan X", From d2b541f7ff5516646121b7526673613e1c4c1d79 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sat, 13 Apr 2013 00:39:37 +0200 Subject: [PATCH 16/16] Tiny optimization for relative dates. --- src/features.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features.coffee b/src/features.coffee index c34b8f844..8b6407f91 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -3113,7 +3113,7 @@ RelativeDates = diff = now - date relative = RelativeDates.relative diff, now, date for singlePost in [post].concat post.clones - singlePost.nodes.date.textContent = relative + singlePost.nodes.date.firstChild.textContent = relative setOwnTimeout diff markStale = -> RelativeDates.stale.push update