From ea391b355040d35faec98f4a449e1955e0c8b13e Mon Sep 17 00:00:00 2001 From: DanyaPostfactum Date: Mon, 17 Sep 2012 06:42:28 +1000 Subject: [PATCH 1/8] Monokai theme selection contrast fix --- lib/ace/theme/monokai.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ace/theme/monokai.css b/lib/ace/theme/monokai.css index 19c95ed3..d2526206 100644 --- a/lib/ace/theme/monokai.css +++ b/lib/ace/theme/monokai.css @@ -53,11 +53,11 @@ } .ace-monokai .ace_marker-layer .ace_active_line { - background: #49483E; + background: #202020; } .ace-monokai .ace_gutter_active_line { - background-color: #191916; + background-color: #272727; } .ace-monokai .ace_marker-layer .ace_selected_word { From 94b75bd994ab1aab30841e22642287389b7159c0 Mon Sep 17 00:00:00 2001 From: C9 Date: Mon, 17 Sep 2012 02:00:48 -0400 Subject: [PATCH 2/8] Updated disqus and some docs --- api/resources/javascripts/disqus-ext.js | 19 +++---- .../ace/skeleton/javascripts/disqus-ext.js | 19 +++---- doc/site/js/main.js | 35 +++---------- doc/site/style.css | 8 +++ index.html | 52 ++++++++++++++++--- 5 files changed, 74 insertions(+), 59 deletions(-) diff --git a/api/resources/javascripts/disqus-ext.js b/api/resources/javascripts/disqus-ext.js index 66da8bfc..6bb7ff4e 100644 --- a/api/resources/javascripts/disqus-ext.js +++ b/api/resources/javascripts/disqus-ext.js @@ -1,22 +1,17 @@ -function setupDisqus() { +function setupDisqus(href) { var disqus_shortname = 'aceapi'; - var dsqId = "disqusScript"; //var paths = window.location.pathname.split("/"); //var fileName = paths[paths.length - 2] + "/" + paths[paths.length - 1]; //var disqus_identifier = fileName; - - var lochash = location.hash.substr(1); - var disqus_identifier = "api/" + (lochash.substr(lochash.indexOf('api=')).split('&')[0].split('=')[1] || "index") + ".html"; + var disqus_identifier = href.substring(2); (function() { - if (document.getElementById(dsqId)) - (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).removeChild(document.getElementById(dsqId)); - - var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js'; - dsq.id="disqusScript"; - (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); + if (document.getElementById("disqusScript") === null) { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); + } })(); } \ No newline at end of file diff --git a/doc/resources/ace/skeleton/javascripts/disqus-ext.js b/doc/resources/ace/skeleton/javascripts/disqus-ext.js index 66da8bfc..6bb7ff4e 100644 --- a/doc/resources/ace/skeleton/javascripts/disqus-ext.js +++ b/doc/resources/ace/skeleton/javascripts/disqus-ext.js @@ -1,22 +1,17 @@ -function setupDisqus() { +function setupDisqus(href) { var disqus_shortname = 'aceapi'; - var dsqId = "disqusScript"; //var paths = window.location.pathname.split("/"); //var fileName = paths[paths.length - 2] + "/" + paths[paths.length - 1]; //var disqus_identifier = fileName; - - var lochash = location.hash.substr(1); - var disqus_identifier = "api/" + (lochash.substr(lochash.indexOf('api=')).split('&')[0].split('=')[1] || "index") + ".html"; + var disqus_identifier = href.substring(2); (function() { - if (document.getElementById(dsqId)) - (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).removeChild(document.getElementById(dsqId)); - - var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js'; - dsq.id="disqusScript"; - (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); + if (document.getElementById("disqusScript") === null) { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); + } })(); } \ No newline at end of file diff --git a/doc/site/js/main.js b/doc/site/js/main.js index e4f78ffc..d2da9c35 100644 --- a/doc/site/js/main.js +++ b/doc/site/js/main.js @@ -14,7 +14,7 @@ $(function() { console.log($(this).find("a")); window.location = $(this).find("a").attr("href"); } - else if (e.target.tagName === "P") { + else if (e.target.tagName === "P" || e.target.tagName === "IMG") { var anchor = $(e.target).siblings(); window.location = anchor.attr("href"); } @@ -23,34 +23,12 @@ $(function() { // used when page is access directly function magicClickInterceptor(e) { e.preventDefault(); - - var state = {}; - state.api = $(this).attr("href").substring(6, $(this).attr("href").length - 5); - $.bbq.pushState(state); - - $("#apiHolder").removeClass("apiIntro").removeClass("span8"); - $("#apiHolder").load($(this).attr("href") + " #documentation", function(){ - ux(); - setupClicker(); - - // handles dropping in from new link - var section = $.bbq.getState("section"); - if (section) { - $("li#dropdown_" + section.replace(/\./g, '\\.') + " a").triggerHandler('click'); - } - - setupDisqus(); - }); - } - - $('.menu-item a').click(magicClickInterceptor); - $('a.argument').click(function (e) { - e.preventDefault(); - + var state = {}; state.api = $(this).attr("href").substring(6, $(this).attr("href").length - 5); $.bbq.pushState(state); + var _self = $(this); $("#apiHolder").load($(this).attr("href") + " #documentation", function(){ $("#apiHolder").removeClass("apiIntro").removeClass("span8"); ux(); @@ -62,9 +40,12 @@ $(function() { $("li#dropdown_" + section.replace(/\./g, '\\.') + " a").triggerHandler('click'); } - setupDisqus(); + //setupDisqus(_self.attr("href")); }); - }); + } + + $('.menu-item a').click(magicClickInterceptor); + $('a.argument').click(magicClickInterceptor); var tabs = $("#tabnav"), tab_a_selector = "a"; diff --git a/doc/site/style.css b/doc/site/style.css index 40118ed5..11e8eaec 100644 --- a/doc/site/style.css +++ b/doc/site/style.css @@ -462,4 +462,12 @@ p.highlight_note a { .apiIntro { padding-left: 15px; padding-bottom: 10px; +} + +.prod_no_image { + position: relative; left: -10px; top: -12px; +} + +#sidebarContainer { + margin: 0 20px 0 0; } \ No newline at end of file diff --git a/index.html b/index.html index 90dceff1..e1b27a1e 100644 --- a/index.html +++ b/index.html @@ -163,7 +163,7 @@ console.log(addResult); return x; }</div> -<script src="src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script> +<script src="https://s3.amazonaws.com/ajaxorg/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script> <script> var editor = ace.edit("editor"); editor.setTheme("ace/theme/twilight"); @@ -189,13 +189,11 @@ console.log(addResult);

Themes are loaded on demand; all you have to do is pass the string name:

editor.setTheme("ace/theme/twilight");
-

> (See all themes)

+

> See all themes

Setting the Programming Language Mode

By default, the editor supports plain text mode. All other language modes are available as separate modules, loaded on demand like this:

- -
<script src="src/mode-javascript.js" type="text/javascript" charset="utf-8">
-

The mode can then be used like this:

var javascriptMode = require("ace/mode/javascript").Mode;
 editor.getSession().setMode(new javascriptMode());
@@ -212,7 +210,7 @@ var css = new EditSession(["some", "css", "code here"]); editor.setSession(js);

Common Operations

-

Set and get content:`

+

Set and get content:

editor.setValue("the new text here"); // or session.setValue
 editor.getValue(); // or session.getValue
@@ -470,60 +468,98 @@ tests for the highlighting.

style="position: relative; left: 19px; top: 2px;" /> RStudio -
  • Sky Edit
  • + class="prod_no_image" /> + Sky Edit +
  • +
  • + WaveMaker
  • + Play My Code
  • + Qooxdoo playground
  • + Radiant CMS
  • + Developer Companion
  • + PythonAnywhere
  • + shiftEdit
  • + Akshell
  • + beanstalk
  • + Neutron IDE
  • + Acebug
  • + Weecod
  • + RubyMonk
  • + tmpltr
  • + CMS Made Simple
  • + Try Jasmine
  • + Codebender
  • + ShareLaTeX
  • From 4abcb89f19bf32346554eff42fe25eef52712faa Mon Sep 17 00:00:00 2001 From: C9 Date: Mon, 17 Sep 2012 02:08:01 -0400 Subject: [PATCH 3/8] Little link change for the site --- doc/site/js/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/site/js/main.js b/doc/site/js/main.js index d2da9c35..0175a7b5 100644 --- a/doc/site/js/main.js +++ b/doc/site/js/main.js @@ -56,8 +56,10 @@ $(function() { e.preventDefault(); embedded_editor.resize(); editor.resize(); - if ($(this).attr("href") === "/") + if ($(this).attr("href") === "/") { + window.location = "http://ace.ajax.org"; return; + } if ($(this).attr("href").indexOf("#api") === 0) { $("#top_container").addClass("collapse"); scrollIntoPosition(null, 0); From b02ba2b3d03c990b8a3fc23e28c73beeb9feca55 Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Thu, 13 Sep 2012 16:49:46 +0300 Subject: [PATCH 4/8] Add varargs console.log to worker --- lib/ace/worker/worker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ace/worker/worker.js b/lib/ace/worker/worker.js index 2e1853df..102d8cd0 100644 --- a/lib/ace/worker/worker.js +++ b/lib/ace/worker/worker.js @@ -1,8 +1,8 @@ "no use strict"; var console = { - log: function(msg) { - postMessage({type: "log", data: msg}); + log: function(msgs) { + postMessage({type: "log", data: arguments.join(" ")}); } }; var window = { From 4d2e0931db10dae89d3fc77104427693fd009296 Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Thu, 13 Sep 2012 17:07:21 +0300 Subject: [PATCH 5/8] Add sanity check for require([module], function(){}) form --- lib/ace/worker/worker.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ace/worker/worker.js b/lib/ace/worker/worker.js index 102d8cd0..0e7270a3 100644 --- a/lib/ace/worker/worker.js +++ b/lib/ace/worker/worker.js @@ -30,6 +30,9 @@ var normalizeModule = function(parentId, moduleName) { }; var require = function(parentId, id) { + if (!id.charAt) + throw new Error("worker.js require() accepts only (parentId, id) as arguments"); + var id = normalizeModule(parentId, id); var module = require.modules[id]; From 10fe461ba5d4010d6b37650869f0a0256cc47e04 Mon Sep 17 00:00:00 2001 From: C9 Date: Mon, 17 Sep 2012 09:40:48 -0400 Subject: [PATCH 6/8] Some updates --- doc/site/js/main.js | 7 +++---- index.html | 17 ++++++----------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/doc/site/js/main.js b/doc/site/js/main.js index 0175a7b5..8a1fd27a 100644 --- a/doc/site/js/main.js +++ b/doc/site/js/main.js @@ -4,10 +4,9 @@ $(function() { hljs.initHighlighting(); editor = ace.edit("ace_editor_demo"); embedded_editor = ace.edit("embedded_ace_code"); - var javascriptMode = require("ace/mode/javascript").Mode; - var htmlMode = require("ace/mode/html").Mode; - editor.getSession().setMode(new javascriptMode()); - embedded_editor.getSession().setMode(new htmlMode()); + editor.getSession().setMode("ace/mode/javascript"); + editor.getSession().setMode("ace/mode/javascript"); + embedded_editor.getSession().setMode("ace/mode/html"); $("ul.menu-list li").click(function(e) { if (e.target.tagName === "LI") { diff --git a/index.html b/index.html index e1b27a1e..fbaad6ee 100644 --- a/index.html +++ b/index.html @@ -7,9 +7,7 @@ - - - + @@ -17,8 +15,6 @@ - - @@ -32,7 +28,7 @@

    The high performance code editor for the web.

    @@ -163,7 +159,7 @@ console.log(addResult); return x; }</div> -<script src="https://s3.amazonaws.com/ajaxorg/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script> +<script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script> <script> var editor = ace.edit("editor"); editor.setTheme("ace/theme/twilight"); @@ -194,10 +190,9 @@ console.log(addResult);

    Setting the Programming Language Mode

    By default, the editor supports plain text mode. All other language modes are available as separate modules, loaded on demand like this:

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

    One Editor, Multiple Sessions

    +

    Common Operations

    Set and get content:

    From ecf5d7dce263a93ffe0a7eceaec4a7028e6e274d Mon Sep 17 00:00:00 2001 From: C9 Date: Mon, 17 Sep 2012 11:52:56 -0400 Subject: [PATCH 7/8] Style updates --- doc/site/style.css | 4 ++++ index.html | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/site/style.css b/doc/site/style.css index 11e8eaec..273a9f5b 100644 --- a/doc/site/style.css +++ b/doc/site/style.css @@ -5,6 +5,10 @@ body { font-family: Helvetica, Arial; } +#embed_ace_wrapper { + height: 525px; +} + .ace_editor_wrapper { height: 275px; position: relative; diff --git a/index.html b/index.html index fbaad6ee..46030236 100644 --- a/index.html +++ b/index.html @@ -137,7 +137,7 @@ console.log(addResult);

    Embedding ACE in Your Site

    ACE can be easily embedded into a web page:

    -
    +
    <!DOCTYPE html> <html lang="en"> <head> @@ -162,7 +162,7 @@ console.log(addResult);
    <script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script> <script> var editor = ace.edit("editor"); - editor.setTheme("ace/theme/twilight"); + editor.setTheme("ace/theme/monokai"); editor.getSession().setMode("ace/mode/javascript"); </script> </body> From a50afaa62ffada100e6219702b736949b2c62fe3 Mon Sep 17 00:00:00 2001 From: C9 Date: Mon, 17 Sep 2012 12:52:45 -0400 Subject: [PATCH 8/8] Added website to list of prod apps --- index.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.html b/index.html index 46030236..7c4e77a9 100644 --- a/index.html +++ b/index.html @@ -498,6 +498,11 @@ tests for the highlighting.

    class="prod_no_image" /> PythonAnywhere
  • +
  • + + Application Craft +