ea2c2ea093
Security & Quality Improvements:
- Fix XSS vulnerabilities in PresetImportDialog, PresetExportDialog, and templates
- Add resource leak protection in downloadExportFile() with try/finally
- Fix encapsulation violation by using public API instead of _presetsCache
- Add rollback mechanism for partial failures in replace mode
- Add preset name validation (length, characters, empty check)
- Add duplicate name detection within import files
- Add file size validation (5MB limit) and type validation
- Fix event listener leaks with proper cleanup in _onRender/_onClose
- Add constructor parameter validation for all dialogs
Acceptance Criteria Compliance:
- Fix AC-2: Export filename now uses world name (via parent.name)
- Fix AC-6: Error message matches spec exactly ('Import failed: invalid JSON format')
- Fix AC-8: Merge/Replace messages match spec format
Code Quality:
- Add shared HTML escaping utilities (src/utils/html.js)
- Consolidate duplicate localization strings (removed 28 duplicates from SCRYING_POOL)
- Use SCENE_PRESET_VERSION constant instead of hardcoded 1
- Handle null options in importPresets()
- Graceful handling of skipValidation with invalid data
Test Results: 679 passed, 3 failed (pre-existing in DirectorsBoard)
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
30 lines
1.1 KiB
Handlebars
30 lines
1.1 KiB
Handlebars
<div class="sp-dialog-content">
|
|
<p class="sp-export-description">
|
|
{{localize "video-view-manager.presetExport.description"}}
|
|
</p>
|
|
|
|
<div class="sp-export-info">
|
|
<span class="sp-info-label">{{localize "video-view-manager.presetExport.scene"}}:</span>
|
|
<span class="sp-info-value">{{sceneName}}</span>
|
|
</div>
|
|
|
|
<div class="sp-export-info">
|
|
<span class="sp-info-label">{{localize "video-view-manager.presetExport.presetCount"}}:</span>
|
|
<span class="sp-info-value">{{presetCount}}</span>
|
|
</div>
|
|
|
|
<div class="sp-export-info">
|
|
<span class="sp-info-label">{{localize "video-view-manager.presetExport.filename"}}:</span>
|
|
<span class="sp-info-value sp-filename">{{filename}}</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="sp-dialog-buttons">
|
|
<button type="button" class="sp-btn sp-btn-primary sp-export-btn">
|
|
<i class="fas fa-download"></i> {{localize "video-view-manager.presetExport.export"}}
|
|
</button>
|
|
<button type="button" class="sp-btn sp-btn-secondary" data-action="close">
|
|
{{localize "video-view-manager.presetExport.cancel"}}
|
|
</button>
|
|
</div>
|