remove a bunch of console.log's

This commit is contained in:
samerbam 2023-08-24 22:36:18 -04:00
parent ffecfd10bf
commit e3bbd502ee

View File

@ -22,8 +22,8 @@ function singleClickListener(e) {
// e.target.classList.remove("h-11") // e.target.classList.remove("h-11")
// e.target.classList.add("h-24") // e.target.classList.add("h-24")
console.log(e.target.tagName) // console.log(e.target.tagName)
console.log(e.target.parentElement.tagName) // console.log(e.target.parentElement.tagName)
if (e.target.tagName !== "LI" && e.target.parentElement.tagName !== "LI" && e.target.parentElement.parentElement.tagName !== "LI") return; if (e.target.tagName !== "LI" && e.target.parentElement.tagName !== "LI" && e.target.parentElement.parentElement.tagName !== "LI") return;
@ -79,13 +79,13 @@ function onClickListener(e) {
// focOutFired = false // focOutFired = false
triggerFocOutEvent = false triggerFocOutEvent = false
console.log(e) // console.log(e)
} }
function blurOrKeypress(e) { function blurOrKeypress(e) {
// split up largely for readability // split up largely for readability
console.log(e) // console.log(e)
// console.log(document.activeElement) // console.log(document.activeElement)
if (!triggerFocOutEvent) { if (!triggerFocOutEvent) {
triggerFocOutEvent = true triggerFocOutEvent = true
@ -355,7 +355,7 @@ function dblListener(e) {
function timeListener(e) { function timeListener(e) {
console.log(e.target.value) // console.log(e.target.value)
let parsedDate = dayjs(e.target.value, 'HH:mm') let parsedDate = dayjs(e.target.value, 'HH:mm')
let activeZone = "startTimeLabel" let activeZone = "startTimeLabel"
@ -413,9 +413,9 @@ function quickButtonListener(e) {
"t120": 120 "t120": 120
} }
console.log(e.target.id) // console.log(e.target.id)
console.log(document.getElementById("startTimeLabel").innerHTML) // console.log(document.getElementById("startTimeLabel").innerHTML)
console.log(dayjs(document.getElementById("startTimeLabel").innerHTML, "h:mm a")) // console.log(dayjs(document.getElementById("startTimeLabel").innerHTML, "h:mm a"))
document.getElementById("endTimeLabel").innerHTML = dayjs(document.getElementById("startTimeLabel").innerHTML, "h:mm a").add(idToAmount[e.target.id], 'm').format('h:mm a') document.getElementById("endTimeLabel").innerHTML = dayjs(document.getElementById("startTimeLabel").innerHTML, "h:mm a").add(idToAmount[e.target.id], 'm').format('h:mm a')
} }
@ -424,8 +424,8 @@ function saveButtonListener(e) {
setsavePrintButton(save=true) setsavePrintButton(save=true)
let startTime = dayjs(document.getElementById("startTimeLabel").innerHTML, 'h:mm a') let startTime = dayjs(document.getElementById("startTimeLabel").innerHTML, 'h:mm a')
let endTime = dayjs(document.getElementById("endTimeLabel").innerHTML, 'h:mm a') let endTime = dayjs(document.getElementById("endTimeLabel").innerHTML, 'h:mm a')
console.log('??') // console.log('??')
console.log(document.getElementsByClassName("timePickerWindowButton")) // console.log(document.getElementsByClassName("timePickerWindowButton"))
startTimeListener("", triggeredFromCode=true) startTimeListener("", triggeredFromCode=true)
document.getElementById("rad1").checked = "clicked" document.getElementById("rad1").checked = "clicked"
@ -434,17 +434,17 @@ function saveButtonListener(e) {
for (let b of document.getElementsByClassName("timePickerWindowButton")) { for (let b of document.getElementsByClassName("timePickerWindowButton")) {
// let b = bu.querySelector("#timeButtonDisplay") // let b = bu.querySelector("#timeButtonDisplay")
console.log('==') // console.log('==')
console.log(b) // console.log(b)
console.log(b.dataset.timepickershown) // console.log(b.dataset.timepickershown)
console.log('===') // console.log('===')
if (b.dataset.timepickershown === 'true') { if (b.dataset.timepickershown === 'true') {
b.dataset.timepickershown = false b.dataset.timepickershown = false
b.querySelector("#timeButtonDisplay").innerHTML = startTime.format('h:mma') + " to " + endTime.format('h:mma') b.querySelector("#timeButtonDisplay").innerHTML = startTime.format('h:mma') + " to " + endTime.format('h:mma')
b.parentElement.parentElement.querySelector("#timeslot").innerHTML = startTime.format('ha') b.parentElement.parentElement.querySelector("#timeslot").innerHTML = startTime.format('ha')
console.log(startTime.minute()) // console.log(startTime.minute())
if (startTime.minute() != 0) { if (startTime.minute() != 0) {
b.parentElement.parentElement.querySelector("#timeslot").innerHTML = startTime.format('h:mma') b.parentElement.parentElement.querySelector("#timeslot").innerHTML = startTime.format('h:mma')
} }
@ -477,8 +477,8 @@ function showTimePickerWindow(e) {
// e.target.dataset.timepickershown = true // e.target.dataset.timepickershown = true
console.log(e.target) // console.log(e.target)
console.log(e.target.dataset.timepickershown) // console.log(e.target.dataset.timepickershown)
if (this.dataset.timepickershown === 'true') return; if (this.dataset.timepickershown === 'true') return;
setsavePrintButton(save=true) setsavePrintButton(save=true)
@ -490,7 +490,7 @@ function showTimePickerWindow(e) {
times[0] = dayjs().format("h:mma") times[0] = dayjs().format("h:mma")
times[1] = dayjs().add(1, 'h').format("h:mma") times[1] = dayjs().add(1, 'h').format("h:mma")
} }
console.log(times) // console.log(times)
// console.log(startTime) // console.log(startTime)
// console.log(endTime) // console.log(endTime)
@ -504,9 +504,9 @@ function showTimePickerWindow(e) {
function timeSlotShowTimePickerButton(e) { function timeSlotShowTimePickerButton(e) {
console.log('yay!') // console.log('yay!')
if (this.parentElement.parentElement.querySelector(".timePickerWindowButton").dataset.timepickershown === 'true') return; if (this.parentElement.parentElement.querySelector(".timePickerWindowButton").dataset.timepickershown === 'true') return;
console.log('woohoo') // console.log('woohoo')
setsavePrintButton(save=true) setsavePrintButton(save=true)
this.parentElement.parentElement.querySelector(".timePickerWindowButton").dataset.timepickershown = true this.parentElement.parentElement.querySelector(".timePickerWindowButton").dataset.timepickershown = true
@ -515,7 +515,7 @@ function timeSlotShowTimePickerButton(e) {
times[0] = dayjs().format("h:mma") times[0] = dayjs().format("h:mma")
times[1] = dayjs().add(1, 'h').format("h:mma") times[1] = dayjs().add(1, 'h').format("h:mma")
} }
console.log(times) // console.log(times)
// console.log(startTime) // console.log(startTime)
// console.log(endTime) // console.log(endTime)
@ -599,12 +599,12 @@ function savePrintButtonListener(e) {
"todos": todo_list "todos": todo_list
}) })
}) })
.then( (response) => { // .then( (response) => {
response.json().then(r => { // response.json().then(r => {
console.log(r.status) // console.log(r.status)
}) // })
//do something awesome that makes the world a better place // //do something awesome that makes the world a better place
}); // });
@ -673,7 +673,7 @@ function loginAction(e) {
function getTodosFromAPI(day=dayjs().format("YYYY-MM-DD")) { function getTodosFromAPI(day=dayjs().format("YYYY-MM-DD")) {
document.getElementById("loginPanel").classList.add("hidden") document.getElementById("loginPanel").classList.add("hidden")
console.log(jToken) // console.log(jToken)
// console.log(t) // console.log(t)
// jToken = t // jToken = t
@ -690,9 +690,9 @@ function getTodosFromAPI(day=dayjs().format("YYYY-MM-DD")) {
} }
}).then(re => { }).then(re => {
re.json().then(jso => { re.json().then(jso => {
console.log(jso) // console.log(jso)
for (let todo of jso.todos) { for (let todo of jso.todos) {
console.log(todo) // console.log(todo)
// function addTask(defaultTimeRange="", defaultTaskText="New Task", editable=true) { // function addTask(defaultTimeRange="", defaultTaskText="New Task", editable=true) {
addTask(defaultTimeRange=todo.time, defaultTaskText=todo.task, editable=false) addTask(defaultTimeRange=todo.time, defaultTaskText=todo.task, editable=false)
} }
@ -709,7 +709,7 @@ document.getElementById("loginButton").addEventListener('click', loginAction)
function sendPrintRequest(action, date, sentence="") { function sendPrintRequest(action, date, sentence="") {
console.log(jToken) // console.log(jToken)
return fetch("/api/todos/print", { return fetch("/api/todos/print", {
method: "post", method: "post",
headers: { headers: {
@ -737,8 +737,8 @@ function sendPrintRequest(action, date, sentence="") {
function printButtonListener(e) { function printButtonListener(e) {
let action = "" let action = ""
let sentence = "" let sentence = ""
console.log(jToken) // console.log(jToken)
console.log('hereherehere') // console.log('hereherehere')
switch(this.id) { switch(this.id) {
case "printGreeting": case "printGreeting":
action = "greeting" action = "greeting"
@ -767,12 +767,12 @@ function printButtonListener(e) {
return return
} }
console.log(sendPrintRequest(action, dayjs(document.getElementById("date-view").innerHTML.slice(4), "MMM D, YYYY").format("YYYY-MM-DD")), sentence) sendPrintRequest(action, dayjs(document.getElementById("date-view").innerHTML.slice(4), "MMM D, YYYY").format("YYYY-MM-DD"), sentence)
} }
function switchDayListener(e) { function switchDayListener(e) {
console.log(document.getElementById("date-view").innerHTML) // console.log(document.getElementById("date-view").innerHTML)
console.log(dayjs(document.getElementById("date-view").innerHTML, "ddd MMM D, YYYY")) // console.log(dayjs(document.getElementById("date-view").innerHTML, "ddd MMM D, YYYY"))
let dateView = document.getElementById("date-view") let dateView = document.getElementById("date-view")
switch (this.id) { switch (this.id) {
case "nextDayButton": case "nextDayButton":
@ -810,9 +810,9 @@ for (let rb of document.getElementsByClassName("recurringButton")) {
} }
let rows = document.getElementsByClassName("task-row"); let rows = document.getElementsByClassName("task-row");
console.log('hmm'); // console.log('hmm');
for (let row of rows) { for (let row of rows) {
console.log(row.querySelector("#timeslot")) // console.log(row.querySelector("#timeslot"))
row.querySelector("#timeslot").addEventListener("mousedown", timeSlotShowTimePickerButton) row.querySelector("#timeslot").addEventListener("mousedown", timeSlotShowTimePickerButton)
row.addEventListener('keypress', blurOrKeypress); row.addEventListener('keypress', blurOrKeypress);