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.

darkness51's avatar
31
darkness51
asked 2012-05-20 22:13:19 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment 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.

Evgeny's avatar
13.2k
Evgeny
answered 2012-05-20 22:24:35 -0600, updated 2012-05-20 22:43:59 -0600
edit flag offensive 0 remove flag delete 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 (2012-05-20 22:41:15 -0600) edit
add a comment see more comments