Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How to add Ordered and Unordered list to buttonbar?
Dreyti
New
Hi, all! Need help with button bar! I have added 2 buttons for Ordered and Unordered list in buttonBar. Also write yhis code to buttonbar.js
case 'orderedlist': $(TextArea).surroundSelectedText('[list=1]', '\n[/list]', 'select'); var tagListItem = '\n[*] '; var selection = '\n' + $(TextArea).getSelection().text; selection = selection.replace(/(\r\n|\n|\r)/gm, tagListItem); $(TextArea).replaceSelectedText(selection, 'collapseToEnd'); break; case 'unorderedlist': $(TextArea).surroundSelectedText('[list]', '\n[/list]', 'select'); var tagListItem = '\n[*] '; var selection = '\n' + $(TextArea).getSelection().text; selection = selection.replace(/(\r\n|\n|\r)/gm, tagListItem); $(TextArea).replaceSelectedText(selection, 'collapseToEnd'); break;
But buttons didn't work. Anyone knows how to make them work?
Tagged:
0
Comments
probably depends on your version of vanilla and what type of formatting bbCode, html or Markdown.
you mentioned neither. nor did you mention your version of buttonbar.
maybe this will help.
http://vanillaforums.org/discussion/comment/201922/#Comment_201922
http://vanillaforums.org/discussion/25726/to-add-this-to-you-buttonbar
or you could look at how they do it with the js code on the advanced editor.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.