asdsad
This commit is contained in:
@@ -1 +1 @@
|
|||||||
1.1.74
|
1.1.75
|
||||||
@@ -181,10 +181,9 @@
|
|||||||
const isText = (component.is && component.is('text'))
|
const isText = (component.is && component.is('text'))
|
||||||
|| (component.get && component.get('type') === 'text');
|
|| (component.get && component.get('type') === 'text');
|
||||||
try {
|
try {
|
||||||
if (isText && component.components) {
|
const hasInlineStyle = /style\s*=\s*["'][^"']*["']/.test(content) || /<span\b/i.test(content);
|
||||||
try {
|
if (isText && component.components && !hasInlineStyle) {
|
||||||
component.components(content);
|
try { component.components(content); } catch {}
|
||||||
} catch {}
|
|
||||||
}
|
}
|
||||||
if (component.set) component.set('content', content);
|
if (component.set) component.set('content', content);
|
||||||
} catch {}
|
} catch {}
|
||||||
@@ -876,10 +875,18 @@
|
|||||||
);
|
);
|
||||||
addButton(icon('M4 7h10v2H4zM4 11h16v2H4zM4 15h10v2H4z'), 'Liste (ungeordnet)', 'insertUnorderedList');
|
addButton(icon('M4 7h10v2H4zM4 11h16v2H4zM4 15h10v2H4z'), 'Liste (ungeordnet)', 'insertUnorderedList');
|
||||||
addButton(icon('M4 6h4v2H4V6zm0 4h4v2H4v-2zm0 4h4v2H4v-2zm6-8h10v2H10V6zm0 4h10v2H10v-2zm0 4h10v2H10v-2z'), 'Liste (geordnet)', 'insertOrderedList');
|
addButton(icon('M4 6h4v2H4V6zm0 4h4v2H4v-2zm0 4h4v2H4v-2zm6-8h10v2H10V6zm0 4h10v2H10v-2zm0 4h10v2H10v-2z'), 'Liste (geordnet)', 'insertOrderedList');
|
||||||
addButton(icon('M4 7h10v2H4zM4 11h16v2H4zM4 15h12v2H4z'), 'Linksbundig', 'justifyLeft');
|
addButton(icon('M4 7h10v2H4zM4 11h16v2H4zM4 15h12v2H4z'), 'Linksbundig', null, null, () => {
|
||||||
addButton(icon('M5 7h14v2H5zM4 11h16v2H4zM5 15h14v2H5z'), 'Zentriert', 'justifyCenter');
|
applyComponentStyle({ textAlign: 'left' });
|
||||||
addButton(icon('M10 7h10v2H10zM4 11h16v2H4zM8 15h12v2H8z'), 'Rechtsbuendig', 'justifyRight');
|
});
|
||||||
addButton(icon('M4 7h16v2H4zM4 11h16v2H4zM4 15h16v2H4z'), 'Blocksatz', 'justifyFull');
|
addButton(icon('M5 7h14v2H5zM4 11h16v2H4zM5 15h14v2H5z'), 'Zentriert', null, null, () => {
|
||||||
|
applyComponentStyle({ textAlign: 'center' });
|
||||||
|
});
|
||||||
|
addButton(icon('M10 7h10v2H10zM4 11h16v2H4zM8 15h12v2H8z'), 'Rechtsbuendig', null, null, () => {
|
||||||
|
applyComponentStyle({ textAlign: 'right' });
|
||||||
|
});
|
||||||
|
addButton(icon('M4 7h16v2H4zM4 11h16v2H4zM4 15h16v2H4z'), 'Blocksatz', null, null, () => {
|
||||||
|
applyComponentStyle({ textAlign: 'justify' });
|
||||||
|
});
|
||||||
const linkModal = doc.createElement('div');
|
const linkModal = doc.createElement('div');
|
||||||
linkModal.style.display = 'none';
|
linkModal.style.display = 'none';
|
||||||
linkModal.style.position = 'absolute';
|
linkModal.style.position = 'absolute';
|
||||||
|
|||||||
@@ -450,6 +450,9 @@
|
|||||||
} catch {}
|
} catch {}
|
||||||
} catch {}
|
} catch {}
|
||||||
};
|
};
|
||||||
|
const hasInlineStyle = (html) => {
|
||||||
|
return /<span\b|style\s*=/i.test(String(html || ''));
|
||||||
|
};
|
||||||
const ensureViewMatchesModel = (model) => {
|
const ensureViewMatchesModel = (model) => {
|
||||||
const target = resolveTextModel(model);
|
const target = resolveTextModel(model);
|
||||||
if (!isTextLike(target)) return;
|
if (!isTextLike(target)) return;
|
||||||
@@ -462,7 +465,7 @@
|
|||||||
if (viewHtml) return;
|
if (viewHtml) return;
|
||||||
try {
|
try {
|
||||||
syncing.add(target);
|
syncing.add(target);
|
||||||
if (target.components) {
|
if (target.components && !hasInlineStyle(modelHtml)) {
|
||||||
try { target.components(modelHtml); } catch {}
|
try { target.components(modelHtml); } catch {}
|
||||||
}
|
}
|
||||||
if (target.set) target.set('content', modelHtml);
|
if (target.set) target.set('content', modelHtml);
|
||||||
@@ -501,7 +504,7 @@
|
|||||||
if (viewHtml === modelHtml) return;
|
if (viewHtml === modelHtml) return;
|
||||||
try {
|
try {
|
||||||
syncing.add(target);
|
syncing.add(target);
|
||||||
if (target.components) {
|
if (target.components && !hasInlineStyle(viewHtml)) {
|
||||||
try { target.components(viewHtml); } catch {}
|
try { target.components(viewHtml); } catch {}
|
||||||
}
|
}
|
||||||
if (target.set) target.set('content', viewHtml);
|
if (target.set) target.set('content', viewHtml);
|
||||||
@@ -536,7 +539,7 @@
|
|||||||
if (viewHtml === modelHtml && hasComps) return;
|
if (viewHtml === modelHtml && hasComps) return;
|
||||||
try {
|
try {
|
||||||
syncing.add(target);
|
syncing.add(target);
|
||||||
if (target.components) {
|
if (target.components && !hasInlineStyle(viewHtml)) {
|
||||||
try { target.components(viewHtml); } catch {}
|
try { target.components(viewHtml); } catch {}
|
||||||
}
|
}
|
||||||
if (target.set) target.set('content', viewHtml);
|
if (target.set) target.set('content', viewHtml);
|
||||||
@@ -575,6 +578,9 @@
|
|||||||
const DEBUG_UI_SUMMARY = B && typeof B.DEBUG_UI_SUMMARY !== 'undefined'
|
const DEBUG_UI_SUMMARY = B && typeof B.DEBUG_UI_SUMMARY !== 'undefined'
|
||||||
? !!B.DEBUG_UI_SUMMARY
|
? !!B.DEBUG_UI_SUMMARY
|
||||||
: true;
|
: true;
|
||||||
|
const hasInlineStyle = (html) => {
|
||||||
|
return /<span\b|style\s*=/i.test(String(html || ''));
|
||||||
|
};
|
||||||
const getModelHtmlForLog = (model) => {
|
const getModelHtmlForLog = (model) => {
|
||||||
if (!model) return '';
|
if (!model) return '';
|
||||||
let html = '';
|
let html = '';
|
||||||
@@ -722,7 +728,7 @@
|
|||||||
if (viewHtml === modelHtml) return;
|
if (viewHtml === modelHtml) return;
|
||||||
try {
|
try {
|
||||||
syncing.add(component);
|
syncing.add(component);
|
||||||
if (component.components) {
|
if (component.components && !hasInlineStyle(viewHtml)) {
|
||||||
try { component.components(viewHtml); } catch {}
|
try { component.components(viewHtml); } catch {}
|
||||||
}
|
}
|
||||||
if (component.set) component.set('content', viewHtml);
|
if (component.set) component.set('content', viewHtml);
|
||||||
@@ -790,7 +796,7 @@
|
|||||||
const viewHtml = normalizeViewHtml(selectedEl.innerHTML || '');
|
const viewHtml = normalizeViewHtml(selectedEl.innerHTML || '');
|
||||||
if (!viewHtml) return;
|
if (!viewHtml) return;
|
||||||
syncing.add(selected);
|
syncing.add(selected);
|
||||||
if (selected.components) {
|
if (selected.components && !hasInlineStyle(viewHtml)) {
|
||||||
try { selected.components(viewHtml); } catch {}
|
try { selected.components(viewHtml); } catch {}
|
||||||
}
|
}
|
||||||
if (selected.set) selected.set('content', viewHtml);
|
if (selected.set) selected.set('content', viewHtml);
|
||||||
|
|||||||
Reference in New Issue
Block a user