]> git.0d.be Git - chloro.git/blobdiff - chloro/phyll/static/js/chloro.js
enable csrf for live-edit post
[chloro.git] / chloro / phyll / static / js / chloro.js
index 066c5738401f5a304603f51b706bb178ab080046..78930c3719df687e0fbed76eefe7636596f8a583 100644 (file)
@@ -20,7 +20,10 @@ $(function() {
 
   $('#save').on('click', function() {
     var text = $('div[contenteditable]')[0].innerHTML;
-    $.post('api-save/', {text: text}).fail(function() {
+    var csrf = $('[name=csrfmiddlewaretoken]').val();
+    $.post('api-save/',
+      { text: text, csrfmiddlewaretoken: csrf}
+    ).fail(function() {
       $('#save').css('background', 'red');
     });
     return false;