2010-06-25 15:55:25 +00:00
|
|
|
$(function() {
|
|
|
|
Ox.theme("modern");
|
|
|
|
var $body = $("body"),
|
|
|
|
app = new Ox.App({
|
2010-06-28 09:16:36 +00:00
|
|
|
requestURL: "http://lion.oil21.org:8000/api/"
|
2010-06-25 15:55:25 +00:00
|
|
|
}),
|
2010-06-29 13:22:39 +00:00
|
|
|
$menu = new Ox.MainMenu({
|
|
|
|
menus: [
|
|
|
|
{
|
|
|
|
id: "demo",
|
|
|
|
title: "Demo",
|
|
|
|
items: [
|
|
|
|
{ id: "about", title: "About" }
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "sort",
|
|
|
|
title: "Sort",
|
|
|
|
items: [
|
|
|
|
{ id: "sort_movies", title: "Sort Movies by", items: [
|
|
|
|
{ checked: false, group: "sort_movies", id: "title", title: "Title"},
|
|
|
|
{ checked: false, group: "sort_movies", id: "director", title: "Director" },
|
|
|
|
{ checked: false, group: "sort_movies", id: "country", title: "Country" },
|
|
|
|
{ checked: true, group: "sort_movies", id: "year", title: "Year" },
|
|
|
|
] },
|
|
|
|
{ id: "order_movies", title: "Order Movies", items: [
|
|
|
|
{ checked: false, group: "order_movies", id: "ascending", title: "Ascending"},
|
|
|
|
{ checked: true, group: "order_movies", id: "descending", title: "Descending" },
|
|
|
|
] }
|
|
|
|
]
|
|
|
|
},
|
|
|
|
],
|
|
|
|
size: "large"
|
|
|
|
}),
|
2010-06-25 15:55:25 +00:00
|
|
|
$list = new Ox.TextList({
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
align: "left",
|
|
|
|
id: "title",
|
|
|
|
operator: "+",
|
|
|
|
title: "Title",
|
2010-06-28 09:16:36 +00:00
|
|
|
visible: true,
|
2010-06-25 15:55:25 +00:00
|
|
|
width: 160
|
|
|
|
},
|
|
|
|
{
|
|
|
|
align: "left",
|
|
|
|
id: "director",
|
|
|
|
operator: "+",
|
|
|
|
title: "Director",
|
2010-06-28 09:16:36 +00:00
|
|
|
visible: true,
|
2010-06-25 15:55:25 +00:00
|
|
|
width: 160
|
|
|
|
},
|
2010-06-28 09:16:36 +00:00
|
|
|
{
|
|
|
|
align: "left",
|
|
|
|
id: "country",
|
|
|
|
operator: "+",
|
|
|
|
title: "Country",
|
|
|
|
visible: true,
|
|
|
|
width: 120
|
|
|
|
},
|
2010-06-25 15:55:25 +00:00
|
|
|
{
|
|
|
|
align: "right",
|
|
|
|
id: "year",
|
|
|
|
operator: "-",
|
|
|
|
title: "Year",
|
2010-06-28 09:16:36 +00:00
|
|
|
visible: true,
|
|
|
|
width: 80
|
|
|
|
},
|
|
|
|
{
|
|
|
|
align: "right",
|
|
|
|
id: "runtime",
|
|
|
|
operator: "-",
|
|
|
|
title: "Runtime",
|
|
|
|
visible: false,
|
2010-06-25 15:55:25 +00:00
|
|
|
width: 80
|
|
|
|
}
|
|
|
|
],
|
|
|
|
request: function(options) {
|
|
|
|
app.request("find", $.extend(options, {
|
|
|
|
query: {
|
|
|
|
conditions: [
|
|
|
|
{
|
|
|
|
key: "country",
|
2010-06-29 12:57:42 +00:00
|
|
|
value: "",
|
2010-06-25 15:55:25 +00:00
|
|
|
operator: ""
|
|
|
|
}
|
|
|
|
],
|
|
|
|
operator: ""
|
|
|
|
}
|
|
|
|
}), options.callback);
|
|
|
|
},
|
2010-06-28 09:16:36 +00:00
|
|
|
sort: [
|
|
|
|
{
|
|
|
|
key: "year",
|
|
|
|
operator: "-"
|
|
|
|
}
|
|
|
|
]
|
2010-06-29 13:22:39 +00:00
|
|
|
}),
|
|
|
|
$main = Ox.SplitPanel({
|
|
|
|
elements: [
|
|
|
|
{
|
|
|
|
element: $menu,
|
|
|
|
size: 24
|
|
|
|
},
|
|
|
|
{
|
|
|
|
element: $list
|
|
|
|
}
|
|
|
|
],
|
|
|
|
orientation: "vertical"
|
2010-06-25 15:55:25 +00:00
|
|
|
}).appendTo($body);
|
|
|
|
});
|