diff options
Diffstat (limited to 'static/js/kosten.js')
-rw-r--r-- | static/js/kosten.js | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/static/js/kosten.js b/static/js/kosten.js index 72517d9..f4f2730 100644 --- a/static/js/kosten.js +++ b/static/js/kosten.js @@ -1,6 +1,6 @@ // Generated by LiveScript 1.2.0 (function(){ - var jq, addJS, showJS, catsJS, out$ = typeof exports != 'undefined' && exports || this; + var jq, set_lang, addJS, showJS, statJS, catsJS, out$ = typeof exports != 'undefined' && exports || this; jQuery.fn.extend({ copy: function(){ return this.clone().removeAttr('id class'); @@ -11,6 +11,18 @@ $(f); }; }; + set_lang = function(){ + return Highcharts.setOptions({ + lang: { + months: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], + shortMonths: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], + weekdays: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'], + rangeSelectorFrom: 'von', + rangeSelectorTo: 'bis', + rangeSelectorZoom: null + } + }); + }; out$.addJS = addJS = jq(function(){ return $('input[name=date]').datepicker({ dateFormat: 'dd.mm.yy', @@ -18,6 +30,7 @@ }); }); out$.showJS = showJS = jq(function(){ + set_lang(); $(".detail .heading").click(function(){ return $(this).closest('.detail').children('.mark:first').click(); }); @@ -77,6 +90,43 @@ return x$; }); }); + out$.statJS = statJS = jq(function(){ + var month; + set_lang(); + month = 30 * 24 * 60 * 60 * 1000; + return $('.stats').each(function(){ + var x$; + x$ = $(this); + x$.highcharts('StockChart', { + title: { + text: null + }, + credits: { + enabled: false + }, + rangeSelector: { + buttons: null, + inputDateFormat: "%d. %b %Y", + inputEditDateFormat: "%d.%m.%Y", + inputDateParser: function(value){ + value = value.split(/\./); + return Date.UTC(value[2], value[1] - 1, value[0], 0, 0, 0, 0); + } + }, + xAxis: { + minTickInterval: month, + minRange: month + }, + series: [{ + data: x$.data('stats') + }], + tooltip: { + pointFormat: "<b>{point.y} €</b><br/>" + } + }); + return x$; + }); + }); out$.catsJS = catsJS = jq(function(){ var counter, add_img, new_input, new_image; counter = 0; |