X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/33a45e0e838cdc9cc1af614e5e98b0ddfa64faec..aae306cda6274d:/js/kivi.js diff --git a/js/kivi.js b/js/kivi.js index 6fad299b5..27077575d 100644 --- a/js/kivi.js +++ b/js/kivi.js @@ -288,6 +288,31 @@ namespace("kivi", function(ns) { return true; }; + // This function submits an existing form given by "form_selector" + // and sets the "action" input to "action_to_call" before submitting + // it. Any existing input named "action" will be removed prior to + // submitting. + ns.submit_form_with_action = function(form_selector, action_to_call) { + $('[name=action]').remove(); + + var $form = $(form_selector); + var $hidden = $(''); + + $hidden.attr('name', 'action'); + $hidden.attr('value', action_to_call); + $form.append($hidden); + + $form.submit(); + }; + + // This function exists solely so that it can be found with + // kivi.get_functions_by_name() and called later on. Using something + // like "var func = history["back"]" works, but calling it later + // with "func.apply()" doesn't. + ns.history_back = function() { + history.back(); + }; + // Return a function object by its name (a string). Works both with // global functions (e.g. "check_right_date_format") and those in // namespaces (e.g. "kivi.t8").