-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
executable file
·178 lines (156 loc) · 5.57 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>EnlighterJS TinyMCE Demo</title>
<!-- just for styling !-->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<style type="text/css">
textarea{
display: block;
width: 100%;
min-height: 600px;
border: dotted 1px #505050;
}
</style>
<script type="text/javascript">/* <![CDATA[ */
EnlighterJS_EditorConfig = {
"languages": {
'generic' : 'Generic Highlighting',
'avrasm' : 'Avr Assembly',
'asm' : 'Generic Assembly',
'c' : 'C',
'cpp' : 'C++',
'csharp' : 'C#',
'css' : 'CSS',
'cython' : 'Cython',
'cordpro' : 'CordPro',
'diff' : 'Diff',
'dockerfile' : 'Dockerfile',
'groovy' : 'Groovy',
'golang' : 'Go',
'html' : 'HTML',
'ini' : 'Ini/Conf Syntax',
'java' : 'Java',
'js' : 'Javascript',
'json' : 'JSON',
'kotlin' : 'Kotlin',
'less' : 'LESS',
'lua' : 'LUA',
'md' : 'Markdown',
'matlab' : 'Matlab/Octave',
'nsis' : 'NSIS',
'php' : 'PHP',
'powershell' : 'PowerShell',
'prolog' : 'Prolog',
'python' : 'Python',
'ruby' : 'Ruby',
'rust' : 'Rust',
'scss' : 'SCSS',
'shell' : 'Shellscript',
'sql' : 'SQL',
'squirrel' : 'Squirrel',
'swift' : 'Swift',
'typescript' : 'TypeScript',
'vhdl' : 'VHDL',
'visualbasic' : 'VisualBasic',
'verilog' : 'Verilog',
'xml' : 'XML',
'yaml' : 'YAML',
'raw' : 'RAW Code'
},
"themes": {
'enlighter' : 'Enlighter',
'godzilla' : 'Godzilla',
'beyond' : 'Beyond',
'classic' : 'Classic',
'mowtoo' : 'MooTwo',
'eclipse' : 'Eclipse',
'droide' : 'Droide',
'minimal' : 'Minimal',
'atomic' : 'Atomic',
'rowhammer' : 'Rowhammer',
'bootstrap4' : 'Bootstrap4',
'dracula': 'Dracula',
'monokai' : 'Monokai',
'wpcustom' : 'Theme Customizer'
},
"config": {
"theme": "wpcustom",
"language": "",
"linenumbers": true,
"indent": 2,
"tabIndentation": true,
"quicktagMode": "html",
"languageShortcode": true,
"shortcuts": true
},
"tinymce": {
"keyboardShortcuts": true
}
};
/* ]]> */</script>
<script src="https://cdn.tinymce.com/4/tinymce.min.js"></script>
<script type="text/javascript">
function _domready(){
// initialize TinyMCE
tinymce.init({
// paste plugin is required to strip pasted wysiwyg content (drop formats!)
plugins: 'paste',
external_plugins: {
'enlighterjs': '/dist/enlighterjs.tinymce.min.js'
},
content_css: "/dist/enlighterjs.tinymce.min.css",
selector: '#editor1',
menubar: false,
height: 1200,
toolbar: 'styleselect | bold italic | link image | pastetext | EnlighterInsert EnlighterEdit'
});
// toggle Visual Editor
document.getElementById('toggle_editor').addEventListener('click', function(){
tinymce.EditorManager.execCommand('mceToggleEditor', true, 'editor1');
})
}
</script>
</head>
<body>
<div class="container">
<div class="py-5 text-center">
<h2>EnlighterJS TinyMCE Demo</h2>
<p class="lead">Official EnlighterJS Plugin for TinyMCE | <a href="https://github.com/EnlighterJS/Plugin.TinyMCE" target="_new">GitHub Repository</a></a></p>
<button type="button" id="toggle_editor" class="btn btn-primary btn-lg">Toggle Editor</button>
</div>
<textarea id="editor1">Post and Edit Sourcecode in TinyMCE smoothly - Initially created as component of Enlighter Wordpress Plugin
<pre class="EnlighterJSRAW">
// get the enlighter settings of the current selected node
var getCodeblockSettings = function () {
// get current node
var node = editor.selection.getNode();
// enlighter element ?
if (!isEnlighterCode(node)) {
return {};
}
// get linenumber attribute (null: not set | true/false)
var ln = node.getAttribute('data-enlighter-linenumbers');
// generate config
return {
language: node.getAttribute('data-enlighter-language'),
linenumbers: (ln == null ? _enlighterjs_config.config.linenumbers : (ln == 'true')),
highlight: node.getAttribute('data-enlighter-highlight'),
lineoffset: node.getAttribute('data-enlighter-lineoffset'),
theme: node.getAttribute('data-enlighter-theme'),
group: node.getAttribute('data-enlighter-group'),
title: node.getAttribute('data-enlighter-title')
};
};
</pre>
</textarea>
</div>
<script type="text/javascript">
if (typeof _domready === 'function'){
_domready.apply(window, [window, document]);
}
</script>
</body>
</html>