Mercurial > zeropaste
diff app/assets/javascripts/init.tabs.js @ 137:3241fe970c13
Yet another indentation fix.
author | Edho Arief <edho@myconan.net> |
---|---|
date | Mon, 12 Nov 2012 17:43:33 +0700 |
parents | b327d80c5ff9 |
children | 13ada93ad6a2 |
line wrap: on
line diff
--- a/app/assets/javascripts/init.tabs.js Mon Nov 12 17:42:37 2012 +0700 +++ b/app/assets/javascripts/init.tabs.js Mon Nov 12 17:43:33 2012 +0700 @@ -7,56 +7,56 @@ mode = paste.data('mode'), width = paste.data('width'), qstring = '#!' + mode + '.' + width; - if (width == 'auto') { - qstring = '#!'; - if (mode != 'plain') { - qstring += mode; - } - } - window.location = qstring; - }, - paste_resize = function(size) { - var paste = $('#paste'), - title = $('#paste-resize a.btn'); - title.html(title.html().replace(/(auto|\d+px)/, size)); - if (size == 'auto') { - paste.css('width', ''); - paste.data('width', size); - } else { - paste.css('width', size); - paste.data('width', size); + if (width == 'auto') { + qstring = '#!'; + if (mode != 'plain') { + qstring += mode; } - update_state(); - }, - paste_resize_menu_handler = function() { - paste_resize($(this).data('size')); - $('.open').removeClass('open'); - return false; - }, - paste_mode_state_handler = function() { - $('#paste').data('mode', $(this).prop('href').split('#')[1]); - update_state(); - }, - init_state = function() { - mode = window.location.hash.substr(2).split('.'); - if (mode[0] == 'highlight') { $('#paste-mode a:eq(1)').click(); } - else if (mode[0] == 'markdown') { $('#paste-mode a:eq(2)').click(); }; - if (mode[1] && mode[1].match(/^\d+px$/)) { paste_resize(mode[1]); } - }, - init_tabs_base = function() { - var raw = $('#plain pre').text(), - markdown = $('#markdown div'); - markdown.html(marked(raw)); - $('#highlight pre').text(raw); + } + window.location = qstring; + }, + paste_resize = function(size) { + var paste = $('#paste'), + title = $('#paste-resize a.btn'); + title.html(title.html().replace(/(auto|\d+px)/, size)); + if (size == 'auto') { + paste.css('width', ''); + paste.data('width', size); + } else { + paste.css('width', size); + paste.data('width', size); + } + update_state(); + }, + paste_resize_menu_handler = function() { + paste_resize($(this).data('size')); + $('.open').removeClass('open'); + return false; + }, + paste_mode_state_handler = function() { + $('#paste').data('mode', $(this).prop('href').split('#')[1]); + update_state(); + }, + init_state = function() { + mode = window.location.hash.substr(2).split('.'); + if (mode[0] == 'highlight') { $('#paste-mode a:eq(1)').click(); } + else if (mode[0] == 'markdown') { $('#paste-mode a:eq(2)').click(); }; + if (mode[1] && mode[1].match(/^\d+px$/)) { paste_resize(mode[1]); } + }, + init_tabs_base = function() { + var raw = $('#plain pre').text(), + markdown = $('#markdown div'); + markdown.html(marked(raw)); + $('#highlight pre').text(raw); - markdown.find('pre').addClass('prettyprint'); - markdown.find('a').prop('rel', 'nofollow'); - prettyPrint(); - }, - init_tabs_menu = function() { - $('#paste-mode a').click(paste_mode_state_handler); - $('#paste-resize ul a').click(paste_resize_menu_handler); - }; + markdown.find('pre').addClass('prettyprint'); + markdown.find('a').prop('rel', 'nofollow'); + prettyPrint(); + }, + init_tabs_menu = function() { + $('#paste-mode a').click(paste_mode_state_handler); + $('#paste-resize ul a').click(paste_resize_menu_handler); + }; init_tabs_base(); init_tabs_menu();