X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=scripts%2Fgenerate_client_js_actions.tpl;h=9e2180289895405366ebe851edf7f91ba71471da;hb=0a7e56be034b56cef57ebd21cb90ac4946435562;hp=46032667f17927cf0ae16f09a3e24ae0ab8c8bd1;hpb=f509d946cb89ef9870c6d89627ec56ad9fa4c480;p=kivitendo-erp.git diff --git a/scripts/generate_client_js_actions.tpl b/scripts/generate_client_js_actions.tpl index 46032667f..9e2180289 100644 --- a/scripts/generate_client_js_actions.tpl +++ b/scripts/generate_client_js_actions.tpl @@ -4,17 +4,18 @@ // "scripts/generate_client_js_actions.pl". See the documentation for // SL/ClientJS.pm for instructions. -function display_flash(type, message) { +namespace("kivi", function(ns) { +ns.display_flash = function(type, message) { $('#flash_' + type + '_content').text(message); $('#flash_' + type).show(); -} +}; -function eval_json_result(data) { +ns.eval_json_result = function(data) { if (!data) return; if (data.error) - return display_flash('error', data.error); + return ns.display_flash('error', data.error); $(['info', 'warning', 'error']).each(function(idx, category) { $('#flash_' + category).hide(); @@ -32,13 +33,9 @@ function eval_json_result(data) { }); // console.log("current_content_type " + $('#current_content_type').val() + ' ID ' + $('#current_content_id').val()); -} +}; -function submit_ajax_form(url, form_selector, additional_data) { - var separator = /\?/.test(url) ? '&' : '?'; - $.post(url + separator + $(form_selector).serialize(), additional_data, eval_json_result); - return true; -} +}); // Local Variables: // mode: js