$('a.ajax-command').live('click', function(evt) {\r
if (running) return false;\r
\r
$('a.ajax-command').live('click', function(evt) {\r
if (running) return false;\r
\r
- $('.context-menu-dropdown').slideUp('fast');\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
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
} 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
process_ajax_response(data, evt);\r
$dialog.fadeOut('fast', function() {\r
$dialog.remove();\r
var $dialog = show_dialog(doptions);\r
} else {\r
start_command();\r
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
process_ajax_response(data, evt);\r
});\r
}\r
)
old_vote.cancel(ip=request.META['REMOTE_ADDR'])
)
old_vote.cancel(ip=request.META['REMOTE_ADDR'])
- score_inc += (old_vote.__class__ == VoteDownAction) and 1 or -1
-
- if old_vote.__class__ != new_vote_cls:
- new_vote_cls(user=user, node=post, ip=request.META['REMOTE_ADDR']).save()
- score_inc += (new_vote_cls == VoteUpAction) and 1 or -1
- else:
+ score_inc = (old_vote.__class__ == VoteDownAction) and 1 or -1
+ else:
+ new_vote_cls(user=user, node=post, ip=request.META['REMOTE_ADDR']).save()
+ score_inc = (new_vote_cls == VoteUpAction) and 1 or -1
response = {
'commands': {
response = {
'commands': {