# HG changeset patch # User Edho Arief # Date 1352712123 -25200 # Node ID 64f73525503ba988cfce554dfa43e42f79773d2b # Parent 4a8cefa814f12f38d75494b7fd558851540be8c1 Use button toolbar instead of nav. diff -r 4a8cefa814f1 -r 64f73525503b app/assets/javascripts/application.js --- a/app/assets/javascripts/application.js Mon Nov 12 15:33:11 2012 +0700 +++ b/app/assets/javascripts/application.js Mon Nov 12 16:22:03 2012 +0700 @@ -13,6 +13,7 @@ //= require jquery //= require jquery_ujs //= require twitter/bootstrap/tab +//= require twitter/bootstrap/button //= require twitter/bootstrap/dropdown //= require prettify //= require marked diff -r 4a8cefa814f1 -r 64f73525503b app/assets/javascripts/init.tabs.js --- a/app/assets/javascripts/init.tabs.js Mon Nov 12 15:33:11 2012 +0700 +++ b/app/assets/javascripts/init.tabs.js Mon Nov 12 16:22:03 2012 +0700 @@ -1,5 +1,5 @@ $(document).ready(function() { - if ($('#paste-tabs').length == 1) { + if ($('#paste-show').length == 1) { raw = $('#plain pre').text(); marked.setOptions({ @@ -31,7 +31,7 @@ paste_resize = function(size) { var paste = $('#paste'), - title = $('#tab-resize a.btn'); + title = $('#paste-resize a.btn'); title.html(title.html().replace(/(auto|\d+px)/, size)); if (size == 'auto') { paste.css('width', ''); @@ -43,11 +43,11 @@ update_state(); } - $('#paste-tabs > li > a').click(function() { + $('#paste-mode a').click(function() { $('#paste').data('mode', $(this).prop('href').split('#')[1]); update_state(); }); - $('#tab-resize ul a').click(function() { + $('#paste-resize ul a').click(function() { paste_resize($(this).data('size')); $('.open').removeClass('open'); return false; diff -r 4a8cefa814f1 -r 64f73525503b app/views/pastes/show.html.erb --- a/app/views/pastes/show.html.erb Mon Nov 12 15:33:11 2012 +0700 +++ b/app/views/pastes/show.html.erb Mon Nov 12 16:22:03 2012 +0700 @@ -4,26 +4,27 @@

<%= content_for :title %>

-
- + +
+
+
+ <%= link_to 'Plain', '#plain', :data => { :toggle => 'tab' }, :class => 'btn active' %> + <%= link_to 'Highlight', '#highlight', :data => { :toggle => 'tab' }, :class => 'btn' %> + <%= link_to 'Markdown', '#markdown', :data => { :toggle => 'tab' }, :class => 'btn' %> +
+ +
<%= @paste.paste %>