Sha256: fd6a6ebb2d74eaf58f7184fd75dcff4944784f7af55f51be9d40217690edd0b3

Contents?: true

Size: 1.42 KB

Versions: 98

Compression:

Stored size: 1.42 KB

Contents

define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"], function(require, exports, module) {

var Editor = require("ace/editor").Editor;

require("../config").defineOptions(Editor.prototype, "editor", {
    enableLinking: {
        set: function(val) {
            if (val) {
                this.on("click", onClick);
                this.on("mousemove", onMouseMove);
            } else {
                this.off("click", onClick);
                this.off("mousemove", onMouseMove);
            }
        },
        value: 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);

        editor._emit("linkHover", {position: docPos, token: token});
    }
}

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});
    }
}

});
                (function() {
                    window.require(["ace/ext/linking"], function() {});
                })();
            

Version data entries

98 entries across 98 versions & 4 rubygems

Version Path
optimacms-0.1.61 spec/dummy/public/js/ace/src/ext-linking.js
optimacms-0.3.9 spec/dummy/public/js/ace/src/ext-linking.js
optimacms-0.3.8 spec/dummy/public/js/ace/src/ext-linking.js
optimacms-0.3.7 spec/dummy/public/js/ace/src/ext-linking.js
optimacms-0.3.6 spec/dummy/public/js/ace/src/ext-linking.js
optimacms-0.3.5 spec/dummy/public/js/ace/src/ext-linking.js
optimacms-0.3.2 spec/dummy/public/js/ace/src/ext-linking.js
optimacms-0.3.1 spec/dummy/public/js/ace/src/ext-linking.js
optimacms-0.2.23 spec/dummy/public/js/ace/src/ext-linking.js
ace-rails-ap-4.1.2 vendor/assets/javascripts/ace/ext-linking.js
optimacms-0.2.22 spec/dummy/public/js/ace/src/ext-linking.js
optimacms-0.2.21 spec/dummy/public/js/ace/src/ext-linking.js
optimacms-0.2.20 spec/dummy/public/js/ace/src/ext-linking.js
optimacms-0.2.19 spec/dummy/public/js/ace/src/ext-linking.js
optimacms-0.2.18 spec/dummy/public/js/ace/src/ext-linking.js
ace-rails-ap-4.1.1 vendor/assets/javascripts/ace/ext-linking.js
optimacms-0.2.17 spec/dummy/public/js/ace/src/ext-linking.js
optimacms-0.2.16 spec/dummy/public/js/ace/src/ext-linking.js
optimacms-0.2.15 spec/dummy/public/js/ace/src/ext-linking.js
optimacms-0.2.14 spec/dummy/public/js/ace/src/ext-linking.js