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() }) 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 }); 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/index.html b/index.html index f61b619a..9158c7ce 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,33 @@ if (match) { style="width: 111px; left: -3px; top: 30px;"> InstaEDU
  • -
  • - - ogEditor -
  • CloudCmd
  • +
  • + + ogEditor +
  • Try allong.es
  • +
  • + + NapCat +
  • +
  • + + CorsLit +
  • +
  • + + OJjs +
  • Codechat 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"; diff --git a/lib/ace/edit_session.js b/lib/ace/edit_session.js index 9f31841c..41e0fa15 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -885,9 +885,11 @@ var EditSession = function(text, mode) { if (!this.$modes["ace/mode/text"]) this.$modes["ace/mode/text"] = new TextMode(); - if (this.$modes[path] && !options) - return this.$onChangeMode(this.$modes[path]); - + if (this.$modes[path] && !options) { + this.$onChangeMode(this.$modes[path]); + cb && cb(); + return; + } // load on demand this.$modeId = path; config.loadModule(["mode", path], function(m) { @@ -902,7 +904,7 @@ var EditSession = function(text, mode) { m.$id = path; } this.$onChangeMode(m); - cb && cb(this.mode); + cb && cb(); } }.bind(this)); diff --git a/lib/ace/mode/golang_highlight_rules.js b/lib/ace/mode/golang_highlight_rules.js index 5a969661..5bd40b44 100644 --- a/lib/ace/mode/golang_highlight_rules.js +++ b/lib/ace/mode/golang_highlight_rules.js @@ -7,15 +7,15 @@ 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 = ( "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 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 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} 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);