Testing for javscript code is not issue for frontend working
x
50
50
1
(function () {
2
tinymce.PluginManager.add('init', function( editor ) {
3
// Replace window manager.
4
editor.on('init', function() {
5
// Add Shortcut key for full screen
6
editor.addShortcut('f11', 'template', () => {
7
editor.execCommand('mceFullScreen');
8
});
9
// Add Shortcut key for anchor
10
editor.addShortcut('alt+shift+k', 'pop-up anchor', () => {
11
editor.execCommand('mceAnchor');
12
});
13
// Add Shortcut key for date
14
editor.addShortcut('alt+shift+i', 'insert Date', () => {
15
var weekdays = ['일', '월', '화', '수', '목', '금', '토'];
16
const today24 = new Date(); //today
17
var cur_yyyy = today24.getFullYear();
18
var cur_mm = ("0" + (today24.getMonth() + 1)).slice(-2);
19
var cur_dd = ("0" + today24.getDate()).slice(-2);
20
var cur_wd = weekdays[today24.getDay()];
21
var timestamp = cur_yyyy + "-" + cur_mm + "-" + cur_dd + "(" + cur_wd + ")";
22
editor.execCommand('mceInsertContent', false, timestamp);
23
});
24
// Add Shortcut key for rest api
25
editor.addShortcut('alt+p', 'Rest API Shortcode', () => {
26
var resetapi_shortcode = "A valid URL was not provided."
27
editor.execCommand('mceInsertContent', false, resetapi_shortcode);
28
});
29
// Add Shortcut key for split
30
editor.addShortcut('alt+h', 'Horizontal Split', () => {
31
editor.execCommand('InsertHorizontalRule');
32
});
33
34
/*
35
// Add Shortcut key font increase
36
editor.addShortcut('alt+p', 'Increase font', () => {
37
editor.execCommand("FontSize", false, "20px");
38
});
39
// Add Shortcut key font general
40
editor.addShortcut('alt+o', 'Increase font', () => {
41
editor.execCommand("FontSize", false, "16px");
42
});
43
*/
44
});
45
});
46
})();
47
48
49
50