mirror of
https://github.com/friendica/friendica
synced 2025-04-19 05:50:10 +00:00
Update insertFormatting() definition
- Remove now useless comment parameter - Formatting all around - Update data-role=“insert-formatting” links - Update onclick=“insertFormatting()” links
This commit is contained in:
parent
b50f1f970f
commit
d7c9b293d3
19 changed files with 222 additions and 216 deletions
|
@ -72,21 +72,19 @@
|
|||
/* setup comment textarea buttons */
|
||||
/* comment textarea buttons needs some "data-*" attributes to work:
|
||||
* data-role="insert-formatting" : to mark the element as a formatting button
|
||||
* data-comment="<string>" : string for "Comment", used by insertFormatting() function
|
||||
* data-bbcode="<string>" : name of the bbcode element to insert. insertFormatting() will insert it as "[name][/name]"
|
||||
* data-id="<string>" : id of the comment, used to find other comment-related element, like the textarea
|
||||
* */
|
||||
$('body').on('click','[data-role="insert-formatting"]', function(e) {
|
||||
e.preventDefault();
|
||||
var o = $(this);
|
||||
var comment = o.data('comment');
|
||||
var bbcode = o.data('bbcode');
|
||||
var id = o.data('id');
|
||||
if (bbcode=="img") {
|
||||
Dialog.doImageBrowser("comment", id);
|
||||
return;
|
||||
}
|
||||
insertFormatting(comment, bbcode, id);
|
||||
insertFormatting(bbcode, id);
|
||||
});
|
||||
|
||||
/* event from comment textarea button popups */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue