autocompletion.html 1008 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>ACE Autocompletion demo</title>
  6. <style type="text/css" media="screen">
  7. body {
  8. overflow: hidden;
  9. }
  10. #editor {
  11. margin: 0;
  12. position: absolute;
  13. top: 0;
  14. bottom: 0;
  15. left: 0;
  16. right: 0;
  17. }
  18. </style>
  19. </head>
  20. <body>
  21. <pre id="editor"></pre>
  22. <!-- load ace -->
  23. <script src="../src-noconflict/ace.js"></script>
  24. <!-- load ace language tools -->
  25. <script src="../src-noconflict/ext-language_tools.js"></script>
  26. <script>
  27. // trigger extension
  28. ace.require("ace/ext/language_tools");
  29. var editor = ace.edit("editor");
  30. editor.session.setMode("ace/mode/html");
  31. editor.setTheme("ace/theme/tomorrow");
  32. // enable autocompletion and snippets
  33. editor.setOptions({
  34. enableBasicAutocompletion: true,
  35. enableSnippets: true,
  36. enableLiveAutocompletion: false
  37. });
  38. </script>
  39. <script src="./show_own_source.js"></script>
  40. </body>
  41. </html>