mirror of
https://github.com/friendica/friendica
synced 2025-04-24 21:50:10 +00:00
Make formatbar work
This commit is contained in:
parent
f590d31b4b
commit
9bc6238b59
2 changed files with 20 additions and 5 deletions
|
@ -27,6 +27,22 @@ function insertFormatting(BBcode, id) {
|
|||
return true;
|
||||
}
|
||||
|
||||
function insertFormattingToPost(BBcode) {
|
||||
textarea = document.getElementById("#profile-jot-text");
|
||||
if (document.selection) {
|
||||
textarea.focus();
|
||||
selected = document.selection.createRange();
|
||||
selected.text = "[" + BBcode + "]" + selected.text + "[/" + BBcode + "]";
|
||||
} else if (textarea.selectionStart || textarea.selectionStart == "0") {
|
||||
var start = textarea.selectionStart;
|
||||
var end = textarea.selectionEnd;
|
||||
textarea.value = textarea.value.substring(0, start) + "[" + BBcode + "]" + textarea.value.substring(start, end) + "[/" + BBcode + "]" + textarea.value.substring(end, textarea.value.length);
|
||||
}
|
||||
|
||||
$(textarea).trigger('change');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function showThread(id) {
|
||||
$("#collapsed-comments-" + id).show()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue