qms-angular 1.0.72 → 1.0.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/qms-angular.umd.js +509 -116
- package/bundles/qms-angular.umd.js.map +1 -1
- package/esm2015/lib/components/qms-navigation-drawer/qms-navigation-drawer.component.js +2 -2
- package/esm2015/lib/components/qms-navigation-drawer/qms-navigation-drawer.module.js +1 -3
- package/esm2015/lib/components/select-include-children/select-include-children.component.js +112 -45
- package/esm2015/lib/components/tree/tree.component.js +10 -14
- package/esm2015/lib/model/en.js +19 -2
- package/esm2015/lib/model/no.js +19 -2
- package/esm2015/lib/qms-ckeditor-components/common/classes/qmsUploadAdapter.js +89 -0
- package/esm2015/lib/qms-ckeditor-components/common/constants/ckeditorEvent.constant.js +3 -1
- package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-data.model.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-video-tree.model.js +4 -0
- package/esm2015/lib/qms-ckeditor-components/common/models/wproofreader-config.model.js +6 -0
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-about/qms-ckeditor-about.component.js +38 -0
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-bpmn/qms-ckeditor-bpmn.component.js +22 -3
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-imagemap/qms-ckeditor-imagemap.component.js +9 -8
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/qms-ckeditor-link.component.js +4 -1
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-tooltip/qms-ckeditor-tooltip.component.js +3 -4
- package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.component.js +160 -10
- package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.module.js +7 -3
- package/esm2015/lib/qms-ckeditor-components/services/qms-ckeditor-tree.service.js +4 -1
- package/esm2015/lib/qms-ckeditor-components/services/qms-ckeditor-upload.service.js +20 -0
- package/esm2015/qms-angular.js +6 -4
- package/fesm2015/qms-angular.js +475 -95
- package/fesm2015/qms-angular.js.map +1 -1
- package/lib/components/select-include-children/select-include-children.component.d.ts +2 -1
- package/lib/model/en.d.ts +17 -0
- package/lib/model/no.d.ts +17 -0
- package/lib/qms-ckeditor-components/common/classes/qmsUploadAdapter.d.ts +18 -0
- package/lib/qms-ckeditor-components/common/constants/ckeditorEvent.constant.d.ts +2 -0
- package/lib/qms-ckeditor-components/common/models/qms-ckeditor-data.model.d.ts +4 -0
- package/lib/qms-ckeditor-components/common/models/qms-ckeditor-video-tree.model.d.ts +5 -0
- package/lib/qms-ckeditor-components/common/models/wproofreader-config.model.d.ts +25 -0
- package/lib/qms-ckeditor-components/components/qms-ckeditor-about/qms-ckeditor-about.component.d.ts +15 -0
- package/lib/qms-ckeditor-components/components/qms-ckeditor-bpmn/qms-ckeditor-bpmn.component.d.ts +4 -1
- package/lib/qms-ckeditor-components/components/qms-ckeditor-imagemap/qms-ckeditor-imagemap.component.d.ts +2 -1
- package/lib/qms-ckeditor-components/qms-ckeditor.component.d.ts +15 -1
- package/lib/qms-ckeditor-components/services/qms-ckeditor-tree.service.d.ts +2 -0
- package/lib/qms-ckeditor-components/services/qms-ckeditor-upload.service.d.ts +5 -0
- package/lib.theme.scss +1 -0
- package/package.json +1 -1
- package/qms-angular.d.ts +5 -3
- package/qms-angular.metadata.json +1 -1
- package/src/assets/images/ckeditor5.svg +1 -0
- package/src/assets/qms-ckeditor-plugin/build/ckeditor.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/ckeditor.js.map +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/az.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/cs.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/da.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/de-ch.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/de.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/en-au.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/es.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/et.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/fa.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/fr.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/gl.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/he.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/hi.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/hr.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/hu.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/id.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/it.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/ja.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/ko.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/ku.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/lv.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/nl.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/no.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/pl.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/pt-br.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/ru.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/sk.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/sl.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/sr-latn.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/sr.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/th.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/tk.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/tr.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/uk.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/vi.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/zh-cn.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/zh.js +1 -1
- package/src/assets/qms-ckeditor-plugin/package-lock.json +23 -0
- package/src/assets/qms-ckeditor-plugin/package.json +2 -0
- package/src/assets/qms-ckeditor-plugin/src/ckeditor.js +16 -4
- package/src/assets/qms-ckeditor-plugin/src/plugins/aboutckeditor/aboutckeditor.js +28 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/bpmn/bpmndialogcommand.js +74 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/bpmn/qmsCKEditorBpmnPlugin.js +5 -68
- package/src/assets/qms-ckeditor-plugin/src/plugins/common/qmsCKEditorConstant.js +4 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/common/qmsCKEditorService.js +21 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/imagemap/imagemapcommand.js +1 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/imagemap/utils.js +1 -1
- package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkcommand.js +131 -176
- package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkdialogcommand.js +88 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkediting.js +2 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkui.js +41 -32
- package/src/assets/qms-ckeditor-plugin/src/plugins/tableofcontents/tableofcontents.js +14 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/tableofcontents/tableofcontentscommand.js +87 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/tableofcontents/tableofcontentsediting.js +59 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/tableofcontents/tableofcontentsui.js +35 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/tableofcontents/utils.js +62 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/template/loadtemplatedialogcommand.js +14 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/template/qmsCKEditorLoadTemplatePlugin.js +10 -12
- package/src/assets/qms-ckeditor-plugin/src/plugins/template/qmsCKEdtiorTemplatePlugin.js +10 -7
- package/src/assets/qms-ckeditor-plugin/src/plugins/template/templatedialogcommand.js +9 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/timestamp/timestamp.js +15 -18
- package/src/assets/qms-ckeditor-plugin/src/plugins/timestamp/timestampcommand.js +17 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/removetooltipcommand.js +42 -26
- package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltip.js +3 -3
- package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipcommand.js +75 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipdialogcommand.js +68 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipediting.js +206 -131
- package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipui.js +424 -136
- package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/ui/actionsview.js +67 -12
- package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/utils.js +17 -55
- package/src/assets/qms-ckeditor-plugin/src/plugins/video/autovideo.js +1 -5
- package/src/assets/qms-ckeditor-plugin/src/plugins/video/video/videoediting.js +5 -2
- package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoupload/browsevideodialogcommand.js +25 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoupload/uploadvideocommand.js +3 -16
- package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoupload/videouploadediting.js +4 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoupload/videouploadui.js +12 -23
- package/src/assets/qms-ckeditor-plugin/src/themes/icons/information.svg +1 -50
- package/src/assets/qms-ckeditor-plugin/src/themes/icons/table-excel.svg +44 -0
- package/src/assets/qms-ckeditor-plugin/src/themes/icons/timestamp.svg +1 -1
- package/src/assets/qms-ckeditor-plugin/src/themes/icons/tooltip.svg +1 -0
- package/src/assets/qms-ckeditor-plugin/src/themes/styles/heading.css +54 -0
- package/src/assets/qms-ckeditor-plugin/src/themes/styles/tooltip.css +11 -53
- package/src/lib/qms-ckeditor-components/components/qms-ckeditor-about/qms-ckeditor-about.component.scss +16 -0
- package/src/lib/qms-ckeditor-components/components/qms-ckeditor-imagemap/qms-ckeditor-imagemap.component.scss +26 -23
- package/src/themes/core/_range-slider.scss +10 -12
- package/esm2015/lib/qms-ckeditor-components/common/classes/uploadAdapter.js +0 -26
- package/lib/qms-ckeditor-components/common/classes/uploadAdapter.d.ts +0 -5
- package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/inserttooltipcommand.js +0 -88
@@ -3,25 +3,62 @@ import { FocusTracker, KeystrokeHandler } from '@ckeditor/ckeditor5-utils';
|
|
3
3
|
import { icons } from '@ckeditor/ckeditor5-core';
|
4
4
|
import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';
|
5
5
|
import '../../../themes/styles/linkactions.css';
|
6
|
-
|
6
|
+
|
7
7
|
export default class ActionsView extends View {
|
8
|
+
/**
|
9
|
+
* @inheritDoc
|
10
|
+
*/
|
8
11
|
constructor( locale ) {
|
9
12
|
super( locale );
|
10
13
|
|
11
14
|
const t = locale.t;
|
12
|
-
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Tracks information about DOM focus in the actions.
|
18
|
+
*
|
19
|
+
* @readonly
|
20
|
+
* @member {module:utils/focustracker~FocusTracker}
|
21
|
+
*/
|
13
22
|
this.focusTracker = new FocusTracker();
|
14
|
-
|
23
|
+
|
24
|
+
/**
|
25
|
+
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
26
|
+
*
|
27
|
+
* @readonly
|
28
|
+
* @member {module:utils/keystrokehandler~KeystrokeHandler}
|
29
|
+
*/
|
15
30
|
this.keystrokes = new KeystrokeHandler();
|
16
|
-
|
17
|
-
this.removeButtonView = this._createButton(t('Remove tooltip'), icons.eraser, 'remove');
|
18
|
-
|
19
|
-
this.editButtonView = this._createButton(t('Edit tooltip'), icons.pencil, 'edit');
|
20
31
|
|
21
|
-
|
22
|
-
|
32
|
+
/**
|
33
|
+
* The unlink button view.
|
34
|
+
*
|
35
|
+
* @member {module:ui/button/buttonview~ButtonView}
|
36
|
+
*/
|
37
|
+
this.removeButtonView = this._createButton( t( 'Remove tooltip' ), icons.eraser, 'remove' );
|
38
|
+
|
39
|
+
/**
|
40
|
+
* The edit link button view.
|
41
|
+
*
|
42
|
+
* @member {module:ui/button/buttonview~ButtonView}
|
43
|
+
*/
|
44
|
+
this.editButtonView = this._createButton( t( 'Edit tooltip' ), icons.pencil, 'edit' );
|
45
|
+
|
46
|
+
/**
|
47
|
+
* A collection of views that can be focused in the view.
|
48
|
+
*
|
49
|
+
* @readonly
|
50
|
+
* @protected
|
51
|
+
* @member {module:ui/viewcollection~ViewCollection}
|
52
|
+
*/
|
23
53
|
this._focusables = new ViewCollection();
|
24
|
-
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Helps cycling over {@link #_focusables} in the view.
|
57
|
+
*
|
58
|
+
* @readonly
|
59
|
+
* @protected
|
60
|
+
* @member {module:ui/focuscycler~FocusCycler}
|
61
|
+
*/
|
25
62
|
this._focusCycler = new FocusCycler( {
|
26
63
|
focusables: this._focusables,
|
27
64
|
focusTracker: this.focusTracker,
|
@@ -29,6 +66,7 @@ export default class ActionsView extends View {
|
|
29
66
|
actions: {
|
30
67
|
// Navigate fields backwards using the Shift + Tab keystroke.
|
31
68
|
focusPrevious: 'shift + tab',
|
69
|
+
|
32
70
|
// Navigate fields forwards using the Tab key.
|
33
71
|
focusNext: 'tab'
|
34
72
|
}
|
@@ -43,6 +81,7 @@ export default class ActionsView extends View {
|
|
43
81
|
'ck-link-actions',
|
44
82
|
'ck-responsive-form'
|
45
83
|
],
|
84
|
+
|
46
85
|
// https://github.com/ckeditor/ckeditor5-link/issues/90
|
47
86
|
tabindex: '-1'
|
48
87
|
},
|
@@ -54,6 +93,9 @@ export default class ActionsView extends View {
|
|
54
93
|
} );
|
55
94
|
}
|
56
95
|
|
96
|
+
/**
|
97
|
+
* @inheritDoc
|
98
|
+
*/
|
57
99
|
render() {
|
58
100
|
super.render();
|
59
101
|
|
@@ -74,10 +116,22 @@ export default class ActionsView extends View {
|
|
74
116
|
this.keystrokes.listenTo( this.element );
|
75
117
|
}
|
76
118
|
|
119
|
+
/**
|
120
|
+
* Focuses the fist {@link #_focusables} in the actions.
|
121
|
+
*/
|
77
122
|
focus() {
|
78
123
|
this._focusCycler.focusFirst();
|
79
124
|
}
|
80
125
|
|
126
|
+
/**
|
127
|
+
* Creates a button view.
|
128
|
+
*
|
129
|
+
* @private
|
130
|
+
* @param {String} label The button label.
|
131
|
+
* @param {String} icon The button icon.
|
132
|
+
* @param {String} [eventName] An event name that the `ButtonView#execute` event will be delegated to.
|
133
|
+
* @returns {module:ui/button/buttonview~ButtonView} The button view instance.
|
134
|
+
*/
|
81
135
|
_createButton( label, icon, eventName ) {
|
82
136
|
const button = new ButtonView( this.locale );
|
83
137
|
|
@@ -87,9 +141,10 @@ export default class ActionsView extends View {
|
|
87
141
|
tooltip: true
|
88
142
|
} );
|
89
143
|
|
90
|
-
button.delegate('execute').to(this, eventName);
|
144
|
+
button.delegate( 'execute' ).to( this, eventName );
|
91
145
|
|
92
146
|
return button;
|
93
147
|
}
|
148
|
+
|
94
149
|
}
|
95
|
-
|
150
|
+
|
@@ -1,65 +1,27 @@
|
|
1
1
|
|
2
2
|
export const TOOLTIP_CUSTOM_PROPERTY = 'tooltip';
|
3
|
-
export const TOOLTIP_ATTRIBUTE = '
|
4
|
-
export const HTML_ATTRIBUTE = 'data-
|
5
|
-
export const HTML_CLASS = '
|
6
|
-
export const
|
7
|
-
|
3
|
+
export const TOOLTIP_ATTRIBUTE = 'qmstooltip';
|
4
|
+
export const HTML_ATTRIBUTE = 'data-qmstooltip';
|
5
|
+
export const HTML_CLASS = 'qms-tooltip';
|
6
|
+
export const HTML_ELEMENT = 'abbr';
|
7
|
+
|
8
|
+
export const TOOLTIP_COMMANDS = {
|
9
|
+
TOOLTIP_DIALOG: 'tooltipdialog',
|
10
|
+
TOOLTIP: 'tooltip',
|
11
|
+
REMOVE_TOOLTIP: 'removetooltip'
|
12
|
+
}
|
13
|
+
|
8
14
|
|
9
15
|
export function isTooltipElement(node) {
|
10
16
|
return node.is('attributeElement') && !!node.getCustomProperty(TOOLTIP_CUSTOM_PROPERTY);
|
11
17
|
}
|
12
|
-
|
13
|
-
export function findTooltipElementAncestor(position) {
|
14
|
-
return position.getAncestors().find(ancestor => isTooltipElement(ancestor));
|
15
|
-
}
|
18
|
+
|
16
19
|
|
17
|
-
export function
|
18
|
-
|
19
|
-
.reverse()
|
20
|
-
.find(node => node.is('element'));
|
21
|
-
}
|
22
|
-
|
23
|
-
export function isTyping(editor) {
|
24
|
-
const input = editor.plugins.get('Input');
|
25
|
-
return input.isInput(editor.model.change(writer => writer.batch));
|
26
|
-
}
|
27
|
-
|
28
|
-
|
29
|
-
export function shouldCopyAttributes(model) {
|
30
|
-
const selection = model.document.selection;
|
31
|
-
const firstPosition = selection.getFirstPosition();
|
32
|
-
const lastPosition = selection.getLastPosition();
|
33
|
-
const nodeAtFirstPosition = firstPosition.nodeAfter;
|
34
|
-
|
35
|
-
// The text tooltip node does not exist...
|
36
|
-
if (!nodeAtFirstPosition) {
|
20
|
+
export function isImageAllowed(element, schema) {
|
21
|
+
if (!element) {
|
37
22
|
return false;
|
38
23
|
}
|
39
24
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
}
|
44
|
-
|
45
|
-
// ...or isn't the tooltip.
|
46
|
-
if (!nodeAtFirstPosition.hasAttribute(TOOLTIP_ATTRIBUTE)) {
|
47
|
-
return false;
|
48
|
-
}
|
49
|
-
|
50
|
-
// `textNode` = the position is inside the tooltip element.
|
51
|
-
// `nodeBefore` = the position is at the end of the tooltip element.
|
52
|
-
const nodeAtLastPosition = lastPosition.textNode || lastPosition.nodeBefore;
|
53
|
-
|
54
|
-
// If both references the same node selection contains a single text node.
|
55
|
-
if (nodeAtFirstPosition === nodeAtLastPosition) {
|
56
|
-
return true;
|
57
|
-
}
|
58
|
-
|
59
|
-
// If nodes are not equal, maybe the tooltip nodes has defined additional attributes inside.
|
60
|
-
// First, we need to find the entire tooltip range.
|
61
|
-
const tooltipRange = findAttributeRange(firstPosition, TOOLTIP_ATTRIBUTE, nodeAtFirstPosition.getAttribute(TOOLTIP_ATTRIBUTE), model);
|
62
|
-
|
63
|
-
// Then we can check whether selected range is inside the found tooltip range. If so, attributes should be preserved.
|
64
|
-
return tooltipRange.containsRange(model.createRange(firstPosition, lastPosition) , true);
|
65
|
-
}
|
25
|
+
return element.is('element', 'image') && schema.checkAttribute('image', TOOLTIP_ATTRIBUTE);
|
26
|
+
}
|
27
|
+
|
@@ -7,11 +7,7 @@ import { global } from 'ckeditor5/src/utils';
|
|
7
7
|
import { insertVideo } from './video/utils';
|
8
8
|
|
9
9
|
// Implements the pattern: http(s)://(www.)example.com/path/to/resource.ext?query=params&maybe=too.
|
10
|
-
const VIDEO_URL_REGEXP = new RegExp( String( /^(http(s)?:\/\/)?[\w-]+\.[\w.~:/[\]@!$&'()*+,;=%-]+/.source +
|
11
|
-
/\.(mp4|webm|ogg|ogv|avi|wmv|mkv|mpeg2|mov|MP4|WEBM|OGG|OGV|AVI|WMV|MKV|MPEG2|MOV)/.source +
|
12
|
-
/(\?[\w.~:/[\]@!$&'()*+,;=%-]*)?/.source +
|
13
|
-
/(#[\w.~:/[\]@!$&'()*+,;=%-]*)?$/.source ) );
|
14
|
-
|
10
|
+
const VIDEO_URL_REGEXP = new RegExp( String( /^(http(s)?:\/\/)?[\w-]+\.[\w.~:/[\]@!$&'()*+,;=%-]+/.source + /(\/video\?id=[0-9]+)/.source));
|
15
11
|
export default class AutoVideo extends Plugin {
|
16
12
|
static get requires() {
|
17
13
|
return [ Clipboard, Undo ];
|
@@ -28,7 +28,7 @@ export default class VideoEditing extends Plugin {
|
|
28
28
|
isObject: true,
|
29
29
|
isBlock: true,
|
30
30
|
allowWhere: '$block',
|
31
|
-
allowAttributes: [ 'src' ]
|
31
|
+
allowAttributes: [ 'src', 'controls' ]
|
32
32
|
} );
|
33
33
|
|
34
34
|
conversion.for( 'dataDowncast' ).elementToElement( {
|
@@ -41,6 +41,7 @@ export default class VideoEditing extends Plugin {
|
|
41
41
|
view: ( modelElement, { writer } ) => toVideoWidget( createVideoViewElement( writer ), writer, t( 'video widget' ) )
|
42
42
|
} );
|
43
43
|
|
44
|
+
conversion.for( 'downcast' ).add( modelToViewAttributeConverter( 'controls' ) );
|
44
45
|
conversion.for( 'downcast' ).add( modelToViewAttributeConverter( 'src' ) );
|
45
46
|
|
46
47
|
conversion.for( 'upcast' )
|
@@ -51,7 +52,9 @@ export default class VideoEditing extends Plugin {
|
|
51
52
|
src: true
|
52
53
|
}
|
53
54
|
},
|
54
|
-
model: ( viewVideo, { writer } ) => writer.createElement( 'video', {
|
55
|
+
model: ( viewVideo, { writer } ) => writer.createElement( 'video', {
|
56
|
+
src: viewVideo.getAttribute( 'src' )
|
57
|
+
} )
|
55
58
|
} )
|
56
59
|
.add( viewFigureToModel() );
|
57
60
|
|
package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoupload/browsevideodialogcommand.js
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
import { Command } from 'ckeditor5/src/core';
|
2
|
+
import { isVideoAllowed } from "../video/utils";
|
3
|
+
import * as QMSCKEditorService from '../../common/qmsCKEditorService';
|
4
|
+
import * as QMSCKEditorConstant from '../../common/qmsCKEditorConstant';
|
5
|
+
|
6
|
+
export default class BrowseVideoDialogCommand extends Command {
|
7
|
+
refresh() {
|
8
|
+
const videoElement = this.editor.model.document.selection.getSelectedElement();
|
9
|
+
const isVideo = videoElement && videoElement.name === 'video' || false;
|
10
|
+
this.isEnabled = isVideoAllowed( this.editor.model ) || isVideo;
|
11
|
+
}
|
12
|
+
|
13
|
+
execute(options) {
|
14
|
+
const editor = this.editor;
|
15
|
+
QMSCKEditorService.uploadVideoNotify({...options});
|
16
|
+
window[QMSCKEditorConstant.QMSCK_BROWSE_VIDEO_IS_PROCESSING] = false;
|
17
|
+
window.addEventListener(QMSCKEditorConstant.QMSCK_BROWSE_VIDEO_RESP, (evt) => {
|
18
|
+
if(window[QMSCKEditorConstant.QMSCK_BROWSE_VIDEO_IS_PROCESSING] || !evt.detail){
|
19
|
+
return;
|
20
|
+
}
|
21
|
+
window[QMSCKEditorConstant.QMSCK_BROWSE_VIDEO_IS_PROCESSING] = true;
|
22
|
+
editor.commands.get('uploadVideo').execute(evt.detail);
|
23
|
+
}, { once: true});
|
24
|
+
}
|
25
|
+
}
|
@@ -1,18 +1,7 @@
|
|
1
|
-
import { FileRepository } from 'ckeditor5/src/upload';
|
2
1
|
import { Command } from 'ckeditor5/src/core';
|
3
2
|
import { toArray } from 'ckeditor5/src/utils';
|
4
3
|
import { insertVideo, isVideoAllowed } from "../video/utils";
|
5
4
|
|
6
|
-
function uploadVideo( model, fileRepository, file ) {
|
7
|
-
const loader = fileRepository.createLoader( file );
|
8
|
-
|
9
|
-
if ( !loader ) {
|
10
|
-
return;
|
11
|
-
}
|
12
|
-
|
13
|
-
insertVideo( model, { uploadId: loader.id } );
|
14
|
-
}
|
15
|
-
|
16
5
|
export default class UploadVideoCommand extends Command {
|
17
6
|
refresh() {
|
18
7
|
const videoElement = this.editor.model.document.selection.getSelectedElement();
|
@@ -25,10 +14,8 @@ export default class UploadVideoCommand extends Command {
|
|
25
14
|
const editor = this.editor;
|
26
15
|
const model = editor.model;
|
27
16
|
|
28
|
-
const
|
29
|
-
|
30
|
-
|
31
|
-
uploadVideo( model, fileRepository, file );
|
32
|
-
}
|
17
|
+
for ( const url of toArray( options.urls ) ) {
|
18
|
+
insertVideo(model, { src: url , controls: true } );
|
19
|
+
}
|
33
20
|
}
|
34
21
|
}
|
@@ -5,6 +5,7 @@ import { ClipboardPipeline } from 'ckeditor5/src/clipboard';
|
|
5
5
|
import { FileRepository } from 'ckeditor5/src/upload';
|
6
6
|
import { env } from 'ckeditor5/src/utils';
|
7
7
|
import UploadVideoCommand from "./uploadvideocommand";
|
8
|
+
import BrowseVideoDialogCommand from "./browsevideodialogcommand";
|
8
9
|
import {
|
9
10
|
createVideoMediaTypeRegExp,
|
10
11
|
fetchLocalVideo,
|
@@ -49,6 +50,9 @@ export default class VideoUploadEditing extends Plugin {
|
|
49
50
|
editor.commands.add( 'uploadVideo', uploadVideoCommand );
|
50
51
|
editor.commands.add( 'videoUpload', uploadVideoCommand );
|
51
52
|
|
53
|
+
const browseVideoDialogCommand = new BrowseVideoDialogCommand( editor );
|
54
|
+
editor.commands.add( 'browseVideoDialog', browseVideoDialogCommand );
|
55
|
+
|
52
56
|
// Register upcast converter for uploadId.
|
53
57
|
conversion.for('upcast')
|
54
58
|
.attributeToAttribute({
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { Plugin } from 'ckeditor5/src/core';
|
2
|
-
import { FileDialogButtonView } from 'ckeditor5/src/upload';
|
3
2
|
import videoUploadIcon from '../theme/icons/video.svg';
|
4
|
-
import
|
3
|
+
import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
|
5
4
|
|
6
5
|
export default class VideoUploadUI extends Plugin {
|
7
6
|
init() {
|
@@ -9,34 +8,24 @@ export default class VideoUploadUI extends Plugin {
|
|
9
8
|
const t = editor.t;
|
10
9
|
|
11
10
|
const componentCreator = locale => {
|
12
|
-
const
|
13
|
-
const command = editor.commands.get('uploadVideo');
|
14
|
-
const videoTypes = editor.config.get('video.upload.types');
|
15
|
-
const videoMediaTypesRegExp = createVideoMediaTypeRegExp(videoTypes);
|
11
|
+
const command = editor.commands.get('browseVideoDialog');
|
16
12
|
|
17
|
-
|
18
|
-
|
19
|
-
allowMultipleFiles: editor.config.get('video.upload.allowMultipleFiles')
|
20
|
-
});
|
13
|
+
const allowMultipleFiles= editor.config.get('video.upload.allowMultipleFiles');
|
14
|
+
const videoTypes = editor.config.get('video.upload.types');
|
21
15
|
|
22
|
-
|
23
|
-
|
16
|
+
const buttonView = new ButtonView( locale );
|
17
|
+
buttonView.bind('isEnabled').to(command);
|
18
|
+
buttonView.set( {
|
19
|
+
label: t('Browse Video'),
|
24
20
|
icon: videoUploadIcon,
|
25
21
|
tooltip: true
|
26
|
-
});
|
27
|
-
|
28
|
-
|
29
|
-
view.buttonView.bind('isEnabled').to(command);
|
30
|
-
|
31
|
-
view.on('done', (evt, files) => {
|
32
|
-
const videosToUpload = Array.from(files).filter(file => videoMediaTypesRegExp.test(file.type));
|
22
|
+
} );
|
33
23
|
|
34
|
-
|
35
|
-
|
36
|
-
}
|
24
|
+
buttonView.on('execute', () => {
|
25
|
+
editor.execute('browseVideoDialog', { allowMultipleFiles, videoTypes });
|
37
26
|
});
|
38
27
|
|
39
|
-
return
|
28
|
+
return buttonView;
|
40
29
|
};
|
41
30
|
|
42
31
|
editor.ui.componentFactory.add( 'uploadVideo', componentCreator );
|
@@ -1,50 +1 @@
|
|
1
|
-
|
2
|
-
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3
|
-
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4
|
-
viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
|
5
|
-
<g>
|
6
|
-
<g>
|
7
|
-
<g>
|
8
|
-
<path d="M256,85.333c-23.531,0-42.667,19.135-42.667,42.667s19.135,42.667,42.667,42.667s42.667-19.135,42.667-42.667
|
9
|
-
S279.531,85.333,256,85.333z M256,149.333c-11.76,0-21.333-9.573-21.333-21.333s9.573-21.333,21.333-21.333
|
10
|
-
s21.333,9.573,21.333,21.333S267.76,149.333,256,149.333z"/>
|
11
|
-
<path d="M288,192h-85.333c-5.896,0-10.667,4.771-10.667,10.667v42.667c0,5.896,4.771,10.667,10.667,10.667h10.667v160
|
12
|
-
c0,5.896,4.771,10.667,10.667,10.667h64c5.896,0,10.667-4.771,10.667-10.667V202.667C298.667,196.771,293.896,192,288,192z
|
13
|
-
M277.333,405.333h-42.667v-160c0-5.896-4.771-10.667-10.667-10.667h-10.667v-21.333h64V405.333z"/>
|
14
|
-
<path d="M256,0C114.844,0,0,114.844,0,256s114.844,256,256,256s256-114.844,256-256S397.156,0,256,0z M256,490.667
|
15
|
-
C126.604,490.667,21.333,385.396,21.333,256S126.604,21.333,256,21.333S490.667,126.604,490.667,256S385.396,490.667,256,490.667
|
16
|
-
z"/>
|
17
|
-
</g>
|
18
|
-
</g>
|
19
|
-
</g>
|
20
|
-
<g>
|
21
|
-
</g>
|
22
|
-
<g>
|
23
|
-
</g>
|
24
|
-
<g>
|
25
|
-
</g>
|
26
|
-
<g>
|
27
|
-
</g>
|
28
|
-
<g>
|
29
|
-
</g>
|
30
|
-
<g>
|
31
|
-
</g>
|
32
|
-
<g>
|
33
|
-
</g>
|
34
|
-
<g>
|
35
|
-
</g>
|
36
|
-
<g>
|
37
|
-
</g>
|
38
|
-
<g>
|
39
|
-
</g>
|
40
|
-
<g>
|
41
|
-
</g>
|
42
|
-
<g>
|
43
|
-
</g>
|
44
|
-
<g>
|
45
|
-
</g>
|
46
|
-
<g>
|
47
|
-
</g>
|
48
|
-
<g>
|
49
|
-
</g>
|
50
|
-
</svg>
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4
|
+
viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
|
5
|
+
<g>
|
6
|
+
<g>
|
7
|
+
<path d="M0,22.261v467.478h512V22.261H0z M155.826,456.348H33.391v-77.913h122.435V456.348z M155.826,345.043H33.391V267.13
|
8
|
+
h122.435V345.043z M155.826,233.739H33.391v-77.913h122.435V233.739z M322.783,456.348H189.217v-77.913h133.565V456.348z
|
9
|
+
M322.783,345.043H189.217V267.13h133.565V345.043z M322.783,233.739H189.217v-77.913h133.565V233.739z M478.609,456.348H356.174
|
10
|
+
v-77.913h122.435V456.348z M478.609,345.043H356.174V267.13h122.435V345.043z M478.609,233.739H356.174v-77.913h122.435V233.739z
|
11
|
+
M478.609,122.435H33.391V55.652h445.217V122.435z"/>
|
12
|
+
</g>
|
13
|
+
</g>
|
14
|
+
<g>
|
15
|
+
</g>
|
16
|
+
<g>
|
17
|
+
</g>
|
18
|
+
<g>
|
19
|
+
</g>
|
20
|
+
<g>
|
21
|
+
</g>
|
22
|
+
<g>
|
23
|
+
</g>
|
24
|
+
<g>
|
25
|
+
</g>
|
26
|
+
<g>
|
27
|
+
</g>
|
28
|
+
<g>
|
29
|
+
</g>
|
30
|
+
<g>
|
31
|
+
</g>
|
32
|
+
<g>
|
33
|
+
</g>
|
34
|
+
<g>
|
35
|
+
</g>
|
36
|
+
<g>
|
37
|
+
</g>
|
38
|
+
<g>
|
39
|
+
</g>
|
40
|
+
<g>
|
41
|
+
</g>
|
42
|
+
<g>
|
43
|
+
</g>
|
44
|
+
</svg>
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"/></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><rect fill="none" height="24" width="24"/><path d="M22,5.18L10.59,16.6l-4.24-4.24l1.41-1.41l2.83,2.83l10-10L22,5.18z M12,20c-4.41,0-8-3.59-8-8s3.59-8,8-8 c1.57,0,3.04,0.46,4.28,1.25l1.45-1.45C16.1,2.67,14.13,2,12,2C6.48,2,2,6.48,2,12s4.48,10,10,10c1.73,0,3.36-0.44,4.78-1.22 l-1.5-1.5C14.28,19.74,13.17,20,12,20z M19,15h-3v2h3v3h2v-3h3v-2h-3v-3h-2V15z"/></svg>
|
@@ -0,0 +1,54 @@
|
|
1
|
+
/*https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.css*/
|
2
|
+
|
3
|
+
.h6, .h5, .h4, .h3, .h2, .h1 {
|
4
|
+
font-weight: 500;
|
5
|
+
line-height: 1.2;
|
6
|
+
}
|
7
|
+
|
8
|
+
.h1 {
|
9
|
+
font-size: calc(1.375rem + 1.5vw);
|
10
|
+
}
|
11
|
+
|
12
|
+
@media (min-width: 1200px) {
|
13
|
+
.h1 {
|
14
|
+
font-size: 2.5rem;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
.h2 {
|
19
|
+
font-size: calc(1.325rem + 0.9vw);
|
20
|
+
}
|
21
|
+
|
22
|
+
@media (min-width: 1200px) {
|
23
|
+
.h2 {
|
24
|
+
font-size: 2rem;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
.h3 {
|
29
|
+
font-size: calc(1.3rem + 0.6vw);
|
30
|
+
}
|
31
|
+
|
32
|
+
@media (min-width: 1200px) {
|
33
|
+
.h3 {
|
34
|
+
font-size: 1.75rem;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
.h4 {
|
39
|
+
font-size: calc(1.275rem + 0.3vw);
|
40
|
+
}
|
41
|
+
|
42
|
+
@media (min-width: 1200px) {
|
43
|
+
.h4 {
|
44
|
+
font-size: 1.5rem;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
.h5 {
|
49
|
+
font-size: 1.25rem;
|
50
|
+
}
|
51
|
+
|
52
|
+
.h6 {
|
53
|
+
font-size: 1rem;
|
54
|
+
}
|
@@ -1,58 +1,24 @@
|
|
1
|
-
.
|
2
|
-
cursor: help !important;
|
3
|
-
font-style: italic;
|
1
|
+
.qms-tooltip {
|
4
2
|
position: relative;
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
visibility: hidden;
|
11
|
-
font-size: .9em;
|
12
|
-
line-height: 1.5;
|
13
|
-
color: var(--ck-color-base-text);
|
14
|
-
padding: var(--ck-spacing-small) var(--ck-spacing-medium);
|
15
|
-
background: var(--ck-color-base-background);
|
16
|
-
border-radius: var(--ck-color-base-border);
|
17
|
-
position: absolute;
|
18
|
-
z-index: 1;
|
19
|
-
top: 150%;
|
20
|
-
}
|
21
|
-
|
22
|
-
.np-tooltip .np-tooltip__content::after {
|
23
|
-
content: "";
|
24
|
-
position: absolute;
|
25
|
-
bottom: 100%;
|
26
|
-
left: 50%;
|
27
|
-
transform: rotateX(180deg);
|
28
|
-
margin-left: -5px;
|
29
|
-
border-width: 5px;
|
30
|
-
border-style: solid;
|
31
|
-
border-color: var(--ck-color-base-background) transparent transparent transparent;
|
32
|
-
}
|
33
|
-
|
34
|
-
.np-tooltip:hover .np-tooltip__content {
|
35
|
-
visibility: visible;
|
3
|
+
font-style: italic;
|
4
|
+
text-decoration: underline dotted;
|
5
|
+
cursor: help;
|
6
|
+
-webkit-text-decoration-skip-ink: none;
|
7
|
+
text-decoration-skip-ink: none;
|
36
8
|
}
|
37
9
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
content: attr(data-tooltip);
|
42
|
-
min-width: 54px;
|
10
|
+
.qms-tooltip:hover:before {
|
11
|
+
content: attr(data-qmstooltip);
|
12
|
+
width: auto;
|
43
13
|
color: var(--ck-color-base-text);
|
44
14
|
padding: var(--ck-spacing-small) var(--ck-spacing-medium);
|
45
15
|
background: var(--ck-color-base-background);
|
46
16
|
border-radius: var(--ck-color-base-border);
|
47
17
|
position: absolute;
|
48
|
-
z-index: 1;
|
49
18
|
top: 100%;
|
50
|
-
visibility: hidden;
|
51
|
-
opacity: 0;
|
52
|
-
transition: opacity 0.3s;
|
53
19
|
}
|
54
20
|
|
55
|
-
.
|
21
|
+
.qms-tooltip:hover:after {
|
56
22
|
position: absolute;
|
57
23
|
content: "";
|
58
24
|
top: 60%;
|
@@ -62,13 +28,5 @@
|
|
62
28
|
border-width: 5px;
|
63
29
|
border-style: solid;
|
64
30
|
border-color: var(--ck-color-base-background) transparent transparent transparent;
|
65
|
-
visibility: hidden;
|
66
|
-
opacity: 0;
|
67
|
-
transition: opacity 0.3s;
|
68
|
-
}
|
69
|
-
|
70
|
-
.np-tooltip:hover:before,
|
71
|
-
.np-tooltip:hover:after{
|
72
|
-
visibility: visible;
|
73
|
-
opacity: 1;
|
74
31
|
}
|
32
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
@import '../../styles/style.scss';
|
2
|
+
.qmsckeditor__about__container {
|
3
|
+
.qmsckeditor__about__logo__container {
|
4
|
+
display: flex;
|
5
|
+
justify-content: center;
|
6
|
+
margin-bottom: 10px;
|
7
|
+
}
|
8
|
+
|
9
|
+
.qmsckeditor__about__logo {
|
10
|
+
height: 64px
|
11
|
+
}
|
12
|
+
|
13
|
+
.qmsckeditor__about__button {
|
14
|
+
float: right;
|
15
|
+
}
|
16
|
+
}
|