Merge remote branch 'upstream/master'

This commit is contained in:
c-spencer 2011-05-23 10:50:21 +01:00
commit 53fb2a3562
14 changed files with 574 additions and 388 deletions

View file

@ -1,8 +1,8 @@
build: build:
mkdir -p build/src mkdir -p build/src
mkdir -p build/textarea/src mkdir -p build/textarea/src
./Makefile.dryice.js ./Makefile.dryice.js normal
./Makefile.dryice.textarea.js ./Makefile.dryice.js bm
clean: clean:
rm -rf build rm -rf build

View file

@ -21,6 +21,7 @@
* *
* Contributor(s): * Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org> * Fabian Jakobs <fabian AT ajax DOT org>
* Julian Viereck <julian.viereck@gmail.com>
* *
* Alternatively, the contents of this file may be used under the terms of * Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or * either the GNU General Public License Version 2 or later (the "GPL"), or
@ -36,22 +37,72 @@
* *
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
var args = process.argv;
var target = null;
var targetDir = null;
if (args.length == 3) {
target = args[2];
// Check if 'target' contains some allowed value.
if (target != "normal" && target != "bm") {
target = null;
}
}
if (!target) {
console.log("--- Ace Dryice Build Tool ---");
console.log("");
console.log("Options:");
console.log(" normal Runs embedded build of Ace");
console.log(" bm Runs bookmarklet build of Ace");
process.exit(0);
} else {
if (target == "normal") {
targetDir = "build";
} else {
targetDir = "build/textarea";
function shadow(input) {
if (typeof input !== 'string') {
input = input.toString();
}
return input.replace(/define\(/g, "__ace_shadowed__.define(");
}
}
}
console.log("using targetDir '", targetDir, "'");
var copy = require('dryice').copy; var copy = require('dryice').copy;
var aceHome = __dirname; var aceHome = __dirname;
console.log('# ace ---------'); console.log('# ace ---------');
var project = copy.createCommonJsProject([ var aceProject = [
aceHome + '/support/pilot/lib', aceHome + '/support/pilot/lib',
aceHome + '/lib', aceHome + '/lib'
aceHome + '/demo' ];
]);
copy({ if (target == "normal") {
aceProject.push(aceHome + '/demo');
copy({
source: "build_support/editor.html", source: "build_support/editor.html",
dest: 'build/editor.html' dest: targetDir + '/editor.html'
}); });
} else if(target == "bm") {
copy({
source: "build_support/editor_textarea.html",
dest: targetDir + '/editor.html'
});
copy({
source: "build_support/style.css",
dest: targetDir + '/style.css'
});
}
var project = copy.createCommonJsProject(aceProject);
function filterTextPlugin(text) { function filterTextPlugin(text) {
return text.replace(/(['"])text\!/g, "$1text/"); return text.replace(/(['"])text\!/g, "$1text/");
@ -63,7 +114,9 @@ function filterTextPlugin(text) {
var ace = copy.createDataObject(); var ace = copy.createDataObject();
copy({ copy({
source: [ source: [
'build_support/mini_require.js' target == "normal"
? 'build_support/mini_require.js'
: 'build_support/mini_require_textarea.js'
], ],
dest: ace dest: ace
}); });
@ -91,22 +144,164 @@ copy({
}); });
copy({ copy({
source: [ source: [
'build_support/boot.js' target == "normal"
? 'build_support/boot.js'
: 'build_support/boot_textarea.js'
], ],
dest: ace dest: ace
}); });
if (target == "normal") {
// Create the compressed and uncompressed output files // Create the compressed and uncompressed output files
copy({ copy({
source: ace, source: ace,
filter: [copy.filter.uglifyjs, filterTextPlugin], filter: [copy.filter.uglifyjs, filterTextPlugin],
dest: 'build/src/ace.js' dest: targetDir + '/src/ace.js'
}); });
copy({ copy({
source: ace, source: ace,
filter: [filterTextPlugin], filter: [filterTextPlugin],
dest: 'build/src/ace-uncompressed.js' dest: targetDir + '/src/ace-uncompressed.js'
});
} else if (target == "bm") {
copy({
source: ace,
filter: [
shadow,
copy.filter.uglifyjs
],
dest: targetDir + '/src/ace.js'
});
copy({
source: ace,
filter: [
shadow
],
dest: targetDir + '/src/ace-uncompressed.js'
});
}
var modeThemeFilters;
if (target == "normal") {
modeThemeFilters = [
copy.filter.moduleDefines,
copy.filter.uglifyjs,
filterTextPlugin
];
} else if (target == "bm") {
modeThemeFilters = [
copy.filter.moduleDefines,
shadow,
copy.filter.uglifyjs
]
}
console.log('# ace modes ---------');
project.assumeAllFilesLoaded();
[
"css", "html", "javascript", "php", "python", "xml", "ruby", "java", "c_cpp",
"coffee", "perl", "csharp", "svg", "clojure"
].forEach(function(mode) {
console.log("mode " + mode);
copy({
source: [
copy.source.commonjs({
project: project.clone(),
require: [ 'ace/mode/' + mode ]
})
],
filter: modeThemeFilters,
dest: targetDir + "/src/mode-" + mode + ".js"
});
});
console.log('# ace themes ---------');
[
"clouds", "clouds_midnight", "cobalt", "dawn", "idle_fingers", "kr_theme",
"mono_industrial", "monokai", "pastel_on_dark", "twilight", "eclipse",
"merbivore", "merbivore_soft", "vibrant_ink"
].forEach(function(theme) {
copy({
source: [{
root: aceHome + '/lib',
include: "ace/theme/" + theme + ".js"
}],
filter: modeThemeFilters,
dest: targetDir + "/src/theme-" + theme + ".js"
});
});
console.log('# ace License | Readme | Changelog ---------');
copy({
source: aceHome + "/LICENSE",
dest: targetDir + '/LICENSE'
});
copy({
source: aceHome + "/Readme.md",
dest: targetDir + '/Readme.md'
});
copy({
source: aceHome + "/ChangeLog.txt",
dest: targetDir + '/ChangeLog.txt'
});
// For the bookmarklet build, we are done.
if (target == "bm") {
process.exit(0);
}
console.log('# ace worker ---------');
["javascript", "coffee"].forEach(function(mode) {
console.log("worker for " + mode + " mode");
var worker = copy.createDataObject();
var workerProject = copy.createCommonJsProject([
aceHome + '/support/pilot/lib',
aceHome + '/lib'
]);
copy({
source: [
copy.source.commonjs({
project: workerProject,
require: [
'pilot/fixoldbrowsers',
'pilot/event_emitter',
'pilot/oop',
'ace/mode/' + mode + '_worker'
]
})
],
filter: [ copy.filter.moduleDefines],
dest: worker
});
copy({
source: [
aceHome + "/lib/ace/worker/worker.js",
worker
],
filter: [ copy.filter.uglifyjs, filterTextPlugin ],
dest: "build/src/worker-" + mode + ".js"
});
});
console.log('# ace key bindings ---------');
// copy key bindings
project.assumeAllFilesLoaded();
["vim", "emacs"].forEach(function(keybinding) {
copy({
source: [
copy.source.commonjs({
project: project.clone(),
require: [ 'ace/keyboard/keybinding/' + keybinding ]
})
],
filter: [ copy.filter.moduleDefines, copy.filter.uglifyjs, filterTextPlugin ],
dest: "build/src/keybinding-" + keybinding + ".js"
});
}); });
console.log('# cockpit ---------'); console.log('# cockpit ---------');
@ -155,109 +350,6 @@ copy({
dest: 'build/src/cockpit-uncompressed.js' dest: 'build/src/cockpit-uncompressed.js'
}); });
console.log('# ace modes ---------');
project.assumeAllFilesLoaded();
[
"css", "html", "javascript", "php", "python", "xml", "ruby", "java", "c_cpp",
"coffee", "perl", "csharp", "svg", "clojure"
].forEach(function(mode) {
console.log("mode " + mode);
copy({
source: [
copy.source.commonjs({
project: project.clone(),
require: [ 'ace/mode/' + mode ]
})
],
filter: [ copy.filter.debug, copy.filter.moduleDefines, copy.filter.uglifyjs, filterTextPlugin ],
dest: "build/src/mode-" + mode + ".js"
});
});
console.log('# worker ---------');
["javascript", "coffee"].forEach(function(mode) {
console.log("worker for " + mode + " mode");
var worker = copy.createDataObject();
var workerProject = copy.createCommonJsProject([
aceHome + '/support/pilot/lib',
aceHome + '/lib'
]);
copy({
source: [
copy.source.commonjs({
project: workerProject,
require: [
'pilot/fixoldbrowsers',
'pilot/event_emitter',
'pilot/oop',
'ace/mode/' + mode + '_worker'
]
})
],
filter: [ copy.filter.moduleDefines],
dest: worker
});
copy({
source: [
aceHome + "/lib/ace/worker/worker.js",
worker
],
filter: [ copy.filter.uglifyjs, filterTextPlugin ],
dest: "build/src/worker-" + mode + ".js"
});
});
console.log('# ace themes ---------');
[
"clouds", "clouds_midnight", "cobalt", "dawn", "idle_fingers", "kr_theme",
"mono_industrial", "monokai", "pastel_on_dark", "twilight", "eclipse",
"merbivore", "merbivore_soft", "vibrant_ink"
].forEach(function(theme) {
copy({
source: [{
root: aceHome + '/lib',
include: "ace/theme/" + theme + ".js"
}],
filter: [ copy.filter.moduleDefines, copy.filter.uglifyjs, filterTextPlugin ],
dest: "build/src/theme-" + theme + ".js"
});
});
// copy key bindings
project.assumeAllFilesLoaded();
["vim", "emacs"].forEach(function(keybinding) {
copy({
source: [
copy.source.commonjs({
project: project.clone(),
require: [ 'ace/keyboard/keybinding/' + keybinding ]
})
],
filter: [ copy.filter.moduleDefines, copy.filter.uglifyjs, filterTextPlugin ],
dest: "build/src/keybinding-" + keybinding + ".js"
});
});
console.log('# License | Readme | Changelog ---------');
copy({
source: aceHome + "/LICENSE",
dest: 'build/LICENSE'
});
copy({
source: aceHome + "/Readme.md",
dest: 'build/Readme.md'
});
copy({
source: aceHome + "/ChangeLog.txt",
dest: 'build/ChangeLog.txt'
});
// copy complex demo // copy complex demo
//copy({ //copy({
// source: aceHome + "/editor.html", // source: aceHome + "/editor.html",

View file

@ -1,183 +0,0 @@
#!/usr/bin/env node
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
* Julian Viereck <julian.viereck@gmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
var copy = require('dryice').copy;
var aceHome = __dirname;
function shadow(input) {
if (typeof input !== 'string') {
input = input.toString();
}
return input.replace(/define\(/g, "__ace_shadowed__.define(");
}
console.log('# ace ---------');
var project = copy.createCommonJsProject([
aceHome + '/support/pilot/lib',
aceHome + '/lib'
]);
copy({
source: "build_support/editor_textarea.html",
dest: 'build/textarea/editor.html'
});
var ace = copy.createDataObject();
copy({
source: [
'build_support/mini_require_textarea.js'
],
dest: ace
});
copy({
source: [
copy.source.commonjs({
project: project,
require: [
"pilot/fixoldbrowsers",
"pilot/index",
"pilot/plugin_manager",
"pilot/environment",
"ace/editor",
"ace/edit_session",
"ace/undomanager",
"ace/theme/textmate",
"ace/mode/text",
"ace/mode/matching_brace_outdent",
"ace/virtual_renderer"
]
})
],
filter: [ copy.filter.moduleDefines ],
dest: ace
});
copy({
source: {
root: project,
include: /.*\.css$|.*\.html$/,
exclude: /tests?\//
},
filter: [ copy.filter.addDefines ],
dest: ace
});
copy({
source: {
root: project,
include: /.*\.png$|.*\.gif$/,
exclude: /tests?\//
},
filter: [ copy.filter.base64 ],
dest: ace
});
copy({
source: [
'build_support/boot_textarea.js'
],
dest: ace
});
// Create the compressed and uncompressed output files
copy({
source: ace,
filter: [
shadow,
copy.filter.uglifyjs
],
dest: 'build/textarea/src/ace.js'
});
copy({
source: ace,
filter: [
shadow
],
dest: 'build/textarea/src/ace-uncompressed.js'
});
console.log('# ace modes ---------');
// create modes
project.assumeAllFilesLoaded();
[
"css", "html", "javascript", "php", "python", "xml", "ruby", "java", "c_cpp",
"coffee", "perl", "svg"
].forEach(function(mode) {
console.log("mode " + mode);
copy({
source: [
copy.source.commonjs({
project: project.clone(),
require: [ 'ace/mode/' + mode ]
})
],
filter: [
copy.filter.moduleDefines,
shadow,
copy.filter.uglifyjs
],
dest: "build/textarea/src/mode-" + mode + ".js"
});
});
console.log('# ace themes ---------');
// create themes
[
"clouds", "clouds_midnight", "cobalt", "dawn", "idle_fingers", "kr_theme",
"mono_industrial", "monokai", "pastel_on_dark", "twilight", "eclipse",
"merbivore", "merbivore_soft", "vibrant_ink"
].forEach(function(theme) {
console.log("theme " + theme);
copy({
source: [{
root: aceHome + '/lib',
include: "ace/theme/" + theme + ".js"
}],
filter: [
copy.filter.moduleDefines,
shadow,
copy.filter.uglifyjs
],
dest: "build/textarea/src/theme-" + theme + ".js"
});
});
console.log('# License | Readme | Changelog ---------');

View file

@ -16,6 +16,10 @@ Features
* Highlight matching parentheses * Highlight matching parentheses
* Toggle between soft tabs and real tabs * Toggle between soft tabs and real tabs
* Displays hidden characters * Displays hidden characters
* Drap and drop text using the mouse
* Line wrapping
* Unstructured / user code folding
* Live syntax checker (currently JavaScript/CoffeeScript)
Take Ace for a spin! Take Ace for a spin!
-------------------- --------------------
@ -35,6 +39,7 @@ Getting the code
Ace is a community project. We actively encourage and support contributions. The Ace source code is hosted on GitHub. It is released under the Mozilla tri-license (MPL/GPL/LGPL), the same license used by Firefox. This license is friendly to all kinds of projects, whether open source or not. Take charge of your editor and add your favorite language highlighting and keybindings! Ace is a community project. We actively encourage and support contributions. The Ace source code is hosted on GitHub. It is released under the Mozilla tri-license (MPL/GPL/LGPL), the same license used by Firefox. This license is friendly to all kinds of projects, whether open source or not. Take charge of your editor and add your favorite language highlighting and keybindings!
git clone git://github.com/ajaxorg/ace.git git clone git://github.com/ajaxorg/ace.git
cd ace
git submodule update --init --recursive git submodule update --init --recursive
Embedding Ace Embedding Ace
@ -78,6 +83,15 @@ Then the mode can be used like this:
var JavaScriptMode = require("ace/mode/javascript").Mode; var JavaScriptMode = require("ace/mode/javascript").Mode;
editor.getSession().setMode(new JavaScriptMode()); editor.getSession().setMode(new JavaScriptMode());
Documentation
-------------
You find a lot more sample code in the [demo app](https://github.com/ajaxorg/ace/blob/master/demo/demo.js).
There is also some documentation on the [wiki page](https://github.com/ajaxorg/ace/wiki).
If you still need help, feel free to drop a mail on the [ace mailing list](http://groups.google.com/group/ace-discuss).
Running Ace Running Ace
----------- -----------
@ -85,7 +99,11 @@ After the checkout Ace works out of the box. No build step is required. Open 'ed
./static.py ./static.py
The editor can then be opened at http://localhost:9999/editor.html. Or using Node.JS
./static.js
The editor can then be opened at http://localhost:8888/index.html.
Package Ace Package Ace
----------- -----------
@ -96,10 +114,14 @@ To package Ace we use the dryice build tool developed by the Mozilla Skywriter t
Afterwards Ace can be built by calling Afterwards Ace can be built by calling
./Makefile.dryice.js ./Makefile.dryice.js normal
The packaged Ace will be put in the 'build' folder. The packaged Ace will be put in the 'build' folder.
To build the bookmarklet version execute
./Makefile.dryice.js bm
Running the Unit Tests Running the Unit Tests
---------------------- ----------------------
@ -111,6 +133,14 @@ To run the tests call:
node lib/ace/test/all.js node lib/ace/test/all.js
You can also run the tests in your browser by serving:
http://localhost:8888/lib/ace/test/tests.html
This makes debugging failing tests way more easier.
_Note_: Currently (2011-05-21) the tests seem to run on Chrome only.
Contributing Contributing
------------ ------------

View file

@ -1067,9 +1067,9 @@ define('ace/ace', ['require', 'exports', 'module' , 'pilot/index', 'pilot/plugin
define('pilot/index', ['require', 'exports', 'module' , 'pilot/fixoldbrowsers', 'pilot/types/basic', 'pilot/types/command', 'pilot/types/settings', 'pilot/commands/settings', 'pilot/commands/basic', 'pilot/settings/canon', 'pilot/canon'], function(require, exports, module) { define('pilot/index', ['require', 'exports', 'module' , 'pilot/fixoldbrowsers', 'pilot/types/basic', 'pilot/types/command', 'pilot/types/settings', 'pilot/commands/settings', 'pilot/commands/basic', 'pilot/settings/canon', 'pilot/canon'], function(require, exports, module) {
exports.startup = function(data, reason) { require('pilot/fixoldbrowsers');
require('pilot/fixoldbrowsers');
exports.startup = function(data, reason) {
require('pilot/types/basic').startup(data, reason); require('pilot/types/basic').startup(data, reason);
require('pilot/types/command').startup(data, reason); require('pilot/types/command').startup(data, reason);
require('pilot/types/settings').startup(data, reason); require('pilot/types/settings').startup(data, reason);
@ -11155,6 +11155,9 @@ var BackgroundTokenizer = function(tokenizer, editor) {
if (firstRow > 0 && this.lines[firstRow - 1]) { if (firstRow > 0 && this.lines[firstRow - 1]) {
state = this.lines[firstRow - 1].state; state = this.lines[firstRow - 1].state;
doCache = true; doCache = true;
} else if (firstRow == 0) {
state = "start";
doCache = true;
} }
var lines = this.doc.getLines(firstRow, lastRow); var lines = this.doc.getLines(firstRow, lastRow);
@ -11164,6 +11167,7 @@ var BackgroundTokenizer = function(tokenizer, editor) {
var state = tokens.state; var state = tokens.state;
rows.push(tokens); rows.push(tokens);
console.log("do cache", doCache, row, state)
if (doCache) { if (doCache) {
this.lines[row] = tokens; this.lines[row] = tokens;
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -39,20 +39,8 @@
(function() { (function() {
var require = window.__ace_shadowed__.require; var require = window.__ace_shadowed__.require;
var deps = [
"pilot/fixoldbrowsers",
"pilot/index",
"pilot/plugin_manager",
"pilot/environment",
"ace/editor",
"ace/edit_session",
"ace/virtual_renderer",
"ace/undomanager",
"ace/theme/textmate"
];
require(deps, function() {
require("pilot/index");
var catalog = require("pilot/plugin_manager").catalog; var catalog = require("pilot/plugin_manager").catalog;
catalog.registerPlugins([ "pilot/index" ]); catalog.registerPlugins([ "pilot/index" ]);
@ -65,6 +53,9 @@ var EditSession = require("ace/edit_session").EditSession;
var UndoManager = require("ace/undomanager").UndoManager; var UndoManager = require("ace/undomanager").UndoManager;
var Renderer = require("ace/virtual_renderer").VirtualRenderer; var Renderer = require("ace/virtual_renderer").VirtualRenderer;
var catalog = require("pilot/plugin_manager").catalog;
catalog.registerPlugins([ "pilot/index" ]);
window.__ace_shadowed__.edit = function(el) { window.__ace_shadowed__.edit = function(el) {
if (typeof(el) == "string") { if (typeof(el) == "string") {
el = document.getElementById(el); el = document.getElementById(el);
@ -373,6 +364,10 @@ function setupApi(editor, editorDiv, settingDiv, ace, options) {
case "showPrintMargin": case "showPrintMargin":
renderer.setShowPrintMargin(toBool(value)); renderer.setShowPrintMargin(toBool(value));
break break
case "showInvisibles":
editor.setShowInvisibles(toBool(value));
break;
} }
options[key] = value; options[key] = value;
@ -407,7 +402,8 @@ function setupSettingPanel(settingDiv, settingOpener, api, options) {
fontSize: "Font Size:", fontSize: "Font Size:",
softWrap: "Soft Wrap:", softWrap: "Soft Wrap:",
showPrintMargin: "Show Print Margin:", showPrintMargin: "Show Print Margin:",
useSoftTabs: "Use Soft Tabs:" useSoftTabs: "Use Soft Tabs:",
showInvisibles: "Show Invisibles"
} }
var optionValues = { var optionValues = {
@ -417,11 +413,16 @@ function setupSettingPanel(settingDiv, settingOpener, api, options) {
coffee: "CoffeeScript", coffee: "CoffeeScript",
html: "HTML", html: "HTML",
css: "CSS", css: "CSS",
xml: "XML",
svg: "SVG",
c_cpp: "C++", c_cpp: "C++",
csharp: "C#",
java: "Java",
php: "PHP", php: "PHP",
ruby: "Ruby", ruby: "Ruby",
python: "Python" perl: "Perl",
python: "Python",
clojure: "Clojure"
}, },
theme: { theme: {
textmate: "Textmate", textmate: "Textmate",
@ -452,7 +453,8 @@ function setupSettingPanel(settingDiv, settingOpener, api, options) {
free: "Free" free: "Free"
}, },
showPrintMargin: BOOL, showPrintMargin: BOOL,
useSoftTabs: BOOL useSoftTabs: BOOL,
showInvisibles: BOOL
} }
var table = []; var table = [];
@ -517,9 +519,8 @@ window.__ace_shadowed__.options = {
fontSize: "12px", fontSize: "12px",
softWrap: "off", softWrap: "off",
showPrintMargin: "false", showPrintMargin: "false",
useSoftTabs: "true" useSoftTabs: "true",
showInvisibles: "true"
} }
});
})() })()

View file

@ -3,37 +3,45 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Editor</title> <link href="style.css" rel="stylesheet" type="text/css">
<title>Ace Bookmarklet Builder</title>
</head> </head>
<body> <body>
<h1>Ace Bookmarklet Builder</h1> <div id="wrapper">
<div class="content" style="width: 950px">
<div class="column1" style="margin-top: 47px">
<textarea id="textarea" style="width:300px; height:300px">
/**
* This is Ace injected using a bookmarklet.
*/
function foo() {
var bar = true;
}</textarea><br>
SourceUrl: <br>
<input id="srcURL" style="width:300px" value="http://ajaxorg.github.com/ace/build/textarea/src/"></input><br>
<button id="buBuild">Build Link</button> <br> <a href="#"></a>
</div>
<div class="column2">
<h1>Ace Bookmarklet Builder</h1>
<p> <p id="first">
WARNING: Currently, this is only fully supported in non IE browsers. <strong>WARNING:</strong> Currently, this is only supported in non IE browsers.
</p> </p>
<p> <h2>How to use it:</h2>
How to use it: <ul>
<ul> <li>Select the options as you want them to be by default.</li>
<li>Select the options below as you want them to be by default.</li> <li>Enter the "SourceUrl". This has to be the URL pointing to build/textarea/src/ (you can leave the default to server the scripts from GitHub).</li>
<li>Enter the "SourceUrl" where you placed the source data which you find under build/textarea/src (you can also leave the default to server the scripts from GitHub).</li>
<li>Click the "Build Link" button to generate your custom Ace Bookmarklet.</li> <li>Click the "Build Link" button to generate your custom Ace Bookmarklet.</li>
<li>Drag the generated link to your toolbar or store it somewhere else.</li> <li>Drag the generated link to your toolbar or store it somewhere else.</li>
<li>Go to a page with an textarea element and click the bookmarklet - wait a little bit till the files are loaded.</li> <li>Go to a page with a textarea element and click the bookmarklet - wait a little bit till the files are loaded.</li>
<li>Click 3 times on the textarea you want to replace - Ace will replace it.</li> <li>Click three times on the textarea you want to replace - Ace will replace it.</li>
<li>To change settings, just click the red icon in the bottom right corner.</li> <li>To change settings, just click the red icon in the bottom right corner.</li>
</ul> </ul>
</p> </div>
</div>
<textarea id="textarea" style="width:300px; height:300px"> </div>
function foo() {
var bar = true;
}
</textarea><br>
SourceUrl: <input id="srcURL" value="http://ajaxorg.github.com/ace/build/textarea/src/"></input>
<button id="buBuild">Build Link</button> <br> <a href="#"></a>
<script> <script>
function inject() { function inject() {
@ -73,8 +81,9 @@ function inject() {
load.scripts = {}; load.scripts = {};
window.__ace_shadowed_load__ = load; window.__ace_shadowed_load__ = load;
load('ace.js', 'text!ace/css/editor.css', function() { load('ace-uncompressed.js', 'text!ace/css/editor.css', function() {
var ace = window.__ace_shadowed__; var ace = window.__ace_shadowed__;
ace.options.mode = "javascript";
var Event = ace.require('pilot/event'); var Event = ace.require('pilot/event');
var areas = document.getElementsByTagName("textarea"); var areas = document.getElementsByTagName("textarea");
for (var i = 0; i < areas.length; i++) { for (var i = 0; i < areas.length; i++) {

230
build_support/style.css Normal file
View file

@ -0,0 +1,230 @@
body {
margin:0;
padding:0;
background-color:#e6f5fc;
}
H2, H3, H4 {
font-family:Trebuchet MS;
font-weight:bold;
margin:0;
padding:0;
}
H2 {
font-size:28px;
color:#263842;
padding-bottom:6px;
}
H3 {
font-family:Trebuchet MS;
font-weight:bold;
font-size:22px;
color:#253741;
margin-top:43px;
margin-bottom:8px;
}
H4 {
font-family:Trebuchet MS;
font-weight:bold;
font-size:21px;
color:#222222;
margin-bottom:4px;
}
P {
padding:13px 0;
margin:0;
line-height:22px;
}
UL{
line-height : 22px;
}
PRE{
background : #333;
color : white;
padding : 10px;
}
#header {
height : 227px;
position:relative;
overflow:hidden;
background: url(images/background.png) repeat-x 0 0;
border-bottom:1px solid #c9e8fa;
}
#header .content .signature {
font-family:Trebuchet MS;
font-size:11px;
color:#ebe4d6;
position:absolute;
bottom:5px;
right:42px;
letter-spacing : 1px;
}
.content {
width:970px;
position:relative;
overflow:hidden;
margin:0 auto;
}
#header .content {
height:184px;
margin-top:22px;
}
#header .content .logo {
width : 282px;
height : 184px;
background:url(images/logo.png) no-repeat 0 0;
position:absolute;
top:0;
left:0;
}
#header .content .title {
width : 605px;
height : 58px;
background:url(images/ace.png) no-repeat 0 0;
position:absolute;
top:98px;
left:329px;
}
#wrapper {
background:url(images/body_background.png) repeat-x 0 0;
min-height:250px;
}
#wrapper .content {
font-family:Arial;
font-size:14px;
color:#222222;
width:1000px;
}
#wrapper .content .column1 {
position:relative;
overflow:hidden;
float:left;
width:315px;
margin-right:31px;
}
#wrapper .content .column2 {
position:relative;
overflow:hidden;
float:left;
width:600px;
padding-top:47px;
}
.fork_on_github {
width:310px;
height:80px;
background:url(images/fork_on_github.png) no-repeat 0 0;
position:relative;
overflow:hidden;
margin-top:49px;
cursor:pointer;
}
.fork_on_github:hover {
background-position:0 -80px;
}
.divider {
height:3px;
background-color:#bedaea;
margin-bottom:3px;
}
.menu {
padding:23px 0 0 24px;
}
UL.content-list {
padding:15px;
margin:0;
}
UL.menu-list {
padding:0;
margin:0 0 20px 0;
list-style-type:none;
line-height : 16px;
}
UL.menu-list LI {
color:#2557b4;
font-family:Trebuchet MS;
font-size:14px;
padding:7px 0;
border-bottom:1px dotted #d6e2e7;
}
UL.menu-list LI:last-child {
border-bottom:0;
}
A {
color:#2557b4;
text-decoration:none;
}
A:hover {
text-decoration:underline;
}
P#first{
background : rgba(255,255,255,0.5);
padding : 20px;
font-size : 16px;
line-height : 24px;
margin : 0 0 20px 0;
}
#footer {
height:40px;
position:relative;
overflow:hidden;
background:url(images/bottombar.png) repeat-x 0 0;
position:relative;
margin-top:40px;
}
UL.menu-footer {
padding:0;
margin:8px 11px 0 0;
list-style-type:none;
float:right;
}
UL.menu-footer LI {
color:white;
font-family:Arial;
font-size:12px;
display:inline-block;
margin:0 1px;
}
UL.menu-footer LI A {
color:#8dd0ff;
text-decoration:none;
}
UL.menu-footer LI A:hover {
text-decoration:underline;
}

View file

@ -141,6 +141,9 @@ var BackgroundTokenizer = function(tokenizer, editor) {
if (firstRow > 0 && this.lines[firstRow - 1]) { if (firstRow > 0 && this.lines[firstRow - 1]) {
state = this.lines[firstRow - 1].state; state = this.lines[firstRow - 1].state;
doCache = true; doCache = true;
} else if (firstRow == 0) {
state = "start";
doCache = true;
} }
var lines = this.doc.getLines(firstRow, lastRow); var lines = this.doc.getLines(firstRow, lastRow);

View file

@ -209,7 +209,7 @@ def command():
if not host: if not host:
host = '0.0.0.0' host = '0.0.0.0'
if not port: if not port:
port = 9999 port = 8888
try: try:
port = int(port) port = int(port)
except: except:
@ -230,8 +230,8 @@ def test():
from wsgiref.validate import validator from wsgiref.validate import validator
app = Cling(getcwd()) app = Cling(getcwd())
try: try:
print "Serving " + getcwd() + " to http://localhost:9999" print "Serving " + getcwd() + " to http://localhost:8888"
make_server('0.0.0.0', 9999, validator(app)).serve_forever() make_server('0.0.0.0', 8888, validator(app)).serve_forever()
except KeyboardInterrupt, ki: except KeyboardInterrupt, ki:
print "" print ""
print "Ciao, baby!" print "Ciao, baby!"