Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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) {
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) {
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) {
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;
});
regex : "\\)",
next : "blocktag"
},
{
token : "string",
regex : "[a-zA-Z0-9\\-_]+"
},
{
token : "keyword",
regex : "#"
}
]
};
};
oop.inherits(TextileHighlightRules, TextHighlightRules);
exports.TextileHighlightRules = TextileHighlightRules;
});
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;
});
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);
var rightChars = line.substring(cursor.column, cursor.column + 2);
if (rightChars == '
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);
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;
});