return false;\r
});\r
\r
- $cancel.click(function() {\r
- if (comment_in_form) {\r
- $comment = $('#comment-' + comment_in_form).slideDown('slow');\r
+ $cancel.click(function(event) {\r
+ if (confirm("You will lose all of your changes in this comment. Do you still wish to proceed?")){\r
+ if (comment_in_form) {\r
+ $comment = $('#comment-' + comment_in_form).slideDown('slow');\r
+ }\r
+ hide_comment_form();\r
+ cleanup_form();\r
}\r
- hide_comment_form();\r
return false;\r
});\r
}\r
});\r
});\r
\r
+function yourWorkWillBeLost(e) {\r
+ if(!e) e = window.event;\r
+ e.cancelBubble = true;\r
+ e.returnValue = 'You sure you want to leave? Your work will be lost.';\r
+\r
+ if (e.stopPropagation) {\r
+ e.stopPropagation();\r
+ e.preventDefault();\r
+ }\r
+ return e;\r
+}
\ No newline at end of file