Skip to content

Commit 09ca69d

Browse files
Merge pull request #5703 from christianbeeznest/ofaj-21876-2
Internal: Improve font between TinyMCE editor and page view - refs BT#21876
2 parents 84c71eb + 6dbdfb8 commit 09ca69d

File tree

2 files changed

+43
-26
lines changed

2 files changed

+43
-26
lines changed

assets/css/editor_content.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ Stylesheet for HTML blocks created with CKEditor to embed in Chamilo pages.
2525
border-collapse: collapse !important;
2626
}
2727

28+
.tiny-content td {
29+
font-size: 14px;
30+
line-height: 16px;
31+
}
32+
2833
.tiny-content td, .tiny-content th {
2934
padding: 5px !important;
3035
}
@@ -40,6 +45,14 @@ Stylesheet for HTML blocks created with CKEditor to embed in Chamilo pages.
4045
font-weight: bold !important;
4146
}
4247

48+
.tiny-content .font-arial {
49+
font-family: Arial, sans-serif;
50+
}
51+
52+
.tiny-content .font-times-new-roman {
53+
font-family: 'Times New Roman', Times, serif;
54+
}
55+
4356
/* Hack for show Bootstrap alerts in CKEditor' style select */
4457
.cke_panel_listItem a > :first-child {
4558
margin-bottom: 0;

assets/vue/components/basecomponents/BaseTinyEditor.vue

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const toolbarTextDirection = "ltr rtl"
100100
101101
const defaultEditorConfig = {
102102
skin: false,
103-
content_css: false,
103+
content_css: ['/build/css/editor_content.css'],
104104
branding: false,
105105
relative_urls: false,
106106
height: 500,
@@ -132,31 +132,35 @@ const defaultEditorConfig = {
132132
"visualblocks",
133133
"wordcount",
134134
],
135-
toolbar: [
136-
toolbarUndo,
137-
toolbarFormatText,
138-
toolbarInsertMedia,
139-
toolbarFontConfig,
140-
toolbarAlign,
141-
toolbarIndent,
142-
toolbarList,
143-
toolbarColor,
144-
toolbarPageBreak,
145-
toolbarSpecialSymbols,
146-
toolbarOther,
147-
toolbarCode,
148-
toolbarTextDirection
149-
].join(" | "),
150-
file_picker_callback: filePickerCallback,
151-
content_style: ".tiny-content { font-family: Arial, sans-serif; font-size: 14px; }",
152-
body_class: 'tiny-content',
153-
setup: (editor) => {
154-
editor.on('init', () => {
155-
const body = editor.getBody();
156-
body.classList.add('tiny-content');
157-
});
158-
}
159-
}
135+
toolbar:
136+
toolbarUndo +
137+
" | " +
138+
toolbarFormatText +
139+
" | " +
140+
toolbarInsertMedia +
141+
" | " +
142+
toolbarFontConfig +
143+
" | " +
144+
toolbarAlign +
145+
" | " +
146+
toolbarIndent +
147+
" | " +
148+
toolbarList +
149+
" | " +
150+
toolbarColor +
151+
" | " +
152+
toolbarPageBreak +
153+
" | " +
154+
toolbarSpecialSymbols +
155+
" | " +
156+
toolbarOther +
157+
" | " +
158+
toolbarCode +
159+
" | " +
160+
toolbarTextDirection,
161+
content_style: ".tiny-content { font-family: Arial, sans-serif; }",
162+
body_class: 'tiny-content'
163+
};
160164
161165
if (props.fullPage) {
162166
defaultEditorConfig.plugins.push("fullpage")

0 commit comments

Comments
 (0)