1 | <html lang='en' xml:lang='en'> |
---|
2 | <head> |
---|
3 | <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/> |
---|
4 | <script src="https://cdn.ckeditor.com/4.4.2/standard/ckeditor.js"></script> |
---|
5 | <script type='application/javascript'> |
---|
6 | CKEDITOR.disableAutoInline = true; |
---|
7 | function downloadFile() { |
---|
8 | document.location = 'data:Application/octet-stream,0'; |
---|
9 | } |
---|
10 | window.onload = function () { |
---|
11 | var editor = CKEDITOR.inline("editor1", { |
---|
12 | floatSpaceDockedOffsetY: 999999, |
---|
13 | toolbarGroups: [ |
---|
14 | { name: 'document', groups: [ 'mode', 'document' ] }, // Displays document group with its two subgroups. |
---|
15 | { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, // Group's name will be used to create voice label. |
---|
16 | '/', |
---|
17 | { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, |
---|
18 | { name: 'links' } |
---|
19 | ] |
---|
20 | |
---|
21 | }); |
---|
22 | editor.addCommand('downloadDraft', { |
---|
23 | exec: downloadFile |
---|
24 | }); |
---|
25 | editor.ui.addButton('DownloadDraft', { |
---|
26 | label: 'Download Draft', |
---|
27 | command: 'downloadDraft', |
---|
28 | toolbar: 'document,20' |
---|
29 | }); |
---|
30 | }; |
---|
31 | </script> |
---|
32 | </head> |
---|
33 | <body> |
---|
34 | <div id='contentwrapper' style="margin-top: 100px;"> |
---|
35 | <div id='editor1' contenteditable="true"> |
---|
36 | <p>Some content blah blah</p> |
---|
37 | </div> |
---|
38 | <button onclick="downloadFile()">download file</button> |
---|
39 | </div> |
---|
40 | </body> |
---|
41 | </html> |
---|