|
|
@ -7,8 +7,17 @@ class Controller {
|
|
|
|
|
|
|
|
|
|
|
|
var cloneBtn = document.getElementsByClassName("clone")[0];
|
|
|
|
var cloneBtn = document.getElementsByClassName("clone")[0];
|
|
|
|
var purgeBtn = document.getElementsByClassName("wipe")[0];
|
|
|
|
var purgeBtn = document.getElementsByClassName("wipe")[0];
|
|
|
|
|
|
|
|
var settingsBtn = document.getElementsByClassName("settingsBtn")[0];
|
|
|
|
|
|
|
|
var settingsClose = document.getElementsByClassName("close");
|
|
|
|
|
|
|
|
var settingsSubmit = document.getElementById("settingsSubmit");
|
|
|
|
|
|
|
|
|
|
|
|
cloneBtn.addEventListener("click", this.cloneRep.bind(this));
|
|
|
|
cloneBtn.addEventListener("click", this.cloneRep.bind(this));
|
|
|
|
purgeBtn.addEventListener("click", this.wipeFS.bind(this));
|
|
|
|
purgeBtn.addEventListener("click", this.wipeFS.bind(this));
|
|
|
|
|
|
|
|
settingsBtn.addEventListener("click", view.openSettings.bind(this));
|
|
|
|
|
|
|
|
for (let i = 0; i < settingsClose.length; i++) {
|
|
|
|
|
|
|
|
settingsClose[i].addEventListener("click", view.closeSettings.bind(this));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
settingsSubmit.addEventListener("click", this.saveSettings.bind(this));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wipeFS() {
|
|
|
|
wipeFS() {
|
|
|
@ -40,4 +49,16 @@ class Controller {
|
|
|
|
function (error) {}
|
|
|
|
function (error) {}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
saveSettings() {
|
|
|
|
|
|
|
|
let repo = document.getElementById("inputRepository");
|
|
|
|
|
|
|
|
let baseDir = document.getElementById("inputBaseDir");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.model.setRepo(repo.value);
|
|
|
|
|
|
|
|
this.model.setBaseDir(baseDir.value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.redrawDirTree(this.view);
|
|
|
|
|
|
|
|
this.view.closeSettings();
|
|
|
|
|
|
|
|
console.log(repo.value);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|