annotate app/assets/javascripts/zp.new.js @ 214:22c4b5f90e24

Massive javascript and html refactor. Also, ie9
author Edho Arief <edho@myconan.net>
date Sun, 12 May 2013 02:43:38 +0900
parents
children 0e52170b7b6a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
214
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
1 //= jquery.autosize
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
2 //= require autosize-box-fix
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() {
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
11 if (this.input() == "undefined") { return }
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
12 console.log("wheee~")
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
13 $(document).on('click', "#reset_paste", $.proxy(this.clear, this))
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
14 this.input().autosize({ className: 'mirrored_text row-fluid', append: "\n"});
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
15 $.autosize_box_fix($(".mirrored_text"))
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
16 this.input().focus()
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 }
22c4b5f90e24 Massive javascript and html refactor. Also, ie9
Edho Arief <edho@myconan.net>
parents:
diff changeset
19 })(jQuery)