|
|
|
@ -23,6 +23,7 @@ function run() {
@@ -23,6 +23,7 @@ function run() {
|
|
|
|
|
n.getElementsByClassName('tag')[0].innerText = j.tag; |
|
|
|
|
n.getElementsByClassName('tag')[0].href = '/' + j.tag; |
|
|
|
|
n.getElementsByClassName('url')[0].innerText = 'decrypting...'; |
|
|
|
|
n.getElementsByClassName('really-delete-yes')[0].dataset.tag = j.tag; |
|
|
|
|
document.getElementById('journalmarks').appendChild(n); |
|
|
|
|
decrs.push(journalmarks_decrypturl(j.content).then(function(url) { |
|
|
|
|
n.getElementsByClassName('url')[0].href = url.url; |
|
|
|
@ -37,6 +38,20 @@ function run() {
@@ -37,6 +38,20 @@ function run() {
|
|
|
|
|
})); |
|
|
|
|
}); |
|
|
|
|
return Promise.all(decrs); |
|
|
|
|
}).then(function() { |
|
|
|
|
Array.from(document.getElementsByClassName('delete')).forEach(function(elem) { elem.addEventListener('click', function(e) { |
|
|
|
|
e.target.style.display = 'none'; |
|
|
|
|
e.target.parentElement.getElementsByClassName('really-delete')[0].style.display = 'inline'; |
|
|
|
|
})}); |
|
|
|
|
Array.from(document.getElementsByClassName('really-delete-yes')).forEach(function(elem) { elem.addEventListener('click', function(e) { |
|
|
|
|
post_object('{{ url_for('journalmarks.delete') }}', {tag: e.target.dataset.tag}).then(function() { |
|
|
|
|
window.location.href = '{{ url_for('journalmarks.overview') }}'; |
|
|
|
|
}); |
|
|
|
|
})}); |
|
|
|
|
Array.from(document.getElementsByClassName('really-delete-no')).forEach(function(elem) { elem.addEventListener('click', function(e) { |
|
|
|
|
e.target.parentElement.style.display = 'none'; |
|
|
|
|
e.target.parentElement.parentElement.getElementsByClassName('delete')[0].style.display = 'inline'; |
|
|
|
|
})}); |
|
|
|
|
}).catch(function(error) { |
|
|
|
|
console.log(error); |
|
|
|
|
//deleteKey(); |
|
|
|
@ -86,6 +101,9 @@ td {
@@ -86,6 +101,9 @@ td {
|
|
|
|
|
td div { |
|
|
|
|
word-break: break-all; |
|
|
|
|
} |
|
|
|
|
.really-delete { |
|
|
|
|
display: none; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|
|
|
|
|
|
{% endblock %} |
|
|
|
@ -104,7 +122,15 @@ td div {
@@ -104,7 +122,15 @@ td div {
|
|
|
|
|
<tr><td>Created:</td><td><span class="date"></td></tr> |
|
|
|
|
<tr class="comment-row"><td>Comment:</td><td><div><span class="comment"></span></div></td></tr> |
|
|
|
|
</table> |
|
|
|
|
<p class="actionlinks"><a href="">edit comment</a> | <a href="">delete</a></p> |
|
|
|
|
<p class="actionlinks"> |
|
|
|
|
<!--<button class="pure-button">edit comment</button>--> |
|
|
|
|
<button class="pure-button delete">Delete</button> |
|
|
|
|
<span class="really-delete"> |
|
|
|
|
Really delete? |
|
|
|
|
<button class="pure-button really-delete-yes">Yes!</button> |
|
|
|
|
<button class="pure-button really-delete-no">No!</button> |
|
|
|
|
</span> |
|
|
|
|
</p> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
{% endblock %} |
|
|
|
|