Update ACE Editor to version 1.32.6
This commit is contained in:

committed by
Sebastian Serth

parent
0a473c7fd3
commit
b00d45521b
24
vendor/assets/javascripts/ace/ext-spellcheck.js
vendored
24
vendor/assets/javascripts/ace/ext-spellcheck.js
vendored
@@ -1,8 +1,6 @@
|
||||
define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"], function(require, exports, module) {
|
||||
"use strict";
|
||||
define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"], function(require, exports, module){"use strict";
|
||||
var event = require("../lib/event");
|
||||
|
||||
exports.contextMenuHandler = function(e){
|
||||
exports.contextMenuHandler = function (e) {
|
||||
var host = e.target;
|
||||
var text = host.textInput.getElement();
|
||||
if (!host.selection.isEmpty())
|
||||
@@ -10,7 +8,6 @@ exports.contextMenuHandler = function(e){
|
||||
var c = host.getCursorPosition();
|
||||
var r = host.session.getWordRange(c.row, c.column);
|
||||
var w = host.session.getTextRange(r);
|
||||
|
||||
host.session.tokenRe.lastIndex = 0;
|
||||
if (!host.session.tokenRe.test(w))
|
||||
return;
|
||||
@@ -20,15 +17,12 @@ exports.contextMenuHandler = function(e){
|
||||
text.setSelectionRange(w.length, w.length + 1);
|
||||
text.setSelectionRange(0, 0);
|
||||
text.setSelectionRange(0, w.length);
|
||||
|
||||
var afterKeydown = false;
|
||||
event.addListener(text, "keydown", function onKeydown() {
|
||||
event.removeListener(text, "keydown", onKeydown);
|
||||
afterKeydown = true;
|
||||
});
|
||||
|
||||
host.textInput.setInputHandler(function(newVal) {
|
||||
console.log(newVal , value, text.selectionStart, text.selectionEnd);
|
||||
host.textInput.setInputHandler(function (newVal) {
|
||||
if (newVal == value)
|
||||
return '';
|
||||
if (newVal.lastIndexOf(value, 0) === 0)
|
||||
@@ -45,14 +39,13 @@ exports.contextMenuHandler = function(e){
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
return newVal;
|
||||
});
|
||||
};
|
||||
var Editor = require("../editor").Editor;
|
||||
require("../config").defineOptions(Editor.prototype, "editor", {
|
||||
spellcheck: {
|
||||
set: function(val) {
|
||||
set: function (val) {
|
||||
var text = this.textInput.getElement();
|
||||
text.spellcheck = !!val;
|
||||
if (!val)
|
||||
@@ -64,8 +57,11 @@ require("../config").defineOptions(Editor.prototype, "editor", {
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
(function() {
|
||||
window.require(["ace/ext/spellcheck"], function() {});
|
||||
}); (function() {
|
||||
window.require(["ace/ext/spellcheck"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
Reference in New Issue
Block a user