2013-08-08 15:07:22 -04:00
|
|
|
// This script puts a link to the catalog below the board subtitle, and next to the board list.
|
|
|
|
|
|
|
|
function catalog() {
|
|
|
|
var board = $("input[name='board']");
|
|
|
|
|
2013-08-08 19:39:18 -04:00
|
|
|
if (board.length>0) {
|
2013-08-11 09:17:21 -04:00
|
|
|
if (window.location.href.indexOf("/res/")==-1){ //if we are inside a thread
|
2013-08-08 15:07:22 -04:00
|
|
|
var catalog_url = 'catalog.html';
|
2013-08-11 09:17:21 -04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
var catalog_url = '../catalog.html';
|
|
|
|
}
|
2013-08-08 15:07:22 -04:00
|
|
|
var pages = document.getElementsByClassName('pages')[0];
|
|
|
|
var bottom = document.getElementsByClassName('boardlist bottom')[0]
|
|
|
|
var subtitle = document.getElementsByClassName('subtitle')[0];
|
|
|
|
|
|
|
|
var link = document.createElement('a');
|
|
|
|
link.href = catalog_url;
|
|
|
|
|
|
|
|
if (pages) {
|
2013-08-16 10:45:01 -04:00
|
|
|
link.textContent = _('Catalog');
|
2013-08-08 15:07:22 -04:00
|
|
|
link.style.color = '#F10000';
|
|
|
|
link.style.padding = '4px';
|
|
|
|
link.style.paddingLeft = '9px';
|
|
|
|
link.style.borderLeft = '1px solid'
|
|
|
|
link.style.borderLeftColor = '#A8A8A8';
|
|
|
|
link.style.textDecoration = "underline";
|
|
|
|
|
|
|
|
pages.appendChild(link)
|
|
|
|
}
|
|
|
|
else {
|
2013-08-16 10:45:01 -04:00
|
|
|
link.textContent = '['+_('Catalog').']';
|
2013-08-08 15:07:22 -04:00
|
|
|
link.style.paddingLeft = '10px';
|
|
|
|
link.style.textDecoration = "underline";
|
|
|
|
document.body.insertBefore(link, bottom);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (subtitle) {
|
|
|
|
var link2 = document.createElement('a');
|
2013-08-16 10:45:01 -04:00
|
|
|
link2.textContent = _('Catalog');
|
2013-08-08 15:07:22 -04:00
|
|
|
link2.href = catalog_url;
|
|
|
|
|
|
|
|
var br = document.createElement('br');
|
|
|
|
subtitle.appendChild(br);
|
|
|
|
subtitle.appendChild(link2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-08-16 10:45:01 -04:00
|
|
|
|
2013-08-16 10:45:43 -04:00
|
|
|
if (active_page != 'ukko') {
|
|
|
|
$(document).ready(catalog);
|
|
|
|
}
|