{% extends "base.html" %} {% block title -%} Wiki Editor {%- endblock title %} {% block content %}
This editor is markdown featured.
* I
* am
* a
* list
Turns into:
**bold** and *italics*
turn into bold and italics. Very easy!
Create links with [NoTube](http://www.notube.com)
. They turn into NoTube.
Headers are as follows:
# Level 1
## Level 2
### Level 3
{% endblock sidebar %}
{% block postscripts -%}
{{ super() }}
$('#previewlink').on('click', function() {
var $form = $('.form');
var $inputs = $form.find('input, textarea, button');
var $pre = $('#preview');
var bodycontent = 'title: preview\n\n' + $form.find('textarea').val();
$inputs.prop('disabled', true);
$pre.removeClass('alert').removeClass('alert-error').html("Loading...");
$.ajax({
url: "{{ url_for('wiki.preview') }}",
type: "POST",
data: { body: bodycontent },
success: function(msg) {
$pre.html(msg);
console.log(msg);
},
error: function() {
$pre.addClass('alert').addClass('alert-error');
$pre.html('There was a problem with the preview.');
},
complete: function() {
$inputs.prop('disabled', false);
}
});
});
$('#previewbtn').on('click', function(event) {
event.preventDefault();
$('#previewlink').click();
});
{%- endblock postscripts %}