varios small changes
This commit is contained in:
@@ -1016,7 +1016,7 @@ function deleteComment(self) {
|
||||
if(retval == 'success') {
|
||||
flash('success', 'Comment deleted');
|
||||
comment.removeClass('panel-default').addClass('panel-danger');
|
||||
comment.find('.panel-footer').children('a[onclick="deleteComment($(this))"]').replaceWith('<a href="#" onclick="restoreComment($(this))"><i style="color:green"; class="fa fa-refresh" aria-hidden="true"></i></a>');
|
||||
comment.find('.panel-footer').children('a[onclick="deleteComment($(this))"]').replaceWith('<a href="href="#' + id + '"' + 'onclick="restoreComment($(this))"><i style="color:green"; class="fa fa-refresh" aria-hidden="true"></i></a>');
|
||||
comment.find('.panel-footer > a[onclick="editComment($(this))"]').remove();
|
||||
}
|
||||
else if(retval == 'invalid_request') flash('error', 'Invalid request');
|
||||
@@ -1048,7 +1048,7 @@ function restoreComment(self) {
|
||||
if(retval == 'success') {
|
||||
flash('success', 'Comment restored');
|
||||
comment.removeClass('panel-danger').addClass('panel-default');
|
||||
comment.find('.panel-footer').children('a[onclick]').replaceWith('<a href="#" onclick="deleteComment($(this))"><i style="color:red"; class="fa fa-times" aria-hidden="true"></i></a> <a href="#" onclick="editComment($(this))"><i style="color:cyan;" class="fa fa-pencil-square" aria-hidden="true"></i></a>');
|
||||
comment.find('.panel-footer').children('a[onclick]').replaceWith('<a href="href="#' + id + '"' + 'onclick="deleteComment($(this))"><i style="color:red"; class="fa fa-times" aria-hidden="true"></i></a> <a href="href="#' + id + '"' + 'onclick="editComment($(this))"><i style="color:cyan;" class="fa fa-pencil-square" aria-hidden="true"></i></a>');
|
||||
}
|
||||
else if(retval == 'invalid_request') flash('error', 'Invalid request');
|
||||
else if(retval == 'not_logged_in') flash('error', 'Not logged in');
|
||||
@@ -1074,11 +1074,11 @@ function editComment(self) {
|
||||
body.replaceWith(textarea);
|
||||
textarea.val($('<div>').html(retval.comment).text());
|
||||
self.prev().remove();
|
||||
self.replaceWith('<a href="#" class="saveCommentEdit">[save]</a> <a href="#" class="abortCommentEdit">[abort]</a>');
|
||||
self.replaceWith('<a href="#" class="saveCommentEdit">[save]</a> <a href="#' + id + '"' + 'class="abortCommentEdit">[abort]</a>');
|
||||
comment.find('.abortCommentEdit').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
$(this).prev().remove();
|
||||
$(this).replaceWith('<a class="delete_comment" href="#" onclick="deleteComment($(this))">[del]</a> <a class="edit_comment" href="#" onclick="editComment($(this))">[edit]</a>');
|
||||
$(this).replaceWith('<a class="delete_comment" href="#' + id + '"' + 'onclick="deleteComment($(this))">[del]</a> <a class="edit_comment" href="#' + id + '"' + 'onclick="editComment($(this))">[edit]</a>');
|
||||
textarea.replaceWith(body);
|
||||
});
|
||||
comment.find('.saveCommentEdit').on('click', function(e) {
|
||||
@@ -1313,4 +1313,11 @@ function Copy() {
|
||||
console.log(Url.innerHTML)
|
||||
Url.select();
|
||||
document.execCommand("copy");
|
||||
}
|
||||
}
|
||||
|
||||
// Vielen Dank an Flummi!
|
||||
// This code snippet makes full and valid urls clickable in the info box!
|
||||
|
||||
const infoboxContent = document.querySelector("button#infobox");
|
||||
if(infoboxContent)
|
||||
infoboxContent.dataset.content = infoboxContent.dataset.content.replace(/(https?:\/\/[^\s]+)/g, "<a href='$1' target='_blank' rel='extern'>$1</a>");
|
Reference in New Issue
Block a user