fixed authentication in Linux, showing Timeline now

This commit is contained in:
Jeena Paradies 2012-11-18 02:20:35 +01:00
parent f58281adc3
commit b138887371
8 changed files with 196 additions and 85 deletions

View file

@ -103,6 +103,7 @@ function(HostApp, Paths, Hmac) {
Oauth.prototype.requestAccessToken = function(responseBody) {
// /oauthtoken?code=51d0115b04d1ed94001dde751c5b360f&state=aQfH1VEohYsQr86qqyv
var urlVars = Paths.getUrlVars(responseBody);
if(this.state && this.state != "" && urlVars["state"] == this.state) {
@ -145,6 +146,7 @@ function(HostApp, Paths, Hmac) {
HostApp.setStringForKey(access["token_type"], "user_token_type");
HostApp.loggedIn();
console.log("D")
}
Oauth.prototype.logout = function() {

View file

@ -55,7 +55,7 @@ function(jQuery, HostApp, Hmac) {
data: data,
processData: false,
error: function(xhr, ajaxOptions, thrownError) {
alert("getURL " + xhr.statusText + " " + http_method + " (" + url + "): '" + xhr.responseText + "'");
console.error("getURL " + xhr.statusText + " " + http_method + " (" + url + "): '" + xhr.responseText + "'");
}
});
}
@ -86,7 +86,7 @@ function(jQuery, HostApp, Hmac) {
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert("findProfileURL " + xhr.statusText + " (" + entity + "): " + xhr.responseText);
console.error("findProfileURL " + xhr.statusText + " (" + entity + "): " + xhr.responseText);
if (errorCallback) errorCallback(xhr.statusText + " - " + xhr.responseText)
}
});

View file

@ -55,6 +55,37 @@ String.prototype.endsWith = function(suffix) {
return this.match(suffix+"$") == suffix;
};
var console = {
log: function(s) {
if (OS_TYPE == "mac") {
alert(s)
} else {
__console.log(s);
}
},
error: function(s) {
if (OS_TYPE == "mac") {
alert("ERROR: " + s);
} else {
__console.error(s);
}
},
warning: function (s) {
if (OS_TYPE == "mac") {
alert("WARNING: " + s);
} else {
__console.warning(s);
}
}
notice: function(s) {
if (OS_TYPE == "mac") {
alert("NOTICE: " + s);
} else {
__console.notice(s);
}
}
};
function loadPlugin(url) {
var plugin = document.createElement("script");
plugin.type = "text/javascript";