New CodeMirror Library version 3.16

Replacing the CodeMirror Version to 3.16
Adding files to ..templates/designer/index.html to  use the new extended control codeMirror.js and codeMirrorField.js
This commit is contained in:
jennylee
2014-02-13 15:19:17 -04:00
parent 054a8d2021
commit 5d3d7392f0
309 changed files with 21218 additions and 12102 deletions

View File

@@ -31,19 +31,17 @@
var completionList = getCompletions(token, context);
completionList = completionList.sort();
//prevent autocomplete for last word, instead show dropdown with one word
if(completionList.length == 1) {
completionList.push(" ");
}
return {list: completionList,
from: CodeMirror.Pos(cur.line, token.start),
to: CodeMirror.Pos(cur.line, token.end)};
}
CodeMirror.pythonHint = function(editor) {
function pythonHint(editor) {
return scriptHint(editor, pythonKeywordsU, function (e, cur) {return e.getTokenAt(cur);});
};
}
CodeMirror.pythonHint = pythonHint; // deprecated
CodeMirror.registerHelper("hint", "python", pythonHint);
var pythonKeywords = "and del from not while as elif global or with assert else if pass yield"
+ "break except import print class exec in raise continue finally is return def for lambda try";
@@ -64,7 +62,7 @@
function getCompletions(token, context) {
var found = [], start = token.string;
function maybeAdd(str) {
if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);
if (str.lastIndexOf(start, 0) == 0 && !arrayContains(found, str)) found.push(str);
}
function gatherCompletions(_obj) {