Merge remote-tracking branch 'remotes/origin/master'

Conflicts:
	index.html
This commit is contained in:
nightwing 2013-09-16 11:53:05 +04:00
commit eb7ed9862a
12 changed files with 85 additions and 38 deletions

View file

@ -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()
})

View file

@ -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 });

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.8 KiB

View file

@ -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;
}

View file

@ -814,11 +814,11 @@ if (match) {
<img src="doc/site/images/sassmeister-logo.png"
style="left: 10px;top: -5px;width: 80px;" />
<a href="http://sassmeister.com/">SassMeister</a>
</li>
</li>
<li>
<img src="doc/site/images/spandexio-logo.png"
style="left: 10px;top: -5px;width: 80px;" />
<a href="http://SpanDeX.io/">SpanDeX.io</a>
<img src="doc/site/images/sx-logo.png"
style="left: -11px; top: -12px;">
<a href="http://www.scroipe.com">Scroipe</a>
</li>
<li>
<img src="doc/site/images/ideone-logo.png"
@ -839,11 +839,11 @@ if (match) {
<img src="doc/site/images/shiftedit-logo.png"
style="left: -10px; top: -20px; width: 120px" />
<a href="http://shiftedit.net/">ShiftEdit</a>
</li>
</li>
<li>
<img src="doc/site/images/sx-logo.png"
style="left: -11px; top: -12px;">
<a href="http://www.scroipe.com">Scroipe</a>
<div class="rotating-logo" style="background:url(doc/site/images/habitat-logo.svg) center no-repeat;
left: 19px; top: 6px;width: 60px;height: 60px;background-size: 60px;position: relative;" ></div>
<a href="http://habitat.inkling.com">Inkling Habitat</a>
</li>
<li>
<img src="doc/site/images/weecod-logo.png"
@ -963,8 +963,7 @@ if (match) {
<a href="http://www.divshot.com/">Divshot</a>
</li>
<li>
<img src="https://codio.com/s/img/logo-beta-111c10af.png"
style="left: -4px; width: 110px;top: 16px;">
<div class="text-logo">Codio</div>
<a href="https://codio.com/">Codio</a>
</li>
<li>
@ -1065,20 +1064,33 @@ if (match) {
style="width: 111px; left: -3px; top: 30px;">
<a href="http://instaedu.com/lesson-demo/">InstaEDU</a>
</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>
<img src="http://s7.postimg.org/tbw9lfcvb/cloudcmd.png"
style="width: 74px; left: 13px; top: -2px;">
<a href="http://coderaiser.github.io/cloudcmd">CloudCmd</a>
</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>
<div class="text-logo" >allong.es</div>
<a href="http://allong.es/try/">Try allong.es</a>
</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>
<div class="text-logo" >Codechat</div>
<a href="http://codechat.net/">Codechat</a>

View file

@ -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";

View file

@ -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));

View file

@ -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;
});
});

View file

@ -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

View file

@ -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":

View file

@ -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}

View file

@ -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);