]> wagnertech.de Git - mfinanz.git/blobdiff - templates/webpages/layout/javascript_setup.js
kivi.js: format/round/parse_amount, format/parse_date
[mfinanz.git] / templates / webpages / layout / javascript_setup.js
index bc4c5ef4e6c6a3dffdf67fed09fd74765f8cac4d..c8c9e81fcd2d35cbd9f8adce3a97e5464c5ca688 100644 (file)
@@ -1,9 +1,9 @@
 [%- USE T8 %]
+[%- USE JavaScript %]
 $(function() {
 [% IF datefmt %]
-  namespace("kivi").initLocale("[% MYCONFIG.countrycode | html %]");
-  setupPoints('[% MYCONFIG.numberformat %]', '[% 'wrongformat' | $T8 %]');
-  setupDateFormat('[% MYCONFIG.dateformat %]', '[% 'Falsches Datumsformat!' | $T8 %]');
+  setupPoints('[% JavaScript.escape(MYCONFIG.numberformat) %]', '[% 'wrongformat' | $T8 %]');
+  setupDateFormat('[% JavaScript.escape(MYCONFIG.dateformat) %]', '[% 'Falsches Datumsformat!' | $T8 %]');
 
   $.datepicker.setDefaults(
     $.extend({}, $.datepicker.regional["[% MYCONFIG.countrycode %]"], {
@@ -16,9 +16,12 @@ $(function() {
       buttonImageOnly: true
   }));
 
-  $('.datepicker').each(function() {
-    $(this).datepicker();
+  kivi.setup_formats({
+    numbers: '[% JavaScript.escape(MYCONFIG.numberformat) %]',
+    dates:   '[% JavaScript.escape(MYCONFIG.dateformat) %]'
   });
+
+  kivi.reinit_widgets();
 [% END %]
 
 [% IF ajax_spinner %]
@@ -30,8 +33,8 @@ $(function() {
 [% END %]
 });
 
-function fokus() {
 [%- IF focus -%]
+function fokus() {
   $('[% focus %]').focus();
-[%- END -%]
 }
+[%- END -%]