add daily/weekly generators

This commit is contained in:
Kameron Kenny 2019-06-18 16:02:48 -04:00
parent da56c89721
commit b38c6c314a
3 changed files with 30 additions and 1 deletions

View File

@ -205,6 +205,33 @@ function createNewEvent() {
// document.getElementById("newEventList").innerHTML = jsonStr; // document.getElementById("newEventList").innerHTML = jsonStr;
} }
function genDaily() {
punchList = window.punches;
var daily = [ "Check Workday", "Check Expenses", "Check Change Cases", "Check TD's", "Check at-mentions" ];
console.log(`${daily[1]}`);
for (x = 0; x < daily.length; x++) {
var newEventJson = { uuid: genUid(), nDate: "EOD", subject: daily[x], priority: "1", progress: "new", notes: "", tags: [ "work", "daily", "today" ] };
punchList.push(newEventJson);
jsonStr = JSON.stringify(punchList);
putJson(jsonStr);
}
}
function genWeekly() {
punchList = window.punches;
var weekly = [ "Update ORB Notes", "Prep Weekly Meeting", "Build out Broadcast Timer" ];
for (x = 0; x < weekly.length; x++) {
var newEventJson = { uuid: genUid(), nDate: "Tuesday", subject: weekly[x], priority: "1", progress: "new", notes: "", tags: [ "work", "weekly" ] };
punchList.push(newEventJson);
jsonStr = JSON.stringify(punchList);
putJson(jsonStr);
}
}
function deletePunch(uuid) { function deletePunch(uuid) {
// console.log(`${punchList}`); // console.log(`${punchList}`);
// console.log(`${window.punches}`); // console.log(`${window.punches}`);

View File

@ -27,6 +27,8 @@
<div class="column"> <div class="column">
<button class="button" onClick="disableElement('punchListAll'), disableElement('punchDetail'), enableElement('newEvent')" id="put">New Punch Item</button> <button class="button" onClick="disableElement('punchListAll'), disableElement('punchDetail'), enableElement('newEvent')" id="put">New Punch Item</button>
<button class="button" onClick="genDaily()" id="daily">Gen Daily</button>
<button class="button" onClick="genWeekly()" id="daily">Gen Weekly</button>
<button class="button" onClick="getJson(genList)" id="getJson">Refresh</button> <button class="button" onClick="getJson(genList)" id="getJson">Refresh</button>
<a class="button" href="https://thelinux.pro/broadcast_timer">Time Boxer</a> <a class="button" href="https://thelinux.pro/broadcast_timer">Time Boxer</a>
</div> </div>

View File

@ -1,4 +1,4 @@
var version = "0.3.048", var version = "0.4.003",
debug = false, debug = false,
jsonUrl = "https://api.myjson.com/bins/1dodsj", jsonUrl = "https://api.myjson.com/bins/1dodsj",
showDone = false, showDone = false,