Merge pull request #259 from aeosynth/aho

Aho
This commit is contained in:
Mayhem 2012-02-21 11:49:47 -08:00
commit b136e07cc6
3 changed files with 30 additions and 13 deletions

View File

@ -101,7 +101,8 @@
'Image Expansion': [true, 'Expand images'], 'Image Expansion': [true, 'Expand images'],
'Image Hover': [false, 'Show full image on mouseover'], 'Image Hover': [false, 'Show full image on mouseover'],
'Sauce': [true, 'Add sauce to images'], 'Sauce': [true, 'Add sauce to images'],
'Reveal Spoilers': [false, 'Replace spoiler thumbnails by the original thumbnail'] 'Reveal Spoilers': [false, 'Replace spoiler thumbnails by the original thumbnail'],
'Expand From Current': [false, 'Expand images from current position to thread end.']
}, },
Monitoring: { Monitoring: {
'Thread Updater': [true, 'Update threads. Has more options in its own dialog.'], 'Thread Updater': [true, 'Update threads. Has more options in its own dialog.'],
@ -169,7 +170,7 @@
expandThread: ['e', 'Expand thread'], expandThread: ['e', 'Expand thread'],
watch: ['w', 'Watch thread'], watch: ['w', 'Watch thread'],
hide: ['x', 'Hide thread'], hide: ['x', 'Hide thread'],
expandImages: ['m', 'Expand selected image'], expandImage: ['m', 'Expand selected image'],
expandAllImages: ['M', 'Expand all images'], expandAllImages: ['M', 'Expand all images'],
update: ['u', 'Update now'], update: ['u', 'Update now'],
unreadCountTo0: ['z', 'Reset unread status'] unreadCountTo0: ['z', 'Reset unread status']
@ -973,7 +974,7 @@
case conf.expandThread: case conf.expandThread:
expandThread.toggle(thread); expandThread.toggle(thread);
break; break;
case conf.expandImages: case conf.expandImage:
keybinds.img(thread); keybinds.img(thread);
break; break;
case conf.nextThread: case conf.nextThread:
@ -3440,18 +3441,25 @@
return imgExpand.toggle(this); return imgExpand.toggle(this);
}, },
all: function() { all: function() {
var thumb, _i, _j, _len, _len2, _ref, _ref2; var i, thumb, thumbs, _i, _j, _len, _len2, _len3, _ref;
imgExpand.on = this.checked; imgExpand.on = this.checked;
if (imgExpand.on) { if (imgExpand.on) {
_ref = $$('img[md5]'); thumbs = $$('img[md5]');
for (_i = 0, _len = _ref.length; _i < _len; _i++) { if (conf['Expand From Current']) {
thumb = _ref[_i]; for (i = 0, _len = thumbs.length; i < _len; i++) {
thumb = thumbs[i];
if (thumb.getBoundingClientRect().top > 0) break;
}
thumbs = thumbs.slice(i);
}
for (_i = 0, _len2 = thumbs.length; _i < _len2; _i++) {
thumb = thumbs[_i];
imgExpand.expand(thumb); imgExpand.expand(thumb);
} }
} else { } else {
_ref2 = $$('img[md5][hidden]'); _ref = $$('img[md5][hidden]');
for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { for (_j = 0, _len3 = _ref.length; _j < _len3; _j++) {
thumb = _ref2[_j]; thumb = _ref[_j];
imgExpand.contract(thumb); imgExpand.contract(thumb);
} }
} }

View File

@ -1,4 +1,6 @@
master master
- aeosynth / ahodesuka
new option: expand images from current position
- ahodesuka - ahodesuka
Add Open Reply in New Tab option for replies made from the main board (not dumping). Add Open Reply in New Tab option for replies made from the main board (not dumping).
Scroll back up (top of anchor - 42px) when unexpanding images. Scroll back up (top of anchor - 42px) when unexpanding images.

View File

@ -24,6 +24,7 @@ config =
'Image Hover': [false, 'Show full image on mouseover'] 'Image Hover': [false, 'Show full image on mouseover']
'Sauce': [true, 'Add sauce to images'] 'Sauce': [true, 'Add sauce to images']
'Reveal Spoilers': [false, 'Replace spoiler thumbnails by the original thumbnail'] 'Reveal Spoilers': [false, 'Replace spoiler thumbnails by the original thumbnail']
'Expand From Current': [false, 'Expand images from current position to thread end.']
Monitoring: Monitoring:
'Thread Updater': [true, 'Update threads. Has more options in its own dialog.'] 'Thread Updater': [true, 'Update threads. Has more options in its own dialog.']
'Unread Count': [true, 'Show unread post count in tab title'] 'Unread Count': [true, 'Show unread post count in tab title']
@ -122,7 +123,7 @@ config =
expandThread: ['e', 'Expand thread'] expandThread: ['e', 'Expand thread']
watch: ['w', 'Watch thread'] watch: ['w', 'Watch thread']
hide: ['x', 'Hide thread'] hide: ['x', 'Hide thread']
expandImages: ['m', 'Expand selected image'] expandImage: ['m', 'Expand selected image']
expandAllImages: ['M', 'Expand all images'] expandAllImages: ['M', 'Expand all images']
update: ['u', 'Update now'] update: ['u', 'Update now']
unreadCountTo0: ['z', 'Reset unread status'] unreadCountTo0: ['z', 'Reset unread status']
@ -797,7 +798,7 @@ keybinds =
keybinds.open thread keybinds.open thread
when conf.expandThread when conf.expandThread
expandThread.toggle thread expandThread.toggle thread
when conf.expandImages when conf.expandImage
keybinds.img thread keybinds.img thread
when conf.nextThread when conf.nextThread
return if g.REPLY return if g.REPLY
@ -2776,7 +2777,13 @@ imgExpand =
all: -> all: ->
imgExpand.on = @checked imgExpand.on = @checked
if imgExpand.on #expand if imgExpand.on #expand
for thumb in $$ 'img[md5]' thumbs = $$ 'img[md5]'
if conf['Expand From Current']
for thumb, i in thumbs
if thumb.getBoundingClientRect().top > 0
break
thumbs = thumbs[i...]
for thumb in thumbs
imgExpand.expand thumb imgExpand.expand thumb
else #contract else #contract
for thumb in $$ 'img[md5][hidden]' for thumb in $$ 'img[md5][hidden]'