reorganize build and demo
Conflicts: Makefile.dryice.js
This commit is contained in:
parent
0f0d12a709
commit
34f3cac4a8
6 changed files with 486 additions and 352 deletions
|
|
@ -38,6 +38,8 @@
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
var fs = require("fs");
|
var fs = require("fs");
|
||||||
|
if (!fs.existsSync)
|
||||||
|
fs.existsSync = require("path").existsSync;
|
||||||
var copy = require('dryice').copy;
|
var copy = require('dryice').copy;
|
||||||
|
|
||||||
var ACE_HOME = __dirname;
|
var ACE_HOME = __dirname;
|
||||||
|
|
@ -47,10 +49,9 @@ function main(args) {
|
||||||
if (args.length == 3) {
|
if (args.length == 3) {
|
||||||
target = args[2];
|
target = args[2];
|
||||||
// Check if 'target' contains some allowed value.
|
// Check if 'target' contains some allowed value.
|
||||||
if (target != "normal" && target != "bm" && target != "demo") {
|
if (!/^(normal|bm|demo|minimal)$/.test(target))
|
||||||
target = null;
|
target = "help";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (target == "help") {
|
if (target == "help") {
|
||||||
console.log("--- Ace Dryice Build Tool ---");
|
console.log("--- Ace Dryice Build Tool ---");
|
||||||
|
|
@ -107,7 +108,7 @@ function bookmarklet(aceProject) {
|
||||||
exportModule: "ace/ext/textarea",
|
exportModule: "ace/ext/textarea",
|
||||||
compress: false,
|
compress: false,
|
||||||
noconflict: true,
|
noconflict: true,
|
||||||
suffix: ".js",
|
suffix: "",
|
||||||
name: "ace-bookmarklet",
|
name: "ace-bookmarklet",
|
||||||
workers: [],
|
workers: [],
|
||||||
keybindings: []
|
keybindings: []
|
||||||
|
|
@ -121,13 +122,13 @@ function ace(aceProject) {
|
||||||
buildAce(aceProject, {
|
buildAce(aceProject, {
|
||||||
compress: false,
|
compress: false,
|
||||||
noconflict: false,
|
noconflict: false,
|
||||||
suffix: "-uncompressed",
|
suffix: "",
|
||||||
name: "ace"
|
name: "ace"
|
||||||
});
|
});
|
||||||
buildAce(aceProject, {
|
buildAce(aceProject, {
|
||||||
compress: false,
|
compress: false,
|
||||||
noconflict: true,
|
noconflict: true,
|
||||||
suffix: "-uncompressed-noconflict",
|
suffix: "-noconflict",
|
||||||
name: "ace",
|
name: "ace",
|
||||||
workers: []
|
workers: []
|
||||||
});
|
});
|
||||||
|
|
@ -136,14 +137,14 @@ function ace(aceProject) {
|
||||||
buildAce(aceProject, {
|
buildAce(aceProject, {
|
||||||
compress: true,
|
compress: true,
|
||||||
noconflict: false,
|
noconflict: false,
|
||||||
suffix: "",
|
suffix: "-min",
|
||||||
name: "ace",
|
name: "ace",
|
||||||
workers: []
|
workers: []
|
||||||
});
|
});
|
||||||
buildAce(aceProject, {
|
buildAce(aceProject, {
|
||||||
compress: true,
|
compress: true,
|
||||||
noconflict: true,
|
noconflict: true,
|
||||||
suffix: "-noconflict",
|
suffix: "-min-noconflict",
|
||||||
name: "ace",
|
name: "ace",
|
||||||
workers: []
|
workers: []
|
||||||
});
|
});
|
||||||
|
|
@ -179,33 +180,65 @@ function demo(aceProject) {
|
||||||
ref = "";
|
ref = "";
|
||||||
version = "";
|
version = "";
|
||||||
}
|
}
|
||||||
|
var changeComments = function(data) {
|
||||||
copy({
|
|
||||||
source: "kitchen-sink.html",
|
|
||||||
dest: "build/kitchen-sink.html",
|
|
||||||
filter: [ function(data) {
|
|
||||||
return (data
|
return (data
|
||||||
.replace("DEVEL-->", "")
|
.replace("DEVEL-->", "")
|
||||||
.replace("<!--DEVEL", "")
|
.replace("<!--DEVEL", "")
|
||||||
.replace("PACKAGE-->", "")
|
.replace("PACKAGE-->", "")
|
||||||
.replace("<!--PACKAGE", "")
|
.replace("<!--PACKAGE", "")
|
||||||
|
.replace("DEVEL*/", "")
|
||||||
|
.replace("/*DEVEL", "")
|
||||||
|
.replace("PACKAGE*/", "")
|
||||||
|
.replace("/*PACKAGE", "")
|
||||||
.replace("%version%", version)
|
.replace("%version%", version)
|
||||||
.replace("%commit%", ref)
|
.replace("%commit%", ref)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
copy({
|
||||||
|
source: "kitchen-sink.html",
|
||||||
|
dest: "build/kitchen-sink.html",
|
||||||
|
filter: [changeComments, function(data) {
|
||||||
|
return data.replace(/"(demo|build)\//g, "\"");
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
|
|
||||||
buildAce(aceProject, {
|
copy({
|
||||||
targetDir: "build/demo/kitchen-sink",
|
source: "demo/kitchen-sink/styles.css",
|
||||||
ns: "ace",
|
dest: "build/kitchen-sink/styles.css",
|
||||||
requires: "kitchen-sink/demo",
|
filter: [ changeComments ]
|
||||||
compress: false,
|
|
||||||
noconflict: false,
|
|
||||||
compat: false,
|
|
||||||
name: "kitchen-sink",
|
|
||||||
suffix: "",
|
|
||||||
keybindings: []
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
fs.readdirSync("demo/kitchen-sink/docs/").forEach(function(x) {
|
||||||
|
copy({
|
||||||
|
source: "demo/kitchen-sink/docs/" + x,
|
||||||
|
dest: "build/kitchen-sink/docs/" + x
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
var demo = copy.createDataObject();
|
||||||
|
copy({
|
||||||
|
source: "demo/kitchen-sink/demo.js",
|
||||||
|
dest: demo,
|
||||||
|
filter: [changeComments, function(data) {
|
||||||
|
return data.replace(/"(demo|build)\//g, "\"");
|
||||||
|
}, function(data) {
|
||||||
|
return data.replace("define(", "define('kitchen-sink/demo',");
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
copy({
|
||||||
|
source: "lib/ace/split.js",
|
||||||
|
dest: demo,
|
||||||
|
filter: [changeComments, function(data) {
|
||||||
|
return data.replace("define(", "define('ace/split',");
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
copy({
|
||||||
|
source: demo,
|
||||||
|
dest: "build/kitchen-sink/demo.js",
|
||||||
|
});
|
||||||
|
|
||||||
|
copyFileSync("demo/kitchen-sink/logo.png", "build/kitchen-sink/logo.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildAce(aceProject, options) {
|
function buildAce(aceProject, options) {
|
||||||
|
|
@ -219,21 +252,13 @@ function buildAce(aceProject, options) {
|
||||||
noconflict: false,
|
noconflict: false,
|
||||||
suffix: "",
|
suffix: "",
|
||||||
name: "ace",
|
name: "ace",
|
||||||
modes: [
|
modes: fs.readdirSync("lib/ace/mode").map(function(x) {
|
||||||
"css", "html", "javascript", "php", "coldfusion", "python", "lua", "xml", "ruby", "java", "c_cpp",
|
if (x.slice(-3) == ".js" && !/_highlight_rules|_test|_worker|xml_util|_outdent|behaviour/.test(x))
|
||||||
"coffee", "perl", "csharp", "haxe", "liquid", "svg", "clojure", "scss", "json", "groovy",
|
return x.slice(0, -3);
|
||||||
"ocaml", "scala", "textile", "scad", "markdown", "latex", "powershell", "sql",
|
}).filter(function(x){return !!x}),
|
||||||
"text", "pgsql", "sh", "xquery", "less", "golang", "c9search", "yaml"
|
themes: fs.readdirSync("lib/ace/theme").map(function(x){
|
||||||
],
|
return x.slice(-3) == ".js" && x.slice(0, -3)
|
||||||
themes: [
|
}).filter(function(x){return !!x}),
|
||||||
"chrome", "clouds", "clouds_midnight", "cobalt", "crimson_editor", "dawn",
|
|
||||||
"dreamweaver", "eclipse",
|
|
||||||
"idle_fingers", "kr_theme", "merbivore", "merbivore_soft",
|
|
||||||
"mono_industrial", "monokai", "pastel_on_dark", "solarized_dark",
|
|
||||||
"solarized_light", "textmate", "tomorrow", "tomorrow_night",
|
|
||||||
"tomorrow_night_blue", "tomorrow_night_bright", "tomorrow_night_eighties",
|
|
||||||
"twilight", "vibrant_ink"
|
|
||||||
],
|
|
||||||
workers: ["javascript", "coffee", "css", "json", "xquery"],
|
workers: ["javascript", "coffee", "css", "json", "xquery"],
|
||||||
keybindings: ["vim", "emacs"]
|
keybindings: ["vim", "emacs"]
|
||||||
};
|
};
|
||||||
|
|
@ -278,12 +303,10 @@ function buildAce(aceProject, options) {
|
||||||
dest: ace
|
dest: ace
|
||||||
});
|
});
|
||||||
copy({
|
copy({
|
||||||
source: [
|
source: [{
|
||||||
{
|
|
||||||
project: project,
|
project: project,
|
||||||
require: options.requires
|
require: options.requires
|
||||||
}
|
}],
|
||||||
],
|
|
||||||
filter: [ copy.filter.moduleDefines ],
|
filter: [ copy.filter.moduleDefines ],
|
||||||
dest: ace
|
dest: ace
|
||||||
});
|
});
|
||||||
|
|
@ -300,12 +323,10 @@ function buildAce(aceProject, options) {
|
||||||
options.modes.forEach(function(mode) {
|
options.modes.forEach(function(mode) {
|
||||||
console.log("mode " + mode);
|
console.log("mode " + mode);
|
||||||
copy({
|
copy({
|
||||||
source: [
|
source: [{
|
||||||
{
|
|
||||||
project: cloneProject(project),
|
project: cloneProject(project),
|
||||||
require: [ 'ace/mode/' + mode ]
|
require: [ 'ace/mode/' + mode ]
|
||||||
}
|
}],
|
||||||
],
|
|
||||||
filter: filters,
|
filter: filters,
|
||||||
dest: targetDir + suffix + "/mode-" + mode + ".js"
|
dest: targetDir + suffix + "/mode-" + mode + ".js"
|
||||||
});
|
});
|
||||||
|
|
@ -380,12 +401,10 @@ function buildAce(aceProject, options) {
|
||||||
project.assumeAllFilesLoaded();
|
project.assumeAllFilesLoaded();
|
||||||
options.keybindings.forEach(function(keybinding) {
|
options.keybindings.forEach(function(keybinding) {
|
||||||
copy({
|
copy({
|
||||||
source: [
|
source: [{
|
||||||
{
|
|
||||||
project: cloneProject(project),
|
project: cloneProject(project),
|
||||||
require: [ 'ace/keyboard/' + keybinding ]
|
require: [ 'ace/keyboard/' + keybinding ]
|
||||||
}
|
}],
|
||||||
],
|
|
||||||
filter: filters,
|
filter: filters,
|
||||||
dest: targetDir + suffix + "/keybinding-" + keybinding + ".js"
|
dest: targetDir + suffix + "/keybinding-" + keybinding + ".js"
|
||||||
});
|
});
|
||||||
|
|
@ -410,6 +429,27 @@ function cloneProject(project) {
|
||||||
|
|
||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
|
function copyFileSync(srcFile, destFile) {
|
||||||
|
var BUF_LENGTH = 64*1024,
|
||||||
|
buf = new Buffer(BUF_LENGTH),
|
||||||
|
bytesRead = BUF_LENGTH,
|
||||||
|
pos = 0,
|
||||||
|
fdr = null,
|
||||||
|
fdw = null;
|
||||||
|
|
||||||
|
|
||||||
|
fdr = fs.openSync(srcFile, 'r');
|
||||||
|
fdw = fs.openSync(destFile, 'w');
|
||||||
|
|
||||||
|
while (bytesRead === BUF_LENGTH) {
|
||||||
|
bytesRead = fs.readSync(fdr, buf, 0, BUF_LENGTH, pos);
|
||||||
|
fs.writeSync(fdw, buf, 0, bytesRead);
|
||||||
|
pos += bytesRead;
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.closeSync(fdr);
|
||||||
|
fs.closeSync(fdw);
|
||||||
|
}
|
||||||
|
|
||||||
function quoteString(str) {
|
function quoteString(str) {
|
||||||
return '"' + str.replace(/\\/, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\\n") + '"';
|
return '"' + str.replace(/\\/, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\\n") + '"';
|
||||||
|
|
@ -438,7 +478,7 @@ function exportAce(ns, module, requireBase) {
|
||||||
var template = function() {
|
var template = function() {
|
||||||
(function() {
|
(function() {
|
||||||
REQUIRE_NS.require(["MODULE"], function(a) {
|
REQUIRE_NS.require(["MODULE"], function(a) {
|
||||||
a.config.init();
|
a && a.config.init();
|
||||||
if (!window.NS)
|
if (!window.NS)
|
||||||
window.NS = {};
|
window.NS = {};
|
||||||
for (var key in a) if (a.hasOwnProperty(key))
|
for (var key in a) if (a.hasOwnProperty(key))
|
||||||
|
|
|
||||||
|
|
@ -28,13 +28,11 @@
|
||||||
}
|
}
|
||||||
}</pre>
|
}</pre>
|
||||||
|
|
||||||
<script src="src/ace-uncompressed-noconflict.js" type="text/javascript" charset="utf-8"></script>
|
<script src="src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
|
||||||
var editor = ace.edit("editor");
|
var editor = ace.edit("editor");
|
||||||
editor.setTheme("ace/theme/twilight");
|
editor.setTheme("ace/theme/twilight");
|
||||||
editor.getSession().setMode("ace/mode/javascript");
|
editor.getSession().setMode("ace/mode/javascript");
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
|
|
@ -39,12 +39,15 @@
|
||||||
|
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
"use strict";
|
"never use strict";
|
||||||
|
|
||||||
require("ace/lib/fixoldbrowsers");
|
require("ace/lib/fixoldbrowsers");
|
||||||
require("ace/config").init();
|
require("ace/config").init();
|
||||||
var env = {};
|
var env = {};
|
||||||
|
|
||||||
|
var dom = require("ace/lib/dom");
|
||||||
|
var net = require("ace/lib/net");
|
||||||
|
|
||||||
var event = require("ace/lib/event");
|
var event = require("ace/lib/event");
|
||||||
var theme = require("ace/theme/textmate");
|
var theme = require("ace/theme/textmate");
|
||||||
var EditSession = require("ace/edit_session").EditSession;
|
var EditSession = require("ace/edit_session").EditSession;
|
||||||
|
|
@ -54,25 +57,25 @@ var vim = require("ace/keyboard/vim").handler;
|
||||||
var emacs = require("ace/keyboard/emacs").handler;
|
var emacs = require("ace/keyboard/emacs").handler;
|
||||||
var HashHandler = require("ace/keyboard/hash_handler").HashHandler;
|
var HashHandler = require("ace/keyboard/hash_handler").HashHandler;
|
||||||
|
|
||||||
var modesByName;
|
var Renderer = require("ace/virtual_renderer").VirtualRenderer;
|
||||||
|
var Editor = require("ace/editor").Editor;
|
||||||
|
var MultiSelect = require("ace/multi_select").MultiSelect;
|
||||||
|
|
||||||
// workers do not work for file:
|
// workers do not work for file:
|
||||||
if (location.protocol == "file:")
|
if (location.protocol == "file:")
|
||||||
EditSession.prototype.$useWorker = false;
|
EditSession.prototype.$useWorker = false;
|
||||||
|
|
||||||
var Doc = function(name, desc, file) {
|
/************** modes ***********************/
|
||||||
this.name = name;
|
var modesByName;
|
||||||
this.desc = desc;
|
function getModeFromPath(path) {
|
||||||
this.doc = new EditSession(file);
|
var mode = modesByName.text;
|
||||||
this.doc.modeName = name;
|
for (var i = 0; i < modes.length; i++) {
|
||||||
this.doc.setUndoManager(new UndoManager());
|
if (modes[i].supportsFile(path)) {
|
||||||
};
|
mode = modes[i];
|
||||||
|
break;
|
||||||
var WrappedDoc = function(name, desc, file) {
|
}
|
||||||
Doc.apply(this, arguments);
|
}
|
||||||
|
return mode;
|
||||||
this.doc.setUseWrapMode(true);
|
|
||||||
this.doc.setWrapLimitRange(80, 80);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var Mode = function(name, desc, extensions) {
|
var Mode = function(name, desc, extensions) {
|
||||||
|
|
@ -130,158 +133,220 @@ modes.forEach(function(m) {
|
||||||
modesByName[m.name] = m;
|
modesByName[m.name] = m;
|
||||||
});
|
});
|
||||||
|
|
||||||
var loreIpsum = require("ace/requirejs/text!./docs/plaintext.txt");
|
/*********** demo documents ***************************/
|
||||||
for (var i = 0; i < 5; i++) {
|
var fileCache = {};
|
||||||
loreIpsum += loreIpsum;
|
|
||||||
|
function initDoc(file, path, doc) {
|
||||||
|
if (doc.prepare)
|
||||||
|
file = doc.prepare(file);
|
||||||
|
|
||||||
|
var session = new EditSession(file);
|
||||||
|
session.setUndoManager(new UndoManager());
|
||||||
|
doc.session = session;
|
||||||
|
doc.path = path;
|
||||||
|
if (doc.wrapped) {
|
||||||
|
session.setUseWrapMode(true);
|
||||||
|
session.setWrapLimitRange(80, 80);
|
||||||
|
}
|
||||||
|
var mode = getModeFromPath(path)
|
||||||
|
session.modeName = mode.name;
|
||||||
|
session.setMode(mode.mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
var docs = [
|
|
||||||
new Doc(
|
|
||||||
"javascript", "JavaScript",
|
|
||||||
require("ace/requirejs/text!./docs/javascript.js")
|
|
||||||
),
|
|
||||||
new WrappedDoc("text", "Plain Text", loreIpsum),
|
|
||||||
new Doc(
|
|
||||||
"coffee", "Coffeescript",
|
|
||||||
require("ace/requirejs/text!./docs/coffeescript.coffee")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"json", "JSON",
|
|
||||||
require("ace/requirejs/text!./docs/json.json")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"css", "CSS",
|
|
||||||
require("ace/requirejs/text!./docs/css.css")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"scss", "SCSS",
|
|
||||||
require("ace/requirejs/text!./docs/scss.scss")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"less", "LESS",
|
|
||||||
require("ace/requirejs/text!./docs/less.less")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"html", "HTML",
|
|
||||||
require("ace/requirejs/text!./docs/html.html")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"xml", "XML",
|
|
||||||
require("ace/requirejs/text!./docs/xml.xml")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"yaml", "YAML",
|
|
||||||
require("ace/requirejs/text!./docs/yaml.yaml")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"svg", "SVG",
|
|
||||||
require("ace/requirejs/text!./docs/svg.svg")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"php", "PHP",
|
|
||||||
require("ace/requirejs/text!./docs/php.php")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"coldfusion", "ColdFusion",
|
|
||||||
require("ace/requirejs/text!./docs/coldfusion.cfm")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"python", "Python",
|
|
||||||
require("ace/requirejs/text!./docs/python.py")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"ruby", "Ruby",
|
|
||||||
require("ace/requirejs/text!./docs/ruby.rb")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"perl", "Perl",
|
|
||||||
require("ace/requirejs/text!./docs/perl.pl")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"ocaml", "OCaml",
|
|
||||||
require("ace/requirejs/text!./docs/ocaml.ml")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"lua", "Lua",
|
|
||||||
require("ace/requirejs/text!./docs/lua.lua")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"liquid", "Liquid",
|
|
||||||
require("ace/requirejs/text!./docs/liquid.liquid")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"java", "Java",
|
|
||||||
require("ace/requirejs/text!./docs/java.java")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"clojure", "Clojure",
|
|
||||||
require("ace/requirejs/text!./docs/clojure.clj")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"groovy", "Groovy",
|
|
||||||
require("ace/requirejs/text!./docs/groovy.groovy")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"scala", "Scala",
|
|
||||||
require("ace/requirejs/text!./docs/scala.scala")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"scad", "OpenSCAD",
|
|
||||||
require("ace/requirejs/text!./docs/OpenSCAD.scad")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"csharp", "C#",
|
|
||||||
require("ace/requirejs/text!./docs/csharp.cs")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"powershell", "Powershell",
|
|
||||||
require("ace/requirejs/text!./docs/powershell.ps1")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"c_cpp", "C/C++",
|
|
||||||
require("ace/requirejs/text!./docs/cpp.cpp")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"haxe", "haXe",
|
|
||||||
require("ace/requirejs/text!./docs/Haxe.hx")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"sh", "SH",
|
|
||||||
require("ace/requirejs/text!./docs/sh.sh")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"xquery", "XQuery",
|
|
||||||
require("ace/requirejs/text!./docs/xquery.xq")
|
|
||||||
),
|
|
||||||
new WrappedDoc(
|
|
||||||
"markdown", "Markdown",
|
|
||||||
require("ace/requirejs/text!./docs/markdown.md")
|
|
||||||
),
|
|
||||||
new WrappedDoc(
|
|
||||||
"textile", "Textile",
|
|
||||||
require("ace/requirejs/text!./docs/textile.textile")
|
|
||||||
),
|
|
||||||
new WrappedDoc(
|
|
||||||
"latex", "LaTeX",
|
|
||||||
require("ace/requirejs/text!./docs/latex.tex")
|
|
||||||
),
|
|
||||||
new WrappedDoc(
|
|
||||||
"sql", "SQL",
|
|
||||||
require("ace/requirejs/text!./docs/sql.sql")
|
|
||||||
),
|
|
||||||
new WrappedDoc(
|
|
||||||
"pgsql", "pgSQL",
|
|
||||||
require("ace/requirejs/text!./docs/pgsql.pgsql")
|
|
||||||
),
|
|
||||||
new Doc(
|
|
||||||
"golang", "Go",
|
|
||||||
require("ace/requirejs/text!./docs/golang.go")
|
|
||||||
)
|
|
||||||
];
|
|
||||||
|
|
||||||
var docsByName = {};
|
function makeHuge(txt) {
|
||||||
docs.forEach(function(d) {
|
for (var i = 0; i < 5; i++)
|
||||||
docsByName[d.name] = d;
|
txt += txt;
|
||||||
|
return txt
|
||||||
|
}
|
||||||
|
|
||||||
|
var docs = {
|
||||||
|
"docs/javascript.js": "JavaScript",
|
||||||
|
"docs/plaintext.txt": {name: "Plain Text", prepare: makeHuge, wrapped: true},
|
||||||
|
"docs/coffeescript.coffee": "Coffeescript",
|
||||||
|
"docs/json.json": "JSON",
|
||||||
|
"docs/css.css": "CSS",
|
||||||
|
"docs/scss.scss": "SCSS",
|
||||||
|
"docs/less.less": "LESS",
|
||||||
|
"docs/html.html": "HTML",
|
||||||
|
"docs/xml.xml": "XML",
|
||||||
|
"docs/yaml.yaml": "YAML",
|
||||||
|
"docs/svg.svg": "SVG",
|
||||||
|
"docs/php.php": "PHP",
|
||||||
|
"docs/coldfusion.cfm": "ColdFusion",
|
||||||
|
"docs/python.py": "Python",
|
||||||
|
"docs/ruby.rb": "Ruby",
|
||||||
|
"docs/perl.pl": "Perl",
|
||||||
|
"docs/ocaml.ml": "OCaml",
|
||||||
|
"docs/OpenSCAD.scad": "OpenSCAD",
|
||||||
|
"docs/lua.lua": "Lua",
|
||||||
|
"docs/liquid.liquid": "Liquid",
|
||||||
|
"docs/java.java": "Java",
|
||||||
|
"docs/clojure.clj": "Clojure",
|
||||||
|
"docs/groovy.groovy": "Groovy",
|
||||||
|
"docs/scala.scala": "Scala",
|
||||||
|
"docs/csharp.cs": "C#",
|
||||||
|
"docs/powershell.ps1": "Powershell",
|
||||||
|
"docs/cpp.cpp": "C/C++",
|
||||||
|
"docs/Haxe.hx": "haXe",
|
||||||
|
"docs/sh.sh": "SH",
|
||||||
|
"docs/xquery.xq": "XQuery",
|
||||||
|
"docs/markdown.md": {name: "Markdown", wrapped: true},
|
||||||
|
"docs/textile.textile": {name: "Textile", wrapped: true},
|
||||||
|
"docs/latex.tex": {name: "LaTeX", wrapped: true},
|
||||||
|
"docs/sql.sql": {name: "SQL", wrapped: true},
|
||||||
|
"docs/pgsql.pgsql": {name: "pgSQL", wrapped: true},
|
||||||
|
"docs/golang.go": "Go"
|
||||||
|
}
|
||||||
|
|
||||||
|
var ownSource = {
|
||||||
|
/* filled from require*/
|
||||||
|
};
|
||||||
|
|
||||||
|
var hugeDocs = {
|
||||||
|
"build/src/ace.js": "",
|
||||||
|
"build/src-min/ace.js": ""
|
||||||
|
};
|
||||||
|
|
||||||
|
if (window.require && window.require.s) try {
|
||||||
|
for (var path in window.require.s.contexts._.loaded) {
|
||||||
|
if (path.indexOf("!") != -1)
|
||||||
|
path = path.split("!").pop();
|
||||||
|
else
|
||||||
|
path = path + ".js";
|
||||||
|
ownSource[path] = ""
|
||||||
|
}
|
||||||
|
} catch(e) {}
|
||||||
|
|
||||||
|
function prepareDocList(docs) {
|
||||||
|
var list = []
|
||||||
|
for (var path in docs) {
|
||||||
|
var doc = docs[path];
|
||||||
|
if (typeof doc != "object")
|
||||||
|
doc = {name: doc || path};
|
||||||
|
|
||||||
|
doc.path = path;
|
||||||
|
doc.desc = doc.name.replace(/^(ace|docs|demo|build)\//, "");
|
||||||
|
if (doc.desc.length > 18)
|
||||||
|
doc.desc = doc.desc.slice(0, 7) + ".." + doc.desc.slice(-9)
|
||||||
|
|
||||||
|
fileCache[doc.name] = doc;
|
||||||
|
list.push(doc);
|
||||||
|
};
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
docs = prepareDocList(docs);
|
||||||
|
ownSource = prepareDocList(ownSource);
|
||||||
|
hugeDocs = prepareDocList(hugeDocs);
|
||||||
|
|
||||||
|
/*********** create editor ***************************/
|
||||||
|
var container = document.getElementById("editor");
|
||||||
|
|
||||||
|
// Splitting.
|
||||||
|
var Split = require("ace/split").Split;
|
||||||
|
var split = new Split(container, theme, 1);
|
||||||
|
env.editor = split.getEditor(0);
|
||||||
|
split.on("focus", function(editor) {
|
||||||
|
env.editor = editor;
|
||||||
|
updateUIEditorOptions();
|
||||||
|
});
|
||||||
|
env.split = split;
|
||||||
|
window.env = env;
|
||||||
|
window.editor = window.ace = env.editor;
|
||||||
|
env.editor.setAnimatedScroll(true);
|
||||||
|
|
||||||
|
var consoleHight = 20;
|
||||||
|
function onResize() {
|
||||||
|
var left = env.split.$container.offsetLeft;
|
||||||
|
var width = document.documentElement.clientWidth - left;
|
||||||
|
container.style.width = width + "px";
|
||||||
|
container.style.height = document.documentElement.clientHeight - consoleHight + "px";
|
||||||
|
env.split.resize();
|
||||||
|
|
||||||
|
consoleEl.style.width = width + "px";
|
||||||
|
cmdLine.resize()
|
||||||
|
}
|
||||||
|
|
||||||
|
var consoleEl = dom.createElement("div");
|
||||||
|
container.parentNode.appendChild(consoleEl);
|
||||||
|
consoleEl.style.position="fixed"
|
||||||
|
consoleEl.style.bottom = "1px"
|
||||||
|
consoleEl.style.right = 0
|
||||||
|
consoleEl.style.background = "white"
|
||||||
|
consoleEl.style.border = "1px solid #baf"
|
||||||
|
consoleEl.style.zIndex = "100"
|
||||||
|
var cmdLine = new singleLineEditor(consoleEl);
|
||||||
|
cmdLine.editor = env.editor;
|
||||||
|
env.editor.cmdLine = cmdLine;
|
||||||
|
|
||||||
|
env.editor.commands.addCommands([{
|
||||||
|
name: "gotoline",
|
||||||
|
bindKey: {win: "Ctrl-L", mac: "Command-L"},
|
||||||
|
exec: function(editor, line) {
|
||||||
|
if (typeof needle == "object") {
|
||||||
|
var arg = this.name + " " + editor.getCursorPosition().row;
|
||||||
|
editor.cmdLine.setValue(arg, 1)
|
||||||
|
editor.cmdLine.focus()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
line = parseInt(line, 10);
|
||||||
|
if (!isNaN(line))
|
||||||
|
editor.gotoLine(line);
|
||||||
|
},
|
||||||
|
readOnly: true
|
||||||
|
}, {
|
||||||
|
name: "find",
|
||||||
|
bindKey: {win: "Ctrl-F", mac: "Command-F"},
|
||||||
|
exec: function(editor, needle) {
|
||||||
|
if (typeof needle == "object") {
|
||||||
|
var arg = this.name + " " + editor.getCopyText()
|
||||||
|
editor.cmdLine.setValue(arg, 1)
|
||||||
|
editor.cmdLine.focus()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
editor.find(needle);
|
||||||
|
},
|
||||||
|
readOnly: true
|
||||||
|
}, {
|
||||||
|
name: "focusCommandLine",
|
||||||
|
bindKey: "shift-esc",
|
||||||
|
exec: function(editor, needle) { editor.cmdLine.focus(); },
|
||||||
|
readOnly: true
|
||||||
|
}])
|
||||||
|
|
||||||
|
cmdLine.commands.bindKeys({
|
||||||
|
"Shift-Return|Ctrl-Return|Alt-Return": function(cmdLine) { cmdLine.insert("\n")},
|
||||||
|
"Esc|Shift-Esc": function(cmdLine){ cmdLine.editor.focus(); },
|
||||||
|
"Return": function(cmdLine){
|
||||||
|
var command = cmdLine.getValue().split(/\s+/);
|
||||||
|
var editor = cmdLine.editor;
|
||||||
|
editor.commands.exec(command[0], editor, command[1]);
|
||||||
|
editor.focus();
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
cmdLine.commands.removeCommands(["find", "goToLine", "findAll", "replace", "replaceAll"])
|
||||||
|
|
||||||
|
window.onresize = onResize;
|
||||||
|
onResize();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This demonstrates how you can define commands and bind shortcuts to them.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var commands = env.editor.commands;
|
||||||
|
commands.addCommand({
|
||||||
|
name: "save",
|
||||||
|
bindKey: {win: "Ctrl-S", mac: "Command-S"},
|
||||||
|
exec: function() {alert("Fake Save File");}
|
||||||
|
});
|
||||||
|
|
||||||
|
commands.addCommand({
|
||||||
|
name: "print",
|
||||||
|
bindKey: {win: "Ctrl-P", mac: "Command-P"},
|
||||||
|
exec: function(editor) {editor.session.setValue("please,\ndo not waste paper\n");}
|
||||||
});
|
});
|
||||||
|
|
||||||
var keybindings = {
|
var keybindings = {
|
||||||
|
|
@ -299,21 +364,9 @@ var keybindings = {
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
var container = document.getElementById("editor");
|
|
||||||
|
|
||||||
// Splitting.
|
|
||||||
var Split = require("ace/split").Split;
|
|
||||||
var split = new Split(container, theme, 1);
|
|
||||||
env.editor = split.getEditor(0);
|
|
||||||
split.on("focus", function(editor) {
|
|
||||||
env.editor = editor;
|
|
||||||
updateUIEditorOptions();
|
|
||||||
});
|
|
||||||
env.split = split;
|
|
||||||
window.env = env;
|
|
||||||
window.editor = window.ace = env.editor;
|
|
||||||
env.editor.setAnimatedScroll(true);
|
|
||||||
|
|
||||||
|
/*********** options pane ***************************/
|
||||||
var docEl = document.getElementById("doc");
|
var docEl = document.getElementById("doc");
|
||||||
var modeEl = document.getElementById("mode");
|
var modeEl = document.getElementById("mode");
|
||||||
var wrapModeEl = document.getElementById("soft_wrap");
|
var wrapModeEl = document.getElementById("soft_wrap");
|
||||||
|
|
@ -330,39 +383,54 @@ var animateScrollEl = document.getElementById("animate_scroll");
|
||||||
var softTabEl = document.getElementById("soft_tab");
|
var softTabEl = document.getElementById("soft_tab");
|
||||||
var behavioursEl = document.getElementById("enable_behaviours");
|
var behavioursEl = document.getElementById("enable_behaviours");
|
||||||
|
|
||||||
docs.forEach(function(doc) {
|
var group = document.createElement("optgroup");
|
||||||
var option = document.createElement("option");
|
group.setAttribute("label", "Mode Examples");
|
||||||
option.setAttribute("value", doc.name);
|
fillDropdown(docs, group);
|
||||||
option.innerHTML = doc.desc;
|
docEl.appendChild(group);
|
||||||
docEl.appendChild(option);
|
var group = document.createElement("optgroup");
|
||||||
});
|
group.setAttribute("label", "Huge documents");
|
||||||
|
fillDropdown(hugeDocs, group);
|
||||||
|
docEl.appendChild(group);
|
||||||
|
var group = document.createElement("optgroup");
|
||||||
|
group.setAttribute("label", "own source");
|
||||||
|
fillDropdown(ownSource, group);
|
||||||
|
docEl.appendChild(group);
|
||||||
|
|
||||||
modes.forEach(function(mode) {
|
|
||||||
var option = document.createElement("option");
|
fillDropdown(modes, modeEl);
|
||||||
option.setAttribute("value", mode.name);
|
|
||||||
option.innerHTML = mode.desc;
|
|
||||||
modeEl.appendChild(option);
|
|
||||||
});
|
|
||||||
|
|
||||||
bindDropdown("mode", function(value) {
|
bindDropdown("mode", function(value) {
|
||||||
env.editor.getSession().setMode(modesByName[value].mode || modesByName.text.mode);
|
env.editor.getSession().setMode(modesByName[value].mode || modesByName.text.mode);
|
||||||
env.editor.getSession().modeName = value;
|
env.editor.getSession().modeName = value;
|
||||||
});
|
});
|
||||||
|
|
||||||
bindDropdown("doc", function(value) {
|
bindDropdown("doc", function(name) {
|
||||||
var doc = docsByName[value].doc;
|
var doc = fileCache[name];
|
||||||
|
if (!doc)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!docsByName[value].initialized) {
|
if (doc.session)
|
||||||
docsByName[value].initialized = true;
|
return setSession(doc.session)
|
||||||
doc.setMode(modesByName[docsByName[value].name].mode);
|
|
||||||
|
//@todo do something while waiting
|
||||||
|
// env.editor.setSession(emptySession || (emptySession = new EditSession("")))
|
||||||
|
var path = doc.path;
|
||||||
|
var parts = path.split("/");
|
||||||
|
if (parts[0] == "docs")
|
||||||
|
path = "demo/kitchen-sink/" + path;
|
||||||
|
else if (parts[0] == "ace")
|
||||||
|
path = "lib/" + path;
|
||||||
|
|
||||||
|
net.get(path, function(x) {
|
||||||
|
initDoc(x, path, doc);
|
||||||
|
setSession(doc.session)
|
||||||
|
})
|
||||||
|
|
||||||
|
function setSession(session) {
|
||||||
|
var session = env.split.setSession(session);
|
||||||
|
updateUIEditorOptions();
|
||||||
|
env.editor.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
var session = env.split.setSession(doc);
|
|
||||||
session.name = doc.name;
|
|
||||||
|
|
||||||
updateUIEditorOptions();
|
|
||||||
|
|
||||||
env.editor.focus();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function updateUIEditorOptions() {
|
function updateUIEditorOptions() {
|
||||||
|
|
@ -389,7 +457,7 @@ function updateUIEditorOptions() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveOption(el, val) {
|
function saveOption(el, val) {
|
||||||
if (!el.onchange || el.onclick)
|
if (!el.onchange && !el.onclick)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ("checked" in el) {
|
if ("checked" in el) {
|
||||||
|
|
@ -565,17 +633,17 @@ function bindDropdown(id, callback) {
|
||||||
onChange();
|
onChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onResize() {
|
function fillDropdown(list, el) {
|
||||||
var left = env.split.$container.offsetLeft;
|
list.forEach(function(item) {
|
||||||
var width = document.documentElement.clientWidth - left;
|
var option = document.createElement("option");
|
||||||
container.style.width = width + "px";
|
option.setAttribute("value", item.name);
|
||||||
container.style.height = document.documentElement.clientHeight + "px";
|
option.innerHTML = item.desc;
|
||||||
env.split.resize();
|
el.appendChild(option);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onresize = onResize;
|
|
||||||
env.editor.renderer.onResize(true);
|
|
||||||
|
|
||||||
|
/************** dragover ***************************/
|
||||||
event.addListener(container, "dragover", function(e) {
|
event.addListener(container, "dragover", function(e) {
|
||||||
return event.preventDefault(e);
|
return event.preventDefault(e);
|
||||||
});
|
});
|
||||||
|
|
@ -591,21 +659,12 @@ event.addListener(container, "drop", function(e) {
|
||||||
if (window.FileReader) {
|
if (window.FileReader) {
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
reader.onload = function() {
|
reader.onload = function() {
|
||||||
env.editor.getSelection().selectAll();
|
var mode = getModeFromPath(file.name);
|
||||||
|
|
||||||
var mode = modesByName.text;
|
|
||||||
for (var i = 0; i < modes.length; i++) {
|
|
||||||
if (modes[i].supportsFile(file.name)) {
|
|
||||||
mode = modes[i];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
env.editor.onTextInput(reader.result);
|
|
||||||
|
|
||||||
|
env.editor.session.doc.setValue(reader.result);
|
||||||
modeEl.value = mode.name;
|
modeEl.value = mode.name;
|
||||||
env.editor.getSession().setMode(mode.mode);
|
env.editor.session.setMode(mode.mode);
|
||||||
env.editor.getSession().modeName = mode.name;
|
env.editor.session.modeName = mode.name;
|
||||||
};
|
};
|
||||||
reader.readAsText(file);
|
reader.readAsText(file);
|
||||||
}
|
}
|
||||||
|
|
@ -613,45 +672,72 @@ event.addListener(container, "drop", function(e) {
|
||||||
return event.preventDefault(e);
|
return event.preventDefault(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* This demonstrates how you can define commands and bind shortcuts to them.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Fake-Save, works from the editor and the command line.
|
|
||||||
var commands = env.editor.commands;
|
|
||||||
|
|
||||||
commands.addCommand({
|
|
||||||
name: "save",
|
|
||||||
bindKey: {
|
|
||||||
win: "Ctrl-S",
|
|
||||||
mac: "Command-S",
|
|
||||||
sender: "editor"
|
|
||||||
},
|
|
||||||
exec: function() {
|
|
||||||
alert("Fake Save File");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Fake-Print with custom lookup-sender-match function.
|
|
||||||
commands.addCommand({
|
|
||||||
name: "print",
|
|
||||||
bindKey: {
|
|
||||||
win: "Ctrl-P",
|
|
||||||
mac: "Command-P",
|
|
||||||
sender: function(env, sender, hashId, keyString) {
|
|
||||||
if (sender == "editor") {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
alert("Sorry, can only print from the editor");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
exec: function() {
|
|
||||||
alert("Fake Print File");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// add multiple cursor support to editor
|
// add multiple cursor support to editor
|
||||||
require("ace/multi_select").MultiSelect(env.editor);
|
require("ace/multi_select").MultiSelect(env.editor);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* var Editor = require("ace/editor").Editor;
|
||||||
|
var UndoManager = require("ace/undomanager").UndoManager;
|
||||||
|
var Renderer = require("ace/virtual_renderer").VirtualRenderer;
|
||||||
|
var MultiSelect = require("ace/multi_select").MultiSelect; */
|
||||||
|
|
||||||
|
function singleLineEditor(el) {
|
||||||
|
var renderer = new Renderer(el);
|
||||||
|
renderer.scrollBar.element.style.display = "none";
|
||||||
|
renderer.scrollBar.width = 0;
|
||||||
|
renderer.content.style.height = "auto";
|
||||||
|
|
||||||
|
renderer.screenToTextCoordinates = function(x, y) {
|
||||||
|
var pos = this.pixelToScreenCoordinates(x, y);
|
||||||
|
return this.session.screenToDocumentPosition(
|
||||||
|
Math.min(this.session.getScreenLength() - 1, Math.max(pos.row, 0)),
|
||||||
|
Math.max(pos.column, 0)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
// todo size change event
|
||||||
|
renderer.$computeLayerConfig = function() {
|
||||||
|
var longestLine = this.$getLongestLine();
|
||||||
|
var firstRow = 0;
|
||||||
|
var lastRow = this.session.getLength();
|
||||||
|
var height = this.session.getScreenLength() * this.lineHeight;
|
||||||
|
|
||||||
|
this.scrollTop = 0;
|
||||||
|
var config = this.layerConfig;
|
||||||
|
config.width = longestLine;
|
||||||
|
config.padding = this.$padding;
|
||||||
|
config.firstRow = 0;
|
||||||
|
config.firstRowScreen = 0;
|
||||||
|
config.lastRow = lastRow;
|
||||||
|
config.lineHeight = this.lineHeight;
|
||||||
|
config.characterWidth = this.characterWidth;
|
||||||
|
config.minHeight = height;
|
||||||
|
config.maxHeight = height;
|
||||||
|
config.offset = 0;
|
||||||
|
config.height = height;
|
||||||
|
|
||||||
|
this.$gutterLayer.element.style.marginTop = 0 + "px";
|
||||||
|
this.content.style.marginTop = 0 + "px";
|
||||||
|
this.content.style.width = longestLine + 2 * this.$padding + "px";
|
||||||
|
this.content.style.height = height + "px";
|
||||||
|
this.scroller.style.height = height + "px";
|
||||||
|
this.container.style.height = height + "px";
|
||||||
|
};
|
||||||
|
renderer.isScrollableBy=function(){return false};
|
||||||
|
|
||||||
|
var editor = new Editor(renderer);
|
||||||
|
new MultiSelect(editor);
|
||||||
|
editor.session.setUndoManager(new UndoManager());
|
||||||
|
|
||||||
|
editor.setHighlightActiveLine(false);
|
||||||
|
editor.setShowPrintMargin(false);
|
||||||
|
editor.renderer.setShowGutter(false);
|
||||||
|
editor.renderer.setHighlightGutterLine(false);
|
||||||
|
return editor;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
|
/*PACKAGE
|
||||||
@import url(//fonts.googleapis.com/css?family=Droid+Sans+Mono);
|
@import url(//fonts.googleapis.com/css?family=Droid+Sans+Mono);
|
||||||
|
PACKAGE*/
|
||||||
|
|
||||||
html {
|
html {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
@ -26,7 +28,7 @@ body {
|
||||||
#editor {
|
#editor {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
left: 300px;
|
left: 280px;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
right: 0px;
|
right: 0px;
|
||||||
background: white;
|
background: white;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<title>Ace Kitchen Sink</title>
|
<title>Ace Kitchen Sink</title>
|
||||||
<meta name="author" content="Fabian Jakobs">
|
<meta name="author" content="Fabian Jakobs">
|
||||||
<link rel="stylesheet" href="demo/kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
|
|
||||||
<!--
|
<!--
|
||||||
|
|
||||||
Ace
|
Ace
|
||||||
|
|
@ -104,6 +103,33 @@
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td >
|
||||||
|
<label for="keybinding">Key Binding</label>
|
||||||
|
</td><td>
|
||||||
|
<select id="keybinding" size="1">
|
||||||
|
<option value="ace">Ace</option>
|
||||||
|
<option value="vim">Vim</option>
|
||||||
|
<option value="emacs">Emacs</option>
|
||||||
|
<option value="custom">Custom</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td >
|
||||||
|
<label for="soft_wrap">Soft Wrap</label>
|
||||||
|
</td><td>
|
||||||
|
<select id="soft_wrap" size="1">
|
||||||
|
<option value="off">Off</option>
|
||||||
|
<option value="40">40 Chars</option>
|
||||||
|
<option value="80">80 Chars</option>
|
||||||
|
<option value="free">Free</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr><td colspan="2">
|
||||||
|
<table id="more-controls">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<label for="select_style">Full Line Selection</label>
|
<label for="select_style">Full Line Selection</label>
|
||||||
|
|
@ -139,30 +165,6 @@
|
||||||
<input type="checkbox" name="animate_scroll" id="animate_scroll">
|
<input type="checkbox" name="animate_scroll" id="animate_scroll">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td >
|
|
||||||
<label for="keybinding">Key Binding</label>
|
|
||||||
</td><td>
|
|
||||||
<select id="keybinding" size="1">
|
|
||||||
<option value="ace">Ace</option>
|
|
||||||
<option value="vim">Vim</option>
|
|
||||||
<option value="emacs">Emacs</option>
|
|
||||||
<option value="custom">Custom</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td >
|
|
||||||
<label for="soft_wrap">Soft Wrap</label>
|
|
||||||
</td><td>
|
|
||||||
<select id="soft_wrap" size="1">
|
|
||||||
<option value="off">Off</option>
|
|
||||||
<option value="40">40 Chars</option>
|
|
||||||
<option value="80">80 Chars</option>
|
|
||||||
<option value="free">Free</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td >
|
<td >
|
||||||
<label for="show_gutter">Show Gutter</label>
|
<label for="show_gutter">Show Gutter</label>
|
||||||
|
|
@ -208,12 +210,14 @@
|
||||||
<input type="checkbox" id="fade_fold_widgets" checked>
|
<input type="checkbox" id="fade_fold_widgets" checked>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
</td></tr>
|
||||||
<div id="editor">
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="editor"></div>
|
||||||
|
|
||||||
<!-- DEVEL-->
|
<!-- DEVEL-->
|
||||||
|
<link rel="stylesheet" href="demo/kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var require = {
|
var require = {
|
||||||
baseUrl: window.location.protocol + "//" + window.location.host + window.location.pathname.split("/").slice(0, -1).join("/"),
|
baseUrl: window.location.protocol + "//" + window.location.host + window.location.pathname.split("/").slice(0, -1).join("/"),
|
||||||
|
|
@ -227,11 +231,15 @@
|
||||||
<!--DEVEL -->
|
<!--DEVEL -->
|
||||||
|
|
||||||
<!--PACKAGE
|
<!--PACKAGE
|
||||||
<script src="demo/kitchen-sink/kitchen-sink.js" data-ace-base="demo/kitchen-sink" type="text/javascript" charset="utf-8"></script>
|
<link rel="stylesheet" href="kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
|
||||||
|
<script src="src/ace.js" data-ace-base="src" type="text/javascript" charset="utf-8"></script>
|
||||||
|
<script src="src/keybinding-vim.js"></script>
|
||||||
|
<script src="src/keybinding-emacs.js"></script>
|
||||||
|
<script src="kitchen-sink/demo.js"></script>
|
||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
require("kitchen-sink/demo");
|
require("kitchen-sink/demo");
|
||||||
</script>
|
</script>
|
||||||
<!--PACKAGE-->
|
PACKAGE-->
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
"jsdom": "0.2.x",
|
"jsdom": "0.2.x",
|
||||||
"amd-loader": "~0.0.4",
|
"amd-loader": "~0.0.4",
|
||||||
"plist": "",
|
"plist": "",
|
||||||
"dryice": "0.4.2",
|
"dryice": "",
|
||||||
"panino" : "~1.0.15"
|
"panino" : "~1.0.15"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue