ueditor-plus-assets 0.1.0 → 0.1.2
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/README.md +3 -3
- package/dist/UEditorPlus/dialogs/ai/ai.html +139 -0
- package/dist/UEditorPlus/dialogs/ai/ai.js +282 -0
- package/dist/UEditorPlus/dialogs/anchor/anchor.html +62 -0
- package/dist/UEditorPlus/dialogs/attachment/attachment.css +716 -0
- package/dist/UEditorPlus/dialogs/attachment/attachment.html +61 -0
- package/dist/UEditorPlus/dialogs/attachment/attachment.js +797 -0
- package/dist/UEditorPlus/dialogs/attachment/images/alignicon.gif +0 -0
- package/dist/UEditorPlus/dialogs/attachment/images/alignicon.png +0 -0
- package/dist/UEditorPlus/dialogs/attachment/images/bg.png +0 -0
- package/dist/UEditorPlus/dialogs/attachment/images/file-icons.gif +0 -0
- package/dist/UEditorPlus/dialogs/attachment/images/file-icons.png +0 -0
- package/dist/UEditorPlus/dialogs/attachment/images/icons.gif +0 -0
- package/dist/UEditorPlus/dialogs/attachment/images/icons.png +0 -0
- package/dist/UEditorPlus/dialogs/attachment/images/image.png +0 -0
- package/dist/UEditorPlus/dialogs/attachment/images/progress.png +0 -0
- package/dist/UEditorPlus/dialogs/attachment/images/success.gif +0 -0
- package/dist/UEditorPlus/dialogs/attachment/images/success.png +0 -0
- package/dist/UEditorPlus/dialogs/audio/audio.css +818 -0
- package/dist/UEditorPlus/dialogs/audio/audio.html +83 -0
- package/dist/UEditorPlus/dialogs/audio/audio.js +805 -0
- package/dist/UEditorPlus/dialogs/audio/images/bg.png +0 -0
- package/dist/UEditorPlus/dialogs/audio/images/center_focus.jpg +0 -0
- package/dist/UEditorPlus/dialogs/audio/images/file-icons.gif +0 -0
- package/dist/UEditorPlus/dialogs/audio/images/file-icons.png +0 -0
- package/dist/UEditorPlus/dialogs/audio/images/icons.gif +0 -0
- package/dist/UEditorPlus/dialogs/audio/images/icons.png +0 -0
- package/dist/UEditorPlus/dialogs/audio/images/image.png +0 -0
- package/dist/UEditorPlus/dialogs/audio/images/left_focus.jpg +0 -0
- package/dist/UEditorPlus/dialogs/audio/images/none_focus.jpg +0 -0
- package/dist/UEditorPlus/dialogs/audio/images/progress.png +0 -0
- package/dist/UEditorPlus/dialogs/audio/images/right_focus.jpg +0 -0
- package/dist/UEditorPlus/dialogs/audio/images/success.gif +0 -0
- package/dist/UEditorPlus/dialogs/audio/images/success.png +0 -0
- package/dist/UEditorPlus/dialogs/background/background.css +193 -0
- package/dist/UEditorPlus/dialogs/background/background.html +59 -0
- package/dist/UEditorPlus/dialogs/background/background.js +370 -0
- package/dist/UEditorPlus/dialogs/background/images/bg.png +0 -0
- package/dist/UEditorPlus/dialogs/background/images/success.png +0 -0
- package/dist/UEditorPlus/dialogs/contentimport/contentimport.html +177 -0
- package/dist/UEditorPlus/dialogs/contentimport/contentimport.js +91 -0
- package/dist/UEditorPlus/dialogs/contentimport/mammoth.browser.min.js +21 -0
- package/dist/UEditorPlus/dialogs/contentimport/showdown.min.js +3 -0
- package/dist/UEditorPlus/dialogs/emotion/emotion.css +129 -0
- package/dist/UEditorPlus/dialogs/emotion/emotion.html +70 -0
- package/dist/UEditorPlus/dialogs/emotion/emotion.js +186 -0
- package/dist/UEditorPlus/dialogs/emotion/images/0.gif +0 -0
- package/dist/UEditorPlus/dialogs/emotion/images/bface.gif +0 -0
- package/dist/UEditorPlus/dialogs/emotion/images/cface.gif +0 -0
- package/dist/UEditorPlus/dialogs/emotion/images/fface.gif +0 -0
- package/dist/UEditorPlus/dialogs/emotion/images/jxface2.gif +0 -0
- package/dist/UEditorPlus/dialogs/emotion/images/neweditor-tab-bg.png +0 -0
- package/dist/UEditorPlus/dialogs/emotion/images/tface.gif +0 -0
- package/dist/UEditorPlus/dialogs/emotion/images/wface.gif +0 -0
- package/dist/UEditorPlus/dialogs/emotion/images/yface.gif +0 -0
- package/dist/UEditorPlus/dialogs/formula/formula.html +98 -0
- package/dist/UEditorPlus/dialogs/formula/formula.js +147 -0
- package/dist/UEditorPlus/dialogs/help/help.css +37 -0
- package/dist/UEditorPlus/dialogs/help/help.html +82 -0
- package/dist/UEditorPlus/dialogs/help/help.js +57 -0
- package/dist/UEditorPlus/dialogs/image/image.css +752 -0
- package/dist/UEditorPlus/dialogs/image/image.html +125 -0
- package/dist/UEditorPlus/dialogs/image/image.js +1051 -0
- package/dist/UEditorPlus/dialogs/image/images/alignicon.jpg +0 -0
- package/dist/UEditorPlus/dialogs/image/images/bg.png +0 -0
- package/dist/UEditorPlus/dialogs/image/images/icons.gif +0 -0
- package/dist/UEditorPlus/dialogs/image/images/icons.png +0 -0
- package/dist/UEditorPlus/dialogs/image/images/image.png +0 -0
- package/dist/UEditorPlus/dialogs/image/images/progress.png +0 -0
- package/dist/UEditorPlus/dialogs/image/images/success.gif +0 -0
- package/dist/UEditorPlus/dialogs/image/images/success.png +0 -0
- package/dist/UEditorPlus/dialogs/insertframe/insertframe.html +135 -0
- package/dist/UEditorPlus/dialogs/internal.js +81 -0
- package/dist/UEditorPlus/dialogs/link/link.html +155 -0
- package/dist/UEditorPlus/dialogs/preview/preview.html +45 -0
- package/dist/UEditorPlus/dialogs/scrawl/images/addimg.png +0 -0
- package/dist/UEditorPlus/dialogs/scrawl/images/brush.png +0 -0
- package/dist/UEditorPlus/dialogs/scrawl/images/delimg.png +0 -0
- package/dist/UEditorPlus/dialogs/scrawl/images/delimgH.png +0 -0
- package/dist/UEditorPlus/dialogs/scrawl/images/empty.png +0 -0
- package/dist/UEditorPlus/dialogs/scrawl/images/emptyH.png +0 -0
- package/dist/UEditorPlus/dialogs/scrawl/images/eraser.png +0 -0
- package/dist/UEditorPlus/dialogs/scrawl/images/redo.png +0 -0
- package/dist/UEditorPlus/dialogs/scrawl/images/redoH.png +0 -0
- package/dist/UEditorPlus/dialogs/scrawl/images/scale.png +0 -0
- package/dist/UEditorPlus/dialogs/scrawl/images/scaleH.png +0 -0
- package/dist/UEditorPlus/dialogs/scrawl/images/size.png +0 -0
- package/dist/UEditorPlus/dialogs/scrawl/images/undo.png +0 -0
- package/dist/UEditorPlus/dialogs/scrawl/images/undoH.png +0 -0
- package/dist/UEditorPlus/dialogs/scrawl/scrawl.css +324 -0
- package/dist/UEditorPlus/dialogs/scrawl/scrawl.html +95 -0
- package/dist/UEditorPlus/dialogs/scrawl/scrawl.js +707 -0
- package/dist/UEditorPlus/dialogs/searchreplace/searchreplace.html +144 -0
- package/dist/UEditorPlus/dialogs/searchreplace/searchreplace.js +174 -0
- package/dist/UEditorPlus/dialogs/spechars/spechars.html +42 -0
- package/dist/UEditorPlus/dialogs/spechars/spechars.js +86 -0
- package/dist/UEditorPlus/dialogs/table/dragicon.png +0 -0
- package/dist/UEditorPlus/dialogs/table/edittable.css +85 -0
- package/dist/UEditorPlus/dialogs/table/edittable.html +69 -0
- package/dist/UEditorPlus/dialogs/table/edittable.js +241 -0
- package/dist/UEditorPlus/dialogs/table/edittd.html +62 -0
- package/dist/UEditorPlus/dialogs/table/edittip.html +33 -0
- package/dist/UEditorPlus/dialogs/template/config.js +42 -0
- package/dist/UEditorPlus/dialogs/template/images/bg.gif +0 -0
- package/dist/UEditorPlus/dialogs/template/images/pre0.png +0 -0
- package/dist/UEditorPlus/dialogs/template/images/pre1.png +0 -0
- package/dist/UEditorPlus/dialogs/template/images/pre2.png +0 -0
- package/dist/UEditorPlus/dialogs/template/images/pre3.png +0 -0
- package/dist/UEditorPlus/dialogs/template/images/pre4.png +0 -0
- package/dist/UEditorPlus/dialogs/template/template.css +99 -0
- package/dist/UEditorPlus/dialogs/template/template.html +26 -0
- package/dist/UEditorPlus/dialogs/template/template.js +53 -0
- package/dist/UEditorPlus/dialogs/video/images/bg.png +0 -0
- package/dist/UEditorPlus/dialogs/video/images/center_focus.jpg +0 -0
- package/dist/UEditorPlus/dialogs/video/images/file-icons.gif +0 -0
- package/dist/UEditorPlus/dialogs/video/images/file-icons.png +0 -0
- package/dist/UEditorPlus/dialogs/video/images/icons.gif +0 -0
- package/dist/UEditorPlus/dialogs/video/images/icons.png +0 -0
- package/dist/UEditorPlus/dialogs/video/images/image.png +0 -0
- package/dist/UEditorPlus/dialogs/video/images/left_focus.jpg +0 -0
- package/dist/UEditorPlus/dialogs/video/images/none_focus.jpg +0 -0
- package/dist/UEditorPlus/dialogs/video/images/progress.png +0 -0
- package/dist/UEditorPlus/dialogs/video/images/right_focus.jpg +0 -0
- package/dist/UEditorPlus/dialogs/video/images/success.gif +0 -0
- package/dist/UEditorPlus/dialogs/video/images/success.png +0 -0
- package/dist/UEditorPlus/dialogs/video/video.css +818 -0
- package/dist/UEditorPlus/dialogs/video/video.html +109 -0
- package/dist/UEditorPlus/dialogs/video/video.js +910 -0
- package/dist/UEditorPlus/dialogs/wordimage/wordimage.html +222 -0
- package/dist/UEditorPlus/dialogs/wordimage/wordimage.js +93 -0
- package/dist/UEditorPlus/index.html +168 -0
- package/dist/UEditorPlus/lang/en/en.js +788 -0
- package/dist/UEditorPlus/lang/en/images/addimage.png +0 -0
- package/dist/UEditorPlus/lang/en/images/alldeletebtnhoverskin.png +0 -0
- package/dist/UEditorPlus/lang/en/images/alldeletebtnupskin.png +0 -0
- package/dist/UEditorPlus/lang/en/images/background.png +0 -0
- package/dist/UEditorPlus/lang/en/images/button.png +0 -0
- package/dist/UEditorPlus/lang/en/images/copy.png +0 -0
- package/dist/UEditorPlus/lang/en/images/deletedisable.png +0 -0
- package/dist/UEditorPlus/lang/en/images/deleteenable.png +0 -0
- package/dist/UEditorPlus/lang/en/images/listbackground.png +0 -0
- package/dist/UEditorPlus/lang/en/images/localimage.png +0 -0
- package/dist/UEditorPlus/lang/en/images/music.png +0 -0
- package/dist/UEditorPlus/lang/en/images/rotateleftdisable.png +0 -0
- package/dist/UEditorPlus/lang/en/images/rotateleftenable.png +0 -0
- package/dist/UEditorPlus/lang/en/images/rotaterightdisable.png +0 -0
- package/dist/UEditorPlus/lang/en/images/rotaterightenable.png +0 -0
- package/dist/UEditorPlus/lang/en/images/upload.png +0 -0
- package/dist/UEditorPlus/lang/zh-cn/images/copy.png +0 -0
- package/dist/UEditorPlus/lang/zh-cn/images/localimage.png +0 -0
- package/dist/UEditorPlus/lang/zh-cn/images/music.png +0 -0
- package/dist/UEditorPlus/lang/zh-cn/images/upload.png +0 -0
- package/dist/UEditorPlus/lang/zh-cn/zh-cn.js +812 -0
- package/dist/UEditorPlus/plugins/demo/demo.js +3 -0
- package/dist/UEditorPlus/themes/default/css/ueditor.css +2170 -0
- package/dist/UEditorPlus/themes/default/dialog.css +642 -0
- package/dist/UEditorPlus/themes/default/dialogbase.css +100 -0
- package/dist/UEditorPlus/themes/default/exts/ai.svg +12 -0
- package/dist/UEditorPlus/themes/default/exts/apk.svg +12 -0
- package/dist/UEditorPlus/themes/default/exts/chm.svg +12 -0
- package/dist/UEditorPlus/themes/default/exts/css.svg +12 -0
- package/dist/UEditorPlus/themes/default/exts/doc.svg +22 -0
- package/dist/UEditorPlus/themes/default/exts/docx.svg +22 -0
- package/dist/UEditorPlus/themes/default/exts/dwg.svg +16 -0
- package/dist/UEditorPlus/themes/default/exts/folder.svg +3 -0
- package/dist/UEditorPlus/themes/default/exts/gif.svg +14 -0
- package/dist/UEditorPlus/themes/default/exts/html.svg +12 -0
- package/dist/UEditorPlus/themes/default/exts/jpeg.svg +14 -0
- package/dist/UEditorPlus/themes/default/exts/jpg.svg +14 -0
- package/dist/UEditorPlus/themes/default/exts/log.svg +12 -0
- package/dist/UEditorPlus/themes/default/exts/mp3.svg +14 -0
- package/dist/UEditorPlus/themes/default/exts/mp4.svg +12 -0
- package/dist/UEditorPlus/themes/default/exts/pdf.svg +14 -0
- package/dist/UEditorPlus/themes/default/exts/png.svg +14 -0
- package/dist/UEditorPlus/themes/default/exts/ppt.svg +24 -0
- package/dist/UEditorPlus/themes/default/exts/pptx.svg +24 -0
- package/dist/UEditorPlus/themes/default/exts/psd.svg +12 -0
- package/dist/UEditorPlus/themes/default/exts/rar.svg +12 -0
- package/dist/UEditorPlus/themes/default/exts/svg.svg +12 -0
- package/dist/UEditorPlus/themes/default/exts/torrent.svg +14 -0
- package/dist/UEditorPlus/themes/default/exts/txt.svg +14 -0
- package/dist/UEditorPlus/themes/default/exts/unknown.svg +12 -0
- package/dist/UEditorPlus/themes/default/exts/xls.svg +25 -0
- package/dist/UEditorPlus/themes/default/exts/xlsx.svg +25 -0
- package/dist/UEditorPlus/themes/default/exts/zip.svg +12 -0
- package/dist/UEditorPlus/themes/default/images/anchor.gif +0 -0
- package/dist/UEditorPlus/themes/default/images/arrow.png +0 -0
- package/dist/UEditorPlus/themes/default/images/arrow_down.png +0 -0
- package/dist/UEditorPlus/themes/default/images/arrow_up.png +0 -0
- package/dist/UEditorPlus/themes/default/images/button-bg.gif +0 -0
- package/dist/UEditorPlus/themes/default/images/cancelbutton.gif +0 -0
- package/dist/UEditorPlus/themes/default/images/charts.png +0 -0
- package/dist/UEditorPlus/themes/default/images/cursor_h.gif +0 -0
- package/dist/UEditorPlus/themes/default/images/cursor_h.png +0 -0
- package/dist/UEditorPlus/themes/default/images/cursor_v.gif +0 -0
- package/dist/UEditorPlus/themes/default/images/cursor_v.png +0 -0
- package/dist/UEditorPlus/themes/default/images/dialog-title-bg.png +0 -0
- package/dist/UEditorPlus/themes/default/images/filescan.png +0 -0
- package/dist/UEditorPlus/themes/default/images/highlighted.gif +0 -0
- package/dist/UEditorPlus/themes/default/images/icons-all.gif +0 -0
- package/dist/UEditorPlus/themes/default/images/icons.gif +0 -0
- package/dist/UEditorPlus/themes/default/images/icons.png +0 -0
- package/dist/UEditorPlus/themes/default/images/img-cracked.png +0 -0
- package/dist/UEditorPlus/themes/default/images/loaderror.png +0 -0
- package/dist/UEditorPlus/themes/default/images/loading.gif +0 -0
- package/dist/UEditorPlus/themes/default/images/lock.gif +0 -0
- package/dist/UEditorPlus/themes/default/images/neweditor-tab-bg.png +0 -0
- package/dist/UEditorPlus/themes/default/images/pagebreak.gif +0 -0
- package/dist/UEditorPlus/themes/default/images/scale.png +0 -0
- package/dist/UEditorPlus/themes/default/images/sortable.png +0 -0
- package/dist/UEditorPlus/themes/default/images/spacer.gif +0 -0
- package/dist/UEditorPlus/themes/default/images/sparator_v.png +0 -0
- package/dist/UEditorPlus/themes/default/images/table-cell-align.png +0 -0
- package/dist/UEditorPlus/themes/default/images/tangram-colorpicker.png +0 -0
- package/dist/UEditorPlus/themes/default/images/toolbar_bg.png +0 -0
- package/dist/UEditorPlus/themes/default/images/unhighlighted.gif +0 -0
- package/dist/UEditorPlus/themes/default/images/upload.png +0 -0
- package/dist/UEditorPlus/themes/default/images/videologo.gif +0 -0
- package/dist/UEditorPlus/themes/default/images/word.gif +0 -0
- package/dist/UEditorPlus/themes/default/images/wordpaste.png +0 -0
- package/dist/UEditorPlus/themes/iframe.css +63 -0
- package/dist/UEditorPlus/third-party/SyntaxHighlighter/shCore.js +3655 -0
- package/dist/UEditorPlus/third-party/SyntaxHighlighter/shCoreDefault.css +1 -0
- package/dist/UEditorPlus/third-party/clipboard/clipboard.js +753 -0
- package/dist/UEditorPlus/third-party/clipboard/clipboard.swf +0 -0
- package/dist/UEditorPlus/third-party/codemirror/codemirror.css +106 -0
- package/dist/UEditorPlus/third-party/codemirror/codemirror.js +3581 -0
- package/dist/UEditorPlus/third-party/jquery-1.10.2.js +6 -0
- package/dist/UEditorPlus/third-party/showdown.js +2 -0
- package/dist/UEditorPlus/third-party/vue.js +1 -0
- package/dist/UEditorPlus/third-party/webuploader/webuploader.css +88 -0
- package/dist/UEditorPlus/third-party/webuploader/webuploader.js +10178 -0
- package/dist/UEditorPlus/third-party/zeroclipboard/ZeroClipboard.js +1256 -0
- package/dist/UEditorPlus/third-party/zeroclipboard/ZeroClipboard.swf +0 -0
- package/dist/UEditorPlus/ueditor.all.js +36896 -0
- package/dist/UEditorPlus/ueditor.config.js +761 -0
- package/dist/UEditorPlus/ueditor.parse.js +907 -0
- package/index.js +5 -5
- package/package.json +29 -29
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<head>
|
|
3
|
+
<title></title>
|
|
4
|
+
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
|
|
5
|
+
<script type="text/javascript" src="../internal.js?{timestamp}"></script>
|
|
6
|
+
<style type="text/css">
|
|
7
|
+
.wrapper {
|
|
8
|
+
width: 620px;
|
|
9
|
+
padding: 10px;
|
|
10
|
+
height: 399px;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
position: relative;
|
|
14
|
+
border-bottom: 1px solid #F2F2F2;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.wrapper .file-upload {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.wrapper .file-upload .file-tip {
|
|
23
|
+
color: #999;
|
|
24
|
+
font-size: 12px;
|
|
25
|
+
padding-left: 10px;
|
|
26
|
+
flex-grow: 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.wrapper .file-manual {
|
|
30
|
+
background: #EEE;
|
|
31
|
+
padding: 10px;
|
|
32
|
+
border-radius: 5px;
|
|
33
|
+
margin-top: 10px;
|
|
34
|
+
line-height: 2;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.wrapper .file-manual .title {
|
|
38
|
+
font-weight: bold;
|
|
39
|
+
font-size: 120%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.wrapper .file-manual .body {
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.wrapper .file-manual .body li {
|
|
46
|
+
list-style: disc;
|
|
47
|
+
margin-left: 20px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.wrapper .upload-button {
|
|
51
|
+
width: 100px;
|
|
52
|
+
height: 30px;
|
|
53
|
+
background-color: #F8F8F8;
|
|
54
|
+
border: 1px solid #EEE;
|
|
55
|
+
border-radius: 4px;
|
|
56
|
+
text-align: center;
|
|
57
|
+
line-height: 28px;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
position: relative;
|
|
60
|
+
flex-shrink: 0;
|
|
61
|
+
margin-right: 5px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.wrapper .upload-button .text {
|
|
65
|
+
display: inline-block;
|
|
66
|
+
vertical-align: middle;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.wrapper .upload-button input {
|
|
70
|
+
position: absolute;
|
|
71
|
+
left: 0;
|
|
72
|
+
top: 0;
|
|
73
|
+
opacity: 0;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
height: 100%;
|
|
76
|
+
width: 100%;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.wrapper .file-result {
|
|
80
|
+
border: 1px solid #333;
|
|
81
|
+
padding: 10px;
|
|
82
|
+
border-radius: 5px;
|
|
83
|
+
position: absolute;
|
|
84
|
+
left: 10px;
|
|
85
|
+
right: 10px;
|
|
86
|
+
top: 50px;
|
|
87
|
+
background: #FFF;
|
|
88
|
+
bottom: 10px;
|
|
89
|
+
overflow: auto;
|
|
90
|
+
display: none;
|
|
91
|
+
}
|
|
92
|
+
.wrapper .file-input{
|
|
93
|
+
position: absolute;
|
|
94
|
+
left: 10px;
|
|
95
|
+
right: 10px;
|
|
96
|
+
top: 50px;
|
|
97
|
+
background: #EEE;
|
|
98
|
+
bottom: 10px;
|
|
99
|
+
border-radius: 5px;
|
|
100
|
+
display:none;
|
|
101
|
+
}
|
|
102
|
+
.wrapper .file-input textarea{
|
|
103
|
+
position: absolute;
|
|
104
|
+
left: 10px;
|
|
105
|
+
right: 10px;
|
|
106
|
+
bottom: 10px;
|
|
107
|
+
border: none;
|
|
108
|
+
resize: none;
|
|
109
|
+
border-radius: 5px;
|
|
110
|
+
padding: 5px;
|
|
111
|
+
outline: none;
|
|
112
|
+
top: 30px;
|
|
113
|
+
}
|
|
114
|
+
.wrapper .file-input .tool{
|
|
115
|
+
text-align: right;
|
|
116
|
+
padding: 5px 10px;
|
|
117
|
+
}
|
|
118
|
+
.wrapper .file-input .tool a{
|
|
119
|
+
display: inline-block;
|
|
120
|
+
text-decoration: none;
|
|
121
|
+
color: #333;
|
|
122
|
+
background: #FFF;
|
|
123
|
+
padding: 0 10px;
|
|
124
|
+
line-height: 20px;
|
|
125
|
+
border-radius: 3px;
|
|
126
|
+
}
|
|
127
|
+
</style>
|
|
128
|
+
</head>
|
|
129
|
+
<body>
|
|
130
|
+
<div class="wrapper">
|
|
131
|
+
<div class="file-upload">
|
|
132
|
+
<div class="upload-button">
|
|
133
|
+
<div class="text"><var id="lang_select_local_file"></var></div>
|
|
134
|
+
<input type="file" id="contentImport"/>
|
|
135
|
+
</div>
|
|
136
|
+
<div class="upload-button">
|
|
137
|
+
<div class="text" onclick="$('.file-input').show();"><var id="lang_paste_markdown"></var></div>
|
|
138
|
+
</div>
|
|
139
|
+
<div class="file-tip"></div>
|
|
140
|
+
</div>
|
|
141
|
+
<div class="file-manual">
|
|
142
|
+
<div class="title">
|
|
143
|
+
<var id="lang_supported_formats"></var>
|
|
144
|
+
</div>
|
|
145
|
+
<div class="body">
|
|
146
|
+
<ul>
|
|
147
|
+
<li><b>Word</b>:docx</li>
|
|
148
|
+
<li><b>Markdown</b>:md</li>
|
|
149
|
+
</ul>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
<div class="file-result"></div>
|
|
153
|
+
<div class="file-input">
|
|
154
|
+
<textarea id="fileInputContent"></textarea>
|
|
155
|
+
<div class="tool">
|
|
156
|
+
<a href="javascript:;" id="fileInputConfirm">
|
|
157
|
+
<var id="lang_confirm"></var>
|
|
158
|
+
</a>
|
|
159
|
+
<a href="javascript:;" onclick="$(this).closest('.file-input').hide();">
|
|
160
|
+
<var id="lang_close"></var>
|
|
161
|
+
</a>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
<script src="../../third-party/jquery-1.10.2.js?{timestamp}"></script>
|
|
166
|
+
<script src="mammoth.browser.min.js?{timestamp}"></script>
|
|
167
|
+
<script src="showdown.min.js?{timestamp}"></script>
|
|
168
|
+
<script type="text/javascript" src="contentimport.js?{timestamp}"></script>
|
|
169
|
+
<script type="text/javascript">
|
|
170
|
+
utils.domReady(function () {
|
|
171
|
+
var options = {};
|
|
172
|
+
var callbacks = {};
|
|
173
|
+
contentImport.init(options, callbacks);
|
|
174
|
+
});
|
|
175
|
+
</script>
|
|
176
|
+
</body>
|
|
177
|
+
</html>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
var contentImport = {};
|
|
2
|
+
var g = $G;
|
|
3
|
+
|
|
4
|
+
contentImport.data = {
|
|
5
|
+
result: null,
|
|
6
|
+
};
|
|
7
|
+
contentImport.init = function (opt, callbacks) {
|
|
8
|
+
addUploadButtonListener();
|
|
9
|
+
addOkListener();
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
function processWord(file) {
|
|
13
|
+
$('.file-tip').html(lang.wordConverting);
|
|
14
|
+
$('.file-result').html('').hide();
|
|
15
|
+
var reader = new FileReader();
|
|
16
|
+
reader.onload = function (loadEvent) {
|
|
17
|
+
mammoth.convertToHtml({
|
|
18
|
+
arrayBuffer: loadEvent.target.result
|
|
19
|
+
})
|
|
20
|
+
.then(function displayResult(result) {
|
|
21
|
+
$('.file-tip').html(lang.convertSuccess);
|
|
22
|
+
contentImport.data.result = result.value;
|
|
23
|
+
$('.file-result').html(result.value).show();
|
|
24
|
+
}, function (error) {
|
|
25
|
+
$('.file-tip').html(lang.wordConvertFail + error);
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
reader.onerror = function (loadEvent) {
|
|
29
|
+
$('.file-tip').html(lang.wordConvertFail + loadEvent);
|
|
30
|
+
};
|
|
31
|
+
reader.readAsArrayBuffer(file);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function processMarkdown( markdown ){
|
|
35
|
+
var converter = new showdown.Converter();
|
|
36
|
+
var html = converter.makeHtml(markdown);
|
|
37
|
+
$('.file-tip').html(lang.convertSuccess);
|
|
38
|
+
contentImport.data.result = html;
|
|
39
|
+
$('.file-result').html(html).show();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function processMarkdownFile(file) {
|
|
43
|
+
$('.file-tip').html(lang.markdownConverting);
|
|
44
|
+
$('.file-result').html('').hide();
|
|
45
|
+
var reader = new FileReader();
|
|
46
|
+
reader.onload = function (loadEvent) {
|
|
47
|
+
processMarkdown( loadEvent.target.result );
|
|
48
|
+
};
|
|
49
|
+
reader.onerror = function (loadEvent) {
|
|
50
|
+
$('.file-tip').html(lang.markdownConvertFail + loadEvent);
|
|
51
|
+
};
|
|
52
|
+
reader.readAsText(file, "UTF-8");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function addUploadButtonListener() {
|
|
56
|
+
g('contentImport').addEventListener('change', function () {
|
|
57
|
+
var file = this.files[0];
|
|
58
|
+
var fileName = file.name;
|
|
59
|
+
var fileExt = fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase();
|
|
60
|
+
switch (fileExt) {
|
|
61
|
+
case 'docx':
|
|
62
|
+
case 'doc':
|
|
63
|
+
processWord(file);
|
|
64
|
+
break;
|
|
65
|
+
case 'md':
|
|
66
|
+
processMarkdownFile(file);
|
|
67
|
+
break;
|
|
68
|
+
default:
|
|
69
|
+
$('.file-tip').html(lang.unsupportedFormat + fileExt);
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
g('fileInputConfirm').addEventListener('click', function () {
|
|
74
|
+
processMarkdown( g('fileInputContent').value );
|
|
75
|
+
$('.file-input').hide();
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function addOkListener() {
|
|
80
|
+
dialog.onok = function () {
|
|
81
|
+
if (!contentImport.data.result) {
|
|
82
|
+
alert(lang.pleaseUploadFirst);
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
editor.fireEvent('saveScene');
|
|
86
|
+
editor.execCommand("inserthtml", contentImport.data.result);
|
|
87
|
+
editor.fireEvent('saveScene');
|
|
88
|
+
};
|
|
89
|
+
dialog.oncancel = function () {
|
|
90
|
+
};
|
|
91
|
+
}
|