consolidation
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user