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.ls40
1 files changed, 19 insertions, 21 deletions
diff --git a/static/js/kosten.ls b/static/js/kosten.ls
index 01bc10c..26bd3b6 100644
--- a/static/js/kosten.ls
+++ b/static/js/kosten.ls
@@ -4,7 +4,7 @@ jQuery.fn.extend do
jq = (f) -> !-> $ f
# Call this to localize Highcharts
-set-lang = ->
+set-lang = !->
Highcharts .set-options do
# old colors
colors: [\#2f7ed8 \#0d233a \#8bbc21 \#910000 \#1aadce \#492970
@@ -21,19 +21,19 @@ set-lang = ->
range-selector-zoom: null
# Add
-export addJS = jq ->
+export addJS = jq !->
$ 'input[name=date]' .datepicker do
date-format: \dd.mm.yy
first-day: 1
# Show
-export showJS = jq ->
+export showJS = jq !->
set-lang!
- $ ".detail .heading" .click ->
+ $ ".detail .heading" .click !->
$ @ .closest \.detail .children \.mark:first .click!
- $ ".detail > .mark" .click ->
+ $ ".detail > .mark" .click !->
if (@src.index-of \closed) isnt -1
@src .= replace \closed \open
else
@@ -44,7 +44,7 @@ export showJS = jq ->
$ \.details .hide!
# draw the pies
- <- $ \.pie .each
+ <-! $ \.pie .each
$ @
..highcharts do
title: text: null
@@ -71,22 +71,20 @@ export showJS = jq ->
]
# Statistics
-export statJS = jq ->
+export statJS = jq !->
set-lang!
month = 30d * 24h * 60min * 60s * 1000ms
const-dialog = !->
df = Highcharts.date-format
- diag_opts =
- #title: "Konstante Ausgaben #{df '%b %Y' @x}"
- title: df '%B %Y' @x
data <-! $.get df '/stats/_const/%Y/%d' @x
- $ data .dialog diag_opts
+ $ data .dialog do
+ title: df '%B %Y' @x
- <- $ \.stats .each
+ <-! $ \.stats .each
$ @
..highcharts 'StockChart' do
title: text: null
@@ -115,7 +113,7 @@ export statJS = jq ->
# Categories
-export catsJS = jq ->
+export catsJS = jq !->
counter = 0
add-img = $ \img#add
new-input = $ \input#new
@@ -125,28 +123,28 @@ export catsJS = jq ->
add-img.copy!
..attr \src -> @src.replace \add new-name
- $ "li > span" .click ->
+ $ "li > span" .click !->
span = $ @
input = span.next!
img = new-image \undo
- ..click ->
+ ..click !->
$ @ .remove!
# reset text
input.val span.text!
- <- input.fade-out \slow
+ <-! input.fade-out \slow
span.toggle!
span.toggle!
- <- input.fade-in \slow
+ <-! input.fade-in \slow
img.insert-after input
- add-img.click ->
+ add-img.click !->
input = new-input.copy!
img = new-image \minus
- ..click ->
- <- $ @ .parent!fade-out \slow
+ ..click !->
+ <-! $ @ .parent!fade-out \slow
$ @ .remove!
input.attr \name -> @name + counter
@@ -156,6 +154,6 @@ export catsJS = jq ->
.append img
.hide!
.insert-before add-img.parent!
- .fade-in \slow -> input.focus!
+ .fade-in \slow !-> input.focus!
counter++