From: Janusz Dobrowolski Date: Fri, 18 Jul 2008 22:54:55 +0000 (+0000) Subject: Optional processing progressbar for submit buttons X-Git-Tag: v2.4.2~19^2~1904 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=5ceece3a1a031ad1dbfbcb11d3aabfca97a56f6b;p=fa-stable.git Optional processing progressbar for submit buttons --- diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc index b775ede0..65ac068f 100644 --- a/includes/ui/ui_input.inc +++ b/includes/ui/ui_input.inc @@ -95,9 +95,10 @@ function hidden($name, $value=null, $echo=true) //--------------------------------------------------------------------------------- // Submit button. // $async parameter can have 3 values: +// null - fallback button not visible in js enabled mode // false - normal submit via form action // true - when js is on submition via ajax call -// null - fallback button not visible in js enabled mode +// 'process' - ditto with processing indicator in msgbox // function submit($name, $value, $echo=true, $title=false, $async=false) { @@ -106,7 +107,8 @@ function submit($name, $value, $echo=true, $title=false, $async=false) $submit_str = "\n"; diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index c654fafb..67d95b97 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -6,10 +6,10 @@ include_once($path_to_root . "/includes/types.inc"); include_once($path_to_root . "/includes/current_user.inc"); $_search_button = " "; + ."%s/images/locate.png) no-repeat;%s' aspect='fallback' name='%s' value=' ' title='"._("Set filter")."'> "; $_select_button = " "; + ."%s/images/button_ok.png) no-repeat;%s' aspect='fallback' name='%s' value=' ' title='"._("Select")."'> "; $all_items = reserved_words::get_all(); diff --git a/js/inserts.js b/js/inserts.js index 244792bc..ec1626a0 100644 --- a/js/inserts.js +++ b/js/inserts.js @@ -5,10 +5,13 @@ function debug(msg) { box.innerHTML= box.innerHTML+'
'+msg } -function progbar(container) { - container.innerHTML= "
"+ - user.loadtxt+"
"; +function progbar() { + box = document.getElementById('msgbox'); + box.innerHTML= "
" + +"
" + +""
+		+user.loadtxt+"

"; } function save_focus(e) { @@ -153,7 +156,7 @@ var inserts = { _set_combo_input(e); } }, - 'input.combo2,input[fallback]': + 'input.combo2,input[aspect="fallback"]': function(e) { // this hides search button for js enabled browsers e.style.display = 'none'; @@ -161,6 +164,8 @@ var inserts = { 'input.ajaxsubmit,input.editbutton,input.navibutton': function(e) { e.onclick = function() { + if (this.getAttribute('aspect') == 'process') + progbar(); JsHttpRequest.request(this); return false; }