diff --git a/VERSION b/VERSION index d0c56127..820b0a2e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.4.1-alpha.1+timestamp.2012.12.23.23.33.10 +Version 2.4.1-alpha.1+timestamp.2012.12.24.11.20.54 diff --git a/applications/admin/static/js/web2py.js b/applications/admin/static/js/web2py.js index 2f87a801..2c58fbf0 100644 --- a/applications/admin/static/js/web2py.js +++ b/applications/admin/static/js/web2py.js @@ -50,6 +50,13 @@ function web2py_event_handlers() { window.location = redirect; }; }); + doc.ajaxError(function(e, xhr, settings, exception) { + doc.off('click', '.flash') + switch(xhr.status){ + case 500: + $('.flash').html(ajax_error_500).slideDown(); + } + }); }; jQuery(function() { diff --git a/applications/admin/views/web2py_ajax.html b/applications/admin/views/web2py_ajax.html index 4bff2fc5..cf8135ac 100644 --- a/applications/admin/views/web2py_ajax.html +++ b/applications/admin/views/web2py_ajax.html @@ -3,6 +3,7 @@ var w2p_ajax_confirm_message = "{{=T('Are you sure you want to delete this object?')}}"; var w2p_ajax_date_format = "{{=T('%Y-%m-%d')}}"; var w2p_ajax_datetime_format = "{{=T('%Y-%m-%d %H:%M:%S')}}"; + var ajax_error_500 = '{{=XML(T('An error occured, please %s the page') % A(T('reload'), _href=URL(args=request.args, vars=request.vars))) }}' //--> {{ response.files.insert(0,URL('static','js/jquery.js')) diff --git a/applications/examples/static/js/web2py.js b/applications/examples/static/js/web2py.js index 2f87a801..2c58fbf0 100644 --- a/applications/examples/static/js/web2py.js +++ b/applications/examples/static/js/web2py.js @@ -50,6 +50,13 @@ function web2py_event_handlers() { window.location = redirect; }; }); + doc.ajaxError(function(e, xhr, settings, exception) { + doc.off('click', '.flash') + switch(xhr.status){ + case 500: + $('.flash').html(ajax_error_500).slideDown(); + } + }); }; jQuery(function() { diff --git a/applications/examples/views/web2py_ajax.html b/applications/examples/views/web2py_ajax.html index 4bff2fc5..cf8135ac 100644 --- a/applications/examples/views/web2py_ajax.html +++ b/applications/examples/views/web2py_ajax.html @@ -3,6 +3,7 @@ var w2p_ajax_confirm_message = "{{=T('Are you sure you want to delete this object?')}}"; var w2p_ajax_date_format = "{{=T('%Y-%m-%d')}}"; var w2p_ajax_datetime_format = "{{=T('%Y-%m-%d %H:%M:%S')}}"; + var ajax_error_500 = '{{=XML(T('An error occured, please %s the page') % A(T('reload'), _href=URL(args=request.args, vars=request.vars))) }}' //--> {{ response.files.insert(0,URL('static','js/jquery.js')) diff --git a/applications/welcome/static/js/web2py.js b/applications/welcome/static/js/web2py.js index 2f87a801..2c58fbf0 100644 --- a/applications/welcome/static/js/web2py.js +++ b/applications/welcome/static/js/web2py.js @@ -50,6 +50,13 @@ function web2py_event_handlers() { window.location = redirect; }; }); + doc.ajaxError(function(e, xhr, settings, exception) { + doc.off('click', '.flash') + switch(xhr.status){ + case 500: + $('.flash').html(ajax_error_500).slideDown(); + } + }); }; jQuery(function() { diff --git a/applications/welcome/views/web2py_ajax.html b/applications/welcome/views/web2py_ajax.html index 4bff2fc5..cf8135ac 100644 --- a/applications/welcome/views/web2py_ajax.html +++ b/applications/welcome/views/web2py_ajax.html @@ -3,6 +3,7 @@ var w2p_ajax_confirm_message = "{{=T('Are you sure you want to delete this object?')}}"; var w2p_ajax_date_format = "{{=T('%Y-%m-%d')}}"; var w2p_ajax_datetime_format = "{{=T('%Y-%m-%d %H:%M:%S')}}"; + var ajax_error_500 = '{{=XML(T('An error occured, please %s the page') % A(T('reload'), _href=URL(args=request.args, vars=request.vars))) }}' //--> {{ response.files.insert(0,URL('static','js/jquery.js'))