First time here? Check out the FAQ!
1

how works the new_answer_form editor?
 

Hello,

I need create a new editor no create a new type of post. Then I need have the new answer form and new other type of post form.

How I can do this?

I create a new form copying the new_answer_form and changing the id of the form, but I can not see the editor and preview is not working.

I really need help with this.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
darkness51's avatar
31
darkness51
asked 12 years ago

Comments

see more comments

1 Answer

0

The previewer and the editor code is tied with the form, so if you are removing the form, the editor won't work.

There are two options: (1) - remove the editor, previewer and the form and replace them with your own, (2) keep everything and add your own fields to the form, and handle those extras with your own code.

You could modify appearance of the editor and the previewer by adjusting css.

The editor uses javascript from files

/js/editor.js #extra components used for the editor - text area resizer, file upload handler
/js/wmd/showdown.js #converts markdown to html for the previewer
/js/wmd/wmd.js #adds buttons and their functions to the editor.

which are inside directory askbot/skins/common/media

Also file askbot/skins/default/templates/meta/editor_data.html is used.

And that is in addition to the fact that the input source text is converted to html on with a python library called markdown2, showdown.js is used only for the previewer.

Not very simple and could be better. Possibly you will be better off with replacing that code with yours. Askbot would benefit from allowing to easily switch the editor.

I hope this helps.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 12 years ago, updated 12 years ago
link

Comments

I know markdown. I work with zinnia. I think that wmd use some time of instantiation using some id like tinymce.

darkness51's avatar darkness51 (12 years ago)
see more comments