r.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ({
  2. optimize: "none",
  3. preserveLicenseComments: false,
  4. name: "node_modules/almond/almond",
  5. baseUrl: "../../",
  6. paths: {
  7. ace : "lib/ace",
  8. demo: "demo/kitchen-sink"
  9. },
  10. packages: [
  11. ],
  12. include: [
  13. "ace/ace"
  14. ],
  15. exclude: [
  16. ],
  17. out: "./packed.js",
  18. useStrict: true,
  19. wrap: false
  20. })<!DOCTYPE html>
  21. <html>
  22. <head>
  23. <title>Editor</title>
  24. <link rel="stylesheet" href="../kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
  25. </head>
  26. <body>
  27. <div id="optionsPanel" style="position:absolute;height:100%;width:260px">
  28. <a href="http://c9.io" title="Cloud9 IDE | Your code anywhere, anytime">
  29. <img id="c9-logo" src="../kitchen-sink/logo.png" style="width: 172px;margin: -9px 30px -12px 51px;">
  30. </a>
  31. </div>
  32. <pre id="editor-container">
  33. <div style="color:black; padding: 10px">
  34. demo showing Ace usage with r.js:
  35. install r.js and almond
  36. and run `<code>r.js -o demo/r.js/build.js</code>`
  37. note that you also need ace/build/src to lazy load modes and themes
  38. require("ace/config").set("basePath", "../../build/src");
  39. require("ace/config").set("packaged", true);
  40. <div>
  41. </pre>
  42. <script src="./packed.js" data-ace-base="src" type="text/javascript" charset="utf-8"></script>
  43. <script type="text/javascript" charset="utf-8">
  44. require("ace/config").set("basePath", "../../build/src")
  45. require("ace/config").set("packaged", true)
  46. var editor = require("ace/ace").edit("editor-container");
  47. editor.session.setMode("ace/mode/javascript");
  48. // editor.session.setValue("var editor = Ace!")
  49. </script>
  50. </body>
  51. </html>