lx-scan
Version:
License eXtension to find 5-tuples of all installed packages: name, version, project home page, license (e. g. Apache v2, BSD) and required notice. It includes a GUI to edit information for each package and to enter information if necessary.
63 lines (48 loc) • 1.81 kB
JavaScript
(function (obj) {
$ = obj.$;
obj.htmlOptionsJS = function (params) {
var buttonfix = function (button_id,link_id) {
window.location = $("#"+link_id)[0].href;
};
obj.fixpage = function () {
var verbose0 = document.getElementById("verbose0");
verbose0.checked = true;
if(params.path !== "") {
document.getElementById("path").value = params.path;
}
if(params.file !== "")
document.getElementById("filename").value = params.file;
caller = "/save/options?oldpath="+params.oldpath;
document.getElementById('bbutton').href = "/browse?jfile="+params.jfile+"&verbose=true&type=html&caller="+caller;
$("#sholder").click(function() {
changeoption2();
buttonfix(this.id,"sbutton");
});
$("#bholder").click(function () {
buttonfix(this.id,"bbutton");
});
};
obj.changeoption = function() {
var verbose,pathval,verbose0,filename,save,browse,caller;
verbose0 = document.getElementById('verbose0');
filename = document.getElementById('filename');
save = document.getElementById('sbutton');
browse = document.getElementById('bbutton');
verbose = verbose0.checked ? "true" : "false";
pathval = document.getElementById("path").value;
if(!/^.*\/$/.test(pathval)) {
pathval = pathval + "/";
}
pathval += filename.value;
caller = "/save/options";
browse.href = "/browse?jfile="+params.jfile+"&verbose="+verbose+"&type=html&caller="+caller;
save.href = "/save?jfile="+params.jfile+"&verbose="+verbose+"&type=html&path="+pathval+"&oldpath="+params.oldpath;
};
obj.changeoption2 = function() {
var filename = document.getElementById("filename");
if(!/^.*\.html$/.test(filename.value))
filename.value += ".html";
obj.changeoption();
};
};
})(this);