Merge pull request #88 from zhaouv/v2.0-editor-docs-20180313
V2 0 editor docs 20180313
This commit is contained in:
commit
0811248bba
@ -213,6 +213,7 @@ var workspace = Blockly.inject(blocklyDiv,{
|
|||||||
toolbox: document.getElementById('toolbox'),
|
toolbox: document.getElementById('toolbox'),
|
||||||
zoom:{
|
zoom:{
|
||||||
controls: true,
|
controls: true,
|
||||||
|
wheel: false,//滚轮改为上下(shift:左右)翻滚
|
||||||
startScale: 1.0,
|
startScale: 1.0,
|
||||||
maxScale: 3,
|
maxScale: 3,
|
||||||
minScale: 0.3,
|
minScale: 0.3,
|
||||||
@ -229,6 +230,14 @@ window.addEventListener('resize', onresize, false);
|
|||||||
onresize();
|
onresize();
|
||||||
Blockly.svgResize(workspace);
|
Blockly.svgResize(workspace);
|
||||||
|
|
||||||
|
//Blockly.bindEventWithChecks_(editor_blockly.workspace.svgGroup_,"wheel",editor_blockly.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_();
|
||||||
|
}
|
||||||
|
|
||||||
var doubleClickCheck=[[0,'abc']];
|
var doubleClickCheck=[[0,'abc']];
|
||||||
function omitedcheckUpdateFunction(event) {
|
function omitedcheckUpdateFunction(event) {
|
||||||
|
|||||||
@ -28,8 +28,14 @@ codeEditor.on("keyup", function (cm, event) {
|
|||||||
|
|
||||||
editor_multi.id='';
|
editor_multi.id='';
|
||||||
editor_multi.isString=false;
|
editor_multi.isString=false;
|
||||||
|
editor_multi.lintAutocomplete=false;
|
||||||
|
|
||||||
editor_multi.show = function(){document.getElementById('left7').style='';}
|
editor_multi.show = function(){
|
||||||
|
if(codeEditor.getValue().slice(0,8)==='function')editor_multi.lintAutocomplete=true;
|
||||||
|
codeEditor.setOption("lint", editor_multi.lintAutocomplete);
|
||||||
|
codeEditor.setOption("autocomplete", editor_multi.lintAutocomplete);
|
||||||
|
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.indent = function(field){
|
editor_multi.indent = function(field){
|
||||||
@ -42,9 +48,12 @@ editor_multi.import = function(id_){
|
|||||||
if(!thisTr)return false;
|
if(!thisTr)return false;
|
||||||
var input = thisTr.children[2].children[0].children[0];
|
var input = thisTr.children[2].children[0].children[0];
|
||||||
var field = thisTr.children[0].getAttribute('title');
|
var field = thisTr.children[0].getAttribute('title');
|
||||||
|
var comment = thisTr.children[1].getAttribute('title');
|
||||||
if(!input.type || input.type!=='textarea')return false;
|
if(!input.type || input.type!=='textarea')return false;
|
||||||
editor_multi.id=id_;
|
editor_multi.id=id_;
|
||||||
editor_multi.isString=false;
|
editor_multi.isString=false;
|
||||||
|
editor_multi.lintAutocomplete=false;
|
||||||
|
if(field.indexOf('Effect') !== -1)editor_multi.lintAutocomplete=true;
|
||||||
if(input.value.slice(0,1)==='"'){
|
if(input.value.slice(0,1)==='"'){
|
||||||
editor_multi.isString=true;
|
editor_multi.isString=true;
|
||||||
codeEditor.setValue(JSON.parse(input.value)||'');
|
codeEditor.setValue(JSON.parse(input.value)||'');
|
||||||
@ -106,6 +115,7 @@ editor_multi.multiLineEdit = function(value,b,f,callback){
|
|||||||
multiLineArgs[0]=b;
|
multiLineArgs[0]=b;
|
||||||
multiLineArgs[1]=f;
|
multiLineArgs[1]=f;
|
||||||
multiLineArgs[2]=callback;
|
multiLineArgs[2]=callback;
|
||||||
|
editor_multi.lintAutocomplete=false;
|
||||||
editor_multi.show();
|
editor_multi.show();
|
||||||
}
|
}
|
||||||
editor_multi.multiLineDone = function(){
|
editor_multi.multiLineDone = function(){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user