annotate app/assets/javascripts/pastes.js @ 114:b72f99d7b8cf

Dynamic url based on options selected. Yes, I'm having too much fun.
author Edho Arief <edho@myconan.net>
date Mon, 12 Nov 2012 13:31:18 +0700
parents e8a0e82213cd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
1 // Place all the behaviors and hooks related to the matching controller here.
42de15334db1 Added the pastes.
Edho Arief <edho@myconan.net>
parents:
diff changeset
2 // All this logic will automatically be available in application.js.
39
a930c717654c Add Clear button to the form.
Edho Arief <edho@myconan.net>
parents: 2
diff changeset
3
78
6ae3333a0251 Moved out link click listener from $(document).ready.
Edho Arief <edho@myconan.net>
parents: 76
diff changeset
4 $(document).on('click', '#reset_paste', function() {
6ae3333a0251 Moved out link click listener from $(document).ready.
Edho Arief <edho@myconan.net>
parents: 76
diff changeset
5 $('#paste_paste').val('');
6ae3333a0251 Moved out link click listener from $(document).ready.
Edho Arief <edho@myconan.net>
parents: 76
diff changeset
6 $('#paste_paste').focus();
6ae3333a0251 Moved out link click listener from $(document).ready.
Edho Arief <edho@myconan.net>
parents: 76
diff changeset
7 return false;
6ae3333a0251 Moved out link click listener from $(document).ready.
Edho Arief <edho@myconan.net>
parents: 76
diff changeset
8 });
39
a930c717654c Add Clear button to the form.
Edho Arief <edho@myconan.net>
parents: 2
diff changeset
9 $(document).ready(function() {
79
50b8738d6428 Use (modified) autosize to automatically resize textarea.
Edho Arief <edho@myconan.net>
parents: 78
diff changeset
10 $('#paste_paste').autosize({ className: 'mirrored_text row-fluid', append: "\n"});
97
e8a0e82213cd Updated autosize from vendor, separated box size hack to its own function.
Edho Arief <edho@myconan.net>
parents: 79
diff changeset
11 $.autosize_box_fix($('.mirrored_text'));
45
37a05df38236 Immediately focus on input box.
Edho Arief <edho@myconan.net>
parents: 44
diff changeset
12 $('#paste_paste').focus();
39
a930c717654c Add Clear button to the form.
Edho Arief <edho@myconan.net>
parents: 2
diff changeset
13 })