Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/Makefile.conf
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Handy little Makefile

TARGET_FILE=~/workspace.xpi

-include Makefile.conf

all:
zip -r $(TARGET_FILE) * -x ".git/*" -x ".*" -x "*~" -x "*.bak" -x "*.swp" -x Makefile -x Makefile.conf -x content/ace/Makefile.workspace.js -x content/ace/ace-uncompressed.js
50 changes: 50 additions & 0 deletions content/ace/ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
2011.02.14, Version 0.1.6

* Floating Anchors
- An Anchor is a floating pointer in the document.
- Whenever text is inserted or deleted before the cursor, the position of the cursor is updated
- Usesd for the cursor and selection
- Basis for bookmarks, multiple cursors and snippets in the future
* Extensive support for Cocoa style keybindings on the Mac <https://github.com/ajaxorg/ace/issues/closed#issue/116/comment/767803>
* New commands:
- center selection in viewport
- remove to end/start of line
- split line
- transpose letters
* Refator markers
- Custom code can be used to render markers
- Markers can be in front or behind the text
- Markers are now stored in the session (was in the renderer)
* Lots of IE8 fixes including copy, cut and selections
* Unit tests can also be run in the browser <https://github.com/ajaxorg/ace/blob/master/lib/ace/test/tests.html>
* Soft wrap can adapt to the width of the editor (Mike Ratcliffe, Joe Cheng)
* Add minimal node server server.js to run the Ace demo in Chrome
* The top level editor.html demo has been renamed to index.html
* Bug fixes
- Fixed gotoLine to consider wrapped lines when calculating where to scroll to (James Allen)
- Fixed isues when the editor was scrolled in the web page (Eric Allam)
- Highlighting of Python string literals
- Syntax rule for PHP comments

2011.02.08, Version 0.1.5

* Add Coffeescript Mode (Satoshi Murakami)
* Fix word wrap bug (Julian Viereck)
* Fix packaged version of the Eclipse mode
* Loading of workers is more robust
* Fix "click selection"
* Allow tokizing empty lines (Daniel Krech)
* Make PageUp/Down behavior more consistent with native OS (Joe Cheng)

2011.02.04, Version 0.1.4

* Add C/C++ mode contributed by Gastón Kleiman
* Fix exception in key input

2011.02.04, Version 0.1.3

* Let the packaged version play nice with requireJS
* Add Ruby mode contributed by Shlomo Zalman Heigh
* Add Java mode contributed by Tom Tasche
* Fix annotation bug
* Changing a document added a new empty line at the end
476 changes: 476 additions & 0 deletions content/ace/LICENSE

Large diffs are not rendered by default.

132 changes: 132 additions & 0 deletions content/ace/Makefile.workspace.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
#!/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>
* Mihai Sucan <mihai DOT sucan AT gmail DOT 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;

console.log('# ace ---------');

var project = copy.createCommonJsProject([
aceHome + "/support/pilot/lib",
aceHome + "/lib",
]);

project.ignoreRequires = ["pilot/fixoldbrowsers"];

