# HG changeset patch # User Edho Arief # Date 1352694491 -25200 # Node ID a8768ad5192610162660e666a2226b2f11727571 # Parent 7a514c733e6c498267752d22b6896de61b8d3441 Allows hash-based onload tab switch. diff -r 7a514c733e6c -r a8768ad51926 app/assets/javascripts/init.tabs.js --- a/app/assets/javascripts/init.tabs.js Mon Nov 12 11:12:20 2012 +0700 +++ b/app/assets/javascripts/init.tabs.js Mon Nov 12 11:28:11 2012 +0700 @@ -2,5 +2,8 @@ raw = $('#plain > pre').text(); $('#highlight > pre').text(raw); $('#markdown > div').html(marked(raw)); + mode = window.location.hash.substr(1); + if (mode == 'highlight') { $('#paste-tabs li:eq(1) a').click(); } + else if (mode == 'markdown') { $('#paste-tabs li:eq(2) a').click(); } window.prettyPrint && prettyPrint(); }); diff -r 7a514c733e6c -r a8768ad51926 app/views/pastes/show.html.erb --- a/app/views/pastes/show.html.erb Mon Nov 12 11:12:20 2012 +0700 +++ b/app/views/pastes/show.html.erb Mon Nov 12 11:28:11 2012 +0700 @@ -5,7 +5,7 @@
-