nixpkgs/gui/chrome/content/main.js
Nicolas Pierron 0265bff844 Improve nixos-gui:
- Can navigate in the tree of option.
- Provide information on options.

svn path=/nixos/trunk/; revision=26945
2011-04-24 04:19:15 +00:00

41 lines
807 B
JavaScript

// global variables.
var gNixOS;
var gOptionView;
/*
var gProgressBar;
function setProgress(current, max)
{
if (gProgressBar) {
gProgressBar.value = 100 * current / max;
log("progress: " + gProgressBar.value + "%");
}
else
log("unknow progress bar");
}
*/
function updatePanel(options)
{
log("updatePanel: " + options.length);
var t = "";
for (var i = 0; i < options.length; i++)
{
log("Called with " + options[i].path);
t += options[i].description;
}
$("#option-desc").text(t);
}
function onload()
{
var optionTree = document.getElementById("option-tree");
// gProgressBar = document.getElementById("progress-bar");
// setProgress(0, 1);
gNixOS = new NixOS();
gOptionView = new OptionView(gNixOS.option, updatePanel);
optionTree.view = gOptionView;
}