annotate app/assets/javascripts/zp.new.js.coffee @ 351:66fd92af3977

coffee: new.
author edogawaconan <me@myconan.net>
date Thu, 03 Jul 2014 15:15:53 +0900
parents app/assets/javascripts/zp.new.js@3ce44f960d3a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
351
66fd92af3977 coffee: new.
edogawaconan <me@myconan.net>
parents: 347
diff changeset
1 #= require jquery.autosize
66fd92af3977 coffee: new.
edogawaconan <me@myconan.net>
parents: 347
diff changeset
2 #= require autosize_box_fix
66fd92af3977 coffee: new.
edogawaconan <me@myconan.net>
parents: 347
diff changeset
3 window.zp.new =
66fd92af3977 coffee: new.
edogawaconan <me@myconan.net>
parents: 347
diff changeset
4 input: -> $("#paste_paste")
66fd92af3977 coffee: new.
edogawaconan <me@myconan.net>
parents: 347
diff changeset
5
66fd92af3977 coffee: new.
edogawaconan <me@myconan.net>
parents: 347
diff changeset
6 clear: (e) ->
66fd92af3977 coffee: new.
edogawaconan <me@myconan.net>
parents: 347
diff changeset
7 e.preventDefault()
66fd92af3977 coffee: new.
edogawaconan <me@myconan.net>
parents: 347
diff changeset
8 @input().val("").focus()
66fd92af3977 coffee: new.
edogawaconan <me@myconan.net>
parents: 347
diff changeset
9
66fd92af3977 coffee: new.
edogawaconan <me@myconan.net>
parents: 347
diff changeset
10 init: ->
66fd92af3977 coffee: new.
edogawaconan <me@myconan.net>
parents: 347
diff changeset
11 return unless @input().length
66fd92af3977 coffee: new.
edogawaconan <me@myconan.net>
parents: 347
diff changeset
12
66fd92af3977 coffee: new.
edogawaconan <me@myconan.net>
parents: 347
diff changeset
13 $(document).on "click", "#reset_paste", $.proxy(@clear, this)
66fd92af3977 coffee: new.
edogawaconan <me@myconan.net>
parents: 347
diff changeset
14 @input().autosize className: "mirrored_text form-control", append: "\n"
66fd92af3977 coffee: new.
edogawaconan <me@myconan.net>
parents: 347
diff changeset
15 $.autosize_box_fix $(".mirrored_text")
66fd92af3977 coffee: new.
edogawaconan <me@myconan.net>
parents: 347
diff changeset
16 @input().focus()