Ask Your Question
1

how works the new_answer_form editor?

asked 2012-05-20 22:13:19 -0500

darkness51 gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-05-20 22:24:35 -0500

Evgeny gravatar image

updated 2012-05-20 22:43:59 -0500

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.

edit flag offensive delete link more

Comments

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

darkness51 gravatar imagedarkness51 ( 2012-05-20 22:41:15 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-05-20 22:13:19 -0500

Seen: 122 times

Last updated: May 20 '12