]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/media/js/osqa.main.js
OSQA-720, changing the WMD markdown editor, applying patches that resolve issues...
[osqa.git] / forum / skins / default / media / js / osqa.main.js
index 7d6294f69c91c90b5ec12b8e4af5f77287bc6266..8f785e30a294593747f900bbf79de0c3c5736413 100644 (file)
@@ -19,10 +19,12 @@ $('html').ajaxSend(function(event, xhr, settings) {
         }\r
         return cookieValue;\r
     }\r
-    if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) {\r
-        // Only send the token to relative URLs i.e. locally.\r
-        xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));\r
-    }\r
+    try {\r
+        if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) {\r
+            // Only send the token to relative URLs i.e. locally.\r
+            xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));\r
+        }\r
+    } catch (e) {}\r
 });\r
 \r
 var response_commands = {\r
@@ -375,7 +377,7 @@ function canned_comment(post_id, comment) {
     // Get the text from the caret to the end\r
     textarea_end = textarea.val().substr(comment_box_cursor_position, textarea.val().length)\r
 \r
-    textarea.val(textarea_start + comment + textarea_endsvn );\r
+    textarea.val(textarea_start + comment + textarea_end);\r
 }\r
 \r
 $(function() {\r
@@ -594,7 +596,7 @@ $(function() {
                 }\r
 \r
                 start_command();\r
-                $.post($form.attr('action'), $form.serialize(), function(data) {\r
+                $.post($form.attr('action'), post_data, function(data) {\r
                     process_ajax_response(data, evt, function(error) {\r
                         if (!error) {\r
                             cleanup_form();\r