Mercurial > zeropaste
comparison app/assets/javascripts/init.tabs.js @ 131:7c7601575358
Moved $('#markdown div') to variable.
author | Edho Arief <edho@myconan.net> |
---|---|
date | Mon, 12 Nov 2012 17:27:14 +0700 |
parents | 64523785ad24 |
children | e05e47f7d224 |
comparison
equal
deleted
inserted
replaced
130:64523785ad24 | 131:7c7601575358 |
---|---|
1 $(document).ready(function() { | 1 $(document).ready(function() { |
2 if ($('#paste-show').length !== 1) { | 2 if ($('#paste-show').length !== 1) { |
3 return; | 3 return; |
4 } | 4 } |
5 raw = $('#plain pre').text(); | 5 var raw = $('#plain pre').text(), |
6 markdown = $('#markdown div'); | |
6 | 7 |
7 $('#markdown div').html(marked(raw)); | 8 markdown.html(marked(raw)); |
8 $('#markdown div pre').addClass('prettyprint'); | 9 markdown.find('pre').addClass('prettyprint'); |
9 $('#markdown div a').prop('rel', 'nofollow'); | 10 markdown.find('a').prop('rel', 'nofollow'); |
10 | 11 |
11 $('#highlight pre').text(raw); | 12 $('#highlight pre').text(raw); |
12 | 13 |
13 window.prettyPrint && prettyPrint(); | 14 window.prettyPrint && prettyPrint(); |
14 | 15 |