mirror of
https://github.com/myvesta/vesta
synced 2025-07-16 10:03:23 -07:00
User page functionality merger (80%)
This commit is contained in:
parent
2b06ef5faa
commit
43dffa3fbe
11 changed files with 826 additions and 208 deletions
|
@ -1,5 +1,10 @@
|
|||
var _DEBUG = true;
|
||||
|
||||
window.jsonParse=function(){var r="(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)",k='(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))';k='(?:"'+k+'*")';var s=new RegExp("(?:false|true|null|[\\{\\}\\[\\]]|"+r+"|"+k+")","g"),t=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),u={'"':'"',"/":"/","\\":"\\",b:"\u0008",f:"\u000c",n:"\n",r:"\r",t:"\t"};function v(h,j,e){return j?u[j]:String.fromCharCode(parseInt(e,16))}var w=new String(""),x=Object.hasOwnProperty;return function(h,
|
||||
j){h=h.match(s);var e,c=h[0],l=false;if("{"===c)e={};else if("["===c)e=[];else{e=[];l=true}for(var b,d=[e],m=1-l,y=h.length;m<y;++m){c=h[m];var a;switch(c.charCodeAt(0)){default:a=d[0];a[b||a.length]=+c;b=void 0;break;case 34:c=c.substring(1,c.length-1);if(c.indexOf("\\")!==-1)c=c.replace(t,v);a=d[0];if(!b)if(a instanceof Array)b=a.length;else{b=c||w;break}a[b]=c;b=void 0;break;case 91:a=d[0];d.unshift(a[b||a.length]=[]);b=void 0;break;case 93:d.shift();break;case 102:a=d[0];a[b||a.length]=false;
|
||||
b=void 0;break;case 110:a=d[0];a[b||a.length]=null;b=void 0;break;case 116:a=d[0];a[b||a.length]=true;b=void 0;break;case 123:a=d[0];d.unshift(a[b||a.length]={});b=void 0;break;case 125:d.shift();break}}if(l){if(d.length!==1)throw new Error;e=e[0]}else if(d.length)throw new Error;if(j){var p=function(n,o){var f=n[o];if(f&&typeof f==="object"){var i=null;for(var g in f)if(x.call(f,g)&&f!==n){var q=p(f,g);if(q!==void 0)f[g]=q;else{i||(i=[]);i.push(g)}}if(i)for(g=i.length;--g>=0;)delete f[i[g]]}return j.call(n,
|
||||
o,f)};e=p({"":e},"")}return e}}();
|
||||
|
||||
|
||||
(function($){$.toJSON=function(o)
|
||||
{if(typeof(JSON)=='object'&&JSON.stringify)
|
||||
|
@ -86,7 +91,7 @@ var App = {
|
|||
// pages related views
|
||||
Pages: {
|
||||
USER: {},
|
||||
WEBDOMAIN: {},
|
||||
WEB_DOMAIN: {},
|
||||
MAIL: {},
|
||||
DB: {},
|
||||
DNS: {},
|
||||
|
@ -97,7 +102,7 @@ var App = {
|
|||
Messages: {},
|
||||
Model: {
|
||||
USER: {},
|
||||
WEBDOMAIN: {},
|
||||
WEB_DOMAIN: {},
|
||||
MAIL: {},
|
||||
DB: {},
|
||||
DNS: {},
|
||||
|
@ -109,7 +114,7 @@ var App = {
|
|||
},
|
||||
Pages: {
|
||||
USER: {},
|
||||
WEBDOMAIN: {},
|
||||
WEB_DOMAIN: {},
|
||||
MAIL: {},
|
||||
DB: {},
|
||||
DNS: {},
|
||||
|
@ -119,8 +124,10 @@ var App = {
|
|||
Ref: {},
|
||||
Tmp: {},
|
||||
Thread: {
|
||||
run: function(delay, ref){
|
||||
setTimeout(function(){
|
||||
run: function(delay, ref)
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
ref();
|
||||
}, delay*10);
|
||||
}
|
||||
|
@ -136,7 +143,8 @@ var App = {
|
|||
};
|
||||
|
||||
// Internals
|
||||
Array.prototype.set = function(key, value){
|
||||
Array.prototype.set = function(key, value)
|
||||
{
|
||||
var index = this[0][key];
|
||||
this[1][index] = value;
|
||||
}
|
||||
|
@ -144,23 +152,27 @@ Array.prototype.get = function(key){
|
|||
var index = this[0][key];
|
||||
return this[1][index];
|
||||
}
|
||||
Array.prototype.finalize = function(){
|
||||
Array.prototype.finalize = function()
|
||||
{
|
||||
this.shift();
|
||||
this[0] = this[0].join('');
|
||||
return this[0];
|
||||
}
|
||||
Array.prototype.done = function(){
|
||||
Array.prototype.done = function()
|
||||
{
|
||||
return this.join('');
|
||||
}
|
||||
|
||||
String.prototype.wrapperize = function(key, ns){
|
||||
String.prototype.wrapperize = function(key, ns)
|
||||
{
|
||||
var tpl = App.Templates.get(key, ns);
|
||||
tpl.set(':content', this);
|
||||
|
||||
return tpl.finalize();
|
||||
}
|
||||
|
||||
App.Ajax.request = function(jedi_method, data, callback){
|
||||
App.Ajax.request = function(jedi_method, data, callback)
|
||||
{
|
||||
App.Helpers.beforeAjax(jedi_method);
|
||||
$.ajax({
|
||||
url: function() {
|
||||
|
@ -176,13 +188,17 @@ App.Ajax.request = function(jedi_method, data, callback){
|
|||
global: false,
|
||||
type: data.request_method || "POST",
|
||||
data: $.extend(data, {'jedi_method': jedi_method}),
|
||||
dataType: "json",
|
||||
dataType: "text",
|
||||
async:true,
|
||||
success: function(reply){
|
||||
success: function(reply)
|
||||
{
|
||||
timer.start();
|
||||
callback && callback(jsonParse(reply));
|
||||
App.Helpers.afterAjax();
|
||||
callback && callback(reply);
|
||||
timer.stop(jedi_method);
|
||||
},
|
||||
error: function() {
|
||||
error: function()
|
||||
{
|
||||
App.View.popup('error');
|
||||
}
|
||||
});
|
||||
|
@ -207,7 +223,7 @@ timer.stop = function( msg )
|
|||
timer.print = function( msg )
|
||||
{
|
||||
var passed = timer.stop_time - timer.start_time;
|
||||
fb.info( msg || '' + passed / 1000 );
|
||||
fb.info( (msg || '') + ': ' + passed / 1000 );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue