Merge pull request #1196 from ajaxorg/bugfix

Bugfix
This commit is contained in:
Mostafa Eweda 2013-01-13 00:39:54 -08:00
commit 7601a904cb
12 changed files with 22 additions and 378 deletions

View file

@ -5,25 +5,18 @@ body {
font-family: Helvetica, Arial;
}
#embed_ace_wrapper {
height: 525px;
}
.ace_editor_wrapper {
#ace_editor_demo, #embedded_ace_code {
height: 275px;
position: relative;
border: 1px solid #DDD;
border-radius: 4px;
border-bottom-right-radius: 0px;
margin-top: 5px;
}
#ace_editor_demo, #embedded_ace_code {
left: 0px;
top: 0px;
bottom: 1px;
right: 1px;
background: #fff;
#embedded_ace_code {
height: 525px;
}
h1, h2, h3, h4, h5, h6 {

View file

@ -6,7 +6,10 @@
<script src="./doc/resources/ace/skeleton/javascripts/jquery.js"></script>
<script src="./doc/resources/ace/skeleton/javascripts/bbq.js"></script>
<script src="./api/resources/javascripts/bootstrap.js"></script>
<script src="https://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script>
<script src="./build/src/ace.js"></script>
<script>
ace = require("ace/ace")
</script>
<script src="https://yandex.st/highlightjs/7.2/highlight.min.js"></script>
<script src="doc/site/js/main.js"></script>
<link rel="stylesheet" href="https://yandex.st/highlightjs/7.0/styles/default.min.css">
@ -69,7 +72,7 @@
in any web page and JavaScript application. ACE is maintained as the
primary editor for <a href="http://c9.io">Cloud9 IDE</a>
and is the successor of the Mozilla Skywriter (Bespin) project.</p>
<div class="ace_editor_wrapper">
<div id="ace_editor_demo">/**
* In fact, you're looking at ACE right now. Go ahead and play with it!
*
@ -85,7 +88,6 @@ function add(x, y) {
var addResult = add(3, 2);
console.log(addResult);</div>
</div>
<p id="embed_link"><a href="#nav=embedding">Learn how to embed this in your own site</a></p>
<p class="highlight_note">Looking for a more full-featured demo? Check out the
<a href="http://ace.ajax.org/build/kitchen-sink.html" target="_blank">kitchen sink</a>.</p>
@ -142,8 +144,7 @@ console.log(addResult);</div>
<h1>Embedding ACE in Your Site</h1>
<p>ACE can be easily embedded into a web page. Just copy the code below:</p>
<div id="embed_ace_wrapper" class="ace_editor_wrapper">
<div id="embedded_ace_code">&lt;!DOCTYPE html>
<div id="embedded_ace_code">&lt;!DOCTYPE html>
&lt;html lang="en">
&lt;head>
&lt;title>ACE in Action&lt;/title>
@ -171,7 +172,7 @@ console.log(addResult);</div>
editor.getSession().setMode("ace/mode/javascript");
&lt;/script>
&lt;/body>
&lt;/html></div></div>
&lt;/html></div>
<p>Now check out the <a href="#nav=howto">How-To Guide</a> for instructions on
common operations, such as setting a different language mode or
getting the contents from the editor.</p>

View file

@ -1,8 +1,7 @@
.ace_editor {
position: absolute;
position: relative;
overflow: hidden;
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
font-size: 12px;
}
.ace_scroller {

View file

@ -9,6 +9,7 @@
border-top: 0 none;
max-width: 297px;
overflow: hidden;
margin: 0;
padding: 4px;
padding-right: 6px;
padding-bottom: 0;
@ -34,11 +35,8 @@
margin-bottom: 4px;
overflow: hidden;
}
.ace_search label {
float: left;
color: #656565;
}
.ace_search input {
.ace_search_field {
background-color: white;
border-right: 1px solid #cbcbcb;
border: 0 none;
@ -51,6 +49,7 @@
outline: 0;
padding: 0 7px;
width: 214px;
margin: 0;
}
.ace_searchbtn,
.ace_replacebtn {

View file

@ -43,12 +43,12 @@ dom.importCssString(searchboxCss, "ace_searchbox");
var html = '<div class="ace_search right">\
<button action="hide" class="ace_searchbtn_close"></button>\
<div class="ace_search_form">\
<input type="text" class="ace_search_field" placeholder="Search for" spellcheck="false">\
<input class="ace_search_field" placeholder="Search for" spellcheck="false">\
<button action="findNext" class="ace_searchbtn next"></button>\
<button action="findPrev" class="ace_searchbtn prev"></button>\
</div>\
<div class="ace_replace_form">\
<input type="text" class="ace_search_field" placeholder="Replace with" spellcheck="false">\
<input class="ace_search_field" placeholder="Replace with" spellcheck="false">\
<button action="replace" class="ace_replacebtn">Replace</button>\
<button action="replaceAll" class="ace_replacebtn">All</button>\
</div>\

View file

@ -300,10 +300,10 @@ var VirtualRenderer = function(container, theme) {
this.resizing++;
else
this.resizing = force ? 1 : 0;
if (!height)
height = dom.getInnerHeight(this.container);
if (force || size.height != height) {
if (height && (force || size.height != height)) {
size.height = height;
this.scroller.style.height = height + "px";
@ -318,7 +318,8 @@ var VirtualRenderer = function(container, theme) {
if (!width)
width = dom.getInnerWidth(this.container);
if (force || this.resizing > 1 || size.width != width) {
if (width && (force || this.resizing > 1 || size.width != width)) {
size.width = width;
var gutterWidth = this.showGutter ? this.$gutter.offsetWidth : 0;

View file

@ -1,2 +0,0 @@
/dist/
/node_modules/

View file

@ -1,63 +0,0 @@
Develop & Distribute ACE using the Sourcemint Loader
====================================================
The [Sourcemint JavaScript Loader](https://github.com/sourcemint/loader-js) is an optimized
module loader that boots sets of *statically linked* modules from *bundles*. An application may
load additional bundles by using *dynamic links*.
*Bundles* are generated from the AMD formatted source files on the fly during development (using a server helper)
and in-batch for production builds. To generate bundles the Sourcemint [RequireJS SDK](https://github.com/sourcemint/sdk-requirejs)
and [Platform NodeJS](https://github.com/sourcemint/platform-nodejs) projects are used.
Development
===========
**Requirements:**
* [NodeJS](http://nodejs.org/)
**Install:**
git clone git://github.com/ajaxorg/ace.git
cd ace
# TMP: Switch to sourcemint branch
git checkout sourcemint
cd sourcemint
npm install
**Start development server:**
node dev
**NOTE:** Modified source files are automatically reloaded on browser refresh so there is no
need to restart the server during development.
Production
==========
To generate production bundles, use the same setup as for *Development*, then run:
// NOT YET IMPLEMENTED
node build ../demo/kitchen-sink ./dist
Where `../demo/kitchen-sink` is the path to your ACE bootstrap package which embeds ACE in the page
or provides an interface for the rest of your application to interact with ACE.
Everything needed for ACE (and your bootstrap package) to run will be written to the `./dist` directory which can be
used in a production application by serving these static files via a web server. To load the bootstrap file use:
<!-- Load the Sourcemint JavaScript Loader -->
<script type="text/javascript" src="./dist/loader.min.js"></script>
<!-- Load ACE bootstrap file -->
<script type="text/javascript">
require.sandbox("./dist/kitchen-sink.js", function(sandbox) {
sandbox.main();
});
</script>
See `../demo/kitchen-sink` for an example of how to write an ACE bootstrap package.
See [Embedding Ace](https://github.com/ajaxorg/ace) and [Embedding API](https://github.com/ajaxorg/ace/wiki/Embedding---API)
for more information on how to embed and interact with ACE.

View file

@ -1,47 +0,0 @@
var PATH = require("path"),
FS = require("fs"),
CONNECT = require("connect"),
BUNDLER = require("sourcemint-platform-nodejs/lib/bundler");
exports.main = function(options) {
var server = CONNECT();
server.use(CONNECT.router(function(app) {
app.get(/^\/loader.js/, CONNECT.static(PATH.dirname(require.resolve("sourcemint-loader-js/loader.js"))));
app.get(/^(?:\/demo\/kitchen-sink)(?:\.js)?(\/.*)?$/, BUNDLER.hoist(PATH.dirname(__dirname) + "/demo/kitchen-sink", {
distributionBasePath: __dirname + "/dist",
packageIdHashSeed: "__ACE__",
bundleLoader: false,
logger: {
log: function() {
console.log.apply(null, arguments);
}
}
}));
app.get(/^\//, function(req, res)
{
CONNECT.static(__dirname)(req, res, function()
{
res.writeHead(404);
res.end("Not found!");
});
});
}));
server.listen(options.port, "127.0.0.1");
console.log("ACE development server running at http://127.0.0.1:" + options.port + "/");
}
if (require.main === module) {
// TODO: Make configurable via command-line flag.
exports.main({
port: 8888
});
}

View file

@ -1,16 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Ace Development Server</title>
</head>
<body>
<h1>Demos</h1>
<p><a href="kitchen-sink.html">Kitchen Sink</a></p>
</body>
</html>

View file

@ -1,209 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Ace Kitchen Sink</title>
<meta name="author" content="Fabian Jakobs">
<link rel="stylesheet" href="demo/kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
<!--
Ace
version %version%
commit %commit%
-->
</head>
<body>
<img id="logo" src="demo/kitchen-sink/logo.png">
<table id="controls">
<tr>
<td>
<label for="doc">Document</label>
</td><td>
<select id="doc" size="1">
</select>
</td>
</tr>
<tr>
<td >
<label for="mode">Mode</label>
</td><td>
<select id="mode" size="1">
</select>
</td>
</tr>
<tr>
<td>
<label for="split">Split</label>
</td><td>
<select id="split" size="1">
<option value="none">None</option>
<option value="below">Below</option>
<option value="beside">Beside</option>
</select>
</td>
</tr>
<tr>
<td >
<label for="theme">Theme</label>
</td><td>
<select id="theme" size="1">
<option value="ace/theme/chrome">Chrome</option>
<option value="ace/theme/clouds">Clouds</option>
<option value="ace/theme/clouds_midnight">Clouds Midnight</option>
<option value="ace/theme/cobalt">Cobalt</option>
<option value="ace/theme/crimson_editor">Crimson Editor</option>
<option value="ace/theme/dawn">Dawn</option>
<option value="ace/theme/dreamweaver">Dreamweaver</option>
<option value="ace/theme/eclipse">Eclipse</option>
<option value="ace/theme/idle_fingers">idleFingers</option>
<option value="ace/theme/kr_theme">krTheme</option>
<option value="ace/theme/merbivore">Merbivore</option>
<option value="ace/theme/merbivore_soft">Merbivore Soft</option>
<option value="ace/theme/mono_industrial">Mono Industrial</option>
<option value="ace/theme/monokai">Monokai</option>
<option value="ace/theme/pastel_on_dark">Pastel on dark</option>
<option value="ace/theme/solarized_dark">Solarized Dark</option>
<option value="ace/theme/solarized_light">Solarized Light</option>
<option value="ace/theme/textmate" selected="selected">TextMate</option>
<option value="ace/theme/twilight">Twilight</option>
<option value="ace/theme/tomorrow">Tomorrow</option>
<option value="ace/theme/tomorrow_night">Tomorrow Night</option>
<option value="ace/theme/tomorrow_night_blue">Tomorrow Night Blue</option>
<option value="ace/theme/tomorrow_night_bright">Tomorrow Night Bright</option>
<option value="ace/theme/tomorrow_night_eighties">Tomorrow Night 80s</option>
<option value="ace/theme/vibrant_ink">Vibrant Ink</option>
</select>
</td>
</tr>
<tr>
<td>
<label for="fontsize">Font Size</label>
</td><td>
<select id="fontsize" size="1">
<option value="10px">10px</option>
<option value="11px">11px</option>
<option value="12px" selected="selected">12px</option>
<option value="14px">14px</option>
<option value="16px">16px</option>
<option value="20px">20px</option>
<option value="24px">24px</option>
</select>
</td>
</tr>
<tr>
<td>
<label for="folding">Code Folding</label>
</td><td>
<select id="folding" size="1">
<option value="manual">manual</option>
<option value="markbegin" selected="selected">mark begin</option>
<option value="markbeginend">mark begin and end</option>
</select>
</td>
</tr>
<tr>
<td>
<label for="select_style">Full Line Selection</label>
</td><td>
<input type="checkbox" name="select_style" id="select_style" checked>
</td>
</tr>
<tr>
<td>
<label for="highlight_active">Highlight Active Line</label>
</td><td>
<input type="checkbox" name="highlight_active" id="highlight_active" checked>
</td>
</tr>
<tr>
<td >
<label for="show_hidden">Show Invisibles</label>
</td><td>
<input type="checkbox" name="show_hidden" id="show_hidden" checked>
</td>
</tr>
<tr>
<td >
<label for="show_hscroll">Persistent HScroll</label>
</td><td>
<input type="checkbox" name="show_hscroll" id="show_hscroll">
</td>
</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 >
<label for="show_gutter">Show Gutter</label>
</td><td>
<input type="checkbox" id="show_gutter" checked>
</td>
</tr>
<tr>
<td >
<label for="show_print_margin">Show Print Margin</label>
</td><td>
<input type="checkbox" id="show_print_margin" checked>
</td>
</tr>
<tr>
<td >
<label for="soft_tab">Use Soft Tab</label>
</td><td>
<input type="checkbox" id="soft_tab" checked>
</td>
</tr>
<tr>
<td >
<label for="highlight_selected_word">Highlight selected word</label>
</td>
<td>
<input type="checkbox" id="highlight_selected_word" checked>
</td>
</tr>
<tr>
<td >
<label for="enable_behaviours">Enable Behaviours</label>
</td>
<td>
<input type="checkbox" id="enable_behaviours">
</td>
</tr>
</table>
<div id="editor">
</div>
<script src="loader.js" type="text/javascript"></script>
<script type="text/javascript">
require.sandbox("demo/kitchen-sink.js", function(sandbox) {
sandbox.main();
});
</script>
</body>
</html>

View file

@ -1,12 +0,0 @@
{
"name": "ajaxorg-ace-sourcemint",
"version": "0.1.0",
"engines": {
"node": "0.x"
},
"dependencies": {
"connect": "1.x",
"sourcemint-platform-nodejs": "0.x",
"sourcemint-loader-js": "0.x"
}
}