# HG changeset patch # User Edho Arief # Date 1352691720 -25200 # Node ID 90b59418828a90287f3ddb0fcb185e0fe1dfe68b # Parent e0e99705e79d105c662d918eb3875e3963907106 Three times more fun with tabs (added plain and markdown tab). diff -r e0e99705e79d -r 90b59418828a app/assets/javascripts/application.js --- a/app/assets/javascripts/application.js Mon Nov 12 09:44:44 2012 +0700 +++ b/app/assets/javascripts/application.js Mon Nov 12 10:42:00 2012 +0700 @@ -12,6 +12,8 @@ // //= require jquery //= require jquery_ujs +//= require twitter/bootstrap/tab //= require prettify +//= require marked //= require jquery.autosize //= require_tree . diff -r e0e99705e79d -r 90b59418828a app/assets/javascripts/init.prettify.js --- a/app/assets/javascripts/init.prettify.js Mon Nov 12 09:44:44 2012 +0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -$(document).ready(function() { - window.prettyPrint && prettyPrint(); -}); diff -r e0e99705e79d -r 90b59418828a app/assets/javascripts/init.tabs.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/assets/javascripts/init.tabs.js Mon Nov 12 10:42:00 2012 +0700 @@ -0,0 +1,6 @@ +$(document).ready(function() { + raw = $('#plain > pre').text(); + $('#highlight > pre').text(raw); + $('#markdown > div').html(marked(raw)); + window.prettyPrint && prettyPrint(); +}); diff -r e0e99705e79d -r 90b59418828a app/views/pastes/show.html.erb --- a/app/views/pastes/show.html.erb Mon Nov 12 09:44:44 2012 +0700 +++ b/app/views/pastes/show.html.erb Mon Nov 12 10:42:00 2012 +0700 @@ -3,7 +3,25 @@ -
<%= @paste.paste.gsub(/^$/, ' ') %>
+ +
+ +
+
+
<%= @paste.paste %>
+
+
+

+    
+
+
+
+
+