Sha256: 5edc97ec3c66e93fd3c3e0668c56dc7a809be251a02ac250c5f01485fe1ec686

Contents?: true

Size: 1.68 KB

Versions: 6

Compression:

Stored size: 1.68 KB

Contents

ace.define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"], function(require, exports, module) {
"use strict";
var dom = require("ace/lib/dom");
var lang = require("ace/lib/lang");

var StatusBar = function(editor, parentNode) {
    this.element = dom.createElement("div");
    this.element.className = "ace_status-indicator";
    this.element.style.cssText = "display: inline-block;";
    parentNode.appendChild(this.element);

    var statusUpdate = lang.delayedCall(function(){
        this.updateStatus(editor)
    }.bind(this)).schedule.bind(null, 100);
    
    editor.on("changeStatus", statusUpdate);
    editor.on("changeSelection", statusUpdate);
    editor.on("keyboardActivity", statusUpdate);
};

(function(){
    this.updateStatus = function(editor) {
        var status = [];
        function add(str, separator) {
            str && status.push(str, separator || "|");
        }

        add(editor.keyBinding.getStatusText(editor));
        if (editor.commands.recording)
            add("REC");
        
        var sel = editor.selection;
        var c = sel.lead;
        
        if (!sel.isEmpty()) {
            var r = editor.getSelectionRange();
            add("(" + (r.end.row - r.start.row) + ":"  +(r.end.column - r.start.column) + ")", " ");
        }
        add(c.row + ":" + c.column, " ");        
        if (sel.rangeCount)
            add("[" + sel.rangeCount + "]", " ");
        status.pop();
        this.element.textContent = status.join("");
    };
}).call(StatusBar.prototype);

exports.StatusBar = StatusBar;

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

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
fiveapples-0.0.7 lib/openui5-runtime-1.60.23/resources/sap/ui/codeeditor/js/ace/ext-statusbar-dbg.js
fiveapples-0.0.6 lib/openui5-runtime-1.60.23/resources/sap/ui/codeeditor/js/ace/ext-statusbar-dbg.js
fiveapples-0.0.5 lib/openui5-runtime-1.60.23/resources/sap/ui/codeeditor/js/ace/ext-statusbar-dbg.js
jekyll-openui5-0.1.0 assets/sap/ui/codeeditor/js/ace/ext-statusbar-dbg.js
treport-1.1.2 public/treport/src-noconflict/ext-statusbar.js
treport-1.1.1 public/treport/src-noconflict/ext-statusbar.js