File size: 1,342 Bytes
08c964e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | ace.define(
'ace/ext/linking',
['require', 'exports', 'module', 'ace/editor', 'ace/config'],
function (e, t, n) {
function i(e) {
var n = e.editor,
r = e.getAccelKey()
if (r) {
var n = e.editor,
i = e.getDocumentPosition(),
s = n.session,
o = s.getTokenAt(i.row, i.column)
t.previousLinkingHover && t.previousLinkingHover != o && n._emit('linkHoverOut'),
n._emit('linkHover', { position: i, token: o }),
(t.previousLinkingHover = o)
} else t.previousLinkingHover && (n._emit('linkHoverOut'), (t.previousLinkingHover = !1))
}
function s(e) {
var t = e.getAccelKey(),
n = e.getButton()
if (n == 0 && t) {
var r = e.editor,
i = e.getDocumentPosition(),
s = r.session,
o = s.getTokenAt(i.row, i.column)
r._emit('linkClick', { position: i, token: o })
}
}
var r = e('../editor').Editor
e('../config').defineOptions(r.prototype, 'editor', {
enableLinking: {
set: function (e) {
e
? (this.on('click', s), this.on('mousemove', i))
: (this.off('click', s), this.off('mousemove', i))
},
value: !1,
},
}),
(t.previousLinkingHover = !1)
}
)
;(function () {
ace.require(['ace/ext/linking'], function (m) {
if (typeof module == 'object' && typeof exports == 'object' && module) {
module.exports = m
}
})
})()
|