mobile: separate javascript_setup Datei damit Validate korrekt funktioniert
authorSven Schöling <s.schoeling@googlemail.com>
Fri, 19 Mar 2021 15:11:59 +0000 (16:11 +0100)
committerSven Schöling <s.schoeling@googlemail.com>
Fri, 25 Jun 2021 13:51:32 +0000 (15:51 +0200)
templates/mobile_webpages/layout/javascript_setup.js [new file with mode: 0644]

diff --git a/templates/mobile_webpages/layout/javascript_setup.js b/templates/mobile_webpages/layout/javascript_setup.js
new file mode 100644 (file)
index 0000000..2b03f4a
--- /dev/null
@@ -0,0 +1,38 @@
+[%- USE LxERP %]
+[%- USE JavaScript %]
+[%- USE JSON %]
+kivi.myconfig = [% JSON.json(MYCONFIG) %];
+$(function() {
+  $.datepicker.setDefaults(
+    $.extend({}, $.datepicker.regional[kivi.myconfig.countrycode], {
+      dateFormat: kivi.myconfig.dateformat.replace(/d+/gi, 'dd').replace(/m+/gi, 'mm').replace(/y+/gi, 'yy'),
+      showOn: "button",
+      showButtonPanel: true,
+      changeMonth: true,
+      changeYear: true,
+      buttonImage: "image/calendar.png",
+      buttonImageOnly: true
+  }));
+
+  kivi.setup_formats({
+    numbers: kivi.myconfig.numberformat,
+    dates:   kivi.myconfig.dateformat,
+    times:   kivi.myconfig.timeformat
+  });
+
+  kivi.reinit_widgets();
+
+[%- IF ajax_spinner %]
+  $(document).ajaxSend(function() {
+    $('#ajax-spinner').show();
+  }).ajaxStop(function() {
+    $('#ajax-spinner').hide();
+  });
+[% END %]
+});
+
+[%- IF focus -%]
+function fokus() {
+  $('[% focus %]').focus();
+}
+[%- END -%]