2018-11-23 23:46:40 +00:00
|
|
|
const faveManager = (elm) => {
|
|
|
|
let path = document.getElementById("path").innerHTML;
|
|
|
|
let data = "";
|
2018-08-25 05:53:44 +00:00
|
|
|
|
|
|
|
if (elm.style.backgroundColor != "") {
|
|
|
|
elm.style.backgroundColor = "";
|
|
|
|
elm.style.color = "";
|
|
|
|
data = "deleteLink=true";
|
|
|
|
} else {
|
|
|
|
elm.style.backgroundColor = "rgb(255, 255, 255)";
|
|
|
|
elm.style.color = "rgb(0, 0, 0)";
|
|
|
|
data = "deleteLink=false";
|
|
|
|
}
|
|
|
|
|
|
|
|
data += "&linkPath=" + path;
|
|
|
|
doAjax("resources/php/dbController.php", data);
|
|
|
|
}
|
2018-08-25 21:10:09 +00:00
|
|
|
|
|
|
|
// Basically resetting path nodes and setting them up
|
|
|
|
// to the new path and just doing a refresh
|
2018-11-23 23:46:40 +00:00
|
|
|
const loadFave = (elm) => {
|
2018-12-09 21:40:23 +00:00
|
|
|
let path = elm.getAttribute("name");
|
2018-11-23 23:46:40 +00:00
|
|
|
let parts = path.split("/");
|
|
|
|
let size = parts.length;
|
2018-08-25 21:10:09 +00:00
|
|
|
pathNodes = [];
|
|
|
|
|
|
|
|
pathNodes.push(parts[0] + "/");
|
2018-11-23 23:46:40 +00:00
|
|
|
for (let i = 1; i < size - 1; i++) {
|
2018-08-25 21:10:09 +00:00
|
|
|
pathNodes.push(parts[i] + "/");
|
|
|
|
}
|
|
|
|
pathNodes.push(parts[size - 1]);
|
|
|
|
|
|
|
|
getDir("./");
|
|
|
|
}
|