Commit 76ffc8e5 authored by neil.fraser@gmail.com's avatar neil.fraser@gmail.com

Fix Toolbox API (issue 226).

git-svn-id: http://blockly.googlecode.com/svn/trunk@1724 c400ca83-b69d-9dd7-9705-49c6b8615e23
parent 7571ff88
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -53,16 +53,16 @@ Blockly.Toolbox.selectedOption_ = null;
* @private
*/
Blockly.Toolbox.CONFIG_ = {
indentWidth: 19,
cssRoot: 'blocklyTreeRoot',
cssHideRoot: 'blocklyHidden',
cssItem: '',
cssTreeRow: 'blocklyTreeRow',
cssItemLabel: 'blocklyTreeLabel',
cssTreeIcon: 'blocklyTreeIcon',
cssExpandedFolderIcon: 'blocklyTreeIconOpen',
cssFileIcon: 'blocklyTreeIconNone',
cssSelectedRow: 'blocklyTreeSelected'
'indentWidth': 19,
'cssRoot': 'blocklyTreeRoot',
'cssHideRoot': 'blocklyHidden',
'cssItem': '',
'cssTreeRow': 'blocklyTreeRow',
'cssItemLabel': 'blocklyTreeLabel',
'cssTreeIcon': 'blocklyTreeIcon',
'cssExpandedFolderIcon': 'blocklyTreeIconOpen',
'cssFileIcon': 'blocklyTreeIconNone',
'cssSelectedRow': 'blocklyTreeSelected'
};
/**
......@@ -292,23 +292,13 @@ Blockly.Toolbox.TreeNode = function(html, opt_config, opt_domHelper) {
};
goog.inherits(Blockly.Toolbox.TreeNode, goog.ui.tree.TreeNode);
/**
* Do not show the +/- icon.
* @return {string} The source for the icon.
* @override
*/
Blockly.Toolbox.TreeNode.prototype.getExpandIconHtml = function() {
return '<span></span>';
};
/**
* Supress population of the +/- icon.
* @return {null} Null.
* @return {!goog.html.SafeHtml} The source for the icon.
* @protected
* @override
*/
Blockly.Toolbox.TreeNode.prototype.getExpandIconElement = function() {
return null;
goog.ui.tree.BaseNode.prototype.getExpandIconSafeHtml = function() {
return goog.html.SafeHtml.create('span', {});
};
/**
......
......@@ -5,7 +5,7 @@
// Copyright 2014 Google Inc. Apache License 2.0
Blockly.Dart=new Blockly.Generator("Dart");Blockly.Dart.addReservedWords("assert,break,case,catch,class,const,continue,default,do,else,enum,extends,false,final,finally,for,if,in,is,new,null,rethrow,return,super,switch,this,throw,true,try,var,void,while,with,print,identityHashCode,identical,BidirectionalIterator,Comparable,double,Function,int,Invocation,Iterable,Iterator,List,Map,Match,num,Pattern,RegExp,Set,StackTrace,String,StringSink,Type,bool,DateTime,Deprecated,Duration,Expando,Null,Object,RuneIterator,Runes,Stopwatch,StringBuffer,Symbol,Uri,Comparator,AbstractClassInstantiationError,ArgumentError,AssertionError,CastError,ConcurrentModificationError,CyclicInitializationError,Error,Exception,FallThroughError,FormatException,IntegerDivisionByZeroException,NoSuchMethodError,NullThrownError,OutOfMemoryError,RangeError,StackOverflowError,StateError,TypeError,UnimplementedError,UnsupportedError");
Blockly.Dart.ORDER_ATOMIC=0;Blockly.Dart.ORDER_UNARY_POSTFIX=1;Blockly.Dart.ORDER_UNARY_PREFIX=2;Blockly.Dart.ORDER_MULTIPLICATIVE=3;Blockly.Dart.ORDER_ADDITIVE=4;Blockly.Dart.ORDER_SHIFT=5;Blockly.Dart.ORDER_BITWISE_AND=6;Blockly.Dart.ORDER_BITWISE_XOR=7;Blockly.Dart.ORDER_BITWISE_OR=8;Blockly.Dart.ORDER_RELATIONAL=9;Blockly.Dart.ORDER_EQUALITY=10;Blockly.Dart.ORDER_LOGICAL_AND=11;Blockly.Dart.ORDER_LOGICAL_OR=12;Blockly.Dart.ORDER_CONDITIONAL=13;Blockly.Dart.ORDER_CASCADE=14;
Blockly.Dart.ORDER_ASSIGNMENT=15;Blockly.Dart.ORDER_NONE=99;Blockly.Dart.INFINITE_LOOP_TRAP=null;
Blockly.Dart.ORDER_ASSIGNMENT=15;Blockly.Dart.ORDER_NONE=99;
Blockly.Dart.init=function(){Blockly.Dart.definitions_=Object.create(null);Blockly.Dart.functionNames_=Object.create(null);if(Blockly.Variables){Blockly.Dart.variableDB_?Blockly.Dart.variableDB_.reset():Blockly.Dart.variableDB_=new Blockly.Names(Blockly.Dart.RESERVED_WORDS_);for(var a=[],b=Blockly.Variables.allVariables(),c=0;c<b.length;c++)a[c]="var "+Blockly.Dart.variableDB_.getName(b[c],Blockly.Variables.NAME_TYPE)+";";Blockly.Dart.definitions_.variables=a.join("\n")}};
Blockly.Dart.finish=function(a){a&&(a=this.prefixLines(a,Blockly.Dart.INDENT));a="main() {\n"+a+"}";var b=[],c=[],d;for(d in Blockly.Dart.definitions_){var e=Blockly.Dart.definitions_[d];e.match(/^import\s/)?b.push(e):c.push(e)}return(b.join("\n")+"\n\n"+c.join("\n\n")).replace(/\n\n+/g,"\n\n").replace(/\n*$/,"\n\n\n")+a};Blockly.Dart.scrubNakedValue=function(a){return a+";\n"};
Blockly.Dart.quote_=function(a){a=a.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n").replace(/\$/g,"\\$").replace(/'/g,"\\'");return"'"+a+"'"};
......@@ -15,7 +15,7 @@ Blockly.Dart.colour={};Blockly.Dart.addReservedWords("Math");Blockly.Dart.colour
Blockly.Dart.colour_random=function(a){Blockly.Dart.definitions_.import_dart_math="import 'dart:math' as Math;";return[Blockly.Dart.provideFunction_("colour_random",["String "+Blockly.Dart.FUNCTION_NAME_PLACEHOLDER_+"() {"," String hex = '0123456789abcdef';"," var rnd = new Math.Random();"," return '#${hex[rnd.nextInt(16)]}${hex[rnd.nextInt(16)]}'"," '${hex[rnd.nextInt(16)]}${hex[rnd.nextInt(16)]}'"," '${hex[rnd.nextInt(16)]}${hex[rnd.nextInt(16)]}';","}"])+"()",Blockly.Dart.ORDER_UNARY_POSTFIX]};
Blockly.Dart.colour_rgb=function(a){var b=Blockly.Dart.valueToCode(a,"RED",Blockly.Dart.ORDER_NONE)||0,c=Blockly.Dart.valueToCode(a,"GREEN",Blockly.Dart.ORDER_NONE)||0;a=Blockly.Dart.valueToCode(a,"BLUE",Blockly.Dart.ORDER_NONE)||0;Blockly.Dart.definitions_.import_dart_math="import 'dart:math' as Math;";return[Blockly.Dart.provideFunction_("colour_rgb",["String "+Blockly.Dart.FUNCTION_NAME_PLACEHOLDER_+"(num r, num g, num b) {"," num rn = (Math.max(Math.min(r, 1), 0) * 255).round();"," String rs = rn.toInt().toRadixString(16);",
" rs = '0$rs';"," rs = rs.substring(rs.length - 2);"," num gn = (Math.max(Math.min(g, 1), 0) * 255).round();"," String gs = gn.toInt().toRadixString(16);"," gs = '0$gs';"," gs = gs.substring(gs.length - 2);"," num bn = (Math.max(Math.min(b, 1), 0) * 255).round();"," String bs = bn.toInt().toRadixString(16);"," bs = '0$bs';"," bs = bs.substring(bs.length - 2);"," return '#$rs$gs$bs';","}"])+"("+b+", "+c+", "+a+")",Blockly.Dart.ORDER_UNARY_POSTFIX]};
Blockly.Dart.colour_blend=function(a){var b=Blockly.Dart.valueToCode(a,"COLOUR1",Blockly.Dart.ORDER_NONE)||"'#000000'",c=Blockly.Dart.valueToCode(a,"COLOUR2",Blockly.Dart.ORDER_NONE)||"'#000000'";a=Blockly.Dart.valueToCode(a,"RATIO",Blockly.Dart.ORDER_NONE)||0.5;Blockly.Dart.definitions_.import_dart_math="import 'dart:math' as Math;";return[Blockly.Dart.provideFunction_("colour_blend",["String "+Blockly.Dart.FUNCTION_NAME_PLACEHOLDER_+"(String c1, String c2, num ratio) {"," ratio = Math.max(Math.min(ratio, 1), 0);",
Blockly.Dart.colour_blend=function(a){var b=Blockly.Dart.valueToCode(a,"COLOUR1",Blockly.Dart.ORDER_NONE)||"'#000000'",c=Blockly.Dart.valueToCode(a,"COLOUR2",Blockly.Dart.ORDER_NONE)||"'#000000'";a=Blockly.Dart.valueToCode(a,"RATIO",Blockly.Dart.ORDER_NONE)||.5;Blockly.Dart.definitions_.import_dart_math="import 'dart:math' as Math;";return[Blockly.Dart.provideFunction_("colour_blend",["String "+Blockly.Dart.FUNCTION_NAME_PLACEHOLDER_+"(String c1, String c2, num ratio) {"," ratio = Math.max(Math.min(ratio, 1), 0);",
" int r1 = int.parse('0x${c1.substring(1, 3)}');"," int g1 = int.parse('0x${c1.substring(3, 5)}');"," int b1 = int.parse('0x${c1.substring(5, 7)}');"," int r2 = int.parse('0x${c2.substring(1, 3)}');"," int g2 = int.parse('0x${c2.substring(3, 5)}');"," int b2 = int.parse('0x${c2.substring(5, 7)}');"," num rn = (r1 * (1 - ratio) + r2 * ratio).round();"," String rs = rn.toInt().toRadixString(16);"," num gn = (g1 * (1 - ratio) + g2 * ratio).round();"," String gs = gn.toInt().toRadixString(16);",
" num bn = (b1 * (1 - ratio) + b2 * ratio).round();"," String bs = bn.toInt().toRadixString(16);"," rs = '0$rs';"," rs = rs.substring(rs.length - 2);"," gs = '0$gs';"," gs = gs.substring(gs.length - 2);"," bs = '0$bs';"," bs = bs.substring(bs.length - 2);"," return '#$rs$gs$bs';","}"])+"("+b+", "+c+", "+a+")",Blockly.Dart.ORDER_UNARY_POSTFIX]};
// Copyright 2014 Google Inc. Apache License 2.0
......
This diff is collapsed.
......@@ -256,7 +256,7 @@ Blockly.Msg.MATH_TRIG_TOOLTIP_ATAN = "Return the arctangent of a number.";
Blockly.Msg.MATH_TRIG_TOOLTIP_COS = "Return the cosine of a degree (not radian).";
Blockly.Msg.MATH_TRIG_TOOLTIP_SIN = "Return the sine of a degree (not radian).";
Blockly.Msg.MATH_TRIG_TOOLTIP_TAN = "Return the tangent of a degree (not radian).";
Blockly.Msg.ME = "Me"; // untranslated
Blockly.Msg.ME = "אותי";
Blockly.Msg.NEW_VARIABLE = "משתנה חדש...";
Blockly.Msg.NEW_VARIABLE_TITLE = "שם המשתנה החדש:";
Blockly.Msg.ORDINAL_NUMBER_SUFFIX = ""; // untranslated
......
......@@ -102,7 +102,7 @@ Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST = "첫 번째 아이템을
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM_END = "특정 위치의 아이템을 찾아내 돌려주고, 그 아이템을 리스트에서 삭제합니다. #1 는 마지막 아이템.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM_START = "특정 위치의 아이템을 찾아내 돌려주고, 그 아이템을 리스트에서 삭제합니다. #1 는 첫번째 아이템.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST = "마지막 아이템을 찾아내 돌려주고, 그 아이템을 리스트에서 삭제합니다.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM = "랜덤 위치의 아이템을 찾아내 돌려주고,그 아이템을 리스트에서 삭제합니다.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM = "목록에서 임의 위치의 아이템을 찾아내 삭제하고 돌려줍니다.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST = "리스트에서 첫 번째 아이템을 삭제합니다.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM_END = "특정 위치의 아이템을 찾아내 삭제합니다. #1 는 마지막 아이템.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM_START = "특정 위치의 아이템을 찾아내 삭제합니다. #1 는 첫번째 아이템.";
......@@ -138,12 +138,12 @@ Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST = "아이템을 리스트의
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM_END = "아이템을 리스트의 특정 위치에 삽입합니다. 마지막 아이템은 #1.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM_START = "아이템을 리스트의 특정 위치에 삽입합니다. 첫번째 아이템은 #1.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST = "리스트의 마지막에 아이템을 추가합니다.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM = "리스트의 랜덤 위치에 아이템을 삽입합니다.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM = "목록에서 임의 위치에 아이템을 삽입합니다.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST = "첫 번째 위치의 아이템으로 설정합니다.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "특정 번째 위치의 아이템으로 설정합니다. #1 는 마지막 아이템.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "특정 번째 위치의 아이템으로 설정합니다. #1 는 첫번째 아이템.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "마지막 아이템으로 설정합니다.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "랜덤 위치의 아이템으로 설정합니다.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "목록에서 임의 위치의 아이템을 설정합니다.";
Blockly.Msg.LISTS_TOOLTIP = "목록이 비었을 때 참을 반환합니다.";
Blockly.Msg.LOGIC_BOOLEAN_FALSE = "거짓";
Blockly.Msg.LOGIC_BOOLEAN_HELPURL = "http://code.google.com/p/blockly/wiki/True_False";
......@@ -209,7 +209,7 @@ Blockly.Msg.MATH_ONLIST_OPERATOR_MAX = "최대값";
Blockly.Msg.MATH_ONLIST_OPERATOR_MEDIAN = "중간값";
Blockly.Msg.MATH_ONLIST_OPERATOR_MIN = "최소값";
Blockly.Msg.MATH_ONLIST_OPERATOR_MODE = "가장 여러 개 있는 값";
Blockly.Msg.MATH_ONLIST_OPERATOR_RANDOM = "랜덤 아이템";
Blockly.Msg.MATH_ONLIST_OPERATOR_RANDOM = "목록의 임의 아이템";
Blockly.Msg.MATH_ONLIST_OPERATOR_STD_DEV = "표준 편차";
Blockly.Msg.MATH_ONLIST_OPERATOR_SUM = "";
Blockly.Msg.MATH_ONLIST_TOOLTIP_AVERAGE = "리스트에 들어있는 수(값)들에 대해, 산술 평균(arithmetic mean) 한 값을 돌려줍니다.";
......@@ -217,16 +217,16 @@ Blockly.Msg.MATH_ONLIST_TOOLTIP_MAX = "리스트에 들어있는 수(값) 들
Blockly.Msg.MATH_ONLIST_TOOLTIP_MEDIAN = "리스트에 들어있는 수(값) 들 중, 중간(median) 수(값)를 돌려줍니다.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MIN = "리스트에 들어있는 수(값) 들 중, 가장 작은(min) 수(값)를 돌려줍니다.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MODE = "리스트에 들어있는 아이템들 중에서, 가장 여러 번 들어있는 아이템들을 리스트로 만들어 돌려줍니다. (최빈값, modes)";
Blockly.Msg.MATH_ONLIST_TOOLTIP_RANDOM = "리스트에 들어있는 아이템들 중에서, 랜덤(random)으로 아이템을 돌려줍니다.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_RANDOM = "목록에서 임의의 아이템을 돌려줍니다.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_STD_DEV = "리스트에 들어있는 수(값)들에 대해, 표준 편차(standard deviation) 를 구해 돌려줍니다.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_SUM = "리스트에 들어있는 수(값)들을, 모두 합(sum) 한, 총합(sum)을 돌려줍니다.";
Blockly.Msg.MATH_POWER_SYMBOL = "^";
Blockly.Msg.MATH_RANDOM_FLOAT_HELPURL = "https://en.wikipedia.org/wiki/Random_number_generation";
Blockly.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM = "랜덤 실수(0.0<= f <1.0)";
Blockly.Msg.MATH_RANDOM_FLOAT_TOOLTIP = "랜덤 실수 값(0.0<= f <1.0)을 돌려줍니다.";
Blockly.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM = "임의 분수";
Blockly.Msg.MATH_RANDOM_FLOAT_TOOLTIP = "0.0 (포함)과 1.0 (배타적) 사이의 임의 분수 값을 돌려줍니다.";
Blockly.Msg.MATH_RANDOM_INT_HELPURL = "https://en.wikipedia.org/wiki/Random_number_generation";
Blockly.Msg.MATH_RANDOM_INT_TITLE = "랜덤정수(%1<= n <=%2)";
Blockly.Msg.MATH_RANDOM_INT_TOOLTIP = "주어진 범위에서, 랜덤 정수값을 돌려줍니다.";
Blockly.Msg.MATH_RANDOM_INT_TOOLTIP = "두 주어진 제한된 범위 사이의 임의 정수값을 돌려줍니다.";
Blockly.Msg.MATH_ROUND_HELPURL = "https://en.wikipedia.org/wiki/Rounding";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUND = "반올림";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN = "버림";
......
......@@ -256,7 +256,7 @@ Blockly.Msg.MATH_TRIG_TOOLTIP_ATAN = "Returner arctangens til et tall.";
Blockly.Msg.MATH_TRIG_TOOLTIP_COS = "Returner cosinus av en vinkel (ikke radian).";
Blockly.Msg.MATH_TRIG_TOOLTIP_SIN = "Returner sinus av en vinkel (ikke radian).";
Blockly.Msg.MATH_TRIG_TOOLTIP_TAN = "Returner tangenten av en vinkel (ikke radian).";
Blockly.Msg.ME = "Me"; // untranslated
Blockly.Msg.ME = "Jeg";
Blockly.Msg.NEW_VARIABLE = "Ny variabel...";
Blockly.Msg.NEW_VARIABLE_TITLE = "Nytt variabelnavn:";
Blockly.Msg.ORDINAL_NUMBER_SUFFIX = "";
......
......@@ -5,7 +5,7 @@
// Copyright 2012 Google Inc. Apache License 2.0
Blockly.Python=new Blockly.Generator("Python");Blockly.Python.addReservedWords("and,as,assert,break,class,continue,def,del,elif,else,except,exec,finally,for,from,global,if,import,in,is,lambda,not,or,pass,print,raise,return,try,while,with,yield,True,False,None,NotImplemented,Ellipsis,__debug__,quit,exit,copyright,license,credits,abs,divmod,input,open,staticmethod,all,enumerate,int,ord,str,any,eval,isinstance,pow,sum,basestring,execfile,issubclass,print,super,bin,file,iter,property,tuple,bool,filter,len,range,type,bytearray,float,list,raw_input,unichr,callable,format,locals,reduce,unicode,chr,frozenset,long,reload,vars,classmethod,getattr,map,repr,xrange,cmp,globals,max,reversed,zip,compile,hasattr,memoryview,round,__import__,complex,hash,min,set,apply,delattr,help,next,setattr,buffer,dict,hex,object,slice,coerce,dir,id,oct,sorted,intern");
Blockly.Python.ORDER_ATOMIC=0;Blockly.Python.ORDER_COLLECTION=1;Blockly.Python.ORDER_STRING_CONVERSION=1;Blockly.Python.ORDER_MEMBER=2;Blockly.Python.ORDER_FUNCTION_CALL=2;Blockly.Python.ORDER_EXPONENTIATION=3;Blockly.Python.ORDER_UNARY_SIGN=4;Blockly.Python.ORDER_BITWISE_NOT=4;Blockly.Python.ORDER_MULTIPLICATIVE=5;Blockly.Python.ORDER_ADDITIVE=6;Blockly.Python.ORDER_BITWISE_SHIFT=7;Blockly.Python.ORDER_BITWISE_AND=8;Blockly.Python.ORDER_BITWISE_XOR=9;Blockly.Python.ORDER_BITWISE_OR=10;
Blockly.Python.ORDER_RELATIONAL=11;Blockly.Python.ORDER_LOGICAL_NOT=12;Blockly.Python.ORDER_LOGICAL_AND=13;Blockly.Python.ORDER_LOGICAL_OR=14;Blockly.Python.ORDER_CONDITIONAL=15;Blockly.Python.ORDER_LAMBDA=16;Blockly.Python.ORDER_NONE=99;Blockly.Python.INFINITE_LOOP_TRAP=null;
Blockly.Python.ORDER_RELATIONAL=11;Blockly.Python.ORDER_LOGICAL_NOT=12;Blockly.Python.ORDER_LOGICAL_AND=13;Blockly.Python.ORDER_LOGICAL_OR=14;Blockly.Python.ORDER_CONDITIONAL=15;Blockly.Python.ORDER_LAMBDA=16;Blockly.Python.ORDER_NONE=99;
Blockly.Python.init=function(){Blockly.Python.definitions_=Object.create(null);Blockly.Python.functionNames_=Object.create(null);if(Blockly.Variables){Blockly.Python.variableDB_?Blockly.Python.variableDB_.reset():Blockly.Python.variableDB_=new Blockly.Names(Blockly.Python.RESERVED_WORDS_);for(var a=[],b=Blockly.Variables.allVariables(),c=0;c<b.length;c++)a[c]=Blockly.Python.variableDB_.getName(b[c],Blockly.Variables.NAME_TYPE)+" = None";Blockly.Python.definitions_.variables=a.join("\n")}};
Blockly.Python.finish=function(a){var b=[],c=[],d;for(d in Blockly.Python.definitions_){var e=Blockly.Python.definitions_[d];e.match(/^(from\s+\S+\s+)?import\s+\S+/)?b.push(e):c.push(e)}return(b.join("\n")+"\n\n"+c.join("\n\n")).replace(/\n\n+/g,"\n\n").replace(/\n*$/,"\n\n\n")+a};Blockly.Python.scrubNakedValue=function(a){return a+"\n"};Blockly.Python.quote_=function(a){a=a.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n").replace(/\%/g,"\\%").replace(/'/g,"\\'");return"'"+a+"'"};
Blockly.Python.scrub_=function(a,b){if(null===b)return"";var c="";if(!a.outputConnection||!a.outputConnection.targetConnection){var d=a.getCommentText();d&&(c+=this.prefixLines(d,"# ")+"\n");for(var e=0;e<a.inputList.length;e++)a.inputList[e].type==Blockly.INPUT_VALUE&&(d=a.inputList[e].connection.targetBlock())&&(d=this.allNestedComments(d))&&(c+=this.prefixLines(d,"# "))}e=a.nextConnection&&a.nextConnection.targetBlock();e=this.blockToCode(e);return c+b+e};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment