Revision 4ec753d2
Von Sven Schöling vor fast 10 Jahren hinzugefügt
templates/webpages/layout/javascript_setup.js | ||
---|---|---|
1 | 1 |
[%- USE T8 %] |
2 | 2 |
[%- USE JavaScript %] |
3 |
[%- USE JSON %] |
|
4 |
kivi.myconfig = [% JSON.json(MYCONFIG) %]; |
|
3 | 5 |
$(function() { |
4 |
[% IF datefmt %] |
|
5 |
setupPoints('[% JavaScript.escape(MYCONFIG.numberformat) %]', '[% 'wrongformat' | $T8 %]'); |
|
6 |
setupDateFormat('[% JavaScript.escape(MYCONFIG.dateformat) %]', '[% 'Falsches Datumsformat!' | $T8 %]'); |
|
6 |
setupPoints(kivi.myconfig.numberformat, '[% 'wrongformat' | $T8 %]'); |
|
7 |
setupDateFormat(kivi.myconfig.dateformat, '[% 'Falsches Datumsformat!' | $T8 %]'); |
|
7 | 8 |
|
8 | 9 |
$.datepicker.setDefaults( |
9 |
$.extend({}, $.datepicker.regional['[% JavaScript.escape(MYCONFIG.countrycode) %]'], {
|
|
10 |
dateFormat: '[% JavaScript.escape(datefmt) %]',
|
|
10 |
$.extend({}, $.datepicker.regional[kivi.myconfig.countrycode], {
|
|
11 |
dateFormat: kivi.myconfig.dateformat.replace(/d+/gi, 'dd').replace(/m+/gi, 'mm').replace(/y+/gi, 'yy'),
|
|
11 | 12 |
showOn: "button", |
12 | 13 |
showButtonPanel: true, |
13 | 14 |
changeMonth: true, |
... | ... | |
17 | 18 |
})); |
18 | 19 |
|
19 | 20 |
kivi.setup_formats({ |
20 |
numbers: '[% JavaScript.escape(MYCONFIG.numberformat) %]',
|
|
21 |
dates: '[% JavaScript.escape(MYCONFIG.dateformat) %]'
|
|
21 |
numbers: kivi.myconfig.numberformat,
|
|
22 |
dates: kivi.myconfig.dateformat
|
|
22 | 23 |
}); |
23 | 24 |
|
24 | 25 |
kivi.reinit_widgets(); |
25 |
[% END %] |
|
26 | 26 |
|
27 |
[% IF ajax_spinner %] |
|
27 |
[%- IF ajax_spinner %]
|
|
28 | 28 |
$(document).ajaxSend(function() { |
29 | 29 |
$('#ajax-spinner').show(); |
30 | 30 |
}).ajaxStop(function() { |
Auch abrufbar als: Unified diff
%::myconfig dem Client javascript zur Verfügung stellen.