Merge git://github.com/ajaxorg/ace
This commit is contained in:
commit
c9cef12b9f
87 changed files with 1295 additions and 884 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) 2010, Ajax.org B.V.
|
* Copyright (c) 2010, Ajax.org B.V.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are met:
|
||||||
* * Redistributions of source code must retain the above copyright
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
* * Neither the name of Ajax.org B.V. nor the
|
* * Neither the name of Ajax.org B.V. nor the
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
|
@ -30,8 +30,11 @@
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
var fs = require("fs");
|
var fs = require("fs");
|
||||||
|
var path = require("path");
|
||||||
if (!fs.existsSync)
|
if (!fs.existsSync)
|
||||||
fs.existsSync = require("path").existsSync;
|
fs.existsSync = path.existsSync;
|
||||||
|
else
|
||||||
|
path.existsSync = fs.existsSync;
|
||||||
var copy = require('dryice').copy;
|
var copy = require('dryice').copy;
|
||||||
|
|
||||||
var ACE_HOME = __dirname;
|
var ACE_HOME = __dirname;
|
||||||
|
|
@ -44,7 +47,7 @@ function main(args) {
|
||||||
return "-" + x;
|
return "-" + x;
|
||||||
return x;
|
return x;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (args[2] && (args[2][0] != "-" || args[2].indexOf("h") != -1))
|
if (args[2] && (args[2][0] != "-" || args[2].indexOf("h") != -1))
|
||||||
type = args[2];
|
type = args[2];
|
||||||
|
|
||||||
|
|
@ -66,8 +69,7 @@ function main(args) {
|
||||||
} else if (type == "bm") {
|
} else if (type == "bm") {
|
||||||
bookmarklet();
|
bookmarklet();
|
||||||
} else if (type == "full") {
|
} else if (type == "full") {
|
||||||
ace();
|
demo(ace());
|
||||||
demo();
|
|
||||||
bookmarklet();
|
bookmarklet();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -120,7 +122,7 @@ function ace() {
|
||||||
console.log('# ace ---------');
|
console.log('# ace ---------');
|
||||||
|
|
||||||
// uncompressed
|
// uncompressed
|
||||||
buildAce({
|
var project = buildAce({
|
||||||
compress: false,
|
compress: false,
|
||||||
noconflict: false
|
noconflict: false
|
||||||
});
|
});
|
||||||
|
|
@ -153,9 +155,16 @@ function ace() {
|
||||||
source: ACE_HOME + "/ChangeLog.txt",
|
source: ACE_HOME + "/ChangeLog.txt",
|
||||||
dest: BUILD_DIR + "/ChangeLog.txt"
|
dest: BUILD_DIR + "/ChangeLog.txt"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return project;
|
||||||
}
|
}
|
||||||
|
|
||||||
function demo() {
|
function demo(project) {
|
||||||
|
project = project || buildAce({
|
||||||
|
compress: false,
|
||||||
|
noconflict: false,
|
||||||
|
coreOnly: true
|
||||||
|
});
|
||||||
console.log('# kitchen sink ---------');
|
console.log('# kitchen sink ---------');
|
||||||
|
|
||||||
var version, ref;
|
var version, ref;
|
||||||
|
|
@ -166,23 +175,26 @@ function demo() {
|
||||||
ref = "";
|
ref = "";
|
||||||
version = "";
|
version = "";
|
||||||
}
|
}
|
||||||
var changeComments = function(data) {
|
|
||||||
return (data
|
function changeComments(data) {
|
||||||
.replace(/<!\-\-DEVEL[\d\D]*?DEVEL\-\->/g, "")
|
return (data
|
||||||
.replace(/PACKAGE\-\->|<!\-\-PACKAGE/g, "")
|
.replace(/<!\-\-DEVEL[\d\D]*?DEVEL\-\->/g, "")
|
||||||
.replace(/\/\*DEVEL[\d\D]*?DEVEL\*\//g, "")
|
.replace(/PACKAGE\-\->|<!\-\-PACKAGE/g, "")
|
||||||
.replace(/PACKAGE\*\/|\/\*PACKAGE/g, "")
|
.replace(/\/\*DEVEL[\d\D]*?DEVEL\*\//g, "")
|
||||||
.replace("%version%", version)
|
.replace(/PACKAGE\*\/|\/\*PACKAGE/g, "")
|
||||||
.replace("%commit%", ref)
|
.replace("%version%", version)
|
||||||
);
|
.replace("%commit%", ref)
|
||||||
}
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
function fixDocPaths(data) {
|
||||||
|
return data.replace(/"(demo|build)\//g, "\"");
|
||||||
|
}
|
||||||
|
|
||||||
copy({
|
copy({
|
||||||
source: ACE_HOME + "/kitchen-sink.html",
|
source: ACE_HOME + "/kitchen-sink.html",
|
||||||
dest: BUILD_DIR + "/kitchen-sink.html",
|
dest: BUILD_DIR + "/kitchen-sink.html",
|
||||||
filter: [changeComments, function(data) {
|
filter: [changeComments, fixDocPaths]
|
||||||
return data.replace(/"(demo|build)\//g, "\"");
|
|
||||||
}]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
copy({
|
copy({
|
||||||
|
|
@ -199,22 +211,17 @@ function demo() {
|
||||||
});
|
});
|
||||||
|
|
||||||
var demo = copy.createDataObject();
|
var demo = copy.createDataObject();
|
||||||
|
|
||||||
|
project.assumeAllFilesLoaded();
|
||||||
copy({
|
copy({
|
||||||
source: ACE_HOME + "/demo/kitchen-sink/demo.js",
|
source: [{
|
||||||
dest: demo,
|
project: cloneProject(project),
|
||||||
filter: [changeComments, function(data) {
|
require: [ "kitchen-sink/demo" ]
|
||||||
return data.replace(/"(demo|build)\//g, "\"");
|
}],
|
||||||
}, function(data) {
|
filter: getWriteFilters({filters:[fixDocPaths]}, "demo"),
|
||||||
return data.replace("define(", "define('kitchen-sink/demo',");
|
dest: demo
|
||||||
}]
|
|
||||||
});
|
|
||||||
copy({
|
|
||||||
source: ACE_HOME + "/lib/ace/split.js",
|
|
||||||
dest: demo,
|
|
||||||
filter: [changeComments, function(data) {
|
|
||||||
return data.replace("define(", "define('ace/split',");
|
|
||||||
}]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
copy({
|
copy({
|
||||||
source: demo,
|
source: demo,
|
||||||
dest: BUILD_DIR + "/kitchen-sink/demo.js",
|
dest: BUILD_DIR + "/kitchen-sink/demo.js",
|
||||||
|
|
@ -223,7 +230,57 @@ function demo() {
|
||||||
copyFileSync(ACE_HOME + "/demo/kitchen-sink/logo.png", BUILD_DIR + "/kitchen-sink/logo.png");
|
copyFileSync(ACE_HOME + "/demo/kitchen-sink/logo.png", BUILD_DIR + "/kitchen-sink/logo.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildAce(options) {
|
function jsFileList(path, filter) {
|
||||||
|
path = ACE_HOME + "/" + path;
|
||||||
|
if (!filter)
|
||||||
|
filter = /_test/;
|
||||||
|
|
||||||
|
return fs.readdirSync(path).map(function(x) {
|
||||||
|
if (x.slice(-3) == ".js" && !filter.test(x))
|
||||||
|
return x.slice(0, -3);
|
||||||
|
}).filter(function(x){ return !!x });
|
||||||
|
}
|
||||||
|
|
||||||
|
function addSuffix(options) {
|
||||||
|
if (options.suffix == null) {
|
||||||
|
options.suffix = "";
|
||||||
|
if (options.compress)
|
||||||
|
options.suffix += "-min";
|
||||||
|
if (options.noconflict)
|
||||||
|
options.suffix += "-noconflict";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getWriteFilters(options, projectType) {
|
||||||
|
var filters = [
|
||||||
|
copy.filter.moduleDefines,
|
||||||
|
removeUseStrict,
|
||||||
|
removeLicenceComments,
|
||||||
|
inlineTextModules
|
||||||
|
];
|
||||||
|
|
||||||
|
if (options.filters)
|
||||||
|
filters = filters.concat(options.filters);
|
||||||
|
|
||||||
|
if (projectType == "worker")
|
||||||
|
return filters;
|
||||||
|
|
||||||
|
if (options.noconflict)
|
||||||
|
filters.push(namespace(options.ns));
|
||||||
|
|
||||||
|
if (options.compress)
|
||||||
|
filters.push(copy.filter.uglifyjs);
|
||||||
|
|
||||||
|
if (options.exportModule && projectType == "main") {
|
||||||
|
if (options.noconflict)
|
||||||
|
filters.push(exportAce(options.ns, options.exportModule, options.ns));
|
||||||
|
else
|
||||||
|
filters.push(exportAce(options.ns, options.exportModule));
|
||||||
|
}
|
||||||
|
return filters;
|
||||||
|
}
|
||||||
|
|
||||||
|
var buildAce = function(options) {
|
||||||
var aceProject = {
|
var aceProject = {
|
||||||
roots: [ACE_HOME + '/lib', ACE_HOME + '/demo'],
|
roots: [ACE_HOME + '/lib', ACE_HOME + '/demo'],
|
||||||
textPluginPattern: /^ace\/requirejs\/text!/
|
textPluginPattern: /^ace\/requirejs\/text!/
|
||||||
|
|
@ -238,51 +295,22 @@ function buildAce(options) {
|
||||||
noconflict: false,
|
noconflict: false,
|
||||||
suffix: null,
|
suffix: null,
|
||||||
name: "ace",
|
name: "ace",
|
||||||
modes: fs.readdirSync(ACE_HOME + "/lib/ace/mode").map(function(x) {
|
modes: jsFileList("lib/ace/mode", /_highlight_rules|_test|_worker|xml_util|_outdent|behaviour/),
|
||||||
if (x.slice(-3) == ".js" && !/_highlight_rules|_test|_worker|xml_util|_outdent|behaviour/.test(x))
|
themes: jsFileList("lib/ace/theme"),
|
||||||
return x.slice(0, -3);
|
extensions: jsFileList("lib/ace/ext"),
|
||||||
}).filter(function(x) { return !!x; }),
|
|
||||||
themes: fs.readdirSync(ACE_HOME + "/lib/ace/theme").map(function(x){
|
|
||||||
return x.slice(-3) == ".js" && x.slice(0, -3);
|
|
||||||
}).filter(function(x){ return !!x; }),
|
|
||||||
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) {
|
addSuffix(options);
|
||||||
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,
|
|
||||||
removeUseStrict,
|
|
||||||
removeLicenceCmments
|
|
||||||
];
|
|
||||||
|
|
||||||
if (options.noconflict) {
|
|
||||||
filters.push(namespace(options.ns));
|
|
||||||
if (options.exportModule)
|
|
||||||
var exportFilter = exportAce(options.ns, options.exportModule, options.ns);
|
|
||||||
} else if (options.exportModule) {
|
|
||||||
var exportFilter = exportAce(options.ns, options.exportModule);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.compress)
|
|
||||||
filters.push(copy.filter.uglifyjs);
|
|
||||||
|
|
||||||
var targetDir = options.targetDir + options.suffix;
|
var targetDir = options.targetDir + options.suffix;
|
||||||
var name = options.name;
|
var name = options.name;
|
||||||
|
|
||||||
|
|
@ -300,10 +328,13 @@ function buildAce(options) {
|
||||||
filter: [ copy.filter.moduleDefines ],
|
filter: [ copy.filter.moduleDefines ],
|
||||||
dest: ace
|
dest: ace
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (options.coreOnly)
|
||||||
|
return project;
|
||||||
|
|
||||||
copy({
|
copy({
|
||||||
source: ace,
|
source: ace,
|
||||||
filter: exportFilter ? filters.concat(exportFilter) : filters,
|
filter: getWriteFilters(options, "main"),
|
||||||
dest: targetDir + '/' + name + ".js"
|
dest: targetDir + '/' + name + ".js"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -317,7 +348,7 @@ function buildAce(options) {
|
||||||
project: cloneProject(project),
|
project: cloneProject(project),
|
||||||
require: [ 'ace/mode/' + mode ]
|
require: [ 'ace/mode/' + mode ]
|
||||||
}],
|
}],
|
||||||
filter: filters,
|
filter: getWriteFilters(options, "mode"),
|
||||||
dest: targetDir + "/mode-" + mode + ".js"
|
dest: targetDir + "/mode-" + mode + ".js"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -327,26 +358,29 @@ function buildAce(options) {
|
||||||
project.assumeAllFilesLoaded();
|
project.assumeAllFilesLoaded();
|
||||||
options.themes.forEach(function(theme) {
|
options.themes.forEach(function(theme) {
|
||||||
console.log("theme " + theme);
|
console.log("theme " + theme);
|
||||||
/*copy({
|
copy({
|
||||||
source: [{
|
source: [{
|
||||||
project: cloneProject(project),
|
project: cloneProject(project),
|
||||||
require: ["ace/theme/" + theme]
|
require: ["ace/theme/" + theme]
|
||||||
}],
|
}],
|
||||||
filter: filters,
|
filter: getWriteFilters(options, "theme"),
|
||||||
dest: targetDir + "/theme-" + theme + ".js"
|
dest: targetDir + "/theme-" + theme.replace("_theme", "") + ".js"
|
||||||
});*/
|
});
|
||||||
// use this instead, to not create separate modules for js and css
|
});
|
||||||
var themePath = ACE_HOME + "/lib/ace/theme/" + theme
|
|
||||||
var js = fs.readFileSync(themePath + ".js", "utf8");
|
console.log('# ace extensions ---------');
|
||||||
js = js.replace("define(", "define('ace/theme/" + theme + "', ['require', 'exports', 'module', 'ace/lib/dom'], ");
|
|
||||||
|
project.assumeAllFilesLoaded();
|
||||||
if (fs.existsSync(themePath + ".css", "utf8")) {
|
options.extensions.forEach(function(ext) {
|
||||||
var css = fs.readFileSync(themePath + ".css", "utf8")
|
console.log("extensions " + ext);
|
||||||
js = js.replace(/require\(.ace\/requirejs\/text!.*?\)/, quoteString(css))
|
copy({
|
||||||
}
|
source: [{
|
||||||
filters.forEach(function(f) {js = f(js); });
|
project: cloneProject(project),
|
||||||
|
require: [ 'ace/ext/' + ext ]
|
||||||
fs.writeFileSync(targetDir + "/theme-" + theme + ".js", js);
|
}],
|
||||||
|
filter: getWriteFilters(options, "ext"),
|
||||||
|
dest: targetDir + "/ext-" + ext + ".js"
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('# ace key bindings ---------');
|
console.log('# ace key bindings ---------');
|
||||||
|
|
@ -359,19 +393,12 @@ function buildAce(options) {
|
||||||
project: cloneProject(project),
|
project: cloneProject(project),
|
||||||
require: [ 'ace/keyboard/' + keybinding ]
|
require: [ 'ace/keyboard/' + keybinding ]
|
||||||
}],
|
}],
|
||||||
filter: filters,
|
filter: getWriteFilters(options, "keybinding"),
|
||||||
dest: targetDir + "/keybinding-" + keybinding + ".js"
|
dest: targetDir + "/keybinding-" + keybinding + ".js"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('# ace worker ---------');
|
console.log('# ace worker ---------');
|
||||||
|
|
||||||
filters = [
|
|
||||||
copy.filter.moduleDefines,
|
|
||||||
filterTextPlugin,
|
|
||||||
removeUseStrict,
|
|
||||||
removeLicenceCmments
|
|
||||||
];
|
|
||||||
|
|
||||||
options.workers.forEach(function(mode) {
|
options.workers.forEach(function(mode) {
|
||||||
console.log("worker for " + mode + " mode");
|
console.log("worker for " + mode + " mode");
|
||||||
|
|
@ -390,7 +417,7 @@ function buildAce(options) {
|
||||||
'ace/mode/' + mode + '_worker'
|
'ace/mode/' + mode + '_worker'
|
||||||
]
|
]
|
||||||
}],
|
}],
|
||||||
filter: filters,
|
filter: getWriteFilters(options, "worker"),
|
||||||
dest: worker
|
dest: worker
|
||||||
});
|
});
|
||||||
copy({
|
copy({
|
||||||
|
|
@ -404,14 +431,70 @@ function buildAce(options) {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
console.log('# combining files into one ---------');
|
|
||||||
|
|
||||||
if (options.shrinkwrap) {
|
if (options.shrinkwrap) {
|
||||||
|
console.log('# combining files into one ---------');
|
||||||
copy({
|
copy({
|
||||||
source: { root:targetDir, exclude:/^worker\-/ },
|
source: { root:targetDir, exclude:/^worker\-/ },
|
||||||
dest: BUILD_DIR + '/ace-min.js'
|
dest: BUILD_DIR + '/ace-min.js'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return project;
|
||||||
|
};
|
||||||
|
|
||||||
|
// silence annoying messages from dryice
|
||||||
|
var buildAce = function(fn) {
|
||||||
|
return function() {
|
||||||
|
var log = console.log
|
||||||
|
console.log = function() {
|
||||||
|
if (typeof arguments[0] == "string" && /Ignoring requirement/.test(arguments[0]))
|
||||||
|
return;
|
||||||
|
log.apply(console, arguments);
|
||||||
|
}
|
||||||
|
var ret = fn.apply(null, arguments);
|
||||||
|
console.log = log;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}(buildAce);
|
||||||
|
|
||||||
|
var textModules = {}
|
||||||
|
var detectTextModules = function(input, source) {
|
||||||
|
if (!source)
|
||||||
|
throw new Error('Missing filename for text module');
|
||||||
|
|
||||||
|
if (typeof input !== 'string')
|
||||||
|
input = input.toString();
|
||||||
|
|
||||||
|
var module = source.isLocation ? source.path : source;
|
||||||
|
|
||||||
|
input = input.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
||||||
|
input = input.replace(/\n\s+/g, "\n");
|
||||||
|
input = '"' + input.replace(/\n/g, '\\\n') + '"';
|
||||||
|
textModules[module] = input;
|
||||||
|
|
||||||
|
return "";
|
||||||
|
};
|
||||||
|
detectTextModules.onRead = true;
|
||||||
|
copy.filter.addDefines = detectTextModules;
|
||||||
|
|
||||||
|
function inlineTextModules(text) {
|
||||||
|
var lastDep = "";
|
||||||
|
return text.replace(/, *['"]ace\/requirejs\/text!(.*?)['"]|= *require\(['"](?:ace|[.\/]+)\/requirejs\/text!(.*?)['"]\)/g, function(_, dep, call) {
|
||||||
|
if (dep) {
|
||||||
|
if (!lastDep) {
|
||||||
|
lastDep = dep;
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
} else if (call) {
|
||||||
|
call = textModules[lastDep];
|
||||||
|
delete textModules[lastDep];
|
||||||
|
lastDep = "";
|
||||||
|
if (call)
|
||||||
|
return "= " + call;
|
||||||
|
}
|
||||||
|
console.log(dep, lastDep, call);
|
||||||
|
throw "inlining of multiple text modules is not supported";
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: replace with project.clone once it is fixed in dryice
|
// TODO: replace with project.clone once it is fixed in dryice
|
||||||
|
|
@ -432,6 +515,7 @@ function cloneProject(project) {
|
||||||
|
|
||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyFileSync(srcFile, destFile) {
|
function copyFileSync(srcFile, destFile) {
|
||||||
var BUF_LENGTH = 64*1024,
|
var BUF_LENGTH = 64*1024,
|
||||||
buf = new Buffer(BUF_LENGTH),
|
buf = new Buffer(BUF_LENGTH),
|
||||||
|
|
@ -458,16 +542,12 @@ function quoteString(str) {
|
||||||
return '"' + str.replace(/\\/, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\\n") + '"';
|
return '"' + str.replace(/\\/, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\\n") + '"';
|
||||||
}
|
}
|
||||||
|
|
||||||
function filterTextPlugin(text) {
|
|
||||||
return text.replace(/(['"])ace\/requirejs\/text\!/g, "$1text!");
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeUseStrict(text) {
|
function removeUseStrict(text) {
|
||||||
return text.replace(/['"]use strict['"];/g, "");
|
return text.replace(/['"]use strict['"];/g, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeLicenceCmments(text) {
|
function removeLicenceComments(text) {
|
||||||
return text.replace(/(;)\s*\/\*[\d\D]*?\*\//g, "$1");
|
return text.replace(/(?:(;)|\n)\s*\/\*[\d\D]*?\*\/|\n\s*\/\/.*/g, "$1");
|
||||||
}
|
}
|
||||||
|
|
||||||
function namespace(ns) {
|
function namespace(ns) {
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
BIN
doc/site/images/ideone-logo.png
Normal file
BIN
doc/site/images/ideone-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
|
|
@ -2,6 +2,7 @@ var editor;
|
||||||
var embedded_editor;
|
var embedded_editor;
|
||||||
$(function() {
|
$(function() {
|
||||||
hljs.initHighlighting();
|
hljs.initHighlighting();
|
||||||
|
ace.config.set("workerPath", "build/src-min");
|
||||||
editor = ace.edit("ace_editor_demo");
|
editor = ace.edit("ace_editor_demo");
|
||||||
embedded_editor = ace.edit("embedded_ace_code");
|
embedded_editor = ace.edit("embedded_ace_code");
|
||||||
editor.getSession().setMode("ace/mode/javascript");
|
editor.getSession().setMode("ace/mode/javascript");
|
||||||
|
|
|
||||||
|
|
@ -250,6 +250,14 @@ ul.menu-list li {
|
||||||
hsl(0,0%,90%) 47%,
|
hsl(0,0%,90%) 47%,
|
||||||
hsl(0,0%,78%) 53%,
|
hsl(0,0%,78%) 53%,
|
||||||
hsl(0,0%,70%)100%);
|
hsl(0,0%,70%)100%);
|
||||||
|
background-image: -moz-repeating-linear-gradient(left, hsla(0,0%,100%,0) 0%, hsla(0,0%,100%,0) 6%, hsla(0,0%,100%, .1) 7.5%),
|
||||||
|
-moz-repeating-linear-gradient(left, hsla(0,0%, 0%,0) 0%, hsla(0,0%, 0%,0) 4%, hsla(0,0%, 0%,.03) 4.5%),
|
||||||
|
-moz-repeating-linear-gradient(left, hsla(0,0%,100%,0) 0%, hsla(0,0%,100%,0) 1.2%, hsla(0,0%,100%,.15) 2.2%),
|
||||||
|
|
||||||
|
-moz-linear-gradient(-90deg, hsl(0,0%,78%) 0%,
|
||||||
|
hsl(0,0%,90%) 47%,
|
||||||
|
hsl(0,0%,78%) 53%,
|
||||||
|
hsl(0,0%,70%)100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
ul.menu-list li:hover {
|
ul.menu-list li:hover {
|
||||||
|
|
|
||||||
|
|
@ -514,6 +514,11 @@ tests for the highlighting.</p>
|
||||||
style="position: relative; left: 10px;top: -5px;width: 80px;" />
|
style="position: relative; left: 10px;top: -5px;width: 80px;" />
|
||||||
<a href="http://SpanDeX.io/">SpanDeX.io</a>
|
<a href="http://SpanDeX.io/">SpanDeX.io</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<img src="doc/site/images/ideone-logo.png"
|
||||||
|
style="position: relative; left: -5px; top: 20px;">
|
||||||
|
<a href="http://ideone.com">Ideone.com</a>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://github.com/Gozala/sky-edit">Sky Edit</a>
|
<a href="https://github.com/Gozala/sky-edit">Sky Edit</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
54
install.js
54
install.js
|
|
@ -33,27 +33,41 @@
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
var buildAce = require("./Makefile.dryice").buildAce;
|
var buildAce = require("./Makefile.dryice").buildAce;
|
||||||
|
var fs = require("fs");
|
||||||
|
|
||||||
var ACE_HOME = __dirname;
|
var ACE_HOME = __dirname;
|
||||||
|
|
||||||
try {
|
function getVersion(path) {
|
||||||
var aceProject = {
|
if (fs.existsSync(path + "/.git-ref"))
|
||||||
roots: [
|
return fs.readFileSync(path + "/.git-ref", "utf8");
|
||||||
ACE_HOME + '/lib',
|
if (fs.existsSync(path + "/.git/ORIG_HEAD"))
|
||||||
ACE_HOME + '/demo'
|
return fs.readFileSync(path + "/.git/ORIG_HEAD", "utf8");
|
||||||
],
|
if (fs.existsSync(path + "/.sourcemint/source.json")) {
|
||||||
textPluginPattern: /^ace\/requirejs\/text!/
|
var json = fs.readFileSync(path + "/.sourcemint/source.json", "utf8");
|
||||||
};
|
return JSON.parse(json).url.split("/").pop();
|
||||||
buildAce(aceProject, {
|
}
|
||||||
compress: false,
|
|
||||||
noconflict: false,
|
|
||||||
suffix: "",
|
|
||||||
compat: true,
|
|
||||||
name: "ace"
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
console.log("--- Ace Build error ---");
|
|
||||||
console.log(e);
|
|
||||||
process.exit(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (process.argv.indexOf("-c") > 0) try {
|
||||||
|
var version = getVersion(ACE_HOME);
|
||||||
|
var oldVersion = getVersion(ACE_HOME + "/build");
|
||||||
|
if (version && oldVersion == version) {
|
||||||
|
console.log("ace build is up to date");
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
fs.writeFileSync(ACE_HOME + "/build/.git-ref", version, "utf8");
|
||||||
|
} catch (e) {}
|
||||||
|
|
||||||
|
try {
|
||||||
|
buildAce({
|
||||||
|
compress: false,
|
||||||
|
noconflict: false,
|
||||||
|
suffix: "",
|
||||||
|
name: "ace"
|
||||||
|
});
|
||||||
|
|
||||||
|
} catch (err) {
|
||||||
|
console.error("--- Ace Build error ---");
|
||||||
|
console.error(err.stack);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
@ -53,8 +53,8 @@ var MultiSelect = require("./multi_select").MultiSelect;
|
||||||
// The following require()s are for inclusion in the built ace file
|
// The following require()s are for inclusion in the built ace file
|
||||||
require("./worker/worker_client");
|
require("./worker/worker_client");
|
||||||
require("./keyboard/hash_handler");
|
require("./keyboard/hash_handler");
|
||||||
require("./keyboard/state_handler");
|
|
||||||
require("./placeholder");
|
require("./placeholder");
|
||||||
|
require("./mode/folding/fold_mode");
|
||||||
exports.config = require("./config");
|
exports.config = require("./config");
|
||||||
/**
|
/**
|
||||||
* Ace.edit(el) -> Editor
|
* Ace.edit(el) -> Editor
|
||||||
|
|
@ -66,9 +66,8 @@ exports.config = require("./config");
|
||||||
exports.edit = function(el) {
|
exports.edit = function(el) {
|
||||||
if (typeof(el) == "string") {
|
if (typeof(el) == "string") {
|
||||||
var _id = el;
|
var _id = el;
|
||||||
if (!(el = document.getElementById(el))) {
|
if (!(el = document.getElementById(el)))
|
||||||
console.log("can't match div #" + _id);
|
throw "ace.edit can't find div #" + _id;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (el.env && el.env.editor instanceof Editor)
|
if (el.env && el.env.editor instanceof Editor)
|
||||||
|
|
|
||||||
|
|
@ -321,11 +321,26 @@ exports.commands = [{
|
||||||
bindKey: bindKey("Ctrl-Shift-D", "Command-Shift-D"),
|
bindKey: bindKey("Ctrl-Shift-D", "Command-Shift-D"),
|
||||||
exec: function(editor) { editor.duplicateSelection(); },
|
exec: function(editor) { editor.duplicateSelection(); },
|
||||||
multiSelectAction: "forEach"
|
multiSelectAction: "forEach"
|
||||||
|
}, {
|
||||||
|
name: "sortlines",
|
||||||
|
bindKey: bindKey("Ctrl-Alt-S", "Command-Alt-S"),
|
||||||
|
exec: function(editor) { editor.sortLines(); },
|
||||||
|
multiSelectAction: "forEach"
|
||||||
}, {
|
}, {
|
||||||
name: "togglecomment",
|
name: "togglecomment",
|
||||||
bindKey: bindKey("Ctrl-/", "Command-/"),
|
bindKey: bindKey("Ctrl-/", "Command-/"),
|
||||||
exec: function(editor) { editor.toggleCommentLines(); },
|
exec: function(editor) { editor.toggleCommentLines(); },
|
||||||
multiSelectAction: "forEach"
|
multiSelectAction: "forEach"
|
||||||
|
}, {
|
||||||
|
name: "modifyNumberUp",
|
||||||
|
bindKey: bindKey("Ctrl-Shift-Up", "Alt-Shift-Up"),
|
||||||
|
exec: function(editor) { editor.modifyNumber(1); },
|
||||||
|
multiSelectAction: "forEach"
|
||||||
|
}, {
|
||||||
|
name: "modifyNumberDown",
|
||||||
|
bindKey: bindKey("Ctrl-Shift-Down", "Alt-Shift-Down"),
|
||||||
|
exec: function(editor) { editor.modifyNumber(-1); },
|
||||||
|
multiSelectAction: "forEach"
|
||||||
}, {
|
}, {
|
||||||
name: "replace",
|
name: "replace",
|
||||||
bindKey: bindKey("Ctrl-R", "Command-Option-F"),
|
bindKey: bindKey("Ctrl-R", "Command-Option-F"),
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,10 @@ var global = (function() {
|
||||||
|
|
||||||
var options = {
|
var options = {
|
||||||
packaged: false,
|
packaged: false,
|
||||||
workerPath: "",
|
workerPath: null,
|
||||||
modePath: "",
|
modePath: null,
|
||||||
themePath: "",
|
themePath: null,
|
||||||
|
basePath: "",
|
||||||
suffix: ".js",
|
suffix: ".js",
|
||||||
$moduleUrls: {}
|
$moduleUrls: {}
|
||||||
};
|
};
|
||||||
|
|
@ -74,7 +75,12 @@ exports.moduleUrl = function(name, component) {
|
||||||
|
|
||||||
if (!base && parts.length > 1)
|
if (!base && parts.length > 1)
|
||||||
base = parts[parts.length - 2];
|
base = parts[parts.length - 2];
|
||||||
return this.get(component + "Path") + "/" + component + "-" + base + this.get("suffix");
|
var path = options[component + "Path"];
|
||||||
|
if (path == null)
|
||||||
|
path = options.basePath;
|
||||||
|
if (path && path.slice(-1) != "/")
|
||||||
|
path += "/";
|
||||||
|
return path + component + "-" + base + this.get("suffix");
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.setModuleUrl = function(name, subst) {
|
exports.setModuleUrl = function(name, subst) {
|
||||||
|
|
@ -95,9 +101,8 @@ exports.init = function() {
|
||||||
var script = scripts[i];
|
var script = scripts[i];
|
||||||
|
|
||||||
var src = script.src || script.getAttribute("src");
|
var src = script.src || script.getAttribute("src");
|
||||||
if (!src) {
|
if (!src)
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
var attributes = script.attributes;
|
var attributes = script.attributes;
|
||||||
for (var j=0, l=attributes.length; j < l; j++) {
|
for (var j=0, l=attributes.length; j < l; j++) {
|
||||||
|
|
|
||||||
71
lib/ace/config_test.js
Normal file
71
lib/ace/config_test.js
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
|
* Distributed under the BSD license:
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010, Ajax.org B.V.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of Ajax.org B.V. nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
if (typeof process !== "undefined") {
|
||||||
|
require("amd-loader");
|
||||||
|
}
|
||||||
|
|
||||||
|
define(function(require, exports, module) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var config = require("./config");
|
||||||
|
var assert = require("./test/assertions");
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
|
||||||
|
"test path resolution" : function() {
|
||||||
|
config.set("packaged", "true");
|
||||||
|
var url = config.moduleUrl("kr_theme", "theme");
|
||||||
|
assert.equal(url, "theme-kr.js");
|
||||||
|
|
||||||
|
config.set("basePath", "a/b");
|
||||||
|
url = config.moduleUrl("m/theme", "theme");
|
||||||
|
assert.equal(url, "a/b/theme-m.js");
|
||||||
|
|
||||||
|
url = config.moduleUrl("m/theme", "ext");
|
||||||
|
assert.equal(url, "a/b/ext-theme.js");
|
||||||
|
|
||||||
|
config.set("workerPath", "c/");
|
||||||
|
url = config.moduleUrl("foo/1", "worker");
|
||||||
|
assert.equal(url, "c/worker-1.js");
|
||||||
|
|
||||||
|
config.setModuleUrl("foo/1", "a/b1.js");
|
||||||
|
url = config.moduleUrl("foo/1", "theme");
|
||||||
|
assert.equal(url, "a/b1.js");
|
||||||
|
|
||||||
|
assert.equal();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
if (typeof module !== "undefined" && module === require.main) {
|
||||||
|
require("asyncjs").test.testcase(module.exports).exec()
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
.ace_editor {
|
.ace_editor {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
font-family: 'Menlo', 'Monaco', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -148,10 +148,22 @@
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_cursor.ace_hidden {
|
.ace_hidden-cursors .ace_cursor {
|
||||||
opacity: 0.2;
|
opacity: 0.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace_smooth-blinking .ace_cursor {
|
||||||
|
-moz-transition: opacity 0.18s;
|
||||||
|
-webkit-transition: opacity 0.18s;
|
||||||
|
-o-transition: opacity 0.18s;
|
||||||
|
-ms-transition: opacity 0.18s;
|
||||||
|
transition: opacity 0.18s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace_cursor[style*="opacity: 0"]{
|
||||||
|
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
||||||
|
}
|
||||||
|
|
||||||
.ace_editor.ace_multiselect .ace_cursor {
|
.ace_editor.ace_multiselect .ace_cursor {
|
||||||
border-left-width: 1px;
|
border-left-width: 1px;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -375,14 +375,7 @@ var EditSession = function(text, mode) {
|
||||||
token.start = c - token.value.length;
|
token.start = c - token.value.length;
|
||||||
return token;
|
return token;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.highlight = function(re) {
|
|
||||||
if (!this.$searchHighlight) {
|
|
||||||
var highlight = new SearchHighlight(null, "ace_selected-word", "text");
|
|
||||||
this.$searchHighlight = this.addDynamicMarker(highlight);
|
|
||||||
}
|
|
||||||
this.$searchHighlight.setRegexp(re);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* EditSession.setUndoManager(undoManager)
|
* EditSession.setUndoManager(undoManager)
|
||||||
* - undoManager (UndoManager): The new undo manager
|
* - undoManager (UndoManager): The new undo manager
|
||||||
|
|
@ -736,6 +729,30 @@ var EditSession = function(text, mode) {
|
||||||
return inFront ? this.$frontMarkers : this.$backMarkers;
|
return inFront ? this.$frontMarkers : this.$backMarkers;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.highlight = function(re) {
|
||||||
|
if (!this.$searchHighlight) {
|
||||||
|
var highlight = new SearchHighlight(null, "ace_selected-word", "text");
|
||||||
|
this.$searchHighlight = this.addDynamicMarker(highlight);
|
||||||
|
}
|
||||||
|
this.$searchHighlight.setRegexp(re);
|
||||||
|
}
|
||||||
|
|
||||||
|
// experimental
|
||||||
|
this.highlightLines = function(startRow, endRow, clazz, inFront) {
|
||||||
|
if (typeof endRow != "number") {
|
||||||
|
clazz = endRow;
|
||||||
|
endRow = startRow;
|
||||||
|
}
|
||||||
|
if (!clazz)
|
||||||
|
clazz = "ace_step";
|
||||||
|
|
||||||
|
var range = new Range(startRow, 0, endRow, Infinity);
|
||||||
|
|
||||||
|
var id = this.addMarker(range, clazz, "fullLine", inFront);
|
||||||
|
range.id = id;
|
||||||
|
return range;
|
||||||
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Error:
|
* Error:
|
||||||
* {
|
* {
|
||||||
|
|
|
||||||
|
|
@ -481,28 +481,24 @@ var Editor = function(renderer, session) {
|
||||||
this.$updateHighlightActiveLine = function() {
|
this.$updateHighlightActiveLine = function() {
|
||||||
var session = this.getSession();
|
var session = this.getSession();
|
||||||
|
|
||||||
if (session.$highlightLineMarker)
|
var highlight;
|
||||||
session.removeMarker(session.$highlightLineMarker);
|
|
||||||
|
|
||||||
session.$highlightLineMarker = null;
|
|
||||||
|
|
||||||
if (this.$highlightActiveLine) {
|
if (this.$highlightActiveLine) {
|
||||||
var cursor = this.getCursorPosition();
|
if ((this.$selectionStyle != "line" || !this.selection.isMultiLine()))
|
||||||
var foldLine = this.session.getFoldLine(cursor.row);
|
highlight = this.getCursorPosition();
|
||||||
|
}
|
||||||
|
|
||||||
if ((this.getSelectionStyle() != "line" || !this.selection.isMultiLine())) {
|
if (session.$highlightLineMarker && !highlight) {
|
||||||
var range;
|
session.removeMarker(session.$highlightLineMarker.id);
|
||||||
if (foldLine) {
|
session.$highlightLineMarker = null;
|
||||||
range = new Range(foldLine.start.row, 0, foldLine.end.row + 1, 0);
|
} else if (!session.$highlightLineMarker && highlight) {
|
||||||
} else {
|
session.$highlightLineMarker = session.highlightLines(highlight.row, highlight.row, "ace_active-line");
|
||||||
range = new Range(cursor.row, 0, cursor.row+1, 0);
|
} else if (highlight) {
|
||||||
}
|
session.$highlightLineMarker.start.row = highlight.row;
|
||||||
session.$highlightLineMarker = session.addMarker(range, "ace_active-line", "background");
|
session.$highlightLineMarker.end.row = highlight.row;
|
||||||
}
|
session._emit("changeBackMarker");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
this.onSelectionChange = function(e) {
|
this.onSelectionChange = function(e) {
|
||||||
var session = this.session;
|
var session = this.session;
|
||||||
|
|
||||||
|
|
@ -656,6 +652,11 @@ var Editor = function(renderer, session) {
|
||||||
this.insert(text);
|
this.insert(text);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
this.execCommand = function(command, args) {
|
||||||
|
this.commands.exec(command, this, args);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Editor.insert(text)
|
* Editor.insert(text)
|
||||||
* - text (String): The new text to add
|
* - text (String): The new text to add
|
||||||
|
|
@ -1276,10 +1277,35 @@ var Editor = function(renderer, session) {
|
||||||
this.session.outdentRows(selection.getRange());
|
this.session.outdentRows(selection.getRange());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// TODO: move out of core when we have good mechanism for managing extensions
|
||||||
|
this.sortLines = function() {
|
||||||
|
var rows = this.$getSelectedRows();
|
||||||
|
var session = this.session;
|
||||||
|
|
||||||
|
var lines = [];
|
||||||
|
for (i = rows.first; i <= rows.last; i++)
|
||||||
|
lines.push(session.getLine(i));
|
||||||
|
|
||||||
|
lines.sort(function(a, b) {
|
||||||
|
if (a.toLowerCase() < b.toLowerCase()) return -1;
|
||||||
|
if (a.toLowerCase() > b.toLowerCase()) return 1;
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
var deleteRange = new Range(0, 0, 0, 0);
|
||||||
|
for (var i = rows.first; i <= rows.last; i++) {
|
||||||
|
var line = session.getLine(i);
|
||||||
|
deleteRange.start.row = i;
|
||||||
|
deleteRange.end.row = i;
|
||||||
|
deleteRange.end.column = line.length;
|
||||||
|
session.replace(deleteRange, lines[i-rows.first]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Editor.toggleCommentLines()
|
* Editor.toggleCommentLines()
|
||||||
*
|
*
|
||||||
* Given the currently selected range, this function either comments all lines or uncomments all lines (depending on whether it's commented or not).
|
* Given the currently selected range, this function either comments all the lines, or uncomments all of them.
|
||||||
**/
|
**/
|
||||||
this.toggleCommentLines = function() {
|
this.toggleCommentLines = function() {
|
||||||
var state = this.session.getState(this.getCursorPosition().row);
|
var state = this.session.getState(this.getCursorPosition().row);
|
||||||
|
|
@ -1287,6 +1313,78 @@ var Editor = function(renderer, session) {
|
||||||
this.session.getMode().toggleCommentLines(state, this.session, rows.first, rows.last);
|
this.session.getMode().toggleCommentLines(state, this.session, rows.first, rows.last);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Editor.getNumberAt() -> Number
|
||||||
|
*
|
||||||
|
* Works like [[Editor.getTokenAt]], except it returns a number.
|
||||||
|
**/
|
||||||
|
this.getNumberAt = function( row, column ) {
|
||||||
|
var _numberRx = /[\-]?[0-9]+(?:\.[0-9]+)?/g
|
||||||
|
_numberRx.lastIndex = 0
|
||||||
|
|
||||||
|
var s = this.session.getLine(row)
|
||||||
|
while(_numberRx.lastIndex < column - 1 ){
|
||||||
|
var m = _numberRx.exec(s)
|
||||||
|
if(m.index <= column && m.index+m[0].length >= column){
|
||||||
|
var number = {
|
||||||
|
value: m[0],
|
||||||
|
start: m.index,
|
||||||
|
end: m.index+m[0].length
|
||||||
|
|
||||||
|
}
|
||||||
|
return number
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Editor.modifyNumber(amount)
|
||||||
|
* - amount (Number): The value to change the numeral by (can be negative to decrease value)
|
||||||
|
*
|
||||||
|
* If the character before the cursor is a number, this functions changes its value by `amount`.
|
||||||
|
**/
|
||||||
|
this.modifyNumber = function(amount) {
|
||||||
|
var row = this.selection.getCursor().row;
|
||||||
|
var column = this.selection.getCursor().column;
|
||||||
|
|
||||||
|
// get the char before the cursor
|
||||||
|
var charRange = new Range(row, column-1, row, column);
|
||||||
|
|
||||||
|
var c = this.session.getTextRange(charRange);
|
||||||
|
// if the char is a digit
|
||||||
|
if (!isNaN(parseFloat(c)) && isFinite(c)) {
|
||||||
|
// get the whole number the digit is part of
|
||||||
|
var nr = this.getNumberAt(row, column);
|
||||||
|
// if number found
|
||||||
|
if (nr) {
|
||||||
|
var fp = nr.value.indexOf(".") >= 0 ? nr.start + nr.value.indexOf(".") + 1 : nr.end;
|
||||||
|
var decimals = nr.start + nr.value.length - fp;
|
||||||
|
|
||||||
|
var t = parseFloat(nr.value);
|
||||||
|
t *= Math.pow(10, decimals);
|
||||||
|
|
||||||
|
|
||||||
|
if(fp !== nr.end && column < fp){
|
||||||
|
amount *= Math.pow(10, nr.end - column - 1);
|
||||||
|
} else {
|
||||||
|
amount *= Math.pow(10, nr.end - column);
|
||||||
|
}
|
||||||
|
|
||||||
|
t += amount;
|
||||||
|
t /= Math.pow(10, decimals);
|
||||||
|
var nnr = t.toFixed(decimals);
|
||||||
|
|
||||||
|
//update number
|
||||||
|
var replaceRange = new Range(row, nr.start, row, nr.end);
|
||||||
|
this.session.replace(replaceRange, nnr);
|
||||||
|
|
||||||
|
//reposition the cursor
|
||||||
|
this.moveCursorTo(row, Math.max(nr.start +1, column + nnr.length - nr.value.length));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/** related to: EditSession.remove
|
/** related to: EditSession.remove
|
||||||
* Editor.removeLines()
|
* Editor.removeLines()
|
||||||
*
|
*
|
||||||
|
|
@ -1308,20 +1406,20 @@ var Editor = function(renderer, session) {
|
||||||
|
|
||||||
this.duplicateSelection = function() {
|
this.duplicateSelection = function() {
|
||||||
var sel = this.selection;
|
var sel = this.selection;
|
||||||
var doc = this.session;
|
var doc = this.session;
|
||||||
var range = sel.getRange();
|
var range = sel.getRange();
|
||||||
if (range.isEmpty()) {
|
if (range.isEmpty()) {
|
||||||
var row = range.start.row;
|
var row = range.start.row;
|
||||||
doc.duplicateLines(row, row);
|
doc.duplicateLines(row, row);
|
||||||
} else {
|
} else {
|
||||||
var reverse = sel.isBackwards()
|
var reverse = sel.isBackwards()
|
||||||
var point = sel.isBackwards() ? range.start : range.end;
|
var point = sel.isBackwards() ? range.start : range.end;
|
||||||
var endPoint = doc.insert(point, doc.getTextRange(range), false);
|
var endPoint = doc.insert(point, doc.getTextRange(range), false);
|
||||||
range.start = point;
|
range.start = point;
|
||||||
range.end = endPoint;
|
range.end = endPoint;
|
||||||
|
|
||||||
sel.setSelectionRange(range, reverse)
|
sel.setSelectionRange(range, reverse)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** related to: EditSession.moveLinesDown
|
/** related to: EditSession.moveLinesDown
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ var UA = require("../lib/useragent");
|
||||||
var net = require("../lib/net");
|
var net = require("../lib/net");
|
||||||
var ace = require("../ace");
|
var ace = require("../ace");
|
||||||
|
|
||||||
require("ace/theme/textmate");
|
require("../theme/textmate");
|
||||||
|
|
||||||
module.exports = exports = ace;
|
module.exports = exports = ace;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ exports.handler.attach = function(editor) {
|
||||||
opacity: 1;\
|
opacity: 1;\
|
||||||
background-color: transparent;\
|
background-color: transparent;\
|
||||||
}\
|
}\
|
||||||
.emacs-mode .ace_cursor.ace_overwrite {\
|
.emacs-mode .ace_overwrite-cursors .ace_cursor {\
|
||||||
opacity: 1;\
|
opacity: 1;\
|
||||||
background-color: transparent;\
|
background-color: transparent;\
|
||||||
border-width: 0 0 2px 2px !important;\
|
border-width: 0 0 2px 2px !important;\
|
||||||
|
|
|
||||||
|
|
@ -298,7 +298,7 @@ var TextInput = function(parentNode, host) {
|
||||||
host.renderer.$keepTextAreaAtCursor = null;
|
host.renderer.$keepTextAreaAtCursor = null;
|
||||||
|
|
||||||
// on windows context menu is opened after mouseup
|
// on windows context menu is opened after mouseup
|
||||||
if (useragent.isWin && (useragent.isGecko || useragent.isIE))
|
if (useragent.isWin)
|
||||||
event.capture(host.container, function(e) {
|
event.capture(host.container, function(e) {
|
||||||
text.style.left = e.clientX - 2 + "px";
|
text.style.left = e.clientX - 2 + "px";
|
||||||
text.style.top = e.clientY - 2 + "px";
|
text.style.top = e.clientY - 2 + "px";
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ var StringStream = function(editor, cursor) {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
var Search = require("ace/search").Search;
|
var Search = require("../../../search").Search;
|
||||||
var search = new Search();
|
var search = new Search();
|
||||||
|
|
||||||
function find(editor, needle, dir) {
|
function find(editor, needle, dir) {
|
||||||
|
|
@ -136,7 +136,7 @@ function find(editor, needle, dir) {
|
||||||
return search.find(editor.session);
|
return search.find(editor.session);
|
||||||
}
|
}
|
||||||
|
|
||||||
var Range = require("ace/range").Range;
|
var Range = require("../../../range").Range;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"w": new Motion(function(editor) {
|
"w": new Motion(function(editor) {
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,12 @@ var Cursor = function(parentEl) {
|
||||||
|
|
||||||
this.isVisible = false;
|
this.isVisible = false;
|
||||||
this.isBlinking = true;
|
this.isBlinking = true;
|
||||||
|
this.blinkInterval = 1000;
|
||||||
|
this.smoothBlinking = false;
|
||||||
|
|
||||||
this.cursors = [];
|
this.cursors = [];
|
||||||
this.cursor = this.addCursor();
|
this.cursor = this.addCursor();
|
||||||
|
dom.addCssClass(this.element, "ace_hidden-cursors");
|
||||||
};
|
};
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
@ -57,20 +60,33 @@ var Cursor = function(parentEl) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setBlinking = function(blinking) {
|
this.setBlinking = function(blinking) {
|
||||||
this.isBlinking = blinking;
|
if (blinking != this.isBlinking){
|
||||||
if (blinking)
|
this.isBlinking = blinking;
|
||||||
this.restartTimer();
|
this.restartTimer();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.setBlinkInterval = function(blinkInterval) {
|
||||||
|
if (blinkInterval != this.blinkInterval){
|
||||||
|
this.blinkInterval = blinkInterval;
|
||||||
|
this.restartTimer();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.setSmoothBlinking = function(smoothBlinking) {
|
||||||
|
if (smoothBlinking != this.smoothBlinking) {
|
||||||
|
this.smoothBlinking = smoothBlinking;
|
||||||
|
if (smoothBlinking)
|
||||||
|
dom.addCssClass(this.element, "ace_smooth-blinking");
|
||||||
|
else
|
||||||
|
dom.removeCssClass(this.element, "ace_smooth-blinking");
|
||||||
|
this.restartTimer();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.addCursor = function() {
|
this.addCursor = function() {
|
||||||
var el = dom.createElement("div");
|
var el = dom.createElement("div");
|
||||||
var className = "ace_cursor";
|
el.className = "ace_cursor";
|
||||||
if (!this.isVisible)
|
|
||||||
className += " ace_hidden";
|
|
||||||
if (this.overwrite)
|
|
||||||
className += " ace_overwrite";
|
|
||||||
|
|
||||||
el.className = className;
|
|
||||||
this.element.appendChild(el);
|
this.element.appendChild(el);
|
||||||
this.cursors.push(el);
|
this.cursors.push(el);
|
||||||
return el;
|
return el;
|
||||||
|
|
@ -86,118 +102,113 @@ var Cursor = function(parentEl) {
|
||||||
|
|
||||||
this.hideCursor = function() {
|
this.hideCursor = function() {
|
||||||
this.isVisible = false;
|
this.isVisible = false;
|
||||||
for (var i = this.cursors.length; i--; )
|
dom.addCssClass(this.element, "ace_hidden-cursors");
|
||||||
dom.addCssClass(this.cursors[i], "ace_hidden");
|
this.restartTimer();
|
||||||
clearInterval(this.blinkId);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.showCursor = function() {
|
this.showCursor = function() {
|
||||||
this.isVisible = true;
|
this.isVisible = true;
|
||||||
for (var i = this.cursors.length; i--; )
|
dom.removeCssClass(this.element, "ace_hidden-cursors");
|
||||||
dom.removeCssClass(this.cursors[i], "ace_hidden");
|
|
||||||
|
|
||||||
this.element.style.visibility = "";
|
|
||||||
this.restartTimer();
|
this.restartTimer();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.restartTimer = function() {
|
this.restartTimer = function() {
|
||||||
clearInterval(this.blinkId);
|
clearInterval(this.intervalId);
|
||||||
if (!this.isBlinking)
|
clearTimeout(this.timeoutId);
|
||||||
return;
|
if (this.smoothBlinking)
|
||||||
if (!this.isVisible)
|
dom.removeCssClass(this.element, "ace_smooth-blinking");
|
||||||
|
for (var i = this.cursors.length; i--; )
|
||||||
|
this.cursors[i].style.opacity = "";
|
||||||
|
|
||||||
|
if (!this.isBlinking || !this.blinkInterval || !this.isVisible)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var element = this.cursors.length == 1 ? this.cursor : this.element;
|
if (this.smoothBlinking)
|
||||||
this.blinkId = setInterval(function() {
|
setTimeout(function(){
|
||||||
element.style.visibility = "hidden";
|
dom.addCssClass(this.element, "ace_smooth-blinking");
|
||||||
setTimeout(function() {
|
}.bind(this));
|
||||||
element.style.visibility = "";
|
|
||||||
}, 400);
|
var blink = function(){
|
||||||
}, 1000);
|
this.timeoutId = setTimeout(function() {
|
||||||
|
for (var i = this.cursors.length; i--; ) {
|
||||||
|
this.cursors[i].style.opacity = 0;
|
||||||
|
}
|
||||||
|
}.bind(this), 0.6 * this.blinkInterval);
|
||||||
|
}.bind(this);
|
||||||
|
|
||||||
|
this.intervalId = setInterval(function() {
|
||||||
|
for (var i = this.cursors.length; i--; ) {
|
||||||
|
this.cursors[i].style.opacity = "";
|
||||||
|
}
|
||||||
|
blink();
|
||||||
|
}.bind(this), this.blinkInterval);
|
||||||
|
|
||||||
|
blink();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getPixelPosition = function(position, onScreen) {
|
this.getPixelPosition = function(position, onScreen) {
|
||||||
if (!this.config || !this.session) {
|
if (!this.config || !this.session)
|
||||||
return {
|
return {left : 0, top : 0};
|
||||||
left : 0,
|
|
||||||
top : 0
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!position)
|
if (!position)
|
||||||
position = this.session.selection.getCursor();
|
position = this.session.selection.getCursor();
|
||||||
var pos = this.session.documentToScreenPosition(position);
|
var pos = this.session.documentToScreenPosition(position);
|
||||||
var cursorLeft = Math.round(this.$padding +
|
var cursorLeft = this.$padding + pos.column * this.config.characterWidth;
|
||||||
pos.column * this.config.characterWidth);
|
|
||||||
var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) *
|
var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) *
|
||||||
this.config.lineHeight;
|
this.config.lineHeight;
|
||||||
|
|
||||||
return {
|
return {left : cursorLeft, top : cursorTop};
|
||||||
left : cursorLeft,
|
|
||||||
top : cursorTop
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.update = function(config) {
|
this.update = function(config) {
|
||||||
this.config = config;
|
this.config = config;
|
||||||
|
|
||||||
if (this.session.selectionMarkerCount > 0) {
|
var selections = this.session.$selectionMarkers;
|
||||||
var selections = this.session.$selectionMarkers;
|
var i = 0, cursorIndex = 0;
|
||||||
var i = 0, sel, cursorIndex = 0;
|
|
||||||
|
|
||||||
for (var i = selections.length; i--; ) {
|
if (selections === undefined || selections.length === 0){
|
||||||
sel = selections[i];
|
selections = [{cursor: null}];
|
||||||
var pixelPos = this.getPixelPosition(sel.cursor, true);
|
}
|
||||||
if ((pixelPos.top > config.height + config.offset ||
|
|
||||||
pixelPos.top < -config.offset) && i > 1) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var style = (this.cursors[cursorIndex++] || this.addCursor()).style;
|
for (var i = selections.length; i--; ) {
|
||||||
|
var pixelPos = this.getPixelPosition(selections[i].cursor, true);
|
||||||
style.left = pixelPos.left + "px";
|
if ((pixelPos.top > config.height + config.offset ||
|
||||||
style.top = pixelPos.top + "px";
|
pixelPos.top < -config.offset) && i > 1) {
|
||||||
style.width = config.characterWidth + "px";
|
continue;
|
||||||
style.height = config.lineHeight + "px";
|
|
||||||
}
|
}
|
||||||
if (cursorIndex > 1)
|
|
||||||
while (this.cursors.length > cursorIndex)
|
var style = (this.cursors[cursorIndex++] || this.addCursor()).style;
|
||||||
this.removeCursor();
|
|
||||||
} else {
|
|
||||||
var pixelPos = this.getPixelPosition(null, true);
|
|
||||||
var style = this.cursor.style;
|
|
||||||
style.left = pixelPos.left + "px";
|
style.left = pixelPos.left + "px";
|
||||||
style.top = pixelPos.top + "px";
|
style.top = pixelPos.top + "px";
|
||||||
style.width = config.characterWidth + "px";
|
style.width = config.characterWidth + "px";
|
||||||
style.height = config.lineHeight + "px";
|
style.height = config.lineHeight + "px";
|
||||||
|
|
||||||
while (this.cursors.length > 1)
|
|
||||||
this.removeCursor();
|
|
||||||
}
|
}
|
||||||
|
while (this.cursors.length > cursorIndex)
|
||||||
|
this.removeCursor();
|
||||||
|
|
||||||
var overwrite = this.session.getOverwrite();
|
var overwrite = this.session.getOverwrite();
|
||||||
if (overwrite != this.overwrite)
|
this.$setOverwrite(overwrite);
|
||||||
this.$setOverwrite(overwrite);
|
|
||||||
|
|
||||||
// cache for textarea and gutter highlight
|
// cache for textarea and gutter highlight
|
||||||
this.$pixelPos = pixelPos;
|
this.$pixelPos = pixelPos;
|
||||||
|
|
||||||
this.restartTimer();
|
this.restartTimer();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$setOverwrite = function(overwrite) {
|
this.$setOverwrite = function(overwrite) {
|
||||||
this.overwrite = overwrite;
|
if (overwrite != this.overwrite) {
|
||||||
for (var i = this.cursors.length; i--; ) {
|
this.overwrite = overwrite;
|
||||||
if (overwrite)
|
if (overwrite)
|
||||||
dom.addCssClass(this.cursors[i], "ace_overwrite");
|
dom.addCssClass(this.element, "ace_overwrite-cursors");
|
||||||
else
|
else
|
||||||
dom.removeCssClass(this.cursors[i], "ace_overwrite");
|
dom.removeCssClass(this.element, "ace_overwrite-cursors");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.destroy = function() {
|
this.destroy = function() {
|
||||||
clearInterval(this.blinkId);
|
clearInterval(this.intervalId);
|
||||||
}
|
clearTimeout(this.timeoutId);
|
||||||
|
};
|
||||||
|
|
||||||
}).call(Cursor.prototype);
|
}).call(Cursor.prototype);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,26 +78,20 @@ var Marker = function(parentEl) {
|
||||||
range = range.toScreenRange(this.session);
|
range = range.toScreenRange(this.session);
|
||||||
if (marker.renderer) {
|
if (marker.renderer) {
|
||||||
var top = this.$getTop(range.start.row, config);
|
var top = this.$getTop(range.start.row, config);
|
||||||
var left = Math.round(
|
var left = this.$padding + range.start.column * config.characterWidth;
|
||||||
this.$padding + range.start.column * config.characterWidth
|
|
||||||
);
|
|
||||||
marker.renderer(html, range, left, top, config);
|
marker.renderer(html, range, left, top, config);
|
||||||
}
|
}
|
||||||
|
if (marker.type == "fullLine") {
|
||||||
|
this.drawFullLineMarker(html, range, marker.clazz, config);
|
||||||
|
}
|
||||||
else if (range.isMultiLine()) {
|
else if (range.isMultiLine()) {
|
||||||
if (marker.type == "text") {
|
if (marker.type == "text")
|
||||||
this.drawTextMarker(html, range, marker.clazz, config);
|
this.drawTextMarker(html, range, marker.clazz, config);
|
||||||
} else {
|
else
|
||||||
this.drawMultiLineMarker(
|
this.drawMultiLineMarker(html, range, marker.clazz, config);
|
||||||
html, range, marker.clazz, config,
|
|
||||||
marker.type
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.drawSingleLineMarker(
|
this.drawSingleLineMarker(html, range, marker.clazz + " ace_start", config);
|
||||||
html, range, marker.clazz + " ace_start", config,
|
|
||||||
null, marker.type
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.element = dom.setInnerHtml(this.element, html.join(""));
|
this.element = dom.setInnerHtml(this.element, html.join(""));
|
||||||
|
|
@ -133,11 +127,11 @@ var Marker = function(parentEl) {
|
||||||
|
|
||||||
// Draws a multi line marker, where lines span the full width
|
// Draws a multi line marker, where lines span the full width
|
||||||
this.drawMultiLineMarker = function(stringBuilder, range, clazz, config, type) {
|
this.drawMultiLineMarker = function(stringBuilder, range, clazz, config, type) {
|
||||||
var padding = type === "background" ? 0 : this.$padding;
|
|
||||||
// from selection start to the end of the line
|
// from selection start to the end of the line
|
||||||
|
var padding = this.$padding;
|
||||||
var height = config.lineHeight;
|
var height = config.lineHeight;
|
||||||
var top = this.$getTop(range.start.row, config);
|
var top = this.$getTop(range.start.row, config);
|
||||||
var left = Math.round(padding + range.start.column * config.characterWidth);
|
var left = padding + range.start.column * config.characterWidth;
|
||||||
|
|
||||||
stringBuilder.push(
|
stringBuilder.push(
|
||||||
"<div class='", clazz, " ace_start' style='",
|
"<div class='", clazz, " ace_start' style='",
|
||||||
|
|
@ -149,7 +143,7 @@ var Marker = function(parentEl) {
|
||||||
|
|
||||||
// from start of the last line to the selection end
|
// from start of the last line to the selection end
|
||||||
top = this.$getTop(range.end.row, config);
|
top = this.$getTop(range.end.row, config);
|
||||||
var width = Math.round(range.end.column * config.characterWidth);
|
var width = range.end.column * config.characterWidth;
|
||||||
|
|
||||||
stringBuilder.push(
|
stringBuilder.push(
|
||||||
"<div class='", clazz, "' style='",
|
"<div class='", clazz, "' style='",
|
||||||
|
|
@ -175,19 +169,12 @@ var Marker = function(parentEl) {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Draws a marker which covers part or whole width of a single screen line
|
// Draws a marker which covers part or whole width of a single screen line
|
||||||
this.drawSingleLineMarker = function(stringBuilder, range, clazz, layerConfig, extraLength, type) {
|
this.drawSingleLineMarker = function(stringBuilder, range, clazz, config, extraLength) {
|
||||||
var padding = type === "background" ? 0 : this.$padding;
|
var height = config.lineHeight;
|
||||||
var height = layerConfig.lineHeight;
|
var width = (range.end.column + (extraLength || 0) - range.start.column) * config.characterWidth;
|
||||||
|
|
||||||
if (type === "background")
|
var top = this.$getTop(range.start.row, config);
|
||||||
var width = layerConfig.width;
|
var left = this.$padding + range.start.column * config.characterWidth;
|
||||||
else
|
|
||||||
width = Math.round((range.end.column + (extraLength || 0) - range.start.column) * layerConfig.characterWidth);
|
|
||||||
|
|
||||||
var top = this.$getTop(range.start.row, layerConfig);
|
|
||||||
var left = Math.round(
|
|
||||||
padding + range.start.column * layerConfig.characterWidth
|
|
||||||
);
|
|
||||||
|
|
||||||
stringBuilder.push(
|
stringBuilder.push(
|
||||||
"<div class='", clazz, "' style='",
|
"<div class='", clazz, "' style='",
|
||||||
|
|
@ -198,6 +185,20 @@ var Marker = function(parentEl) {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.drawFullLineMarker = function(stringBuilder, range, clazz, config) {
|
||||||
|
var top = this.$getTop(range.start.row, config);
|
||||||
|
var height = config.lineHeight;
|
||||||
|
if (range.start.row != range.end.row)
|
||||||
|
height += this.$getTop(range.end.row, config) - top;
|
||||||
|
|
||||||
|
stringBuilder.push(
|
||||||
|
"<div class='", clazz, "' style='",
|
||||||
|
"height:", height, "px;",
|
||||||
|
"top:", top, "px;",
|
||||||
|
"left:0;right:0;'></div>"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}).call(Marker.prototype);
|
}).call(Marker.prototype);
|
||||||
|
|
||||||
exports.Marker = Marker;
|
exports.Marker = Marker;
|
||||||
|
|
|
||||||
|
|
@ -543,10 +543,33 @@ if (!Object.getOwnPropertyNames) {
|
||||||
// ES5 15.2.3.5
|
// ES5 15.2.3.5
|
||||||
// http://es5.github.com/#x15.2.3.5
|
// http://es5.github.com/#x15.2.3.5
|
||||||
if (!Object.create) {
|
if (!Object.create) {
|
||||||
|
var createEmpty;
|
||||||
|
if (Object.prototype.__proto__ === null) {
|
||||||
|
createEmpty = function () {
|
||||||
|
return { "__proto__": null };
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
// In old IE __proto__ can't be used to manually set `null`
|
||||||
|
createEmpty = function () {
|
||||||
|
var empty = {};
|
||||||
|
for (var i in empty)
|
||||||
|
empty[i] = null;
|
||||||
|
empty.constructor =
|
||||||
|
empty.hasOwnProperty =
|
||||||
|
empty.propertyIsEnumerable =
|
||||||
|
empty.isPrototypeOf =
|
||||||
|
empty.toLocaleString =
|
||||||
|
empty.toString =
|
||||||
|
empty.valueOf =
|
||||||
|
empty.__proto__ = null;
|
||||||
|
return empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Object.create = function create(prototype, properties) {
|
Object.create = function create(prototype, properties) {
|
||||||
var object;
|
var object;
|
||||||
if (prototype === null) {
|
if (prototype === null) {
|
||||||
object = { "__proto__": null };
|
object = createEmpty();
|
||||||
} else {
|
} else {
|
||||||
if (typeof prototype != "object")
|
if (typeof prototype != "object")
|
||||||
throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'");
|
throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'");
|
||||||
|
|
|
||||||
|
|
@ -33,19 +33,70 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
var oop = require("../../lib/oop");
|
var oop = require("../../lib/oop");
|
||||||
var Behaviour = require("../behaviour").Behaviour;
|
var Behaviour = require("../behaviour").Behaviour;
|
||||||
|
var TokenIterator = require("../../token_iterator").TokenIterator;
|
||||||
|
|
||||||
|
var autoInsertedBrackets = 0;
|
||||||
|
var autoInsertedRow = -1;
|
||||||
|
var autoInsertedLineEnd = "";
|
||||||
|
|
||||||
var CstyleBehaviour = function () {
|
var CstyleBehaviour = function () {
|
||||||
|
|
||||||
|
CstyleBehaviour.isSaneInsertion = function(editor, session) {
|
||||||
|
var cursor = editor.getCursorPosition();
|
||||||
|
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
||||||
|
|
||||||
|
// Don't insert in the middle of a keyword/identifier/lexical
|
||||||
|
if (!this.$matchTokenType(iterator.getCurrentToken() || "text", ["text", "paren.rparen"])) {
|
||||||
|
// Look ahead in case we're at the end of a token
|
||||||
|
iterator = new TokenIterator(session, cursor.row, cursor.column + 1);
|
||||||
|
if (!this.$matchTokenType(iterator.getCurrentToken() || "text", ["text", "paren.rparen"]))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Only insert in front of whitespace/comments
|
||||||
|
iterator.stepForward();
|
||||||
|
return iterator.getCurrentTokenRow() !== cursor.row ||
|
||||||
|
this.$matchTokenType(iterator.getCurrentToken() || "text", ["text", "comment", "paren.rparen"]);
|
||||||
|
};
|
||||||
|
|
||||||
|
CstyleBehaviour.$matchTokenType = function(token, types) {
|
||||||
|
return types.indexOf(token.type || token) > -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
|
||||||
|
var cursor = editor.getCursorPosition();
|
||||||
|
var line = session.doc.getLine(cursor.row);
|
||||||
|
// Reset previous state if text or context changed too much
|
||||||
|
if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
|
||||||
|
autoInsertedBrackets = 0;
|
||||||
|
autoInsertedRow = cursor.row;
|
||||||
|
autoInsertedLineEnd = bracket + line.substr(cursor.column);
|
||||||
|
autoInsertedBrackets++;
|
||||||
|
};
|
||||||
|
|
||||||
|
CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
|
||||||
|
return autoInsertedBrackets > 0 &&
|
||||||
|
cursor.row === autoInsertedRow &&
|
||||||
|
bracket === autoInsertedLineEnd[0] &&
|
||||||
|
line.substr(cursor.column) === autoInsertedLineEnd;
|
||||||
|
};
|
||||||
|
|
||||||
|
CstyleBehaviour.popAutoInsertedClosing = function() {
|
||||||
|
autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
|
||||||
|
autoInsertedBrackets--;
|
||||||
|
};
|
||||||
|
|
||||||
this.add("braces", "insertion", function (state, action, editor, session, text) {
|
this.add("braces", "insertion", function (state, action, editor, session, text) {
|
||||||
if (text == '{') {
|
if (text == '{') {
|
||||||
var selection = editor.getSelectionRange();
|
var selection = editor.getSelectionRange();
|
||||||
var selected = session.doc.getTextRange(selection);
|
var selected = session.doc.getTextRange(selection);
|
||||||
if (selected !== "") {
|
if (selected !== "" && selected !== "{") {
|
||||||
return {
|
return {
|
||||||
text: '{' + selected + '}',
|
text: '{' + selected + '}',
|
||||||
selection: false
|
selection: false
|
||||||
};
|
};
|
||||||
} else {
|
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
|
||||||
|
CstyleBehaviour.recordAutoInsert(editor, session, "}");
|
||||||
return {
|
return {
|
||||||
text: '{}',
|
text: '{}',
|
||||||
selection: [1, 1]
|
selection: [1, 1]
|
||||||
|
|
@ -57,7 +108,8 @@ var CstyleBehaviour = function () {
|
||||||
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
||||||
if (rightChar == '}') {
|
if (rightChar == '}') {
|
||||||
var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
|
var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
|
||||||
if (matching !== null) {
|
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
|
||||||
|
CstyleBehaviour.popAutoInsertedClosing();
|
||||||
return {
|
return {
|
||||||
text: '',
|
text: '',
|
||||||
selection: [1, 1]
|
selection: [1, 1]
|
||||||
|
|
@ -105,7 +157,8 @@ var CstyleBehaviour = function () {
|
||||||
text: '(' + selected + ')',
|
text: '(' + selected + ')',
|
||||||
selection: false
|
selection: false
|
||||||
};
|
};
|
||||||
} else {
|
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
|
||||||
|
CstyleBehaviour.recordAutoInsert(editor, session, ")");
|
||||||
return {
|
return {
|
||||||
text: '()',
|
text: '()',
|
||||||
selection: [1, 1]
|
selection: [1, 1]
|
||||||
|
|
@ -117,7 +170,8 @@ var CstyleBehaviour = function () {
|
||||||
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
||||||
if (rightChar == ')') {
|
if (rightChar == ')') {
|
||||||
var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
|
var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
|
||||||
if (matching !== null) {
|
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
|
||||||
|
CstyleBehaviour.popAutoInsertedClosing();
|
||||||
return {
|
return {
|
||||||
text: '',
|
text: '',
|
||||||
selection: [1, 1]
|
selection: [1, 1]
|
||||||
|
|
@ -148,7 +202,8 @@ var CstyleBehaviour = function () {
|
||||||
text: '[' + selected + ']',
|
text: '[' + selected + ']',
|
||||||
selection: false
|
selection: false
|
||||||
};
|
};
|
||||||
} else {
|
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
|
||||||
|
CstyleBehaviour.recordAutoInsert(editor, session, "]");
|
||||||
return {
|
return {
|
||||||
text: '[]',
|
text: '[]',
|
||||||
selection: [1, 1]
|
selection: [1, 1]
|
||||||
|
|
@ -160,7 +215,8 @@ var CstyleBehaviour = function () {
|
||||||
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
||||||
if (rightChar == ']') {
|
if (rightChar == ']') {
|
||||||
var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
|
var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
|
||||||
if (matching !== null) {
|
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
|
||||||
|
CstyleBehaviour.popAutoInsertedClosing();
|
||||||
return {
|
return {
|
||||||
text: '',
|
text: '',
|
||||||
selection: [1, 1]
|
selection: [1, 1]
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,8 @@ var oop = require("../lib/oop");
|
||||||
var TextMode = require("./text").Mode;
|
var TextMode = require("./text").Mode;
|
||||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||||
var JadeHighlightRules = require("./jade_highlight_rules").JadeHighlightRules;
|
var JadeHighlightRules = require("./jade_highlight_rules").JadeHighlightRules;
|
||||||
// var JavascriptMode = require("ace/mode/javascript").Mode;
|
// var JavascriptMode = require("../mode/javascript").Mode;
|
||||||
// var CssMode = require("ace/mode/css").Mode;
|
// var CssMode = require("../mode/css").Mode;
|
||||||
|
|
||||||
var Mode = function() {
|
var Mode = function() {
|
||||||
var highlighter = new JadeHighlightRules();
|
var highlighter = new JadeHighlightRules();
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||||
var SqlHighlightRules = function() {
|
var SqlHighlightRules = function() {
|
||||||
|
|
||||||
var keywords = (
|
var keywords = (
|
||||||
"select|from|where|and|or|group|by|order|limit|offset|having|as|case|" +
|
"select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|" +
|
||||||
"when|else|end|type|left|right|join|on|outer|desc|asc"
|
"when|else|end|type|left|right|join|on|outer|desc|asc"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var Range = require('./range').Range;
|
var Range = require("./range").Range;
|
||||||
var EventEmitter = require("./lib/event_emitter").EventEmitter;
|
var EventEmitter = require("./lib/event_emitter").EventEmitter;
|
||||||
var oop = require("./lib/oop");
|
var oop = require("./lib/oop");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,8 @@ var Editor = require("./editor").Editor;
|
||||||
var MockRenderer = require("./test/mockrenderer").MockRenderer;
|
var MockRenderer = require("./test/mockrenderer").MockRenderer;
|
||||||
var assert = require("./test/assertions");
|
var assert = require("./test/assertions");
|
||||||
var JavaScriptMode = require("./mode/javascript").Mode;
|
var JavaScriptMode = require("./mode/javascript").Mode;
|
||||||
var PlaceHolder = require('./placeholder').PlaceHolder;
|
var PlaceHolder = require("./placeholder").PlaceHolder;
|
||||||
var UndoManager = require('./undomanager').UndoManager;
|
var UndoManager = require("./undomanager").UndoManager;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ define(function (require, exports, module) {
|
||||||
if (globalRequire && globalRequire.nodeRequire)
|
if (globalRequire && globalRequire.nodeRequire)
|
||||||
onLoad(globalRequire.nodeRequire('fs').readFileSync(req.toUrl(name), 'utf8'));
|
onLoad(globalRequire.nodeRequire('fs').readFileSync(req.toUrl(name), 'utf8'));
|
||||||
else
|
else
|
||||||
require("ace/lib/net").get(req.toUrl(name), onLoad);
|
require("../lib/net").get(req.toUrl(name), onLoad);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
border-left: 1px solid #7991E8;
|
border-left: 1px solid #7991E8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-ambiance .ace_cursor.ace_overwrite {
|
.ace-ambiance .ace_overwrite-cursors .ace_cursor {
|
||||||
border: 1px solid #FFE300;
|
border: 1px solid #FFE300;
|
||||||
background: #766B13;
|
background: #766B13;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = true;
|
exports.isDark = true;
|
||||||
exports.cssClass = "ace-ambiance";
|
exports.cssClass = "ace-ambiance";
|
||||||
exports.cssText = require("ace/requirejs/text!./ambiance.css");
|
exports.cssText = require("../requirejs/text!./ambiance.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
border-left: 2px solid black;
|
border-left: 2px solid black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-chrome .ace_cursor.ace_overwrite {
|
.ace-chrome .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid black;
|
border-bottom: 1px solid black;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = false;
|
exports.isDark = false;
|
||||||
exports.cssClass = "ace-chrome";
|
exports.cssClass = "ace-chrome";
|
||||||
exports.cssText = require('ace/requirejs/text!./chrome.css');
|
exports.cssText = require("../requirejs/text!./chrome.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
border-left: 2px solid #000000
|
border-left: 2px solid #000000
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-clouds .ace_cursor.ace_overwrite {
|
.ace-clouds .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #000000
|
border-bottom: 1px solid #000000
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = false;
|
exports.isDark = false;
|
||||||
exports.cssClass = "ace-clouds";
|
exports.cssClass = "ace-clouds";
|
||||||
exports.cssText = require('ace/requirejs/text!./clouds.css');
|
exports.cssText = require("../requirejs/text!./clouds.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
border-left: 2px solid #7DA5DC
|
border-left: 2px solid #7DA5DC
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-clouds-midnight .ace_cursor.ace_overwrite {
|
.ace-clouds-midnight .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #7DA5DC
|
border-bottom: 1px solid #7DA5DC
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = true;
|
exports.isDark = true;
|
||||||
exports.cssClass = "ace-clouds-midnight";
|
exports.cssClass = "ace-clouds-midnight";
|
||||||
exports.cssText = require('ace/requirejs/text!./clouds_midnight.css');
|
exports.cssText = require("../requirejs/text!./clouds_midnight.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
border-left: 2px solid #FFFFFF
|
border-left: 2px solid #FFFFFF
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-cobalt .ace_cursor.ace_overwrite {
|
.ace-cobalt .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #FFFFFF
|
border-bottom: 1px solid #FFFFFF
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = true;
|
exports.isDark = true;
|
||||||
exports.cssClass = "ace-cobalt";
|
exports.cssClass = "ace-cobalt";
|
||||||
exports.cssText = require('ace/requirejs/text!./cobalt.css');
|
exports.cssText = require("../requirejs/text!./cobalt.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
border-left: 2px solid black;
|
border-left: 2px solid black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-crimson-editor .ace_cursor.ace_overwrite {
|
.ace-crimson-editor .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid black;
|
border-bottom: 1px solid black;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
exports.isDark = false;
|
exports.isDark = false;
|
||||||
exports.cssText = require('ace/requirejs/text!./crimson_editor.css');
|
exports.cssText = require("../requirejs/text!./crimson_editor.css");
|
||||||
|
|
||||||
exports.cssClass = "ace-crimson-editor";
|
exports.cssClass = "ace-crimson-editor";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
border-left: 2px solid #000000
|
border-left: 2px solid #000000
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-dawn .ace_cursor.ace_overwrite {
|
.ace-dawn .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #000000
|
border-bottom: 1px solid #000000
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = false;
|
exports.isDark = false;
|
||||||
exports.cssClass = "ace-dawn";
|
exports.cssClass = "ace-dawn";
|
||||||
exports.cssText = require('ace/requirejs/text!./dawn.css');
|
exports.cssText = require("../requirejs/text!./dawn.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
border-left: 2px solid black;
|
border-left: 2px solid black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-dreamweaver .ace_cursor.ace_overwrite {
|
.ace-dreamweaver .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid black;
|
border-bottom: 1px solid black;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
exports.isDark = false;
|
exports.isDark = false;
|
||||||
exports.cssClass = "ace-dreamweaver";
|
exports.cssClass = "ace-dreamweaver";
|
||||||
exports.cssText = require('ace/requirejs/text!./dreamweaver.css');
|
exports.cssText = require("../requirejs/text!./dreamweaver.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
exports.isDark = false;
|
exports.isDark = false;
|
||||||
exports.cssText = require('ace/requirejs/text!./eclipse.css');
|
exports.cssText = require("../requirejs/text!./eclipse.css");
|
||||||
|
|
||||||
exports.cssClass = "ace-eclipse";
|
exports.cssClass = "ace-eclipse";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@
|
||||||
border-left: 2px solid black;
|
border-left: 2px solid black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-github .ace_cursor.ace_overwrite {
|
.ace-github .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid black;
|
border-bottom: 1px solid black;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = false;
|
exports.isDark = false;
|
||||||
exports.cssClass = "ace-github";
|
exports.cssClass = "ace-github";
|
||||||
exports.cssText = require('ace/requirejs/text!./github.css');
|
exports.cssText = require("../requirejs/text!./github.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
border-left: 2px solid #91FF00
|
border-left: 2px solid #91FF00
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-idle-fingers .ace_cursor.ace_overwrite {
|
.ace-idle-fingers .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #91FF00
|
border-bottom: 1px solid #91FF00
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = true;
|
exports.isDark = true;
|
||||||
exports.cssClass = "ace-idle-fingers";
|
exports.cssClass = "ace-idle-fingers";
|
||||||
exports.cssText = require('ace/requirejs/text!./idle_fingers.css');
|
exports.cssText = require("../requirejs/text!./idle_fingers.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
border-left: 2px solid #FF9900
|
border-left: 2px solid #FF9900
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-kr-theme .ace_cursor.ace_overwrite {
|
.ace-kr-theme .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #FF9900
|
border-bottom: 1px solid #FF9900
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = true;
|
exports.isDark = true;
|
||||||
exports.cssClass = "ace-kr-theme";
|
exports.cssClass = "ace-kr-theme";
|
||||||
exports.cssText = require('ace/requirejs/text!./kr_theme.css');
|
exports.cssText = require("../requirejs/text!./kr_theme.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
border-left: 2px solid #FFFFFF
|
border-left: 2px solid #FFFFFF
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-merbivore .ace_cursor.ace_overwrite {
|
.ace-merbivore .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #FFFFFF
|
border-bottom: 1px solid #FFFFFF
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = true;
|
exports.isDark = true;
|
||||||
exports.cssClass = "ace-merbivore";
|
exports.cssClass = "ace-merbivore";
|
||||||
exports.cssText = require('ace/requirejs/text!./merbivore.css');
|
exports.cssText = require("../requirejs/text!./merbivore.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
border-left: 2px solid #FFFFFF
|
border-left: 2px solid #FFFFFF
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-merbivore-soft .ace_cursor.ace_overwrite {
|
.ace-merbivore-soft .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #FFFFFF
|
border-bottom: 1px solid #FFFFFF
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = true;
|
exports.isDark = true;
|
||||||
exports.cssClass = "ace-merbivore-soft";
|
exports.cssClass = "ace-merbivore-soft";
|
||||||
exports.cssText = require('ace/requirejs/text!./merbivore_soft.css');
|
exports.cssText = require("../requirejs/text!./merbivore_soft.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
border-left: 2px solid #FFFFFF
|
border-left: 2px solid #FFFFFF
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-mono-industrial .ace_cursor.ace_overwrite {
|
.ace-mono-industrial .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #FFFFFF
|
border-bottom: 1px solid #FFFFFF
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = true;
|
exports.isDark = true;
|
||||||
exports.cssClass = "ace-mono-industrial";
|
exports.cssClass = "ace-mono-industrial";
|
||||||
exports.cssText = require('ace/requirejs/text!./mono_industrial.css');
|
exports.cssText = require("../requirejs/text!./mono_industrial.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
border-left: 2px solid #F8F8F0
|
border-left: 2px solid #F8F8F0
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-monokai .ace_cursor.ace_overwrite {
|
.ace-monokai .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #F8F8F0
|
border-bottom: 1px solid #F8F8F0
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = true;
|
exports.isDark = true;
|
||||||
exports.cssClass = "ace-monokai";
|
exports.cssClass = "ace-monokai";
|
||||||
exports.cssText = require('ace/requirejs/text!./monokai.css');
|
exports.cssText = require("../requirejs/text!./monokai.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
border-left: 2px solid #A7A7A7
|
border-left: 2px solid #A7A7A7
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-pastel-on-dark .ace_cursor.ace_overwrite {
|
.ace-pastel-on-dark .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #A7A7A7
|
border-bottom: 1px solid #A7A7A7
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = true;
|
exports.isDark = true;
|
||||||
exports.cssClass = "ace-pastel-on-dark";
|
exports.cssClass = "ace-pastel-on-dark";
|
||||||
exports.cssText = require('ace/requirejs/text!./pastel_on_dark.css');
|
exports.cssText = require("../requirejs/text!./pastel_on_dark.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
border-left: 2px solid #D30102
|
border-left: 2px solid #D30102
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-solarized-dark .ace_cursor.ace_overwrite {
|
.ace-solarized-dark .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #D30102
|
border-bottom: 1px solid #D30102
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = true;
|
exports.isDark = true;
|
||||||
exports.cssClass = "ace-solarized-dark";
|
exports.cssClass = "ace-solarized-dark";
|
||||||
exports.cssText = require('ace/requirejs/text!./solarized_dark.css');
|
exports.cssText = require("../requirejs/text!./solarized_dark.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
border-left: 2px solid #000000
|
border-left: 2px solid #000000
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-solarized-light .ace_cursor.ace_overwrite {
|
.ace-solarized-light .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #000000
|
border-bottom: 1px solid #000000
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = false;
|
exports.isDark = false;
|
||||||
exports.cssClass = "ace-solarized-light";
|
exports.cssClass = "ace-solarized-light";
|
||||||
exports.cssText = require('ace/requirejs/text!./solarized_light.css');
|
exports.cssText = require("../requirejs/text!./solarized_light.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
border-left: 2px solid black;
|
border-left: 2px solid black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-tm .ace_cursor.ace_overwrite {
|
.ace-tm .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid black;
|
border-bottom: 1px solid black;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = false;
|
exports.isDark = false;
|
||||||
exports.cssClass = "ace-tm";
|
exports.cssClass = "ace-tm";
|
||||||
exports.cssText = require('ace/requirejs/text!./textmate.css');
|
exports.cssText = require("../requirejs/text!./textmate.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
border-left: 2px solid #AEAFAD
|
border-left: 2px solid #AEAFAD
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-tomorrow .ace_cursor.ace_overwrite {
|
.ace-tomorrow .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #AEAFAD
|
border-bottom: 1px solid #AEAFAD
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = false;
|
exports.isDark = false;
|
||||||
exports.cssClass = "ace-tomorrow";
|
exports.cssClass = "ace-tomorrow";
|
||||||
exports.cssText = require('ace/requirejs/text!./tomorrow.css');
|
exports.cssText = require("../requirejs/text!./tomorrow.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
border-left: 2px solid #AEAFAD
|
border-left: 2px solid #AEAFAD
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-tomorrow-night .ace_cursor.ace_overwrite {
|
.ace-tomorrow-night .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #AEAFAD
|
border-bottom: 1px solid #AEAFAD
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = true;
|
exports.isDark = true;
|
||||||
exports.cssClass = "ace-tomorrow-night";
|
exports.cssClass = "ace-tomorrow-night";
|
||||||
exports.cssText = require('ace/requirejs/text!./tomorrow_night.css');
|
exports.cssText = require("../requirejs/text!./tomorrow_night.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
border-left: 2px solid #FFFFFF
|
border-left: 2px solid #FFFFFF
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-tomorrow-night-blue .ace_cursor.ace_overwrite {
|
.ace-tomorrow-night-blue .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #FFFFFF
|
border-bottom: 1px solid #FFFFFF
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = true;
|
exports.isDark = true;
|
||||||
exports.cssClass = "ace-tomorrow-night-blue";
|
exports.cssClass = "ace-tomorrow-night-blue";
|
||||||
exports.cssText = require('ace/requirejs/text!./tomorrow_night_blue.css');
|
exports.cssText = require("../requirejs/text!./tomorrow_night_blue.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
border-left: 2px solid #9F9F9F
|
border-left: 2px solid #9F9F9F
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-tomorrow-night-bright .ace_cursor.ace_overwrite {
|
.ace-tomorrow-night-bright .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #9F9F9F
|
border-bottom: 1px solid #9F9F9F
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = true;
|
exports.isDark = true;
|
||||||
exports.cssClass = "ace-tomorrow-night-bright";
|
exports.cssClass = "ace-tomorrow-night-bright";
|
||||||
exports.cssText = require('ace/requirejs/text!./tomorrow_night_bright.css');
|
exports.cssText = require("../requirejs/text!./tomorrow_night_bright.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
border-left: 2px solid #CCCCCC
|
border-left: 2px solid #CCCCCC
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-tomorrow-night-eighties .ace_cursor.ace_overwrite {
|
.ace-tomorrow-night-eighties .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #CCCCCC
|
border-bottom: 1px solid #CCCCCC
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = true;
|
exports.isDark = true;
|
||||||
exports.cssClass = "ace-tomorrow-night-eighties";
|
exports.cssClass = "ace-tomorrow-night-eighties";
|
||||||
exports.cssText = require('ace/requirejs/text!./tomorrow_night_eighties.css');
|
exports.cssText = require("../requirejs/text!./tomorrow_night_eighties.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
border-left: 2px solid #A7A7A7
|
border-left: 2px solid #A7A7A7
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-twilight .ace_cursor.ace_overwrite {
|
.ace-twilight .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #A7A7A7
|
border-bottom: 1px solid #A7A7A7
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = true;
|
exports.isDark = true;
|
||||||
exports.cssClass = "ace-twilight";
|
exports.cssClass = "ace-twilight";
|
||||||
exports.cssText = require('ace/requirejs/text!./twilight.css');
|
exports.cssText = require("../requirejs/text!./twilight.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
border-left: 2px solid #FFFFFF
|
border-left: 2px solid #FFFFFF
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-vibrant-ink .ace_cursor.ace_overwrite {
|
.ace-vibrant-ink .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #FFFFFF
|
border-bottom: 1px solid #FFFFFF
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = true;
|
exports.isDark = true;
|
||||||
exports.cssClass = "ace-vibrant-ink";
|
exports.cssClass = "ace-vibrant-ink";
|
||||||
exports.cssText = require('ace/requirejs/text!./vibrant_ink.css');
|
exports.cssText = require("../requirejs/text!./vibrant_ink.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
border-left: 2px solid #000000
|
border-left: 2px solid #000000
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-xcode .ace_cursor.ace_overwrite {
|
.ace-xcode .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid #000000
|
border-bottom: 1px solid #000000
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
exports.isDark = false;
|
exports.isDark = false;
|
||||||
exports.cssClass = "ace-xcode";
|
exports.cssClass = "ace-xcode";
|
||||||
exports.cssText = require('ace/requirejs/text!./xcode.css');
|
exports.cssText = require("../requirejs/text!./xcode.css");
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
dom.importCssString(exports.cssText, exports.cssClass);
|
dom.importCssString(exports.cssText, exports.cssClass);
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ var CursorLayer = require("./layer/cursor").Cursor;
|
||||||
var ScrollBar = require("./scrollbar").ScrollBar;
|
var ScrollBar = require("./scrollbar").ScrollBar;
|
||||||
var RenderLoop = require("./renderloop").RenderLoop;
|
var RenderLoop = require("./renderloop").RenderLoop;
|
||||||
var EventEmitter = require("./lib/event_emitter").EventEmitter;
|
var EventEmitter = require("./lib/event_emitter").EventEmitter;
|
||||||
var editorCss = require("ace/requirejs/text!./css/editor.css");
|
var editorCss = require("./requirejs/text!./css/editor.css");
|
||||||
|
|
||||||
dom.importCssString(editorCss, "ace_editor");
|
dom.importCssString(editorCss, "ace_editor");
|
||||||
|
|
||||||
|
|
@ -164,8 +164,8 @@ var VirtualRenderer = function(container, theme) {
|
||||||
);
|
);
|
||||||
this.$loop.schedule(this.CHANGE_FULL);
|
this.$loop.schedule(this.CHANGE_FULL);
|
||||||
|
|
||||||
this.setPadding(4);
|
|
||||||
this.updateCharacterSize();
|
this.updateCharacterSize();
|
||||||
|
this.setPadding(4);
|
||||||
};
|
};
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
@ -509,13 +509,11 @@ var VirtualRenderer = function(container, theme) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$updatePrintMargin = function() {
|
this.$updatePrintMargin = function() {
|
||||||
var containerEl;
|
|
||||||
|
|
||||||
if (!this.$showPrintMargin && !this.$printMarginEl)
|
if (!this.$showPrintMargin && !this.$printMarginEl)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!this.$printMarginEl) {
|
if (!this.$printMarginEl) {
|
||||||
containerEl = dom.createElement("div");
|
var containerEl = dom.createElement("div");
|
||||||
containerEl.className = "ace_layer ace_print-margin-layer";
|
containerEl.className = "ace_layer ace_print-margin-layer";
|
||||||
this.$printMarginEl = dom.createElement("div");
|
this.$printMarginEl = dom.createElement("div");
|
||||||
this.$printMarginEl.className = "ace_print-margin";
|
this.$printMarginEl.className = "ace_print-margin";
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
"asyncjs": "0.0.x",
|
"asyncjs": "0.0.x",
|
||||||
"jsdom": "0.2.x",
|
"jsdom": "0.2.x",
|
||||||
"amd-loader": "~0.0.4",
|
"amd-loader": "~0.0.4",
|
||||||
"dryice": ""
|
"dryice": "0.4.7"
|
||||||
},
|
},
|
||||||
"mappings": {
|
"mappings": {
|
||||||
"ace": "."
|
"ace": "."
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node lib/ace/test/all.js",
|
"test": "node lib/ace/test/all.js",
|
||||||
"postinstall": "node ./install.js"
|
"postinstall": "node ./install.js -c"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"github.com/sourcemint/bundler-js/0/-meta/config/0": {
|
"github.com/sourcemint/bundler-js/0/-meta/config/0": {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
border-left: 2px solid %cursor%;
|
border-left: 2px solid %cursor%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.%cssClass% .ace_cursor.ace_overwrite {
|
.%cssClass% .ace_overwrite-cursors .ace_cursor {
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
border-bottom: 1px solid %overwrite%;
|
border-bottom: 1px solid %overwrite%;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -278,7 +278,7 @@ function convertTheme(name) {
|
||||||
|
|
||||||
var js = fillTemplate(jsTemplate, {
|
var js = fillTemplate(jsTemplate, {
|
||||||
name: name,
|
name: name,
|
||||||
css: "require('ace/requirejs/text!./" + name + ".css')", // quoteString(css), //
|
css: 'require("../requirejs/text!./' + name + '.css")', // quoteString(css), //
|
||||||
cssClass: "ace-" + hyphenate(name),
|
cssClass: "ace-" + hyphenate(name),
|
||||||
isDark: styles.isDark
|
isDark: styles.isDark
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,10 @@ var deps = [{
|
||||||
path: "mode/css/csslint.js",
|
path: "mode/css/csslint.js",
|
||||||
url: "https://raw.github.com/stubbornella/csslint/master/release/csslint-node.js",
|
url: "https://raw.github.com/stubbornella/csslint/master/release/csslint-node.js",
|
||||||
needsFixup: true
|
needsFixup: true
|
||||||
|
}, {
|
||||||
|
path: "../../demo/kitchen-sink/require.js",
|
||||||
|
url: "https://raw.github.com/jrburke/requirejs/master/require.js",
|
||||||
|
needsFixup: false
|
||||||
}]
|
}]
|
||||||
|
|
||||||
var download = function(href, callback) {
|
var download = function(href, callback) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue