From 8a08d3fc0a92b37bd9af15c4f7023b7f3bd8a5e5 Mon Sep 17 00:00:00 2001 From: Matthew Kastor Date: Thu, 12 Sep 2013 01:44:25 -0400 Subject: [PATCH 01/11] fix broken demo. --- demo/keyboard_shortcuts.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/keyboard_shortcuts.html b/demo/keyboard_shortcuts.html index 988e1918..b52602c8 100644 --- a/demo/keyboard_shortcuts.html +++ b/demo/keyboard_shortcuts.html @@ -33,7 +33,7 @@ name: "showKeyboardShortcuts", bindKey: {win: "Ctrl-Alt-h", mac: "Command-Alt-h"}, exec: function(editor) { - config.loadModule("ace/ext/keybinding_menu", function(module) { + ace.config.loadModule("ace/ext/keybinding_menu", function(module) { module.init(editor); editor.showKeyboardShortcuts() }) From 2a016e38909d0888e6fd670c3e6a6af96b4889d5 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Fri, 13 Sep 2013 16:14:05 +0200 Subject: [PATCH 02/11] Added another few missing builtin types and functions to the Go language. --- lib/ace/mode/golang_highlight_rules.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ace/mode/golang_highlight_rules.js b/lib/ace/mode/golang_highlight_rules.js index 5a969661..d71bc2ad 100644 --- a/lib/ace/mode/golang_highlight_rules.js +++ b/lib/ace/mode/golang_highlight_rules.js @@ -12,10 +12,10 @@ define(function(require, exports, module) { ); var builtinTypes = ( "string|uint8|uint16|uint32|uint64|int8|int16|int32|int64|float32|" + - "float64|complex64|complex128|byte|rune|uint|int|uintptr|bool" + "float64|complex64|complex128|byte|rune|uint|int|uintptr|bool|error" ); var builtinFunctions = ( - "make|close|new" + "make|close|new|panic|recover" ); var builtinConstants = ("nil|true|false|iota"); @@ -108,4 +108,4 @@ define(function(require, exports, module) { oop.inherits(GolangHighlightRules, TextHighlightRules); exports.GolangHighlightRules = GolangHighlightRules; -}); +}); \ No newline at end of file From 4e748341fcd15cd859293bd0bdc86e2368100452 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Fri, 13 Sep 2013 16:14:44 +0200 Subject: [PATCH 03/11] [Golang] Forgot | --- lib/ace/mode/golang_highlight_rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/mode/golang_highlight_rules.js b/lib/ace/mode/golang_highlight_rules.js index d71bc2ad..5bd40b44 100644 --- a/lib/ace/mode/golang_highlight_rules.js +++ b/lib/ace/mode/golang_highlight_rules.js @@ -7,7 +7,7 @@ define(function(require, exports, module) { var keywords = ( "else|break|case|return|goto|if|const|select|" + "continue|struct|default|switch|for|range|" + - "func|import|package|chan|defer|fallthrough|go|interface|map|range" + + "func|import|package|chan|defer|fallthrough|go|interface|map|range|" + "select|type|var" ); var builtinTypes = ( From 214c3a9b5d5ab9de4f29c17186e337ef65b19191 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 13 Sep 2013 20:38:20 +0400 Subject: [PATCH 04/11] workaround for broken Object.create(null) on old opera fixes https://github.com/ajaxorg/ace-builds/issues/13 --- lib/ace/mode/text_highlight_rules.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ace/mode/text_highlight_rules.js b/lib/ace/mode/text_highlight_rules.js index fc7bfb67..48e016b0 100644 --- a/lib/ace/mode/text_highlight_rules.js +++ b/lib/ace/mode/text_highlight_rules.js @@ -212,6 +212,11 @@ var TextHighlightRules = function() { for (var i = list.length; i--; ) keywords[list[i]] = className; }); + // in old versions of opera keywords["__proto__"] sets prototype + // even on objects with __proto__=null + if (Object.getPrototypeOf(keywords)) { + keywords.__proto__ = null; + } this.$keywordList = Object.keys(keywords); map = null; return ignoreCase From 2c9dbced9be086e2b6e0dbc17927938bcab7c46f Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 13 Sep 2013 20:38:53 +0400 Subject: [PATCH 05/11] allow setting MaxTokenCount in tokenizer --- lib/ace/tokenizer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ace/tokenizer.js b/lib/ace/tokenizer.js index b4ef627b..6d63b075 100644 --- a/lib/ace/tokenizer.js +++ b/lib/ace/tokenizer.js @@ -34,8 +34,6 @@ define(function(require, exports, module) { // tokenizing lines longer than this makes editor very slow var MAX_TOKEN_COUNT = 1000; /** - * - * * This class takes a set of highlighting rules, and creates a tokenizer out of them. For more information, see [the wiki on extending highlighters](https://github.com/ajaxorg/ace/wiki/Creating-or-Extending-an-Edit-Mode#wiki-extendingTheHighlighter). * @class Tokenizer **/ @@ -128,6 +126,10 @@ var Tokenizer = function(rules) { }; (function() { + this.$setMaxTokenCount = function(m) { + MAX_TOKEN_COUNT = m | 0; + }; + this.$applyToken = function(str) { var values = this.splitRegex.exec(str).slice(1); var types = this.token.apply(this, values); From fbdcbd00a12862975b48ae3ad6ef19f7718aa70d Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 13 Sep 2013 21:20:06 +0400 Subject: [PATCH 06/11] always call callback from setMode --- lib/ace/edit_session.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ace/edit_session.js b/lib/ace/edit_session.js index 9f31841c..ea1e92c3 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -885,9 +885,10 @@ var EditSession = function(text, mode) { if (!this.$modes["ace/mode/text"]) this.$modes["ace/mode/text"] = new TextMode(); - if (this.$modes[path] && !options) + if (this.$modes[path] && !options) { + cb && cb(this.mode); return this.$onChangeMode(this.$modes[path]); - + } // load on demand this.$modeId = path; config.loadModule(["mode", path], function(m) { From 3c6cd4d16f89de0531d7e8f06c5e791839ab9eb6 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 13 Sep 2013 23:46:03 +0400 Subject: [PATCH 07/11] fix #1606 broken markdown snippets --- lib/ace/snippets.js | 8 +++++--- lib/ace/snippets/markdown.snippets | 11 ++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/ace/snippets.js b/lib/ace/snippets.js index aa1d71b5..6d7e22b5 100644 --- a/lib/ace/snippets.js +++ b/lib/ace/snippets.js @@ -155,11 +155,13 @@ var SnippetManager = function() { case "SELECTED_TEXT": return s.getTextRange(r); case "CURRENT_LINE": - return s.getLine(e.getCursorPosition().row); + return s.getLine(editor.getCursorPosition().row); + case "PREV_LINE": // not possible in textmate + return s.getLine(editor.getCursorPosition().row - 1); case "LINE_INDEX": - return e.getCursorPosition().column; + return editor.getCursorPosition().column; case "LINE_NUMBER": - return e.getCursorPosition().row + 1; + return editor.getCursorPosition().row + 1; case "SOFT_TABS": return s.getUseSoftTabs() ? "YES" : "NO"; case "TAB_SIZE": diff --git a/lib/ace/snippets/markdown.snippets b/lib/ace/snippets/markdown.snippets index e4efd3c2..a5110fc9 100644 --- a/lib/ace/snippets/markdown.snippets +++ b/lib/ace/snippets/markdown.snippets @@ -23,14 +23,15 @@ snippet ![:* ![${1:id}]: ${2:`@*`} "${3:title}" snippet === - `repeat('=', strlen(getline(line(".") - 1)))` +regex /^/=+/=*// + ${PREV_LINE/./=/g} - ${1} + ${0} snippet --- - `repeat('-', strlen(getline(line(".") - 1)))` +regex /^/-+/-*// + ${PREV_LINE/./-/g} - ${1} - + ${0} snippet blockquote {% blockquote %} ${1:quote} From eecbe4869502e598eb3ec56a9bd43f9cd8dd2ed6 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 14 Sep 2013 00:50:57 +0400 Subject: [PATCH 08/11] replace ace global with getter in the demo see 060e86d6 --- demo/kitchen-sink/demo.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/demo/kitchen-sink/demo.js b/demo/kitchen-sink/demo.js index 634125f6..d565bd81 100644 --- a/demo/kitchen-sink/demo.js +++ b/demo/kitchen-sink/demo.js @@ -88,8 +88,6 @@ split.on("focus", function(editor) { }); env.split = split; window.env = env; -window.ace = env.editor; -env.editor.setAnimatedScroll(true); // add multiple cursor support to editor require("ace/multi_select").MultiSelect(env.editor); @@ -617,3 +615,13 @@ env.editor.setOptions({ }) }); + +// allow easy access to ace in console, but not in ace code which uses strict +function isNonStrict() { + try { return !!arguments.callee.caller.caller } + catch(e){ return false } +} +window.__defineGetter__("ace", function(){ return isNonStrict() && env.editor }); +window.__defineGetter__("editor", function(){ return isNonStrict() && env.editor }); +window.__defineGetter__("session", function(){ return isNonStrict() && env.editor.session }); +window.__defineGetter__("split", function(){ return isNonStrict() && env.split }); From 4d8a31fd54e693252ae7448a0dd68cc67cfbf922 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 14 Sep 2013 14:53:51 +0400 Subject: [PATCH 09/11] fix popup position flipping --- lib/ace/autocomplete/popup.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ace/autocomplete/popup.js b/lib/ace/autocomplete/popup.js index e1ec86c2..4cf29073 100644 --- a/lib/ace/autocomplete/popup.js +++ b/lib/ace/autocomplete/popup.js @@ -206,9 +206,12 @@ var AcePopup = function(parentNode) { }; popup.show = function(pos, lineHeight) { var el = this.container; - if (pos.top > window.innerHeight / 2 + lineHeight) { + var screenHeight = window.innerHeight; + var renderer = this.renderer; + var maxH = renderer.$maxLines * lineHeight; + if (pos.top +maxH > screenHeight - lineHeight) { el.style.top = ""; - el.style.bottom = window.innerHeight - pos.top + "px"; + el.style.bottom = screenHeight - pos.top + "px"; } else { pos.top += lineHeight; el.style.top = pos.top + "px"; From 414667916ec8b94fd4e3b0004d3c84ed65256e46 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 14 Sep 2013 14:55:41 +0400 Subject: [PATCH 10/11] always call setMode callback after the event --- lib/ace/edit_session.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ace/edit_session.js b/lib/ace/edit_session.js index ea1e92c3..41e0fa15 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -886,8 +886,9 @@ var EditSession = function(text, mode) { this.$modes["ace/mode/text"] = new TextMode(); if (this.$modes[path] && !options) { - cb && cb(this.mode); - return this.$onChangeMode(this.$modes[path]); + this.$onChangeMode(this.$modes[path]); + cb && cb(); + return; } // load on demand this.$modeId = path; @@ -903,7 +904,7 @@ var EditSession = function(text, mode) { m.$id = path; } this.$onChangeMode(m); - cb && cb(this.mode); + cb && cb(); } }.bind(this)); From 51b7cb67a63998c9c0b7d089a85c60e032a7cc17 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 14 Sep 2013 18:46:51 +0400 Subject: [PATCH 11/11] update site and submodules --- build | 2 +- doc/site/images/habitat-logo.svg | 1 + doc/site/style.css | 11 ++++++++ doc/wiki | 2 +- index.html | 46 +++++++++++++++++++++----------- 5 files changed, 45 insertions(+), 17 deletions(-) create mode 100644 doc/site/images/habitat-logo.svg diff --git a/build b/build index 995de31e..8f2423d1 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 995de31e6513ddfd5e9f66b8216f5b316fcd2253 +Subproject commit 8f2423d10a7cc5680dcdb42a2dd57d9b192e3b34 diff --git a/doc/site/images/habitat-logo.svg b/doc/site/images/habitat-logo.svg new file mode 100644 index 00000000..986c3687 --- /dev/null +++ b/doc/site/images/habitat-logo.svg @@ -0,0 +1 @@ +Slice 1 \ No newline at end of file diff --git a/doc/site/style.css b/doc/site/style.css index db57aa2f..4e79b5fb 100644 --- a/doc/site/style.css +++ b/doc/site/style.css @@ -493,4 +493,15 @@ img { .menu-list>li>img { position: relative; +} + +.rotating-logo { + -webkit-transform: rotate(0deg); + -webkit-transition: all 0.5s ease-out; + transition: all 0.5s ease-out; +} +.rotating-logo:hover { + -webkit-transform: rotate(360deg); + -webkit-transition: all 0.5s ease-in-out; + transition: all 0.5s ease-in-out; } \ No newline at end of file diff --git a/doc/wiki b/doc/wiki index d93670b4..a3d6d692 160000 --- a/doc/wiki +++ b/doc/wiki @@ -1 +1 @@ -Subproject commit d93670b47d776987b38bb2c31777c4e488338fac +Subproject commit a3d6d69286903155bc7e1e5cd9c0f541791d384b diff --git a/index.html b/index.html index 4427356d..a33f0e03 100644 --- a/index.html +++ b/index.html @@ -814,11 +814,11 @@ if (match) { SassMeister - +
  • - - SpanDeX.io + + Scroipe
  • ShiftEdit -
  • +
  • - - Scroipe + + Inkling Habitat
  • Divshot
  • - + Codio
  • @@ -1065,20 +1064,37 @@ if (match) { style="width: 111px; left: -3px; top: 30px;"> InstaEDU
  • -
  • - - ogEditor -
  • CloudCmd
  • +
  • + + ogEditor +
  • Try allong.es
  • +
  • + + NapCat +
  • +
  • + + CorsLit +
  • +
  • + + OJjs +
  • +
  • + + Codechat +
  • Sky Edit