file-dialog.html 833 B

12345678910111213141516171819202122232425262728293031
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>fileDialog Examples</title>
  6. <link rel="stylesheet" href="../themes/default/default.css" />
  7. <script src="../kindeditor.js"></script>
  8. <script src="../lang/zh_CN.js"></script>
  9. <script>
  10. KindEditor.ready(function(K) {
  11. var editor = K.editor({
  12. allowFileManager : true
  13. });
  14. K('#insertfile').click(function() {
  15. editor.loadPlugin('insertfile', function() {
  16. editor.plugin.fileDialog({
  17. fileUrl : K('#url').val(),
  18. clickFn : function(url, title) {
  19. K('#url').val(url);
  20. editor.hideDialog();
  21. }
  22. });
  23. });
  24. });
  25. });
  26. </script>
  27. </head>
  28. <body>
  29. <input type="text" id="url" value="" /> <input type="button" id="insertfile" value="选择文件" />
  30. </body>
  31. </html>