diff --git a/punch_list/public/css/custom.css b/punch_list/public/css/custom.css index 15a4f0d..71609f1 100644 --- a/punch_list/public/css/custom.css +++ b/punch_list/public/css/custom.css @@ -1,4 +1,6 @@ #neededBy { display: none; } +#whoami { width: 100%; } +.inProgress { color:orange; font-size: 12px; } .subject { overflow: hidden; width: 89%; @@ -8,7 +10,7 @@ font-weight: 900; } .column-left { display: none; } .column-right { display: none; } -.column-middle { width: 100%; overflow: auto; float: left; background: #333; padding-bottom: 200px;} +.column-middle { width: 100%; overflow: auto; background: #333; padding-bottom: 200px; margin-left: auto; margin-right: auto;} #mainMenuWrapper:after { content: ""; clear: both; } #sortable { list-style-type: none; margin: 0; padding: 0; width: 100%; } #sortable li { font-size: 1.4em; color: #AAA;} @@ -45,7 +47,7 @@ a.punch-default { color: #00BFFF; font-size: 12px; text-decoration: none;} a.punch-default:hover { color: #00FFFF; text-shadow: 0px 0px 23px #FFF; } .punch-default { border: 0px solid #AAA; color: #aaa; font-size: 12px; font-family: Arial, Helvetica, sans-serif;} - .inProgress { color: orange; font-size: 12px; } + .inprogress { color: orange; font-size: 12px; } .waiting { color: red; font-size: 12px; } .overdue { color: red; font-size: 12px; border: 1px solid red; padding:3px;} .duesoon { color: yellow; font-size: 12px; border: 1px solid yellow; padding:3px;} @@ -160,6 +162,7 @@ textarea { /* The container
- needed to position the dropdown content */ .dropdown { + min-width: 20px; position: relative; display: inline-block; height: 20px; @@ -249,6 +252,7 @@ textarea { width: 99%; max-width: 99%; padding: 0 5px; } + .header { background-color: #666; margin-top: 6rem; @@ -329,7 +333,7 @@ textarea { margin-right: auto; width: 90%; } .column-left { - display: block; + display: none; margin-top: 100px; margin-left: auto; width: 30%; @@ -339,8 +343,8 @@ textarea { float: left; border-right: 3px solid #000; } - .column-right { display: block; width: 10%; overflow: hidden; float: left;} - .column-middle { display: block; width: 55%; overflow: visible; float: left;} + .column-right { display: none; width: 10%; overflow: hidden; float: left;} + .column-middle { display: block; width: 55%; overflow: visible; margin-left:auto; margin-right:auto;} /* Navbar */ .clock-wrapper { display: block; @@ -395,7 +399,7 @@ textarea { } @media (min-width: 1500px) { .column-left { - display: block; + display: none; margin-top: 100px; margin-left: auto; width: 20%; @@ -405,7 +409,7 @@ textarea { float: left; border-right: 3px solid #000; } - .column-middle { display: block; width: 50%; overflow: hidden; float: left;} - .column-right { display: block; width: 25%; overflow: hidden; float: left; padding-top: 100px;} + .column-middle { display: block; width: 50%; overflow: hidden; margin-left:auto;margin-right:auto;} + .column-right { display: none; width: 25%; overflow: hidden; float: left; padding-top: 100px;} #events-list { background-color: #000; } } diff --git a/punch_list/public/index.html b/punch_list/public/index.html index a31f1a3..39b5f1f 100644 --- a/punch_list/public/index.html +++ b/punch_list/public/index.html @@ -60,19 +60,8 @@ -
-
@@ -83,11 +72,21 @@
+
- Parking Lot + Punches
    @@ -112,6 +111,8 @@
    +
    +
    -
    diff --git a/punch_list/public/js/myFirebase.js b/punch_list/public/js/myFirebase.js index c3d87ca..fb22af0 100644 --- a/punch_list/public/js/myFirebase.js +++ b/punch_list/public/js/myFirebase.js @@ -169,6 +169,40 @@ function newPunch(uid, subject, priority, progress, needBy, notes, tags) { return firebase.database().ref().update(updates); } +function genDaily() { + + var daily = [ "Check Workday", "Check Expenses", "Check Change Cases", "Check TD's", "Check at-mentions" ]; + console.log(`${daily[1]}`); + priority = parseInt("3"); + + var d = new Date(); + var needBy = d.setHours(17,0,0); + + var newTag = "work,daily"; + var stripLeadingSpace = newTag.replace(/, /g, ','); + var noSpaces = stripLeadingSpace.replace(/ /g, '_'); + var newTags = noSpaces.split(","); + + for (x = 0; x < daily.length; x++) { + newPunch(window.uid, daily[x], priority, "new", needBy, "", newTags); + } +} + +function genWeekly() { +getJson(); + + 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); + } +} + // Read the punches via listener // standard functions @@ -301,6 +335,10 @@ function progressMenuDrop(uuid) { document.getElementById("progressDropdown" + uuid).classList.toggle("show"); } +function toggleElement(element) { + document.getElementById(element).classList.toggle("show"); +} + window.onclick = function(event) { if (!event.target.matches('.dropbtn')) { var dropdowns = document.getElementsByClassName("dropdown-content"); @@ -327,7 +365,7 @@ function editPunch(uuid) { var data = snapshot.val(); console.log(data); - var nDate = data.needByDate; + var nDate = new Date(data.needByDate); var notes = data.notes; var priority = data.priority; var progress = data.progress; @@ -405,6 +443,19 @@ function createTimer(element,timeTo) { }, 1000); } +function formatDate(d) { + d = new Date(d); + var minutes = d.getMinutes(); + var hours = d.getHours(); + + if (minutes < 10) { minutes = ('0' + minutes); } + if (hours === 0) { hours = ('0' + hours); } + + var s = d.getFullYear() + '/' + d.getMonth() + '/' + d.getDate() + ' ' + hours + ':' + minutes; + + return s; +} + // load punches @@ -425,12 +476,12 @@ function addPunchElement(childKey, childData) { genPunchListItem('
    ', '#div-portlet' + childKey); genPunchListItem('
    ', '#div-portlet' + childKey); genPunchListItem('
    ' + childData.priority + '
    ', '#priority-container' + childKey); - genPunchListItem('
    ' + childData.subject + '
    ', '#details-container' + childKey); + genPunchListItem('
    ' + childData.subject + '
    details
    ', '#details-container' + childKey); genPunchListItem('
    ', '#details-container' + childKey); - genPunchListItem('
    ' + childData.progress + '
    ', '#details-col-one' + childKey); + genPunchListItem('
    ' + childData.progress + '
    ', '#details-col-one' + childKey); genPunchListItem('
    ', '#details-col-one' + childKey); // status dropdown - genPunchListItem('', '#details-container' + childKey); + genPunchListItem('', '#details-container' + childKey); genPunchListItem('', '#dropdown-wrapper' + childKey); genPunchListItem('', '#dropdown-wrapper' + childKey); genPunchListItem('New', '#progressDropdown' + childKey); @@ -438,12 +489,11 @@ function addPunchElement(childKey, childData) { genPunchListItem('Waiting', '#progressDropdown' + childKey); genPunchListItem('Finish', '#progressDropdown' + childKey); - genPunchListItem('
    ', '#details-container' + childKey); - genPunchListItem('
    ', '#details-container' + childKey); + genPunchListItem('
    ', '#details-container' + childKey); genPunchListItem('
    ', '#details-container' + childKey); if ( childData.needByDate != null && childData.needByDate != undefined && childData.needByDate != '' ) { genPunchListItem('
    ', '#details-col-three' + childKey); - genPunchListItem('
    ' + childData.needByDate + '
    ', '#neededBy' + childKey); + genPunchListItem('
    ' + formatDate(childData.needByDate) + '
    ', '#neededBy' + childKey); genPunchListItem('
    ', '#neededBy' + childKey); createTimer('needby-date-timer' + childKey, childData.needByDate); genPunchListItem('
    ', '#details-col-three' + childKey); @@ -452,8 +502,6 @@ function addPunchElement(childKey, childData) { $( '#needby-data' + childKey ).addClass( "overdue" ); } else if ( ((new Date(childData.needByDate).getTime() - new Date().getTime()) / 1000) <= 259200 ) { $( '#needby-data' + childKey ).addClass( "duesoon" ); - } else { - genPunchListItem('
     
    ', '#details-col-four' + childKey); } } @@ -467,7 +515,7 @@ function addPunchElement(childKey, childData) { } genPunchListItem('
    ', '#div-portlet' + childKey) ; if ( childData.startTime != undefined ) { - genPunchListItem('
    ' + new Date(childData.startTime) + '
    ', '#punch-list-backlog-details' + childKey); + genPunchListItem('
    ' + formatDate(childData.startTime) + '
    ', '#punch-list-backlog-details' + childKey); var time = new Date(childData.startTime).getTime(); createTimer("timer" + childKey, time); } @@ -477,7 +525,6 @@ function addPunchElement(childKey, childData) { genPunchListItem('', '#punch-list-backlog-details' + childKey); } - enableDetail(); } @@ -509,6 +556,7 @@ function loadPunches(uid) { mkSortable(); +//enableDetail(); } @@ -740,36 +788,6 @@ getJson(); // document.getElementById("newEventList").innerHTML = jsonStr; } -function genDaily() { -getJson(); - - 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() { -getJson(); - - 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) { getJson();