index.html
4.86 KB
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
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>NKeditor 在线编辑器 PHP demo</title>
<script charset="utf-8" src="NKeditor-all-min.js"></script>
<!-- 如果你不需要使用批量图片上传,涂鸦功能和文件管理功能,就不需要引入 jquery -->
<script charset="utf-8" src="libs/jquery.min.js"></script>
<!-- JDialog是一款优秀的漂亮,轻量级的js弹出框插件 不是必须引入的,如果不引入则使用默认的 window.alert() 来弹出提示信息 -->
<script charset="utf-8" src="libs/JDialog/JDialog.min.js"></script>
<script>
KindEditor.ready(function(K) {
K.create('textarea[name="content1"]', {
/**
* 七牛云上传 API
*/
uploadJson : K.basePath+'php/qiniu/upload_json.php',
fileManagerJson : K.basePath+'php/qiniu/file_manager_json.php',
imageSearchJson : K.basePath+'php/qiniu/image_search_json.php', //图片搜索url
imageGrapJson : K.basePath+'php/qiniu/image_grap_json.php', //抓取选中的搜索图片地址
dialogOffset : 0, //对话框距离页面顶部的位置,默认为0居中,
allowFileManager : true,
allowImageUpload : true,
allowMediaUpload : true,
afterCreate : function() {
var self = this;
K.ctrl(document, 13, function() {
self.sync();
K('form[name=example]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function() {
self.sync();
K('form[name=example]')[0].submit();
});
},
//错误处理 handler
errorMsgHandler : function(message, type) {
try {
JDialog.msg({type:type, content:message, timer:2000});
} catch (Error) {
alert(message);
}
}
});
K.create('textarea[name="content2"]', {
/**
* 通用上传 API
*/
uploadJson : K.basePath+'php/default/upload_json.php',
fileManagerJson : K.basePath+'php/default/file_manager_json.php',
imageSearchJson : K.basePath+'php/default/image_search_json.php', //图片搜索url
imageGrapJson : K.basePath+'php/default/image_grap_json.php', //抓取选中的搜索图片地址
allowFileManager : true,
allowImageUpload : true,
allowMediaUpload : true,
themeType : "black", //主题
//错误处理 handler
errorMsgHandler : function(message, type) {
try {
JDialog.msg({type:type, content:message, timer:2000});
} catch (Error) {
alert(message);
}
}
});
K.create('textarea[name="content3"]', {
/**
* 通用上传 API
*/
uploadJson : K.basePath+'php/default/upload_json.php',
fileManagerJson : K.basePath+'php/default/file_manager_json.php',
imageSearchJson : K.basePath+'php/default/image_search_json.php', //图片搜索url
imageGrapJson : K.basePath+'php/default/image_grap_json.php', //抓取选中的搜索图片地址
allowFileManager : true,
allowImageUpload : true,
allowMediaUpload : true,
themeType : "grey", //主题
//错误处理 handler
errorMsgHandler : function(message, type) {
try {
JDialog.msg({type:type, content:message, timer:2000});
} catch (Error) {
alert(message);
}
}
});
K.create('textarea[name="content4"]', {
/**
* 通用上传 API
*/
uploadJson : K.basePath+'php/default/upload_json.php',
fileManagerJson : K.basePath+'php/default/file_manager_json.php',
imageSearchJson : K.basePath+'php/default/image_search_json.php', //图片搜索url
imageGrapJson : K.basePath+'php/default/image_grap_json.php', //抓取选中的搜索图片地址
allowFileManager : true,
allowImageUpload : true,
allowMediaUpload : true,
themeType : "blue", //主题
//错误处理 handler
errorMsgHandler : function(message, type) {
try {
JDialog.msg({type:type, content:message, timer:2000});
} catch (Error) {
alert(message);
}
}
});
});
</script>
</head>
<body>
<div style="padding-bottom: 100px; padding-left: 50px;">
<div style="">
<h1>七牛云上传 API 版(Default), 老版本 UI 的请移步 <a href="old.html" target="_blank">这里</a> </h1>
<form name="example" method="post">
<textarea name="content1" style="width:900px;height:200px;visibility:hidden;"></textarea>
</form>
</div>
<div style="">
<h1>通用php文件上传 API 版(Black)</h1>
<form name="example" method="post">
<textarea name="content2" style="width:900px;height:200px;visibility:hidden;"></textarea>
</form>
</div>
<div style="">
<h1>通用php文件上传 API 版(Grey)</h1>
<form name="example" method="post">
<textarea name="content3" style="width:900px;height:200px;visibility:hidden;"></textarea>
</form>
</div>
<div style="">
<h1>通用php文件上传 API 版(Blue)</h1>
<form name="example" method="post">
<textarea name="content4" style="width:900px;height:200px;visibility:hidden;"></textarea>
</form>
</div>
</div>
</body>
</html>