Skip to content

Commit cc1f80e

Browse files
committed
Better formatting for menu buttons and editor.
1 parent d336007 commit cc1f80e

2 files changed

Lines changed: 59 additions & 14 deletions

File tree

index.css

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ iframe {
6464
z-index: 0;
6565
}
6666

67-
#editor {
67+
#editor-container {
6868
position: absolute;
6969
left: 0px;
7070
top: 0px;
@@ -75,6 +75,19 @@ iframe {
7575
z-index: 1;
7676
}
7777

78+
.ace_scrollbar-v { display: none !important; }
79+
80+
#editor {
81+
margin: 0 0;
82+
margin-top: 35px;
83+
width: 480px;
84+
height: 500px;
85+
background-color: rgb(40, 44, 52);
86+
border-right: solid 1px black;
87+
z-index: 1;
88+
overflow: hidden !important;
89+
}
90+
7891
.ace_gutter {
7992
background: rgb(40, 44, 52) !important;
8093
}
@@ -139,9 +152,34 @@ a:visited { color: white; }
139152
z-index: 100;
140153
}
141154

155+
#tutorial-save {
156+
width: 90px;
157+
height: 18px;
158+
left: 360px;
159+
display: inline;
160+
text-align: center;
161+
text-decoration: none;
162+
top: 5px;
163+
color: #FFFFFF;
164+
z-index: 100;
165+
position: absolute;
166+
font-weight: 900;
167+
font-size: 16px;
168+
line-height: 0.9em;
169+
z-index: 100;
170+
border: solid 1px #ffffff;
171+
background-color: #000000;
172+
padding: 3px;
173+
padding-left: 10px;
174+
padding-right: 10px;
175+
}
176+
142177
#tutorial-next {
143-
left: 413px;
178+
width: 90px;
179+
height: 18px;
180+
left: 240px;
144181
text-decoration: none;
182+
text-align: center;
145183
top: 5px;
146184
color: #FFFFFF;
147185
z-index: 100;
@@ -158,8 +196,11 @@ a:visited { color: white; }
158196
}
159197

160198
#tutorial-prev {
161-
left: 345px;
199+
width: 90px;
200+
height: 18px;
201+
left: 120px;
162202
text-decoration: none;
203+
text-align: center;
163204
top: 5px;
164205
color: #FFFFFF;
165206
z-index: 100;
@@ -176,7 +217,7 @@ a:visited { color: white; }
176217
}
177218

178219
#tutorial-link-pointer {
179-
left: 610px;
220+
left: 345px;
180221
top: 225px;
181222
color: #555555;
182223
z-index: 100;

index.html

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@
4141

4242
<a id="tutorial-menu" href="index.html">menu</a>
4343
<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>
4750

4851
<div id="tutorial">
4952
<div>
@@ -124,8 +127,9 @@ <h1>Tutorials</h1>
124127
var editor = ace.edit("editor");
125128
editor.setTheme("ace/theme/monokai");
126129
editor.session.setMode("ace/mode/ruby");
130+
editor.session.setUseWrapMode(true);
127131

128-
editor.setFontSize("14px");
132+
editor.setFontSize("12px");
129133
editor.commands.addCommand({
130134
name: "save",
131135
exec: save,
@@ -164,11 +168,10 @@ <h1>Tutorials</h1>
164168
});
165169

166170
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");
172175

173176
// This call is required for the editor to fix all of
174177
// its inner structure for adapting to a change in size
@@ -231,9 +234,10 @@ <h1>Tutorials</h1>
231234
}
232235
var tutorial_step = tutorial.steps[number.toString()];
233236
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);
235238
editor.gotoLine(0);
236239
editor.clearSelection();
240+
$(".ace_scrollbar").attr("display: none !important");
237241
save();
238242
}
239243

0 commit comments

Comments
 (0)