Allow resizing the tutorial pane.
MODIFY
tutorials/basic/index.pug
tutorials/basic/index.pug
@@ -30,6 +30,7 @@ block mainTutorial
height: 100%;
padding: 0;
margin: 0;
+ overflow: hidden;
}
:markdown-it

MODIFY
tutorials/common/tutorials.css
tutorials/common/tutorials.css
@@ -12,6 +12,7 @@ html, body {
width: 100%;
height: 100%;
overflow: hidden;
+ display: flex;
}
.navbar #maincontent {
height: calc(100% - 60px);
@@ -28,9 +29,12 @@ html, body {
overflow-y: auto;
padding: 0.5em;
background: ivory;
+ resize: horizontal;
+ min-width: 10em;
}
#workframe {
overflow: hidden;
+ flex-grow: 100;
}
.codeblock .codeblock_entry {
width: calc(100% - 6em);

MODIFY
tutorials/common/tutorials.js
tutorials/common/tutorials.js
@@ -28,6 +28,7 @@ var processBlockInfo = {
' height: 100%;\n' +
' padding: 0;\n' +
' margin: 0;\n' +
+ ' overflow: hidden;\n' +
'}'
};
@@ -237,7 +238,10 @@ function start_keeper(alwaysKeep) {
key = 'src' + (block.attr('step') !== '1' ? block.attr('step') : '');
if (query[key]) {
try {
- var src = atob(query[key].replace(/\./g, '/').replace(/-/g, '+').replace(/_/g, '='));
+ /* Strip out white space and pluses, then convert ., -, and _ to /, +,
+ * =. By removing whitespace, the url is more robust against email
+ * handling. The others keep things short. */
+ var src = atob(query[key].replace(/(\s|\+)/g, '').replace(/\./g, '/').replace(/-/g, '+').replace(/_/g, '='));
src = pako.inflate(src, {to: 'string', raw: true});
if ($('.CodeMirror', block).length) {
$('.CodeMirror', block)[0].CodeMirror.setValue(src);

MODIFY
tutorials/editor/index.pug
tutorials/editor/index.pug
@@ -9,7 +9,9 @@ block mainTutorial
+codeblock('javascript', 1, undefined, true).
var map = geo.map({
- node: "#map"
+ node: "#map",
+ center: {x: 4.90, y: 52.37},
+ zoom: 14
});
var layer = map.createLayer('osm');
+codeblock_test('map has one osm layer from openstreetmap', [

ADD
tutorials/editor/thumb.jpg
tutorials/editor/thumb.jpg
Binary files /dev/null and b/tutorials/editor/thumb.jpg differ

Allow resizing the tutorial pane.