Reload the iframe on connection error.
This commit is contained in:
parent
593329b41e
commit
966b84ea71
@ -1191,15 +1191,20 @@
|
|||||||
|
|
||||||
qr = {
|
qr = {
|
||||||
init: function() {
|
init: function() {
|
||||||
|
var iframe;
|
||||||
if (!$('form[name=post]')) return;
|
if (!$('form[name=post]')) return;
|
||||||
g.callbacks.push(function(root) {
|
g.callbacks.push(function(root) {
|
||||||
return $.on($('.quotejs + .quotejs', root), 'click', qr.quote);
|
return $.on($('.quotejs + .quotejs', root), 'click', qr.quote);
|
||||||
});
|
});
|
||||||
$.add(d.body, $.el('iframe', {
|
iframe = $.el('iframe', {
|
||||||
id: 'iframe',
|
id: 'iframe',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
src: 'http://sys.4chan.org/post'
|
src: 'http://sys.4chan.org/post'
|
||||||
}));
|
});
|
||||||
|
$.on(iframe, 'error', function() {
|
||||||
|
return this.src = this.src;
|
||||||
|
});
|
||||||
|
$.add(d.body, iframe);
|
||||||
if (conf['Persistent QR']) {
|
if (conf['Persistent QR']) {
|
||||||
qr.dialog();
|
qr.dialog();
|
||||||
if (conf['Auto Hide QR']) qr.hide();
|
if (conf['Auto Hide QR']) qr.hide();
|
||||||
|
|||||||
@ -861,10 +861,12 @@ qr =
|
|||||||
return unless $ 'form[name=post]'
|
return unless $ 'form[name=post]'
|
||||||
g.callbacks.push (root) ->
|
g.callbacks.push (root) ->
|
||||||
$.on $('.quotejs + .quotejs', root), 'click', qr.quote
|
$.on $('.quotejs + .quotejs', root), 'click', qr.quote
|
||||||
$.add d.body, $.el 'iframe',
|
iframe = $.el 'iframe',
|
||||||
id: 'iframe'
|
id: 'iframe'
|
||||||
hidden: true
|
hidden: true
|
||||||
src: 'http://sys.4chan.org/post'
|
src: 'http://sys.4chan.org/post'
|
||||||
|
$.on iframe, 'error', -> @src = @src
|
||||||
|
$.add d.body, iframe
|
||||||
if conf['Persistent QR']
|
if conf['Persistent QR']
|
||||||
qr.dialog()
|
qr.dialog()
|
||||||
qr.hide() if conf['Auto Hide QR']
|
qr.hide() if conf['Auto Hide QR']
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user