Merge pull request #90 from zhaouv/v2.0-editor-docs-20180313

lint检查
This commit is contained in:
Zhang Chen 2018-03-17 11:55:59 +08:00 committed by GitHub
commit c791566044
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -230,13 +230,14 @@ window.addEventListener('resize', onresize, false);
onresize();
Blockly.svgResize(workspace);
//Blockly.bindEventWithChecks_(editor_blockly.workspace.svgGroup_,"wheel",editor_blockly.workspace,function(e){});
//Blockly.bindEventWithChecks_(workspace.svgGroup_,"wheel",workspace,function(e){});
document.getElementById('blocklyDiv').onmousewheel = function(e){
//console.log(e);
e.preventDefault();
var hvScroll = e.shiftKey?'hScroll':'vScroll';
editor_blockly.workspace.scrollbar[hvScroll].handlePosition_+=( ((e.deltaY||0)+(e.detail||0)) >0?20:-20);
editor_blockly.workspace.scrollbar[hvScroll].onScroll_();
workspace.scrollbar[hvScroll].handlePosition_+=( ((e.deltaY||0)+(e.detail||0)) <0?20:-20);
workspace.scrollbar[hvScroll].onScroll_();
workspace.setScale(workspace.scale);
}
var doubleClickCheck=[[0,'abc']];

View File

@ -31,7 +31,9 @@ editor_multi.isString=false;
editor_multi.lintAutocomplete=false;
editor_multi.show = function(){
if(codeEditor.getValue().slice(0,8)==='function')editor_multi.lintAutocomplete=true;
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);
document.getElementById('left7').style='';