+ $dialog.find('.dialog-yes').click(function() {\r
+ options.yes_callback($dialog);\r
+ });\r
+\r
+ if (options.close_on_clickoutside) {\r
+ $dialog.one('clickoutside', function() {\r
+ default_close_function($dialog);\r
+ });\r
+ }\r
+\r
+ return $dialog;\r
+}\r
+\r
+function show_message(evt, msg, callback) {\r
+ var $dialog = show_dialog({\r
+ html: msg,\r
+ extra_class: 'warning',\r
+ event: evt,\r
+ yes_callback: function() {\r
+ $dialog.fadeOut('fast', function() {\r
+ $dialog.remove();\r
+ });\r
+ if (callback) {\r
+ callback();\r
+ }\r
+ },\r
+ close_on_clickoutside: true\r
+ });\r
+}\r
+\r
+function load_prompt(evt, url) {\r
+ $.get(url, function(data) {\r
+ var $dialog = show_dialog({\r
+ html: data,\r
+ extra_class: 'prompt',\r
+ event: evt,\r
+ yes_callback: function() {\r
+ var postvars = {};\r
+ $dialog.find('input, textarea, select').each(function() {\r
+ postvars[$(this).attr('name')] = $(this).val();\r
+ });\r
+ $.post(url, postvars, function(data) {\r
+ $dialog.fadeOut('fast', function() {\r
+ $dialog.remove();\r
+ });\r
+ process_ajax_response(data, evt);\r
+ }, 'json');\r
+ },\r
+ show_no: true\r
+ });\r
+ });\r