2010-01-26 06:17:14 +01:00
|
|
|
var theProject;
|
|
|
|
var ui = {};
|
|
|
|
|
2010-01-25 23:51:25 +01:00
|
|
|
function onLoad() {
|
2010-01-26 06:17:14 +01:00
|
|
|
var params = URL.getParameters();
|
|
|
|
if ("project" in params) {
|
|
|
|
theProject = {
|
2010-01-29 01:46:15 +01:00
|
|
|
id: parseInt(params.project)
|
2010-01-26 06:17:14 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
Ajax.chainGetJSON(
|
|
|
|
"/command/get-project-metadata?" + $.param({ project: theProject.id }), null,
|
|
|
|
function(data) {
|
|
|
|
theProject.metadata = data;
|
|
|
|
},
|
|
|
|
"/command/get-column-model?" + $.param({ project: theProject.id }), null,
|
|
|
|
function(data) {
|
|
|
|
theProject.columnModel = data;
|
2010-01-26 20:54:14 +01:00
|
|
|
for (var i = 0; i < theProject.columnModel.columns.length; i++) {
|
|
|
|
theProject.columnModel.columns[i].collapsed = false;
|
|
|
|
}
|
2010-01-26 06:17:14 +01:00
|
|
|
},
|
|
|
|
function() {
|
|
|
|
initializeUI();
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
2010-01-25 23:51:25 +01:00
|
|
|
}
|
|
|
|
$(onLoad);
|
2010-01-26 06:17:14 +01:00
|
|
|
|
|
|
|
function initializeUI() {
|
|
|
|
document.title = theProject.metadata.name + " - Gridlock";
|
|
|
|
$("#title").html(document.title);
|
|
|
|
|
|
|
|
var body = $("#body").empty();
|
|
|
|
|
|
|
|
var table = document.createElement("table");
|
|
|
|
$(table).attr("cellspacing", 20).css("width", "100%");
|
|
|
|
body.append(table);
|
|
|
|
|
|
|
|
var tr = table.insertRow(0);
|
|
|
|
|
|
|
|
var tdLeft = tr.insertCell(0);
|
|
|
|
var tdRight = tr.insertCell(1);
|
|
|
|
tdLeft.setAttribute("width", "75%");
|
|
|
|
tdRight.setAttribute("width", "25%");
|
|
|
|
|
|
|
|
ui.viewPanel = $('<div></div>').appendTo(tdLeft).css("width", tdLeft.offsetWidth + "px").css("overflow-x", "auto");
|
|
|
|
ui.facetPanel = $('<div></div>').appendTo(tdRight);
|
2010-01-27 02:48:42 +01:00
|
|
|
ui.historyPanel = $('<div></div>').addClass("history-panel").appendTo(document.body);
|
2010-01-26 06:17:14 +01:00
|
|
|
|
2010-01-29 01:46:15 +01:00
|
|
|
ui.browsingEngine = new BrowsingEngine(ui.facetPanel);
|
2010-01-27 02:48:42 +01:00
|
|
|
ui.historyWidget = new HistoryWidget(ui.historyPanel);
|
2010-01-29 01:46:15 +01:00
|
|
|
ui.dataTableView = new DataTableView(ui.viewPanel);
|
2010-01-26 08:57:11 +01:00
|
|
|
}
|