function filterTextPlugin(text) {
return text.replace(/(['"])text\!/g, "$1text/");
/*return text
.replace(/define\(\s*['"]text\!\)/g, "text/")
.replace(/require\(\s*['"]text\!\)/g, "text/")*/
}

var ace = copy.createDataObject();
copy({
source: [
'build_support/mini_require.js'
],
dest: ace
});
copy({
source: [
copy.source.commonjs({
project: project,
require: [
"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/mode/javascript",
"ace/virtual_renderer"
]
})
],
filter: [ copy.filter.moduleDefines ],
dest: ace
});
copy({
source: {
root: project,
include: /.*\.css$/,
exclude: /tests?\//
},
filter: [ copy.filter.addDefines ],
dest: ace
});
copy({
source: [
'build_support/boot.js'
],
dest: ace
});


// Create the compressed and uncompressed output files
copy({
source: ace,
filter: [copy.filter.uglifyjs, filterTextPlugin],
dest: 'build/ace.js'
});
copy({
source: ace,
filter: [filterTextPlugin],
dest: 'build/ace-uncompressed.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'
});

104 changes: 104 additions & 0 deletions content/ace/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
Ace (Ajax.org Cloud9 Editor)
============================

Ace is a standalone code editor written in JavaScript. Our goal is to create a web based code editor that matches and extends the features, usability and performance of existing native editors such as TextMate, Vim or Eclipse. It can be easily embedded in any web page and JavaScript application. Ace is developed as the primary editor for [Cloud9 IDE](http://www.cloud9ide.com/) and the successor of the Mozilla Skywriter (Bespin) Project.

Features
--------

* Syntax highlighting
* Auto indentation and outdent
* An optional command line
* Work with huge documents (100,000 lines and more are no problem)
* Fully customizable key bindings including VI and Emacs modes
* Themes (TextMate themes can be imported)
* Search and replace with regular expressions
* Highlight matching parentheses
* Toggle between soft tabs and real tabs
* Displays hidden characters

Take Ace for a spin!
--------------------

Check out the Ace live [demo](http://ajaxorg.github.com/ace/build/editor.html) or get a [Cloud9 IDE account](http://run.cloud9ide.com) to experience Ace while editing one of your own GitHub projects.

If you want, you can use Ace as a textarea replacement thanks to the [Ace Bookmarklet](http://ajaxorg.github.com/ace/build/textarea/editor.html).

History
-------

Previously known as “Bespin” or lately “Skywriter” it’s now known as Ace (Ajax.org Cloud9 Editor)! Bespin and Ace started as two independent projects both aiming to build a no compromise code editor component for the web. Bespin started as part of Mozilla Labs and was based on the canvas tag, while Ace is the Editor component of the Cloud9 IDE and is using the DOM for rendering. After the release of Ace at JSConf.eu 2010 in Berlin the Skywriter team decided to merge Ace with a simplified version of Skywriter's plugin system and some of Skywriter's extensibility points. All these changes have been merged back to Ace now, which supersedes Skywriter. Both Ajax.org and Mozilla are actively developing and maintaining Ace.

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). This is 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 submodule update --init --recursive

Embedding Ace
-------------

Ace can be easily embedded into any existing web page. The Ace git repository ships with a pre-packaged version of Ace inside of the `build` directory. The same packaged files are also available as a separate [download](https://github.com/ajaxorg/ace/downloads). Simply copy the contents of the `src` subdirectory somewhere into your project and take a look at the included demos of how to use Ace.

The easiest version is simply:

<div id="editor">some text</div>
<script src="src/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
window.onload = function() {
var editor = ace.edit("editor");
};
</script>

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. However all other language modes 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>

the mode can be used like this:

var JavaScriptMode = require("ace/mode/javascript").Mode;
editor.getSession().setMode(new JavaScriptMode());

Running Ace
-----------

After the checkout Ace works out of the box. No build step is required. Simply open 'editor.html' in any browser except Google Chrome. Google Chrome doesn't allow XMLHTTPRequests from files loaded from disc (i.e. with a file:/// URL). To open the Ace in Chrome simply start the bundled mini HTTP server:

./static.py

The editor can then be opened at http://localhost:9999/editor.html.

Package Ace
-----------

To package Ace we use the dryice build tool developed by the Mozilla Skywriter team. To install dryice and all its dependencies simply call:

npm link .

Afterwards Ace can by build by calling

./Makefile.dryice.js

The packaged Ace will be put in the 'build' folder.

Running the Unit Tests
----------------------

The Ace unit tests run on node.js. Before the first run a couple of node mudules have to be installed. The easiest way to do this is by using the node package manager (npm). In the Ace base directory simply call

npm link .

To run the tests call:

node lib/ace/test/all.js

Loading