From d8683ed9d5b1e74f535a521f90815da710a89d57 Mon Sep 17 00:00:00 2001 From: Jeena Paradies Date: Fri, 9 Nov 2012 23:52:24 +0100 Subject: [PATCH] fixed #20 --- WebKit/scripts/controller/Timeline.js | 11 ++++++----- WebKit/scripts/main.js | 19 ++++++++++++++++++- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/WebKit/scripts/controller/Timeline.js b/WebKit/scripts/controller/Timeline.js index 28172e1..8242ccf 100644 --- a/WebKit/scripts/controller/Timeline.js +++ b/WebKit/scripts/controller/Timeline.js @@ -12,6 +12,7 @@ function(Core, Paths, HostApp, URI) { Core.call(this); this.action = "timeline"; + this.reload_blocked = false; this.max_length = 200; this.timeout = 10 * 1000; // every 10 seconds @@ -82,12 +83,16 @@ function(Core, Paths, HostApp, URI) { } those.newStatus(json); + those.reload_blocked = false; } var data = null; if (HostApp.stringForKey("user_access_token")) { - Paths.getURL(url.toString(), http_method, callback, data); // FIXME: error callback + if (!this.reload_blocked) { + this.reload_blocked = true; + Paths.getURL(url.toString(), http_method, callback, data); // FIXME: error callback + } } } @@ -97,10 +102,6 @@ function(Core, Paths, HostApp, URI) { Core.prototype.sendNewMessage.call(this, content, in_reply_to_status_id, in_reply_to_entity, callback); } - Timeline.prototype.foo = function(a) { - return a; - } - return Timeline; }); \ No newline at end of file diff --git a/WebKit/scripts/main.js b/WebKit/scripts/main.js index 4c5947f..0234f5e 100644 --- a/WebKit/scripts/main.js +++ b/WebKit/scripts/main.js @@ -73,4 +73,21 @@ function debug(string) { alert("DEBUG: " + string); } -setTimeout(HostAppGo, 2000); +function go() { // wait untill everything is loaded + setTimeout(function() { + + if (HostAppGo != undefined) { + + HostAppGo(); + + } else { + + go(); + + } + + }, 500); +} + +go(); +