oxjstmp/demos/test/app.js

45 lines
1.3 KiB
JavaScript
Raw Normal View History

2010-01-31 08:27:03 +00:00
$(function() {
var app = new Ox.App({
requestURL: "http://blackbook.local:8000/api/"
}),
$dialog = new Ox.Dialog({
2010-01-31 09:32:41 +00:00
title: "Application Error",
2010-01-31 08:27:03 +00:00
buttons: [
2010-01-31 09:32:41 +00:00
{
value: "Change Title",
click: function() {
console.log("click to change title")
$dialog.options({
title: "New Title"
});
$dialog.$buttons[0].toggleDisabled();
}
},
{
2010-01-31 08:27:03 +00:00
value: "Close",
2010-01-31 09:32:41 +00:00
click: function() {
$dialog.close();
}
}
2010-01-31 08:27:03 +00:00
]
});
app.request("error");
//app.request("hello");
2010-02-01 06:11:35 +00:00
/*
2010-01-31 08:27:03 +00:00
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 09:32:41 +00:00
alert(403);
//$dialog.open();
} else if (result.status.code == 500) {
2010-01-31 08:27:03 +00:00
}
});
2010-02-01 06:11:35 +00:00
*/
2010-01-31 08:27:03 +00:00
});