";
@@ -129,6 +146,14 @@ function genList(punchList) {
list += "
Status: " + punchList[i].progress + "
";
list += "
Priority: " + punchList[i].priority + "
";
list += "
Need By: " + punchList[i].nDate + "
";
+ if (punchList[i].tags != undefined) {
+ console.log(`Adding tags object to punchList[${item}]`);
+ list += "
Tags: ";
+ for (t = 0; t < punchList[i].tags.length; t++) {
+ list += punchList[i].tags[t] + ", ";
+ }
+ list += "
";
+ }
list += "
";
list += "
";
@@ -301,3 +326,28 @@ function submitEditPunch() {
putJson(jsonStr);
disableElement("editPunch");
}
+
+function addTag() {
+ var item = document.getElementById("editID").value;
+ var newTag = document.getElementById("tag").value;
+
+ console.log(`Item: ${item}`);
+ console.log(`New Tag: ${newTag}`);
+ // make sure tags object exists
+ if (punchList[item].tags === undefined) {
+ console.log(`Adding tags object to punchList[${item}]`);
+ punchList[item].tags = [];
+ }
+
+ punchList[item].tags.push(newTag);
+ console.log(`${punchList[item].tags}`);
+
+ jsonStr = JSON.stringify(punchList);
+ putJson(jsonStr);
+ disableElement("editPunch");
+ enableElement("punchListAll");
+}
+
+
+
+
diff --git a/punch_list/index.html b/punch_list/index.html
index 0f1a3ca..455a851 100644
--- a/punch_list/index.html
+++ b/punch_list/index.html
@@ -39,6 +39,7 @@
+
diff --git a/punch_list/metadata.js b/punch_list/metadata.js
index af6e224..24078bf 100644
--- a/punch_list/metadata.js
+++ b/punch_list/metadata.js
@@ -1,4 +1,4 @@
-var version = "0.2.017",
+var version = "0.3.021",
debug = false,
jsonUrl = "https://api.myjson.com/bins/1dodsj",
showDone = false,