diff --git a/inc/display.php b/inc/display.php index 2895e099..268c633d 100644 --- a/inc/display.php +++ b/inc/display.php @@ -35,7 +35,7 @@ function doBoardListPart($list, $root, &$boards) { $title = ' title="'.$boards[$board].'"'; } - $body .= ' ' . $board . ' /'; + $body .= ' ' . $board . ' /'; } } } diff --git a/js/boardlist-catalog-links.js b/js/boardlist-catalog-links.js new file mode 100644 index 00000000..46afb358 --- /dev/null +++ b/js/boardlist-catalog-links.js @@ -0,0 +1,33 @@ +/* + * boardlist-catalog-links.js + * + * Usage: + * $config['additional_javascript'][] = 'js/jquery.min.js'; + * $config['additional_javascript'][] = 'js/boardlist-catalog-links.js'; + * + */ + +$(document).ready(function() { + + function replace_index_links() { + $('.boardlist').children('span[class="sub"]').children('a.board').each(function() { + this.href = this.href.replace('index.html', 'catalog.html'); + }); + } + + if (window.Options && Options.get_tab('general')) { + Options.extend_tab("general", "
Board List Catalog Links
"); + + $('#boardlist_catalog_links').on('change', function(){ + var setting = $(this).attr('id'); + + localStorage[setting] = $(this).is(':checked'); + location.reload(); + }); + + if (localStorage.boardlist_catalog_links === 'true') { + $('#boardlist_catalog_links').prop('checked', true); + replace_index_links(); + } + } +});