How to use the pilot/oop.inherits function in pilot

To help you get started, we’ve selected a few pilot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AnalyticalGraphicsInc / cesium / Examples / Sandbox / Editor.js View on Github external
define('ace/mode/cesium', function(require, exports, module) {
            var oop = require('pilot/oop');
            var TextMode = require('ace/mode/text').Mode;
            var Tokenizer = require('ace/tokenizer').Tokenizer;
            var WorkerClient = require('ace/worker/worker_client').WorkerClient;
            var CesiumHighlightRules = require('ace/mode/cesium_highlight_rules').CesiumHighlightRules;

            var Mode = function() {
                this.$tokenizer = new Tokenizer(new CesiumHighlightRules().getRules());
            };
            oop.inherits(Mode, TextMode);
            (function() {
                // Create a worker to enable jslint
                this.createWorker = function(session) {
                    var doc = session.getDocument();
                    var worker = new WorkerClient(['ace', 'pilot'], 'worker-javascript.js', 'ace/mode/javascript_worker', 'JavaScriptWorker');
                    worker.call('setValue', [doc.getValue()]);

                    doc.on('change', function(e) {
                        e.range = {
                            start : e.data.range.start,
                            end : e.data.range.end
                        };
                        worker.emit('change', e);
                    });

                    worker.on('jslint', function(results) {
github HelioNetworks / HelioPanel_archived / web / ace / lib / ace / mode / javascript.js View on Github external
var oop = require("pilot/oop");
var TextMode = require("ace/mode/text").Mode;
var Tokenizer = require("ace/tokenizer").Tokenizer;
var JavaScriptHighlightRules = require("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("ace/mode/matching_brace_outdent").MatchingBraceOutdent;
var Range = require("ace/range").Range;
var WorkerClient = require("ace/worker/worker_client").WorkerClient;
var CstyleBehaviour = require("ace/mode/behaviour/cstyle").CstyleBehaviour;

var Mode = function() {
    this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
    this.$outdent = new MatchingBraceOutdent();
    this.$behaviour = new CstyleBehaviour();
};
oop.inherits(Mode, TextMode);

(function() {

    this.toggleCommentLines = function(state, doc, startRow, endRow) {
        var outdent = true;
        var outentedRows = [];
        var re = /^(\s*)\/\//;

        for (var i=startRow; i<= endRow; i++) {
            if (!re.test(doc.getLine(i))) {
                outdent = false;
                break;
            }
        }

        if (outdent) {
github atom / atom / vendor / ace / mode / c_cpp.js View on Github external
define(function(require, exports, module) {

var oop = require("pilot/oop");
var TextMode = require("ace/mode/text").Mode;
var Tokenizer = require("ace/tokenizer").Tokenizer;
var c_cppHighlightRules = require("ace/mode/c_cpp_highlight_rules").c_cppHighlightRules;
var MatchingBraceOutdent = require("ace/mode/matching_brace_outdent").MatchingBraceOutdent;
var Range = require("ace/range").Range;
var CstyleBehaviour = require("ace/mode/behaviour/cstyle").CstyleBehaviour;

var Mode = function() {
    this.$tokenizer = new Tokenizer(new c_cppHighlightRules().getRules());
    this.$outdent = new MatchingBraceOutdent();
    this.$behaviour = new CstyleBehaviour();
};
oop.inherits(Mode, TextMode);

(function() {

    this.toggleCommentLines = function(state, doc, startRow, endRow) {
        var outdent = true;
        var outentedRows = [];
        var re = /^(\s*)\/\//;

        for (var i=startRow; i<= endRow; i++) {
            if (!re.test(doc.getLine(i))) {
                outdent = false;
                break;
            }
        }

        if (outdent) {
github 3-Round-Stones / callimachus / webapp / editor / ace / xml_mode.js View on Github external
define("ace/mode/xml", function(require, exports, module) {

var oop = require("pilot/oop");
var TextMode = require("ace/mode/text").Mode;
var Tokenizer = require("ace/tokenizer").Tokenizer;
var XmlHighlightRules = require("ace/mode/xml_highlight_rules").XmlHighlightRules;
var XmlBehaviour = require("ace/mode/behaviour/xml").XmlBehaviour;

var Mode = function() {
    this.$tokenizer = new Tokenizer(new XmlHighlightRules().getRules());
    this.$behaviour = new XmlBehaviour();
};

oop.inherits(Mode, TextMode);

(function() {

    this.getNextLineIndent = function(state, line, tab) {
        return this.$getIndent(line);
    };

}).call(Mode.prototype);

exports.Mode = Mode;
});
github atom / atom / vendor / ace / mode / textile_highlight_rules.js View on Github external
regex : "\\)",
                next  : "blocktag"
            },
            {
                token : "string",
                regex : "[a-zA-Z0-9\\-_]+"
            },
            {
                token : "keyword",
                regex : "#"
            }
        ]
    };
};

oop.inherits(TextileHighlightRules, TextHighlightRules);

exports.TextileHighlightRules = TextileHighlightRules;

});
github atom / atom / vendor / ace / mode / html_highlight_rules.js View on Github external
regex: "\\/\\/.*(?=<\\/script>)",
        next: "tag"
    }, {
        token: "text",
        regex: "<\\/(?=script)",
        next: "tag"
    }]);
    
    this.embedRules(CssHighlightRules, "css-", [{
        token: "text",
        regex: "<\\/(?=style)",
        next: "tag"
    }]);
};

oop.inherits(HtmlHighlightRules, TextHighlightRules);

exports.HtmlHighlightRules = HtmlHighlightRules;
});
github atom / atom / vendor / ace / mode / html.js View on Github external
var Tokenizer = require("ace/tokenizer").Tokenizer;
var HtmlHighlightRules = require("ace/mode/html_highlight_rules").HtmlHighlightRules;
var XmlBehaviour = require("ace/mode/behaviour/xml").XmlBehaviour;

var Mode = function() {
    var highlighter = new HtmlHighlightRules();
    this.$tokenizer = new Tokenizer(highlighter.getRules());
    this.$behaviour = new XmlBehaviour();
    
    this.$embeds = highlighter.getEmbeds();
    this.createModeDelegates({
      "js-": JavaScriptMode,
      "css-": CssMode
    });
};
oop.inherits(Mode, TextMode);

(function() {

    this.toggleCommentLines = function(state, doc, startRow, endRow) {
        return 0;
    };

    this.getNextLineIndent = function(state, line, tab) {
        return this.$getIndent(line);
    };

    this.checkOutdent = function(state, line, input) {
        return false;
    };

}).call(Mode.prototype);
github 3-Round-Stones / callimachus / webapp / editor / ace / xml.js View on Github external
var rightChars = line.substring(cursor.column, cursor.column + 2);
            if (rightChars == '
github jessegrosjean / PlainText.javascript / shared / writeroom / writeroom_editor.js View on Github external
define("writeroom/editor", function(require, exports, module) {
		
	var oop = require("pilot/oop");
	var canon = require("pilot/canon");
	var Editor = require("ace/editor").Editor;
	var Range = require("ace/range").Range;
	require("writeroom/commands");
    
	   
	var WrEditor = function WrEditor() {
		Editor.prototype.constructor.apply(this, arguments);
	};
	
	oop.inherits(WrEditor, Editor);

	(function() {

		this.toggleSpanWithBoundary = function(boundary) {
			if (this.$readOnly)
				return;
			
			var curSelectionRange = this.getSelectionRange();
			
			if( this.session.getSelection().isEmpty() ) {
				var curPos = this.getCursorPosition();
				var ins = boundary+" "+boundary;
				this.session.insert(curPos, ins);
				var range = new Range(curPos.row, curPos.column+boundary.length, 
						curPos.row, curPos.column+boundary.length+1);
				this.session.selection.setSelectionRange(range, false);
github fivesixty / notepages / src / js / markdown-mode.js View on Github external
next  : "start"
    }]);
    
    this.embedRules(TexHighlightRules, "tex-", [{
        token : "constant",
        regex : "\\$\\$",
        next  : "start"
    }]);
    
    this.embedRules(TexHighlightRules, "texi-", [{
        token : "constant",
        regex : "%%",
        next  : "start"
    }]);
};
oop.inherits(MarkdownHighlightRules, TextHighlightRules);

exports.MarkdownHighlightRules = MarkdownHighlightRules;
});