comparison app/assets/javascripts/init.tabs.js @ 120:309238f5b7b1

Prettyprint in markdown.
author Edho Arief <edho@myconan.net>
date Mon, 12 Nov 2012 14:35:19 +0700
parents e3f3402da5a1
children dd7181c021de
comparison
equal deleted inserted replaced
119:52fa2536a102 120:309238f5b7b1
1 $(document).ready(function() { 1 $(document).ready(function() {
2 if ($('#paste-tabs').length == 1) { 2 if ($('#paste-tabs').length == 1) {
3 raw = $('#plain pre').text(); 3 raw = $('#plain pre').text();
4 4
5 $('#markdown div').html(marked(raw));
6 $('#markdown div pre').addClass('prettyprint');
7
5 $('#highlight pre').text(raw); 8 $('#highlight pre').text(raw);
9
6 window.prettyPrint && prettyPrint(); 10 window.prettyPrint && prettyPrint();
7
8 $('#markdown div').html(marked(raw));
9 11
10 update_state = function() { 12 update_state = function() {
11 var paste = $('#paste'), 13 var paste = $('#paste'),
12 mode = paste.data('mode'), 14 mode = paste.data('mode'),
13 width = paste.data('width'), 15 width = paste.data('width'),