From e4efa68044a9494fff2c64bcf12a0a232d679738 Mon Sep 17 00:00:00 2001 From: Brandon Date: Sat, 3 May 2014 12:46:16 -0700 Subject: [PATCH 1/2] fix #714 --- builds/4chan-X.user.js | 8 ++++---- builds/crx/script.js | 8 ++++---- src/General/Main.coffee | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 31240de88..c579e76bb 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -14012,11 +14012,11 @@ } if (!Conf['JSON Navigation'] || g.VIEW === 'thread') { Main.initThread(); - $.add(d.head, $.el('link', { - href: "//s.4cdn.org/css/flags.556.css", - rel: "stylesheet" - })); } + $.add(d.head, $.el('link', { + href: "//s.4cdn.org/css/flags.556.css", + rel: "stylesheet" + })); $.event('4chanXInitFinished'); test = $.el('span'); test.classList.add('a', 'b'); diff --git a/builds/crx/script.js b/builds/crx/script.js index 293ec4e3c..5004d1512 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -14030,11 +14030,11 @@ } if (!Conf['JSON Navigation'] || g.VIEW === 'thread') { Main.initThread(); - $.add(d.head, $.el('link', { - href: "//s.4cdn.org/css/flags.556.css", - rel: "stylesheet" - })); } + $.add(d.head, $.el('link', { + href: "//s.4cdn.org/css/flags.556.css", + rel: "stylesheet" + })); $.event('4chanXInitFinished'); try { return localStorage.getItem('4chan-settings'); diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 3842c671b..8874fdf19 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -201,10 +201,10 @@ Main = if !Conf['JSON Navigation'] or g.VIEW is 'thread' Main.initThread() - # JSON Navigation may not load on a page that has flags, so force their CSS to always be available. - $.add d.head, $.el 'link', - href: "//s.4cdn.org/css/flags.556.css" - rel: "stylesheet" + # JSON Navigation may not load on a page that has flags, so force their CSS to always be available. + $.add d.head, $.el 'link', + href: "//s.4cdn.org/css/flags.556.css" + rel: "stylesheet" $.event '4chanXInitFinished' From 0faacd737e27b03b05b36dab625c80f85bad2a3e Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sat, 3 May 2014 16:05:46 -0700 Subject: [PATCH 2/2] Revert "Lets pretend we're smarter than we really are!" This reverts commit 393eb3ec2289293dd4d4caaef17db33bb695fa30. Conflicts: LICENSE builds/4chan-X.user.js builds/crx/script.js --- builds/4chan-X.user.js | 8 ++++---- builds/crx/script.js | 8 ++++---- src/Miscellaneous/Time.coffee | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index c579e76bb..243ac8b77 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1175,7 +1175,7 @@ Post.prototype.parseQuote = function(quotelink) { var fullID, match; - if (!(match = quotelink.href.match(/boards\.4chan\.org\/([^\/]+)\/(res|thread)\/\d+.*\#p(\d+)$/))) { + if (!(match = quotelink.href.match(/boards\.4chan\.org\/([^\/]+)\/thread\/\d+.*\#p(\d+)$/))) { return; } this.nodes.quotelinks.push(quotelink); @@ -12682,18 +12682,18 @@ if (this.isClone) { return; } - return this.nodes.date.textContent = Time.funk(this.info.date); + return this.nodes.date.textContent = Time.funk(Time, this.info.date); }, createFunc: function(format) { var code; code = format.replace(/%([A-Za-z])/g, function(s, c) { if (c in Time.formatters) { - return "' + this.formatters." + c + ".call(date) + '"; + return "' + Time.formatters." + c + ".call(date) + '"; } else { return s; } }); - return Function('date', "return '" + code + "'"); + return Function('Time', 'date', "return '" + code + "'"); }, day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], diff --git a/builds/crx/script.js b/builds/crx/script.js index 5004d1512..b625e4088 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1231,7 +1231,7 @@ Post.prototype.parseQuote = function(quotelink) { var fullID, match; - if (!(match = quotelink.href.match(/boards\.4chan\.org\/([^\/]+)\/(res|thread)\/\d+.*\#p(\d+)$/))) { + if (!(match = quotelink.href.match(/boards\.4chan\.org\/([^\/]+)\/thread\/\d+.*\#p(\d+)$/))) { return; } this.nodes.quotelinks.push(quotelink); @@ -12697,18 +12697,18 @@ if (this.isClone) { return; } - return this.nodes.date.textContent = Time.funk(this.info.date); + return this.nodes.date.textContent = Time.funk(Time, this.info.date); }, createFunc: function(format) { var code; code = format.replace(/%([A-Za-z])/g, function(s, c) { if (c in Time.formatters) { - return "' + this.formatters." + c + ".call(date) + '"; + return "' + Time.formatters." + c + ".call(date) + '"; } else { return s; } }); - return Function('date', "return '" + code + "'"); + return Function('Time', 'date', "return '" + code + "'"); }, day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], diff --git a/src/Miscellaneous/Time.coffee b/src/Miscellaneous/Time.coffee index 0f08befa2..0d290cc63 100755 --- a/src/Miscellaneous/Time.coffee +++ b/src/Miscellaneous/Time.coffee @@ -8,14 +8,14 @@ Time = cb: @node node: -> return if @isClone - @nodes.date.textContent = Time.funk @info.date + @nodes.date.textContent = Time.funk Time, @info.date createFunc: (format) -> code = format.replace /%([A-Za-z])/g, (s, c) -> if c of Time.formatters - "' + this.formatters.#{c}.call(date) + '" + "' + Time.formatters.#{c}.call(date) + '" else s - Function 'date', "return '#{code}'" + Function 'Time', 'date', "return '#{code}'" day: [ 'Sunday' 'Monday'