]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/media/js/osqa.main.js
ALteration of the schema to a single content model. As a bonus there is a complete...
[osqa.git] / forum / skins / default / media / js / osqa.main.js
index a3ea374a58cf9e5245fcb60c0c508287aa6f2ec1..d929a16fb5a4c515f7771c73f37aea5c9c5922d9 100644 (file)
@@ -1,12 +1,12 @@
 var response_commands = {\r
 var response_commands = {\r
-    update_post_score: function(type, id, inc) {\r
-        var $score_board = $('#' + type + '-' + id + '-score');\r
+    update_post_score: function(id, inc) {\r
+        var $score_board = $('#post-' + id + '-score');\r
         $score_board.html(parseInt($score_board.html()) + inc)\r
     },\r
 \r
         $score_board.html(parseInt($score_board.html()) + inc)\r
     },\r
 \r
-    update_user_post_vote: function(type, id, vote_type) {\r
-        var $upvote_button = $('#' + type + '-' + id + '-upvote');\r
-        var $downvote_button = $('#' + type + '-' + id + '-downvote');\r
+    update_user_post_vote: function(id, vote_type) {\r
+        var $upvote_button = $('#post-' + id + '-upvote');\r
+        var $downvote_button = $('#post-' + id + '-downvote');\r
 \r
         $upvote_button.removeClass('on');\r
         $downvote_button.removeClass('on');\r
 \r
         $upvote_button.removeClass('on');\r
         $downvote_button.removeClass('on');\r
@@ -89,9 +89,9 @@ var response_commands = {
         });\r
     },\r
 \r
         });\r
     },\r
 \r
-    insert_comment: function(post_type, post_id, comment_id, comment, username, profile_url, delete_url) {\r
-        var $container = $('#comments-container-' + post_type + '-' + post_id);\r
-        var skeleton = $('#new-comment-skeleton-' + post_type + '-' + post_id).html().toString();\r
+    insert_comment: function(post_id, comment_id, comment, username, profile_url, delete_url) {\r
+        var $container = $('#comments-container-' + post_id);\r
+        var skeleton = $('#new-comment-skeleton-' + post_id).html().toString();\r
 \r
         skeleton = skeleton.replace(new RegExp('%ID%', 'g'), comment_id)\r
                 .replace(new RegExp('%COMMENT%', 'g'), comment)\r
 \r
         skeleton = skeleton.replace(new RegExp('%ID%', 'g'), comment_id)\r
                 .replace(new RegExp('%COMMENT%', 'g'), comment)\r