|
@@ -22,6 +22,7 @@ $(document).ready(function() {
|
|
|
var activeMode = 'html';
|
|
var activeMode = 'html';
|
|
|
var currentHash;
|
|
var currentHash;
|
|
|
var editor;
|
|
var editor;
|
|
|
|
|
+ var editorSession;
|
|
|
var editorStorage = new LocalStorageDraft();
|
|
var editorStorage = new LocalStorageDraft();
|
|
|
var saveTimeout1;
|
|
var saveTimeout1;
|
|
|
var saveTimeout2;
|
|
var saveTimeout2;
|
|
@@ -55,11 +56,19 @@ $(document).ready(function() {
|
|
|
// $window.resize(onResize);
|
|
// $window.resize(onResize);
|
|
|
// onResize();
|
|
// onResize();
|
|
|
|
|
|
|
|
|
|
+ function initEditor() {
|
|
|
|
|
+ editor = ace.edit("editor");
|
|
|
|
|
+ editorSession = editor.getSession();
|
|
|
|
|
+ editor.setTheme("ace/theme/eclipse");
|
|
|
|
|
+ editor.$blockScrolling = Infinity;
|
|
|
|
|
+ editorSession.setUseWrapMode(true);
|
|
|
|
|
+ if(_webSandboxFiles) {
|
|
|
|
|
+ editorSession.setMode("ace/mode/html");
|
|
|
|
|
+ editorSession.setValue(_webSandboxFiles.html[0].content);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
- // editor = ace.edit("editor");
|
|
|
|
|
- // editor.setTheme("ace/theme/eclipse");
|
|
|
|
|
- // editor.$blockScrolling = Infinity;
|
|
|
|
|
- // editor.getSession().setUseWrapMode(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// /**
|
|
// /**
|
|
@@ -291,4 +300,7 @@ $(document).ready(function() {
|
|
|
// $revertEditor.click(revertEditor);
|
|
// $revertEditor.click(revertEditor);
|
|
|
// $.get('/menu', menu => $('#site-menu').html(menu), 'html');
|
|
// $.get('/menu', menu => $('#site-menu').html(menu), 'html');
|
|
|
// loadExampleList();
|
|
// loadExampleList();
|
|
|
|
|
+
|
|
|
|
|
+ initEditor();
|
|
|
|
|
+
|
|
|
});
|
|
});
|