From 35069a9ae57a63988aea961baf34c56b89bd9bbe Mon Sep 17 00:00:00 2001 From: James Campos Date: Sat, 11 Dec 2010 03:25:58 -0800 Subject: [PATCH] expand images in new posts --- 4chan_x.coffee | 3 +++ 4chan_x.js | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/4chan_x.coffee b/4chan_x.coffee index 0b8fb5599..b0d269b9f 100644 --- a/4chan_x.coffee +++ b/4chan_x.coffee @@ -380,6 +380,7 @@ imageClick = (e) -> imageExpandClick = -> thumbs = $$ 'img[md5]' + g.expand = @checked if @checked #expand for thumb in thumbs if thumb.className isnt 'hide' @@ -823,6 +824,7 @@ AEOS.init() g = callbacks: [] count: 0 + expand: false favEmpty: 'data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///9vb2////yH5BAEAAAMALAAAAAAQABAAAAIvnI+pq+D9DBAUoFkPFnbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==' favNormal: $('link[rel="shortcut icon"]', $('head', d))?.href or 'http://static.4chan.org/image/favicon.ico' flavors: [ @@ -982,6 +984,7 @@ if getConfig 'Image Expansion' thumbs = $$ 'img[md5]', root for thumb in thumbs thumb.parentNode.addEventListener 'click', imageClick, true + if g.expand then imageFull thumb if getConfig 'Localize Time' g.callbacks.push (root) -> diff --git a/4chan_x.js b/4chan_x.js index f8e733cd7..8ff0648bf 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -489,6 +489,7 @@ imageExpandClick = function() { var thumb, thumbs, _i, _j, _len, _len2, _results, _results2; thumbs = $$('img[md5]'); + g.expand = this.checked; if (this.checked) { _results = []; for (_i = 0, _len = thumbs.length; _i < _len; _i++) { @@ -1091,6 +1092,7 @@ g = { callbacks: [], count: 0, + expand: false, favEmpty: 'data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///9vb2////yH5BAEAAAMALAAAAAAQABAAAAIvnI+pq+D9DBAUoFkPFnbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==', favNormal: ((_ref = $('link[rel="shortcut icon"]', $('head', d))) != null ? _ref.href : void 0) || 'http://static.4chan.org/image/favicon.ico', flavors: ['http://regex.info/exif.cgi?url=', 'http://iqdb.org/?url=', 'http://saucenao.com/search.php?db=999&url=', 'http://tineye.com/search?url='].join('\n'), @@ -1255,7 +1257,8 @@ _results = []; for (_i = 0, _len = thumbs.length; _i < _len; _i++) { thumb = thumbs[_i]; - _results.push(thumb.parentNode.addEventListener('click', imageClick, true)); + thumb.parentNode.addEventListener('click', imageClick, true); + _results.push(g.expand ? imageFull(thumb) : void 0); } return _results; });