diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/assets/javascripts/zp.new.js	Sun May 12 02:43:38 2013 +0900
@@ -0,0 +1,19 @@
+//= 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() == "undefined") { return }
+      console.log("wheee~")
+      $(document).on('click', "#reset_paste", $.proxy(this.clear, this))
+      this.input().autosize({ className: 'mirrored_text row-fluid', append: "\n"});
+      $.autosize_box_fix($(".mirrored_text"))
+      this.input().focus()
+    }
+  }
+})(jQuery)