]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/media/js/osqa.main.js
Improving the canned comments feature, now we can use Django style template syntax...
[osqa.git] / forum / skins / default / media / js / osqa.main.js
index 8a3dbf9a44b227e90cd333e4404fd95a0ded063b..0c532e37adbfc7da84bd61d7c26c9066311e55ad 100644 (file)
@@ -2,6 +2,7 @@
  * We do not want the CSRF protection enabled for the AJAX post requests, it causes only trouble.\r
  * Get the csrftoken cookie and pass it to the X-CSRFToken HTTP request property.\r
  */\r
+\r
 $('html').ajaxSend(function(event, xhr, settings) {\r
     function getCookie(name) {\r
         var cookieValue = null;\r
@@ -24,6 +25,10 @@ $('html').ajaxSend(function(event, xhr, settings) {
     }\r
 });\r
 \r
+function canned_comment(post_id, comment) {\r
+    $('#comment-' + post_id + '-form textarea').val(comment);\r
+}\r
+\r
 var response_commands = {\r
     refresh_page: function() {\r
         window.location.reload(true)\r
@@ -123,10 +128,6 @@ var response_commands = {
         $('#comment-' + comment_id).slideDown('slow');\r
     },\r
 \r
-    canned_comment: function(post_id, comment) {\r
-        $('#comment-' + post_id + '-form textarea').val(comment);\r
-    },\r
-\r
     update_comment: function(comment_id, comment_text) {\r
         var $comment = $('#comment-' + comment_id);\r
         $comment.find('.comment-text').html(comment_text);\r
@@ -732,7 +733,7 @@ function pickedTags(){
                 tag_link.attr('rel','tag');\r
                 tag_link.attr('href', scriptUrl + $.i18n._('tags/') + tagname + '/');\r
                 tag_link.html(tagname);\r
-                var del_link = $('<img></img>');\r
+                var del_link = $('<img />');\r
                 del_link.addClass('delete-icon');\r
                 del_link.attr('src', mediaUrl('media/images/close-small-dark.png'));\r
 \r