# HG changeset patch # User edogawaconan # Date 1381857576 -32400 # Node ID fa4a1ba990ae529a2bd58b72ab59801009a1e653 # Parent a9c45375a65655cafdacd85ae06ed9fbcc5d2a06 Simplified pastes#show view. diff -r a9c45375a656 -r fa4a1ba990ae app/assets/javascripts/boot.js --- a/app/assets/javascripts/boot.js Wed Oct 16 01:55:23 2013 +0900 +++ b/app/assets/javascripts/boot.js Wed Oct 16 02:19:36 2013 +0900 @@ -1,10 +1,8 @@ //= require zp.init -//= require zp.emul_radio //= require zp.formatter //= require zp.hash_magic //= require zp.new $(document).ready(function() { - zp.emul_radio.init() zp.formatter.init() zp.hash_magic.init() zp.new.init() diff -r a9c45375a656 -r fa4a1ba990ae app/assets/javascripts/zp.emul_radio.js --- a/app/assets/javascripts/zp.emul_radio.js Wed Oct 16 01:55:23 2013 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -(function($) { - window.zp.emul_radio = { - do_switch: function(e) { - $(e.target).siblings().removeClass("active") - }, - init: function() { - $(".emul-radio > a").click(this.do_switch) - } - } -})(jQuery) diff -r a9c45375a656 -r fa4a1ba990ae app/assets/javascripts/zp.hash_magic.js --- a/app/assets/javascripts/zp.hash_magic.js Wed Oct 16 01:55:23 2013 +0900 +++ b/app/assets/javascripts/zp.hash_magic.js Wed Oct 16 02:19:36 2013 +0900 @@ -3,9 +3,8 @@ window.zp.hash_magic = { load_hash: function() { var format = window.location.hash.slice(1) - if (format !== undefined) { - zp.formatter.links().filter("[href=#" + format + "]").click() - } + if (format == "") format = "pl" + zp.formatter.links().filter("[href=#" + format + "]").tab('show') }, set_hash: function(e) { if (typeof e !== "undefined") { diff -r a9c45375a656 -r fa4a1ba990ae app/assets/stylesheets/pastes.css --- a/app/assets/stylesheets/pastes.css Wed Oct 16 01:55:23 2013 +0900 +++ b/app/assets/stylesheets/pastes.css Wed Oct 16 02:19:36 2013 +0900 @@ -9,3 +9,9 @@ #pl > pre { word-break: normal; } + +#paste-show > div, +#paste-show > ul, +.edit_paste { + margin-bottom: 20px; +} diff -r a9c45375a656 -r fa4a1ba990ae app/views/pastes/show.html.erb --- a/app/views/pastes/show.html.erb Wed Oct 16 01:55:23 2013 +0900 +++ b/app/views/pastes/show.html.erb Wed Oct 16 02:19:36 2013 +0900 @@ -11,16 +11,13 @@
-
-
-
- <%= link_to 'Plain', '#pl', :data => { :toggle => 'tab' }, :class => 'btn btn-default active' %> - <%= link_to 'Highlight', '#hl', :data => { :toggle => 'tab' }, :class => 'btn btn-default' %> - <%= link_to 'Markdown', '#md', :data => { :toggle => 'tab' }, :class => 'btn btn-default' %> -
-
-
-
+ + +
<%= @paste.paste %>
@@ -30,24 +27,22 @@
-
+
-
- <%= form_for @paste, :method => :delete do |f| %> +<%= form_for @paste, :method => :delete do |f| %> +
<%= f.text_field :key, :value => nil, :placeholder => 'Deletion key', :class => "form-control", :autofocus => !flash[:error].blank? %> <%= f.submit 'Delete this paste', :class => 'btn btn-danger' %>
- <% end %> -
+
+<% end %> -
- -
+