From f475f0095f2b4af1acab8cfe3d6c866a71b73bf1 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Sat, 14 Sep 2013 00:27:31 +0200 Subject: Replaced current JS by LS and generated JS --- static/js/kosten.js | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 static/js/kosten.js (limited to 'static/js/kosten.js') diff --git a/static/js/kosten.js b/static/js/kosten.js new file mode 100644 index 0000000..c1df1ca --- /dev/null +++ b/static/js/kosten.js @@ -0,0 +1,81 @@ +// Generated by LiveScript 1.2.0 +(function(){ + var jq, addJS, showJS, catsJS, out$ = typeof exports != 'undefined' && exports || this; + jQuery.fn.extend({ + copy: function(){ + return this.clone().removeAttr('id class'); + } + }); + jq = function(f){ + return function(){ + $(f); + }; + }; + out$.addJS = addJS = jq(function(){ + return $('input[name=date]').datepicker({ + dateFormat: 'dd.mm.yy', + firstDay: 1 + }); + }); + out$.showJS = showJS = jq(function(){ + $(".detail span").click(function(){ + return $(this).prevAll('.mark:last').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'); + } + return $(this).nextAll('.details:first').toggle(); + }); + return $('.details').hide(); + }); + out$.catsJS = catsJS = jq(function(){ + var counter, add_img, new_input, new_image; + counter = 0; + add_img = $('img#add'); + new_input = $('input#new'); + new_image = function(new_name){ + var x$; + x$ = add_img.copy(); + x$.attr('src', function(){ + return this.src.replace('add', new_name); + }); + return x$; + }; + $("li > span").click(function(){ + var span, input, x$, img; + span = $(this); + input = span.next(); + x$ = img = new_image('undo'); + x$.click(function(){ + $(this).remove(); + input.val(span.text()); + return input.fadeOut('slow', function(){ + return span.toggle(); + }); + }); + span.toggle(); + return input.fadeIn('slow', function(){ + return img.insertAfter(input); + }); + }); + return add_img.click(function(){ + var input, x$, img; + input = new_input.copy(); + x$ = img = new_image('minus'); + x$.click(function(){ + return $(this).parent().fadeOut('slow', function(){ + return $(this).remove(); + }); + }); + input.attr('name', function(){ + return this.name + counter; + }).removeAttr('style').wrap("
  • ").parent().append(img).hide().insertBefore(add_img.parent()).fadeIn('slow', function(){ + return input.focus(); + }); + return counter++; + }); + }); +}).call(this); -- cgit v1.2.3-70-g09d2