Files
bentopdf/src/js/utils/full-width.ts
abdullahalam123 771de32cf0 feat: add digital signature PDF tool
- Add new tool to apply cryptographic signatures to PDFs using X.509 certificates
- Support PKCS#12 (.pfx, .p12) and PEM certificate formats
- Create PKCS#7 detached signatures compatible with all major PDF viewers
- Optional visible signature with customizable position, image, and text overlay
- Add translations for English, German, Vietnamese, and Chinese
2026-01-03 20:47:50 +05:30

35 lines
1.1 KiB
TypeScript

// Full-width mode utility
// This script applies the full-width preference from localStorage to page uploaders
export function initFullWidthMode() {
const savedFullWidth = localStorage.getItem('fullWidthMode') !== 'false';
if (savedFullWidth) {
applyFullWidthMode(true);
}
}
export function applyFullWidthMode(enabled: boolean) {
// Apply to all page uploaders
const pageUploaders = document.querySelectorAll('#tool-uploader');
pageUploaders.forEach((uploader) => {
if (enabled) {
uploader.classList.remove('max-w-2xl', 'max-w-4xl', 'max-w-5xl');
} else {
// Restore original max-width if not already present
if (!uploader.classList.contains('max-w-2xl') && !uploader.classList.contains('max-w-4xl') && !uploader.classList.contains('max-w-5xl')) {
uploader.classList.add('max-w-2xl');
}
}
});
}
// Auto-initialize on DOM load
if (typeof document !== 'undefined') {
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initFullWidthMode);
} else {
initFullWidthMode();
}
}