Trademark Violation Monitoring System
Log, track, and manage potential trademark infringements.
Monitored Trademarks
| Trademark | Owner | Active Violations | Actions |
|---|
Log and track all potential infringements for this trademark.
Please select a trademark from the dashboard to view its violation log.
Please select a trademark from the dashboard to view a summary.
Add Trademark
Log Violation
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(); });