show warning if build/src/ace.js is missing
This commit is contained in:
parent
badade8f4e
commit
cdaf4c1539
1 changed files with 48 additions and 38 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
var editor;
|
var editor;
|
||||||
var embedded_editor;
|
var embedded_editor;
|
||||||
$(function() {
|
$(function() {
|
||||||
|
if (typeof ace !== "undefined") {
|
||||||
ace.config.set("workerPath", "build/src-min");
|
ace.config.set("workerPath", "build/src-min");
|
||||||
editor = ace.edit("ace_editor_demo");
|
editor = ace.edit("ace_editor_demo");
|
||||||
editor.container.style.opacity = "";
|
editor.container.style.opacity = "";
|
||||||
|
|
@ -33,7 +34,16 @@ $(function() {
|
||||||
enableBasicAutocompletion: true
|
enableBasicAutocompletion: true
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
document.body.insertAdjacentHTML("afterbegin", '<div class="bs-docs-example">\
|
||||||
|
<div class="alert alert-error">\
|
||||||
|
<button type="button" class="close" data-dismiss="alert">\xd7</button>\
|
||||||
|
<strong>Oh No!</strong> Couldn\'t load <code>build/src/ace.js</code>.<br>\
|
||||||
|
You can build it by running <code>node Makefile.dryice.js</code><br>\
|
||||||
|
Or download older version by running <code>git submodule update --init --recursive</code><br>\
|
||||||
|
</div>\
|
||||||
|
</div>');
|
||||||
|
}
|
||||||
$("ul.menu-list").mousedown(function(e) {
|
$("ul.menu-list").mousedown(function(e) {
|
||||||
if (e.button === 1) {
|
if (e.button === 1) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue