diff --git a/static/script.js b/static/script.js index 74623f5..d13bc57 100644 --- a/static/script.js +++ b/static/script.js @@ -1,3 +1,23 @@ +function insertAtEnd(myField, myValue) { + myField.value += myValue; +} +function insertDate() { + insertAtEnd(document.getElementById("edit_md"),"\n[ ] "+getDate()+" "); +} + +function getDate(){ + var d = new Date(); + var hr = d.getHours(); + var min = d.getMinutes(); + if (min < 10) { min = "0" + min; } + var day = d.getDate(); + var month = 1+d.getMonth(); + if (month < 10) { month = "0" + month; } + var year = d.getFullYear(); + return year+"-"+month+"-"+day+" "+hr+":"+min +} + + function growTextarea(name) { var el=document.getElementById(name); var rows=el.value.split(/\r?\n|\r/); diff --git a/templates/show_shop.html b/templates/show_shop.html index ba86c33..4ff0fe9 100644 --- a/templates/show_shop.html +++ b/templates/show_shop.html @@ -68,6 +68,7 @@