From 2ca6ababa58f53f532bce6c56d057e9b17a93065 Mon Sep 17 00:00:00 2001 From: Tnks2U Date: Thu, 16 Mar 2023 15:13:28 +0900 Subject: [PATCH 1/9] =?UTF-8?q?feat:=20=ED=8C=90=EB=8B=A8=EB=B8=94?= =?UTF-8?q?=EB=A1=9D=20'=EC=98=A4=EB=B8=8C=EC=A0=9D=ED=8A=B8=EA=B0=80=20?= =?UTF-8?q?=ED=81=B4=EB=A6=AD=EB=90=98=EC=97=88=EB=8A=94=EA=B0=80=3F'=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extern/util/static.js | 1 + src/class/engine.js | 39 +++++++++++++----------- src/playground/blocks/block_judgement.js | 28 +++++++++++++++++ 3 files changed, 50 insertions(+), 18 deletions(-) diff --git a/extern/util/static.js b/extern/util/static.js index 9f77604bb6..2447e1c3ad 100644 --- a/extern/util/static.js +++ b/extern/util/static.js @@ -318,6 +318,7 @@ EntryStatic.getAllBlocks = function() { category: 'judgement', blocks: [ 'is_clicked', + 'is_object_clicked', 'is_press_some_key', 'reach_something', 'boolean_basic_operator', diff --git a/src/class/engine.js b/src/class/engine.js index 833118753e..3fc6719e78 100644 --- a/src/class/engine.js +++ b/src/class/engine.js @@ -22,12 +22,15 @@ Entry.Engine = class Engine { _addEventListener('canvasClick', () => this.fireEvent('mouse_clicked')); _addEventListener('canvasClickCanceled', () => this.fireEvent('mouse_click_cancled')); - _addEventListener('entityClick', (entity) => + _addEventListener('entityClick', (entity) => { + const objId = entity.id; + Entry.stage.clickedObjectId = objId; this.fireEventOnEntity('when_object_click', entity) - ); - _addEventListener('entityClickCanceled', (entity) => + }); + _addEventListener('entityClickCanceled', (entity) => { + delete Entry.stage.clickedObjectId; this.fireEventOnEntity('when_object_click_canceled', entity) - ); + }); if (Entry.type !== 'phone' && Entry.type !== 'playground') { _addEventListener( @@ -79,7 +82,7 @@ Entry.Engine = class Engine { 'entryEngineButtonWorkspace_w' ) .appendTo(this.view_) - .bindOnClick(function(e) { + .bindOnClick(function (e) { Entry.engine.toggleSpeedPanel(); this.blur(); }); @@ -91,7 +94,7 @@ Entry.Engine = class Engine { 'entryMaximizeButtonWorkspace_w' ) .appendTo(this.view_) - .bindOnClick(function(e) { + .bindOnClick(function (e) { Entry.engine.toggleFullScreen(); this.blur(); }); @@ -103,7 +106,7 @@ Entry.Engine = class Engine { 'entryCoordinateButtonWorkspace_w' ) .appendTo(this.view_) - .bindOnClick(function(e) { + .bindOnClick(function (e) { if (this.hasClass('toggleOn')) { this.removeClass('toggleOn'); } else { @@ -133,7 +136,7 @@ Entry.Engine = class Engine { this.addButton = Entry.createElement('button') .addClass('entryEngineButtonWorkspace_w') .addClass('entryAddButtonWorkspace_w') - .bindOnClick(function() { + .bindOnClick(function () { Entry.do('addObjectButtonClick'); this.blur(); }) @@ -161,7 +164,7 @@ Entry.Engine = class Engine { .addClass('entryPauseButtonWorkspace_w') .addClass('entryRemove') .appendTo(this.buttonWrapper) - .bindOnClick(function(e) { + .bindOnClick(function (e) { this.blur(); Entry.engine.togglePause(); }); @@ -171,7 +174,7 @@ Entry.Engine = class Engine { .addClass('entryPauseButtonWorkspace_full') .addClass('entryRemove') .appendTo(this.buttonWrapper) - .bindOnClick(function() { + .bindOnClick(function () { this.blur(); Entry.engine.togglePause(); }); @@ -188,7 +191,7 @@ Entry.Engine = class Engine { .addClass('entryEngineButtonWorkspace_w') .addClass('entryStopButtonWorkspace_w2') .addClass('entryRemove') - .bindOnClick(function() { + .bindOnClick(function () { this.blur(); Entry.engine.toggleStop(); }) @@ -212,7 +215,7 @@ Entry.Engine = class Engine { this.coordinateButton.addClass('entryEngineButtonMinimize'); this.coordinateButton.addClass('entryCoordinateButtonMinimize'); this.view_.appendChild(this.coordinateButton); - this.coordinateButton.bindOnClick(function(e) { + this.coordinateButton.bindOnClick(function (e) { if (this.hasClass('toggleOn')) { this.removeClass('toggleOn'); } else { @@ -227,7 +230,7 @@ Entry.Engine = class Engine { this.stopButton.addClass('entryRemove'); this.stopButton.innerHTML = Lang.Workspace.stop; this.view_.appendChild(this.stopButton); - this.stopButton.bindOnClick(function(e) { + this.stopButton.bindOnClick(function (e) { this.blur(); Entry.engine.toggleStop(); }); @@ -238,7 +241,7 @@ Entry.Engine = class Engine { this.pauseButton.addClass('entryPauseButtonMinimize'); this.pauseButton.addClass('entryRemove'); this.view_.appendChild(this.pauseButton); - this.pauseButton.bindOnClick(function(e) { + this.pauseButton.bindOnClick(function (e) { this.blur(); Entry.engine.togglePause(); }); @@ -472,7 +475,7 @@ Entry.Engine = class Engine { .parent() .remove(); delete this.speedLabel_; - $(this.speedProgress_).fadeOut(null, function(e) { + $(this.speedProgress_).fadeOut(null, function (e) { $(this).remove(); delete this.speedProgress_; }); @@ -689,7 +692,7 @@ Entry.Engine = class Engine { Entry.dispatchEvent('beforeStop'); try { await Promise.all(this.execPromises); - } catch (e) {} + } catch (e) { } const container = Entry.container; const variableContainer = Entry.variableContainer; @@ -768,7 +771,7 @@ Entry.Engine = class Engine { this.setEnableInputField(false); Entry.dispatchEvent('stop'); Entry.stage.hideInputField(); - (function(w) { + (function (w) { w && w.getMode() === Entry.Workspace.MODE_VIMBOARD && w.codeToText(); })(Entry.getMainWS()); Entry.dispatchEvent('dispatchEventDidToggleStop'); @@ -1257,7 +1260,7 @@ Entry.Engine = class Engine { this.execPromises = this.trimPromiseExecutor(); const index = this.execPromises.length; promises.forEach((promise, i) => { - const execPromise = (async function() { + const execPromise = (async function () { const result = await promise; const j = Entry.engine.execPromises.indexOf(execPromise); Entry.engine.execPromises[j] = result; diff --git a/src/playground/blocks/block_judgement.js b/src/playground/blocks/block_judgement.js index 52752f04eb..3a7beaadde 100644 --- a/src/playground/blocks/block_judgement.js +++ b/src/playground/blocks/block_judgement.js @@ -36,6 +36,34 @@ module.exports = { ], }, }, + is_object_clicked: { + color: EntryStatic.colorSet.block.default.JUDGE, + outerLine: EntryStatic.colorSet.block.darken.JUDGE, + skeleton: 'basic_boolean_field', + statements: [], + params: [ + { + type: 'Text', + text: Lang.Blocks.JUDGEMENT_is_object_clicked, + color: '#FFF', + }, + ], + events: {}, + def: { + params: [null], + type: 'is_object_clicked', + }, + class: 'boolean_input', + isNotFor: [], + func(sprite, script) { + const objId = sprite.id; + if (Entry.stage.clickedObjectId == objId) { + return true; + } + return false; + }, + syntax: { js: [], py: [] }, + }, is_press_some_key: { color: EntryStatic.colorSet.block.default.JUDGE, outerLine: EntryStatic.colorSet.block.darken.JUDGE, From de6f7b72fa7aeb56e6c02139aec6b4f6b4ecb65c Mon Sep 17 00:00:00 2001 From: Tnks2U Date: Thu, 16 Mar 2023 15:53:26 +0900 Subject: [PATCH 2/9] =?UTF-8?q?feat:=20=ED=8C=90=EB=8B=A8=EB=B8=94?= =?UTF-8?q?=EB=A1=9D=20'=EC=98=A4=EB=B8=8C=EC=A0=9D=ED=8A=B8=EB=A5=BC=20?= =?UTF-8?q?=ED=81=B4=EB=A6=AD=ED=96=88=EB=8A=94=EA=B0=80'=20=EB=8B=A4?= =?UTF-8?q?=EA=B5=AD=EC=96=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extern/lang/ebs.js | 2 ++ extern/lang/en.js | 2 ++ extern/lang/ko.js | 2 ++ 3 files changed, 6 insertions(+) diff --git a/extern/lang/ebs.js b/extern/lang/ebs.js index 54bf2b465d..57dc28008d 100644 --- a/extern/lang/ebs.js +++ b/extern/lang/ebs.js @@ -794,6 +794,7 @@ Lang.Blocks = { "JUDGEMENT_boolean_or": "또는", "JUDGEMENT_false": " 거짓 ", "JUDGEMENT_is_clicked": "마우스를 클릭했는가?", + "JUDGEMENT_is_object_clicked": "오브젝트를 클릭했는가?", "JUDGEMENT_is_press_some_key_1": "", "JUDGEMENT_is_press_some_key_2": "키가 눌러져 있는가?", "JUDGEMENT_reach_something_1": "", @@ -6248,6 +6249,7 @@ Lang.template = { "turtle_turn_unit_with_radius_in_direction": "%1 으로 %2 %3 반지름 %4 cm를 %5 방향으로 돌기 %6", "turtle_value": "%1", "is_clicked": "%1", + "is_object_clicked": "%1", "is_press_some_key": "%1 %2", "reach_something": "%1 %2 %3", "boolean_comparison": "%1 %2 %3", diff --git a/extern/lang/en.js b/extern/lang/en.js index 4cd8e21f76..2e3c5f3d4d 100644 --- a/extern/lang/en.js +++ b/extern/lang/en.js @@ -1109,6 +1109,7 @@ Lang.Blocks = { "arduino_lite_connect": "Web Connection", "arduino_lite_disconnect": "Cancel", "arduino_lite_guide": "• connection guide", + "JUDGEMENT_is_object_clicked": "Object clicked?", }; Lang.video_body_coord_params = { "left_eye": "Left Eye", @@ -5458,6 +5459,7 @@ Lang.template = { "turtle_turn_unit_with_radius_in_direction": "turn %1 %2 %3 with radius %4 cm in %5 direction %6", "turtle_value": "%1", "is_clicked": "%1", + "is_object_clicked": "%1", "is_press_some_key": "%1 %2", "reach_something": "%1 %2 %3", "boolean_comparison": "%1 %2 %3", diff --git a/extern/lang/ko.js b/extern/lang/ko.js index 971ebb4699..f1d5cedb01 100644 --- a/extern/lang/ko.js +++ b/extern/lang/ko.js @@ -809,6 +809,7 @@ Lang.Blocks = { JUDGEMENT_boolean_or: '또는', JUDGEMENT_false: ' 거짓 ', JUDGEMENT_is_clicked: '마우스를 클릭했는가?', + JUDGEMENT_is_object_clicked: '오브젝트를 클릭했는가?', JUDGEMENT_is_press_some_key_1: '', JUDGEMENT_is_press_some_key_2: '키가 눌러져 있는가?', JUDGEMENT_reach_something_1: '', @@ -7254,6 +7255,7 @@ Lang.template = { turtle_turn_unit_with_radius_in_direction: '%1 으로 %2 %3 반지름 %4 cm를 %5 방향으로 돌기 %6', turtle_value: '%1', is_clicked: '%1', + is_object_clicked: '%1', is_press_some_key: '%1 %2', reach_something: '%1 %2 %3', boolean_comparison: '%1 %2 %3', From d42fee208fa4255d6f235a2fe5fbb481a7b10239 Mon Sep 17 00:00:00 2001 From: Tnks2U Date: Thu, 16 Mar 2023 16:16:04 +0900 Subject: [PATCH 3/9] =?UTF-8?q?feat:=20=EA=B0=92=EB=B8=94=EB=A1=9D=20'?= =?UTF-8?q?=ED=98=84=EC=9E=AC%'=EC=97=90=20=EC=9A=94=EC=9D=BC=20=ED=8C=8C?= =?UTF-8?q?=EB=9D=BC=EB=AF=B8=ED=84=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extern/lang/ebs.js | 1 + extern/lang/ko.js | 1 + src/playground/blocks/block_calc.js | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/extern/lang/ebs.js b/extern/lang/ebs.js index 57dc28008d..6ab1c9e26a 100644 --- a/extern/lang/ebs.js +++ b/extern/lang/ebs.js @@ -743,6 +743,7 @@ Lang.Blocks = { "CALC_get_date_minute": "시각(분)", "CALC_get_date_month": "월", "CALC_get_date_second": "시각(초)", + "CALC_get_date_day_of_week": "요일", "CALC_get_date_year": "연도", "CALC_get_sound_duration_1": "", "CALC_get_sound_duration_2": "소리의 길이", diff --git a/extern/lang/ko.js b/extern/lang/ko.js index f1d5cedb01..5effe73f50 100644 --- a/extern/lang/ko.js +++ b/extern/lang/ko.js @@ -756,6 +756,7 @@ Lang.Blocks = { CALC_get_date_day: '일', CALC_get_date_hour: '시각(시)', CALC_get_date_minute: '시각(분)', + CALC_get_date_day_of_week: '요일', CALC_get_date_month: '월', CALC_get_date_second: '시각(초)', CALC_get_date_year: '연도', diff --git a/src/playground/blocks/block_calc.js b/src/playground/blocks/block_calc.js index e41fab8102..d1b23481a4 100644 --- a/src/playground/blocks/block_calc.js +++ b/src/playground/blocks/block_calc.js @@ -1399,6 +1399,7 @@ module.exports = { [Lang.Blocks.CALC_get_date_hour, 'HOUR'], [Lang.Blocks.CALC_get_date_minute, 'MINUTE'], [Lang.Blocks.CALC_get_date_second, 'SECOND'], + [Lang.Blocks.CALC_get_date_day_of_week, 'DAY_OF_WEEK'], ], value: 'YEAR', fontSize: 10, @@ -1438,6 +1439,10 @@ module.exports = { return dateTime.getHours(); } else if (operator === 'MINUTE') { return dateTime.getMinutes(); + } else if (operator === 'DAY_OF_WEEK') { + const daysLang = ['일', '월', '화', '수', '목', '금', '토']; + const dayNum = dateTime.getDay(); + return daysLang[dayNum]; } else { return dateTime.getSeconds(); } @@ -1459,6 +1464,7 @@ module.exports = { [Lang.Blocks.CALC_get_date_hour, 'HOUR'], [Lang.Blocks.CALC_get_date_minute, 'MINUTE'], [Lang.Blocks.CALC_get_date_second, 'SECOND'], + [Lang.Blocks.CALC_get_date_day_of_week, 'DAY_OF_WEEK'], ], value: 'YEAR', fontSize: 11, From 34b3ee1d440d8c79acaddcdc5cf9141257d1d0aa Mon Sep 17 00:00:00 2001 From: Tnks2U Date: Thu, 16 Mar 2023 17:02:14 +0900 Subject: [PATCH 4/9] =?UTF-8?q?feat:=20=EA=B0=92=EB=B8=94=EB=A1=9D=20%1?= =?UTF-8?q?=EC=9D=84=20=EB=92=A4=EC=A7=91=EA=B8=B0=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extern/lang/ebs.js | 3 ++ extern/lang/en.js | 3 ++ extern/lang/ko.js | 2 ++ extern/util/static.js | 1 + src/playground/blocks/block_calc.js | 48 +++++++++++++++++++++++++++++ 5 files changed, 57 insertions(+) diff --git a/extern/lang/ebs.js b/extern/lang/ebs.js index 6ab1c9e26a..adc94258a4 100644 --- a/extern/lang/ebs.js +++ b/extern/lang/ebs.js @@ -1525,6 +1525,8 @@ Lang.Blocks = { "CALC_char_at_3": "번째 글자", "CALC_length_of_string_1": "", "CALC_length_of_string_2": "의 글자 수", + "CALC_reverse_of_string_1": "", + "CALC_reverse_of_string_2": "을(를) 뒤집기", "CALC_substring_1": "", "CALC_substring_2": "의", "CALC_substring_3": "번째 글자부터", @@ -6033,6 +6035,7 @@ Lang.template = { "get_project_timer_value": "%1 %2", "char_at": "%1 %2 %3 %4 %5", "length_of_string": "%1 %2 %3", + "reverse_of_string": "%1 %2 %3", "substring": "%1 %2 %3 %4 %5 %6 %7", "replace_string": "%1 %2 %3 %4 %5 %6 %7", "change_string_case": "%1 %2 %3 %4 %5", diff --git a/extern/lang/en.js b/extern/lang/en.js index 2e3c5f3d4d..23156882b7 100644 --- a/extern/lang/en.js +++ b/extern/lang/en.js @@ -722,6 +722,8 @@ Lang.Blocks = { "CALC_char_at_3": "", "CALC_length_of_string_1": "length of", "CALC_length_of_string_2": "", + "CALC_reverse_of_string_1": "Reverse", + "CALC_reverse_of_string_2": "", "CALC_substring_1": "substring of", "CALC_substring_2": "from", "CALC_substring_3": "to", @@ -5242,6 +5244,7 @@ Lang.template = { "get_project_timer_value": "%1 %2", "char_at": "%1 %2 %3 %4 %5", "length_of_string": "%1 %2 %3", + "reverse_of_string": "%1 %2 %3", "substring": "%1 %2 %3 %4 %5 %6 %7", "replace_string": "%1 %2 %3 %4 %5 %6 %7", "change_string_case": "%1 %2 %3 %4 %5", diff --git a/extern/lang/ko.js b/extern/lang/ko.js index 5effe73f50..9103f58456 100644 --- a/extern/lang/ko.js +++ b/extern/lang/ko.js @@ -1541,6 +1541,8 @@ Lang.Blocks = { CALC_char_at_3: '번째 글자', CALC_length_of_string_1: '', CALC_length_of_string_2: '의 글자 수', + CALC_reverse_of_string_1: '', + CALC_reverse_of_string_2: '을(를) 뒤집기', CALC_substring_1: '', CALC_substring_2: '의', CALC_substring_3: '번째 글자부터', diff --git a/extern/util/static.js b/extern/util/static.js index 2447e1c3ad..dea4b53097 100644 --- a/extern/util/static.js +++ b/extern/util/static.js @@ -346,6 +346,7 @@ EntryStatic.getAllBlocks = function() { 'get_user_name', 'get_nickname', 'length_of_string', + 'reverse_of_string', 'combine_something', 'char_at', 'substring', diff --git a/src/playground/blocks/block_calc.js b/src/playground/blocks/block_calc.js index d1b23481a4..db8779099e 100644 --- a/src/playground/blocks/block_calc.js +++ b/src/playground/blocks/block_calc.js @@ -1741,6 +1741,54 @@ module.exports = { ], }, }, + reverse_of_string: { + color: EntryStatic.colorSet.block.default.CALC, + outerLine: EntryStatic.colorSet.block.darken.CALC, + skeleton: 'basic_string_field', + statements: [], + params: [ + { + type: 'Text', + text: Lang.Blocks.CALC_reverse_of_string_1, + color: '#FFF', + }, + { + type: 'Block', + accept: 'string', + }, + { + type: 'Text', + text: Lang.Blocks.CALC_reverse_of_string_2, + color: '#FFF', + }, + ], + events: {}, + def: { + params: [ + null, + { + type: 'text', + params: [Lang.Blocks.entry], + }, + null, + ], + type: 'reverse_of_string', + }, + paramsKeyMap: { + STRING: 1, + }, + class: 'calc_string', + isNotFor: [], + func(sprite, script) { + const originStr = script.getStringValue('STRING', script); + const reversedStr = originStr.split('').reverse().join(''); + return reversedStr; + }, + syntax: { + js: [], + py: [], + }, + }, combine_something: { color: EntryStatic.colorSet.block.default.CALC, outerLine: EntryStatic.colorSet.block.darken.CALC, From ce00ad88e7fb1dea05024ffa98c8e8d5ccb66389 Mon Sep 17 00:00:00 2001 From: Tnks2U Date: Fri, 17 Mar 2023 15:31:44 +0900 Subject: [PATCH 5/9] =?UTF-8?q?feat:=20%1=EC=97=90=EC=84=9C=20%2=20?= =?UTF-8?q?=EA=B8=80=EC=9E=90=20=EC=88=98=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extern/lang/ebs.js | 4 ++ extern/lang/en.js | 4 ++ extern/lang/ko.js | 4 ++ extern/util/static.js | 1 + src/playground/blocks/block_calc.js | 82 +++++++++++++++++++++++++---- 5 files changed, 86 insertions(+), 9 deletions(-) diff --git a/extern/lang/ebs.js b/extern/lang/ebs.js index adc94258a4..92332ad868 100644 --- a/extern/lang/ebs.js +++ b/extern/lang/ebs.js @@ -1541,6 +1541,8 @@ Lang.Blocks = { "CALC_change_string_case_3": " ", "CALC_change_string_case_sub_1": "대문자", "CALC_change_string_case_sub_2": "소문자", + "CALC_count_match_string_1": "에서", + "CALC_count_match_string_2": "의 글자 개수", "CALC_index_of_string_1": "", "CALC_index_of_string_2": "에서", "CALC_index_of_string_3": "의 시작 위치", @@ -1585,6 +1587,7 @@ Lang.Blocks = { "entry_bot_name": "엔트리봇", "hi_entry": "", "hi_entry_en": "", + "hello_entry": "hello entry", "bark_dog": "", "walking_entryBot": "엔트리봇_걷기", "doggi_bark": "강아지 짖는 소리", @@ -6040,6 +6043,7 @@ Lang.template = { "replace_string": "%1 %2 %3 %4 %5 %6 %7", "change_string_case": "%1 %2 %3 %4 %5", "index_of_string": "%1 %2 %3 %4 %5", + "count_match_string": "%1 %2 %3 %4", "combine_something": "%1 %2 %3 %4 %5", "get_sound_volume": "%1 %2", "quotient_and_mod": "%1 %2 %3 %4 %5 %6", diff --git a/extern/lang/en.js b/extern/lang/en.js index 23156882b7..38848e9481 100644 --- a/extern/lang/en.js +++ b/extern/lang/en.js @@ -738,6 +738,8 @@ Lang.Blocks = { "CALC_change_string_case_3": " ", "CALC_change_string_case_sub_1": "uppercase", "CALC_change_string_case_sub_2": "lowercase", + "CALC_count_match_string_1": "'s count of", + "CALC_count_match_string_2": "", "CALC_index_of_string_1": "index of", "CALC_index_of_string_2": "in", "CALC_index_of_string_3": "", @@ -782,6 +784,7 @@ Lang.Blocks = { "entry_bot_name": "Entrybot", "hi_entry": "Hello Entry!", "hi_entry_en": "Hello Entry!", + "hello_entry": "hello entry", "bark_dog": "dog barking", "walking_entryBot": "Walking Entrybot", "doggi_bark": "Doggi's Bark", @@ -5248,6 +5251,7 @@ Lang.template = { "substring": "%1 %2 %3 %4 %5 %6 %7", "replace_string": "%1 %2 %3 %4 %5 %6 %7", "change_string_case": "%1 %2 %3 %4 %5", + "count_match_string": "%3 %2 %1 %4", "index_of_string": "%1 %2 %3 %4 %5", "combine_something": "%1 %2 %3 %4 %5", "get_sound_volume": "%1 %2", diff --git a/extern/lang/ko.js b/extern/lang/ko.js index 9103f58456..0a89d29a26 100644 --- a/extern/lang/ko.js +++ b/extern/lang/ko.js @@ -1557,6 +1557,8 @@ Lang.Blocks = { CALC_change_string_case_3: ' ', CALC_change_string_case_sub_1: '대문자', CALC_change_string_case_sub_2: '소문자', + CALC_count_match_string_1: '에서', + CALC_count_match_string_2: '의 글자 개수', CALC_index_of_string_1: '', CALC_index_of_string_2: '에서', CALC_index_of_string_3: '의 시작 위치', @@ -1601,6 +1603,7 @@ Lang.Blocks = { entry_bot_name: '엔트리봇', hi_entry: '안녕 엔트리!', hi_entry_en: 'Hello Entry!', + hello_entry: 'hello entry', bark_dog: '강아지 짖는 소리', walking_entryBot: '엔트리봇_걷기', doggi_bark: '강아지 짖는 소리', @@ -6949,6 +6952,7 @@ Lang.template = { substring: '%1 %2 %3 %4 %5 %6 %7', replace_string: '%1 %2 %3 %4 %5 %6 %7', change_string_case: '%1 %2 %3 %4 %5', + count_match_string: '%1 %2 %3 %4', index_of_string: '%1 %2 %3 %4 %5', combine_something: '%1 %2 %3 %4 %5', get_sound_volume: '%1 %2', diff --git a/extern/util/static.js b/extern/util/static.js index dea4b53097..0285ddc90d 100644 --- a/extern/util/static.js +++ b/extern/util/static.js @@ -350,6 +350,7 @@ EntryStatic.getAllBlocks = function() { 'combine_something', 'char_at', 'substring', + 'count_match_string', 'index_of_string', 'replace_string', 'change_string_case', diff --git a/src/playground/blocks/block_calc.js b/src/playground/blocks/block_calc.js index db8779099e..b7bebefc9d 100644 --- a/src/playground/blocks/block_calc.js +++ b/src/playground/blocks/block_calc.js @@ -1100,14 +1100,14 @@ module.exports = { ], events: { viewAdd: [ - function() { + function () { if (Entry.engine) { Entry.engine.showProjectTimer(); } }, ], viewDestroy: [ - function(block, notIncludeSelf) { + function (block, notIncludeSelf) { if (Entry.engine) { Entry.engine.hideProjectTimer(block, notIncludeSelf); } @@ -1169,14 +1169,14 @@ module.exports = { ], events: { viewAdd: [ - function() { + function () { if (Entry.engine) { Entry.engine.showProjectTimer(); } }, ], dataDestroy: [ - function(block) { + function (block) { if (Entry.engine) { Entry.engine.hideProjectTimer(block); } @@ -1307,14 +1307,14 @@ module.exports = { ], events: { viewAdd: [ - function() { + function () { if (Entry.engine) { Entry.engine.showProjectTimer(); } }, ], viewDestroy: [ - function(block, notIncludeSelf) { + function (block, notIncludeSelf) { if (Entry.engine) { Entry.engine.hideProjectTimer(block, notIncludeSelf); } @@ -1522,13 +1522,13 @@ module.exports = { const mousePos = Entry.stage.mouseCoordinate; return Math.sqrt( Math.pow(sprite.getX() - mousePos.x, 2) + - Math.pow(sprite.getY() - mousePos.y, 2) + Math.pow(sprite.getY() - mousePos.y, 2) ); } else { const targetEntity = Entry.container.getEntity(targetId); return Math.sqrt( Math.pow(sprite.getX() - targetEntity.getX(), 2) + - Math.pow(sprite.getY() - targetEntity.getY(), 2) + Math.pow(sprite.getY() - targetEntity.getY(), 2) ); } }, @@ -2124,6 +2124,70 @@ module.exports = { ], }, }, + count_match_string: { + color: EntryStatic.colorSet.block.default.CALC, + outerLine: EntryStatic.colorSet.block.darken.CALC, + skeleton: 'basic_string_field', + statements: [], + params: [ + { + type: 'Block', + accept: 'string', + }, + { + type: 'Text', + text: Lang.Blocks.CALC_count_match_string_1, + color: '#FFF', + }, + { + type: 'Block', + accept: 'string', + }, + { + type: 'Text', + text: Lang.Blocks.CALC_count_match_string_2, + color: '#FFF', + }, + ], + events: {}, + def: { + params: [ + { + type: 'text', + params: [Lang.Blocks.hello_entry], + }, + null, + { + type: 'text', + params: ['e'], + }, + null, + ], + type: 'count_match_string', + }, + paramsKeyMap: { + STRING: 0, + TARGET: 2, + }, + class: 'calc_string', + isNotFor: [], + func(sprite, script) { + const originStr = script.getStringValue('STRING', script); + const targetStr = script.getStringValue('TARGET', script); + + if (originStr.length > 0 && targetStr.length > 0) { + const result = originStr.match(new RegExp(targetStr, 'g')); + if (result) { + return result.length; + } + } + return 0; + }, + syntax: { + js: [], + py: [], + }, + }, index_of_string: { color: EntryStatic.colorSet.block.default.CALC, outerLine: EntryStatic.colorSet.block.darken.CALC, @@ -2393,7 +2457,7 @@ module.exports = { func(sprite, script) { return script .getStringValue('STRING', script) - [script.getField('CASE', script)](); + [script.getField('CASE', script)](); }, syntax: { js: [], From 5cf1654066b1660299c4ecaa81a610f22285c860 Mon Sep 17 00:00:00 2001 From: Tnks2U Date: Fri, 17 Mar 2023 16:34:30 +0900 Subject: [PATCH 6/9] =?UTF-8?q?feat:=20=ED=8C=90=EB=8B=A8=EB=B8=94?= =?UTF-8?q?=EB=A1=9D=20%1=EA=B0=80=20%2=EC=9D=B8=EA=B0=80=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extern/lang/ebs.js | 4 ++ extern/lang/en.js | 4 ++ extern/lang/ko.js | 4 ++ extern/util/static.js | 1 + src/playground/blocks/block_judgement.js | 58 ++++++++++++++++++++++++ 5 files changed, 71 insertions(+) diff --git a/extern/lang/ebs.js b/extern/lang/ebs.js index 92332ad868..915cdbf20e 100644 --- a/extern/lang/ebs.js +++ b/extern/lang/ebs.js @@ -800,6 +800,9 @@ Lang.Blocks = { "JUDGEMENT_is_press_some_key_2": "키가 눌러져 있는가?", "JUDGEMENT_reach_something_1": "", "JUDGEMENT_reach_something_2": "에 닿았는가?", + "JUDGEMENT_is_type_1": '(이)가', + "JUDGEMENT_is_type_2": '인가?', + "is_type_number": "숫자", "JUDGEMENT_true": " 참 ", "LOOKS": "생김새", "LOOKS_change_scale_percent_1": "크기를", @@ -6260,6 +6263,7 @@ Lang.template = { "is_object_clicked": "%1", "is_press_some_key": "%1 %2", "reach_something": "%1 %2 %3", + "is_type": '%1 %2 %3 %4', "boolean_comparison": "%1 %2 %3", "boolean_equal": "%1 %2 %3", "boolean_bigger": "%1 %2 %3", diff --git a/extern/lang/en.js b/extern/lang/en.js index 38848e9481..50b2bc80ba 100644 --- a/extern/lang/en.js +++ b/extern/lang/en.js @@ -1115,6 +1115,9 @@ Lang.Blocks = { "arduino_lite_disconnect": "Cancel", "arduino_lite_guide": "• connection guide", "JUDGEMENT_is_object_clicked": "Object clicked?", + "JUDGEMENT_is_type_1": "is", + "JUDGEMENT_is_type_2": "", + "is_type_number": "number", }; Lang.video_body_coord_params = { "left_eye": "Left Eye", @@ -5469,6 +5472,7 @@ Lang.template = { "is_object_clicked": "%1", "is_press_some_key": "%1 %2", "reach_something": "%1 %2 %3", + "is_type": '%1 %2 %3 %4', "boolean_comparison": "%1 %2 %3", "boolean_equal": "%1 %2 %3", "boolean_bigger": "%1 %2 %3", diff --git a/extern/lang/ko.js b/extern/lang/ko.js index 0a89d29a26..8993c5beab 100644 --- a/extern/lang/ko.js +++ b/extern/lang/ko.js @@ -815,8 +815,11 @@ Lang.Blocks = { JUDGEMENT_is_press_some_key_2: '키가 눌러져 있는가?', JUDGEMENT_reach_something_1: '', JUDGEMENT_reach_something_2: '에 닿았는가?', + JUDGEMENT_is_type_1: '(이)가', + JUDGEMENT_is_type_2: '인가?', JUDGEMENT_true: ' 참 ', JUDGEMENT_is_boost_mode: '부스트모드가 켜져 있는가?', + is_type_number: '숫자', LOOKS: '생김새', LOOKS_change_scale_percent_1: '크기를', LOOKS_change_scale_percent_2: '만큼 바꾸기', @@ -7265,6 +7268,7 @@ Lang.template = { is_object_clicked: '%1', is_press_some_key: '%1 %2', reach_something: '%1 %2 %3', + is_type: '%1 %2 %3 %4', boolean_comparison: '%1 %2 %3', boolean_equal: '%1 %2 %3', boolean_bigger: '%1 %2 %3', diff --git a/extern/util/static.js b/extern/util/static.js index 0285ddc90d..9af923e95e 100644 --- a/extern/util/static.js +++ b/extern/util/static.js @@ -321,6 +321,7 @@ EntryStatic.getAllBlocks = function() { 'is_object_clicked', 'is_press_some_key', 'reach_something', + 'is_type', 'boolean_basic_operator', 'boolean_and_or', 'boolean_not', diff --git a/src/playground/blocks/block_judgement.js b/src/playground/blocks/block_judgement.js index 3a7beaadde..dc79007b9e 100644 --- a/src/playground/blocks/block_judgement.js +++ b/src/playground/blocks/block_judgement.js @@ -257,6 +257,64 @@ module.exports = { ], }, }, + is_type: { + color: EntryStatic.colorSet.block.default.JUDGE, + outerLine: EntryStatic.colorSet.block.darken.JUDGE, + skeleton: 'basic_boolean_field', + statements: [], + params: [ + { + type: 'Block', + accept: 'string', + }, + { + type: 'Text', + text: Lang.Blocks.JUDGEMENT_is_type_1, + color: '#FFF', + }, + { + type: 'Dropdown', + options: [ + [Lang.Blocks.is_type_number, 'number'], + ], + value: 'number', + fontSize: 10, + bgColor: EntryStatic.colorSet.block.darken.JUDGE, + }, + { + type: 'Text', + text: Lang.Blocks.JUDGEMENT_is_type_2, + color: '#FFF', + }, + ], + events: {}, + def: { + params: ['10', null, 'number', null], + type: 'is_type', + }, + paramsKeyMap: { + VALUE: 0, + TYPE: 2, + }, + class: 'boolean_type', + isNotFor: [], + func(sprite, script) { + const value = script.getStringValue('VALUE', script); + const type = script.getField('TYPE', script); + + if (type === 'number') { + const numCheckRegex = /^-?\d+$/; + if (numCheckRegex.test(value)) { + return true; + } + } + return false; + }, + syntax: { + js: [], + py: [], + }, + }, boolean_basic_operator: { color: EntryStatic.colorSet.block.default.JUDGE, outerLine: EntryStatic.colorSet.block.darken.JUDGE, From 961da7d117f839fdcd613bd358b2aab8ee5503dc Mon Sep 17 00:00:00 2001 From: Tnks2U Date: Fri, 17 Mar 2023 16:56:39 +0900 Subject: [PATCH 7/9] =?UTF-8?q?feat:=20=EC=8B=A0=EA=B7=9C=EB=B8=94?= =?UTF-8?q?=EB=A1=9D=20=EB=B8=94=EB=A1=9D=EB=A9=94=EB=89=B4=20=EC=9C=84?= =?UTF-8?q?=EC=B9=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extern/util/static.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/util/static.js b/extern/util/static.js index 9af923e95e..7d053b0d3d 100644 --- a/extern/util/static.js +++ b/extern/util/static.js @@ -347,13 +347,13 @@ EntryStatic.getAllBlocks = function() { 'get_user_name', 'get_nickname', 'length_of_string', - 'reverse_of_string', 'combine_something', 'char_at', 'substring', 'count_match_string', 'index_of_string', 'replace_string', + 'reverse_of_string', 'change_string_case', 'get_block_count', ], From 022d38792749a9466890e3616a9657fb95c399c1 Mon Sep 17 00:00:00 2001 From: Tnks2U Date: Fri, 17 Mar 2023 17:21:57 +0900 Subject: [PATCH 8/9] =?UTF-8?q?lang:=20=EC=8B=A0=EA=B7=9C=EB=B8=94?= =?UTF-8?q?=EB=A1=9D=20=EC=84=A4=EB=AA=85=20=EB=8B=A4=EA=B5=AD=EC=96=B4=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extern/lang/ebs.js | 6 +++++- extern/lang/en.js | 6 +++++- extern/lang/ko.js | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/extern/lang/ebs.js b/extern/lang/ebs.js index 915cdbf20e..64325c1749 100644 --- a/extern/lang/ebs.js +++ b/extern/lang/ebs.js @@ -5386,8 +5386,10 @@ Lang.Helper = { "sound_volume_set": "작품에서 재생되는 모든 소리의 크기를 입력한 값으로 정합니다.", "sound_silent_all": "재생 중인 모든 소리를 멈춥니다.", "is_clicked": "마우스를 클릭한 경우 ‘참’으로 판단합니다.", + "is_object_clicked": "오브젝트를 클릭한 경우 ‘참’으로 판단합니다.", "is_press_some_key": "선택한 키가 눌려져 있는 경우 ‘참’으로 판단합니다.", "reach_something": "해당 오브젝트가 선택한 항목과 닿은 경우 ‘참’으로 판단합니다.", + "is_type": "입력한 값이 숫자라면 ‘참’으로 판단합니다.", "is_included_in_list": "선택한 리스트가 입력한 값을 가진 항목을 포함하는 경우 '참'으로 판단합니다.", "boolean_basic_operator": "입력한 두 값을 비교합니다.\n= : 왼쪽에 위치한 값과 오른쪽에 위치한 값이 같은 경우 '참'으로 판단합니다.\n> : 왼쪽에 위치한 값이 오른쪽에 위치한 값보다 큰 경우 같로 판단합니다.\n< : 왼쪽에 위치한 값이 오른쪽에 위치한 값보다 작은 경우 '참'으로 판단합니다.\n≥ : 왼쪽에 위치한 값이 오른쪽에 위치한 값보다 크거나 같은 경우 '참'으로 판단합니다.\n≤ : 왼쪽에 위치한 값이 오른쪽에 위치한 값보다 작거나 같은 경우 '참'으로 판단합니다.", "function_create": "자주 쓰는 코드를 이 블록 아래에 조립하여 함수로 만듭니다. [함수 정의하기]의 오른쪽 빈칸에 [이름]을 조립하여 함수의 이름을 정할 수 있습니다. 함수를 실행하는 데 입력값이 필요한 경우 빈칸에 [문자/숫자값], [판단값]을 조립하여 매개변수로 사용합니다.", @@ -5409,7 +5411,7 @@ Lang.Helper = { "calc_share": "앞 수에서 뒤 수를 나누어 생긴 몫을 의미합니다.", "calc_mod": "앞 수에서 뒤 수를 나누어 생긴 나머지를 의미합니다.", "calc_operation": "입력한 수에 대한 다양한 수학식의 계산값입니다. (제곱, 루트, 사인값, 코사인값, 탄젠트값, 아크사인값, 아크코사인값, 아크탄젠트값, 로그값, 자연로그값, 소수점 부분, 소수점 버림값, 소수점 올림값, 소수점 반올림값, 펙토리얼값, 절대값)", - "get_date": "현재 연도, 월, 일, 시각과 같이 시간에 대한 값입니다.", + "get_date": "현재 연도, 월, 일, 요일, 시각과 같이 시간에 대한 값입니다.", "distance_something": "해당 오브젝트와 선택한 오브젝트 또는 마우스 포인터 간의 거릿값입니다.", "get_sound_duration": "선택한 소리의 길이(초) 값입니다.", "get_user_name": "작품을 실행하고 있는 사용자의 이름값입니다.", @@ -5421,6 +5423,7 @@ Lang.Helper = { "get_canvas_input_value": "사용자가 '대답 창'에 입력한 값입니다.", "set_visible_answer": "대답 창'을 실행화면에서 숨기거나 보이게 합니다.", "combine_something": "입력한 두 값을 결합한 값입니다.", + "reverse_of_string": "입력한 값을 뒤집은 값입니다.", "get_variable": "선택한 변수에 저장된 값입니다.", "change_variable": "선택한 변수에 입력한 값을 더합니다.", "set_variable": "선택한 변수의 값을 입력한 값으로 정합니다.", @@ -5464,6 +5467,7 @@ Lang.Helper = { "char_at": "입력한 값에서 입력한 숫자 번째의 글자 값입니다. (공백을 포함합니다.)", "length_of_string": "입력한 값의 공백을 포함한 글자 수입니다.", "substring": "입력한 값에서 입력한 범위 내의 글자 값입니다. (공백을 포함합니다.)", + "count_match_string": "입력한 값에서 지정한 값의 글자 개수입니다.", "replace_string": "입력한 값에서 지정한 값을 찾아 추가로 입력한 값으로 모두 바꾼 값입니다. (영문 입력 시 대소문자를 구분합니다.)", "index_of_string": "입력한 값에서 지정한 값이 처음으로 등장하는 위치 값입니다. (공백을 포함합니다.)", "change_string_case": "입력한 영문의 모든 알파벳을 대문자 또는 소문자로 바꾼 값입니다.", diff --git a/extern/lang/en.js b/extern/lang/en.js index 50b2bc80ba..561ae9633f 100644 --- a/extern/lang/en.js +++ b/extern/lang/en.js @@ -4591,8 +4591,10 @@ Lang.Helper = { "sound_volume_set": "Sets the volume of all the sounds played as much as the input percentage.", "sound_silent_all": "Stops all sounds currently playing.", "is_clicked": "Checks whether mouse is clicked.", + "is_object_clicked": "Checks whether object is clicked.", "is_press_some_key": "Checks whether an selected key is pressed.", "reach_something": "Checks whether the object reaches the selected point.", + "is_type": "Checks whether the input text is a number. If the input text is a number, it is judged as ’True’.", "is_included_in_list": "Checks whether selected list contains the input value.", "boolean_basic_operator": "Checks whether the value on the left is the same as the value on the right.", "function_create": "Define a function by placing frequently used sets of blocks under this block. Place [name] next to [Define function] to give function a name. Pass on number of text values by placing [numeric/text value] block. Pass on boolean value of true or false by placing the [boolean value] block.", @@ -4615,7 +4617,7 @@ Lang.Helper = { "calc_share": "Reports the quotient occurring from first number divided by the second number. ", "calc_mod": "Reports the remainder occurring from the first number divided by the second number.", "calc_operation": "Reports calculated values of a variety of equations relating to input numbers.", - "get_date": "Reports the values regarding the current year, month, day and time.", + "get_date": "Reports the values regarding the current year, month, day, day of the week and time.", "distance_something": "Reports the distance between the object and the selected object.", "get_sound_duration": "Reports the time length of the selected sound.", "get_user_name": "Reports the username who runs the project.", @@ -4628,6 +4630,7 @@ Lang.Helper = { "get_canvas_input_value": "Reports the answer which is taken after the object asked.", "set_visible_answer": "Hide or show the response window.", "combine_something": "Combines two input texts.", + "reverse_of_string": "Reports the text that reversed input text.", "get_variable": "Reports the value of the selected variable.", "change_variable": "Adds the input value to the selected variable.", "set_variable": "Sets the value of the selected variable to the input value.", @@ -4671,6 +4674,7 @@ Lang.Helper = { "char_at": "Reports the letter of the input text.", "length_of_string": "Reports the length of input text including space.", "substring": "Reports the text extracted from the input text between two specified indices. (includes space)", + "count_match_string": "Reports the number of letters in a specific text in the input text.", "replace_string": "Reports the text that replaced all the input text with another input text. (distinguishes uppercase to lowercase)", "index_of_string": "Reports the index of first input text in second input text. (includes space)", "change_string_case": "Reports the text that converted to uppercase or lowercase.", diff --git a/extern/lang/ko.js b/extern/lang/ko.js index 8993c5beab..ce6d9c2d17 100644 --- a/extern/lang/ko.js +++ b/extern/lang/ko.js @@ -5917,8 +5917,10 @@ Lang.Helper = { sound_volume_set: '작품에서 재생되는 모든 소리의 크기를 입력한 값으로 정합니다.', sound_silent_all: '재생 중인 모든 소리를 멈춥니다.', is_clicked: '마우스를 클릭한 경우 ‘참’으로 판단합니다.', + is_object_clicked: '오브젝트를 클릭한 경우 ‘참’으로 판단합니다.', is_press_some_key: '선택한 키가 눌려져 있는 경우 ‘참’으로 판단합니다.', reach_something: '해당 오브젝트가 선택한 항목과 닿은 경우 ‘참’으로 판단합니다.', + is_type: '입력한 값이 숫자라면 ‘참’으로 판단합니다.', is_included_in_list: "선택한 리스트가 입력한 값을 가진 항목을 포함하는 경우 '참'으로 판단합니다.", boolean_basic_operator: @@ -5951,7 +5953,7 @@ Lang.Helper = { calc_mod: '앞 수에서 뒤 수를 나누어 생긴 나머지를 의미합니다.', calc_operation: '입력한 수에 대한 다양한 수학식의 계산값입니다. (제곱, 루트, 사인값, 코사인값, 탄젠트값, 아크사인값, 아크코사인값, 아크탄젠트값, 로그값, 자연로그값, 소수점 부분, 소수점 버림값, 소수점 올림값, 소수점 반올림값, 펙토리얼값, 절대값)', - get_date: '현재 연도, 월, 일, 시각과 같이 시간에 대한 값입니다.', + get_date: '현재 연도, 월, 일, 요일, 시각과 같이 시간에 대한 값입니다.', distance_something: '해당 오브젝트와 선택한 오브젝트 또는 마우스 포인터 간의 거릿값입니다.', get_sound_duration: '선택한 소리의 길이(초) 값입니다.', get_user_name: '작품을 실행하고 있는 사용자의 아이디 값입니다.', @@ -5966,6 +5968,7 @@ Lang.Helper = { get_canvas_input_value: "사용자가 '대답 창'에 입력한 값입니다.", set_visible_answer: "대답 창'을 실행화면에서 숨기거나 보이게 합니다.", combine_something: '입력한 두 값을 결합한 값입니다.', + reverse_of_string: '입력한 값을 뒤집은 값입니다.', get_variable: '선택한 변수에 저장된 값입니다.', change_variable: '선택한 변수에 입력한 값을 더합니다.', set_variable: '선택한 변수의 값을 입력한 값으로 정합니다.', @@ -6027,6 +6030,7 @@ Lang.Helper = { char_at: '입력한 값에서 입력한 숫자 번째의 글자 값입니다. (공백을 포함합니다.)', length_of_string: '입력한 값의 공백을 포함한 글자 수입니다.', substring: '입력한 값에서 입력한 범위 내의 글자 값입니다. (공백을 포함합니다.)', + count_match_string: '입력한 값에서 지정한 값의 글자 개수입니다.', replace_string: '입력한 값에서 지정한 값을 찾아 추가로 입력한 값으로 모두 바꾼 값입니다. (영문 입력 시 대소문자를 구분합니다.)', index_of_string: From e969d71d5647b5fc741df26ca01ef27f1a4c995b Mon Sep 17 00:00:00 2001 From: Tnks2U Date: Fri, 17 Mar 2023 17:41:38 +0900 Subject: [PATCH 9/9] =?UTF-8?q?refactor:=20reviewdog=20lint=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/class/engine.js | 30 ++++++++++++++--------------- src/playground/blocks/block_calc.js | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/class/engine.js b/src/class/engine.js index 3fc6719e78..49b482c849 100644 --- a/src/class/engine.js +++ b/src/class/engine.js @@ -25,11 +25,11 @@ Entry.Engine = class Engine { _addEventListener('entityClick', (entity) => { const objId = entity.id; Entry.stage.clickedObjectId = objId; - this.fireEventOnEntity('when_object_click', entity) + this.fireEventOnEntity('when_object_click', entity); }); _addEventListener('entityClickCanceled', (entity) => { delete Entry.stage.clickedObjectId; - this.fireEventOnEntity('when_object_click_canceled', entity) + this.fireEventOnEntity('when_object_click_canceled', entity); }); if (Entry.type !== 'phone' && Entry.type !== 'playground') { @@ -82,7 +82,7 @@ Entry.Engine = class Engine { 'entryEngineButtonWorkspace_w' ) .appendTo(this.view_) - .bindOnClick(function (e) { + .bindOnClick(function(e) { Entry.engine.toggleSpeedPanel(); this.blur(); }); @@ -94,7 +94,7 @@ Entry.Engine = class Engine { 'entryMaximizeButtonWorkspace_w' ) .appendTo(this.view_) - .bindOnClick(function (e) { + .bindOnClick(function(e) { Entry.engine.toggleFullScreen(); this.blur(); }); @@ -106,7 +106,7 @@ Entry.Engine = class Engine { 'entryCoordinateButtonWorkspace_w' ) .appendTo(this.view_) - .bindOnClick(function (e) { + .bindOnClick(function(e) { if (this.hasClass('toggleOn')) { this.removeClass('toggleOn'); } else { @@ -136,7 +136,7 @@ Entry.Engine = class Engine { this.addButton = Entry.createElement('button') .addClass('entryEngineButtonWorkspace_w') .addClass('entryAddButtonWorkspace_w') - .bindOnClick(function () { + .bindOnClick(function() { Entry.do('addObjectButtonClick'); this.blur(); }) @@ -164,7 +164,7 @@ Entry.Engine = class Engine { .addClass('entryPauseButtonWorkspace_w') .addClass('entryRemove') .appendTo(this.buttonWrapper) - .bindOnClick(function (e) { + .bindOnClick(function(e) { this.blur(); Entry.engine.togglePause(); }); @@ -174,7 +174,7 @@ Entry.Engine = class Engine { .addClass('entryPauseButtonWorkspace_full') .addClass('entryRemove') .appendTo(this.buttonWrapper) - .bindOnClick(function () { + .bindOnClick(function() { this.blur(); Entry.engine.togglePause(); }); @@ -191,7 +191,7 @@ Entry.Engine = class Engine { .addClass('entryEngineButtonWorkspace_w') .addClass('entryStopButtonWorkspace_w2') .addClass('entryRemove') - .bindOnClick(function () { + .bindOnClick(function() { this.blur(); Entry.engine.toggleStop(); }) @@ -215,7 +215,7 @@ Entry.Engine = class Engine { this.coordinateButton.addClass('entryEngineButtonMinimize'); this.coordinateButton.addClass('entryCoordinateButtonMinimize'); this.view_.appendChild(this.coordinateButton); - this.coordinateButton.bindOnClick(function (e) { + this.coordinateButton.bindOnClick(function(e) { if (this.hasClass('toggleOn')) { this.removeClass('toggleOn'); } else { @@ -230,7 +230,7 @@ Entry.Engine = class Engine { this.stopButton.addClass('entryRemove'); this.stopButton.innerHTML = Lang.Workspace.stop; this.view_.appendChild(this.stopButton); - this.stopButton.bindOnClick(function (e) { + this.stopButton.bindOnClick(function(e) { this.blur(); Entry.engine.toggleStop(); }); @@ -241,7 +241,7 @@ Entry.Engine = class Engine { this.pauseButton.addClass('entryPauseButtonMinimize'); this.pauseButton.addClass('entryRemove'); this.view_.appendChild(this.pauseButton); - this.pauseButton.bindOnClick(function (e) { + this.pauseButton.bindOnClick(function(e) { this.blur(); Entry.engine.togglePause(); }); @@ -475,7 +475,7 @@ Entry.Engine = class Engine { .parent() .remove(); delete this.speedLabel_; - $(this.speedProgress_).fadeOut(null, function (e) { + $(this.speedProgress_).fadeOut(null, function(e) { $(this).remove(); delete this.speedProgress_; }); @@ -771,7 +771,7 @@ Entry.Engine = class Engine { this.setEnableInputField(false); Entry.dispatchEvent('stop'); Entry.stage.hideInputField(); - (function (w) { + (function(w) { w && w.getMode() === Entry.Workspace.MODE_VIMBOARD && w.codeToText(); })(Entry.getMainWS()); Entry.dispatchEvent('dispatchEventDidToggleStop'); @@ -1260,7 +1260,7 @@ Entry.Engine = class Engine { this.execPromises = this.trimPromiseExecutor(); const index = this.execPromises.length; promises.forEach((promise, i) => { - const execPromise = (async function () { + const execPromise = (async function() { const result = await promise; const j = Entry.engine.execPromises.indexOf(execPromise); Entry.engine.execPromises[j] = result; diff --git a/src/playground/blocks/block_calc.js b/src/playground/blocks/block_calc.js index b7bebefc9d..ba4259edcb 100644 --- a/src/playground/blocks/block_calc.js +++ b/src/playground/blocks/block_calc.js @@ -1169,7 +1169,7 @@ module.exports = { ], events: { viewAdd: [ - function () { + function() { if (Entry.engine) { Entry.engine.showProjectTimer(); }