diff --git a/4chan_x.user.js b/4chan_x.user.js
index cfa44e7bd..a1e4bc206 100644
--- a/4chan_x.user.js
+++ b/4chan_x.user.js
@@ -1127,15 +1127,78 @@
return $.replace(home, a);
},
dialog: function() {
- var arr, checked, description, dialog, hiddenNum, hiddenThreads, html, input, key, li, main, obj, overlay, ul, _i, _len, _ref, _ref2;
- hiddenThreads = $.get("hiddenThreads/" + g.BOARD + "/", {});
- hiddenNum = Object.keys(g.hiddenReplies).length + Object.keys(hiddenThreads).length;
- html = "
| | |
Time formatting - :
- Supported format specifiers:
- Day: %a, %A, %d, %e
- Month: %m, %b, %B
- Year: %y
- Hour: %k, %H, %l (lowercase L), %I (uppercase i), %p, %P
- Minutes: %M
";
+ var arr, back, checked, description, dialog, flavors, hiddenNum, hiddenThreads, input, key, li, obj, overlay, time, ul, _i, _len, _ref, _ref2;
dialog = $.el('div', {
id: 'options',
- innerHTML: html
+ innerHTML: '\
+\
+
\
+
\
+ \
+ | \
+ | \
+ | \
+
\
+
\
+
\
+
\
+
\
+
\
+
\
+
\
+
\
+
\
+
\
+
\
+
\
+ Time formatting\
+ - :
\
+ - Supported format specifiers:
\
+ - Day: %a, %A, %d, %e
\
+ - Month: %m, %b, %B
\
+ - Year: %y
\
+ - Hour: %k, %H, %l (lowercase L), %I (uppercase i), %p, %P
\
+ - Minutes: %M
\
+
\
+
\
+
\
+
\
+
\
+
'
});
- main = $('#main', dialog);
_ref = config.main;
for (key in _ref) {
obj = _ref[key];
@@ -1152,19 +1215,25 @@
$.bind($('input', li), 'click', $.cb.checked);
$.add(ul, li);
}
- $.add(main, ul);
+ $.add($('#main', dialog), ul);
}
+ hiddenThreads = $.get("hiddenThreads/" + g.BOARD + "/", {});
+ hiddenNum = Object.keys(g.hiddenReplies).length + Object.keys(hiddenThreads).length;
li = $.el('li', {
innerHTML: " : Forget all hidden posts. Useful if you accidentally hide a post and have `show stubs` disabled."
});
$.bind($('button', li), 'click', options.clearHidden);
$.add($('ul:nth-child(2)', dialog), li);
- $.bind($('#flavors', dialog), 'change', $.cb.value);
- $.bind($('input[name=time]', dialog), 'keyup', options.time);
- $.bind($('input[name=backlink]', dialog), 'keyup', options.backlink);
+ (flavors = $('#flavors', dialog)).textContent = conf['flavors'];
+ $.bind(flavors, 'change', $.cb.value);
+ (back = $('[name=backlink]', dialog)).value = conf['backlink'];
+ (time = $('[name=time]', dialog)).value = conf['time'];
+ $.bind(back, 'keyup', options.backlink);
+ $.bind(time, 'keyup', options.time);
_ref2 = $$('#keybinds input', dialog);
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
input = _ref2[_i];
+ input.type = 'text';
input.value = conf[input.name];
$.bind(input, 'keydown', options.keybind);
}
@@ -1177,16 +1246,16 @@
overlay = $.el('div', {
id: 'overlay'
});
- $.add(overlay, dialog);
- $.add(d.body, overlay);
- options.time.call($('input[name=time]', dialog));
- options.backlink.call($('input[name=backlink]', dialog));
$.bind(overlay, 'click', function() {
return $.rm(overlay);
});
- return $.bind(dialog.firstElementChild, 'click', function(e) {
+ $.bind(dialog.firstElementChild, 'click', function(e) {
return e.stopPropagation();
});
+ $.add(overlay, dialog);
+ $.add(d.body, overlay);
+ options.time.call(time);
+ return options.backlink.call(back);
},
clearHidden: function(e) {
$["delete"]("hiddenReplies/" + g.BOARD + "/");
@@ -2747,12 +2816,16 @@
var req, thumb;
thumb = this.previousSibling;
imgExpand.contract(thumb);
- req = $.ajax(this.src, null, 'head');
- return req.onreadystatechange = function(e) {
- if (this.status !== 404) {
- return setTimeout(imgExpand.retry, 10000, thumb);
- }
- };
+ if (navigator.appName !== 'Opera') {
+ req = $.ajax(this.src, null, 'head');
+ return req.onreadystatechange = function(e) {
+ if (this.status !== 404) {
+ return setTimeout(imgExpand.retry, 10000, thumb);
+ }
+ };
+ } else if (!g.dead) {
+ return setTimeout(imgExpand.retry, 10000, thumb);
+ }
},
retry: function(thumb) {
if (!thumb.hidden) {
@@ -3195,11 +3268,11 @@
http://code.google.com/p/chromium/issues/detail?id=78961\
*/\
font-size: 100px;\
- position: absolute;\
- left: 0;\
opacity: 0;\
}\
#qr #files img {\
+ position: absolute;\
+ left: 0;\
max-height: 100px;\
max-width: 100px;\
}\
diff --git a/script.coffee b/script.coffee
index 8dcf594dd..cb0b26788 100644
--- a/script.coffee
+++ b/script.coffee
@@ -802,79 +802,76 @@ options =
$.replace home, a
dialog: ->
- hiddenThreads = $.get "hiddenThreads/#{g.BOARD}/", {}
- hiddenNum = Object.keys(g.hiddenReplies).length + Object.keys(hiddenThreads).length
- html = "
-
-
-
- | | |
-
-
-
-
-
-
-
-
-
-
-
-
-
- Time formatting
- - :
- - Supported format specifiers:
- - Day: %a, %A, %d, %e
- - Month: %m, %b, %B
- - Year: %y
- - Hour: %k, %H, %l (lowercase L), %I (uppercase i), %p, %P
- - Minutes: %M
-
-
-
-
-
-
- "
+ dialog = $.el 'div', id: 'options', innerHTML: '
+
+
+
+
+ |
+ |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Time formatting
+ - :
+ - Supported format specifiers:
+ - Day: %a, %A, %d, %e
+ - Month: %m, %b, %B
+ - Year: %y
+ - Hour: %k, %H, %l (lowercase L), %I (uppercase i), %p, %P
+ - Minutes: %M
+
+
+
+
+
+
'
- dialog = $.el 'div', id: 'options', innerHTML: html
- main = $('#main', dialog)
+ #main
for key, obj of config.main
ul = $.el 'ul',
textContent: key
@@ -885,17 +882,28 @@ options =
innerHTML: ": #{description}"
$.bind $('input', li), 'click', $.cb.checked
$.add ul, li
- $.add main, ul
+ $.add $('#main', dialog), ul
+ hiddenThreads = $.get "hiddenThreads/#{g.BOARD}/", {}
+ hiddenNum = Object.keys(g.hiddenReplies).length + Object.keys(hiddenThreads).length
li = $.el 'li',
innerHTML: " : Forget all hidden posts. Useful if you accidentally hide a post and have `show stubs` disabled."
$.bind $('button', li), 'click', options.clearHidden
$.add $('ul:nth-child(2)', dialog), li
- $.bind $('#flavors', dialog), 'change', $.cb.value
- $.bind $('input[name=time]', dialog), 'keyup', options.time
- $.bind $('input[name=backlink]', dialog), 'keyup', options.backlink
+ #sauce
+ (flavors = $ '#flavors', dialog).textContent = conf['flavors']
+ $.bind flavors, 'change', $.cb.value
+
+ #rice
+ (back = $ '[name=backlink]', dialog).value = conf['backlink']
+ (time = $ '[name=time]', dialog).value = conf['time']
+ $.bind back, 'keyup', options.backlink
+ $.bind time, 'keyup', options.time
+
+ #keybinds
for input in $$ '#keybinds input', dialog
+ input.type = 'text'
input.value = conf[input.name]
$.bind input, 'keydown', options.keybind
@@ -906,14 +914,13 @@ options =
https://bugzilla.mozilla.org/show_bug.cgi?id=579776
###
overlay = $.el 'div', id: 'overlay'
+ $.bind overlay, 'click', -> $.rm overlay
+ $.bind dialog.firstElementChild, 'click', (e) -> e.stopPropagation()
$.add overlay, dialog
$.add d.body, overlay
- options.time.call $('input[name=time]', dialog)
- options.backlink.call $('input[name=backlink]', dialog)
-
- $.bind overlay, 'click', -> $.rm overlay
- $.bind dialog.firstElementChild, 'click', (e) -> e.stopPropagation()
+ options.time.call time
+ options.backlink.call back
clearHidden: (e) ->
#'hidden' might be misleading; it's the number of IDs we're *looking* for,
@@ -2032,8 +2039,11 @@ imgExpand =
thumb = @previousSibling
imgExpand.contract thumb
#navigator.online is not x-browser/os yet
- req = $.ajax @src, null, 'head'
- req.onreadystatechange = (e) -> setTimeout imgExpand.retry, 10000, thumb if @status isnt 404
+ if navigator.appName isnt 'Opera'
+ req = $.ajax @src, null, 'head'
+ req.onreadystatechange = (e) -> setTimeout imgExpand.retry, 10000, thumb if @status isnt 404
+ else unless g.dead
+ setTimeout imgExpand.retry, 10000, thumb
retry: (thumb) ->
imgExpand.expand thumb unless thumb.hidden
@@ -2513,11 +2523,11 @@ Main =
http://code.google.com/p/chromium/issues/detail?id=78961
*/
font-size: 100px;
- position: absolute;
- left: 0;
opacity: 0;
}
#qr #files img {
+ position: absolute;
+ left: 0;
max-height: 100px;
max-width: 100px;
}