-
@@ -170,7 +187,6 @@ main .ck-editor[role='application'] .ck.ck-content,
width: 100%;
background: #fff;
font-size: 1em;
- line-height: 1.6em;
min-height: var(--ck-sample-editor-min-height);
padding: 1.5em 2em;
}
@@ -210,12 +226,14 @@ import {
computed,
onMounted,
onBeforeUnmount,
+ nextTick,
} from "vue";
import { useStore } from "src/store";
import { useQuasar } from "quasar";
import { useI18n } from "vue-i18n";
import GlobalData from "src/common/GlobalData";
import SubtitleEntity from "src/entities/SubtitleEntity";
+import { log } from "util";
export default defineComponent({
name: "ComponentSubtitleDialog",
@@ -229,6 +247,7 @@ export default defineComponent({
let subtitle = ref(new SubtitleEntity());
let wysiwyg_editor: Ref
= ref(null);
let wysiwyg_toolbar: Ref = ref(null);
+ let editor_parent: Ref = ref(null);
let editor: any = null;
const createEditor = () => {
@@ -237,35 +256,38 @@ export default defineComponent({
return;
}
+ const fontOptions: number[] = [9, 11, 13, 17];
+ for (let i = 17 + 2; i < 100; i += 2) {
+ fontOptions.push(i);
+ }
+
+ for (let i = 103; i < 150; i += 3) {
+ fontOptions.push(i);
+ }
+
+ for (let i = 154; i < 180; i += 4) {
+ fontOptions.push(i);
+ }
+
+ for (let i = 185; i < 200; i += 5) {
+ fontOptions.push(i);
+ }
+
+ for (let i = 210; i < 250; i += 10) {
+ fontOptions.push(i);
+ }
+
+ for (let i = 270; i < 300; i += 20) {
+ fontOptions.push(i);
+ }
+
+ for (let i = 330; i < 360; i += 30) {
+ fontOptions.push(i);
+ }
+
(window as any).DecoupledDocumentEditor.create(wysiwyg_editor.value, {
fontSize: {
- options: [
- 9,
- 11,
- 13,
- "default",
- 17,
- 19,
- 21,
- 25,
- 29,
- 31,
- 35,
- 39,
- 41,
- 45,
- 49,
- 51,
- 55,
- 59,
- 61,
- 69,
- 71,
- 79,
- 89,
- 99,
- 109,
- ],
+ options: fontOptions,
},
toolbar: {
items: [
@@ -284,8 +306,6 @@ export default defineComponent({
"bulletedList",
"todoList",
"|",
- "blockQuote",
- "|",
"undo",
"redo",
],
@@ -315,6 +335,7 @@ export default defineComponent({
subtitle,
wysiwyg_editor,
wysiwyg_toolbar,
+ editor_parent,
async showDialog() {
show_dialog.value = true;
loading.value = true;
@@ -335,12 +356,18 @@ export default defineComponent({
},
onShow() {
if (editor) {
- editor.ui.view.toolbar.isCompact = false;
- editor.ui.view.toolbar.maxWidth = "100%";
+ setTimeout(() => {
+ editor.ui.view.toolbar.isCompact = false;
+ editor.ui.view.toolbar.maxWidth = "100%";
+ }, 500);
document.querySelectorAll(".ck-dropdown__panel").forEach((item) => {
((item as HTMLElement)?.style as any).overflow = "auto";
- ((item as HTMLElement)?.style as any).height = "45vh";
+ ((item as HTMLElement)?.style as any).overflowX = "hidden";
+ ((item as HTMLElement)?.style as any).height = "40vh";
+ item.querySelectorAll(".ck-button__label").forEach((item_) => {
+ ((item_ as HTMLElement)?.style as any).fontSize = "20px";
+ });
});
editor.setData(subtitle.value.text);
@@ -397,6 +424,17 @@ export default defineComponent({
} catch {}
loading.value = false;
},
+ toggleFullScreen(e: any) {
+ console.log(e);
+ const target = e.target.parentNode.parentNode.parentNode;
+ console.log(target);
+ $q.fullscreen
+ .toggle(target)
+ .then(() => {})
+ .catch((err) => {
+ console.error(err);
+ });
+ },
};
},
});
diff --git a/src/i18n/zh-CN/index.ts b/src/i18n/zh-CN/index.ts
index 6570370..cc4637b 100644
--- a/src/i18n/zh-CN/index.ts
+++ b/src/i18n/zh-CN/index.ts
@@ -170,4 +170,6 @@ export default {
"set subtitle success": "设置字幕成功",
"input data error": "输入数据错误",
"editor error": "富文本编辑器内部错误",
+ "Exit Fullscreen": "退出全屏",
+ "Go Fullscreen": "全屏",
};