HOLY BALLS, load QR's iframe faster. Close #192

This commit is contained in:
Nicolas Stepien 2012-02-07 16:26:28 +01:00
parent 1fbe52ba67
commit c5b06c7d9c
3 changed files with 7 additions and 6 deletions

View File

@ -1207,7 +1207,7 @@
iframe = $.el('iframe', {
id: 'iframe',
hidden: true,
src: 'http://sys.4chan.org/post'
src: 'http://sys.4chan.org/favicon.ico'
});
$.on(iframe, 'error', function() {
return this.src = this.src;
@ -1216,7 +1216,7 @@
if (!qr.status.ready) {
iframe.src = 'about:blank';
return setTimeout((function() {
return iframe.src = 'http://sys.4chan.org/post';
return iframe.src = 'http://sys.4chan.org/favicon.ico';
}), 250);
}
};
@ -3433,7 +3433,7 @@
}
$.on(window, 'message', Main.message);
if (location.hostname === 'sys.4chan.org') {
if (location.pathname === '/post') {
if (location.pathname === '/favicon.ico') {
qr.message.init();
} else if (/report/.test(location.search)) {
$.ready(function() {

View File

@ -2,6 +2,7 @@ master
- aeosynth
prevent post form flicker
- Mayhem
Load QR's iframe to sys.4chan.org faster. Thanks desuwa.
Increase Sauce linking possibilites:
Thumbnails, full images, MD5 hashes.
New option: Recursive Filtering: Filter replies of filtered posts.

View File

@ -880,13 +880,13 @@ qr =
iframe = $.el 'iframe',
id: 'iframe'
hidden: true
src: 'http://sys.4chan.org/post'
src: 'http://sys.4chan.org/favicon.ico'
$.on iframe, 'error', -> @src = @src
# Greasemonkey ghetto fix
loadChecking = (iframe) ->
unless qr.status.ready
iframe.src = 'about:blank'
setTimeout (-> iframe.src = 'http://sys.4chan.org/post'), 250
setTimeout (-> iframe.src = 'http://sys.4chan.org/favicon.ico'), 250
$.on iframe, 'load', -> unless @src is 'about:blank' then setTimeout loadChecking, 250, @
$.add d.body, iframe
@ -2660,7 +2660,7 @@ Main =
$.on window, 'message', Main.message
if location.hostname is 'sys.4chan.org'
if location.pathname is '/post'
if location.pathname is '/favicon.ico'
qr.message.init()
else if /report/.test location.search
$.ready ->