diff --git a/doc/site/js/main.js b/doc/site/js/main.js index b24383c0..514fad42 100644 --- a/doc/site/js/main.js +++ b/doc/site/js/main.js @@ -1,39 +1,49 @@ var editor; var embedded_editor; $(function() { - ace.config.set("workerPath", "build/src-min"); - editor = ace.edit("ace_editor_demo"); - editor.container.style.opacity = ""; - embedded_editor = ace.edit("embedded_ace_code"); - embedded_editor.container.style.opacity = ""; - embedded_editor.session.setMode("ace/mode/html"); - embedded_editor.setAutoScrollEditorIntoView(true); - embedded_editor.setOption("maxLines", 40); - - editor.setOptions({ - maxLines: 30, - mode: "ace/mode/javascript", - autoScrollEditorIntoView: true - }); - - ace.config.loadModule("ace/ext/emmet", function() { - ace.require("ace/lib/net").loadScript("http://nightwing.github.io/emmet-core/emmet.js", function() { - embedded_editor.setOption("enableEmmet", true); - editor.setOption("enableEmmet", true); - }); - }); - - ace.config.loadModule("ace/ext/language_tools", function() { - embedded_editor.setOptions({ - enableSnippets: true, - enableBasicAutocompletion: true - }); + if (typeof ace !== "undefined") { + ace.config.set("workerPath", "build/src-min"); + editor = ace.edit("ace_editor_demo"); + editor.container.style.opacity = ""; + embedded_editor = ace.edit("embedded_ace_code"); + embedded_editor.container.style.opacity = ""; + embedded_editor.session.setMode("ace/mode/html"); + embedded_editor.setAutoScrollEditorIntoView(true); + embedded_editor.setOption("maxLines", 40); + editor.setOptions({ - enableSnippets: true, - enableBasicAutocompletion: true + maxLines: 30, + mode: "ace/mode/javascript", + autoScrollEditorIntoView: true }); - }); - + + ace.config.loadModule("ace/ext/emmet", function() { + ace.require("ace/lib/net").loadScript("http://nightwing.github.io/emmet-core/emmet.js", function() { + embedded_editor.setOption("enableEmmet", true); + editor.setOption("enableEmmet", true); + }); + }); + + ace.config.loadModule("ace/ext/language_tools", function() { + embedded_editor.setOptions({ + enableSnippets: true, + enableBasicAutocompletion: true + }); + editor.setOptions({ + enableSnippets: true, + enableBasicAutocompletion: true + }); + }); + } else { + document.body.insertAdjacentHTML("afterbegin", '
build/src/ace.js.node Makefile.dryice.jsgit submodule update --init --recursive