This repository has been archived on 2025-08-18. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Bungloo/WebKit/scripts/main.js
Jeena Paradies d8683ed9d5 fixed #20
2012-11-09 23:52:24 +01:00

93 lines
1.6 KiB
JavaScript

var tentia_instance;
var tentia_cache = {};
var OS_TYPE = "mac";
requirejs.config({
baseUrl: 'scripts'
});
function start(view) {
if (view == "oauth") {
require(["controller/Oauth"], function(Oauth) {
tentia_instance = new Oauth();
tentia_instance.authenticate();
});
} else if (view == "timeline") {
require(["controller/Timeline"], function(Timeline) {
tentia_instance = new Timeline();
});
} else if (view == "mentions") {
require(["controller/Mentions"], function(Mentions) {
tentia_instance = new Mentions();
});
} else if (view == "profile") {
} else if (view == "follow") {
} else if (view == "conversation") {
require(["controller/Conversation"], function(Conversation) {
tentia_instance = new Conversation();
});
}
}
String.prototype.startsWith = function(prefix) {
return this.indexOf(prefix) === 0;
}
String.prototype.endsWith = function(suffix) {
return this.match(suffix+"$") == suffix;
};
function loadPlugin(url) {
var plugin = document.createElement("script");
plugin.type = "text/javascript";
plugin.src = url;
document.getElementsByTagName("head")[0].appendChild(plugin);
}
function debug(string) {
if (typeof string != "string") {
string = JSON.stringify(string);
}
alert("DEBUG: " + string);
}
function go() { // wait untill everything is loaded
setTimeout(function() {
if (HostAppGo != undefined) {
HostAppGo();
} else {
go();
}
}, 500);
}
go();