3
<form class="post-form" action="{{ form_url }}" method="post" enctype="multipart/form-data">
4
<div class="preview-box" style="display: none">
5
<div class="header">{% trans "Preview" %}</div>
6
<div class="content"></div>
9
<legend>{% if forum %}{% trans "New topic" %}{% else %}{% trans "New reply" %}{% endif %}</legend>
12
<input type="submit" value="{% trans "Submit" %}" />
13
<input class="preview-button" type="button" value="{% trans "Preview" %}" />
18
<script type="text/javascript">
20
$('.post-form .preview-button').click(function() {
21
var raw_content = $.trim($('.post-form #id_body').val());
22
var markup = $('.post-form #id_markup').val();
24
args = {'content': raw_content, 'markup': markup}
25
$.post('{% url pybb_post_ajax_preview %}', args, function(data) {
29
$('.preview-box .content').html(data.content);
30
$('.preview-box').show();