oxjs/demos/test/app.js

45 lines
1.3 KiB
JavaScript
Raw Normal View History

2010-01-31 13:57:03 +05:30
$(function() {
var app = new Ox.App({
requestURL: "http://blackbook.local:8000/api/"
}),
$dialog = new Ox.Dialog({
2010-01-31 15:02:41 +05:30
title: "Application Error",
2010-01-31 13:57:03 +05:30
buttons: [
2010-01-31 15:02:41 +05:30
{
value: "Change Title",
click: function() {
2010-02-06 19:29:16 +05:30
Ox.print("click to change title")
2010-01-31 15:02:41 +05:30
$dialog.options({
title: "New Title"
});
$dialog.$buttons[0].toggleDisabled();
}
},
{
2010-01-31 13:57:03 +05:30
value: "Close",
2010-01-31 15:02:41 +05:30
click: function() {
$dialog.close();
}
}
2010-01-31 13:57:03 +05:30
]
});
app.request("error");
//app.request("hello");
2010-02-01 11:41:35 +05:30
/*
2010-01-31 13:57:03 +05:30
app.request("login", {"username": "test", "password": "test"}, function(result) {
Ox.print(result);
if (result.status.code == 200) {
Ox.print(result);
app.request("preferences", function(result) {
Ox.print(result.data.preferences);
});
}
else if (result.status.code == 403) {
2010-01-31 15:02:41 +05:30
alert(403);
//$dialog.open();
} else if (result.status.code == 500) {
2010-01-31 13:57:03 +05:30
}
});
2010-02-01 11:41:35 +05:30
*/
2010-01-31 13:57:03 +05:30
});