Initial gCodeViewer (http://github.com/hudbrog/gCodeViewer) integration

This commit is contained in:
Alex Ustyantsev committed 2013-02-03 12:01:01 +03:00
1 parent 84c9403e65
commit 7c00dd5594
45 files changed
+51482 -3

No files matched your search

@@ -0,0 +1,32 @@
CodeMirror.defineMode("diff", function() {
var TOKEN_NAMES = {
'G': 'tag',
'M': 'string',
';': 'meta'
};
return {
token: function(stream) {
var tw_pos = stream.string.search(/[\t ]+?$/);
if (!stream.sol() || tw_pos === 0) {
stream.skipToEnd();
return ("error " + (
TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, '');
}
var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd();
if (tw_pos === -1) {
stream.skipToEnd();
} else {
stream.pos = tw_pos;
}
return token_name;
}
};
});
CodeMirror.defineMIME("text/x-diff", "diff");