';
}
var pages = [];
if (totalPages <= 7) {
for (var p = 1; p <= totalPages; p++) pages.push(p);
} else if (currentPage <= 4) {
for (var p = 1; p <= 6; p++) pages.push(p);
pages.push('...');
pages.push(totalPages);
} else if (currentPage >= totalPages - 3) {
pages.push(1);
pages.push('...');
for (var p = totalPages - 5; p <= totalPages; p++) pages.push(p);
} else {
pages.push(1);
pages.push('...');
for (var p = currentPage - 2; p <= currentPage + 2; p++) pages.push(p);
pages.push('...');
pages.push(totalPages);
}
for (var pi = 0; pi < pages.length; pi++) {
var page = pages[pi];
if (page === '...') {
html += '
';
}
list.innerHTML = html;
if (!document.getElementById('ha-pagination-style')) {
var style = document.createElement('style');
style.id = 'ha-pagination-style';
style.textContent =
'.pagination__item--ellipsis{cursor:default;border:none;background:transparent;padding:6px 10px;color:#999}' +
'.pagination__item{min-width:36px;text-align:center;padding:6px 12px!important;border-radius:6px;margin:0 2px;}' +
'.pagination__item--selected{background:#d6263a;color:#fff;border-radius:6px;font-weight:700;}' +
'.pagination__item:not(.pagination__item--disabled):not(.pagination__item--selected):hover{background:#f5f5f7;}' +
'.pagination__item--disabled{color:#ccc;cursor:default;}' +
'.pagination__list{gap:4px;}';
document.head.appendChild(style);
}
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', rebuildPagination);
} else {
setTimeout(rebuildPagination, 200);
}
})();
// Load cart badge from external file
(function() {
var s = document.createElement('script');
s.src = 'https://chatbot.hobbyaction.net/static/cart_badge.js';
s.async = true;
document.head.appendChild(s);
})();
// Load chat widget
(function() {
var s = document.createElement('script');
s.src = 'https://chatbot.hobbyaction.net/static/chat.js';
s.async = true;
document.head.appendChild(s);
})();
// Load Google platform.js for rating badge
(function() {
var s = document.createElement('script');
s.src = 'https://apis.google.com/js/platform.js?onload=renderBadge';
s.async = true;
s.defer = true;
document.head.appendChild(s);
})();
By using our website, you agree to the use of cookies. These cookies help us understand how customers arrive at and use our site and help us make improvements.
Hide this messageMore on cookies »