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:
mkdir -p build/src
mkdir -p build/textarea/src
./Makefile.dryice.js
./Makefile.dryice.textarea.js
./Makefile.dryice.js normal
./Makefile.dryice.js bm
clean:
rm -rf build

View file

@ -21,6 +21,7 @@
*
* 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
@ -36,22 +37,72 @@
*
* ***** 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 aceHome = __dirname;
console.log('# ace ---------');
var project = copy.createCommonJsProject([
var aceProject = [
aceHome + '/support/pilot/lib',
aceHome + '/lib',
aceHome + '/demo'
]);
aceHome + '/lib'
];
if (target == "normal") {
aceProject.push(aceHome + '/demo');
copy({
source: "build_support/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);
copy({
source: "build_support/editor.html",
dest: 'build/editor.html'
});
function filterTextPlugin(text) {
return text.replace(/(['"])text\!/g, "$1text/");
@ -63,7 +114,9 @@ function filterTextPlugin(text) {
var ace = copy.createDataObject();
copy({
source: [
'build_support/mini_require.js'
target == "normal"
? 'build_support/mini_require.js'
: 'build_support/mini_require_textarea.js'
],
dest: ace
});
@ -91,22 +144,164 @@ copy({
});
copy({
source: [
'build_support/boot.js'
target == "normal"
? 'build_support/boot.js'
: 'build_support/boot_textarea.js'
],
dest: ace
});
if (target == "normal") {
// Create the compressed and uncompressed output files
copy({
source: ace,
filter: [copy.filter.uglifyjs, filterTextPlugin],
dest: targetDir + '/src/ace.js'
});
copy({
source: ace,
filter: [filterTextPlugin],
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 ---------');
// Create the compressed and uncompressed output files
copy({
source: ace,
filter: [copy.filter.uglifyjs, filterTextPlugin],
dest: 'build/src/ace.js'
source: aceHome + "/LICENSE",
dest: targetDir + '/LICENSE'
});
copy({
source: ace,
filter: [filterTextPlugin],
dest: 'build/src/ace-uncompressed.js'
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 ---------');
@ -155,109 +350,6 @@ copy({
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({
// 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
* Toggle between soft tabs and real tabs
* 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!
--------------------
@ -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!
git clone git://github.com/ajaxorg/ace.git
cd ace
git submodule update --init --recursive
Embedding Ace
@ -54,30 +59,39 @@ The easiest version is simply:
With "editor" being the id of the DOM element, which should be converted to an editor. Note that this element must be explicitly sized and positioned `absolute` or `relative` for Ace to work. e.g.
#editor {
#editor {
position: absolute;
width: 500px;
height: 400px;
}
To change the theme simply include the Theme's JavaScript file
<script src="src/theme-twilight.js" type="text/javascript" charset="utf-8"></script>
and configure the editor to use the theme:
editor.setTheme("ace/theme/twilight");
By default the editor only supports plain text mode; many other languages are available as separate modules. After including the mode's JavaScript file:
<script src="src/mode-javascript.js" type="text/javascript" charset="utf-8"></script>
Then the mode can be used like this:
var JavaScriptMode = require("ace/mode/javascript").Mode;
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
-----------
@ -85,7 +99,11 @@ After the checkout Ace works out of the box. No build step is required. Open 'ed
./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
-----------
@ -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
./Makefile.dryice.js
./Makefile.dryice.js normal
The packaged Ace will be put in the 'build' folder.
To build the bookmarklet version execute
./Makefile.dryice.js bm
Running the Unit Tests
----------------------
@ -111,6 +133,14 @@ To run the tests call:
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
------------

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) {
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/command').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]) {
state = this.lines[firstRow - 1].state;
doCache = true;
} else if (firstRow == 0) {
state = "start";
doCache = true;
}
var lines = this.doc.getLines(firstRow, lastRow);
@ -11164,6 +11167,7 @@ var BackgroundTokenizer = function(tokenizer, editor) {
var state = tokens.state;
rows.push(tokens);
console.log("do cache", doCache, row, state)
if (doCache) {
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() {
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;
catalog.registerPlugins([ "pilot/index" ]);
@ -65,6 +53,9 @@ var EditSession = require("ace/edit_session").EditSession;
var UndoManager = require("ace/undomanager").UndoManager;
var Renderer = require("ace/virtual_renderer").VirtualRenderer;
var catalog = require("pilot/plugin_manager").catalog;
catalog.registerPlugins([ "pilot/index" ]);
window.__ace_shadowed__.edit = function(el) {
if (typeof(el) == "string") {
el = document.getElementById(el);
@ -373,6 +364,10 @@ function setupApi(editor, editorDiv, settingDiv, ace, options) {
case "showPrintMargin":
renderer.setShowPrintMargin(toBool(value));
break
case "showInvisibles":
editor.setShowInvisibles(toBool(value));
break;
}
options[key] = value;
@ -407,7 +402,8 @@ function setupSettingPanel(settingDiv, settingOpener, api, options) {
fontSize: "Font Size:",
softWrap: "Soft Wrap:",
showPrintMargin: "Show Print Margin:",
useSoftTabs: "Use Soft Tabs:"
useSoftTabs: "Use Soft Tabs:",
showInvisibles: "Show Invisibles"
}
var optionValues = {
@ -417,11 +413,16 @@ function setupSettingPanel(settingDiv, settingOpener, api, options) {
coffee: "CoffeeScript",
html: "HTML",
css: "CSS",
xml: "XML",
svg: "SVG",
c_cpp: "C++",
csharp: "C#",
java: "Java",
php: "PHP",
ruby: "Ruby",
python: "Python"
perl: "Perl",
python: "Python",
clojure: "Clojure"
},
theme: {
textmate: "Textmate",
@ -451,8 +452,9 @@ function setupSettingPanel(settingDiv, settingOpener, api, options) {
80: "80",
free: "Free"
},
showPrintMargin: BOOL,
useSoftTabs: BOOL
showPrintMargin: BOOL,
useSoftTabs: BOOL,
showInvisibles: BOOL
}
var table = [];
@ -511,15 +513,14 @@ function setupSettingPanel(settingDiv, settingOpener, api, options) {
// Default startup options.
window.__ace_shadowed__.options = {
mode: "text",
theme: "textmate",
gutter: "false",
fontSize: "12px",
softWrap: "off",
showPrintMargin: "false",
useSoftTabs: "true"
mode: "text",
theme: "textmate",
gutter: "false",
fontSize: "12px",
softWrap: "off",
showPrintMargin: "false",
useSoftTabs: "true",
showInvisibles: "true"
}
});
})()

View file

@ -3,37 +3,45 @@
<head>
<meta charset="UTF-8">
<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>
<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>
WARNING: Currently, this is only fully supported in non IE browsers.
</p>
<p id="first">
<strong>WARNING:</strong> Currently, this is only supported in non IE browsers.
</p>
<p>
How to use it:
<ul>
<li>Select the options below as you want them to be by default.</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>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>Click 3 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>
</ul>
</p>
<textarea id="textarea" style="width:300px; height:300px">
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>
<h2>How to use it:</h2>
<ul>
<li>Select the options 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>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>Go to a page with a textarea element and click the bookmarklet - wait a little bit till the files are loaded.</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>
</ul>
</div>
</div>
</div>
<script>
function inject() {
@ -73,8 +81,9 @@ function inject() {
load.scripts = {};
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__;
ace.options.mode = "javascript";
var Event = ace.require('pilot/event');
var areas = document.getElementsByTagName("textarea");
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]) {
state = this.lines[firstRow - 1].state;
doCache = true;
} else if (firstRow == 0) {
state = "start";
doCache = true;
}
var lines = this.doc.getLines(firstRow, lastRow);

View file

@ -18,8 +18,8 @@ Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
The Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor,
The Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
Luke Arno can be found at http://lukearno.com/
@ -49,14 +49,14 @@ class MagicError(Exception): pass
class StatusApp:
"""Used by WSGI apps to return some HTTP status."""
def __init__(self, status, message=None):
self.status = status
if message is None:
self.message = status
else:
self.message = message
def __call__(self, environ, start_response, headers=[]):
if self.message:
Headers(headers).add_header('Content-type', 'text/plain')
@ -69,9 +69,9 @@ class StatusApp:
class Cling(object):
"""A stupidly simple way to serve static content via WSGI.
Serve the file of the same path as PATH_INFO in self.datadir.
Look up the Content-type in self.content_types by extension
or use 'text/plain' if the extension is not found.
@ -173,17 +173,17 @@ def iter_and_close(file_like, block_size):
else: raise StopIteration
except StopIteration, si:
file_like.close()
return
return
def cling_wrap(package_name, dir_name, **kw):
"""Return a Cling that serves from the given package and dir_name.
This uses pkg_resources.resource_filename which is not the
recommended way, since it extracts the files.
I think this works fine unless you have some _very_ serious
requirements for static content, in which case you probably
recommended way, since it extracts the files.
I think this works fine unless you have some _very_ serious
requirements for static content, in which case you probably
shouldn't be serving it through a WSGI app, IMHO. YMMV.
"""
resource = Requirement.parse(package_name)
@ -191,7 +191,7 @@ def cling_wrap(package_name, dir_name, **kw):
def command():
parser = OptionParser(usage="%prog DIR [HOST][:][PORT]",
parser = OptionParser(usage="%prog DIR [HOST][:][PORT]",
version="static 0.3.6")
options, args = parser.parse_args()
if len(args) in (1, 2):
@ -209,7 +209,7 @@ def command():
if not host:
host = '0.0.0.0'
if not port:
port = 9999
port = 8888
try:
port = int(port)
except:
@ -230,8 +230,8 @@ def test():
from wsgiref.validate import validator
app = Cling(getcwd())
try:
print "Serving " + getcwd() + " to http://localhost:9999"
make_server('0.0.0.0', 9999, validator(app)).serve_forever()
print "Serving " + getcwd() + " to http://localhost:8888"
make_server('0.0.0.0', 8888, validator(app)).serve_forever()
except KeyboardInterrupt, ki:
print ""
print "Ciao, baby!"