This commit is contained in:
Kameron Kenny 2019-06-25 18:02:16 -04:00
parent ce8594e5b1
commit a81ada61d2
3 changed files with 59 additions and 15 deletions

View File

@ -6,6 +6,7 @@
<!-- <link href='http://fonts.googleapis.com/css?family=Raleway:400,300,600' rel='stylesheet' type='text/css'> -->
<!-- CSS -->
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/skeleton.css">
<link rel="stylesheet" href="css/custom.css">
@ -38,6 +39,8 @@
<a class="button" href="https://thelinux.pro/broadcast_timer">Time Boxer</a>
</div>
<div id="editPunch" class="listWrapper"></div>
<div class="listWrapper" id="punchListAll">
<div id="punchListInProgressWrapper" class="listWrapper">
<span class="punchListHeader">Backlog</span>
@ -45,6 +48,7 @@
</div>
</div>
<div id="debug1"></div>
<div id="debug1"></div>
</body>
</html>

View File

@ -94,7 +94,24 @@ function genList(punchList, element) {
if (punchList[i].progress.toLowerCase() === "done" && punchList[i].priority != 99999) {
setPriority(punchList[i].uuid, 99999);
} else if (punchList[i].progress.toLowerCase() != "done"){
list += '<li class="' + style + '"><div class="portlet"><div class="backlog-list-header">' + punchList[i].priority + '<div class=subject>' + punchList[i].subject + '</div></div><div class="backlog-list-content"><div style="punch-list-backlog-details">' + punchList[i].progress + '<br /> Created:' + punchList[i].cDate + '<br /> Modified: ' + punchList[i].mDate + '<br /><textarea>' + punchList[i].notes + '</textarea><br /><input onfocus="clearDefault(this)" type="text" id="tag" value="Add tag"><input onClick="addTag()" type=button value="Add" /> </div></div></div></div></li>';
list += '<li class="' + style + '">';
list += '<div class="portlet">';
list += '<div class="backlog-list-header">';
list += punchList[i].priority + '<div class=subject>' + punchList[i].subject + '</div>';
list += '<div class="two columns ' + style + '">' + punchList[i].progress + '</div>';
if (style === "inProgress") {
list += '<div class="two columns ' + style + '"><a class="punch-default" href="#" onClick=completePunch("' + punchList[i].uuid + '")>Finish</a></div>';
} else if (style === "punch-default") {
list += '<div class="two columns ' + style + '"><a class="punch-default" href="#" onClick=startPunch("' + punchList[i].uuid + '")>Start</a></div>';
}
list += '</div>';
list += '<div class="backlog-list-content"><div style="punch-list-backlog-details">' + punchList[i].progress + '<br />';
list += 'Created: ' + punchList[i].cDate + '<br /> ';
list += 'Modified: ' + punchList[i].mDate + '<br />';
list += 'Tags: ' + punchList[i].tags + '<br />';
list += '<textarea>' + punchList[i].notes + '</textarea><br />';
list += '<button class="button" onClick=editPunch("' + punchList[i].uuid + '")>edit</button>';
list += '</div></div></div></li>';
}
}
@ -134,6 +151,12 @@ function mkSortable() {
});
$( "#sortable" ).disableSelection();
} );
// pop-over dialog
$( "#dialog" ).dialog({ autoOpen: false });
$( "#opener" ).click(function() {
$( "#dialog" ).dialog( "open" );
});
}
function setPriority(sortObject, newPosition) {
@ -296,9 +319,7 @@ function editPunch(uuid) {
/* Before doing this,
Refresh the array,
So that we don't overwrite data */
getJson();
disableElement("newEvent");
disableElement("punchListAll");
enableElement("editPunch");
@ -312,29 +333,43 @@ getJson();
var progress = punchList[id].progress;
var nDate = punchList[id].nDate;
var notes = punchList[id].notes;
var tags = punchList[id].tags;
var html = '<div class="container listWrapper">';
html += '<input type=hidden id="editID" value="' + uuid + '">';
html += '<div class="edit-row"><div class="three columns">Subject:</div><div class="nine columns"><input class="twelve columns" type=text id="editSubject" value="' + subject + '"></div></div>';
html += '<div class="three columns">Priority:</div><div class="nine columns"><input type=text id="editPriority" value="' + priority + '"></div>';
html += '<div class="three columns">Need By:</div><div class="nine columns"><input type=text id="timepickerEdit" value="' + nDate + '"></div>';
html += '<div class="three columns">Progress:</div><div id="editProgress" class="nine columns">';
html += progress;
html += '</div>';
html += '<div class="three columns">Tags:</div><div class="nine columns"><input type=text id="editTags" value="' + tags + '"></div>';
html += '<div class="three columns">Notes: </div><div class="nine columns"><textarea class="edit-text-box" id="editNotes">' + notes + '</textarea></div>';
html += '<button onClick=submitEditPunch("' + uuid + '")>Update</button>';
html += '<button onClick=\'disableElement("editPunch"),enableElement("punchListAll")\'>Close</button>';
html += '</div>';
document.getElementById("editPunch").innerHTML = html;
document.getElementById("editID").value = id;
document.getElementById("editSubject").value = subject;
document.getElementById("timepickerEdit").value = nDate;
document.getElementById("editNotes").value = notes;
document.getElementById("editProgress").value = progress;
document.getElementById("editPriority").value = priority;
}
function submitEditPunch() {
function submitEditPunch(uuid) {
punchList = window.punches;
var id = document.getElementById("editID").value;
// var uuid = document.getElementById("editID").value;
var id = findArrayId(uuid);
var subjectField = document.getElementById("editSubject").value;
var priorityField = document.getElementById("editPriority").value;
var progressField = document.getElementById("editProgress").value;
var progressField = document.getElementById("editProgress").innerHTML;
var nDateField = document.getElementById("timepickerEdit").value;
var tagsField = document.getElementById("editTags").value.toLowerCase();
var notesField = document.getElementById("editNotes").value;
punchList[id].subject = subjectField;
punchList[id].priority = priorityField;
punchList[id].progress = progressField;
punchList[id].nDate = nDateField;
punchList[id].tags = tagsField;
punchList[id].notes = notesField;
jsonStr = JSON.stringify(punchList);

View File

@ -6,6 +6,7 @@
}
.backlog-list-header {
padding: 0.2em 0.3em;
padding-bottom: 0.9em;
position: relative;
}
.portlet-toggle {
@ -25,13 +26,17 @@
}
.ui-widget-content { background: #000; color: #aaa;}
.ui-widget-header { background: #333; color: #aaa;}
.punch-default { border: 0px solid #AAA; background: #000; }
.inProgress { background: /*#80ffcc;*/ #555; color: #000; }
a.punch-default { color: #aaa; font-size: 12px; text-decoration: none;}
a.punch-default:hover { color: #00FFFF; }
.punch-default { border: 0px solid #AAA; color: #aaa; font-size: 12px; }
.inProgress { color: orange; font-size: 12px; }
.hide { display: none; }
.punch-list-backlog-details {
font-size: 18px;
color: #aaa;
}
.edit-row { padding-top: 5px; }
.edit-text-box { width: 100%; min-height: 200px; }
body {
background: #222;
color: #AAA; }