annotate app/assets/javascripts/pastes.js @ 66:e0817b84c01b

Allow post in txt format.
author Edho Arief <edho@myconan.net>
date Thu, 04 Oct 2012 10:20:19 +0700
parents 37a05df38236
children 5635c91f4bfd
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
a930c717654c Add Clear button to the form.
Edho Arief <edho@myconan.net>
parents: 2
diff changeset
4 $(document).ready(function() {
a930c717654c Add Clear button to the form.
Edho Arief <edho@myconan.net>
parents: 2
diff changeset
5 $('#reset_paste').click(function() {
a930c717654c Add Clear button to the form.
Edho Arief <edho@myconan.net>
parents: 2
diff changeset
6 $('#paste_paste').val('');
a930c717654c Add Clear button to the form.
Edho Arief <edho@myconan.net>
parents: 2
diff changeset
7 $('#paste_paste').focus();
a930c717654c Add Clear button to the form.
Edho Arief <edho@myconan.net>
parents: 2
diff changeset
8 return false;
a930c717654c Add Clear button to the form.
Edho Arief <edho@myconan.net>
parents: 2
diff changeset
9 });
44
6a9e0c09bbd8 Ensure input box's width is always 100%.
Edho Arief <edho@myconan.net>
parents: 39
diff changeset
10 $(window).resize(function() {
6a9e0c09bbd8 Ensure input box's width is always 100%.
Edho Arief <edho@myconan.net>
parents: 39
diff changeset
11 $('#paste_paste').css('width', '100%');
6a9e0c09bbd8 Ensure input box's width is always 100%.
Edho Arief <edho@myconan.net>
parents: 39
diff changeset
12 })
45
37a05df38236 Immediately focus on input box.
Edho Arief <edho@myconan.net>
parents: 44
diff changeset
13 $('#paste_paste').focus();
39
a930c717654c Add Clear button to the form.
Edho Arief <edho@myconan.net>
parents: 2
diff changeset
14 })