$(document).ready(function(){
var filecount = 0;
function updatePreview(data, type) {
$("#preview-contents").html(data);
}
function reloadPreview() {
var src = $('#src').val();
var title = $('#title').val()
$("#preview-contents").contents().find("html").load("/preview", $("#edit-form").serializeArray());
}
function appendFileForm() {
filecount += 1;
$(":file:last").after("
")
}
$('#show-preview').click(function(){ reloadPreview(); });
$('#append-file').click(function() { appendFileForm(); });
});