diff --git a/_server/CodeMirror/javascript-hint.js b/_server/CodeMirror/javascript-hint.js index 6331fb81..21d1fe9a 100644 --- a/_server/CodeMirror/javascript-hint.js +++ b/_server/CodeMirror/javascript-hint.js @@ -109,6 +109,7 @@ function getCompletions(token, context, keywords, options) { var found = [], start = token.string, global = options && options.globalScope || window; function maybeAdd(str) { + if (str==null || str==undefined) return; if (str.lastIndexOf(start, 0) == 0 && !arrayContains(found, str)) found.push(str); } function gatherCompletions(obj) { diff --git a/_server/css/editor_mode.css b/_server/css/editor_mode.css index a638df42..3600a8b7 100644 --- a/_server/css/editor_mode.css +++ b/_server/css/editor_mode.css @@ -172,9 +172,13 @@ div.etableInputDiv { } .etableInputDiv input[type="checkbox"] { - position:relative; - top: 35%; - height: 30px; + width: 16px; + height: 16px; + position: absolute; + left: 50%; + top: 50%; + margin-left: -8px; + margin-top: -8px; } .etableInputDiv select { diff --git a/_server/editor_multi.js b/_server/editor_multi.js index 284d7c52..0a918926 100644 --- a/_server/editor_multi.js +++ b/_server/editor_multi.js @@ -34,11 +34,19 @@ editor_multi.show = function(){ var valueNow = codeEditor.getValue(); //try{eval('function _asdygakufyg_() { return '+valueNow+'\n}');editor_multi.lintAutocomplete=true;}catch(ee){} if(valueNow.slice(0,8)==='function')editor_multi.lintAutocomplete=true; - codeEditor.setOption("lint", editor_multi.lintAutocomplete); - codeEditor.setOption("autocomplete", editor_multi.lintAutocomplete); + editor_multi.setLint(); document.getElementById('left7').style=''; } editor_multi.hide = function(){document.getElementById('left7').style='z-index:-1;opacity: 0;';} +editor_multi.setLint = function() { + codeEditor.setOption("lint", editor_multi.lintAutocomplete); + codeEditor.setOption("autocomplete", editor_multi.lintAutocomplete); + document.getElementById("lintCheckbox").checked = editor_multi.lintAutocomplete; +} +editor_multi.toggerLint = function() { + editor_multi.lintAutocomplete = document.getElementById("lintCheckbox").checked; + editor_multi.setLint(); +} editor_multi.indent = function(field){ if(editor && editor.mode && editor.mode.indent)return editor.mode.indent(field); diff --git a/editor.html b/editor.html index 77ed9aae..cf24e470 100644 --- a/editor.html +++ b/editor.html @@ -142,6 +142,8 @@
+ + Lint