##// END OF EJS Templates
Add javascript for Object Code excanvas (flot) version herein included and use that instead of minified version....
Add javascript for Object Code excanvas (flot) version herein included and use that instead of minified version. I had a bit of trouble finding the upstream on excanvas, as the version from Google, which appears to be the original source, seems unmaintained. However, it appears the version we're carrying in Kallithea is indeed from the excanvas era of flot. $ (cd /tmp; \ svn -r 135 checkout http://flot.googlecode.com/svn/trunk/ flot ) $ cp /tmp/flot/excanvas.js rhodecode/public/js/excanvas.js I also verified the sha256sum of the min file matched ours: $ sha256sum /tmp/flot/excanvas.min.js rhodecode/public/js/excanvas.min.js 5f94b032a110504b7b261eaf71392fa3e8d82cdc6455c0cba5c9f03cd34ed122 /tmp/flot/excanvas.min.js 5f94b032a110504b7b261eaf71392fa3e8d82cdc6455c0cba5c9f03cd34ed122 rhodecode/public/js/excanvas.min.js

File last commit:

r4026:a60a0e90 default
r4132:531ab818 rhodecode-2.2.5-gpl
Show More
z80.js
85 lines | 2.4 KiB | application/javascript | JavascriptLexer
added codemirror edit mode with autodetection
r4026 CodeMirror.defineMode('z80', function() {
var keywords1 = /^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i;
var keywords2 = /^(call|j[pr]|ret[in]?)\b/i;
var keywords3 = /^b_?(call|jump)\b/i;
var variables1 = /^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i;
var variables2 = /^(n?[zc]|p[oe]?|m)\b/i;
var errors = /^([hl][xy]|i[xy][hl]|slia|sll)\b/i;
var numbers = /^([\da-f]+h|[0-7]+o|[01]+b|\d+)\b/i;
return {
startState: function() {
return {context: 0};
},
token: function(stream, state) {
if (!stream.column())
state.context = 0;
if (stream.eatSpace())
return null;
var w;
if (stream.eatWhile(/\w/)) {
w = stream.current();
if (stream.indentation()) {
if (state.context == 1 && variables1.test(w))
return 'variable-2';
if (state.context == 2 && variables2.test(w))
return 'variable-3';
if (keywords1.test(w)) {
state.context = 1;
return 'keyword';
} else if (keywords2.test(w)) {
state.context = 2;
return 'keyword';
} else if (keywords3.test(w)) {
state.context = 3;
return 'keyword';
}
if (errors.test(w))
return 'error';
} else if (numbers.test(w)) {
return 'number';
} else {
return null;
}
} else if (stream.eat(';')) {
stream.skipToEnd();
return 'comment';
} else if (stream.eat('"')) {
while (w = stream.next()) {
if (w == '"')
break;
if (w == '\\')
stream.next();
}
return 'string';
} else if (stream.eat('\'')) {
if (stream.match(/\\?.'/))
return 'number';
} else if (stream.eat('.') || stream.sol() && stream.eat('#')) {
state.context = 4;
if (stream.eatWhile(/\w/))
return 'def';
} else if (stream.eat('$')) {
if (stream.eatWhile(/[\da-f]/i))
return 'number';
} else if (stream.eat('%')) {
if (stream.eatWhile(/[01]/))
return 'number';
} else {
stream.next();
}
return null;
}
};
});
CodeMirror.defineMIME("text/x-z80", "z80");