annotate app/assets/javascripts/zp.new.js.coffee @ 355:56382cb104dd

Add support for environment variable-based deployment.
author edogawaconan <me@myconan.net>
date Mon, 04 Aug 2014 17:05:16 +0900
parents 66fd92af3977
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()