Skip to content

Commit

Permalink
removed logs
Browse files Browse the repository at this point in the history
  • Loading branch information
junsan1 committed Jul 9, 2024
1 parent 1d45206 commit 6f8542f
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions _layouts/catalog_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,32 +84,18 @@ <h2>{{ item.name }}</h2>
{% endfor %}
</div>

<div id="debug-info" style="background-color: #f0f0f0; padding: 10px; margin-top: 20px; border: 1px solid #ccc;">
<h3>Debug Information</h3>
<pre id="debug-output"></pre>
</div>

<script>
var section = '{{ page.section }}';

document.addEventListener('DOMContentLoaded', function() {
const filterButtons = document.querySelectorAll('.filter-btn, .filter-tag');
const catalogItems = document.querySelectorAll('.catalog-item');
const searchInput = document.getElementById('catalog-search');
const debugOutput = document.getElementById('debug-output');

let activeFilters = new Set();
let activeItem = null;
let searchTerm = '';

function updateDebugInfo(message) {
debugOutput.textContent += message + '\n';
}

function clearDebugInfo() {
debugOutput.textContent = '';
}

function updateURL() {
const searchParams = new URLSearchParams();
if (activeFilters.size > 0) {
Expand Down Expand Up @@ -137,16 +123,7 @@ <h3>Debug Information</h3>
}

function applyFilters() {
clearDebugInfo();
updateDebugInfo(`Active filters: ${Array.from(activeFilters).join(', ')}`);
updateDebugInfo(`Active item: ${activeItem}`);
updateDebugInfo(`Search term: ${searchTerm}`);

let totalItems = 0;
let displayedItems = 0;

catalogItems.forEach(item => {
totalItems++;
const itemFilters = item.dataset.filters.toLowerCase().split(',');
const itemName = item.querySelector('h2').textContent.trim().toLowerCase();
const supportedDataProviders = item.dataset.supportedDataProviders ? item.dataset.supportedDataProviders.toLowerCase().split(',') : [];
Expand All @@ -172,21 +149,12 @@ <h3>Debug Information</h3>

const searchCondition = searchTerm === '' || itemName.includes(searchTerm);

updateDebugInfo(`Item: ${itemName}, Filter: ${filterCondition}, Item: ${itemCondition}, Search: ${searchCondition}`);
updateDebugInfo(`Supported Data Providers: ${supportedDataProviders.join(', ')}`);
updateDebugInfo(`Supported Brokers: ${supportedBrokers.join(', ')}`);
updateDebugInfo(`Supported Software: ${supportedSoftware.join(', ')}`);

if (filterCondition && itemCondition && searchCondition) {
item.style.display = 'block';
displayedItems++;
} else {
item.style.display = 'none';
}
});

updateDebugInfo(`Total items: ${totalItems}`);
updateDebugInfo(`Displayed items: ${displayedItems}`);
}

filterButtons.forEach(button => {
Expand Down Expand Up @@ -224,12 +192,6 @@ <h3>Debug Information</h3>
const urlBroker = urlParams.get('broker');
const urlSoftware = urlParams.get('software');
const urlSearch = urlParams.get('search');

updateDebugInfo(`URL Filters: ${urlFilters.join(', ')}`);
updateDebugInfo(`URL Data Provider: ${urlDataProvider}`);
updateDebugInfo(`URL Broker: ${urlBroker}`);
updateDebugInfo(`URL Software: ${urlSoftware}`);
updateDebugInfo(`URL Search: ${urlSearch}`);

if (urlFilters.length > 0 || urlDataProvider || urlBroker || urlSoftware || urlSearch) {
urlFilters.forEach(filter => {
Expand All @@ -245,7 +207,6 @@ <h3>Debug Information</h3>

if (urlDataProvider || urlBroker || urlSoftware) {
activeItem = decodeURIComponent(urlDataProvider || urlBroker || urlSoftware);
updateDebugInfo(`Active item set to: ${activeItem}`);
}

if (urlSearch) {
Expand Down

0 comments on commit 6f8542f

Please sign in to comment.