mirror of
https://github.com/google/blockly.git
synced 2026-03-12 16:20:12 +01:00
Merge branch 'develop'
This commit is contained in:
@@ -859,8 +859,7 @@ var Blockly={Blocks:{}};
|
||||
Blockly.Workspace=function(a){this.id=Blockly.genUid();Blockly.Workspace.WorkspaceDB_[this.id]=this;this.options=a||{};this.RTL=!!this.options.RTL;this.topBlocks_=[];this.listeners_=[];this.undoStack_=[];this.redoStack_=[];this.blockDB_=Object.create(null)};Blockly.Workspace.prototype.rendered=!1;Blockly.Workspace.prototype.MAX_UNDO=1024;Blockly.Workspace.prototype.dispose=function(){this.listeners_.length=0;this.clear();delete Blockly.Workspace.WorkspaceDB_[this.id]};
|
||||
Blockly.Workspace.SCAN_ANGLE=3;Blockly.Workspace.prototype.addTopBlock=function(a){this.topBlocks_.push(a)};Blockly.Workspace.prototype.removeTopBlock=function(a){for(var b=!1,c,d=0;c=this.topBlocks_[d];d++)if(c==a){this.topBlocks_.splice(d,1);b=!0;break}if(!b)throw"Block not present in workspace's list of top-most blocks.";};
|
||||
Blockly.Workspace.prototype.getTopBlocks=function(a){var b=[].concat(this.topBlocks_);if(a&&1<b.length){var c=Math.sin(goog.math.toRadians(Blockly.Workspace.SCAN_ANGLE));this.RTL&&(c*=-1);b.sort(function(a,b){var g=a.getRelativeToSurfaceXY(),h=b.getRelativeToSurfaceXY();return g.y+c*g.x-(h.y+c*h.x)})}return b};Blockly.Workspace.prototype.getAllBlocks=function(){for(var a=this.getTopBlocks(!1),b=0;b<a.length;b++)a.push.apply(a,a[b].getChildren());return a};
|
||||
Blockly.Workspace.prototype.clear=function(){var a=Blockly.Events.getGroup();for(a||Blockly.Events.setGroup(!0);this.topBlocks_.length;)this.topBlocks_[0].dispose();a||Blockly.Events.setGroup(!1)};Blockly.Workspace.prototype.getWidth=function(){return 0};Blockly.Workspace.prototype.newBlock=function(a,b){return new Blockly.Block(this,a,b)};Blockly.Workspace.prototype.getBlockById=function(a){for(var b=this.getAllBlocks(),c=0,d;d=b[c];c++)if(d.id==a)return d;return null};
|
||||
Blockly.Workspace.prototype.remainingCapacity=function(){return isNaN(this.options.maxBlocks)?Infinity:this.options.maxBlocks-this.getAllBlocks().length};
|
||||
Blockly.Workspace.prototype.clear=function(){var a=Blockly.Events.getGroup();for(a||Blockly.Events.setGroup(!0);this.topBlocks_.length;)this.topBlocks_[0].dispose();a||Blockly.Events.setGroup(!1)};Blockly.Workspace.prototype.getWidth=function(){return 0};Blockly.Workspace.prototype.newBlock=function(a,b){return new Blockly.Block(this,a,b)};Blockly.Workspace.prototype.remainingCapacity=function(){return isNaN(this.options.maxBlocks)?Infinity:this.options.maxBlocks-this.getAllBlocks().length};
|
||||
Blockly.Workspace.prototype.undo=function(a){var b=a?this.redoStack_:this.undoStack_,c=a?this.undoStack_:this.redoStack_,d=b.pop();if(d){for(var f=[d];b.length&&d.group&&d.group==b[b.length-1].group;)f.push(b.pop());for(b=0;d=f[b];b++)c.push(d);f=Blockly.Events.filter(f,a);Blockly.Events.recordUndo=!1;for(b=0;d=f[b];b++)d.run(a);Blockly.Events.recordUndo=!0}};Blockly.Workspace.prototype.clearUndo=function(){this.undoStack_.length=0;this.redoStack_.length=0;Blockly.Events.clearPendingUndo()};
|
||||
Blockly.Workspace.prototype.addChangeListener=function(a){this.listeners_.push(a);return a};Blockly.Workspace.prototype.removeChangeListener=function(a){a=this.listeners_.indexOf(a);-1!=a&&this.listeners_.splice(a,1)};Blockly.Workspace.prototype.fireChangeListener=function(a){a.recordUndo&&(this.undoStack_.push(a),this.redoStack_.length=0,this.undoStack_.length>this.MAX_UNDO&&this.undoStack_.unshift());for(var b=0,c;c=this.listeners_[b];b++)c(a)};
|
||||
Blockly.Workspace.prototype.getBlockById=function(a){return this.blockDB_[a]||null};Blockly.Workspace.WorkspaceDB_=Object.create(null);Blockly.Workspace.getById=function(a){return Blockly.Workspace.WorkspaceDB_[a]||null};Blockly.Workspace.prototype.clear=Blockly.Workspace.prototype.clear;Blockly.Workspace.prototype.clearUndo=Blockly.Workspace.prototype.clearUndo;Blockly.Workspace.prototype.addChangeListener=Blockly.Workspace.prototype.addChangeListener;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -326,7 +326,7 @@ Blockly.inject.bindDocumentEvents_ = function() {
|
||||
|
||||
/**
|
||||
* Load sounds for the given workspace.
|
||||
* @param {string} options The path to the media directory.
|
||||
* @param {string} pathToMedia The path to the media directory.
|
||||
* @param {!Blockly.Workspace} workspace The workspace to load sounds for.
|
||||
* @private
|
||||
*/
|
||||
|
||||
@@ -185,22 +185,6 @@ Blockly.Workspace.prototype.newBlock = function(prototypeName, opt_id) {
|
||||
return new Blockly.Block(this, prototypeName, opt_id);
|
||||
};
|
||||
|
||||
/**
|
||||
* Finds the block with the specified ID in this workspace.
|
||||
* @param {string} id ID of block to find.
|
||||
* @return {Blockly.Block} The matching block, or null if not found.
|
||||
*/
|
||||
Blockly.Workspace.prototype.getBlockById = function(id) {
|
||||
// If this O(n) function fails to scale well, maintain a hash table of IDs.
|
||||
var blocks = this.getAllBlocks();
|
||||
for (var i = 0, block; block = blocks[i]; i++) {
|
||||
if (block.id == id) {
|
||||
return block;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
/**
|
||||
* The number of blocks that may be added to the workspace before reaching
|
||||
* the maxBlocks.
|
||||
|
||||
28
msg/js/bn.js
28
msg/js/bn.js
@@ -80,13 +80,13 @@ Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD = "তালিকা";
|
||||
Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP = "Add, remove, or reorder sections to reconfigure this list block."; // untranslated
|
||||
Blockly.Msg.LISTS_CREATE_WITH_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH = "create list with"; // untranslated
|
||||
Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP = "তালিকায় একটি পদ যোগ কর";
|
||||
Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP = "তালিকায় একটি পদ যোগ করে।";
|
||||
Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP = "যেকোন সংখ্যক পদ নিয়ে একটি তালিকা তৈরি করুন।";
|
||||
Blockly.Msg.LISTS_GET_INDEX_FIRST = "প্রথম";
|
||||
Blockly.Msg.LISTS_GET_INDEX_FROM_END = "# from end"; // untranslated
|
||||
Blockly.Msg.LISTS_GET_INDEX_FROM_END = "# শেষ থেকে";
|
||||
Blockly.Msg.LISTS_GET_INDEX_FROM_START = "#"; // untranslated
|
||||
Blockly.Msg.LISTS_GET_INDEX_GET = "get"; // untranslated
|
||||
Blockly.Msg.LISTS_GET_INDEX_GET_REMOVE = "get and remove"; // untranslated
|
||||
Blockly.Msg.LISTS_GET_INDEX_GET = "নিন";
|
||||
Blockly.Msg.LISTS_GET_INDEX_GET_REMOVE = "নিন ও সরান";
|
||||
Blockly.Msg.LISTS_GET_INDEX_LAST = "শেষ";
|
||||
Blockly.Msg.LISTS_GET_INDEX_RANDOM = "এলোমেলো";
|
||||
Blockly.Msg.LISTS_GET_INDEX_REMOVE = "অপসারণ";
|
||||
@@ -115,16 +115,16 @@ Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_END = "get sub-list from # from end";
|
||||
Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_START = "get sub-list from #"; // untranslated
|
||||
Blockly.Msg.LISTS_GET_SUBLIST_TAIL = ""; // untranslated
|
||||
Blockly.Msg.LISTS_GET_SUBLIST_TOOLTIP = "Creates a copy of the specified portion of a list."; // untranslated
|
||||
Blockly.Msg.LISTS_INDEX_OF_FIRST = "find first occurrence of item"; // untranslated
|
||||
Blockly.Msg.LISTS_INDEX_OF_FIRST = "আইটেমের প্রথম সংঘটন খুঁজুন";
|
||||
Blockly.Msg.LISTS_INDEX_OF_HELPURL = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list"; // untranslated
|
||||
Blockly.Msg.LISTS_INDEX_OF_LAST = "find last occurrence of item"; // untranslated
|
||||
Blockly.Msg.LISTS_INDEX_OF_LAST = "আইটেমের শেষ সংঘটন খুঁজুন";
|
||||
Blockly.Msg.LISTS_INDEX_OF_TOOLTIP = "Returns the index of the first/last occurrence of the item in the list. Returns 0 if item is not found."; // untranslated
|
||||
Blockly.Msg.LISTS_INLIST = "তালিকার মধ্যে";
|
||||
Blockly.Msg.LISTS_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Lists#is-empty"; // untranslated
|
||||
Blockly.Msg.LISTS_ISEMPTY_TITLE = "%1 খালি";
|
||||
Blockly.Msg.LISTS_ISEMPTY_TOOLTIP = "পাঠাবে সত্য যদি তালিকাটি খালি হয়।";
|
||||
Blockly.Msg.LISTS_LENGTH_HELPURL = "https://github.com/google/blockly/wiki/Lists#length-of"; // untranslated
|
||||
Blockly.Msg.LISTS_LENGTH_TITLE = "length of %1"; // untranslated
|
||||
Blockly.Msg.LISTS_LENGTH_TITLE = "%1-এর দৈর্ঘ্য";
|
||||
Blockly.Msg.LISTS_LENGTH_TOOLTIP = "একটি তালিকার দৈর্ঘ্য পাঠাবে।";
|
||||
Blockly.Msg.LISTS_REPEAT_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
|
||||
Blockly.Msg.LISTS_REPEAT_TITLE = "create list with item %1 repeated %2 times"; // untranslated
|
||||
@@ -163,9 +163,9 @@ Blockly.Msg.LOGIC_COMPARE_TOOLTIP_NEQ = "পাঠাবে সত্য যদ
|
||||
Blockly.Msg.LOGIC_NEGATE_HELPURL = "https://github.com/google/blockly/wiki/Logic#not"; // untranslated
|
||||
Blockly.Msg.LOGIC_NEGATE_TITLE = "%1 নয়";
|
||||
Blockly.Msg.LOGIC_NEGATE_TOOLTIP = "পাঠাবে সত্য যদি ইনপুট মিথ্যা হয়। পাঠাবে মিথ্যা যদি ইনপুট সত্য হয়।";
|
||||
Blockly.Msg.LOGIC_NULL = "নুল";
|
||||
Blockly.Msg.LOGIC_NULL = "কিছু না";
|
||||
Blockly.Msg.LOGIC_NULL_HELPURL = "https://en.wikipedia.org/wiki/Nullable_type"; // untranslated
|
||||
Blockly.Msg.LOGIC_NULL_TOOLTIP = "পাঠাবে নাল।";
|
||||
Blockly.Msg.LOGIC_NULL_TOOLTIP = "কিছু না ফেরত দিবে।";
|
||||
Blockly.Msg.LOGIC_OPERATION_AND = "এবং";
|
||||
Blockly.Msg.LOGIC_OPERATION_HELPURL = "https://github.com/google/blockly/wiki/Logic#logical-operations"; // untranslated
|
||||
Blockly.Msg.LOGIC_OPERATION_OR = "অথবা";
|
||||
@@ -184,7 +184,7 @@ Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS = "পাঠাবে দুটি স
|
||||
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY = "পাঠাবে দুটি সংখ্যার গুণফল।";
|
||||
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_POWER = "Return the first number raised to the power of the second number."; // untranslated
|
||||
Blockly.Msg.MATH_CHANGE_HELPURL = "https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter"; // untranslated
|
||||
Blockly.Msg.MATH_CHANGE_TITLE = "পরিবর্তন %1 দ্বারা %2";
|
||||
Blockly.Msg.MATH_CHANGE_TITLE = "%2 দ্বারা %1 পরিবর্তন";
|
||||
Blockly.Msg.MATH_CHANGE_TOOLTIP = "Add a number to variable '%1'."; // untranslated
|
||||
Blockly.Msg.MATH_CONSTANT_HELPURL = "https://en.wikipedia.org/wiki/Mathematical_constant"; // untranslated
|
||||
Blockly.Msg.MATH_CONSTANT_TOOLTIP = "Return one of the common constants: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…), or ∞ (infinity)."; // untranslated
|
||||
@@ -312,7 +312,7 @@ Blockly.Msg.TEXT_CHARAT_RANDOM = "get random letter"; // untranslated
|
||||
Blockly.Msg.TEXT_CHARAT_TAIL = ""; // untranslated
|
||||
Blockly.Msg.TEXT_CHARAT_TOOLTIP = "Returns the letter at the specified position."; // untranslated
|
||||
Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP = "লেখাটিতে একটি পদ যোগ করুন।";
|
||||
Blockly.Msg.TEXT_CREATE_JOIN_TITLE_JOIN = "সংযোগ কর";
|
||||
Blockly.Msg.TEXT_CREATE_JOIN_TITLE_JOIN = "যোগ";
|
||||
Blockly.Msg.TEXT_CREATE_JOIN_TOOLTIP = "Add, remove, or reorder sections to reconfigure this text block."; // untranslated
|
||||
Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_END = "to letter # from end"; // untranslated
|
||||
Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_START = "to letter #"; // untranslated
|
||||
@@ -337,10 +337,10 @@ Blockly.Msg.TEXT_JOIN_HELPURL = "https://github.com/google/blockly/wiki/Text#tex
|
||||
Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH = "create text with"; // untranslated
|
||||
Blockly.Msg.TEXT_JOIN_TOOLTIP = "Create a piece of text by joining together any number of items."; // untranslated
|
||||
Blockly.Msg.TEXT_LENGTH_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||
Blockly.Msg.TEXT_LENGTH_TITLE = "length of %1"; // untranslated
|
||||
Blockly.Msg.TEXT_LENGTH_TITLE = "%1-এর দৈর্ঘ্য";
|
||||
Blockly.Msg.TEXT_LENGTH_TOOLTIP = "Returns the number of letters (including spaces) in the provided text."; // untranslated
|
||||
Blockly.Msg.TEXT_PRINT_HELPURL = "https://github.com/google/blockly/wiki/Text#printing-text"; // untranslated
|
||||
Blockly.Msg.TEXT_PRINT_TITLE = "প্রিন্ট %1";
|
||||
Blockly.Msg.TEXT_PRINT_TITLE = "%1 মুদ্রণ করুন";
|
||||
Blockly.Msg.TEXT_PRINT_TOOLTIP = "Print the specified text, number or other value."; // untranslated
|
||||
Blockly.Msg.TEXT_PROMPT_HELPURL = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user"; // untranslated
|
||||
Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER = "Prompt for user for a number."; // untranslated
|
||||
@@ -361,7 +361,7 @@ Blockly.Msg.VARIABLES_GET_CREATE_SET = "Create 'set %1'"; // untranslated
|
||||
Blockly.Msg.VARIABLES_GET_HELPURL = "https://github.com/google/blockly/wiki/Variables#get"; // untranslated
|
||||
Blockly.Msg.VARIABLES_GET_TOOLTIP = "Returns the value of this variable."; // untranslated
|
||||
Blockly.Msg.VARIABLES_SET = "set %1 to %2"; // untranslated
|
||||
Blockly.Msg.VARIABLES_SET_CREATE_GET = "Create 'get %1'"; // untranslated
|
||||
Blockly.Msg.VARIABLES_SET_CREATE_GET = "'%1 নিন' তৈরি করুন";
|
||||
Blockly.Msg.VARIABLES_SET_HELPURL = "https://github.com/google/blockly/wiki/Variables#set"; // untranslated
|
||||
Blockly.Msg.VARIABLES_SET_TOOLTIP = "Sets this variable to be equal to the input."; // untranslated
|
||||
Blockly.Msg.PROCEDURES_DEFRETURN_TITLE = Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE;
|
||||
|
||||
@@ -355,7 +355,7 @@ Blockly.Msg.TEXT_TRIM_OPERATOR_LEFT = "왼쪽의 공백 문자 제거";
|
||||
Blockly.Msg.TEXT_TRIM_OPERATOR_RIGHT = "오른쪽의 공백 문자 제거";
|
||||
Blockly.Msg.TEXT_TRIM_TOOLTIP = "문장의 왼쪽/오른쪽/양쪽에서 스페이스 문자를 제거해 돌려줍니다.";
|
||||
Blockly.Msg.TODAY = "오늘";
|
||||
Blockly.Msg.UNDO = "Undo"; // untranslated
|
||||
Blockly.Msg.UNDO = "끄르다";
|
||||
Blockly.Msg.VARIABLES_DEFAULT_NAME = "항목";
|
||||
Blockly.Msg.VARIABLES_GET_CREATE_SET = "'집합 %1' 생성";
|
||||
Blockly.Msg.VARIABLES_GET_HELPURL = "https://ko.wikipedia.org/wiki/%EB%B3%80%EC%88%98_(%EC%BB%B4%ED%93%A8%ED%84%B0_%EA%B3%BC%ED%95%99)";
|
||||
|
||||
@@ -289,7 +289,7 @@ Blockly.Msg.PROCEDURES_MUTATORARG_TITLE = "invoernaam:";
|
||||
Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Een invoer aan de functie toevoegen.";
|
||||
Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "ingangen";
|
||||
Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Invoer van deze functie toevoegen, verwijderen of herordenen.";
|
||||
Blockly.Msg.REDO = "Redo"; // untranslated
|
||||
Blockly.Msg.REDO = "Opnieuw";
|
||||
Blockly.Msg.REMOVE_COMMENT = "Opmerking verwijderen";
|
||||
Blockly.Msg.RENAME_VARIABLE = "Variabele hernoemen...";
|
||||
Blockly.Msg.RENAME_VARIABLE_TITLE = "Alle variabelen \"%1\" hernoemen naar:";
|
||||
@@ -355,7 +355,7 @@ Blockly.Msg.TEXT_TRIM_OPERATOR_LEFT = "spaties van de linkerkant verwijderen van
|
||||
Blockly.Msg.TEXT_TRIM_OPERATOR_RIGHT = "spaties van de rechterkant verwijderen van";
|
||||
Blockly.Msg.TEXT_TRIM_TOOLTIP = "Geeft een kopie van de tekst met verwijderde spaties van één of beide kanten.";
|
||||
Blockly.Msg.TODAY = "Vandaag";
|
||||
Blockly.Msg.UNDO = "Undo"; // untranslated
|
||||
Blockly.Msg.UNDO = "Ongedaan maken";
|
||||
Blockly.Msg.VARIABLES_DEFAULT_NAME = "item";
|
||||
Blockly.Msg.VARIABLES_GET_CREATE_SET = "Maak \"verander %1\"";
|
||||
Blockly.Msg.VARIABLES_GET_HELPURL = "https://github.com/google/blockly/wiki/Variables#get";
|
||||
|
||||
@@ -38,7 +38,7 @@ Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE = "跳過這個迴圈的
|
||||
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING = "警告: 此積木僅可用於迴圈內。";
|
||||
Blockly.Msg.CONTROLS_FOREACH_HELPURL = "https://github.com/google/blockly/wiki/Loops#for-each"; // untranslated
|
||||
Blockly.Msg.CONTROLS_FOREACH_TITLE = "取出每個 %1 自列表 %2";
|
||||
Blockly.Msg.CONTROLS_FOREACH_TOOLTIP = "遍歷每個列表中的項目,將變數 '%1' 設定到該項目中,然後執行某些語句";
|
||||
Blockly.Msg.CONTROLS_FOREACH_TOOLTIP = "遍歷每個列表中的項目,將變數 '%1' 設定到該項目中,然後執行某些語句";
|
||||
Blockly.Msg.CONTROLS_FOR_HELPURL = "https://github.com/google/blockly/wiki/Loops#count-with"; // untranslated
|
||||
Blockly.Msg.CONTROLS_FOR_TITLE = "使用 %1 從範圍 %2 到 %3 每隔 %4";
|
||||
Blockly.Msg.CONTROLS_FOR_TOOLTIP = "從起始數到結尾數中取出變數 \"%1\" 的值,按指定的時間間隔,執行指定的積木。";
|
||||
@@ -383,4 +383,4 @@ Blockly.Msg.LISTS_CREATE_WITH_ITEM_TITLE = Blockly.Msg.VARIABLES_DEFAULT_NAME;
|
||||
Blockly.Msg.TEXT_APPEND_VARIABLE = Blockly.Msg.VARIABLES_DEFAULT_NAME;
|
||||
Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
|
||||
Blockly.Msg.LISTS_INDEX_OF_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
|
||||
Blockly.Msg.PROCEDURES_DEFRETURN_COMMENT = Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT;
|
||||
Blockly.Msg.PROCEDURES_DEFRETURN_COMMENT = Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT;
|
||||
Reference in New Issue
Block a user