restructuring of the whole code basis
This commit is contained in:
parent
2efbbd1d0a
commit
d99ff86520
60 changed files with 14404 additions and 2490 deletions
68
WebKit/scripts/main.js
Normal file
68
WebKit/scripts/main.js
Normal file
|
@ -0,0 +1,68 @@
|
|||
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") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
setTimeout(HostAppGo, 1000);
|
Reference in a new issue