requireJS fixes for the editor
This commit is contained in:
parent
fe837c321a
commit
872afa6904
6 changed files with 16 additions and 12 deletions
|
|
@ -7,7 +7,8 @@ require.def("ace/Editor",
|
|||
"ace/Search",
|
||||
"ace/BackgroundTokenizer",
|
||||
"ace/Range",
|
||||
], function(ace, TextInput, KeyBinding, Document, Search, BackgroundTokenizer, Range) {
|
||||
"ace/MEventEmitter"
|
||||
], function(ace, TextInput, KeyBinding, Document, Search, BackgroundTokenizer, Range, MEventEmitter) {
|
||||
|
||||
var Editor = function(renderer, doc) {
|
||||
var container = renderer.getContainerElement();
|
||||
|
|
@ -44,7 +45,7 @@ var Editor = function(renderer, doc) {
|
|||
|
||||
(function(){
|
||||
|
||||
ace.implement(this, ace.MEventEmitter);
|
||||
ace.implement(this, MEventEmitter);
|
||||
|
||||
this.$forwardEvents = {
|
||||
gutterclick: 1,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
require.def("ace/KeyBinding", ["ace/ace"], function(ace) {
|
||||
require.def("ace/KeyBinding",
|
||||
["ace/ace", "ace/conf/keybindings/default_mac", "ace/conf/keybindings/default_win"],
|
||||
function(ace, default_mac, default_win) {
|
||||
|
||||
var KeyBinding = function(element, editor, config) {
|
||||
this.editor = editor;
|
||||
|
|
@ -53,8 +55,8 @@ var KeyBinding = function(element, editor, config) {
|
|||
|
||||
this.setConfig = function(config) {
|
||||
this.config = config || ace.isMac
|
||||
? ace.KeyBinding.default_mac
|
||||
: ace.KeyBinding.default_win;
|
||||
? default_mac
|
||||
: default_win;
|
||||
if (typeof this.config.reverse == "undefined")
|
||||
this.config.reverse = ace.objectReverse(this.config, "|");
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@ require.def("ace/VirtualRenderer",
|
|||
"ace/layer/Marker",
|
||||
"ace/layer/Text",
|
||||
"ace/layer/Cursor",
|
||||
"ace/ScrollBar"
|
||||
], function(ace, GutterLayer, MarkerLayer, TextLayer, CursorLayer, ScrollBar) {
|
||||
"ace/ScrollBar",
|
||||
"ace/MEventEmitter"
|
||||
], function(ace, GutterLayer, MarkerLayer, TextLayer, CursorLayer, ScrollBar, MEventEmitter) {
|
||||
|
||||
var VirtualRenderer = function(container) {
|
||||
this.container = container;
|
||||
|
|
@ -62,7 +63,7 @@ var VirtualRenderer = function(container) {
|
|||
|
||||
(function() {
|
||||
|
||||
ace.implement(this, ace.MEventEmitter);
|
||||
ace.implement(this, MEventEmitter);
|
||||
|
||||
this.setDocument = function(doc) {
|
||||
this.lines = doc.lines;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
require.def("ace/conf/keybinding/default_mac", function() {
|
||||
require.def("ace/conf/keybindings/default_mac", function() {
|
||||
|
||||
return {
|
||||
"selectall": "Meta-A",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
require.def("ace/conf/keybinding/default_win", function() {
|
||||
require.def("ace/conf/keybindings/default_win", function() {
|
||||
|
||||
return {
|
||||
"selectall": "Control-A",
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ require.def("ace/lib/lang", function() {
|
|||
return copy;
|
||||
};
|
||||
|
||||
this.arrayToMap = function(arr) {
|
||||
lang.arrayToMap = function(arr) {
|
||||
var map = {};
|
||||
for (var i=0; i<arr.length; i++) {
|
||||
map[arr[i]] = 1;
|
||||
|
|
@ -43,7 +43,7 @@ require.def("ace/lib/lang", function() {
|
|||
|
||||
};
|
||||
|
||||
this.objectReverse = function(obj, keySplit) {
|
||||
lang.objectReverse = function(obj, keySplit) {
|
||||
var i, j, l, key,
|
||||
ret = {};
|
||||
for (i in obj) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue