|
41 | 41 |
|
42 | 42 | <a id="tutorial-menu" href="index.html">menu</a> |
43 | 43 | <a id="tutorial-full" href="#" target="_blank">view full source</a> |
44 | | - <a id="tutorial-prev" href="#" style="display: none" onclick="tutorialLoadPreviousStep(); return false;">prev<br/>step</a> |
45 | | - <a id="tutorial-next" href="#" style="display: none" onclick="tutorialLoadNextStep(); return false;">next<br/>step</a> |
46 | | - <div id="editor"></div> |
| 44 | + <a id="tutorial-save" href="#" onclick="save(); return false;"><div style="margin-top: 3px">run</div></a> |
| 45 | + <a id="tutorial-prev" href="#" style="display: none" onclick="tutorialLoadPreviousStep(); return false;"><div style="margin-top: 3px">prev step</div></a> |
| 46 | + <a id="tutorial-next" href="#" style="display: none" onclick="tutorialLoadNextStep(); return false;"><div style="margin-top: 3px">next step</div></a> |
| 47 | + <div id="editor-container"> |
| 48 | + <div id="editor"></div> |
| 49 | + </div> |
47 | 50 |
|
48 | 51 | <div id="tutorial"> |
49 | 52 | <div> |
@@ -124,8 +127,9 @@ <h1>Tutorials</h1> |
124 | 127 | var editor = ace.edit("editor"); |
125 | 128 | editor.setTheme("ace/theme/monokai"); |
126 | 129 | editor.session.setMode("ace/mode/ruby"); |
| 130 | + editor.session.setUseWrapMode(true); |
127 | 131 |
|
128 | | - editor.setFontSize("14px"); |
| 132 | + editor.setFontSize("12px"); |
129 | 133 | editor.commands.addCommand({ |
130 | 134 | name: "save", |
131 | 135 | exec: save, |
@@ -164,11 +168,10 @@ <h1>Tutorials</h1> |
164 | 168 | }); |
165 | 169 |
|
166 | 170 | var heightUpdateFunction = function() { |
167 | | - // http://stackoverflow.com/questions/11584061/ |
168 | | - var newHeight = editor.getSession().getScreenLength() * editor.renderer.lineHeight + editor.renderer.scrollBar.getWidth(); |
169 | | - |
170 | | - $('#editor').height("540px"); |
171 | | - $('#editor-section').height("540px"); |
| 171 | + $('#editor').height("500px"); |
| 172 | + $('#editor').width("480px"); |
| 173 | + $('#editor-section').height("500px"); |
| 174 | + $('#editor-section').width("480px"); |
172 | 175 |
|
173 | 176 | // This call is required for the editor to fix all of |
174 | 177 | // its inner structure for adapting to a change in size |
@@ -231,9 +234,10 @@ <h1>Tutorials</h1> |
231 | 234 | } |
232 | 235 | var tutorial_step = tutorial.steps[number.toString()]; |
233 | 236 | document.getElementById("tutorial").innerHTML = tutorial_step.text.outerHTML; |
234 | | - editor.setValue("# Exec Code: ctrl + s or cmd + s.\n# Next Step: ctrl + k or cmd + k.\n# Prev Step: ctrl + p or cmd + p.\n\n" + tutorial_step.code); |
| 237 | + editor.setValue("" + tutorial_step.code); |
235 | 238 | editor.gotoLine(0); |
236 | 239 | editor.clearSelection(); |
| 240 | + $(".ace_scrollbar").attr("display: none !important"); |
237 | 241 | save(); |
238 | 242 | } |
239 | 243 |
|
|
0 commit comments