commit
dbab677c41
37 changed files with 599 additions and 314 deletions
|
|
@ -43,56 +43,61 @@ if (!fs.existsSync)
|
||||||
var copy = require('dryice').copy;
|
var copy = require('dryice').copy;
|
||||||
|
|
||||||
var ACE_HOME = __dirname;
|
var ACE_HOME = __dirname;
|
||||||
|
var BUILD_DIR = "build";
|
||||||
|
|
||||||
function main(args) {
|
function main(args) {
|
||||||
var target = "minimal";
|
var type = "minimal";
|
||||||
if (args.length == 3) {
|
args = args.map(function(x) {
|
||||||
target = args[2];
|
if (x[0] == "-" && x[1] != "-")
|
||||||
// Check if 'target' contains some allowed value.
|
return "-" + x;
|
||||||
if (!/^(normal|bm|demo|minimal)$/.test(target))
|
return x;
|
||||||
target = "help";
|
});
|
||||||
}
|
|
||||||
|
if (args[2] && (args[2][0] != "-" || args[2].indexOf("h") != -1))
|
||||||
|
type = args[2];
|
||||||
|
|
||||||
if (target == "help") {
|
var i = args.indexOf("--target");
|
||||||
console.log("--- Ace Dryice Build Tool ---");
|
if (i != -1 && args[i+1])
|
||||||
console.log("");
|
BUILD_DIR = args[i+1];
|
||||||
console.log("Options:");
|
|
||||||
console.log(" minimal Runs minimal build of Ace");
|
|
||||||
console.log(" normal Runs embedded build of Ace");
|
|
||||||
console.log(" demo Runs demo build of Ace");
|
|
||||||
console.log(" bm Runs bookmarklet build of Ace");
|
|
||||||
process.exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
var aceProject = {
|
if (type == "minimal") {
|
||||||
roots: [
|
buildAce({
|
||||||
ACE_HOME + '/lib',
|
compress: args.indexOf("-m") != -1,
|
||||||
ACE_HOME + '/demo'
|
noconflict: args.indexOf("-nc") != -1
|
||||||
],
|
|
||||||
textPluginPattern: /^ace\/requirejs\/text!/
|
|
||||||
};
|
|
||||||
|
|
||||||
if (target == "minimal") {
|
|
||||||
buildAce(aceProject, {
|
|
||||||
compress: false,
|
|
||||||
noconflict: false,
|
|
||||||
suffix: "",
|
|
||||||
name: "ace"
|
|
||||||
});
|
});
|
||||||
|
} else if (type == "normal") {
|
||||||
|
ace();
|
||||||
|
} else if (type == "demo") {
|
||||||
|
demo();
|
||||||
|
} else if (type == "bm") {
|
||||||
|
bookmarklet();
|
||||||
|
} else if (type == "full") {
|
||||||
|
ace();
|
||||||
|
demo();
|
||||||
|
bookmarklet();
|
||||||
}
|
}
|
||||||
if (target == "normal") {
|
|
||||||
ace(aceProject);
|
console.log("--- Ace Dryice Build Tool ---");
|
||||||
}
|
console.log("");
|
||||||
else if (target == "demo") {
|
console.log("Options:");
|
||||||
demo(aceProject);
|
console.log(" normal Runs embedded build of Ace");
|
||||||
}
|
console.log(" demo Runs demo build of Ace");
|
||||||
else if (target == "bm") {
|
console.log(" bm Runs bookmarklet build of Ace");
|
||||||
bookmarklet(aceProject);
|
console.log(" full all of above");
|
||||||
}
|
console.log("flags:");
|
||||||
|
console.log(" -m minify");
|
||||||
|
console.log(" -nc namespace require");
|
||||||
|
console.log(" --target ./path path to build folder");
|
||||||
|
console.log("");
|
||||||
|
if (BUILD_DIR)
|
||||||
|
console.log(" output generated in " + type + __dirname + "/" + BUILD_DIR)
|
||||||
|
|
||||||
|
process.exit(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function bookmarklet(aceProject) {
|
function bookmarklet() {
|
||||||
var targetDir = "build/textarea";
|
var targetDir = BUILD_DIR + "/textarea";
|
||||||
copy({
|
copy({
|
||||||
source: "build_support/editor_textarea.html",
|
source: "build_support/editor_textarea.html",
|
||||||
dest: targetDir + '/editor.html'
|
dest: targetDir + '/editor.html'
|
||||||
|
|
@ -102,7 +107,7 @@ function bookmarklet(aceProject) {
|
||||||
dest: targetDir + '/style.css'
|
dest: targetDir + '/style.css'
|
||||||
});
|
});
|
||||||
|
|
||||||
buildAce(aceProject, {
|
buildAce({
|
||||||
targetDir: targetDir + "/src",
|
targetDir: targetDir + "/src",
|
||||||
ns: "__ace_shadowed__",
|
ns: "__ace_shadowed__",
|
||||||
exportModule: "ace/ext/textarea",
|
exportModule: "ace/ext/textarea",
|
||||||
|
|
@ -115,38 +120,27 @@ function bookmarklet(aceProject) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function ace(aceProject) {
|
function ace() {
|
||||||
console.log('# ace ---------');
|
console.log('# ace ---------');
|
||||||
|
|
||||||
// uncompressed
|
// uncompressed
|
||||||
buildAce(aceProject, {
|
buildAce({
|
||||||
compress: false,
|
compress: false,
|
||||||
noconflict: false,
|
noconflict: false
|
||||||
suffix: "",
|
|
||||||
name: "ace"
|
|
||||||
});
|
});
|
||||||
buildAce(aceProject, {
|
buildAce({
|
||||||
compress: false,
|
compress: false,
|
||||||
noconflict: true,
|
noconflict: true
|
||||||
suffix: "-noconflict",
|
|
||||||
name: "ace",
|
|
||||||
workers: []
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// compressed
|
// compressed
|
||||||
buildAce(aceProject, {
|
buildAce({
|
||||||
compress: true,
|
compress: true,
|
||||||
noconflict: false,
|
noconflict: false
|
||||||
suffix: "-min",
|
|
||||||
name: "ace",
|
|
||||||
workers: []
|
|
||||||
});
|
});
|
||||||
buildAce(aceProject, {
|
buildAce({
|
||||||
compress: true,
|
compress: true,
|
||||||
noconflict: true,
|
noconflict: true
|
||||||
suffix: "-min-noconflict",
|
|
||||||
name: "ace",
|
|
||||||
workers: []
|
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('# ace License | Readme | Changelog ---------');
|
console.log('# ace License | Readme | Changelog ---------');
|
||||||
|
|
@ -169,7 +163,7 @@ function ace(aceProject) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function demo(aceProject) {
|
function demo() {
|
||||||
console.log('# kitchen sink ---------');
|
console.log('# kitchen sink ---------');
|
||||||
|
|
||||||
var version, ref;
|
var version, ref;
|
||||||
|
|
@ -182,14 +176,10 @@ function demo(aceProject) {
|
||||||
}
|
}
|
||||||
var changeComments = function(data) {
|
var changeComments = function(data) {
|
||||||
return (data
|
return (data
|
||||||
.replace("DEVEL-->", "")
|
.replace(/<!\-\-DEVEL[\d\D]*?DEVEL\-\->/g, "")
|
||||||
.replace("<!--DEVEL", "")
|
.replace(/PACKAGE\-\->|<!\-\-PACKAGE/g, "")
|
||||||
.replace("PACKAGE-->", "")
|
.replace(/\/\*DEVEL[\d\D]*?DEVEL\*\//g, "")
|
||||||
.replace("<!--PACKAGE", "")
|
.replace(/PACKAGE\*\/|\/\*PACKAGE/g, "")
|
||||||
.replace("DEVEL*/", "")
|
|
||||||
.replace("/*DEVEL", "")
|
|
||||||
.replace("PACKAGE*/", "")
|
|
||||||
.replace("/*PACKAGE", "")
|
|
||||||
.replace("%version%", version)
|
.replace("%version%", version)
|
||||||
.replace("%commit%", ref)
|
.replace("%commit%", ref)
|
||||||
);
|
);
|
||||||
|
|
@ -197,7 +187,7 @@ function demo(aceProject) {
|
||||||
|
|
||||||
copy({
|
copy({
|
||||||
source: "kitchen-sink.html",
|
source: "kitchen-sink.html",
|
||||||
dest: "build/kitchen-sink.html",
|
dest: BUILD_DIR + "/kitchen-sink.html",
|
||||||
filter: [changeComments, function(data) {
|
filter: [changeComments, function(data) {
|
||||||
return data.replace(/"(demo|build)\//g, "\"");
|
return data.replace(/"(demo|build)\//g, "\"");
|
||||||
}]
|
}]
|
||||||
|
|
@ -205,14 +195,14 @@ function demo(aceProject) {
|
||||||
|
|
||||||
copy({
|
copy({
|
||||||
source: "demo/kitchen-sink/styles.css",
|
source: "demo/kitchen-sink/styles.css",
|
||||||
dest: "build/kitchen-sink/styles.css",
|
dest: BUILD_DIR + "/kitchen-sink/styles.css",
|
||||||
filter: [ changeComments ]
|
filter: [ changeComments ]
|
||||||
});
|
});
|
||||||
|
|
||||||
fs.readdirSync("demo/kitchen-sink/docs/").forEach(function(x) {
|
fs.readdirSync("demo/kitchen-sink/docs/").forEach(function(x) {
|
||||||
copy({
|
copy({
|
||||||
source: "demo/kitchen-sink/docs/" + x,
|
source: "demo/kitchen-sink/docs/" + x,
|
||||||
dest: "build/kitchen-sink/docs/" + x
|
dest: BUILD_DIR + "/kitchen-sink/docs/" + x
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -235,22 +225,26 @@ function demo(aceProject) {
|
||||||
});
|
});
|
||||||
copy({
|
copy({
|
||||||
source: demo,
|
source: demo,
|
||||||
dest: "build/kitchen-sink/demo.js",
|
dest: BUILD_DIR + "/kitchen-sink/demo.js",
|
||||||
});
|
});
|
||||||
|
|
||||||
copyFileSync("demo/kitchen-sink/logo.png", "build/kitchen-sink/logo.png");
|
copyFileSync("demo/kitchen-sink/logo.png", BUILD_DIR + "/kitchen-sink/logo.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildAce(aceProject, options) {
|
function buildAce(options) {
|
||||||
|
var aceProject = {
|
||||||
|
roots: [ACE_HOME + '/lib', ACE_HOME + '/demo'],
|
||||||
|
textPluginPattern: /^ace\/requirejs\/text!/
|
||||||
|
};
|
||||||
|
|
||||||
var defaults = {
|
var defaults = {
|
||||||
targetDir: __dirname + "/build/src",
|
targetDir: BUILD_DIR + "/src",
|
||||||
ns: "ace",
|
ns: "ace",
|
||||||
exportModule: "ace/ace",
|
exportModule: "ace/ace",
|
||||||
requires: null,
|
requires: null,
|
||||||
compress: false,
|
compress: false,
|
||||||
noconflict: false,
|
noconflict: false,
|
||||||
suffix: "",
|
suffix: null,
|
||||||
name: "ace",
|
name: "ace",
|
||||||
modes: fs.readdirSync("lib/ace/mode").map(function(x) {
|
modes: fs.readdirSync("lib/ace/mode").map(function(x) {
|
||||||
if (x.slice(-3) == ".js" && !/_highlight_rules|_test|_worker|xml_util|_outdent|behaviour/.test(x))
|
if (x.slice(-3) == ".js" && !/_highlight_rules|_test|_worker|xml_util|_outdent|behaviour/.test(x))
|
||||||
|
|
@ -262,15 +256,29 @@ function buildAce(aceProject, options) {
|
||||||
workers: ["javascript", "coffee", "css", "json", "xquery"],
|
workers: ["javascript", "coffee", "css", "json", "xquery"],
|
||||||
keybindings: ["vim", "emacs"]
|
keybindings: ["vim", "emacs"]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
for(var key in defaults)
|
for(var key in defaults)
|
||||||
if (!options.hasOwnProperty(key))
|
if (!options.hasOwnProperty(key))
|
||||||
options[key] = defaults[key];
|
options[key] = defaults[key];
|
||||||
|
|
||||||
|
if (options.suffix == null) {
|
||||||
|
options.suffix = "";
|
||||||
|
if (options.compress)
|
||||||
|
options.suffix += "-min";
|
||||||
|
if (options.noconflict)
|
||||||
|
options.suffix += "-noconflict";
|
||||||
|
}
|
||||||
|
|
||||||
if (!options.requires)
|
if (!options.requires)
|
||||||
options.requires = [options.exportModule];
|
options.requires = [options.exportModule];
|
||||||
|
|
||||||
var filters = [copy.filter.moduleDefines, filterTextPlugin];
|
var filters = [
|
||||||
|
copy.filter.moduleDefines,
|
||||||
|
filterTextPlugin,
|
||||||
|
removeUseStrict,
|
||||||
|
removeLicenceCmments
|
||||||
|
];
|
||||||
|
|
||||||
if (options.noconflict) {
|
if (options.noconflict) {
|
||||||
filters.push(namespace(options.ns));
|
filters.push(namespace(options.ns));
|
||||||
|
|
@ -280,20 +288,10 @@ function buildAce(aceProject, options) {
|
||||||
var exportFilter = exportAce(options.ns, options.exportModule);
|
var exportFilter = exportAce(options.ns, options.exportModule);
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove use strict
|
|
||||||
filters.push(function(text) {
|
|
||||||
return text.replace(/['"]use strict['"];/g, "");
|
|
||||||
})
|
|
||||||
// remove redundant comments
|
|
||||||
filters.push(function(text) {
|
|
||||||
return text.replace(/(;)\s*\/\*[\d\D]*?\*\//g, "$1");
|
|
||||||
})
|
|
||||||
|
|
||||||
if (options.compress)
|
if (options.compress)
|
||||||
filters.push(copy.filter.uglifyjs);
|
filters.push(copy.filter.uglifyjs);
|
||||||
|
|
||||||
var suffix = options.suffix;
|
var targetDir = options.targetDir + options.suffix;
|
||||||
var targetDir = options.targetDir;
|
|
||||||
var name = options.name;
|
var name = options.name;
|
||||||
|
|
||||||
var project = copy.createCommonJsProject(aceProject);
|
var project = copy.createCommonJsProject(aceProject);
|
||||||
|
|
@ -304,8 +302,8 @@ function buildAce(aceProject, options) {
|
||||||
});
|
});
|
||||||
copy({
|
copy({
|
||||||
source: [{
|
source: [{
|
||||||
project: project,
|
project: project,
|
||||||
require: options.requires
|
require: options.requires
|
||||||
}],
|
}],
|
||||||
filter: [ copy.filter.moduleDefines ],
|
filter: [ copy.filter.moduleDefines ],
|
||||||
dest: ace
|
dest: ace
|
||||||
|
|
@ -314,7 +312,7 @@ function buildAce(aceProject, options) {
|
||||||
copy({
|
copy({
|
||||||
source: ace,
|
source: ace,
|
||||||
filter: exportFilter ? filters.concat(exportFilter) : filters,
|
filter: exportFilter ? filters.concat(exportFilter) : filters,
|
||||||
dest: targetDir + suffix + '/' + name + ".js"
|
dest: targetDir + '/' + name + ".js"
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('# ace modes ---------');
|
console.log('# ace modes ---------');
|
||||||
|
|
@ -324,11 +322,11 @@ function buildAce(aceProject, options) {
|
||||||
console.log("mode " + mode);
|
console.log("mode " + mode);
|
||||||
copy({
|
copy({
|
||||||
source: [{
|
source: [{
|
||||||
project: cloneProject(project),
|
project: cloneProject(project),
|
||||||
require: [ 'ace/mode/' + mode ]
|
require: [ 'ace/mode/' + mode ]
|
||||||
}],
|
}],
|
||||||
filter: filters,
|
filter: filters,
|
||||||
dest: targetDir + suffix + "/mode-" + mode + ".js"
|
dest: targetDir + "/mode-" + mode + ".js"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -343,7 +341,7 @@ function buildAce(aceProject, options) {
|
||||||
require: ["ace/theme/" + theme]
|
require: ["ace/theme/" + theme]
|
||||||
}],
|
}],
|
||||||
filter: filters,
|
filter: filters,
|
||||||
dest: targetDir + suffix + "/theme-" + theme + ".js"
|
dest: targetDir + "/theme-" + theme + ".js"
|
||||||
});*/
|
});*/
|
||||||
// use this instead, to not create separate modules for js and css
|
// use this instead, to not create separate modules for js and css
|
||||||
var themePath = "lib/ace/theme/" + theme
|
var themePath = "lib/ace/theme/" + theme
|
||||||
|
|
@ -356,43 +354,7 @@ function buildAce(aceProject, options) {
|
||||||
}
|
}
|
||||||
filters.forEach(function(f) {js = f(js); });
|
filters.forEach(function(f) {js = f(js); });
|
||||||
|
|
||||||
fs.writeFileSync(targetDir + suffix + "/theme-" + theme + ".js", js);
|
fs.writeFileSync(targetDir + "/theme-" + theme + ".js", js);
|
||||||
});
|
|
||||||
|
|
||||||
console.log('# ace worker ---------');
|
|
||||||
|
|
||||||
options.workers.forEach(function(mode) {
|
|
||||||
console.log("worker for " + mode + " mode");
|
|
||||||
var worker = copy.createDataObject();
|
|
||||||
var workerProject = copy.createCommonJsProject({
|
|
||||||
roots: [
|
|
||||||
ACE_HOME + '/lib'
|
|
||||||
],
|
|
||||||
textPluginPattern: /^ace\/requirejs\/text!/
|
|
||||||
});
|
|
||||||
copy({
|
|
||||||
source: [
|
|
||||||
{
|
|
||||||
project: workerProject,
|
|
||||||
require: [
|
|
||||||
'ace/lib/fixoldbrowsers',
|
|
||||||
'ace/lib/event_emitter',
|
|
||||||
'ace/lib/oop',
|
|
||||||
'ace/mode/' + mode + '_worker'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
filter: [ copy.filter.moduleDefines, filterTextPlugin ],
|
|
||||||
dest: worker
|
|
||||||
});
|
|
||||||
copy({
|
|
||||||
source: [
|
|
||||||
ACE_HOME + "/lib/ace/worker/worker.js",
|
|
||||||
worker
|
|
||||||
],
|
|
||||||
filter: [ /* copy.filter.uglifyjs */],
|
|
||||||
dest: targetDir + "/worker-" + mode + ".js"
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('# ace key bindings ---------');
|
console.log('# ace key bindings ---------');
|
||||||
|
|
@ -406,9 +368,49 @@ function buildAce(aceProject, options) {
|
||||||
require: [ 'ace/keyboard/' + keybinding ]
|
require: [ 'ace/keyboard/' + keybinding ]
|
||||||
}],
|
}],
|
||||||
filter: filters,
|
filter: filters,
|
||||||
dest: targetDir + suffix + "/keybinding-" + keybinding + ".js"
|
dest: targetDir + "/keybinding-" + keybinding + ".js"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log('# ace worker ---------');
|
||||||
|
|
||||||
|
filters = [
|
||||||
|
copy.filter.moduleDefines,
|
||||||
|
filterTextPlugin,
|
||||||
|
removeUseStrict,
|
||||||
|
removeLicenceCmments
|
||||||
|
];
|
||||||
|
|
||||||
|
options.workers.forEach(function(mode) {
|
||||||
|
console.log("worker for " + mode + " mode");
|
||||||
|
var worker = copy.createDataObject();
|
||||||
|
var workerProject = copy.createCommonJsProject({
|
||||||
|
roots: [ ACE_HOME + '/lib' ],
|
||||||
|
textPluginPattern: /^ace\/requirejs\/text!/
|
||||||
|
});
|
||||||
|
copy({
|
||||||
|
source: [{
|
||||||
|
project: workerProject,
|
||||||
|
require: [
|
||||||
|
'ace/lib/fixoldbrowsers',
|
||||||
|
'ace/lib/event_emitter',
|
||||||
|
'ace/lib/oop',
|
||||||
|
'ace/mode/' + mode + '_worker'
|
||||||
|
]
|
||||||
|
}],
|
||||||
|
filter: filters,
|
||||||
|
dest: worker
|
||||||
|
});
|
||||||
|
copy({
|
||||||
|
source: [
|
||||||
|
ACE_HOME + "/lib/ace/worker/worker.js",
|
||||||
|
worker
|
||||||
|
],
|
||||||
|
filter: options.compress ? [copy.filter.uglifyjs] : [],
|
||||||
|
dest: targetDir + "/worker-" + mode + ".js"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: replace with project.clone once it is fixed in dryice
|
// TODO: replace with project.clone once it is fixed in dryice
|
||||||
|
|
@ -459,6 +461,14 @@ function filterTextPlugin(text) {
|
||||||
return text.replace(/(['"])ace\/requirejs\/text\!/g, "$1text!");
|
return text.replace(/(['"])ace\/requirejs\/text\!/g, "$1text!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function removeUseStrict(text) {
|
||||||
|
return text.replace(/['"]use strict['"];/g, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeLicenceCmments(text) {
|
||||||
|
return text.replace(/(;)\s*\/\*[\d\D]*?\*\//g, "$1");
|
||||||
|
}
|
||||||
|
|
||||||
function namespace(ns) {
|
function namespace(ns) {
|
||||||
return function(text) {
|
return function(text) {
|
||||||
text = text
|
text = text
|
||||||
|
|
|
||||||
62
Readme.md
62
Readme.md
|
|
@ -10,7 +10,7 @@ Features
|
||||||
* Automatic indent and outdent
|
* Automatic indent and outdent
|
||||||
* An optional command line
|
* An optional command line
|
||||||
* Handles huge documents (100,000 lines and more are no problem)
|
* Handles huge documents (100,000 lines and more are no problem)
|
||||||
* Fully customizable key bindings including VI and Emacs modes
|
* Fully customizable key bindings including VIM and Emacs modes
|
||||||
* Themes (TextMate themes can be imported)
|
* Themes (TextMate themes can be imported)
|
||||||
* Search and replace with regular expressions
|
* Search and replace with regular expressions
|
||||||
* Highlight matching parentheses
|
* Highlight matching parentheses
|
||||||
|
|
@ -18,20 +18,16 @@ Features
|
||||||
* Displays hidden characters
|
* Displays hidden characters
|
||||||
* Drag and drop text using the mouse
|
* Drag and drop text using the mouse
|
||||||
* Line wrapping
|
* Line wrapping
|
||||||
* Unstructured / user code folding
|
* Code folding
|
||||||
* Live syntax checker (currently JavaScript/CoffeeScript)
|
* Multiple selections
|
||||||
|
* Live syntax checker (currently JavaScript/CoffeeScript/Css/XQuery)
|
||||||
|
|
||||||
Take Ace for a spin!
|
Take Ace for a spin!
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
Check out the Ace live [demo](http://ajaxorg.github.com/ace/) or get a [Cloud9 IDE account](http://run.cloud9ide.com) to experience Ace while editing one of your own GitHub projects.
|
Check out the Ace live [demo](http://ajaxorg.github.com/ace-builds/kitchen-sink.html) or get a [Cloud9 IDE account](http://c9.io) to experience Ace while editing one of your own GitHub projects.
|
||||||
|
|
||||||
If you want, you can use Ace as a textarea replacement thanks to the [Ace Bookmarklet](http://ajaxorg.github.com/ace/build/textarea/editor.html).
|
If you want, you can use Ace as a textarea replacement thanks to the [Ace Bookmarklet](http://ajaxorg.github.com/ace-builds/textarea/editor.html).
|
||||||
|
|
||||||
History
|
|
||||||
-------
|
|
||||||
|
|
||||||
Previously known as “Bespin” and “Skywriter” it’s now known as Ace (Ajax.org Cloud9 Editor)! Bespin and Ace started as two independent projects, both aiming to build a no-compromise code editor component for the web. Bespin started as part of Mozilla Labs and was based on the canvas tag, while Ace is the Editor component of the Cloud9 IDE and is using the DOM for rendering. After the release of Ace at JSConf.eu 2010 in Berlin the Skywriter team decided to merge Ace with a simplified version of Skywriter's plugin system and some of Skywriter's extensibility points. All these changes have been merged back to Ace. Both Ajax.org and Mozilla are actively developing and maintaining Ace.
|
|
||||||
|
|
||||||
Getting the code
|
Getting the code
|
||||||
----------------
|
----------------
|
||||||
|
|
@ -40,14 +36,13 @@ Ace is a community project. We actively encourage and support contributions. The
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone git://github.com/ajaxorg/ace.git
|
git clone git://github.com/ajaxorg/ace.git
|
||||||
cd ace
|
|
||||||
git submodule update --init --recursive
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Embedding Ace
|
Embedding Ace
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
Ace can be easily embedded into any existing web page. The Ace git repository ships with a pre-packaged version of Ace inside of the `build` directory. The same packaged files are also available as a separate [download](https://github.com/ajaxorg/ace/downloads). Simply copy the contents of the `src` subdirectory somewhere into your project and take a look at the included demos of how to use Ace.
|
Ace can be easily embedded into any existing web page. You can either use one of pre-packaged versions of [ace](https://github.com/ajaxorg/ace-builds/) (just copy one of `src*` subdirectories somewhere into your project), or use requireJS to load contents of [lib/ace](https://github.com/ajaxorg/ace/tree/master/lib/ace) as `ace`
|
||||||
|
|
||||||
|
|
||||||
The easiest version is simply:
|
The easiest version is simply:
|
||||||
|
|
||||||
|
|
@ -55,9 +50,7 @@ The easiest version is simply:
|
||||||
<div id="editor">some text</div>
|
<div id="editor">some text</div>
|
||||||
<script src="src/ace.js" type="text/javascript" charset="utf-8"></script>
|
<script src="src/ace.js" type="text/javascript" charset="utf-8"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
|
||||||
var editor = ace.edit("editor");
|
var editor = ace.edit("editor");
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -96,10 +89,14 @@ Then the mode can be used like this:
|
||||||
editor.getSession().setMode(new JavaScriptMode());
|
editor.getSession().setMode(new JavaScriptMode());
|
||||||
```
|
```
|
||||||
|
|
||||||
|
and take a look at the one of [included](https://github.com/ajaxorg/ace-builds/blob/master/editor.html) [demos](https://github.com/ajaxorg/ace/blob/master/demo/kitchen-sink/demo.js) of how to use Ace.
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
You find a lot more sample code in the [demo app](https://github.com/ajaxorg/ace/blob/master/demo/demo.js).
|
You can find api documentation at [http://ajaxorg.github.com/ace/api/index.html](http://ajaxorg.github.com/ace/api/index.html).
|
||||||
|
|
||||||
|
And a lot more sample code in the [demo app](https://github.com/ajaxorg/ace/blob/master/demo/kitchen-sink/demo.js).
|
||||||
|
|
||||||
There is also some documentation on the [wiki page](https://github.com/ajaxorg/ace/wiki).
|
There is also some documentation on the [wiki page](https://github.com/ajaxorg/ace/wiki).
|
||||||
|
|
||||||
|
|
@ -126,42 +123,17 @@ The editor can then be opened at http://localhost:8888/index.html.
|
||||||
Package Ace
|
Package Ace
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
To package Ace we use the dryice build tool developed by the Mozilla Skywriter team. Before you can build you need to make sure that the submodules are up to date.
|
To package Ace we use the dryice build tool developed by the Mozilla Skywriter team. Make sure you at latest version of dryice
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git submodule update --init --recursive
|
npm install
|
||||||
```
|
node ./Makefile.dryice.js ;; -m to minify, -nc to use namespaced requre, -target ./path/to/build/dir
|
||||||
|
|
||||||
Make sure you at least version 0.3.0 of dryice
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install dryice
|
|
||||||
```
|
|
||||||
|
|
||||||
Afterwards Ace can be built by calling
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./Makefile.dryice.js normal
|
|
||||||
```
|
|
||||||
|
|
||||||
The packaged Ace will be put in the 'build' folder.
|
|
||||||
|
|
||||||
To build the bookmarklet version execute
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./Makefile.dryice.js bm
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Running the Unit Tests
|
Running the Unit Tests
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
The Ace unit tests run on node.js. Before the first run a couple of node modules have to be installed. The easiest way to do this is by using the node package manager (npm). In the Ace base directory simply call
|
The Ace unit tests can run on node.js. Assuming you have already done `npm install`, just call:
|
||||||
|
|
||||||
```bash
|
|
||||||
npm link .
|
|
||||||
```
|
|
||||||
|
|
||||||
To run the tests call:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
node lib/ace/test/all.js
|
node lib/ace/test/all.js
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ if (location.protocol == "file:")
|
||||||
EditSession.prototype.$useWorker = false;
|
EditSession.prototype.$useWorker = false;
|
||||||
|
|
||||||
/************** modes ***********************/
|
/************** modes ***********************/
|
||||||
var modesByName;
|
var modes = [];
|
||||||
function getModeFromPath(path) {
|
function getModeFromPath(path) {
|
||||||
var mode = modesByName.text;
|
var mode = modesByName.text;
|
||||||
for (var i = 0; i < modes.length; i++) {
|
for (var i = 0; i < modes.length; i++) {
|
||||||
|
|
@ -82,57 +82,60 @@ var Mode = function(name, desc, extensions) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.desc = desc;
|
this.desc = desc;
|
||||||
this.mode = "ace/mode/" + name;
|
this.mode = "ace/mode/" + name;
|
||||||
this.extRe = new RegExp("^.*\\.(" + extensions.join("|") + ")$", "g");
|
this.extRe = new RegExp("^.*\\.(" + extensions + ")$", "g");
|
||||||
};
|
};
|
||||||
|
|
||||||
Mode.prototype.supportsFile = function(filename) {
|
Mode.prototype.supportsFile = function(filename) {
|
||||||
return filename.match(this.extRe);
|
return filename.match(this.extRe);
|
||||||
};
|
};
|
||||||
|
|
||||||
var modes = [
|
var modesByName = {
|
||||||
new Mode("c_cpp", "C/C++", ["c", "cpp", "cxx", "h", "hpp"]),
|
coffee: ["CoffeeScript" , "coffee|^Cakefile"],
|
||||||
new Mode("clojure", "Clojure", ["clj"]),
|
coldfusion: ["ColdFusion" , "cfm"],
|
||||||
new Mode("coffee", "CoffeeScript", ["coffee"]),
|
csharp: ["C#" , "cs"],
|
||||||
new Mode("coldfusion", "ColdFusion", ["cfm"]),
|
css: ["CSS" , "css"],
|
||||||
new Mode("csharp", "C#", ["cs"]),
|
diff: ["Diff" , "diff|patch"],
|
||||||
new Mode("css", "CSS", ["css"]),
|
golang: ["Go" , "go"],
|
||||||
new Mode("golang", "Go", ["go"]),
|
groovy: ["Groovy" , "groovy"],
|
||||||
new Mode("groovy", "Groovy", ["groovy"]),
|
haxe: ["haXe" , "hx"],
|
||||||
new Mode("haxe", "haXe", ["hx"]),
|
html: ["HTML" , "htm|html|xhtml"],
|
||||||
new Mode("html", "HTML", ["html", "htm"]),
|
c_cpp: ["C/C++" , "c|cc|cpp|cxx|h|hh|hpp"],
|
||||||
new Mode("java", "Java", ["java"]),
|
clojure: ["Clojure" , "clj"],
|
||||||
new Mode("diff", "Diff", ["diff", "patch"]),
|
java: ["Java" , "java"],
|
||||||
new Mode("javascript", "JavaScript", ["js"]),
|
javascript: ["JavaScript" , "js"],
|
||||||
new Mode("json", "JSON", ["json"]),
|
json: ["JSON" , "json"],
|
||||||
new Mode("latex", "LaTeX", ["tex"]),
|
latex: ["LaTeX" , "latex|tex|ltx|bib"],
|
||||||
new Mode("less", "LESS", ["less"]),
|
less: ["LESS" , "less"],
|
||||||
new Mode("lua", "Lua", ["lua"]),
|
liquid: ["Liquid" , "liquid"],
|
||||||
new Mode("liquid", "Liquid", ["liquid"]),
|
lua: ["Lua" , "lua"],
|
||||||
new Mode("markdown", "Markdown", ["md", "markdown"]),
|
markdown: ["Markdown" , "md|markdown"],
|
||||||
new Mode("ocaml", "OCaml", ["ml", "mli"]),
|
ocaml: ["OCaml" , "ml|mli"],
|
||||||
new Mode("scad", "OpenSCAD", ["scad"]),
|
perl: ["Perl" , "pl|pm"],
|
||||||
new Mode("perl", "Perl", ["pl", "pm"]),
|
pgsql: ["pgSQL" , "pgsql"],
|
||||||
new Mode("pgsql", "pgSQL", ["pgsql", "sql"]),
|
php: ["PHP" , "php|phtml"],
|
||||||
new Mode("php", "PHP", ["php"]),
|
powershell: ["Powershell" , "ps1"],
|
||||||
new Mode("powershell", "Powershell", ["ps1"]),
|
python: ["Python" , "py"],
|
||||||
new Mode("python", "Python", ["py"]),
|
ruby: ["Ruby" , "ru|gemspec|rake|rb"],
|
||||||
new Mode("scala", "Scala", ["scala"]),
|
scad: ["OpenSCAD" , "scad"],
|
||||||
new Mode("scss", "SCSS", ["scss"]),
|
scala: ["Scala" , "scala"],
|
||||||
new Mode("ruby", "Ruby", ["rb"]),
|
scss: ["SCSS" , "scss|sass"],
|
||||||
new Mode("sql", "SQL", ["sql"]),
|
sh: ["SH" , "sh|bash|bat"],
|
||||||
new Mode("svg", "SVG", ["svg"]),
|
sql: ["SQL" , "sql"],
|
||||||
new Mode("text", "Text", ["txt"]),
|
svg: ["SVG" , "svg"],
|
||||||
new Mode("textile", "Textile", ["textile"]),
|
text: ["Text" , "txt"],
|
||||||
new Mode("xml", "XML", ["xml"]),
|
textile: ["Textile" , "textile"],
|
||||||
new Mode("sh", "SH", ["sh"]),
|
xml: ["XML" , "xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"],
|
||||||
new Mode("xquery", "XQuery", ["xq"]),
|
xquery: ["XQuery" , "xq"],
|
||||||
new Mode("yaml", "YAML", ["yaml"])
|
yaml: ["YAML" , "yaml"]
|
||||||
];
|
};
|
||||||
|
|
||||||
|
for (var name in modesByName) {
|
||||||
|
var mode = modesByName[name];
|
||||||
|
mode = new Mode(name, mode[0], mode[1])
|
||||||
|
modesByName[name] = mode;
|
||||||
|
modes.push(mode);
|
||||||
|
}
|
||||||
|
|
||||||
modesByName = {};
|
|
||||||
modes.forEach(function(m) {
|
|
||||||
modesByName[m.name] = m;
|
|
||||||
});
|
|
||||||
|
|
||||||
/*********** demo documents ***************************/
|
/*********** demo documents ***************************/
|
||||||
var fileCache = {};
|
var fileCache = {};
|
||||||
|
|
@ -259,18 +262,6 @@ window.env = env;
|
||||||
window.editor = window.ace = env.editor;
|
window.editor = window.ace = env.editor;
|
||||||
env.editor.setAnimatedScroll(true);
|
env.editor.setAnimatedScroll(true);
|
||||||
|
|
||||||
var consoleHight = 20;
|
|
||||||
function onResize() {
|
|
||||||
var left = env.split.$container.offsetLeft;
|
|
||||||
var width = document.documentElement.clientWidth - left;
|
|
||||||
container.style.width = width + "px";
|
|
||||||
container.style.height = document.documentElement.clientHeight - consoleHight + "px";
|
|
||||||
env.split.resize();
|
|
||||||
|
|
||||||
consoleEl.style.width = width + "px";
|
|
||||||
cmdLine.resize()
|
|
||||||
}
|
|
||||||
|
|
||||||
var consoleEl = dom.createElement("div");
|
var consoleEl = dom.createElement("div");
|
||||||
container.parentNode.appendChild(consoleEl);
|
container.parentNode.appendChild(consoleEl);
|
||||||
consoleEl.style.position="fixed"
|
consoleEl.style.position="fixed"
|
||||||
|
|
@ -331,9 +322,6 @@ cmdLine.commands.bindKeys({
|
||||||
|
|
||||||
cmdLine.commands.removeCommands(["find", "goToLine", "findAll", "replace", "replaceAll"])
|
cmdLine.commands.removeCommands(["find", "goToLine", "findAll", "replace", "replaceAll"])
|
||||||
|
|
||||||
window.onresize = onResize;
|
|
||||||
onResize();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This demonstrates how you can define commands and bind shortcuts to them.
|
* This demonstrates how you can define commands and bind shortcuts to them.
|
||||||
*/
|
*/
|
||||||
|
|
@ -368,6 +356,22 @@ var keybindings = {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*********** manage layout ***************************/
|
||||||
|
var consoleHight = 20;
|
||||||
|
function onResize() {
|
||||||
|
var left = env.split.$container.offsetLeft;
|
||||||
|
var width = document.documentElement.clientWidth - left;
|
||||||
|
container.style.width = width + "px";
|
||||||
|
container.style.height = document.documentElement.clientHeight - consoleHight + "px";
|
||||||
|
env.split.resize();
|
||||||
|
|
||||||
|
consoleEl.style.width = width + "px";
|
||||||
|
cmdLine.resize()
|
||||||
|
}
|
||||||
|
|
||||||
|
window.onresize = onResize;
|
||||||
|
onResize();
|
||||||
|
|
||||||
/*********** options pane ***************************/
|
/*********** options pane ***************************/
|
||||||
var docEl = document.getElementById("doc");
|
var docEl = document.getElementById("doc");
|
||||||
var modeEl = document.getElementById("mode");
|
var modeEl = document.getElementById("mode");
|
||||||
|
|
@ -654,24 +658,22 @@ event.addListener(container, "drop", function(e) {
|
||||||
var file;
|
var file;
|
||||||
try {
|
try {
|
||||||
file = e.dataTransfer.files[0];
|
file = e.dataTransfer.files[0];
|
||||||
|
if (window.FileReader) {
|
||||||
|
var reader = new FileReader();
|
||||||
|
reader.onload = function() {
|
||||||
|
var mode = getModeFromPath(file.name);
|
||||||
|
|
||||||
|
env.editor.session.doc.setValue(reader.result);
|
||||||
|
modeEl.value = mode.name;
|
||||||
|
env.editor.session.setMode(mode.mode);
|
||||||
|
env.editor.session.modeName = mode.name;
|
||||||
|
};
|
||||||
|
reader.readAsText(file);
|
||||||
|
}
|
||||||
|
return event.preventDefault(e);
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
return event.stopEvent();
|
return event.stopEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.FileReader) {
|
|
||||||
var reader = new FileReader();
|
|
||||||
reader.onload = function() {
|
|
||||||
var mode = getModeFromPath(file.name);
|
|
||||||
|
|
||||||
env.editor.session.doc.setValue(reader.result);
|
|
||||||
modeEl.value = mode.name;
|
|
||||||
env.editor.session.setMode(mode.mode);
|
|
||||||
env.editor.session.modeName = mode.name;
|
|
||||||
};
|
|
||||||
reader.readAsText(file);
|
|
||||||
}
|
|
||||||
|
|
||||||
return event.preventDefault(e);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// add multiple cursor support to editor
|
// add multiple cursor support to editor
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@
|
||||||
|
|
||||||
<h2>Take Ace for a spin!</h2>
|
<h2>Take Ace for a spin!</h2>
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
<p>Check out the <a href="build/kitchen-sink.html">Ace live demo</a> or get a <a href="http://c9.io">Cloud9 IDE account</a> to experience Ace while editing one of your own GitHub projects.</p>
|
<p>Check out the <a href="http://ajaxorg.github.com/ace-builds/kitchen-sink.html">Ace live demo</a> or get a <a href="http://c9.io">Cloud9 IDE account</a> to experience Ace while editing one of your own GitHub projects.</p>
|
||||||
|
|
||||||
<h2>History</h2>
|
<h2>History</h2>
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,19 @@
|
||||||
commit %commit%
|
commit %commit%
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<!--DEVEL-->
|
||||||
|
<link rel="stylesheet" href="demo/kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
|
||||||
|
<!--DEVEL-->
|
||||||
|
|
||||||
|
<!--PACKAGE
|
||||||
|
<link rel="stylesheet" href="kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
|
||||||
|
PACKAGE-->
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<img id="logo" src="demo/kitchen-sink/logo.png">
|
<a href="http://ajaxorg.github.com/ace/" >
|
||||||
|
<img id="logo" src="demo/kitchen-sink/logo.png">
|
||||||
|
</a>
|
||||||
<table id="controls">
|
<table id="controls">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|
@ -216,8 +226,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="editor"></div>
|
<div id="editor"></div>
|
||||||
|
|
||||||
<!-- DEVEL-->
|
<!--DEVEL-->
|
||||||
<link rel="stylesheet" href="demo/kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var require = {
|
var require = {
|
||||||
baseUrl: window.location.protocol + "//" + window.location.host + window.location.pathname.split("/").slice(0, -1).join("/"),
|
baseUrl: window.location.protocol + "//" + window.location.host + window.location.pathname.split("/").slice(0, -1).join("/"),
|
||||||
|
|
@ -228,10 +237,9 @@
|
||||||
</script>
|
</script>
|
||||||
<script src="demo/kitchen-sink/require.js" data-main="demo/kitchen-sink/demo" type="text/javascript"></script>
|
<script src="demo/kitchen-sink/require.js" data-main="demo/kitchen-sink/demo" type="text/javascript"></script>
|
||||||
|
|
||||||
<!--DEVEL -->
|
<!--DEVEL-->
|
||||||
|
|
||||||
<!--PACKAGE
|
<!--PACKAGE
|
||||||
<link rel="stylesheet" href="kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
|
|
||||||
<script src="src/ace.js" data-ace-base="src" type="text/javascript" charset="utf-8"></script>
|
<script src="src/ace.js" data-ace-base="src" type="text/javascript" charset="utf-8"></script>
|
||||||
<script src="src/keybinding-vim.js"></script>
|
<script src="src/keybinding-vim.js"></script>
|
||||||
<script src="src/keybinding-emacs.js"></script>
|
<script src="src/keybinding-emacs.js"></script>
|
||||||
|
|
|
||||||
|
|
@ -53,34 +53,34 @@ function forceTokenize(session){
|
||||||
}
|
}
|
||||||
|
|
||||||
function testStates(session, states) {
|
function testStates(session, states) {
|
||||||
for (var i = 0, l = session.getLength(); i < l; i++)
|
for (var i = 0, l = session.getLength(); i < l; i++)
|
||||||
assert.equal(session.bgTokenizer.states[i], states[i])
|
assert.equal(session.bgTokenizer.states[i], states[i])
|
||||||
assert.ok(l == states.length)
|
assert.ok(l == states.length)
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
||||||
"test background tokenizer update on session change" : function() {
|
"test background tokenizer update on session change" : function() {
|
||||||
var doc = new EditSession([
|
var doc = new EditSession([
|
||||||
"/*",
|
"/*",
|
||||||
"*/",
|
"*/",
|
||||||
"var juhu"
|
"var juhu"
|
||||||
]);
|
]);
|
||||||
doc.setMode("ace/mode/javascript")
|
doc.setMode("./mode/javascript")
|
||||||
|
|
||||||
forceTokenize(doc)
|
forceTokenize(doc)
|
||||||
testStates(doc, ["comment", "start", "start"])
|
testStates(doc, ["comment", "start", "start"])
|
||||||
|
|
||||||
doc.remove(new Range(0,2,1,2))
|
doc.remove(new Range(0,2,1,2))
|
||||||
testStates(doc, [null, "start"])
|
testStates(doc, [null, "start"])
|
||||||
|
|
||||||
forceTokenize(doc)
|
forceTokenize(doc)
|
||||||
testStates(doc, ["comment", "comment"])
|
testStates(doc, ["comment", "comment"])
|
||||||
|
|
||||||
doc.insert({row:0, column:2}, "\n*/")
|
doc.insert({row:0, column:2}, "\n*/")
|
||||||
testStates(doc, [undefined, undefined, "comment"])
|
testStates(doc, [undefined, undefined, "comment"])
|
||||||
|
|
||||||
forceTokenize(doc)
|
forceTokenize(doc)
|
||||||
testStates(doc, ["comment", "start", "start"])
|
testStates(doc, ["comment", "start", "start"])
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -708,15 +708,18 @@ var EditSession = function(text, mode) {
|
||||||
var line = this.getLine(row);
|
var line = this.getLine(row);
|
||||||
|
|
||||||
var inToken = false;
|
var inToken = false;
|
||||||
if (column > 0) {
|
if (column > 0)
|
||||||
inToken = !!line.charAt(column - 1).match(this.tokenRe);
|
inToken = !!line.charAt(column - 1).match(this.tokenRe);
|
||||||
}
|
|
||||||
|
|
||||||
if (!inToken) {
|
if (!inToken)
|
||||||
inToken = !!line.charAt(column).match(this.tokenRe);
|
inToken = !!line.charAt(column).match(this.tokenRe);
|
||||||
}
|
|
||||||
|
if (inToken)
|
||||||
var re = inToken ? this.tokenRe : this.nonTokenRe;
|
var re = this.tokenRe;
|
||||||
|
else if (/^\s+$/.test(line.slice(column-1, column+1)))
|
||||||
|
var re = /\s/;
|
||||||
|
else
|
||||||
|
var re = this.nonTokenRe;
|
||||||
|
|
||||||
var start = column;
|
var start = column;
|
||||||
if (start > 0) {
|
if (start > 0) {
|
||||||
|
|
|
||||||
|
|
@ -397,6 +397,9 @@ var Editor = function(renderer, session) {
|
||||||
* Emitted once the editor comes into focus.
|
* Emitted once the editor comes into focus.
|
||||||
**/
|
**/
|
||||||
this.onFocus = function() {
|
this.onFocus = function() {
|
||||||
|
if (this.$isFocused)
|
||||||
|
return;
|
||||||
|
this.$isFocused = true;
|
||||||
this.renderer.showCursor();
|
this.renderer.showCursor();
|
||||||
this.renderer.visualizeFocus();
|
this.renderer.visualizeFocus();
|
||||||
this._emit("focus");
|
this._emit("focus");
|
||||||
|
|
@ -408,6 +411,9 @@ var Editor = function(renderer, session) {
|
||||||
* Emitted once the editor has been blurred.
|
* Emitted once the editor has been blurred.
|
||||||
**/
|
**/
|
||||||
this.onBlur = function() {
|
this.onBlur = function() {
|
||||||
|
if (!this.$isFocused)
|
||||||
|
return;
|
||||||
|
this.$isFocused = false;
|
||||||
this.renderer.hideCursor();
|
this.renderer.hideCursor();
|
||||||
this.renderer.visualizeBlur();
|
this.renderer.visualizeBlur();
|
||||||
this._emit("blur");
|
this._emit("blur");
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,13 @@ define(function(require, exports, module) {
|
||||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||||
var GolangHighlightRules = require("./golang_highlight_rules").GolangHighlightRules;
|
var GolangHighlightRules = require("./golang_highlight_rules").GolangHighlightRules;
|
||||||
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
||||||
|
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
||||||
|
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||||
|
|
||||||
var Mode = function() {
|
var Mode = function() {
|
||||||
this.$tokenizer = new Tokenizer(new GolangHighlightRules().getRules());
|
this.$tokenizer = new Tokenizer(new GolangHighlightRules().getRules());
|
||||||
this.$outdent = new MatchingBraceOutdent();
|
this.$outdent = new MatchingBraceOutdent();
|
||||||
|
this.foldingRules = new CStyleFoldMode();
|
||||||
};
|
};
|
||||||
oop.inherits(Mode, TextMode);
|
oop.inherits(Mode, TextMode);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,14 @@ var GroovyHighlightRules = function() {
|
||||||
}, {
|
}, {
|
||||||
token : "string.regexp",
|
token : "string.regexp",
|
||||||
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
||||||
|
}, {
|
||||||
|
token : "string",
|
||||||
|
regex : '"""',
|
||||||
|
next : "qqstring"
|
||||||
|
}, {
|
||||||
|
token : "string",
|
||||||
|
regex : "'''",
|
||||||
|
next : "qstring"
|
||||||
}, {
|
}, {
|
||||||
token : "string", // single line
|
token : "string", // single line
|
||||||
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
||||||
|
|
@ -130,6 +138,38 @@ var GroovyHighlightRules = function() {
|
||||||
merge : true,
|
merge : true,
|
||||||
regex : ".+"
|
regex : ".+"
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"qqstring" : [
|
||||||
|
{
|
||||||
|
token : "constant.language.escape",
|
||||||
|
regex : /\\(?:u[0-9A-Fa-f]{4}|.|$)/
|
||||||
|
}, {
|
||||||
|
token : "constant.language.escape",
|
||||||
|
regex : /\$[\w\d]+/
|
||||||
|
}, {
|
||||||
|
token : "constant.language.escape",
|
||||||
|
regex : /\$\{[^"\}]+\}?/
|
||||||
|
}, {
|
||||||
|
token : "string",
|
||||||
|
regex : '"{3,5}',
|
||||||
|
next : "start"
|
||||||
|
}, {
|
||||||
|
token : "string",
|
||||||
|
regex : '.+?'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"qstring" : [
|
||||||
|
{
|
||||||
|
token : "constant.language.escape",
|
||||||
|
regex : /\\(?:u[0-9A-Fa-f]{4}|.|$)/
|
||||||
|
}, {
|
||||||
|
token : "string",
|
||||||
|
regex : "'{3,5}",
|
||||||
|
next : "start"
|
||||||
|
}, {
|
||||||
|
token : "string",
|
||||||
|
regex : ".+?"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,11 +75,16 @@ var ScalaHighlightRules = function() {
|
||||||
token : "string.regexp",
|
token : "string.regexp",
|
||||||
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
||||||
}, {
|
}, {
|
||||||
token : "string", // single line
|
token : "string",
|
||||||
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
regex : '"""',
|
||||||
|
next : "tstring"
|
||||||
}, {
|
}, {
|
||||||
token : "string", // single line
|
token : "string",
|
||||||
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
regex : '"(?=.)', // " strings can't span multiple lines
|
||||||
|
next : "string"
|
||||||
|
}, {
|
||||||
|
token : "symbol.constant", // single line
|
||||||
|
regex : "'[\\w\\d_]+"
|
||||||
}, {
|
}, {
|
||||||
token : "constant.numeric", // hex
|
token : "constant.numeric", // hex
|
||||||
regex : "0[xX][0-9a-fA-F]+\\b"
|
regex : "0[xX][0-9a-fA-F]+\\b"
|
||||||
|
|
@ -131,6 +136,36 @@ var ScalaHighlightRules = function() {
|
||||||
merge : true,
|
merge : true,
|
||||||
regex : ".+"
|
regex : ".+"
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"string" : [
|
||||||
|
{
|
||||||
|
token : "escape",
|
||||||
|
regex : '\\\\"',
|
||||||
|
}, {
|
||||||
|
token : "string",
|
||||||
|
merge : true,
|
||||||
|
regex : '"',
|
||||||
|
next : "start"
|
||||||
|
}, {
|
||||||
|
token : "string.invalid",
|
||||||
|
regex : '[^"\\\\]*$',
|
||||||
|
next : "start"
|
||||||
|
}, {
|
||||||
|
token : "string",
|
||||||
|
regex : '[^"\\\\]+',
|
||||||
|
merge : true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"tstring" : [
|
||||||
|
{
|
||||||
|
token : "string", // closing comment
|
||||||
|
regex : '"{3,5}',
|
||||||
|
next : "start"
|
||||||
|
}, {
|
||||||
|
token : "string", // comment spanning whole line
|
||||||
|
merge : true,
|
||||||
|
regex : ".+?"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ function DefaultHandlers(mouseHandler) {
|
||||||
editor.setDefaultHandler("mousewheel", this.onScroll.bind(mouseHandler));
|
editor.setDefaultHandler("mousewheel", this.onScroll.bind(mouseHandler));
|
||||||
|
|
||||||
var exports = ["select", "startSelect", "drag", "dragEnd", "dragWait",
|
var exports = ["select", "startSelect", "drag", "dragEnd", "dragWait",
|
||||||
"dragWaitEnd", "startDrag"];
|
"dragWaitEnd", "startDrag", "focusWait"];
|
||||||
|
|
||||||
exports.forEach(function(x) {
|
exports.forEach(function(x) {
|
||||||
mouseHandler[x] = this[x];
|
mouseHandler[x] = this[x];
|
||||||
|
|
@ -98,8 +98,9 @@ function DefaultHandlers(mouseHandler) {
|
||||||
if (inSelection && !editor.isFocused()) {
|
if (inSelection && !editor.isFocused()) {
|
||||||
editor.focus();
|
editor.focus();
|
||||||
if (this.$focusWaitTimout && !this.$clickSelection) {
|
if (this.$focusWaitTimout && !this.$clickSelection) {
|
||||||
// todo start select after focusWaitTimout passes
|
this.setState("focusWait");
|
||||||
return;
|
this.captureMouse(ev);
|
||||||
|
return ev.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -212,6 +213,14 @@ function DefaultHandlers(mouseHandler) {
|
||||||
editor.keyBinding.addKeyboardHandler(this.$dragKeybinding);
|
editor.keyBinding.addKeyboardHandler(this.$dragKeybinding);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.focusWait = function() {
|
||||||
|
var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);
|
||||||
|
var time = (new Date()).getTime();
|
||||||
|
|
||||||
|
if (distance > DRAG_OFFSET ||time - this.mousedownEvent.time > this.$focusWaitTimout)
|
||||||
|
this.startSelect();
|
||||||
|
};
|
||||||
|
|
||||||
this.dragWait = function() {
|
this.dragWait = function() {
|
||||||
var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);
|
var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);
|
||||||
var time = (new Date()).getTime();
|
var time = (new Date()).getTime();
|
||||||
|
|
@ -219,7 +228,7 @@ function DefaultHandlers(mouseHandler) {
|
||||||
|
|
||||||
if (distance > DRAG_OFFSET) {
|
if (distance > DRAG_OFFSET) {
|
||||||
this.startSelect();
|
this.startSelect();
|
||||||
} else if ((time - this.mousedownEvent.time) > editor.getDragDelay()) {
|
} else if (time - this.mousedownEvent.time > editor.getDragDelay()) {
|
||||||
this.startDrag()
|
this.startDrag()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
105
lib/ace/mouse/dragdrop.js
vendored
105
lib/ace/mouse/dragdrop.js
vendored
|
|
@ -0,0 +1,105 @@
|
||||||
|
/* vim:ts=4:sts=4:sw=4:
|
||||||
|
* ***** BEGIN LICENSE BLOCK *****
|
||||||
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
|
*
|
||||||
|
* The contents of this file are subject to the Mozilla Public License Version
|
||||||
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
* http://www.mozilla.org/MPL/
|
||||||
|
*
|
||||||
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
|
* for the specific language governing rights and limitations under the
|
||||||
|
* License.
|
||||||
|
*
|
||||||
|
* The Original Code is Ajax.org Code Editor (ACE).
|
||||||
|
*
|
||||||
|
* The Initial Developer of the Original Code is
|
||||||
|
* Ajax.org B.V.
|
||||||
|
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||||
|
* the Initial Developer. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Contributor(s):
|
||||||
|
*
|
||||||
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
|
* of those above. If you wish to allow use of your version of this file only
|
||||||
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
|
* use your version of this file under the terms of the MPL, indicate your
|
||||||
|
* decision by deleting the provisions above and replace them with the notice
|
||||||
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
|
* the provisions above, a recipient may use your version of this file under
|
||||||
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
|
*
|
||||||
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
define(function(require, exports, module) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var event = require("../lib/event");
|
||||||
|
|
||||||
|
var DragdropHandler = function(mouseHandler) {
|
||||||
|
var editor = mouseHandler.editor;
|
||||||
|
var dragSelectionMarker, x, y;
|
||||||
|
var timerId, range, isBackwards;
|
||||||
|
var dragCursor, counter = 0;
|
||||||
|
|
||||||
|
var mouseTarget = editor.container;
|
||||||
|
event.addListener(mouseTarget, "dragenter", function(e) {console.log(e.type, counter,e.target);
|
||||||
|
counter++;
|
||||||
|
if (!dragSelectionMarker) {
|
||||||
|
range = editor.getSelectionRange();
|
||||||
|
isBackwards = editor.selection.isBackwards();
|
||||||
|
var style = editor.getSelectionStyle();
|
||||||
|
dragSelectionMarker = editor.session.addMarker(range, "ace_selection", style);
|
||||||
|
editor.clearSelection();
|
||||||
|
clearInterval(timerId);
|
||||||
|
timerId = setInterval(onDragInterval, 20);
|
||||||
|
}
|
||||||
|
return event.preventDefault(e);
|
||||||
|
});
|
||||||
|
|
||||||
|
event.addListener(mouseTarget, "dragover", function(e) {
|
||||||
|
x = e.clientX;
|
||||||
|
y = e.clientY;
|
||||||
|
return event.preventDefault(e);
|
||||||
|
});
|
||||||
|
|
||||||
|
var onDragInterval = function() {
|
||||||
|
dragCursor = editor.renderer.screenToTextCoordinates(x, y);
|
||||||
|
editor.moveCursorToPosition(dragCursor);
|
||||||
|
editor.renderer.scrollCursorIntoView();
|
||||||
|
};
|
||||||
|
|
||||||
|
event.addListener(mouseTarget, "dragleave", function(e) {console.log(e.type, counter,e.target);
|
||||||
|
counter--;
|
||||||
|
if (counter > 0)
|
||||||
|
return;
|
||||||
|
console.log(e.type, counter,e.target);
|
||||||
|
clearInterval(timerId);
|
||||||
|
editor.session.removeMarker(dragSelectionMarker);
|
||||||
|
dragSelectionMarker = null;
|
||||||
|
editor.selection.setSelectionRange(range, isBackwards);
|
||||||
|
return event.preventDefault(e);
|
||||||
|
});
|
||||||
|
|
||||||
|
event.addListener(mouseTarget, "drop", function(e) {
|
||||||
|
console.log(e.type, counter,e.target);
|
||||||
|
counter = 0;
|
||||||
|
clearInterval(timerId);
|
||||||
|
editor.session.removeMarker(dragSelectionMarker);
|
||||||
|
dragSelectionMarker = null;
|
||||||
|
|
||||||
|
range.end = editor.session.insert(dragCursor, e.dataTransfer.getData('Text'));
|
||||||
|
range.start = dragCursor;
|
||||||
|
editor.focus();
|
||||||
|
editor.selection.setSelectionRange(range);
|
||||||
|
return event.preventDefault(e);
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.DragdropHandler = DragdropHandler;
|
||||||
|
});
|
||||||
|
|
@ -44,12 +44,14 @@ var event = require("../lib/event");
|
||||||
var DefaultHandlers = require("./default_handlers").DefaultHandlers;
|
var DefaultHandlers = require("./default_handlers").DefaultHandlers;
|
||||||
var DefaultGutterHandler = require("./default_gutter_handler").GutterHandler;
|
var DefaultGutterHandler = require("./default_gutter_handler").GutterHandler;
|
||||||
var MouseEvent = require("./mouse_event").MouseEvent;
|
var MouseEvent = require("./mouse_event").MouseEvent;
|
||||||
|
var DragdropHandler = require("./dragdrop").DragdropHandler;
|
||||||
|
|
||||||
var MouseHandler = function(editor) {
|
var MouseHandler = function(editor) {
|
||||||
this.editor = editor;
|
this.editor = editor;
|
||||||
|
|
||||||
new DefaultHandlers(this);
|
new DefaultHandlers(this);
|
||||||
new DefaultGutterHandler(this);
|
new DefaultGutterHandler(this);
|
||||||
|
new DragdropHandler(this);
|
||||||
|
|
||||||
event.addListener(editor.container, "mousedown", function(e) {
|
event.addListener(editor.container, "mousedown", function(e) {
|
||||||
editor.focus();
|
editor.focus();
|
||||||
|
|
|
||||||
|
|
@ -196,10 +196,9 @@ var RangeList = function() {
|
||||||
var lineDif = endRow - startRow;
|
var lineDif = endRow - startRow;
|
||||||
|
|
||||||
var colDiff = -start.column + end.column;
|
var colDiff = -start.column + end.column;
|
||||||
|
|
||||||
var ranges = this.ranges;
|
var ranges = this.ranges;
|
||||||
|
|
||||||
for (var i=0, n = ranges.length; i < n; i++) {
|
for (var i = 0, n = ranges.length; i < n; i++) {
|
||||||
var r = ranges[i];
|
var r = ranges[i];
|
||||||
if (r.end.row < startRow)
|
if (r.end.row < startRow)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -722,8 +722,17 @@ var Selection = function(session) {
|
||||||
if (fold)
|
if (fold)
|
||||||
return this.moveCursorTo(fold.end.row, fold.end.column);
|
return this.moveCursorTo(fold.end.row, fold.end.column);
|
||||||
|
|
||||||
if (column == line.length)
|
if (column == line.length) {
|
||||||
return this.moveCursorRight();
|
var l = this.doc.getLength();
|
||||||
|
do {
|
||||||
|
row++;
|
||||||
|
rightOfCursor = this.doc.getLine(row)
|
||||||
|
} while (row < l && /^\s*$/.test(rightOfCursor))
|
||||||
|
|
||||||
|
if (!/^\s+/.test(rightOfCursor))
|
||||||
|
rightOfCursor = ""
|
||||||
|
column = 0;
|
||||||
|
}
|
||||||
|
|
||||||
var index = this.$shortWordEndIndex(rightOfCursor);
|
var index = this.$shortWordEndIndex(rightOfCursor);
|
||||||
|
|
||||||
|
|
@ -738,11 +747,19 @@ var Selection = function(session) {
|
||||||
if (fold = this.session.getFoldAt(row, column, -1))
|
if (fold = this.session.getFoldAt(row, column, -1))
|
||||||
return this.moveCursorTo(fold.start.row, fold.start.column);
|
return this.moveCursorTo(fold.start.row, fold.start.column);
|
||||||
|
|
||||||
if (column == 0)
|
var line = this.session.getLine(row).substring(0, column);
|
||||||
return this.moveCursorLeft();
|
if (column == 0) {
|
||||||
|
do {
|
||||||
|
row--;
|
||||||
|
line = this.doc.getLine(row);
|
||||||
|
} while (row > 0 && /^\s*$/.test(line))
|
||||||
|
|
||||||
|
column = line.length;
|
||||||
|
if (!/\s+$/.test(line))
|
||||||
|
line = ""
|
||||||
|
}
|
||||||
|
|
||||||
var str = this.session.getLine(row).substring(0, column);
|
var leftOfCursor = lang.stringReverse(line);
|
||||||
var leftOfCursor = lang.stringReverse(str);
|
|
||||||
var index = this.$shortWordEndIndex(leftOfCursor);
|
var index = this.$shortWordEndIndex(leftOfCursor);
|
||||||
|
|
||||||
return this.moveCursorTo(row, column - index);
|
return this.moveCursorTo(row, column - index);
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@
|
||||||
background: #FFFBD1;
|
background: #FFFBD1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace-clouds .ace_gutter_active_line {
|
||||||
|
background-color : #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
.ace-clouds .ace_marker-layer .ace_selected_word {
|
.ace-clouds .ace_marker-layer .ace_selected_word {
|
||||||
border: 1px solid #BDD5FC;
|
border: 1px solid #BDD5FC;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@
|
||||||
background: rgba(215, 215, 215, 0.031);
|
background: rgba(215, 215, 215, 0.031);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace-clouds-midnight .ace_gutter_active_line {
|
||||||
|
background-color : #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
.ace-clouds-midnight .ace_marker-layer .ace_selected_word {
|
.ace-clouds-midnight .ace_marker-layer .ace_selected_word {
|
||||||
border: 1px solid #000000;
|
border: 1px solid #000000;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@
|
||||||
background: rgba(0, 0, 0, 0.35);
|
background: rgba(0, 0, 0, 0.35);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace-cobalt .ace_gutter_active_line {
|
||||||
|
background-color : #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
.ace-cobalt .ace_marker-layer .ace_selected_word {
|
.ace-cobalt .ace_marker-layer .ace_selected_word {
|
||||||
border: 1px solid rgba(179, 101, 57, 0.75);
|
border: 1px solid rgba(179, 101, 57, 0.75);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@
|
||||||
background: rgba(36, 99, 180, 0.12);
|
background: rgba(36, 99, 180, 0.12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace-dawn .ace_gutter_active_line {
|
||||||
|
background-color : #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
.ace-dawn .ace_marker-layer .ace_selected_word {
|
.ace-dawn .ace_marker-layer .ace_selected_word {
|
||||||
border: 1px solid rgba(39, 95, 255, 0.30);
|
border: 1px solid rgba(39, 95, 255, 0.30);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@
|
||||||
background: #353637;
|
background: #353637;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace-idle-fingers .ace_gutter_active_line {
|
||||||
|
background-color : #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
.ace-idle-fingers .ace_marker-layer .ace_selected_word {
|
.ace-idle-fingers .ace_marker-layer .ace_selected_word {
|
||||||
border: 1px solid rgba(90, 100, 126, 0.88);
|
border: 1px solid rgba(90, 100, 126, 0.88);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@
|
||||||
background: #38403D;
|
background: #38403D;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace-kr-theme .ace_gutter_active_line {
|
||||||
|
background-color : #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
.ace-kr-theme .ace_marker-layer .ace_selected_word {
|
.ace-kr-theme .ace_marker-layer .ace_selected_word {
|
||||||
border: 1px solid rgba(170, 0, 255, 0.45);
|
border: 1px solid rgba(170, 0, 255, 0.45);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@
|
||||||
background: #333435;
|
background: #333435;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace-merbivore .ace_gutter_active_line {
|
||||||
|
background-color : #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
.ace-merbivore .ace_marker-layer .ace_selected_word {
|
.ace-merbivore .ace_marker-layer .ace_selected_word {
|
||||||
border: 1px solid #454545;
|
border: 1px solid #454545;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@
|
||||||
background: #333435;
|
background: #333435;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace-merbivore-soft .ace_gutter_active_line {
|
||||||
|
background-color : #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
.ace-merbivore-soft .ace_marker-layer .ace_selected_word {
|
.ace-merbivore-soft .ace_marker-layer .ace_selected_word {
|
||||||
border: 1px solid #494949;
|
border: 1px solid #494949;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@
|
||||||
background: rgba(12, 13, 12, 0.25);
|
background: rgba(12, 13, 12, 0.25);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace-mono-industrial .ace_gutter_active_line {
|
||||||
|
background-color : #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
.ace-mono-industrial .ace_marker-layer .ace_selected_word {
|
.ace-mono-industrial .ace_marker-layer .ace_selected_word {
|
||||||
border: 1px solid rgba(145, 153, 148, 0.40);
|
border: 1px solid rgba(145, 153, 148, 0.40);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,11 +53,11 @@
|
||||||
border: 1px solid #49483E;
|
border: 1px solid #49483E;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-monokai .ace_marker-layer .ace_active_line{
|
.ace-monokai .ace_marker-layer .ace_active_line {
|
||||||
background: #49483E;
|
background: #49483E;
|
||||||
}
|
}
|
||||||
.ace-monokai .ace_gutter_active_line{
|
.ace-monokai .ace_gutter_active_line {
|
||||||
background: #191916;
|
background-color: #191916;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-monokai .ace_marker-layer .ace_selected_word {
|
.ace-monokai .ace_marker-layer .ace_selected_word {
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@
|
||||||
background: rgba(255, 255, 255, 0.031);
|
background: rgba(255, 255, 255, 0.031);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace-pastel-on-dark .ace_gutter_active_line {
|
||||||
|
background-color : #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
.ace-pastel-on-dark .ace_marker-layer .ace_selected_word {
|
.ace-pastel-on-dark .ace_marker-layer .ace_selected_word {
|
||||||
border: 1px solid rgba(221, 240, 255, 0.20);
|
border: 1px solid rgba(221, 240, 255, 0.20);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,9 @@
|
||||||
.ace-solarized-dark .ace_marker-layer .ace_active_line {
|
.ace-solarized-dark .ace_marker-layer .ace_active_line {
|
||||||
background: #073642;
|
background: #073642;
|
||||||
}
|
}
|
||||||
.ace-solarized-dark .ace_gutter_active_line{
|
|
||||||
background: #0d3440;
|
.ace-solarized-dark .ace_gutter_active_line {
|
||||||
|
background-color: #0d3440;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-solarized-dark .ace_marker-layer .ace_selected_word {
|
.ace-solarized-dark .ace_marker-layer .ace_selected_word {
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@
|
||||||
background: #EEE8D5;
|
background: #EEE8D5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace-solarized-light .ace_gutter_active_line {
|
||||||
|
background-color : #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
.ace-solarized-light .ace_marker-layer .ace_selected_word {
|
.ace-solarized-light .ace_marker-layer .ace_selected_word {
|
||||||
border: 1px solid #073642;
|
border: 1px solid #073642;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@
|
||||||
background: #EFEFEF;
|
background: #EFEFEF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace-tomorrow .ace_gutter_active_line {
|
||||||
|
background-color : #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
.ace-tomorrow .ace_marker-layer .ace_selected_word {
|
.ace-tomorrow .ace_marker-layer .ace_selected_word {
|
||||||
border: 1px solid #D6D6D6;
|
border: 1px solid #D6D6D6;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@
|
||||||
background: #282A2E;
|
background: #282A2E;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace-tomorrow-night .ace_gutter_active_line {
|
||||||
|
background-color : #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
.ace-tomorrow-night .ace_marker-layer .ace_selected_word {
|
.ace-tomorrow-night .ace_marker-layer .ace_selected_word {
|
||||||
border: 1px solid #373B41;
|
border: 1px solid #373B41;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,11 +53,12 @@
|
||||||
border: 1px solid #404F7D;
|
border: 1px solid #404F7D;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-tomorrow-night-blue .ace_marker-layer .ace_active_line{
|
.ace-tomorrow-night-blue .ace_marker-layer .ace_active_line {
|
||||||
background: #00346E;
|
background: #00346E;
|
||||||
}
|
}
|
||||||
.ace-tomorrow-night-blue .ace_gutter_active_line{
|
|
||||||
background: #022040;
|
.ace-tomorrow-night-blue .ace_gutter_active_line {
|
||||||
|
background-color: #022040;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-tomorrow-night-blue .ace_marker-layer .ace_selected_word {
|
.ace-tomorrow-night-blue .ace_marker-layer .ace_selected_word {
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@
|
||||||
background: #2A2A2A;
|
background: #2A2A2A;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace-tomorrow-night-bright .ace_gutter_active_line {
|
||||||
|
background-color : #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
.ace-tomorrow-night-bright .ace_marker-layer .ace_selected_word {
|
.ace-tomorrow-night-bright .ace_marker-layer .ace_selected_word {
|
||||||
border: 1px solid #424242;
|
border: 1px solid #424242;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@
|
||||||
background: #393939;
|
background: #393939;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace-tomorrow-night-eighties .ace_gutter_active_line {
|
||||||
|
background-color : #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
.ace-tomorrow-night-eighties .ace_marker-layer .ace_selected_word {
|
.ace-tomorrow-night-eighties .ace_marker-layer .ace_selected_word {
|
||||||
border: 1px solid #515151;
|
border: 1px solid #515151;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@
|
||||||
background: rgba(255, 255, 255, 0.031);
|
background: rgba(255, 255, 255, 0.031);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace-twilight .ace_gutter_active_line {
|
||||||
|
background-color : #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
.ace-twilight .ace_marker-layer .ace_selected_word {
|
.ace-twilight .ace_marker-layer .ace_selected_word {
|
||||||
border: 1px solid rgba(221, 240, 255, 0.20);
|
border: 1px solid rgba(221, 240, 255, 0.20);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@
|
||||||
background: #333333;
|
background: #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace-vibrant-ink .ace_gutter_active_line {
|
||||||
|
background-color : #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
.ace-vibrant-ink .ace_marker-layer .ace_selected_word {
|
.ace-vibrant-ink .ace_marker-layer .ace_selected_word {
|
||||||
border: 1px solid #6699CC;
|
border: 1px solid #6699CC;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@
|
||||||
background: %active_line%;
|
background: %active_line%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.%cssClass% .ace_gutter_active_line {
|
||||||
|
background-color : #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
.%cssClass% .ace_marker-layer .ace_selected_word {
|
.%cssClass% .ace_marker-layer .ace_selected_word {
|
||||||
%selected_word_highlight%
|
%selected_word_highlight%
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue