blob: 99b44b17a83de595438096ef5943c9cbe1957f77 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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').each(function() {
this.href = this.href.replace('index.html', 'catalog.html');
});
}
if (window.Options && Options.get_tab('general')) {
Options.extend_tab("general", "<fieldset><legend> Board List Catalog Links </legend><label><input type='checkbox' id='boardlist_catalog_links' /> "+_('Use catalog links for the board list')+"</label></fieldset>");
$('#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();
}
}
});
|