From 6a5906b0dada29d43be8af534d1de7659c826c48 Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Fri, 16 Mar 2018 20:25:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?lint=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _server/editor_multi.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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=''; From 12a7d213f2b08cbd5cf9b01bd77e48ac0b610c7a Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Sat, 17 Mar 2018 01:24:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4blockly=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _server/editor_blockly.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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']];