Link Augments
enhances links with confirmation prompts and other utilitiesProject Forge provides progressive enhancement for HTML links, adding JavaScript functionality while maintaining full accessibility for users without JavaScript. The link augmentation system focuses on improving user experience through confirmation dialogs and other interactive behaviors.
Overview
Link augments work by: - Adding CSS classes to standard HTML links - Automatically detecting and enhancing these links when JavaScript loads - Providing fallback behavior for users without JavaScript - Maintaining semantic HTML structure and accessibility
Confirmation Links
Basic Usage
Create links that require user confirmation before navigation by adding the link-confirm class:
<a href="/dangerous-action" class="link-confirm">Delete Item</a>
This will show a browser confirmation dialog with the default message “Are you sure?” before allowing navigation.
Custom Confirmation Messages
Provide custom confirmation messages using the data-message attribute:
1 | |
Progressive Enhancement
The confirmation functionality is implemented as a progressive enhancement:
With JavaScript enabled: - User clicks the link - Confirmation dialog appears with the specified message - If user clicks “OK”, navigation proceeds - If user clicks “Cancel”, navigation is prevented
Without JavaScript: - Link works as a normal HTML link - User navigates directly to the target URL - No confirmation dialog appears