2
0

index.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>CodeMirror 2: Smalltalk mode</title>
  5. <link rel="stylesheet" href="../../lib/codemirror.css">
  6. <script src="../../lib/codemirror.js"></script>
  7. <script src="smalltalk.js"></script>
  8. <link rel="stylesheet" href="../../theme/default.css">
  9. <link rel="stylesheet" href="../../css/docs.css">
  10. <style>
  11. .CodeMirror {border: 2px solid #dee; border-right-width: 10px;}
  12. .CodeMirror-gutter {border: none; background: #dee;}
  13. .CodeMirror-gutter pre {color: white; font-weight: bold;}
  14. </style>
  15. </head>
  16. <body>
  17. <h1>CodeMirror 2: Smalltalk mode</h1>
  18. <form><textarea id="code" name="code">
  19. "
  20. This is a test of the Smalltalk code
  21. "
  22. Seaside.WAComponent subclass: #MyCounter [
  23. | count |
  24. MyCounter class &gt;&gt; canBeRoot [ ^true ]
  25. initialize [
  26. super initialize.
  27. count := 0.
  28. ]
  29. states [ ^{ self } ]
  30. renderContentOn: html [
  31. html heading: count.
  32. html anchor callback: [ count := count + 1 ]; with: '++'.
  33. html space.
  34. html anchor callback: [ count := count - 1 ]; with: '--'.
  35. ]
  36. ]
  37. MyCounter registerAsApplication: 'mycounter'
  38. </textarea></form>
  39. <script>
  40. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  41. lineNumbers: true,
  42. matchBrackets: true,
  43. mode: "text/x-stsrc",
  44. indentUnit: 4
  45. });
  46. </script>
  47. <p>Simple Smalltalk mode.</p>
  48. <p><strong>MIME types defined:</strong> <code>text/x-stsrc</code>.</p>
  49. </body>
  50. </html>