Mercurial > zeropaste
changeset 351:66fd92af3977
coffee: new.
author | edogawaconan <me@myconan.net> |
---|---|
date | Thu, 03 Jul 2014 15:15:53 +0900 |
parents | dbf1289bd721 |
children | 259a47cd3f44 |
files | app/assets/javascripts/zp.new.js app/assets/javascripts/zp.new.js.coffee |
diffstat | 2 files changed, 16 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/app/assets/javascripts/zp.new.js Thu Jul 03 15:03:52 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -//= require jquery.autosize -//= require autosize_box_fix -(function($) { - window.zp.new = { - input: function() { return $("#paste_paste") }, - clear: function(e) { - this.input().val("").focus() - e.preventDefault() - }, - init: function() { - if (this.input().length === 0) { return } - $(document).on('click', "#reset_paste", $.proxy(this.clear, this)) - this.input().autosize({ className: 'mirrored_text form-control', append: "\n"}); - $.autosize_box_fix($(".mirrored_text")) - this.input().focus() - } - } -})(jQuery)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/assets/javascripts/zp.new.js.coffee Thu Jul 03 15:15:53 2014 +0900 @@ -0,0 +1,16 @@ +#= require jquery.autosize +#= require autosize_box_fix +window.zp.new = + input: -> $("#paste_paste") + + clear: (e) -> + e.preventDefault() + @input().val("").focus() + + init: -> + return unless @input().length + + $(document).on "click", "#reset_paste", $.proxy(@clear, this) + @input().autosize className: "mirrored_text form-control", append: "\n" + $.autosize_box_fix $(".mirrored_text") + @input().focus()