statusbar.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <title>ACE Editor StatusBar Demo</title>
  7. <style type="text/css" media="screen">
  8. body {
  9. overflow: hidden;
  10. }
  11. #editor {
  12. margin: 0;
  13. position: absolute;
  14. top: 0;
  15. bottom: 20px;
  16. left: 0;
  17. right: 0;
  18. }
  19. #statusBar {
  20. margin: 0;
  21. padding: 0;
  22. position: absolute;
  23. left: 0;
  24. right: 0;
  25. bottom: 0;
  26. height: 20px;
  27. background-color: rgb(245, 245, 245);
  28. color: gray;
  29. }
  30. .ace_status-indicator {
  31. color: gray;
  32. position: absolute;
  33. right: 0;
  34. border-left: 1px solid;
  35. }
  36. </style>
  37. </head>
  38. <body>
  39. <pre id="editor"></pre>
  40. <div id="statusBar">ace rocks!</div>
  41. <script src="kitchen-sink/require.js"></script>
  42. <script>
  43. // setup paths
  44. require.config({paths: { "ace" : "../lib/ace"}});
  45. // load ace and extensions
  46. require(["ace/ace", "ace/ext/statusbar"], function(ace) {
  47. var editor = ace.edit("editor");
  48. var StatusBar = ace.require("ace/ext/statusbar").StatusBar;
  49. // create a simple selection status indicator
  50. var statusBar = new StatusBar(editor, document.getElementById("statusBar"));
  51. editor.setTheme("ace/theme/dawn");
  52. editor.session.setMode("ace/mode/html");
  53. });
  54. </script>
  55. <script src="./show_own_source.js"></script>
  56. </body>
  57. </html>