// Generated by LiveScript 1.2.0 (function(){ var jq, setLang, addJS, showJS, statJS, catsJS, out$ = typeof exports != 'undefined' && exports || this; jQuery.fn.extend({ copy: function(){ return this.clone().removeAttr('id class'); } }); jq = function(f){ return function(){ $(f); }; }; setLang = function(){ Highcharts.setOptions({ colors: ['#2f7ed8', '#0d233a', '#8bbc21', '#910000', '#1aadce', '#492970', '#f28f43', '#77a1e5', '#c42525', '#a6c96a'], 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 } }); }; $(function(){ $('form.search').hide(); $('li.search').click(function(){ var x$; x$ = $('form.search'); x$.toggle(); if (x$.is(':visible')) { $('input.search').focus(); } }); $('input.search').focusout(function(){ $('form.search').hide(); }); }); out$.addJS = addJS = jq(function(){ $('input[name=date]').datepicker({ dateFormat: 'dd.mm.yy', firstDay: 1 }); }); out$.showJS = showJS = jq(function(){ setLang(); $(".detail .heading").click(function(){ $(this).closest('.detail').children('.mark:first').click(); }); $(".detail > .mark").click(function(){ if (this.src.indexOf('closed') !== -1) { this.src = this.src.replace('closed', 'open'); } else { this.src = this.src.replace('open', 'closed'); } $(this).nextAll('.details:first').toggle(); }); $('.details').hide(); $('.pie').each(function(){ var x$, k, v; x$ = $(this); x$.highcharts({ title: { text: null }, tooltip: { hideDelay: 200, formatter: function(){ return this.key + ": " + this.y.toFixed(2) + " € / " + this.percentage.toFixed(2) + "%"; } }, chart: { backgroundColor: null, plotBorderWidth: null, plotShadow: false, spacingTop: 0 }, credits: { enabled: false }, series: [{ type: 'pie', size: '70%', states: { hover: { halo: null } }, allowPointSelect: true, dataLabels: { color: x$.css('color'), distance: 20 }, data: (function(){ var ref$, results$ = []; for (k in ref$ = x$.data('pie')) { v = ref$[k]; results$.push({ name: v > 0 ? k : '', y: v, visible: v > 0 }); } return results$; }()) }] }); }); }); out$.statJS = statJS = jq(function(){ var month, constDialog; setLang(); month = 30 * 24 * 60 * 60 * 1000; constDialog = function(){ var df, time; df = Highcharts.dateFormat; time = this.x; $.get(df('/stats/_const/%Y/%m', time), function(data){ $(data).dialog({ title: df('%B %Y', time) }); }); }; $('.stats').each(function(){ var x$; x$ = $(this); x$.highcharts('StockChart', { title: { text: null }, credits: { enabled: false }, rangeSelector: { buttons: [], inputDateFormat: "%b %Y", inputEditDateFormat: "%m.%Y", inputDateParser: function(value){ value = value.split(/\./); return Date.UTC(value[1], value[0] - 1, 1, 0, 0, 0, 0); } }, plotOptions: { series: { point: { events: { click: constDialog } } } }, chart: { events: { click: function(){ var i$, ref$, len$, p; for (i$ = 0, len$ = (ref$ = this.series[0].data).length; i$ < len$; ++i$) { p = ref$[i$]; if (p.state) { constDialog.apply(p); break; } } } } }, xAxis: { minTickInterval: month, minRange: month }, series: [{ data: x$.data('stats'), step: 'left' }], tooltip: { pointFormat: '{point.y} €
' } }); }); }); out$.catsJS = catsJS = jq(function(){ var counter, addImg, newInput, newImage; counter = 0; addImg = $('img#add'); newInput = $('input#new'); newImage = function(newName){ var x$; x$ = addImg.copy(); x$.attr('src', function(){ return this.src.replace('add', newName); }); return x$; }; $("li > span").click(function(){ var span, input, x$, img; span = $(this); input = span.next(); x$ = img = newImage('undo'); x$.click(function(){ $(this).remove(); input.val(span.text()); input.fadeOut('slow', function(){ span.toggle(); }); }); span.toggle(); input.fadeIn('slow', function(){ img.insertAfter(input); }); }); addImg.click(function(){ var input, x$, img; input = newInput.copy(); x$ = img = newImage('minus'); x$.click(function(){ $(this).parent().fadeOut('slow', function(){ $(this).remove(); }); }); input.attr('name', function(){ return this.name + counter; }).removeAttr('style').wrap("
  • ").parent().append(img).hide().insertBefore(addImg.parent()).fadeIn('slow', function(){ input.focus(); }); counter++; }); }); }).call(this);