X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/a6b4b406f0a9db0a1c719f4b7d5eb8265f90bf61..3bb283ad739b95704f8df9a55c1ed0b86f617f23:/js/kivi.js diff --git a/js/kivi.js b/js/kivi.js index 77c78a2cc..ea892f521 100644 --- a/js/kivi.js +++ b/js/kivi.js @@ -1,25 +1,8 @@ namespace("kivi", function(ns) { - - ns._localeLang = false; - ns._locales = {}; + ns._locale = {}; ns.t8 = function(text, params) { - if( ns._localeLang ) { - if( !ns._locales[ns._localeLang] ) { - ns._locales[ns._localeLang] = {}; - - jQuery.ajax({ - url: "js/locale/"+ ns._localeLang +".js", - async: false, - dataType: "json", - success: function(res) { - ns._locales[ns._localeLang] = res; - }, - }); - } - - text = ns._locales[ns._localeLang][text] || text; - } + var text = ns._locale[text] || text; if( Object.prototype.toString.call( params ) === '[object Array]' ) { var len = params.length; @@ -40,8 +23,20 @@ namespace("kivi", function(ns) { return text; }; - ns.initLocale = function(localeLang) { - ns._localeLang = localeLang; + ns.setupLocale = function(locale) { + ns._locale = locale; }; + ns.reinit_widgets = function() { + $('.datepicker').each(function() { + $(this).datepicker(); + }); + + if (ns.PartPicker) + $('input.part_autocomplete').each(function(idx, elt){ + kivi.PartPicker($(elt)); + }); + }; }); + +kivi = namespace('kivi');