Lint Checkbox
This commit is contained in:
parent
7f3b86e2f7
commit
e88c5ad67f
@ -109,6 +109,7 @@
|
|||||||
function getCompletions(token, context, keywords, options) {
|
function getCompletions(token, context, keywords, options) {
|
||||||
var found = [], start = token.string, global = options && options.globalScope || window;
|
var found = [], start = token.string, global = options && options.globalScope || window;
|
||||||
function maybeAdd(str) {
|
function maybeAdd(str) {
|
||||||
|
if (str==null || str==undefined) return;
|
||||||
if (str.lastIndexOf(start, 0) == 0 && !arrayContains(found, str)) found.push(str);
|
if (str.lastIndexOf(start, 0) == 0 && !arrayContains(found, str)) found.push(str);
|
||||||
}
|
}
|
||||||
function gatherCompletions(obj) {
|
function gatherCompletions(obj) {
|
||||||
|
|||||||
@ -172,9 +172,13 @@ div.etableInputDiv {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.etableInputDiv input[type="checkbox"] {
|
.etableInputDiv input[type="checkbox"] {
|
||||||
position:relative;
|
width: 16px;
|
||||||
top: 35%;
|
height: 16px;
|
||||||
height: 30px;
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
margin-left: -8px;
|
||||||
|
margin-top: -8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.etableInputDiv select {
|
.etableInputDiv select {
|
||||||
|
|||||||
@ -34,11 +34,19 @@ editor_multi.show = function(){
|
|||||||
var valueNow = codeEditor.getValue();
|
var valueNow = codeEditor.getValue();
|
||||||
//try{eval('function _asdygakufyg_() { return '+valueNow+'\n}');editor_multi.lintAutocomplete=true;}catch(ee){}
|
//try{eval('function _asdygakufyg_() { return '+valueNow+'\n}');editor_multi.lintAutocomplete=true;}catch(ee){}
|
||||||
if(valueNow.slice(0,8)==='function')editor_multi.lintAutocomplete=true;
|
if(valueNow.slice(0,8)==='function')editor_multi.lintAutocomplete=true;
|
||||||
codeEditor.setOption("lint", editor_multi.lintAutocomplete);
|
editor_multi.setLint();
|
||||||
codeEditor.setOption("autocomplete", editor_multi.lintAutocomplete);
|
|
||||||
document.getElementById('left7').style='';
|
document.getElementById('left7').style='';
|
||||||
}
|
}
|
||||||
editor_multi.hide = function(){document.getElementById('left7').style='z-index:-1;opacity: 0;';}
|
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){
|
editor_multi.indent = function(field){
|
||||||
if(editor && editor.mode && editor.mode.indent)return editor.mode.indent(field);
|
if(editor && editor.mode && editor.mode.indent)return editor.mode.indent(field);
|
||||||
|
|||||||
@ -142,6 +142,8 @@
|
|||||||
<div id="left7" style="z-index:-1;opacity: 0;"><!-- 多行文本编辑器 -->
|
<div id="left7" style="z-index:-1;opacity: 0;"><!-- 多行文本编辑器 -->
|
||||||
<button onclick="editor_multi.confirm()">confirm</button>
|
<button onclick="editor_multi.confirm()">confirm</button>
|
||||||
<button onclick="editor_multi.cancel()">cancel</button>
|
<button onclick="editor_multi.cancel()">cancel</button>
|
||||||
|
<input type="checkbox" onclick="editor_multi.toggerLint()" id="lintCheckbox" style="vertical-align: bottom;margin-left:6px" />
|
||||||
|
<span style="vertical-align: bottom; margin-left: -3px">Lint</span>
|
||||||
<textarea id="multiLineCode" name="multiLineCode"></textarea>
|
<textarea id="multiLineCode" name="multiLineCode"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div id="left8" class='leftTab' style="z-index:-1;opacity: 0;"><!-- functions -->
|
<div id="left8" class='leftTab' style="z-index:-1;opacity: 0;"><!-- functions -->
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user