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

committed by
Sebastian Serth

parent
0a473c7fd3
commit
b00d45521b
33
vendor/assets/javascripts/ace/ext-linking.js
vendored
33
vendor/assets/javascripts/ace/ext-linking.js
vendored
@ -1,14 +1,12 @@
|
||||
define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"], function(require, exports, module) {
|
||||
|
||||
var Editor = require("ace/editor").Editor;
|
||||
|
||||
define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"], function(require, exports, module){var Editor = require("../editor").Editor;
|
||||
require("../config").defineOptions(Editor.prototype, "editor", {
|
||||
enableLinking: {
|
||||
set: function(val) {
|
||||
set: function (val) {
|
||||
if (val) {
|
||||
this.on("click", onClick);
|
||||
this.on("mousemove", onMouseMove);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
this.off("click", onClick);
|
||||
this.off("mousemove", onMouseMove);
|
||||
}
|
||||
@ -16,46 +14,43 @@ require("../config").defineOptions(Editor.prototype, "editor", {
|
||||
value: false
|
||||
}
|
||||
});
|
||||
|
||||
exports.previousLinkingHover = false;
|
||||
|
||||
function onMouseMove(e) {
|
||||
var editor = e.editor;
|
||||
var ctrl = e.getAccelKey();
|
||||
|
||||
if (ctrl) {
|
||||
var editor = e.editor;
|
||||
var docPos = e.getDocumentPosition();
|
||||
var session = editor.session;
|
||||
var token = session.getTokenAt(docPos.row, docPos.column);
|
||||
|
||||
if (exports.previousLinkingHover && exports.previousLinkingHover != token) {
|
||||
editor._emit("linkHoverOut");
|
||||
}
|
||||
editor._emit("linkHover", {position: docPos, token: token});
|
||||
editor._emit("linkHover", { position: docPos, token: token });
|
||||
exports.previousLinkingHover = token;
|
||||
} else if (exports.previousLinkingHover) {
|
||||
}
|
||||
else if (exports.previousLinkingHover) {
|
||||
editor._emit("linkHoverOut");
|
||||
exports.previousLinkingHover = false;
|
||||
}
|
||||
}
|
||||
|
||||
function onClick(e) {
|
||||
var ctrl = e.getAccelKey();
|
||||
var button = e.getButton();
|
||||
|
||||
if (button == 0 && ctrl) {
|
||||
var editor = e.editor;
|
||||
var docPos = e.getDocumentPosition();
|
||||
var session = editor.session;
|
||||
var token = session.getTokenAt(docPos.row, docPos.column);
|
||||
|
||||
editor._emit("linkClick", {position: docPos, token: token});
|
||||
editor._emit("linkClick", { position: docPos, token: token });
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
(function() {
|
||||
window.require(["ace/ext/linking"], function() {});
|
||||
}); (function() {
|
||||
window.require(["ace/ext/linking"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
Reference in New Issue
Block a user