diff --git a/_server/editor_blockly.js b/_server/editor_blockly.js index bbd2be2d..049d0559 100644 --- a/_server/editor_blockly.js +++ b/_server/editor_blockly.js @@ -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']]; diff --git a/_server/editor_multi.js b/_server/editor_multi.js index 84416fae..d2797dda 100644 --- a/_server/editor_multi.js +++ b/_server/editor_multi.js @@ -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='';