From f78fbc6e3656bdf84cdf526d9f75ebdc89ceab6d Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 10 Jan 2013 13:36:21 +0400 Subject: [PATCH 1/5] do not set font size on editor, to not create weird combinations of inherited line height and own font size --- lib/ace/css/editor.css | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/ace/css/editor.css b/lib/ace/css/editor.css index 73702bdf..934b6905 100644 --- a/lib/ace/css/editor.css +++ b/lib/ace/css/editor.css @@ -2,7 +2,6 @@ position: absolute; overflow: hidden; font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; - font-size: 12px; } .ace_scroller { From 19c3031abf2ff02d0ebf05ee587792180991fd19 Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 10 Jan 2013 13:39:34 +0400 Subject: [PATCH 2/5] change default editor position to relative --- lib/ace/css/editor.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/css/editor.css b/lib/ace/css/editor.css index 934b6905..c4b40a4f 100644 --- a/lib/ace/css/editor.css +++ b/lib/ace/css/editor.css @@ -1,5 +1,5 @@ .ace_editor { - position: absolute; + position: relative; overflow: hidden; font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; } From be642d2a6f71b5944a2ad09db5e081c6732634a3 Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 10 Jan 2013 21:54:59 +0400 Subject: [PATCH 3/5] do not set editor size to 0 when it is hidden --- lib/ace/virtual_renderer.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index 8f169def..24d4bd06 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -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; From 6d7f6de6df6264d123611309738a53080d19f4e6 Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 10 Jan 2013 15:58:49 +0400 Subject: [PATCH 4/5] fix site --- doc/site/style.css | 15 ++++----------- index.html | 13 +++++++------ lib/ace/ext/searchbox.css | 9 ++++----- lib/ace/ext/searchbox.js | 4 ++-- 4 files changed, 17 insertions(+), 24 deletions(-) diff --git a/doc/site/style.css b/doc/site/style.css index 79640676..5e16c723 100644 --- a/doc/site/style.css +++ b/doc/site/style.css @@ -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 { diff --git a/index.html b/index.html index 4f8bef91..448dbcdb 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,10 @@ - + + @@ -69,7 +72,7 @@ in any web page and JavaScript application. ACE is maintained as the primary editor for Cloud9 IDE and is the successor of the Mozilla Skywriter (Bespin) project.

-
+
/** * 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);
-

Looking for a more full-featured demo? Check out the kitchen sink.

@@ -142,8 +144,7 @@ console.log(addResult);

Embedding ACE in Your Site

ACE can be easily embedded into a web page. Just copy the code below:

-
-
<!DOCTYPE html> +
<!DOCTYPE html> <html lang="en"> <head> <title>ACE in Action</title> @@ -171,7 +172,7 @@ console.log(addResult);
editor.getSession().setMode("ace/mode/javascript"); </script> </body> -</html>
+</html>

Now check out the How-To Guide for instructions on common operations, such as setting a different language mode or getting the contents from the editor.

diff --git a/lib/ace/ext/searchbox.css b/lib/ace/ext/searchbox.css index 2b828c8d..c8fd126a 100644 --- a/lib/ace/ext/searchbox.css +++ b/lib/ace/ext/searchbox.css @@ -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 { diff --git a/lib/ace/ext/searchbox.js b/lib/ace/ext/searchbox.js index 9f62411b..eecac88c 100644 --- a/lib/ace/ext/searchbox.js +++ b/lib/ace/ext/searchbox.js @@ -43,12 +43,12 @@ dom.importCssString(searchboxCss, "ace_searchbox"); var html = '