Merge remote-tracking branch 'remotes/origin/master'
Conflicts: index.html
This commit is contained in:
commit
eb7ed9862a
12 changed files with 85 additions and 38 deletions
|
|
@ -33,7 +33,7 @@
|
||||||
name: "showKeyboardShortcuts",
|
name: "showKeyboardShortcuts",
|
||||||
bindKey: {win: "Ctrl-Alt-h", mac: "Command-Alt-h"},
|
bindKey: {win: "Ctrl-Alt-h", mac: "Command-Alt-h"},
|
||||||
exec: function(editor) {
|
exec: function(editor) {
|
||||||
config.loadModule("ace/ext/keybinding_menu", function(module) {
|
ace.config.loadModule("ace/ext/keybinding_menu", function(module) {
|
||||||
module.init(editor);
|
module.init(editor);
|
||||||
editor.showKeyboardShortcuts()
|
editor.showKeyboardShortcuts()
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -88,8 +88,6 @@ split.on("focus", function(editor) {
|
||||||
});
|
});
|
||||||
env.split = split;
|
env.split = split;
|
||||||
window.env = env;
|
window.env = env;
|
||||||
window.ace = env.editor;
|
|
||||||
env.editor.setAnimatedScroll(true);
|
|
||||||
|
|
||||||
// add multiple cursor support to editor
|
// add multiple cursor support to editor
|
||||||
require("ace/multi_select").MultiSelect(env.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 });
|
||||||
|
|
|
||||||
1
doc/site/images/habitat-logo.svg
Normal file
1
doc/site/images/habitat-logo.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 5.8 KiB |
|
|
@ -493,4 +493,15 @@ img {
|
||||||
|
|
||||||
.menu-list>li>img {
|
.menu-list>li>img {
|
||||||
position: relative;
|
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;
|
||||||
}
|
}
|
||||||
42
index.html
42
index.html
|
|
@ -814,11 +814,11 @@ if (match) {
|
||||||
<img src="doc/site/images/sassmeister-logo.png"
|
<img src="doc/site/images/sassmeister-logo.png"
|
||||||
style="left: 10px;top: -5px;width: 80px;" />
|
style="left: 10px;top: -5px;width: 80px;" />
|
||||||
<a href="http://sassmeister.com/">SassMeister</a>
|
<a href="http://sassmeister.com/">SassMeister</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<img src="doc/site/images/spandexio-logo.png"
|
<img src="doc/site/images/sx-logo.png"
|
||||||
style="left: 10px;top: -5px;width: 80px;" />
|
style="left: -11px; top: -12px;">
|
||||||
<a href="http://SpanDeX.io/">SpanDeX.io</a>
|
<a href="http://www.scroipe.com">Scroipe</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<img src="doc/site/images/ideone-logo.png"
|
<img src="doc/site/images/ideone-logo.png"
|
||||||
|
|
@ -839,11 +839,11 @@ if (match) {
|
||||||
<img src="doc/site/images/shiftedit-logo.png"
|
<img src="doc/site/images/shiftedit-logo.png"
|
||||||
style="left: -10px; top: -20px; width: 120px" />
|
style="left: -10px; top: -20px; width: 120px" />
|
||||||
<a href="http://shiftedit.net/">ShiftEdit</a>
|
<a href="http://shiftedit.net/">ShiftEdit</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<img src="doc/site/images/sx-logo.png"
|
<div class="rotating-logo" style="background:url(doc/site/images/habitat-logo.svg) center no-repeat;
|
||||||
style="left: -11px; top: -12px;">
|
left: 19px; top: 6px;width: 60px;height: 60px;background-size: 60px;position: relative;" ></div>
|
||||||
<a href="http://www.scroipe.com">Scroipe</a>
|
<a href="http://habitat.inkling.com">Inkling Habitat</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<img src="doc/site/images/weecod-logo.png"
|
<img src="doc/site/images/weecod-logo.png"
|
||||||
|
|
@ -963,8 +963,7 @@ if (match) {
|
||||||
<a href="http://www.divshot.com/">Divshot</a>
|
<a href="http://www.divshot.com/">Divshot</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<img src="https://codio.com/s/img/logo-beta-111c10af.png"
|
<div class="text-logo">Codio</div>
|
||||||
style="left: -4px; width: 110px;top: 16px;">
|
|
||||||
<a href="https://codio.com/">Codio</a>
|
<a href="https://codio.com/">Codio</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
|
@ -1065,20 +1064,33 @@ if (match) {
|
||||||
style="width: 111px; left: -3px; top: 30px;">
|
style="width: 111px; left: -3px; top: 30px;">
|
||||||
<a href="http://instaedu.com/lesson-demo/">InstaEDU</a>
|
<a href="http://instaedu.com/lesson-demo/">InstaEDU</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
|
||||||
<img src="http://www.ogeditor.com/images/logo.png"
|
|
||||||
style="width: 105px; left: -2px; top: 27px;">
|
|
||||||
<a href="http://www.ogeditor.com/index.aspx">ogEditor</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<img src="http://s7.postimg.org/tbw9lfcvb/cloudcmd.png"
|
<img src="http://s7.postimg.org/tbw9lfcvb/cloudcmd.png"
|
||||||
style="width: 74px; left: 13px; top: -2px;">
|
style="width: 74px; left: 13px; top: -2px;">
|
||||||
<a href="http://coderaiser.github.io/cloudcmd">CloudCmd</a>
|
<a href="http://coderaiser.github.io/cloudcmd">CloudCmd</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<img src="http://www.ogeditor.com/images/logo.png"
|
||||||
|
style="width: 105px; left: -2px; top: 27px;">
|
||||||
|
<a href="http://www.ogeditor.com/index.aspx">ogEditor</a>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<div class="text-logo" >allong.es</div>
|
<div class="text-logo" >allong.es</div>
|
||||||
<a href="http://allong.es/try/">Try allong.es</a>
|
<a href="http://allong.es/try/">Try allong.es</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<div class="text-logo" >NapCat</div>
|
||||||
|
<a href="http://napcatapp.tumblr.com/post/60598006734/version-1-3-is-released">NapCat</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div class="text-logo" >CorsLit</div>
|
||||||
|
<a href="http://www.corslit.com/new/melloWorld">CorsLit</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<img src="http://ojjs.org/media/oj_logo_big.png"
|
||||||
|
style="width: 74px; left: 13px; top: 8px;background: white;box-shadow: 0 0 2px 6px white;">
|
||||||
|
<a href="http://ojjs.org/index.html">OJjs</a>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<div class="text-logo" >Codechat</div>
|
<div class="text-logo" >Codechat</div>
|
||||||
<a href="http://codechat.net/">Codechat</a>
|
<a href="http://codechat.net/">Codechat</a>
|
||||||
|
|
|
||||||
|
|
@ -206,9 +206,12 @@ var AcePopup = function(parentNode) {
|
||||||
};
|
};
|
||||||
popup.show = function(pos, lineHeight) {
|
popup.show = function(pos, lineHeight) {
|
||||||
var el = this.container;
|
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.top = "";
|
||||||
el.style.bottom = window.innerHeight - pos.top + "px";
|
el.style.bottom = screenHeight - pos.top + "px";
|
||||||
} else {
|
} else {
|
||||||
pos.top += lineHeight;
|
pos.top += lineHeight;
|
||||||
el.style.top = pos.top + "px";
|
el.style.top = pos.top + "px";
|
||||||
|
|
|
||||||
|
|
@ -885,9 +885,11 @@ var EditSession = function(text, mode) {
|
||||||
if (!this.$modes["ace/mode/text"])
|
if (!this.$modes["ace/mode/text"])
|
||||||
this.$modes["ace/mode/text"] = new TextMode();
|
this.$modes["ace/mode/text"] = new TextMode();
|
||||||
|
|
||||||
if (this.$modes[path] && !options)
|
if (this.$modes[path] && !options) {
|
||||||
return this.$onChangeMode(this.$modes[path]);
|
this.$onChangeMode(this.$modes[path]);
|
||||||
|
cb && cb();
|
||||||
|
return;
|
||||||
|
}
|
||||||
// load on demand
|
// load on demand
|
||||||
this.$modeId = path;
|
this.$modeId = path;
|
||||||
config.loadModule(["mode", path], function(m) {
|
config.loadModule(["mode", path], function(m) {
|
||||||
|
|
@ -902,7 +904,7 @@ var EditSession = function(text, mode) {
|
||||||
m.$id = path;
|
m.$id = path;
|
||||||
}
|
}
|
||||||
this.$onChangeMode(m);
|
this.$onChangeMode(m);
|
||||||
cb && cb(this.mode);
|
cb && cb();
|
||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,15 @@ define(function(require, exports, module) {
|
||||||
var keywords = (
|
var keywords = (
|
||||||
"else|break|case|return|goto|if|const|select|" +
|
"else|break|case|return|goto|if|const|select|" +
|
||||||
"continue|struct|default|switch|for|range|" +
|
"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"
|
"select|type|var"
|
||||||
);
|
);
|
||||||
var builtinTypes = (
|
var builtinTypes = (
|
||||||
"string|uint8|uint16|uint32|uint64|int8|int16|int32|int64|float32|" +
|
"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 = (
|
var builtinFunctions = (
|
||||||
"make|close|new"
|
"make|close|new|panic|recover"
|
||||||
);
|
);
|
||||||
var builtinConstants = ("nil|true|false|iota");
|
var builtinConstants = ("nil|true|false|iota");
|
||||||
|
|
||||||
|
|
@ -108,4 +108,4 @@ define(function(require, exports, module) {
|
||||||
oop.inherits(GolangHighlightRules, TextHighlightRules);
|
oop.inherits(GolangHighlightRules, TextHighlightRules);
|
||||||
|
|
||||||
exports.GolangHighlightRules = GolangHighlightRules;
|
exports.GolangHighlightRules = GolangHighlightRules;
|
||||||
});
|
});
|
||||||
|
|
@ -212,6 +212,11 @@ var TextHighlightRules = function() {
|
||||||
for (var i = list.length; i--; )
|
for (var i = list.length; i--; )
|
||||||
keywords[list[i]] = className;
|
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);
|
this.$keywordList = Object.keys(keywords);
|
||||||
map = null;
|
map = null;
|
||||||
return ignoreCase
|
return ignoreCase
|
||||||
|
|
|
||||||
|
|
@ -155,11 +155,13 @@ var SnippetManager = function() {
|
||||||
case "SELECTED_TEXT":
|
case "SELECTED_TEXT":
|
||||||
return s.getTextRange(r);
|
return s.getTextRange(r);
|
||||||
case "CURRENT_LINE":
|
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":
|
case "LINE_INDEX":
|
||||||
return e.getCursorPosition().column;
|
return editor.getCursorPosition().column;
|
||||||
case "LINE_NUMBER":
|
case "LINE_NUMBER":
|
||||||
return e.getCursorPosition().row + 1;
|
return editor.getCursorPosition().row + 1;
|
||||||
case "SOFT_TABS":
|
case "SOFT_TABS":
|
||||||
return s.getUseSoftTabs() ? "YES" : "NO";
|
return s.getUseSoftTabs() ? "YES" : "NO";
|
||||||
case "TAB_SIZE":
|
case "TAB_SIZE":
|
||||||
|
|
|
||||||
|
|
@ -23,14 +23,15 @@ snippet ![:*
|
||||||
![${1:id}]: ${2:`@*`} "${3:title}"
|
![${1:id}]: ${2:`@*`} "${3:title}"
|
||||||
|
|
||||||
snippet ===
|
snippet ===
|
||||||
`repeat('=', strlen(getline(line(".") - 1)))`
|
regex /^/=+/=*//
|
||||||
|
${PREV_LINE/./=/g}
|
||||||
|
|
||||||
${1}
|
${0}
|
||||||
snippet ---
|
snippet ---
|
||||||
`repeat('-', strlen(getline(line(".") - 1)))`
|
regex /^/-+/-*//
|
||||||
|
${PREV_LINE/./-/g}
|
||||||
|
|
||||||
${1}
|
${0}
|
||||||
|
|
||||||
snippet blockquote
|
snippet blockquote
|
||||||
{% blockquote %}
|
{% blockquote %}
|
||||||
${1:quote}
|
${1:quote}
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,6 @@ define(function(require, exports, module) {
|
||||||
// tokenizing lines longer than this makes editor very slow
|
// tokenizing lines longer than this makes editor very slow
|
||||||
var MAX_TOKEN_COUNT = 1000;
|
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).
|
* 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
|
* @class Tokenizer
|
||||||
**/
|
**/
|
||||||
|
|
@ -128,6 +126,10 @@ var Tokenizer = function(rules) {
|
||||||
};
|
};
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
this.$setMaxTokenCount = function(m) {
|
||||||
|
MAX_TOKEN_COUNT = m | 0;
|
||||||
|
};
|
||||||
|
|
||||||
this.$applyToken = function(str) {
|
this.$applyToken = function(str) {
|
||||||
var values = this.splitRegex.exec(str).slice(1);
|
var values = this.splitRegex.exec(str).slice(1);
|
||||||
var types = this.token.apply(this, values);
|
var types = this.token.apply(this, values);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue