comparison app/assets/javascripts/init.tabs.js @ 125:64f73525503b

Use button toolbar instead of nav.
author Edho Arief <edho@myconan.net>
date Mon, 12 Nov 2012 16:22:03 +0700
parents 4a8cefa814f1
children 426fb7bb44bb
comparison
equal deleted inserted replaced
124:4a8cefa814f1 125:64f73525503b
1 $(document).ready(function() { 1 $(document).ready(function() {
2 if ($('#paste-tabs').length == 1) { 2 if ($('#paste-show').length == 1) {
3 raw = $('#plain pre').text(); 3 raw = $('#plain pre').text();
4 4
5 marked.setOptions({ 5 marked.setOptions({
6 gfm: true, 6 gfm: true,
7 pedantic: false, 7 pedantic: false,
29 window.location = qstring; 29 window.location = qstring;
30 }; 30 };
31 31
32 paste_resize = function(size) { 32 paste_resize = function(size) {
33 var paste = $('#paste'), 33 var paste = $('#paste'),
34 title = $('#tab-resize a.btn'); 34 title = $('#paste-resize a.btn');
35 title.html(title.html().replace(/(auto|\d+px)/, size)); 35 title.html(title.html().replace(/(auto|\d+px)/, size));
36 if (size == 'auto') { 36 if (size == 'auto') {
37 paste.css('width', ''); 37 paste.css('width', '');
38 paste.data('width', size); 38 paste.data('width', size);
39 } else { 39 } else {
41 paste.data('width', size); 41 paste.data('width', size);
42 } 42 }
43 update_state(); 43 update_state();
44 } 44 }
45 45
46 $('#paste-tabs > li > a').click(function() { 46 $('#paste-mode a').click(function() {
47 $('#paste').data('mode', $(this).prop('href').split('#')[1]); 47 $('#paste').data('mode', $(this).prop('href').split('#')[1]);
48 update_state(); 48 update_state();
49 }); 49 });
50 $('#tab-resize ul a').click(function() { 50 $('#paste-resize ul a').click(function() {
51 paste_resize($(this).data('size')); 51 paste_resize($(this).data('size'));
52 $('.open').removeClass('open'); 52 $('.open').removeClass('open');
53 return false; 53 return false;
54 }); 54 });
55 55