annotate app/assets/javascripts/zp.new.js @ 349:f802099acd37

coffee: hash_magic.
author edogawaconan <me@myconan.net>
date Thu, 03 Jul 2014 15:03:34 +0900
parents 3ce44f960d3a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
215
0e52170b7b6a Missed the keyword require
Edho Arief <edho@myconan.net>
parents: 214
diff changeset
1 //= require jquery.autosize
347
3ce44f960d3a coffee: autosize_box_fix.
edogawaconan <me@myconan.net>
parents: 262
diff changeset
2 //= require autosize_box_fix
214
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
3 (function($) {
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
4 window.zp.new = {
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
5 input: function() { return $("#paste_paste") },
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
6 clear: function(e) {
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
7 this.input().val("").focus()
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
8 e.preventDefault()
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
9 },
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
10 init: function() {
217
cbd5819d7468 Completely wtf init for zp.new
Edho Arief <edho@myconan.net>
parents: 215
diff changeset
11 if (this.input().length === 0) { return }
214
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
12 $(document).on('click', "#reset_paste", $.proxy(this.clear, this))
262
45bd94c70896 Fix class name for form autoresizer.
edogawaconan <me@myconan.net>
parents: 217
diff changeset
13 this.input().autosize({ className: 'mirrored_text form-control', append: "\n"});
214
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
14 $.autosize_box_fix($(".mirrored_text"))
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
15 this.input().focus()
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
16 }
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
17 }
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
18 })(jQuery)