From b842063d3d11ac78b9e85b5d3dc96f5618fe5e85 Mon Sep 17 00:00:00 2001 From: James Campos Date: Mon, 12 Sep 2011 22:52:58 -0700 Subject: [PATCH 1/4] fix #275 --- 4chan_x.user.js | 13 +++++++++---- script.coffee | 10 +++++++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index cb2f03128..8639af09a 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2056,12 +2056,17 @@ return g.callbacks.push(Time.node); }, node: function(root) { - var day, hour, min, month, s, time, year, _, _ref; + var day, hour, min, month, node, tc, time, year, _, _ref; if (root.className === 'inline') { return; } - s = $('span[id^=no]', root).previousSibling; - _ref = s.textContent.match(/(\d+)\/(\d+)\/(\d+)\(\w+\)(\d+):(\d+)/), _ = _ref[0], month = _ref[1], day = _ref[2], year = _ref[3], hour = _ref[4], min = _ref[5]; + node = $('span[id]', root).previousSibling; + tc = node.textContent; + if (tc === ' ') { + node = node.previousSibling; + tc = node.textContent; + } + _ref = tc.match(/(\d+)\/(\d+)\/(\d+)\(\w+\)(\d+):(\d+)/), _ = _ref[0], month = _ref[1], day = _ref[2], year = _ref[3], hour = _ref[4], min = _ref[5]; year = "20" + year; month -= 1; hour = g.chanOffset + Number(hour); @@ -2069,7 +2074,7 @@ time = $.el('time', { textContent: ' ' + Time.funk(Time) + ' ' }); - return $.replace(s, time); + return $.replace(node, time); }, foo: function() { var code; diff --git a/script.coffee b/script.coffee index 1837a71da..5e0a6591a 100644 --- a/script.coffee +++ b/script.coffee @@ -1618,9 +1618,13 @@ Time = g.callbacks.push Time.node node: (root) -> return if root.className is 'inline' - s = $('span[id^=no]', root).previousSibling + node = $('span[id]', root).previousSibling + tc = node.textContent + if tc is ' ' + node = node.previousSibling + tc = node.textContent [_, month, day, year, hour, min] = - s.textContent.match /(\d+)\/(\d+)\/(\d+)\(\w+\)(\d+):(\d+)/ + tc.match /(\d+)\/(\d+)\/(\d+)\(\w+\)(\d+):(\d+)/ year = "20#{year}" month -= 1 #months start at 0 hour = g.chanOffset + Number hour @@ -1629,7 +1633,7 @@ Time = time = $.el 'time', textContent: ' ' + Time.funk(Time) + ' ' - $.replace s, time + $.replace node, time foo: -> code = conf['time'].replace /%([A-Za-z])/g, (s, c) -> if c of Time.formatters From b475a38e6e18eb12d0e417b52942d06141dd1264 Mon Sep 17 00:00:00 2001 From: James Campos Date: Mon, 12 Sep 2011 22:56:39 -0700 Subject: [PATCH 2/4] cl --- changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog b/changelog index 541894964..d7140be95 100644 --- a/changelog +++ b/changelog @@ -2,6 +2,8 @@ master - mayhem quote inlining default styling (by xat) add up/down/right/left keybinding support +- aeosynth + fixed bug that caused script to fail when time formatting enabled 2.19.2 - mayhem From 2a33e8b7024304fd522cfd202eb234a540293f4d Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 13 Sep 2011 23:03:44 +0200 Subject: [PATCH 3/4] changelog 2.19.3 / god damn aerosmitten --- changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog b/changelog index d7140be95..8b80cbe0a 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master + +2.19.3 - mayhem quote inlining default styling (by xat) add up/down/right/left keybinding support From 7b4edd2ab6335f80f69b80210498d6f8d49294c3 Mon Sep 17 00:00:00 2001 From: James Campos Date: Tue, 13 Sep 2011 21:29:11 -0700 Subject: [PATCH 4/4] comment out exif search. I never use it --- 4chan_x.user.js | 2 +- script.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 8639af09a..f05d6c6f5 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -114,7 +114,7 @@ 'Indicate OP quote': [true, 'Add \'(OP)\' to OP quotes'] } }, - flavors: ['http://regex.info/exif.cgi?url=', 'http://iqdb.org/?url=', 'http://google.com/searchbyimage?image_url=', '#http://tineye.com/search?url=', '#http://saucenao.com/search.php?db=999&url=', '#http://imgur.com/upload?url='].join('\n'), + flavors: ['http://iqdb.org/?url=', 'http://google.com/searchbyimage?image_url=', '#http://regex.info/exif.cgi?url=', '#http://tineye.com/search?url=', '#http://saucenao.com/search.php?db=999&url=', '#http://imgur.com/upload?url='].join('\n'), time: '%m/%d/%y(%a)%H:%M', backlink: '>>%id', hotkeys: { diff --git a/script.coffee b/script.coffee index 5e0a6591a..f671b62f2 100644 --- a/script.coffee +++ b/script.coffee @@ -44,9 +44,9 @@ config = 'Quote Preview': [true, 'Show quote content on hover'] 'Indicate OP quote': [true, 'Add \'(OP)\' to OP quotes'] flavors: [ - 'http://regex.info/exif.cgi?url=' 'http://iqdb.org/?url=' 'http://google.com/searchbyimage?image_url=' + '#http://regex.info/exif.cgi?url=' '#http://tineye.com/search?url=' '#http://saucenao.com/search.php?db=999&url=' '#http://imgur.com/upload?url='