Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
773 views
in Plugins by
The markdown editor and the WYSIWYG editor are too 'heavy' for comments. What I'd like is one similar to the markdown editor but with only italics and links. Is that possible?
Q2A version: 1.6.1

2 Answers

0 votes
by
You might want to write your own editor.

1. Use the default textarea, add a bar on top with two buttons bold italic.

2. Use jquery to capture the click event and add <b> tag or <i> tag

3. n°2 can be a bit tricky, you have to check if a word is marked, or if not, then enter <b>CURSOR</b>

4. When sending the post to the server, you need to make sure that it gets saved in format HTML.

 

Note: This solution assumes that the user knows the b and i tag and is not confused if they appear in the editor...

Good luck
Kai

 

PS: It seems - as this is the second editor post I face today - that I should really finish the light weiht SCEditor implementation I started last year... (memo)
0 votes
by

Good question. If you are using CKEditor4, you may cope by remodeling this plugin. The remodeling content is as follows. This answer is technical content.

  1. Add button patern option for comments in admin panel of CKEditor4
  2. Judge $fieldname in load_script() of qa-ckeditor4.php
  3. if $fieldname == 'c99_content' >> return added button pattern (qa_ckeditor4_config_comment ?)
  4. else >> standard button pattern (qa_ckeditor4_config)

In addition, we may apply button pattern for mobile by judging user agent or window size. 

...