annotate app/assets/javascripts/init.tabs.js @ 104:9825e51ba30f

Minor reorganization.
author Edho Arief <edho@myconan.net>
date Mon, 12 Nov 2012 11:29:22 +0700
parents a8768ad51926
children a949b71c9afb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
59
1833de28583a Turns out the init file is required.
Edho Arief <edho@myconan.net>
parents:
diff changeset
1 $(document).ready(function() {
100
90b59418828a Three times more fun with tabs (added plain and markdown tab).
Edho Arief <edho@myconan.net>
parents: 59
diff changeset
2 raw = $('#plain > pre').text();
104
9825e51ba30f Minor reorganization.
Edho Arief <edho@myconan.net>
parents: 103
diff changeset
3
9825e51ba30f Minor reorganization.
Edho Arief <edho@myconan.net>
parents: 103
diff changeset
4 $('#highlight pre').text(raw);
9825e51ba30f Minor reorganization.
Edho Arief <edho@myconan.net>
parents: 103
diff changeset
5 window.prettyPrint && prettyPrint();
9825e51ba30f Minor reorganization.
Edho Arief <edho@myconan.net>
parents: 103
diff changeset
6
9825e51ba30f Minor reorganization.
Edho Arief <edho@myconan.net>
parents: 103
diff changeset
7 $('#markdown div').html(marked(raw));
9825e51ba30f Minor reorganization.
Edho Arief <edho@myconan.net>
parents: 103
diff changeset
8
103
a8768ad51926 Allows hash-based onload tab switch.
Edho Arief <edho@myconan.net>
parents: 100
diff changeset
9 mode = window.location.hash.substr(1);
a8768ad51926 Allows hash-based onload tab switch.
Edho Arief <edho@myconan.net>
parents: 100
diff changeset
10 if (mode == 'highlight') { $('#paste-tabs li:eq(1) a').click(); }
a8768ad51926 Allows hash-based onload tab switch.
Edho Arief <edho@myconan.net>
parents: 100
diff changeset
11 else if (mode == 'markdown') { $('#paste-tabs li:eq(2) a').click(); }
59
1833de28583a Turns out the init file is required.
Edho Arief <edho@myconan.net>
parents:
diff changeset
12 });