image-dialog.html
1.8 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
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>ImageDialog Examples</title>
<link rel="stylesheet" href="../themes/default/default.css" />
<script src="../kindeditor.js"></script>
<script src="../lang/zh_CN.js"></script>
<script>
KindEditor.ready(function(K) {
var editor = K.editor({
allowFileManager : true
});
K('#image1').click(function() {
editor.loadPlugin('image', function() {
editor.plugin.imageDialog({
imageUrl : K('#url1').val(),
clickFn : function(url, title, width, height, border, align) {
K('#url1').val(url);
editor.hideDialog();
}
});
});
});
K('#image2').click(function() {
editor.loadPlugin('image', function() {
editor.plugin.imageDialog({
showLocal : false,
imageUrl : K('#url2').val(),
clickFn : function(url, title, width, height, border, align) {
K('#url2').val(url);
editor.hideDialog();
}
});
});
});
K('#image3').click(function() {
editor.loadPlugin('image', function() {
editor.plugin.imageDialog({
showRemote : false,
imageUrl : K('#url3').val(),
clickFn : function(url, title, width, height, border, align) {
K('#url3').val(url);
editor.hideDialog();
}
});
});
});
});
</script>
</head>
<body>
<p><input type="text" id="url1" value="" /> <input type="button" id="image1" value="选择图片" />(网络图片 + 本地上传)</p>
<p><input type="text" id="url2" value="" /> <input type="button" id="image2" value="选择图片" />(网络图片)</p>
<p><input type="text" id="url3" value="" /> <input type="button" id="image3" value="选择图片" />(本地上传)</p>
</body>
</html>