requests, errors, dialogs
This commit is contained in:
parent
dedac0a29f
commit
74e89e680e
|
@ -26,22 +26,14 @@ Dialog
|
||||||
|
|
||||||
.OxThemeClassic .OxDialog {
|
.OxThemeClassic .OxDialog {
|
||||||
background: rgba(224, 224, 224, 0.96);
|
background: rgba(224, 224, 224, 0.96);
|
||||||
//border: 1px solid rgba(128, 128, 128, 0.5);
|
-moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.5);
|
||||||
|
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.OxThemeClassic .OxDialog .OxTitle {
|
.OxThemeClassic .OxDialog .OxTitle {
|
||||||
color: rgb(48, 48, 48);
|
color: rgb(48, 48, 48);
|
||||||
}
|
}
|
||||||
|
|
||||||
.OxThemeClassic .OxDialog > .OxTitleBar {
|
|
||||||
//border-color: rgb(192, 192, 192);
|
|
||||||
//background: rgba(208, 208, 208, 0.96);
|
|
||||||
}
|
|
||||||
|
|
||||||
.OxThemeClassic .OxDialog > .OxButtonsBar {
|
|
||||||
//background: rgba(192, 192, 192, 0.96);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
================================================================================
|
================================================================================
|
||||||
Forms
|
Forms
|
||||||
|
|
|
@ -67,8 +67,6 @@ Dialog
|
||||||
position: absolute;
|
position: absolute;
|
||||||
-moz-border-radius: 8px;
|
-moz-border-radius: 8px;
|
||||||
-webkit-border-radius: 8px;
|
-webkit-border-radius: 8px;
|
||||||
-moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.5);
|
|
||||||
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.5);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.OxDialog > .OxTitleBar {
|
.OxDialog > .OxTitleBar {
|
||||||
|
|
|
@ -26,13 +26,8 @@ Dialog
|
||||||
|
|
||||||
.OxThemeModern .OxDialog {
|
.OxThemeModern .OxDialog {
|
||||||
background: rgba(48, 48, 48, 0.96);
|
background: rgba(48, 48, 48, 0.96);
|
||||||
}
|
-moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 1);
|
||||||
.OxThemeModern .OxDialog > .OxTitleBar {
|
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 1);
|
||||||
//background: rgba(32, 32, 32, 0.96);
|
|
||||||
}
|
|
||||||
|
|
||||||
.OxThemeModern .OxDialog > .OxButtonsBar {
|
|
||||||
//background: rgba(32, 32, 32, 0.96);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -477,10 +477,12 @@ requires
|
||||||
|
|
||||||
function error(request, status, error) {
|
function error(request, status, error) {
|
||||||
var data;
|
var data;
|
||||||
Ox.print("error", request, status, error);
|
if (arguments.length == 1) {
|
||||||
|
data = arguments[0]
|
||||||
|
} else {
|
||||||
try {
|
try {
|
||||||
data = JSON.parse(request.responseText);
|
data = JSON.parse(request.responseText);
|
||||||
} catch (error) {
|
} catch (err) {
|
||||||
data = {
|
data = {
|
||||||
status: {
|
status: {
|
||||||
code: request.status,
|
code: request.status,
|
||||||
|
@ -488,6 +490,7 @@ requires
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (data.status.code < 500) {
|
if (data.status.code < 500) {
|
||||||
callback(data);
|
callback(data);
|
||||||
} else {
|
} else {
|
||||||
|
@ -516,13 +519,13 @@ requires
|
||||||
})
|
})
|
||||||
.append("Sorry, we have encountered an application error while handling your request. To help us find out what went wrong, you may want to report this error to an administrator. Otherwise, please try again later.")
|
.append("Sorry, we have encountered an application error while handling your request. To help us find out what went wrong, you may want to report this error to an administrator. Otherwise, please try again later.")
|
||||||
.open();
|
.open();
|
||||||
|
// fixme: change this to Send / Don't Send
|
||||||
Ox.print({
|
Ox.print({
|
||||||
request: request,
|
request: request,
|
||||||
status: status,
|
status: status,
|
||||||
error: error
|
error: error
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
pending[options.id] = false;
|
pending[options.id] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -530,14 +533,15 @@ requires
|
||||||
pending[options.id] = false;
|
pending[options.id] = false;
|
||||||
try {
|
try {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
} catch(error) {
|
} catch (err) {
|
||||||
data = {
|
error({
|
||||||
status: {
|
status: {
|
||||||
code: 500,
|
code: 500,
|
||||||
text: "Internal Server Error"
|
text: "Internal Server Error"
|
||||||
},
|
},
|
||||||
data: {}
|
data: {}
|
||||||
};
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
cache[req] = {
|
cache[req] = {
|
||||||
data: data,
|
data: data,
|
||||||
|
@ -1082,7 +1086,6 @@ requires
|
||||||
.appendTo(that);
|
.appendTo(that);
|
||||||
that.$buttons = [];
|
that.$buttons = [];
|
||||||
$.each(options.buttons, function(i, button) {
|
$.each(options.buttons, function(i, button) {
|
||||||
console.log(button)
|
|
||||||
that.$buttons[i] = new Ox.Button({
|
that.$buttons[i] = new Ox.Button({
|
||||||
size: "medium",
|
size: "medium",
|
||||||
value: button.value
|
value: button.value
|
||||||
|
|
|
@ -25,6 +25,7 @@ $(function() {
|
||||||
});
|
});
|
||||||
app.request("error");
|
app.request("error");
|
||||||
//app.request("hello");
|
//app.request("hello");
|
||||||
|
/*
|
||||||
app.request("login", {"username": "test", "password": "test"}, function(result) {
|
app.request("login", {"username": "test", "password": "test"}, function(result) {
|
||||||
Ox.print(result);
|
Ox.print(result);
|
||||||
if (result.status.code == 200) {
|
if (result.status.code == 200) {
|
||||||
|
@ -39,4 +40,5 @@ $(function() {
|
||||||
} else if (result.status.code == 500) {
|
} else if (result.status.code == 500) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user