auto gif
This commit is contained in:
parent
c05b5e7859
commit
8c31785b0e
14
4chan_x.js
14
4chan_x.js
@ -66,6 +66,7 @@
|
||||
'Anonymize': [false, 'Make everybody anonymous'],
|
||||
'Auto Watch': [true, 'Automatically watch threads that you start (Firefox only)'],
|
||||
'Comment Expansion': [true, 'Expand too long comments'],
|
||||
'Image Auto-Gif': [false, 'Animate gif thumbnails'],
|
||||
'Image Expansion': [true, 'Expand images'],
|
||||
'Image Preloading': [false, 'Preload Images'],
|
||||
'Keybinds': [false, 'Binds actions to keys'],
|
||||
@ -1588,6 +1589,19 @@
|
||||
return _results;
|
||||
});
|
||||
}
|
||||
if (getConfig('Image Auto-Gif')) {
|
||||
g.callbacks.push(function(root) {
|
||||
var src, thumb, thumbs, _i, _len, _results;
|
||||
thumbs = $$('img[md5]', root);
|
||||
_results = [];
|
||||
for (_i = 0, _len = thumbs.length; _i < _len; _i++) {
|
||||
thumb = thumbs[_i];
|
||||
src = thumb.parentNode.href;
|
||||
_results.push(/gif$/.test(src) ? thumb.src = src : void 0);
|
||||
}
|
||||
return _results;
|
||||
});
|
||||
}
|
||||
if (getConfig('Localize Time')) {
|
||||
g.callbacks.push(function(root) {
|
||||
var date, day, dotw, hour, min_sec, month, s, span, spans, year, _i, _len, _ref, _results;
|
||||
|
||||
@ -12,6 +12,7 @@ config =
|
||||
'Anonymize': [false, 'Make everybody anonymous']
|
||||
'Auto Watch': [true, 'Automatically watch threads that you start (Firefox only)']
|
||||
'Comment Expansion': [true, 'Expand too long comments']
|
||||
'Image Auto-Gif': [false, 'Animate gif thumbnails']
|
||||
'Image Expansion': [true, 'Expand images']
|
||||
'Image Preloading': [false, 'Preload Images']
|
||||
'Keybinds': [false, 'Binds actions to keys']
|
||||
@ -1211,6 +1212,14 @@ if getConfig 'Image Expansion'
|
||||
thumb.parentNode.addEventListener 'click', imageClick, true
|
||||
if g.expand then imageToggle thumb.parentNode
|
||||
|
||||
if getConfig 'Image Auto-Gif'
|
||||
g.callbacks.push (root) ->
|
||||
thumbs = $$ 'img[md5]', root
|
||||
for thumb in thumbs
|
||||
src = thumb.parentNode.href
|
||||
if /gif$/.test src
|
||||
thumb.src = src
|
||||
|
||||
if getConfig 'Localize Time'
|
||||
g.callbacks.push (root) ->
|
||||
spans = $$ 'span[id^=no]', root
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user