From eb22d553c3763679f836f7b53d5b8f9c024cdd6b Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 27 Dec 2011 04:37:58 +0100 Subject: [PATCH 1/9] Let the report button open multiple popups. Close #83 --- 4chan_x.user.js | 2 +- changelog | 1 + script.coffee | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 0e17ce38c..d391c0cc8 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2701,7 +2701,7 @@ report: function() { var id, set, url; url = "http://sys.4chan.org/" + g.BOARD + "/imgboard.php?mode=report&no=" + ($.x('preceding-sibling::input', this).name); - id = "" + NAMESPACE + "popup"; + id = new Date().getTime(); set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200"; return window.open(url, id, set); } diff --git a/changelog b/changelog index daad97e12..00ded2b35 100644 --- a/changelog +++ b/changelog @@ -1,5 +1,6 @@ master - mayhem + the report button can open multiple popups add omploader to the list of optional flavors (http://ompldr.org/upload?url1=) 2.23.7 diff --git a/script.coffee b/script.coffee index 73935d937..719ae450d 100644 --- a/script.coffee +++ b/script.coffee @@ -2102,7 +2102,7 @@ reportButton = $.on a, 'click', reportButton.report report: -> url = "http://sys.4chan.org/#{g.BOARD}/imgboard.php?mode=report&no=#{$.x('preceding-sibling::input', @).name}" - id = "#{NAMESPACE}popup" + id = new Date().getTime() set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200" window.open url, id, set From 691395b627ed21b6e2b14dd3bbbe2f0dd30016dd Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 27 Dec 2011 06:30:11 +0100 Subject: [PATCH 2/9] Update foolz archives redirection, close #71. Get #79 done, will need testing and foolz archive's support. --- 4chan_x.user.js | 120 +++++++++++++++++++++++++++--------------------- Cakefile | 1 + changelog | 4 +- script.coffee | 55 ++++++++++++++-------- 4 files changed, 107 insertions(+), 73 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index d391c0cc8..a0975a19a 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -6,6 +6,7 @@ // @copyright 2009-2011 James Campos // @license MIT; http://en.wikipedia.org/wiki/Mit_license // @include http://boards.4chan.org/* +// @include http://images.4chan.org/* // @include http://sys.4chan.org/* // @run-at document-start // @updateURL https://raw.github.com/MayhemYDG/4chan-x/stable/4chan_x.user.js @@ -70,7 +71,7 @@ config = { main: { Enhancing: { - '404 Redirect': [true, 'Redirect dead threads'], + '404 Redirect': [true, 'Redirect dead threads and images'], 'Keybinds': [true, 'Binds actions to keys'], 'Time Formatting': [true, 'Arbitrarily formatted timestamps, using your local time'], 'Report Button': [true, 'Add report buttons'], @@ -2819,49 +2820,61 @@ } }; - redirect = function() { - var url; - switch (g.BOARD) { - case 'a': - case 'jp': - case 'm': - case 'tg': - case 'tv': - url = "http://oldarchive.foolz.us/" + g.BOARD + "/thread/" + g.THREAD_ID; - break; - case 'diy': - case 'g': - case 'sci': - url = "http://archive.installgentoo.net/" + g.BOARD + "/thread/" + g.THREAD_ID; - break; - case '3': - case 'adv': - case 'an': - case 'ck': - case 'co': - case 'fa': - case 'fit': - case 'int': - case 'k': - case 'mu': - case 'n': - case 'o': - case 'p': - case 'po': - case 'pol': - case 'soc': - case 'sp': - case 'toy': - case 'trv': - case 'v': - case 'vp': - case 'x': - url = "http://archive.no-ip.org/" + g.BOARD + "/thread/" + g.THREAD_ID; - break; - default: - url = "http://boards.4chan.org/" + g.BOARD; + redirect = { + init: function() { + var url; + url = location.hostname === 'images.4chan.org' ? redirect.image(g.BOARD, location.pathname.split('/')[3]) : /^\d+$/.test(g.THREAD_ID) ? redirect.thread() : void 0; + if (url) return location.href = url; + }, + image: function(board, filename) { + switch (board) { + case 'a': + case 'jp': + case 'm': + case 'tg': + case 'tv': + return "http://archivethumb.foolz.us/board/" + board + "/img/" + filename; + } + }, + thread: function() { + switch (g.BOARD) { + case 'a': + case 'jp': + case 'm': + case 'tg': + case 'tv': + return "http://archive.foolz.us/" + g.BOARD + "/thread/" + g.THREAD_ID; + case 'diy': + case 'g': + case 'sci': + return "http://archive.installgentoo.net/" + g.BOARD + "/thread/" + g.THREAD_ID; + case '3': + case 'adv': + case 'an': + case 'ck': + case 'co': + case 'fa': + case 'fit': + case 'int': + case 'k': + case 'mu': + case 'n': + case 'o': + case 'p': + case 'po': + case 'pol': + case 'soc': + case 'sp': + case 'toy': + case 'trv': + case 'v': + case 'vp': + case 'x': + return "http://archive.no-ip.org/" + g.BOARD + "/thread/" + g.THREAD_ID; + default: + return "http://boards.4chan.org/" + g.BOARD; + } } - return location.href = url; }; imgHover = { @@ -2973,26 +2986,29 @@ thumb.hidden = false; return $.rm(thumb.nextSibling); }, - expand: function(thumb) { + expand: function(thumb, url) { var a, filesize, img, max; a = thumb.parentNode; img = $.el('img', { - src: a.href + src: url ? url : a.href }); if (engine === 'gecko' && a.parentNode.className !== 'op') { filesize = $.x('preceding-sibling::span[@class="filesize"]', a).textContent; max = filesize.match(/(\d+)x/); img.style.maxWidth = "" + max[1] + "px"; } - $.on(img, 'error', imgExpand.error); + if (conf['404 Redirect']) $.on(img, 'error', imgExpand.error); thumb.hidden = true; return $.add(a, img); }, error: function() { - var req, thumb; + var req, src, thumb, url; thumb = this.previousSibling; imgExpand.contract(thumb); - if (engine === 'webkit') { + src = this.src.split('/'); + if (url = redirect.image(src[3], src[5])) { + return imgExpand.expand(thumb, url); + } else if (engine === 'webkit') { return req = $.ajax(this.src, (function() { if (this.status !== 404) { return setTimeout(imgExpand.retry, 10000, thumb); @@ -3042,7 +3058,7 @@ pathname = location.pathname.slice(1).split('/'); g.BOARD = pathname[0], temp = pathname[1]; if (temp === 'res') { - g.REPLY = temp; + g.REPLY = true; g.THREAD_ID = pathname[2]; } else { g.PAGENUM = parseInt(temp) || 0; @@ -3111,11 +3127,11 @@ onLoad: function() { var callback, canPost, form, node, nodes, _i, _j, _len, _len2, _ref; $.off(d, 'DOMContentLoaded', Main.onLoad); - if (conf['404 Redirect'] && d.title === '4chan - 404' && /^\d+$/.test(g.THREAD_ID)) { - redirect(); + if (conf['404 Redirect'] && d.title === '4chan - 404') { + redirect.init(); return; } - if (!$('#navtopr')) return; + if (!$('#navtopr') || location.hostname === 'images.4chan.org') return; $.addClass(d.body, engine); $.addStyle(Main.css); threading.init(); diff --git a/Cakefile b/Cakefile index 43bb0c87f..195cbb959 100644 --- a/Cakefile +++ b/Cakefile @@ -13,6 +13,7 @@ HEADER = """ // @copyright 2009-2011 James Campos // @license MIT; http://en.wikipedia.org/wiki/Mit_license // @include http://boards.4chan.org/* +// @include http://images.4chan.org/* // @include http://sys.4chan.org/* // @run-at document-start // @updateURL https://raw.github.com/MayhemYDG/4chan-x/stable/4chan_x.user.js diff --git a/changelog b/changelog index 00ded2b35..dc57939e7 100644 --- a/changelog +++ b/changelog @@ -1,7 +1,9 @@ master - mayhem - the report button can open multiple popups + redirect 404'd pictures to archives when possible + the report button can open multiple popups again add omploader to the list of optional flavors (http://ompldr.org/upload?url1=) + update archive redirections 2.23.7 - mayhem diff --git a/script.coffee b/script.coffee index 719ae450d..ab4dfa06b 100644 --- a/script.coffee +++ b/script.coffee @@ -1,7 +1,7 @@ config = main: Enhancing: - '404 Redirect': [true, 'Redirect dead threads'] + '404 Redirect': [true, 'Redirect dead threads and images'] 'Keybinds': [true, 'Binds actions to keys'] 'Time Formatting': [true, 'Arbitrarily formatted timestamps, using your local time'] 'Report Button': [true, 'Add report buttons'] @@ -2216,17 +2216,29 @@ Favicon = favicon.href = null $.replace favicon, clone -redirect = -> - switch g.BOARD - when 'a', 'jp', 'm', 'tg', 'tv' - url = "http://oldarchive.foolz.us/#{g.BOARD}/thread/#{g.THREAD_ID}" - when 'diy', 'g', 'sci' - url = "http://archive.installgentoo.net/#{g.BOARD}/thread/#{g.THREAD_ID}" - when '3', 'adv', 'an', 'ck', 'co', 'fa', 'fit', 'int', 'k', 'mu', 'n', 'o', 'p', 'po', 'pol', 'soc', 'sp', 'toy', 'trv', 'v', 'vp', 'x' - url = "http://archive.no-ip.org/#{g.BOARD}/thread/#{g.THREAD_ID}" - else - url = "http://boards.4chan.org/#{g.BOARD}" - location.href = url +redirect = + init: -> + url = + # waiting for https://github.com/FoOlRulez/FoOlFuuka/issues/11 + if location.hostname is 'images.4chan.org' + redirect.image g.BOARD, location.pathname.split('/')[3] + else if /^\d+$/.test g.THREAD_ID + redirect.thread() + location.href = url if url + image: (board, filename) -> #board must be given, the image can originate from a cross-quote + switch board + when 'a', 'jp', 'm', 'tg', 'tv' + "http://archivethumb.foolz.us/board/#{board}/img/#{filename}" + thread: -> + switch g.BOARD + when 'a', 'jp', 'm', 'tg', 'tv' + "http://archive.foolz.us/#{g.BOARD}/thread/#{g.THREAD_ID}" + when 'diy', 'g', 'sci' + "http://archive.installgentoo.net/#{g.BOARD}/thread/#{g.THREAD_ID}" + when '3', 'adv', 'an', 'ck', 'co', 'fa', 'fit', 'int', 'k', 'mu', 'n', 'o', 'p', 'po', 'pol', 'soc', 'sp', 'toy', 'trv', 'v', 'vp', 'x' + "http://archive.no-ip.org/#{g.BOARD}/thread/#{g.THREAD_ID}" + else + "http://boards.4chan.org/#{g.BOARD}" imgHover = init: -> @@ -2303,23 +2315,26 @@ imgExpand = thumb.hidden = false $.rm thumb.nextSibling - expand: (thumb) -> + expand: (thumb, url) -> a = thumb.parentNode img = $.el 'img', - src: a.href + src: if url then url else a.href if engine is 'gecko' and a.parentNode.className isnt 'op' filesize = $.x('preceding-sibling::span[@class="filesize"]', a).textContent max = filesize.match /(\d+)x/ img.style.maxWidth = "#{max[1]}px" - $.on img, 'error', imgExpand.error + $.on img, 'error', imgExpand.error if conf['404 Redirect'] thumb.hidden = true $.add a, img error: -> thumb = @previousSibling imgExpand.contract thumb + src = @src.split '/' + if url = redirect.image src[3], src[5] + imgExpand.expand thumb, url #navigator.online is not x-browser/os yet - if engine is 'webkit' + else if engine is 'webkit' req = $.ajax @src, (-> setTimeout imgExpand.retry, 10000, thumb if @status isnt 404 ), type: 'head', event: 'onreadystatechange' @@ -2358,7 +2373,7 @@ Main = pathname = location.pathname[1..].split('/') [g.BOARD, temp] = pathname if temp is 'res' - g.REPLY = temp + g.REPLY = true g.THREAD_ID = pathname[2] else g.PAGENUM = parseInt(temp) or 0 @@ -2453,10 +2468,10 @@ Main = onLoad: -> $.off d, 'DOMContentLoaded', Main.onLoad - if conf['404 Redirect'] and d.title is '4chan - 404' and /^\d+$/.test g.THREAD_ID - redirect() + if conf['404 Redirect'] and d.title is '4chan - 404' + redirect.init() return - if not $ '#navtopr' + if not $('#navtopr') or location.hostname is 'images.4chan.org' return $.addClass d.body, engine $.addStyle Main.css From f221b09f631744bae28834c73cee6a34f5cb6962 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 27 Dec 2011 21:16:45 +0100 Subject: [PATCH 3/9] Twice faster and shorter. --- 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 a0975a19a..539b321a0 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -972,7 +972,7 @@ } break; case conf.unreadCountTo0: - unread.replies.length = 0; + unread.replies = []; unread.updateTitle(); Favicon.update(); break; diff --git a/script.coffee b/script.coffee index ab4dfa06b..0999439f6 100644 --- a/script.coffee +++ b/script.coffee @@ -709,7 +709,7 @@ keybinds = else $('.postarea form').submit() when conf.unreadCountTo0 - unread.replies.length = 0 + unread.replies = [] unread.updateTitle() Favicon.update() else From ccc6e009de9fd0fc53f326834b7b4e35d21857cd Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 27 Dec 2011 23:22:59 +0100 Subject: [PATCH 4/9] Decrease the unread count when inlining unread posts. Close #57 --- 4chan_x.user.js | 7 ++++++- changelog | 1 + script.coffee | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 539b321a0..85127f929 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2469,10 +2469,15 @@ return this.classList.toggle('inlined'); }, add: function(q, id) { - var el, inline, pathname, root, threadID; + var el, i, inline, pathname, root, threadID; root = q.parentNode.nodeName === 'FONT' ? q.parentNode : q.nextSibling ? q.nextSibling : q; if (el = $.id(id)) { inline = quoteInline.table(id, el.innerHTML); + if (g.REPLY && conf['Unread Count'] && (i = unread.replies.indexOf(el.parentNode.parentNode.parentNode)) !== -1) { + unread.replies.splice(i, 1); + unread.updateTitle(); + Favicon.update(); + } if (/\bbacklink\b/.test(q.className)) { $.after(q.parentNode, inline); if (conf['Forward Hiding']) { diff --git a/changelog b/changelog index dc57939e7..514b910c4 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,7 @@ master - mayhem redirect 404'd pictures to archives when possible + the unread count will decrease when inlining quotes of unread posts the report button can open multiple popups again add omploader to the list of optional flavors (http://ompldr.org/upload?url1=) update archive redirections diff --git a/script.coffee b/script.coffee index 0999439f6..cdce5bfbf 100644 --- a/script.coffee +++ b/script.coffee @@ -1959,6 +1959,10 @@ quoteInline = root = if q.parentNode.nodeName is 'FONT' then q.parentNode else if q.nextSibling then q.nextSibling else q if el = $.id id inline = quoteInline.table id, el.innerHTML + if g.REPLY and conf['Unread Count'] and (i = unread.replies.indexOf el.parentNode.parentNode.parentNode) isnt -1 + unread.replies.splice i, 1 + unread.updateTitle() + Favicon.update() if /\bbacklink\b/.test q.className $.after q.parentNode, inline $.addClass $.x('ancestor::table', el), 'forwarded' if conf['Forward Hiding'] From b2c3c6522fe24e1202e88b49a7da4db8dfeb1feb Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 29 Dec 2011 01:59:30 +0100 Subject: [PATCH 5/9] Use Date.now() --- 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 85127f929..76c13dda7 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2707,7 +2707,7 @@ report: function() { var id, set, url; url = "http://sys.4chan.org/" + g.BOARD + "/imgboard.php?mode=report&no=" + ($.x('preceding-sibling::input', this).name); - id = new Date().getTime(); + id = Date.now(); set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200"; return window.open(url, id, set); } diff --git a/script.coffee b/script.coffee index cdce5bfbf..92e7806be 100644 --- a/script.coffee +++ b/script.coffee @@ -2106,7 +2106,7 @@ reportButton = $.on a, 'click', reportButton.report report: -> url = "http://sys.4chan.org/#{g.BOARD}/imgboard.php?mode=report&no=#{$.x('preceding-sibling::input', @).name}" - id = new Date().getTime() + id = Date.now() set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200" window.open url, id, set From 6df5a9311b7505a8c6ed0baed74d55c747d7ab1c Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 29 Dec 2011 02:04:39 +0100 Subject: [PATCH 6/9] Add /u/ archive redirection. --- 4chan_x.user.js | 2 ++ script.coffee | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 76c13dda7..c526dc86a 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2838,6 +2838,7 @@ case 'm': case 'tg': case 'tv': + case 'u': return "http://archivethumb.foolz.us/board/" + board + "/img/" + filename; } }, @@ -2848,6 +2849,7 @@ case 'm': case 'tg': case 'tv': + case 'u': return "http://archive.foolz.us/" + g.BOARD + "/thread/" + g.THREAD_ID; case 'diy': case 'g': diff --git a/script.coffee b/script.coffee index 92e7806be..eb3434272 100644 --- a/script.coffee +++ b/script.coffee @@ -2231,11 +2231,11 @@ redirect = location.href = url if url image: (board, filename) -> #board must be given, the image can originate from a cross-quote switch board - when 'a', 'jp', 'm', 'tg', 'tv' + when 'a', 'jp', 'm', 'tg', 'tv', 'u' "http://archivethumb.foolz.us/board/#{board}/img/#{filename}" thread: -> switch g.BOARD - when 'a', 'jp', 'm', 'tg', 'tv' + when 'a', 'jp', 'm', 'tg', 'tv', 'u' "http://archive.foolz.us/#{g.BOARD}/thread/#{g.THREAD_ID}" when 'diy', 'g', 'sci' "http://archive.installgentoo.net/#{g.BOARD}/thread/#{g.THREAD_ID}" From fcc0d61f723b8e04d267777e7078e72fae98e174 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 29 Dec 2011 02:08:52 +0100 Subject: [PATCH 7/9] Add /lit/ archive redirection. --- 4chan_x.user.js | 4 +++- script.coffee | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index c526dc86a..c3d47f01c 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2850,7 +2850,9 @@ case 'tg': case 'tv': case 'u': - return "http://archive.foolz.us/" + g.BOARD + "/thread/" + g.THREAD_ID; + return "http://archive.foolz.us/" + g.BOARD + "/thread/" + g.THREAD_ID + "/"; + case 'lit': + return "http://fuuka.warosu.org/" + g.BOARD + "/thread/" + g.THREAD_ID; case 'diy': case 'g': case 'sci': diff --git a/script.coffee b/script.coffee index eb3434272..3243d802c 100644 --- a/script.coffee +++ b/script.coffee @@ -2236,7 +2236,9 @@ redirect = thread: -> switch g.BOARD when 'a', 'jp', 'm', 'tg', 'tv', 'u' - "http://archive.foolz.us/#{g.BOARD}/thread/#{g.THREAD_ID}" + "http://archive.foolz.us/#{g.BOARD}/thread/#{g.THREAD_ID}/" + when 'lit' + "http://fuuka.warosu.org/#{g.BOARD}/thread/#{g.THREAD_ID}" when 'diy', 'g', 'sci' "http://archive.installgentoo.net/#{g.BOARD}/thread/#{g.THREAD_ID}" when '3', 'adv', 'an', 'ck', 'co', 'fa', 'fit', 'int', 'k', 'mu', 'n', 'o', 'p', 'po', 'pol', 'soc', 'sp', 'toy', 'trv', 'v', 'vp', 'x' From 39d7e45261babda7dcd6c83ba1add88607db7845 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 29 Dec 2011 02:24:36 +0100 Subject: [PATCH 8/9] Update changelog; add /r9k/ archive redirection, even though the last archived post is dated from the 5th December. --- 4chan_x.user.js | 1 + changelog | 2 +- script.coffee | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index c3d47f01c..a94e50c92 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2872,6 +2872,7 @@ case 'p': case 'po': case 'pol': + case 'r9k': case 'soc': case 'sp': case 'toy': diff --git a/changelog b/changelog index 514b910c4..d9a41b46f 100644 --- a/changelog +++ b/changelog @@ -4,7 +4,7 @@ master the unread count will decrease when inlining quotes of unread posts the report button can open multiple popups again add omploader to the list of optional flavors (http://ompldr.org/upload?url1=) - update archive redirections + update archive redirections, add /lit/ and /u/ 2.23.7 - mayhem diff --git a/script.coffee b/script.coffee index 3243d802c..85ced57bb 100644 --- a/script.coffee +++ b/script.coffee @@ -2241,7 +2241,7 @@ redirect = "http://fuuka.warosu.org/#{g.BOARD}/thread/#{g.THREAD_ID}" when 'diy', 'g', 'sci' "http://archive.installgentoo.net/#{g.BOARD}/thread/#{g.THREAD_ID}" - when '3', 'adv', 'an', 'ck', 'co', 'fa', 'fit', 'int', 'k', 'mu', 'n', 'o', 'p', 'po', 'pol', 'soc', 'sp', 'toy', 'trv', 'v', 'vp', 'x' + when '3', 'adv', 'an', 'ck', 'co', 'fa', 'fit', 'int', 'k', 'mu', 'n', 'o', 'p', 'po', 'pol', 'r9k', 'soc', 'sp', 'toy', 'trv', 'v', 'vp', 'x' "http://archive.no-ip.org/#{g.BOARD}/thread/#{g.THREAD_ID}" else "http://boards.4chan.org/#{g.BOARD}" From b1256e17541ccc9ef6dfb5a95165734081a8bc76 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 29 Dec 2011 05:03:28 +0100 Subject: [PATCH 9/9] Max-width: 75% for image hover. Close #76 --- 4chan_x.user.js | 7 ++++--- changelog | 1 + script.coffee | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index a94e50c92..15edaec6a 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2899,7 +2899,7 @@ }, mouseover: function() { ui.el = $.el('img', { - id: 'iHover', + id: 'ihover', src: this.parentNode.href }); return $.add(d.body, ui.el); @@ -3272,12 +3272,13 @@ width: 100%;\ }\ \ - #qp, #iHover {\ + #qp, #ihover {\ position: fixed;\ }\ \ - #iHover {\ + #ihover {\ max-height: 100%;\ + max-width: 75%;\ }\ \ #navlinks {\ diff --git a/changelog b/changelog index d9a41b46f..42e956a24 100644 --- a/changelog +++ b/changelog @@ -5,6 +5,7 @@ master the report button can open multiple popups again add omploader to the list of optional flavors (http://ompldr.org/upload?url1=) update archive redirections, add /lit/ and /u/ + fit horizontally for Image Hover 2.23.7 - mayhem diff --git a/script.coffee b/script.coffee index 85ced57bb..088f71d3d 100644 --- a/script.coffee +++ b/script.coffee @@ -2255,7 +2255,7 @@ imgHover = $.on thumb, 'mouseout', ui.hoverend mouseover: -> ui.el = $.el 'img' - id: 'iHover' + id: 'ihover' src: @parentNode.href $.add d.body, ui.el @@ -2624,12 +2624,13 @@ Main = width: 100%; } - #qp, #iHover { + #qp, #ihover { position: fixed; } - #iHover { + #ihover { max-height: 100%; + max-width: 75%; } #navlinks {