biso24-editor 1.3.0 → 1.3.1
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/CKEditor4/CHANGES.md +2182 -2182
- package/CKEditor4/LICENSE.md +1436 -1436
- package/CKEditor4/README.md +39 -39
- package/CKEditor4/SECURITY.md +10 -10
- package/CKEditor4/adapters/jquery.js +158 -158
- package/CKEditor4/bender-runner.config.json +16 -16
- package/CKEditor4/build-config.js +100 -100
- package/CKEditor4/ckeditor.js +30065 -30065
- package/CKEditor4/config.js +39 -39
- package/CKEditor4/contents.css +161 -161
- package/CKEditor4/lang/vi.js +475 -475
- package/CKEditor4/plugins/a11yhelp/dialogs/a11yhelp.js +143 -143
- package/CKEditor4/plugins/a11yhelp/dialogs/lang/vi.js +122 -122
- package/CKEditor4/plugins/custompaste/plugin.js +57 -57
- package/CKEditor4/plugins/dialog/dialogDefinition.js +4 -4
- package/CKEditor4/plugins/dialog/styles/dialog.css +18 -18
- package/CKEditor4/plugins/font/lang/vi.js +14 -14
- package/CKEditor4/plugins/font/plugin.js +535 -535
- package/CKEditor4/plugins/image2/dialogs/image2.js +558 -558
- package/CKEditor4/plugins/image2/lang/vi.js +21 -21
- package/CKEditor4/plugins/image2/plugin.js +1715 -1708
- package/CKEditor4/plugins/justify/plugin.js +266 -266
- package/CKEditor4/plugins/justify_group/plugin.js +64 -64
- package/CKEditor4/plugins/lineheight/LICENSE +22 -22
- package/CKEditor4/plugins/lineheight/README.md +2 -2
- package/CKEditor4/plugins/lineheight/lang/vi.js +3 -3
- package/CKEditor4/plugins/lineheight/plugin.js +99 -99
- package/CKEditor4/plugins/lineheight/readme.txt +30 -30
- package/CKEditor4/plugins/link/dialogs/anchor.js +82 -82
- package/CKEditor4/plugins/link/dialogs/link.js +777 -777
- package/CKEditor4/plugins/menubutton/plugin.js +99 -99
- package/CKEditor4/plugins/pastefromword/filter/default.js +849 -849
- package/CKEditor4/plugins/pastetools/filter/common.js +445 -445
- package/CKEditor4/plugins/pastetools/filter/image.js +163 -163
- package/CKEditor4/plugins/pdffile/plugin.js +36 -36
- package/CKEditor4/plugins/placeholder_button/plugin.js +31 -31
- package/CKEditor4/plugins/sourcedialog/dialogs/sourcedialog.js +88 -88
- package/CKEditor4/plugins/sourcedialog/lang/vi.js +9 -9
- package/CKEditor4/plugins/sourcedialog/plugin.js +30 -30
- package/CKEditor4/plugins/wordfile/plugin.js +161 -161
- package/CKEditor4/skins/moono-lisa/dialog.css +685 -685
- package/CKEditor4/skins/moono-lisa/dialog_ie.css +721 -721
- package/CKEditor4/skins/moono-lisa/dialog_ie8.css +746 -746
- package/CKEditor4/skins/moono-lisa/dialog_iequirks.css +724 -724
- package/CKEditor4/skins/moono-lisa/editor.css +1551 -1551
- package/CKEditor4/skins/moono-lisa/editor_gecko.css +1556 -1556
- package/CKEditor4/skins/moono-lisa/editor_ie.css +1588 -1588
- package/CKEditor4/skins/moono-lisa/editor_ie8.css +1639 -1639
- package/CKEditor4/skins/moono-lisa/editor_iequirks.css +1632 -1632
- package/CKEditor4/skins/moono-lisa/readme.md +46 -46
- package/CKEditor4/styles.js +136 -136
- package/CKEditor4/vendor/promise.js +385 -385
- package/package.json +1 -1
|
@@ -1,163 +1,163 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
(function () {
|
|
6
|
-
function u(a, c, b) {
|
|
7
|
-
c = l(c);
|
|
8
|
-
var e, d;
|
|
9
|
-
if (0 === c.length) return a;
|
|
10
|
-
e = CKEDITOR.tools.array.map(
|
|
11
|
-
c,
|
|
12
|
-
function (a) {
|
|
13
|
-
return h(a);
|
|
14
|
-
},
|
|
15
|
-
this,
|
|
16
|
-
);
|
|
17
|
-
if (b.length !== e.length)
|
|
18
|
-
return CKEDITOR.error('pastetools-failed-image-extraction', { rtf: c.length, html: b.length }), a;
|
|
19
|
-
for (d = 0; d < b.length; d++)
|
|
20
|
-
if (0 === b[d].indexOf('file://'))
|
|
21
|
-
if (e[d]) {
|
|
22
|
-
var k = b[d].replace(/\\/g, '\\\\');
|
|
23
|
-
a = a.replace(new RegExp('(\x3cimg [^\x3e]*src\x3d["\']?)' + k), '$1' + e[d]);
|
|
24
|
-
} else CKEDITOR.error('pastetools-unsupported-image', { type: c[d].type, index: d });
|
|
25
|
-
return a;
|
|
26
|
-
}
|
|
27
|
-
function v(a, c, b) {
|
|
28
|
-
var e = CKEDITOR.tools.array.unique(
|
|
29
|
-
CKEDITOR.tools.array.filter(b, function (a) {
|
|
30
|
-
return a.match(/^blob:/i);
|
|
31
|
-
}),
|
|
32
|
-
);
|
|
33
|
-
b = CKEDITOR.tools.array.map(e, m);
|
|
34
|
-
CKEDITOR.tools.promise.all(b).then(function (b) {
|
|
35
|
-
CKEDITOR.tools.array.forEach(b, function (b, c) {
|
|
36
|
-
if (b) {
|
|
37
|
-
var d = e[c],
|
|
38
|
-
d = a
|
|
39
|
-
.editable()
|
|
40
|
-
.find('img[src\x3d"' + d + '"]')
|
|
41
|
-
.toArray();
|
|
42
|
-
CKEDITOR.tools.array.forEach(
|
|
43
|
-
d,
|
|
44
|
-
function (a) {
|
|
45
|
-
a.setAttribute('src', b);
|
|
46
|
-
a.setAttribute('data-cke-saved-src', b);
|
|
47
|
-
},
|
|
48
|
-
this,
|
|
49
|
-
);
|
|
50
|
-
} else CKEDITOR.error('pastetools-unsupported-image', { type: 'blob', index: c });
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
return c;
|
|
54
|
-
}
|
|
55
|
-
function l(a) {
|
|
56
|
-
function c(a) {
|
|
57
|
-
return 'string' !== typeof a
|
|
58
|
-
? -1
|
|
59
|
-
: CKEDITOR.tools.array.indexOf(d, function (b) {
|
|
60
|
-
return b.id === a;
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
function b(a) {
|
|
64
|
-
var b = a.match(/\\blipuid (\w+)\}/);
|
|
65
|
-
a = a.match(/\\bliptag(-?\d+)/);
|
|
66
|
-
return b ? b[1] : a ? a[1] : null;
|
|
67
|
-
}
|
|
68
|
-
var e = CKEDITOR.plugins.pastetools.filters.common.rtf,
|
|
69
|
-
d = [];
|
|
70
|
-
a = e.removeGroups(a, '(?:(?:header|footer)[lrf]?|nonshppict|shprslt)');
|
|
71
|
-
a = e.getGroups(a, 'pict');
|
|
72
|
-
if (!a) return d;
|
|
73
|
-
for (var k = 0; k < a.length; k++) {
|
|
74
|
-
var f = a[k].content,
|
|
75
|
-
h = b(f),
|
|
76
|
-
n = t(f),
|
|
77
|
-
g = c(h),
|
|
78
|
-
p = -1 !== g && d[g].hex,
|
|
79
|
-
l = p && d[g].type === n,
|
|
80
|
-
p = p && d[g].type !== n && g === d.length - 1,
|
|
81
|
-
m = -1 !== f.indexOf('\\defshp'),
|
|
82
|
-
q = -1 !== CKEDITOR.tools.array.indexOf(CKEDITOR.pasteFilters.image.supportedImageTypes, n),
|
|
83
|
-
r = -1 !== CKEDITOR.tools.indexOf(f, 'fHorizRule');
|
|
84
|
-
l
|
|
85
|
-
? d.push(d[g])
|
|
86
|
-
: p ||
|
|
87
|
-
m ||
|
|
88
|
-
r ||
|
|
89
|
-
((f = { id: h, hex: q ? e.extractGroupContent(f).replace(/\s/g, '') : null, type: n }),
|
|
90
|
-
-1 !== g ? d.splice(g, 1, f) : d.push(f));
|
|
91
|
-
}
|
|
92
|
-
return d;
|
|
93
|
-
}
|
|
94
|
-
function q(a) {
|
|
95
|
-
for (var c = /<img[^>]+src="([^"]+)[^>]+/g, b = [], e; (e = c.exec(a)); ) b.push(e[1]);
|
|
96
|
-
return b;
|
|
97
|
-
}
|
|
98
|
-
function t(a) {
|
|
99
|
-
var c = CKEDITOR.tools.array.find(CKEDITOR.pasteFilters.image.recognizableImageTypes, function (b) {
|
|
100
|
-
return b.marker.test(a);
|
|
101
|
-
});
|
|
102
|
-
return c ? c.type : 'unknown';
|
|
103
|
-
}
|
|
104
|
-
function h(a) {
|
|
105
|
-
var c = -1 !== CKEDITOR.tools.array.indexOf(CKEDITOR.pasteFilters.image.supportedImageTypes, a.type),
|
|
106
|
-
b = a.hex;
|
|
107
|
-
if (!c) return null;
|
|
108
|
-
'string' === typeof b && (b = CKEDITOR.tools.convertHexStringToBytes(a.hex));
|
|
109
|
-
return a.type ? 'data:' + a.type + ';base64,' + CKEDITOR.tools.convertBytesToBase64(b) : null;
|
|
110
|
-
}
|
|
111
|
-
function m(a) {
|
|
112
|
-
return new CKEDITOR.tools.promise(function (c) {
|
|
113
|
-
CKEDITOR.ajax.load(
|
|
114
|
-
a,
|
|
115
|
-
function (a) {
|
|
116
|
-
a = new Uint8Array(a);
|
|
117
|
-
var e = r(a);
|
|
118
|
-
a = h({ type: e, hex: a });
|
|
119
|
-
c(a);
|
|
120
|
-
},
|
|
121
|
-
'arraybuffer',
|
|
122
|
-
);
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
function r(a) {
|
|
126
|
-
a = a.subarray(0, 4);
|
|
127
|
-
var c = CKEDITOR.tools.array
|
|
128
|
-
.map(a, function (a) {
|
|
129
|
-
return a.toString(16);
|
|
130
|
-
})
|
|
131
|
-
.join('');
|
|
132
|
-
return (a = CKEDITOR.tools.array.find(CKEDITOR.pasteFilters.image.recognizableImageSignatures, function (a) {
|
|
133
|
-
return 0 === c.indexOf(a.signature);
|
|
134
|
-
}))
|
|
135
|
-
? a.type
|
|
136
|
-
: null;
|
|
137
|
-
}
|
|
138
|
-
CKEDITOR.pasteFilters.image = function (a, c, b) {
|
|
139
|
-
if (c.activeFilter && !c.activeFilter.check('img[src]')) return a;
|
|
140
|
-
e = q(a);
|
|
141
|
-
return 0 === e.length ? a : b ? u(a, b, e) : v(c, a, e);
|
|
142
|
-
};
|
|
143
|
-
CKEDITOR.pasteFilters.image.format = u;
|
|
144
|
-
CKEDITOR.pasteFilters.image.formatBlob = v;
|
|
145
|
-
CKEDITOR.pasteFilters.image.extractFromRtf = l;
|
|
146
|
-
CKEDITOR.pasteFilters.image.extractTagsFromHtml = q;
|
|
147
|
-
CKEDITOR.pasteFilters.image.getImageType = t;
|
|
148
|
-
CKEDITOR.pasteFilters.image.createSrcWithBase64 = h;
|
|
149
|
-
CKEDITOR.pasteFilters.image.convertBlobUrlToBase64 = m;
|
|
150
|
-
CKEDITOR.pasteFilters.image.getImageTypeFromSignature = r;
|
|
151
|
-
CKEDITOR.pasteFilters.image.supportedImageTypes = ['image/png', 'image/jpeg', 'image/gif'];
|
|
152
|
-
CKEDITOR.pasteFilters.image.recognizableImageTypes = [
|
|
153
|
-
{ marker: /\\pngblip/, type: 'image/png' },
|
|
154
|
-
{ marker: /\\jpegblip/, type: 'image/jpeg' },
|
|
155
|
-
{ marker: /\\emfblip/, type: 'image/emf' },
|
|
156
|
-
{ marker: /\\wmetafile\d/, type: 'image/wmf' },
|
|
157
|
-
];
|
|
158
|
-
CKEDITOR.pasteFilters.image.recognizableImageSignatures = [
|
|
159
|
-
{ signature: 'ffd8ff', type: 'image/jpeg' },
|
|
160
|
-
{ signature: '47494638', type: 'image/gif' },
|
|
161
|
-
{ signature: '89504e47', type: 'image/png' },
|
|
162
|
-
];
|
|
163
|
-
})();
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
(function () {
|
|
6
|
+
function u(a, c, b) {
|
|
7
|
+
c = l(c);
|
|
8
|
+
var e, d;
|
|
9
|
+
if (0 === c.length) return a;
|
|
10
|
+
e = CKEDITOR.tools.array.map(
|
|
11
|
+
c,
|
|
12
|
+
function (a) {
|
|
13
|
+
return h(a);
|
|
14
|
+
},
|
|
15
|
+
this,
|
|
16
|
+
);
|
|
17
|
+
if (b.length !== e.length)
|
|
18
|
+
return CKEDITOR.error('pastetools-failed-image-extraction', { rtf: c.length, html: b.length }), a;
|
|
19
|
+
for (d = 0; d < b.length; d++)
|
|
20
|
+
if (0 === b[d].indexOf('file://'))
|
|
21
|
+
if (e[d]) {
|
|
22
|
+
var k = b[d].replace(/\\/g, '\\\\');
|
|
23
|
+
a = a.replace(new RegExp('(\x3cimg [^\x3e]*src\x3d["\']?)' + k), '$1' + e[d]);
|
|
24
|
+
} else CKEDITOR.error('pastetools-unsupported-image', { type: c[d].type, index: d });
|
|
25
|
+
return a;
|
|
26
|
+
}
|
|
27
|
+
function v(a, c, b) {
|
|
28
|
+
var e = CKEDITOR.tools.array.unique(
|
|
29
|
+
CKEDITOR.tools.array.filter(b, function (a) {
|
|
30
|
+
return a.match(/^blob:/i);
|
|
31
|
+
}),
|
|
32
|
+
);
|
|
33
|
+
b = CKEDITOR.tools.array.map(e, m);
|
|
34
|
+
CKEDITOR.tools.promise.all(b).then(function (b) {
|
|
35
|
+
CKEDITOR.tools.array.forEach(b, function (b, c) {
|
|
36
|
+
if (b) {
|
|
37
|
+
var d = e[c],
|
|
38
|
+
d = a
|
|
39
|
+
.editable()
|
|
40
|
+
.find('img[src\x3d"' + d + '"]')
|
|
41
|
+
.toArray();
|
|
42
|
+
CKEDITOR.tools.array.forEach(
|
|
43
|
+
d,
|
|
44
|
+
function (a) {
|
|
45
|
+
a.setAttribute('src', b);
|
|
46
|
+
a.setAttribute('data-cke-saved-src', b);
|
|
47
|
+
},
|
|
48
|
+
this,
|
|
49
|
+
);
|
|
50
|
+
} else CKEDITOR.error('pastetools-unsupported-image', { type: 'blob', index: c });
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
return c;
|
|
54
|
+
}
|
|
55
|
+
function l(a) {
|
|
56
|
+
function c(a) {
|
|
57
|
+
return 'string' !== typeof a
|
|
58
|
+
? -1
|
|
59
|
+
: CKEDITOR.tools.array.indexOf(d, function (b) {
|
|
60
|
+
return b.id === a;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function b(a) {
|
|
64
|
+
var b = a.match(/\\blipuid (\w+)\}/);
|
|
65
|
+
a = a.match(/\\bliptag(-?\d+)/);
|
|
66
|
+
return b ? b[1] : a ? a[1] : null;
|
|
67
|
+
}
|
|
68
|
+
var e = CKEDITOR.plugins.pastetools.filters.common.rtf,
|
|
69
|
+
d = [];
|
|
70
|
+
a = e.removeGroups(a, '(?:(?:header|footer)[lrf]?|nonshppict|shprslt)');
|
|
71
|
+
a = e.getGroups(a, 'pict');
|
|
72
|
+
if (!a) return d;
|
|
73
|
+
for (var k = 0; k < a.length; k++) {
|
|
74
|
+
var f = a[k].content,
|
|
75
|
+
h = b(f),
|
|
76
|
+
n = t(f),
|
|
77
|
+
g = c(h),
|
|
78
|
+
p = -1 !== g && d[g].hex,
|
|
79
|
+
l = p && d[g].type === n,
|
|
80
|
+
p = p && d[g].type !== n && g === d.length - 1,
|
|
81
|
+
m = -1 !== f.indexOf('\\defshp'),
|
|
82
|
+
q = -1 !== CKEDITOR.tools.array.indexOf(CKEDITOR.pasteFilters.image.supportedImageTypes, n),
|
|
83
|
+
r = -1 !== CKEDITOR.tools.indexOf(f, 'fHorizRule');
|
|
84
|
+
l
|
|
85
|
+
? d.push(d[g])
|
|
86
|
+
: p ||
|
|
87
|
+
m ||
|
|
88
|
+
r ||
|
|
89
|
+
((f = { id: h, hex: q ? e.extractGroupContent(f).replace(/\s/g, '') : null, type: n }),
|
|
90
|
+
-1 !== g ? d.splice(g, 1, f) : d.push(f));
|
|
91
|
+
}
|
|
92
|
+
return d;
|
|
93
|
+
}
|
|
94
|
+
function q(a) {
|
|
95
|
+
for (var c = /<img[^>]+src="([^"]+)[^>]+/g, b = [], e; (e = c.exec(a)); ) b.push(e[1]);
|
|
96
|
+
return b;
|
|
97
|
+
}
|
|
98
|
+
function t(a) {
|
|
99
|
+
var c = CKEDITOR.tools.array.find(CKEDITOR.pasteFilters.image.recognizableImageTypes, function (b) {
|
|
100
|
+
return b.marker.test(a);
|
|
101
|
+
});
|
|
102
|
+
return c ? c.type : 'unknown';
|
|
103
|
+
}
|
|
104
|
+
function h(a) {
|
|
105
|
+
var c = -1 !== CKEDITOR.tools.array.indexOf(CKEDITOR.pasteFilters.image.supportedImageTypes, a.type),
|
|
106
|
+
b = a.hex;
|
|
107
|
+
if (!c) return null;
|
|
108
|
+
'string' === typeof b && (b = CKEDITOR.tools.convertHexStringToBytes(a.hex));
|
|
109
|
+
return a.type ? 'data:' + a.type + ';base64,' + CKEDITOR.tools.convertBytesToBase64(b) : null;
|
|
110
|
+
}
|
|
111
|
+
function m(a) {
|
|
112
|
+
return new CKEDITOR.tools.promise(function (c) {
|
|
113
|
+
CKEDITOR.ajax.load(
|
|
114
|
+
a,
|
|
115
|
+
function (a) {
|
|
116
|
+
a = new Uint8Array(a);
|
|
117
|
+
var e = r(a);
|
|
118
|
+
a = h({ type: e, hex: a });
|
|
119
|
+
c(a);
|
|
120
|
+
},
|
|
121
|
+
'arraybuffer',
|
|
122
|
+
);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function r(a) {
|
|
126
|
+
a = a.subarray(0, 4);
|
|
127
|
+
var c = CKEDITOR.tools.array
|
|
128
|
+
.map(a, function (a) {
|
|
129
|
+
return a.toString(16);
|
|
130
|
+
})
|
|
131
|
+
.join('');
|
|
132
|
+
return (a = CKEDITOR.tools.array.find(CKEDITOR.pasteFilters.image.recognizableImageSignatures, function (a) {
|
|
133
|
+
return 0 === c.indexOf(a.signature);
|
|
134
|
+
}))
|
|
135
|
+
? a.type
|
|
136
|
+
: null;
|
|
137
|
+
}
|
|
138
|
+
CKEDITOR.pasteFilters.image = function (a, c, b) {
|
|
139
|
+
if (c.activeFilter && !c.activeFilter.check('img[src]')) return a;
|
|
140
|
+
e = q(a);
|
|
141
|
+
return 0 === e.length ? a : b ? u(a, b, e) : v(c, a, e);
|
|
142
|
+
};
|
|
143
|
+
CKEDITOR.pasteFilters.image.format = u;
|
|
144
|
+
CKEDITOR.pasteFilters.image.formatBlob = v;
|
|
145
|
+
CKEDITOR.pasteFilters.image.extractFromRtf = l;
|
|
146
|
+
CKEDITOR.pasteFilters.image.extractTagsFromHtml = q;
|
|
147
|
+
CKEDITOR.pasteFilters.image.getImageType = t;
|
|
148
|
+
CKEDITOR.pasteFilters.image.createSrcWithBase64 = h;
|
|
149
|
+
CKEDITOR.pasteFilters.image.convertBlobUrlToBase64 = m;
|
|
150
|
+
CKEDITOR.pasteFilters.image.getImageTypeFromSignature = r;
|
|
151
|
+
CKEDITOR.pasteFilters.image.supportedImageTypes = ['image/png', 'image/jpeg', 'image/gif'];
|
|
152
|
+
CKEDITOR.pasteFilters.image.recognizableImageTypes = [
|
|
153
|
+
{ marker: /\\pngblip/, type: 'image/png' },
|
|
154
|
+
{ marker: /\\jpegblip/, type: 'image/jpeg' },
|
|
155
|
+
{ marker: /\\emfblip/, type: 'image/emf' },
|
|
156
|
+
{ marker: /\\wmetafile\d/, type: 'image/wmf' },
|
|
157
|
+
];
|
|
158
|
+
CKEDITOR.pasteFilters.image.recognizableImageSignatures = [
|
|
159
|
+
{ signature: 'ffd8ff', type: 'image/jpeg' },
|
|
160
|
+
{ signature: '47494638', type: 'image/gif' },
|
|
161
|
+
{ signature: '89504e47', type: 'image/png' },
|
|
162
|
+
];
|
|
163
|
+
})();
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A plugin to enable placeholder tokens to be inserted into the CKEditor message. Use on its own or with teh placeholder plugin.
|
|
3
|
-
* The default format is compatible with the placeholders syntex
|
|
4
|
-
*
|
|
5
|
-
* @version 0.1
|
|
6
|
-
* @Author Troy Lutton
|
|
7
|
-
* @license MIT
|
|
8
|
-
*
|
|
9
|
-
* This is a pure modification for the placeholders plugin. All credit goes to Stuart Sillitoe for creating the original (stuartsillitoe.co.uk)
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
CKEDITOR.plugins.add('pdffile', {
|
|
14
|
-
icons: 'exporttopdf',
|
|
15
|
-
hidpi: true,
|
|
16
|
-
init: function (editor) {
|
|
17
|
-
// add the menu to the editor
|
|
18
|
-
|
|
19
|
-
editor.addCommand('exporttopdf', {
|
|
20
|
-
exec: function (editor) {
|
|
21
|
-
const html2pdf = editor.getCommand('html2pdf');
|
|
22
|
-
html2pdf
|
|
23
|
-
.Worker()
|
|
24
|
-
.from(editor.document.$.documentElement.outerHTML || '')
|
|
25
|
-
.save();
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
editor.ui.addButton('exporttopdf', {
|
|
30
|
-
label: 'Xuất tệp PDF',
|
|
31
|
-
command: 'exporttopdf',
|
|
32
|
-
className: 'pdffile',
|
|
33
|
-
toolbar: 'others',
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
});
|
|
1
|
+
/**
|
|
2
|
+
* A plugin to enable placeholder tokens to be inserted into the CKEditor message. Use on its own or with teh placeholder plugin.
|
|
3
|
+
* The default format is compatible with the placeholders syntex
|
|
4
|
+
*
|
|
5
|
+
* @version 0.1
|
|
6
|
+
* @Author Troy Lutton
|
|
7
|
+
* @license MIT
|
|
8
|
+
*
|
|
9
|
+
* This is a pure modification for the placeholders plugin. All credit goes to Stuart Sillitoe for creating the original (stuartsillitoe.co.uk)
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
CKEDITOR.plugins.add('pdffile', {
|
|
14
|
+
icons: 'exporttopdf',
|
|
15
|
+
hidpi: true,
|
|
16
|
+
init: function (editor) {
|
|
17
|
+
// add the menu to the editor
|
|
18
|
+
|
|
19
|
+
editor.addCommand('exporttopdf', {
|
|
20
|
+
exec: function (editor) {
|
|
21
|
+
const html2pdf = editor.getCommand('html2pdf');
|
|
22
|
+
html2pdf
|
|
23
|
+
.Worker()
|
|
24
|
+
.from(editor.document.$.documentElement.outerHTML || '')
|
|
25
|
+
.save();
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
editor.ui.addButton('exporttopdf', {
|
|
30
|
+
label: 'Xuất tệp PDF',
|
|
31
|
+
command: 'exporttopdf',
|
|
32
|
+
className: 'pdffile',
|
|
33
|
+
toolbar: 'others',
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
});
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A plugin to enable placeholder tokens to be inserted into the CKEditor message. Use on its own or with teh placeholder plugin.
|
|
3
|
-
* The default format is compatible with the placeholders syntex
|
|
4
|
-
*
|
|
5
|
-
* @version 0.1
|
|
6
|
-
* @Author Troy Lutton
|
|
7
|
-
* @license MIT
|
|
8
|
-
*
|
|
9
|
-
* This is a pure modification for the placeholders plugin. All credit goes to Stuart Sillitoe for creating the original (stuartsillitoe.co.uk)
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
CKEDITOR.plugins.add('placeholder_button', {
|
|
14
|
-
init: function (editor) {
|
|
15
|
-
// add the menu to the editor
|
|
16
|
-
|
|
17
|
-
editor.addCommand('placeholder_button', {
|
|
18
|
-
exec: function (editor) {
|
|
19
|
-
const openkeywordmodal = editor.getCommand('openkeywordmodal');
|
|
20
|
-
openkeywordmodal.handleOpen();
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
editor.ui.addButton('placeholder_button', {
|
|
25
|
-
label: 'Từ khóa',
|
|
26
|
-
command: 'placeholder_button',
|
|
27
|
-
className: 'placeholder_button',
|
|
28
|
-
toolbar: 'placeholder',
|
|
29
|
-
});
|
|
30
|
-
},
|
|
31
|
-
});
|
|
1
|
+
/**
|
|
2
|
+
* A plugin to enable placeholder tokens to be inserted into the CKEditor message. Use on its own or with teh placeholder plugin.
|
|
3
|
+
* The default format is compatible with the placeholders syntex
|
|
4
|
+
*
|
|
5
|
+
* @version 0.1
|
|
6
|
+
* @Author Troy Lutton
|
|
7
|
+
* @license MIT
|
|
8
|
+
*
|
|
9
|
+
* This is a pure modification for the placeholders plugin. All credit goes to Stuart Sillitoe for creating the original (stuartsillitoe.co.uk)
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
CKEDITOR.plugins.add('placeholder_button', {
|
|
14
|
+
init: function (editor) {
|
|
15
|
+
// add the menu to the editor
|
|
16
|
+
|
|
17
|
+
editor.addCommand('placeholder_button', {
|
|
18
|
+
exec: function (editor) {
|
|
19
|
+
const openkeywordmodal = editor.getCommand('openkeywordmodal');
|
|
20
|
+
openkeywordmodal.handleOpen();
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
editor.ui.addButton('placeholder_button', {
|
|
25
|
+
label: 'Từ khóa',
|
|
26
|
+
command: 'placeholder_button',
|
|
27
|
+
className: 'placeholder_button',
|
|
28
|
+
toolbar: 'placeholder',
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
});
|
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
4
|
-
* CKEditor 4 LTS ("Long Term Support") is available under the terms of the Extended Support Model.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
CKEDITOR.dialog.add('sourcedialog', function (editor) {
|
|
8
|
-
var size = CKEDITOR.document.getWindow().getViewPaneSize();
|
|
9
|
-
|
|
10
|
-
// Make it maximum 800px wide, but still fully visible in the viewport.
|
|
11
|
-
var width = Math.min(size.width - 70, 800);
|
|
12
|
-
|
|
13
|
-
// Make it use 2/3 of the viewport height.
|
|
14
|
-
var height = size.height / 1.5;
|
|
15
|
-
|
|
16
|
-
// Store old editor data to avoid unnecessary setData.
|
|
17
|
-
var oldData;
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
title: editor.lang.sourcedialog.title,
|
|
21
|
-
minWidth: 100,
|
|
22
|
-
minHeight: 100,
|
|
23
|
-
|
|
24
|
-
onShow: function () {
|
|
25
|
-
this.setValueOf('main', 'data', (oldData = editor.getData()));
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
onOk: (function () {
|
|
29
|
-
function setData(dialog, newData) {
|
|
30
|
-
// [IE8] Focus editor before setting selection to avoid setting data on
|
|
31
|
-
// locked selection, because in case of inline editor, it won't be
|
|
32
|
-
// unlocked before editable's HTML is altered. (https://dev.ckeditor.com/ticket/11585)
|
|
33
|
-
editor.focus();
|
|
34
|
-
editor.setData(newData, function () {
|
|
35
|
-
dialog.hide();
|
|
36
|
-
|
|
37
|
-
// Ensure correct selection.
|
|
38
|
-
var range = editor.createRange();
|
|
39
|
-
range.moveToElementEditStart(editor.editable());
|
|
40
|
-
range.select();
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return function () {
|
|
45
|
-
// Remove CR from input data for reliable comparison with editor data.
|
|
46
|
-
var newData = this.getValueOf('main', 'data').replace(/\r/g, ''),
|
|
47
|
-
that = this;
|
|
48
|
-
|
|
49
|
-
// Avoid unnecessary setData. Also preserve selection
|
|
50
|
-
// when user changed his mind and goes back to wysiwyg editing.
|
|
51
|
-
if (newData === oldData) return true;
|
|
52
|
-
|
|
53
|
-
setTimeout(function () {
|
|
54
|
-
setData(that, newData);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
// Don't let the dialog close before setData is over, to hide
|
|
58
|
-
// from user blinking caused by selection restoring and setting new data.
|
|
59
|
-
return false;
|
|
60
|
-
};
|
|
61
|
-
})(),
|
|
62
|
-
|
|
63
|
-
contents: [
|
|
64
|
-
{
|
|
65
|
-
id: 'main',
|
|
66
|
-
label: editor.lang.sourcedialog.title,
|
|
67
|
-
elements: [
|
|
68
|
-
{
|
|
69
|
-
type: 'textarea',
|
|
70
|
-
id: 'data',
|
|
71
|
-
dir: 'ltr',
|
|
72
|
-
inputStyle:
|
|
73
|
-
'cursor:auto;' +
|
|
74
|
-
'width:' +
|
|
75
|
-
width +
|
|
76
|
-
'px;' +
|
|
77
|
-
'height:' +
|
|
78
|
-
height +
|
|
79
|
-
'px;' +
|
|
80
|
-
'tab-size:4;' +
|
|
81
|
-
'text-align:left;',
|
|
82
|
-
class: 'cke_source',
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
};
|
|
88
|
-
});
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
4
|
+
* CKEditor 4 LTS ("Long Term Support") is available under the terms of the Extended Support Model.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
CKEDITOR.dialog.add('sourcedialog', function (editor) {
|
|
8
|
+
var size = CKEDITOR.document.getWindow().getViewPaneSize();
|
|
9
|
+
|
|
10
|
+
// Make it maximum 800px wide, but still fully visible in the viewport.
|
|
11
|
+
var width = Math.min(size.width - 70, 800);
|
|
12
|
+
|
|
13
|
+
// Make it use 2/3 of the viewport height.
|
|
14
|
+
var height = size.height / 1.5;
|
|
15
|
+
|
|
16
|
+
// Store old editor data to avoid unnecessary setData.
|
|
17
|
+
var oldData;
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
title: editor.lang.sourcedialog.title,
|
|
21
|
+
minWidth: 100,
|
|
22
|
+
minHeight: 100,
|
|
23
|
+
|
|
24
|
+
onShow: function () {
|
|
25
|
+
this.setValueOf('main', 'data', (oldData = editor.getData()));
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
onOk: (function () {
|
|
29
|
+
function setData(dialog, newData) {
|
|
30
|
+
// [IE8] Focus editor before setting selection to avoid setting data on
|
|
31
|
+
// locked selection, because in case of inline editor, it won't be
|
|
32
|
+
// unlocked before editable's HTML is altered. (https://dev.ckeditor.com/ticket/11585)
|
|
33
|
+
editor.focus();
|
|
34
|
+
editor.setData(newData, function () {
|
|
35
|
+
dialog.hide();
|
|
36
|
+
|
|
37
|
+
// Ensure correct selection.
|
|
38
|
+
var range = editor.createRange();
|
|
39
|
+
range.moveToElementEditStart(editor.editable());
|
|
40
|
+
range.select();
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return function () {
|
|
45
|
+
// Remove CR from input data for reliable comparison with editor data.
|
|
46
|
+
var newData = this.getValueOf('main', 'data').replace(/\r/g, ''),
|
|
47
|
+
that = this;
|
|
48
|
+
|
|
49
|
+
// Avoid unnecessary setData. Also preserve selection
|
|
50
|
+
// when user changed his mind and goes back to wysiwyg editing.
|
|
51
|
+
if (newData === oldData) return true;
|
|
52
|
+
|
|
53
|
+
setTimeout(function () {
|
|
54
|
+
setData(that, newData);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// Don't let the dialog close before setData is over, to hide
|
|
58
|
+
// from user blinking caused by selection restoring and setting new data.
|
|
59
|
+
return false;
|
|
60
|
+
};
|
|
61
|
+
})(),
|
|
62
|
+
|
|
63
|
+
contents: [
|
|
64
|
+
{
|
|
65
|
+
id: 'main',
|
|
66
|
+
label: editor.lang.sourcedialog.title,
|
|
67
|
+
elements: [
|
|
68
|
+
{
|
|
69
|
+
type: 'textarea',
|
|
70
|
+
id: 'data',
|
|
71
|
+
dir: 'ltr',
|
|
72
|
+
inputStyle:
|
|
73
|
+
'cursor:auto;' +
|
|
74
|
+
'width:' +
|
|
75
|
+
width +
|
|
76
|
+
'px;' +
|
|
77
|
+
'height:' +
|
|
78
|
+
height +
|
|
79
|
+
'px;' +
|
|
80
|
+
'tab-size:4;' +
|
|
81
|
+
'text-align:left;',
|
|
82
|
+
class: 'cke_source',
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
};
|
|
88
|
+
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
CKEditor 4 LTS ("Long Term Support") is available under the terms of the Extended Support Model.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
CKEDITOR.plugins.setLang('sourcedialog', 'vi', {
|
|
7
|
-
toolbar: 'Nguồn',
|
|
8
|
-
title: 'Nguồn',
|
|
9
|
-
});
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
CKEditor 4 LTS ("Long Term Support") is available under the terms of the Extended Support Model.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
CKEDITOR.plugins.setLang('sourcedialog', 'vi', {
|
|
7
|
+
toolbar: 'Nguồn',
|
|
8
|
+
title: 'Nguồn',
|
|
9
|
+
});
|