comparison app/assets/javascripts/init.tabs.js @ 132:e05e47f7d224

Add raw texts first before doing anything with them.
author Edho Arief <edho@myconan.net>
date Mon, 12 Nov 2012 17:27:53 +0700
parents 7c7601575358
children 342373709d16
comparison
equal deleted inserted replaced
131:7c7601575358 132:e05e47f7d224
4 } 4 }
5 var raw = $('#plain pre').text(), 5 var raw = $('#plain pre').text(),
6 markdown = $('#markdown div'); 6 markdown = $('#markdown div');
7 7
8 markdown.html(marked(raw)); 8 markdown.html(marked(raw));
9 $('#highlight pre').text(raw);
10
9 markdown.find('pre').addClass('prettyprint'); 11 markdown.find('pre').addClass('prettyprint');
10 markdown.find('a').prop('rel', 'nofollow'); 12 markdown.find('a').prop('rel', 'nofollow');
11
12 $('#highlight pre').text(raw);
13
14 window.prettyPrint && prettyPrint(); 13 window.prettyPrint && prettyPrint();
15 14
16 update_state = function() { 15 update_state = function() {
17 var paste = $('#paste'), 16 var paste = $('#paste'),
18 mode = paste.data('mode'), 17 mode = paste.data('mode'),