This commit is contained in:
nightwing 2013-09-07 13:47:52 +04:00
commit 7b80bb793e
4 changed files with 15 additions and 6 deletions

View file

@ -6,10 +6,13 @@ $(function() {
editor.container.style.opacity = "";
embedded_editor = ace.edit("embedded_ace_code");
embedded_editor.container.style.opacity = "";
editor.session.setMode("ace/mode/javascript");
editor.session.setMode("ace/mode/javascript");
editor.session.setMode("ace/mode/javascript");
embedded_editor.session.setMode("ace/mode/html");
editor.setOptions({
maxLines: 30
})
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);

View file

@ -80,7 +80,7 @@ function add(x, y) {
var addResult = add(3, 2);
console.log(addResult);
</div>
</div>
<p id="embed_link"><a href="#nav=embedding">Learn how to embed this in your own site</a></p>
<p class="highlight_note">Looking for a more full-featured demo? Check out the
<a href="build/kitchen-sink.html" target="_blank">kitchen sink</a>.

View file

@ -90,7 +90,7 @@ var Autocomplete = function() {
this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler);
this.editor.off("changeSelection", this.changeListener);
this.editor.off("blur", this.changeListener);
this.editor.off("mousedown", this.changeListener);
this.editor.off("mousedown", this.mousedownListener);
this.editor.off("mousewheel", this.mousewheelListener);
this.changeTimer.cancel();

View file

@ -217,8 +217,11 @@ var optionsProvider = {
if (this["$" + name] === value)
return;
var opt = this.$options[name];
if (!opt)
if (!opt) {
if (typeof console != "undefined" && console.error)
console.error('misspelled option "' + name + '"');
return undefined;
}
if (opt.forwardTo)
return this[opt.forwardTo] && this[opt.forwardTo].setOption(name, value);
@ -229,8 +232,11 @@ var optionsProvider = {
},
getOption: function(name) {
var opt = this.$options[name];
if (!opt)
if (!opt) {
if (typeof console != "undefined" && console.error)
console.error('misspelled option "' + name + '"');
return undefined;
}
if (opt.forwardTo)
return this[opt.forwardTo] && this[opt.forwardTo].getOption(name);
return opt && opt.get ? opt.get.call(this) : this["$" + name];