mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 13:01:52 -07:00
export from svn
This commit is contained in:
commit
641ed97fdd
340 changed files with 32404 additions and 0 deletions
116
web/js/old/app.js
Normal file
116
web/js/old/app.js
Normal file
|
@ -0,0 +1,116 @@
|
|||
/**
|
||||
* App namespace
|
||||
*/
|
||||
var App = {
|
||||
Ajax: {},
|
||||
Env: {
|
||||
BROWSER: {
|
||||
type: 'unknown-type',
|
||||
version: 'version', // prefixed with type will be "unknown-version"
|
||||
os: 'unknown-os'
|
||||
},
|
||||
getWorldName: function() {
|
||||
return App.Env.world.toLowerCase();
|
||||
}
|
||||
},
|
||||
Core: {},
|
||||
Bash: {},
|
||||
Console: {},
|
||||
Constants: {},
|
||||
Actions: {},
|
||||
Helpers: {},
|
||||
Filters: {},
|
||||
i18N: {},
|
||||
HTML: {
|
||||
Build: {}
|
||||
},
|
||||
View:{
|
||||
|
||||
// pages related views
|
||||
Pages: {
|
||||
USER: {},
|
||||
WEBDOMAIN: {},
|
||||
MAIL: {},
|
||||
DB: {},
|
||||
DNS: {},
|
||||
IP: {},
|
||||
CRON: {}
|
||||
}
|
||||
},
|
||||
Messages: {},
|
||||
Model: {
|
||||
USER: {},
|
||||
WEBDOMAIN: {},
|
||||
MAIL: {},
|
||||
DB: {},
|
||||
DNS: {},
|
||||
IP: {},
|
||||
CRON: {}
|
||||
},
|
||||
Cache: {
|
||||
clear: function(){} // stub method, will be used later
|
||||
},
|
||||
Pages: {
|
||||
USER: {},
|
||||
WEBDOMAIN: {},
|
||||
MAIL: {},
|
||||
DB: {},
|
||||
DNS: {},
|
||||
IP: {},
|
||||
CRON: {}
|
||||
},
|
||||
Ref: {},
|
||||
Tmp: {},
|
||||
Thread: {
|
||||
run: function(delay, ref){
|
||||
setTimeout(function(){
|
||||
ref();
|
||||
}, delay*10);
|
||||
}
|
||||
},
|
||||
Settings: {},
|
||||
Templates: {
|
||||
Templator: null,
|
||||
Tpl: {},
|
||||
_indexes: {}
|
||||
},
|
||||
Utils: {},
|
||||
Validate: {}
|
||||
};
|
||||
|
||||
//
|
||||
// AJAX global method
|
||||
//
|
||||
App.Ajax.request = function(jedi_method, data, callback){
|
||||
App.Helpers.beforeAjax(jedi_method);
|
||||
$.ajax({
|
||||
url: function() {
|
||||
var url_parts = location.href.split('/');
|
||||
if (url_parts[url_parts.length -1] == 'index.html') {
|
||||
url_parts[url_parts.length -1] = 'dispatch.php';
|
||||
}
|
||||
else {
|
||||
url_parts.push('dispatch.php');
|
||||
}
|
||||
return url_parts.join('/');
|
||||
}(),
|
||||
global: false,
|
||||
type: data.request_method || "POST",
|
||||
data: $.extend(data, {'jedi_method': jedi_method}),
|
||||
dataType: "json",
|
||||
async:true,
|
||||
success: function(reply){
|
||||
App.Helpers.afterAjax();
|
||||
callback && callback(reply);
|
||||
},
|
||||
error: function() {
|
||||
App.View.popup('error');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue