diff --git a/boards/static/js/thread.js b/boards/static/js/thread.js --- a/boards/static/js/thread.js +++ b/boards/static/js/thread.js @@ -1,78 +1,28 @@ -var image_mode = 0; -var normal_dom, table_dom; - -function add_panel(after) -{ - var nav_top = $(after); - if (nav_top.length === 0) return; - nav_top = nav_top[0]; - - var tab_bar = $('
'); - - var tab; - - tab = $(''); - tab.on("change", tab_handler); - - var label_normal = gettext('Normal'); - tab = $('').prepend(tab); - tab_bar.append(tab); - - tab = $(''); - tab.on("change", tab_handler); - - var label_gallery = gettext('Gallery'); - tab = $('').prepend(tab); - tab_bar.append(tab); - - tab_bar.insertAfter(nav_top); -} - -function tab_handler(ev) -{ - var current_el = $(this); - - if (!current_el.prop('checked')) return; +function addGalleryPanel() { + var gallery = $('a[class="thumb"]').clone(true), + normal = $('.post').clone(true); - var new_mode = parseInt(current_el.val(), 10); - if (new_mode === image_mode) return; - image_mode = new_mode; - - make_normal_dom(); - make_table_dom(); - - switch(new_mode) { - case 0: - $('#posts-table').replaceWith(normal_dom); - break; - case 1: - $('#posts').replaceWith(table_dom); - break; - } + $('.navigation_panel').filter(':first').after( + '