semicolonify demo files;
This commit is contained in:
parent
753dbbece5
commit
fada97f807
7 changed files with 59 additions and 62 deletions
|
|
@ -33,8 +33,8 @@ define(function(require, exports, module) {
|
|||
"use strict";
|
||||
|
||||
var LineWidgets = require("ace/line_widgets").LineWidgets;
|
||||
var Editor = require("ace/editor").Editor
|
||||
var Renderer = require("ace/virtual_renderer").VirtualRenderer
|
||||
var Editor = require("ace/editor").Editor;
|
||||
var Renderer = require("ace/virtual_renderer").VirtualRenderer;
|
||||
var dom = require("ace/lib/dom");
|
||||
|
||||
|
||||
|
|
@ -42,12 +42,12 @@ require("ace/commands/default_commands").commands.push({
|
|||
name: "openInlineEditor",
|
||||
bindKey: "F3",
|
||||
exec: function(editor) {
|
||||
var split = env.split
|
||||
var s = editor.session
|
||||
var inlineEditor = new Editor(new Renderer())
|
||||
var splitSession = split.$cloneSession(s)
|
||||
var split = window.env.split;
|
||||
var s = editor.session;
|
||||
var inlineEditor = new Editor(new Renderer());
|
||||
var splitSession = split.$cloneSession(s);
|
||||
|
||||
var row = editor.getCursorPosition().row
|
||||
var row = editor.getCursorPosition().row;
|
||||
if (editor.session.lineWidgets && editor.session.lineWidgets[row]) {
|
||||
editor.session.lineWidgets[row].destroy();
|
||||
return;
|
||||
|
|
@ -70,36 +70,36 @@ require("ace/commands/default_commands").commands.push({
|
|||
}
|
||||
|
||||
var h = rowCount*editor.renderer.layerConfig.lineHeight;
|
||||
inlineEditor.container.style.height = h + "px"
|
||||
inlineEditor.container.style.height = h + "px";
|
||||
|
||||
el.style.position = "absolute"
|
||||
el.style.zIndex = "4"
|
||||
el.style.borderTop = "solid blue 2px"
|
||||
el.style.borderBottom = "solid blue 2px"
|
||||
el.style.position = "absolute";
|
||||
el.style.zIndex = "4";
|
||||
el.style.borderTop = "solid blue 2px";
|
||||
el.style.borderBottom = "solid blue 2px";
|
||||
|
||||
inlineEditor.setSession(splitSession)
|
||||
inlineEditor.setSession(splitSession);
|
||||
editor.session.widgetManager.addLineWidget(w);
|
||||
|
||||
var kb = {
|
||||
handleKeyboard:function(_,hashId, keyString) {
|
||||
if (hashId == 0 && keyString == "esc") {
|
||||
if (hashId === 0 && keyString === "esc") {
|
||||
w.destroy();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
w.destroy = function() {
|
||||
editor.keyBinding.removeKeyboardHandler(kb);
|
||||
s.widgetManager.removeLineWidget(w);
|
||||
}
|
||||
};
|
||||
|
||||
editor.keyBinding.addKeyboardHandler(kb)
|
||||
inlineEditor.keyBinding.addKeyboardHandler(kb)
|
||||
editor.keyBinding.addKeyboardHandler(kb);
|
||||
inlineEditor.keyBinding.addKeyboardHandler(kb);
|
||||
editor.on("changeSession", function(e) {
|
||||
w.el.parentNode && w.el.parentNode.removeChild(w.el)
|
||||
w.el.parentNode && w.el.parentNode.removeChild(w.el);
|
||||
});
|
||||
inlineEditor.setTheme("ace/theme/solarized_light")
|
||||
inlineEditor.setTheme("ace/theme/solarized_light");
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue