requests, errors, dialogs

This commit is contained in:
Rolux 2010-02-01 11:41:35 +05:30
parent dedac0a29f
commit 74e89e680e
5 changed files with 24 additions and 34 deletions

View File

@ -26,22 +26,14 @@ Dialog
.OxThemeClassic .OxDialog {
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 {
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

View File

@ -67,8 +67,6 @@ Dialog
position: absolute;
-moz-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 {

View File

@ -26,13 +26,8 @@ Dialog
.OxThemeModern .OxDialog {
background: rgba(48, 48, 48, 0.96);
}
.OxThemeModern .OxDialog > .OxTitleBar {
//background: rgba(32, 32, 32, 0.96);
}
.OxThemeModern .OxDialog > .OxButtonsBar {
//background: rgba(32, 32, 32, 0.96);
-moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 1);
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 1);
}
/*

View File

@ -477,16 +477,19 @@ requires
function error(request, status, error) {
var data;
Ox.print("error", request, status, error);
try {
data = JSON.parse(request.responseText);
} catch (error) {
data = {
status: {
code: request.status,
text: request.statusText
}
};
if (arguments.length == 1) {
data = arguments[0]
} else {
try {
data = JSON.parse(request.responseText);
} catch (err) {
data = {
status: {
code: request.status,
text: request.statusText
}
};
}
}
if (data.status.code < 500) {
callback(data);
@ -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.")
.open();
// fixme: change this to Send / Don't Send
Ox.print({
request: request,
status: status,
error: error
});
}
pending[options.id] = false;
}
@ -530,14 +533,15 @@ requires
pending[options.id] = false;
try {
data = JSON.parse(data);
} catch(error) {
data = {
} catch (err) {
error({
status: {
code: 500,
text: "Internal Server Error"
},
data: {}
};
});
return;
}
cache[req] = {
data: data,
@ -1082,7 +1086,6 @@ requires
.appendTo(that);
that.$buttons = [];
$.each(options.buttons, function(i, button) {
console.log(button)
that.$buttons[i] = new Ox.Button({
size: "medium",
value: button.value

View File

@ -25,6 +25,7 @@ $(function() {
});
app.request("error");
//app.request("hello");
/*
app.request("login", {"username": "test", "password": "test"}, function(result) {
Ox.print(result);
if (result.status.code == 200) {
@ -39,4 +40,5 @@ $(function() {
} else if (result.status.code == 500) {
}
});
*/
});