summaryrefslogtreecommitdiff
path: root/static/js/kosten.ls
diff options
context:
space:
mode:
Diffstat (limited to 'static/js/kosten.ls')
-rw-r--r--static/js/kosten.ls82
1 files changed, 41 insertions, 41 deletions
diff --git a/static/js/kosten.ls b/static/js/kosten.ls
index 5312a9a..6106ab5 100644
--- a/static/js/kosten.ls
+++ b/static/js/kosten.ls
@@ -3,32 +3,32 @@ jQuery.fn.extend do
jq = (f) -> !-> $ f
-# Call this to localize HighCharts
-set_lang = ->
- Highcharts .setOptions do
+# Call this to localize Highcharts
+set-lang = ->
+ Highcharts .set-options do
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]
+ short-months: [\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
+ range-selector-from: \von
+ range-selector-to: \bis
+ range-selector-zoom: null
# Add
export addJS = jq ->
$ 'input[name=date]' .datepicker do
- dateFormat: \dd.mm.yy
- firstDay: 1
+ date-format: \dd.mm.yy
+ first-day: 1
# Show
export showJS = jq ->
- set_lang!
+ set-lang!
$ ".detail .heading" .click ->
$ @ .closest \.detail .children \.mark:first .click!
$ ".detail > .mark" .click ->
- if (@src.indexOf \closed) is not -1
+ if (@src.index-of \closed) is not -1
@src .= replace \closed \open
else
@src .= replace \open \closed
@@ -43,20 +43,20 @@ export showJS = jq ->
..highcharts do
title: text: null
tooltip:
- hideDelay: 200
+ hide-delay: 200
formatter: ->
- "#{@key}: <b>#{@y.toFixed 2} €</b> / #{@percentage.toFixed 2}%"
+ "#{@key}: <b>#{@y.toFixed 2} €</b> / #{@percentage.to-fixed 2}%"
chart:
- backgroundColor: null
- plotBorderWidth: null
- plotShadow: off
- spacingTop: 0
+ background-color: null
+ plot-border-width: null
+ plot-shadow: off
+ spacing-top: 0
credits: enabled: false
series: [
type: \pie
size: \70%
- allowPointSelect: true
- dataLabels:
+ allow-point-select: true
+ data-labels:
color: ..css \color
distance: 20
data: [ {name: if v>0 then k else '' , y: v, visible: v > 0} \
@@ -65,8 +65,8 @@ export showJS = jq ->
# Statistics
export statJS = jq ->
- set_lang!
-
+ set-lang!
+
month = 30 * 24 * 60 * 60 * 1000
<- $ \.stats .each
@@ -74,42 +74,42 @@ export statJS = jq ->
..highcharts 'StockChart' do
title: text: null
credits: enabled: false
- rangeSelector:
+ range-selector:
buttons: []
- inputDateFormat: "%d. %b %Y"
- inputEditDateFormat: "%d.%m.%Y"
- inputDateParser: (value) ->
+ input-date-format: "%d. %b %Y"
+ input-edit-date-format: "%d.%m.%Y"
+ input-date-parser: (value) ->
value .= split /\./
- Date.UTC(value[2], # year
+ Date.UTC value[2], # year
value[1] - 1, # month ... 0-based -.-
value[0], #day
0,0,0,0 # time
- )
- xAxis:
- minTickInterval: month
- minRange: month
+
+ x-axis:
+ min-tick-interval: month
+ min-range: month
series: [
data : ..data \stats
]
tooltip:
- pointFormat: "<b>{point.y} €</b><br/>"
+ point-format: "<b>{point.y} €</b><br/>"
# Categories
export catsJS = jq ->
counter = 0
- add_img = $ \img#add
- new_input = $ \input#new
+ add-img = $ \img#add
+ new-input = $ \input#new
- new_image = (new_name) ->
+ new-image = (new-name) ->
# we need to copy the image to get the correct URL
- add_img.copy!
- ..attr \src -> @src.replace \add new_name
+ add-img.copy!
+ ..attr \src -> @src.replace \add new-name
$ "li > span" .click ->
span = $ @
input = span.next!
- img = new_image \undo
+ img = new-image \undo
..click ->
$ @ .remove!
@@ -123,9 +123,9 @@ export catsJS = jq ->
<- input.fade-in \slow
img.insert-after input
- add_img.click ->
- input = new_input.copy!
- img = new_image \minus
+ add-img.click ->
+ input = new-input.copy!
+ img = new-image \minus
..click ->
<- $ @ .parent!fade-out \slow
$ @ .remove!
@@ -136,7 +136,7 @@ export catsJS = jq ->
.parent! # wrap does not return the li
.append img
.hide!
- .insert-before add_img.parent!
+ .insert-before add-img.parent!
.fade-in \slow -> input.focus!
counter++