From ee102fbfe8a432e8220c818dd08be3922ad4a913 Mon Sep 17 00:00:00 2001 From: szimszon Date: Mon, 5 Aug 2013 13:14:52 +0200 Subject: [PATCH 1/2] disable_with message should be translatable --- applications/welcome/static/js/web2py.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/applications/welcome/static/js/web2py.js b/applications/welcome/static/js/web2py.js index 507be9f5..d96e685d 100644 --- a/applications/welcome/static/js/web2py.js +++ b/applications/welcome/static/js/web2py.js @@ -211,12 +211,13 @@ }, trap_form: function (action, target) { + var disable_with_message = (typeof w2p_ajax_disable_with_message != 'undefined') ? w2p_ajax_disable_with_message : "Working..."; $('#' + target + ' form').each(function (i) { var form = $(this); form.attr('data-w2p_target', target); if(!form.hasClass('no_trap')) { //should be there by default ? - form.find('input[type=submit]').attr('data-w2p_disable_with', 'Working...'); + form.find('input[type=submit]').attr('data-w2p_disable_with', disable_with_message); form.submit(function (e) { web2py.hide_flash(); web2py.ajax_page('post', action, form.serialize(), target, form); @@ -431,11 +432,12 @@ disableElement: function (el) { el.addClass('disabled'); var method = el.prop('type') == 'submit' ? 'val' : 'html'; + var disable_with_message = (typeof w2p_ajax_disable_with_message != 'undefined') ? w2p_ajax_disable_with_message : "Working..."; // store enabled state el.data('w2p:enable-with', el[method]()); /* little addition by default*/ if((el.data('w2p_disable_with') == 'default') || (el.data('w2p_disable_with') === undefined)) { - el.data('w2p_disable_with', 'Working...'); + el.data('w2p_disable_with', disable_with_message); } // set to disabled state el[method](el.data('w2p_disable_with')); From 58d832889994a11f0794eabcad47b92d5d26e4d7 Mon Sep 17 00:00:00 2001 From: szimszon Date: Mon, 5 Aug 2013 13:16:29 +0200 Subject: [PATCH 2/2] disable_with message should be translatable --- applications/welcome/views/web2py_ajax.html | 1 + 1 file changed, 1 insertion(+) diff --git a/applications/welcome/views/web2py_ajax.html b/applications/welcome/views/web2py_ajax.html index 52709edc..5d7195b0 100644 --- a/applications/welcome/views/web2py_ajax.html +++ b/applications/welcome/views/web2py_ajax.html @@ -1,6 +1,7 @@