Reload the iframe on connection error.

This commit is contained in:
Nicolas Stepien 2012-01-25 18:31:00 +01:00
parent 593329b41e
commit 966b84ea71
2 changed files with 10 additions and 3 deletions

View File

@ -1191,15 +1191,20 @@
qr = {
init: function() {
var iframe;
if (!$('form[name=post]')) return;
g.callbacks.push(function(root) {
return $.on($('.quotejs + .quotejs', root), 'click', qr.quote);
});
$.add(d.body, $.el('iframe', {
iframe = $.el('iframe', {
id: 'iframe',
hidden: true,
src: 'http://sys.4chan.org/post'
}));
});
$.on(iframe, 'error', function() {
return this.src = this.src;
});
$.add(d.body, iframe);
if (conf['Persistent QR']) {
qr.dialog();
if (conf['Auto Hide QR']) qr.hide();

View File

@ -861,10 +861,12 @@ qr =
return unless $ 'form[name=post]'
g.callbacks.push (root) ->
$.on $('.quotejs + .quotejs', root), 'click', qr.quote
$.add d.body, $.el 'iframe',
iframe = $.el 'iframe',
id: 'iframe'
hidden: true
src: 'http://sys.4chan.org/post'
$.on iframe, 'error', -> @src = @src
$.add d.body, iframe
if conf['Persistent QR']
qr.dialog()
qr.hide() if conf['Auto Hide QR']