Add live preview to forum replies
This commit is contained in:
@@ -1,4 +1,23 @@
|
|||||||
{% extends "forum_base.html" %}
|
{% extends "forum_base.html" %}
|
||||||
|
{% block extrahead %}
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function() {
|
||||||
|
var oldText = "";
|
||||||
|
function preview() {
|
||||||
|
if ($('#forum-preview').is(':hidden')) {
|
||||||
|
$('#forum-preview').show("blind");
|
||||||
|
}
|
||||||
|
var newText = $('#id_body').val();
|
||||||
|
if (newText != oldText)
|
||||||
|
$('#forum-preview').load("{% url forums.views.preview %}", {'body': newText});
|
||||||
|
oldText = newText;
|
||||||
|
setTimeout(preview, 500);
|
||||||
|
}
|
||||||
|
preview();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{%block content%}
|
{%block content%}
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<h2>Replying to:</h2>
|
<h2>Replying to:</h2>
|
||||||
@@ -11,6 +30,8 @@
|
|||||||
<input type="submit" value="Submit"/>
|
<input type="submit" value="Submit"/>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="item" id="forum-preview">
|
||||||
|
</div>
|
||||||
{%endblock%}
|
{%endblock%}
|
||||||
|
|
||||||
{%block breadcrumb %}
|
{%block breadcrumb %}
|
||||||
|
Reference in New Issue
Block a user