Trademark Violation Monitoring System

Trademark Violation Monitoring System

Log, track, and manage potential trademark infringements.

Monitored Trademarks

Trademark Owner Active Violations Actions

Please select a trademark from the dashboard to view its violation log.

Please select a trademark from the dashboard to view a summary.

No violations logged for this trademark.

'; return; } violations.forEach(v => { const statusSlug = v.status.toLowerCase().replace(/ /g, '-'); const card = document.createElement('div'); card.className = 'bg-white p-4 rounded-lg border border-gray-200 shadow-sm'; card.innerHTML = `

${v.source}

Found on: ${v.date}

${v.status}

${v.notes || 'No notes.'}

`; container.appendChild(card); }); } function renderSummary() { const view = document.getElementById('summary-view'); const noSelection = document.getElementById('no-summary-selected'); if (!state.selectedTrademarkId) { view.classList.add('hidden'); noSelection.classList.remove('hidden'); return; } view.classList.remove('hidden'); noSelection.classList.add('hidden'); const trademark = state.trademarks.find(tm => tm.id === state.selectedTrademarkId); document.getElementById('summary-title').textContent = `Summary Report for "${trademark.name}"`; const container = document.getElementById('summary-content'); container.innerHTML = ''; const violations = state.violations[state.selectedTrademarkId] || []; if (violations.length === 0) { container.innerHTML = '

No violations to summarize.

'; return; } violations.forEach(v => { const statusSlug = v.status.toLowerCase().replace(/ /g, '-'); const item = document.createElement('div'); item.className = 'p-4 border rounded-lg bg-white'; item.innerHTML = `

Violation Source:

${v.status}

${v.source}

Date Found: ${v.date}

Notes:

${v.notes || 'N/A'}

`; container.appendChild(item); }); } // --- CORE FUNCTIONS --- window.showTab = function(tabIndex) { if (tabIndex > 0 && !state.selectedTrademarkId) { // Prevent moving to other tabs if no trademark is selected from dashboard if (state.currentTab === 0) return; } if (tabIndex === 0) { state.selectedTrademarkId = null; } state.currentTab = tabIndex; tabButtons.forEach((btn, i) => btn.classList.toggle('active', i === state.currentTab)); tabContents.forEach((content, i) => content.classList.toggle('active', i === state.currentTab)); updateNavButtons(); if (tabIndex === 1) renderViolationLog(); if (tabIndex === 2) renderSummary(); }; window.selectTrademark = function(trademarkId) { state.selectedTrademarkId = trademarkId; showTab(1); }; function updateNavButtons() { prevBtn.disabled = state.currentTab === 0; nextBtn.disabled = state.currentTab === tabButtons.length - 1; } function downloadPDF() { if (!state.selectedTrademarkId) return; const trademark = state.trademarks.find(tm => tm.id === state.selectedTrademarkId); const violations = state.violations[state.selectedTrademarkId] || []; const { jsPDF } = jspdf; const doc = new jsPDF(); doc.setFontSize(20); doc.setFont("helvetica", "bold"); doc.text(`Trademark Violation Report`, 105, 20, { align: 'center' }); doc.setFontSize(14); doc.text(`Trademark: ${trademark.name} (${trademark.owner})`, 105, 30, { align: 'center' }); const tableData = violations.map(v => [v.date, v.source, v.status, v.notes || '']); doc.autoTable({ startY: 40, head: [['Date Found', 'Source URL', 'Status', 'Notes']], body: tableData, theme: 'grid', headStyles: { fillColor: [67, 56, 202] } // Indigo }); doc.save(`Trademark_Report_${trademark.name}.pdf`); } // --- MODAL HANDLING --- function openModal(modal) { modal.classList.add('active'); } function closeModal(modal) { modal.classList.remove('active'); } document.getElementById('add-trademark-btn').addEventListener('click', () => { document.getElementById('trademark-form').reset(); openModal(trademarkModal); }); document.getElementById('add-violation-btn').addEventListener('click', () => { document.getElementById('violation-form').reset(); document.getElementById('violation-date').value = new Date().toISOString().split('T')[0]; openModal(violationModal); }); document.querySelectorAll('.cancel-btn').forEach(btn => { btn.addEventListener('click', (e) => closeModal(e.target.closest('.modal-overlay'))); }); // --- FORM SUBMISSIONS --- document.getElementById('trademark-form').addEventListener('submit', (e) => { e.preventDefault(); const newTrademark = { id: Date.now(), name: document.getElementById('trademark-name').value, owner: document.getElementById('trademark-owner').value }; state.trademarks.push(newTrademark); state.violations[newTrademark.id] = []; renderTrademarkList(); closeModal(trademarkModal); }); document.getElementById('violation-form').addEventListener('submit', (e) => { e.preventDefault(); const newViolation = { id: Date.now(), source: document.getElementById('violation-source').value, date: document.getElementById('violation-date').value, status: document.getElementById('violation-status').value, notes: document.getElementById('violation-notes').value, }; state.violations[state.selectedTrademarkId].push(newViolation); renderViolationLog(); closeModal(violationModal); }); // --- EVENT LISTENERS --- nextBtn.addEventListener('click', () => showTab(state.currentTab + 1)); prevBtn.addEventListener('click', () => showTab(state.currentTab - 1)); document.getElementById('pdf-download-btn').addEventListener('click', downloadPDF); // --- INITIALIZATION --- function initialize() { renderTrademarkList(); showTab(0); } initialize(); });
Scroll to Top