consolidation

This commit is contained in:
overcuriousity
2025-07-25 12:23:56 +02:00
parent 1e7c1a2468
commit b7fea4f31f
6 changed files with 138 additions and 51 deletions

View File

@@ -217,22 +217,8 @@ const tools = data.tools;
checkboxWrappers.forEach(wrapper => wrapper.style.display = 'flex');
}
// Create tool slug from name
function createToolSlug(toolName) {
return toolName.toLowerCase()
.replace(/[^a-z0-9\s-]/g, '')
.replace(/\s+/g, '-')
.replace(/-+/g, '-')
.replace(/^-|-$/g, '');
}
// Find tool by name or slug
function findTool(identifier) {
return window.toolsData.find(tool =>
tool.name === identifier ||
createToolSlug(tool.name) === identifier.toLowerCase()
);
}
// REMOVED: createToolSlug function - now using window.createToolSlug
// REMOVED: findTool function - now using window.findToolByIdentifier
// Navigation functions for sharing
window.navigateToGrid = function(toolName) {
@@ -337,8 +323,8 @@ const tools = data.tools;
return;
}
// Find the tool by name or slug
const tool = findTool(toolParam);
// Find the tool by name or slug using global function
const tool = window.findToolByIdentifier(window.toolsData, toolParam);
if (!tool) {
console.warn('Shared tool not found:', toolParam);
return;