projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CustomerVendor: vergessenes run_before ergänzt
[kivitendo-erp.git]
/
scripts
/
generate_client_js_actions.tpl
diff --git
a/scripts/generate_client_js_actions.tpl
b/scripts/generate_client_js_actions.tpl
index
55206ea
..
6772cd1
100644
(file)
--- a/
scripts/generate_client_js_actions.tpl
+++ b/
scripts/generate_client_js_actions.tpl
@@
-4,20
+4,23
@@
// "scripts/generate_client_js_actions.pl". See the documentation for
// SL/ClientJS.pm for instructions.
// "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();
$('#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)
if (!data)
return;
if (data.error)
- return display_flash('error', data.error);
+ return
ns.
display_flash('error', data.error);
- $('#flash_error').hide();
- $('#flash_error_content').empty();
+ $(['info', 'warning', 'error']).each(function(idx, category) {
+ $('#flash_' + category).hide();
+ $('#flash_' + category + '_content').empty();
+ });
if ((data.js || '') != '')
eval(data.js);
if ((data.js || '') != '')
eval(data.js);
@@
-30,13
+33,15
@@
function eval_json_result(data) {
});
// console.log("current_content_type " + $('#current_content_type').val() + ' ID ' + $('#current_content_id').val());
});
// console.log("current_content_type " + $('#current_content_type').val() + ' ID ' + $('#current_content_id').val());
-}
+}
;
-
function submit_ajax_form
(url, form_selector, additional_data) {
+
ns.submit_ajax_form = function
(url, form_selector, additional_data) {
var separator = /\?/.test(url) ? '&' : '?';
var separator = /\?/.test(url) ? '&' : '?';
- $.post(url + separator + $(form_selector).serialize(), additional_data, eval_json_result);
+ $.post(url + separator + $(form_selector).serialize(), additional_data,
ns.
eval_json_result);
return true;
return true;
-}
+};
+
+});
// Local Variables:
// mode: js
// Local Variables:
// mode: js