Refactor symbols app: cleanup and fix issues
- Removed duplicate files (index2/3/4.html, symbols.js duplicates) - Kept index4.html as the main index.html (modular version) - Removed old text-generator.js (replaced by modular version) - Fixed ID mismatch in ui-bindings.js to match HTML - Added square and circle shape support in svg-generator.js - Added legend preview with copy functionality - Removed 580 lines of obsolete text-generator v4 code from app.js - Added addTextToLegend and addStandaloneArrowToLegend to export.js Still TODO: Split large files to comply with 300 line limit - app.js: 1219 lines - styles.css: 1319 lines - symbols.js: 870 lines 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -319,3 +319,44 @@ window.downloadStandaloneArrowDXF = function() {
|
||||
window.TextExport.downloadDxf(svg, 'pfeil.dxf');
|
||||
}
|
||||
};
|
||||
|
||||
// Zur Legende hinzufuegen
|
||||
window.addTextToLegend = function() {
|
||||
var state = window.TextGenState.current;
|
||||
var svg = window.SvgGenerator.generate(state);
|
||||
var name = state.text || 'Text-Symbol';
|
||||
|
||||
if (typeof legendItems !== 'undefined' && typeof updateLegendCount === 'function') {
|
||||
legendItems.push({
|
||||
id: 'text_' + Date.now(),
|
||||
name: name.split('\n')[0].substring(0, 30),
|
||||
svg: svg,
|
||||
description: ''
|
||||
});
|
||||
updateLegendCount();
|
||||
saveLegendToStorage();
|
||||
if (typeof showNotification === 'function') {
|
||||
showNotification('Zur Legende hinzugefuegt!');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
window.addStandaloneArrowToLegend = function() {
|
||||
var state = window.TextGenState.current;
|
||||
var svg = window.SvgGenerator.generateArrowOnly(state);
|
||||
if (!svg) return;
|
||||
|
||||
if (typeof legendItems !== 'undefined' && typeof updateLegendCount === 'function') {
|
||||
legendItems.push({
|
||||
id: 'arrow_' + Date.now(),
|
||||
name: 'Pfeil ' + state.arrow,
|
||||
svg: svg,
|
||||
description: ''
|
||||
});
|
||||
updateLegendCount();
|
||||
saveLegendToStorage();
|
||||
if (typeof showNotification === 'function') {
|
||||
showNotification('Pfeil zur Legende hinzugefuegt!');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user