]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/media/js/osqa.main.js
OSQA-538, fixing the IE caching issues, now we append the Nocache random number to...
[osqa.git] / forum / skins / default / media / js / osqa.main.js
index d95e4e0523a1f8005f34a1b78029652dcf1a0b48..2de5ecf56dc70bc74b66babf28e0618f96b91b56 100644 (file)
@@ -100,12 +100,12 @@ var response_commands = {
     },\r
 \r
     mark_deleted: function(post_type, post_id) {\r
-        if (post_type == 'answer') {\r
-            var $answer = $('#answer-container-' + post_id);\r
-            $answer.addClass('deleted');\r
-        } else {\r
+        if (post_type == 'question') {\r
             var $container = $('#question-table');\r
             $container.addClass('deleted');\r
+        } else {\r
+            var $el = $('#' + post_type + '-container-' + post_id);\r
+            $el.addClass('deleted');\r
         }\r
     },\r
 \r
@@ -125,6 +125,10 @@ var response_commands = {
 \r
     set_subscription_status: function(text) {\r
         $('.subscription-status').html(text);\r
+    },\r
+\r
+    copy_url: function(url) {\r
+        $.copy(url);\r
     }\r
 }\r
 \r
@@ -324,19 +328,22 @@ $(function() {
     $('a.ajax-command').live('click', function(evt) {\r
         if (running) return false;\r
 \r
-        $('.context-menu-dropdown').slideUp('fast');\r
-\r
         var el = $(this);\r
 \r
+        var ajax_url = el.attr('href')\r
+        ajax_url = ajax_url + "?nocache=" + new Date().getTime()\r
+\r
+        $('.context-menu-dropdown').slideUp('fast');\r
+\r
         if (el.is('.withprompt')) {\r
-            load_prompt(evt, el, el.attr('href'));\r
+            load_prompt(evt, el, ajax_url);\r
         } else if(el.is('.confirm')) {\r
             var doptions = {\r
                 html: messages.confirm,\r
                 extra_class: 'confirm',\r
                 yes_callback: function() {\r
                     start_command();\r
-                    $.getJSON(el.attr('href'), function(data) {\r
+                    $.getJSON(ajax_url, function(data) {\r
                         process_ajax_response(data, evt);\r
                         $dialog.fadeOut('fast', function() {\r
                             $dialog.remove();\r
@@ -354,7 +361,7 @@ $(function() {
             var $dialog = show_dialog(doptions);\r
         } else {\r
             start_command();\r
-            $.getJSON(el.attr('href'), function(data) {\r
+            $.getJSON(ajax_url, function(data) {\r
                 process_ajax_response(data, evt);\r
             });\r
         }\r
@@ -563,8 +570,8 @@ $(function() {
         var $previewer = $('#previewer');\r
         var $container = $('#editor-metrics');\r
 \r
-        var initial_whitespace_rExp = /^[^A-Za-z0-9]+/gi;\r
-        var non_alphanumerics_rExp = rExp = /[^A-Za-z0-9]+/gi;\r
+        var initial_whitespace_rExp = /^[^A-Za-zА-Яа-я0-9]+/gi;\r
+        var non_alphanumerics_rExp = rExp = /[^A-Za-zА-Яа-я0-9]+/gi;\r
         var editor_interval = null;\r
 \r
         $editor.focus(function() {\r