\r
if (el.is('.withprompt')) {\r
load_prompt(evt, el.attr('href'));\r
+ } else if(el.is('.confirm')) {\r
+ $dialog = show_dialog({\r
+ html: messages.confirm,\r
+ extra_class: 'confirm',\r
+ event: evt,\r
+ yes_callback: function() {\r
+ start_command();\r
+ $.getJSON(el.attr('href'), function(data) {\r
+ process_ajax_response(data, evt);\r
+ $dialog.fadeOut('fast', function() {\r
+ $dialog.remove();\r
+ });\r
+ });\r
+ },\r
+ yes_text: messages.yes,\r
+ show_no: true,\r
+ no_text: messages.no\r
+ });\r
} else {\r
start_command();\r
$.getJSON(el.attr('href'), function(data) {\r
cleanup_form();\r
\r
function process_form_changes() {\r
- var length = $textarea.val().length;\r
+ var length = $textarea.val().replace(/[ ]{2,}/g," ").length;\r
\r
if (current_length == length)\r
return;\r
$chars_togo_message.show();\r
$chars_counter.html(min_length - length);\r
} else {\r
+ length = $textarea.val().length;\r
$chars_togo_message.hide();\r
$chars_left_message.show();\r
$chars_counter.html(max_length - length);\r