Skip to content

Commit

Permalink
Merge pull request #243 from Catrobat/develop
Browse files Browse the repository at this point in the history
Release 1.2.0
  • Loading branch information
wslany authored Dec 18, 2020
2 parents 5653f08 + 46de23b commit c38b4e2
Show file tree
Hide file tree
Showing 81 changed files with 7,843 additions and 2,492 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
},
"globals": {
"process": false,
"$": true
"$": true,
"Android": true
},
"plugins": ["jest"]
}
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}",
"sourceMapPathOverrides": {
"webpack://CatBlocks/./*": "${workspaceFolder}/*"
"webpack:///./*": "${workspaceFolder}/*"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# if some files should be excluded for the checks, add them here
excluded_js_files = ['index.js']

excluded_java_bricks = ['Brick', 'ParameterizedEndBrick']
excluded_java_bricks = ['Brick', 'ParameterizedEndBrick', 'UserDefinedBrick', 'UserDefinedReceiverBrick']

map_bricks_scripts = [
('WhenScript', 'WhenBrick'),
Expand Down
87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-af/strings.xml

Large diffs are not rendered by default.

91 changes: 91 additions & 0 deletions i18n/catroid_strings/values-ar/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-az/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-bg/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-bn/strings.xml

Large diffs are not rendered by default.

88 changes: 88 additions & 0 deletions i18n/catroid_strings/values-bs/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-ca/strings.xml

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions i18n/catroid_strings/values-cs/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-da/strings.xml

Large diffs are not rendered by default.

206 changes: 140 additions & 66 deletions i18n/catroid_strings/values-de/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-el/strings.xml

Large diffs are not rendered by default.

166 changes: 97 additions & 69 deletions i18n/catroid_strings/values-en/strings.xml

Large diffs are not rendered by default.

250 changes: 168 additions & 82 deletions i18n/catroid_strings/values-es/strings.xml

Large diffs are not rendered by default.

800 changes: 466 additions & 334 deletions i18n/catroid_strings/values-fa/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-fi/strings.xml

Large diffs are not rendered by default.

89 changes: 88 additions & 1 deletion i18n/catroid_strings/values-fr/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-gl/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-gu/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-hi/strings.xml

Large diffs are not rendered by default.

88 changes: 88 additions & 0 deletions i18n/catroid_strings/values-hr/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-hu/strings.xml

Large diffs are not rendered by default.

86 changes: 86 additions & 0 deletions i18n/catroid_strings/values-ig/strings.xml

Large diffs are not rendered by default.

88 changes: 87 additions & 1 deletion i18n/catroid_strings/values-in/strings.xml

Large diffs are not rendered by default.

280 changes: 183 additions & 97 deletions i18n/catroid_strings/values-it/strings.xml

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions i18n/catroid_strings/values-iw/strings.xml

Large diffs are not rendered by default.

86 changes: 86 additions & 0 deletions i18n/catroid_strings/values-ja/strings.xml

Large diffs are not rendered by default.

786 changes: 426 additions & 360 deletions i18n/catroid_strings/values-kk/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-kn/strings.xml

Large diffs are not rendered by default.

86 changes: 86 additions & 0 deletions i18n/catroid_strings/values-ko/strings.xml

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions i18n/catroid_strings/values-lt/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-mk/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-ml/strings.xml

Large diffs are not rendered by default.

86 changes: 86 additions & 0 deletions i18n/catroid_strings/values-ms/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-nl/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-no/strings.xml

Large diffs are not rendered by default.

88 changes: 87 additions & 1 deletion i18n/catroid_strings/values-pl/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-ps/strings.xml

Large diffs are not rendered by default.

456 changes: 271 additions & 185 deletions i18n/catroid_strings/values-pt-rBR/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-pt/strings.xml

Large diffs are not rendered by default.

88 changes: 88 additions & 0 deletions i18n/catroid_strings/values-ro/strings.xml

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions i18n/catroid_strings/values-ru/strings.xml

Large diffs are not rendered by default.

89 changes: 88 additions & 1 deletion i18n/catroid_strings/values-sd/strings.xml

Large diffs are not rendered by default.

132 changes: 127 additions & 5 deletions i18n/catroid_strings/values-si/strings.xml

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions i18n/catroid_strings/values-sk/strings.xml

Large diffs are not rendered by default.

91 changes: 90 additions & 1 deletion i18n/catroid_strings/values-sl/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-sq/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-sv/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-sw/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-ta/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-te/strings.xml

Large diffs are not rendered by default.

121 changes: 104 additions & 17 deletions i18n/catroid_strings/values-th/strings.xml

Large diffs are not rendered by default.

1,507 changes: 744 additions & 763 deletions i18n/catroid_strings/values-tr/strings.xml

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions i18n/catroid_strings/values-uk/strings.xml

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions i18n/catroid_strings/values-ur/strings.xml

Large diffs are not rendered by default.

88 changes: 87 additions & 1 deletion i18n/catroid_strings/values-vi/strings.xml

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion i18n/strings_to_json_mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"CATEGORY_EVENT": "${category_event}",
"CATEGORY_CONTROL": "${category_control}",
"CATEGORY_DATA": "${category_data}",
"CATEGORY_DEVICE": "${category_device}",
"CATEGORY_MYBLOCKS": "${category_user_bricks}",
"CATEGORY_LEGONXT": "${category_lego_nxt}",
"CATEGORY_LEGOEV3": "${category_lego_ev3}",
Expand Down Expand Up @@ -84,6 +85,9 @@
"LOOKS_TURNFLASHLIGHT": "${brick_flash} %1%2",
"LOOKS_BACKGROUNDREQUEST": "${brick_look_request} %1%2 ${brick_background_request_result}",
"LOOKS_LOOKREQUEST": "${brick_look_request} %1%2 ${brick_look_request_result}",
"LOOKS_COPY_LOOK": "${brick_copy_look} %1%2",
"LOOKS_DELETE_LOOK": "${brick_delete_look}",
"LOOKS_PAINT_NEW_LOOK": "${brick_paint_new_look} %1%2",
"@sound": "sound blocks",
"SOUND_STARTSOUND": "${brick_play_sound} %1%2",
"SOUND_STARTSOUNDANDWAIT": "${brick_play_sound_and_wait} %1%2",
Expand All @@ -106,7 +110,11 @@
"SOUND_SET_INSTRUMENT": "${set_instrument_to} %1%2",
"SOUND_PAUSE_FOR_BEATS": "${pause_for} %1%2 ${beats}",
"SOUND_SET_LISTENING_LANGUAGE": "${brick_set_listening_language} %1%2",
"SOUND_SET_TEMPO": "${set_tempo_to} %1%2 ${percent_symbol}",
"SOUND_SET_TEMPO": "${set_tempo_to} %1%2",
"SOUND_CHANGE_TEMPO_BY": "${change_tempo_by} %1%2",
"SOUND_PLAY_DRUM_FOR_BEATS": "${play_drum} %1%2 ${for_string} %3%4 ${beats}",
"SOUND_PLAY_NOTE_FOR_BEATS": "${play_note} %1%2 ${for_string} %3%4 ${beats}",
"DEVICE_RESET_TIMER": "${brick_reset_timer}",
"@events": "events blocks",
"EVENT_WHENSCENESTARTS": "${brick_when_started}",
"EVENT_WHENTAPPED": "${brick_when}",
Expand Down Expand Up @@ -137,6 +145,8 @@
"CONTROL_SETNFCTAG": "${brick_set_nfc_tag} %1%2 ${ndef_record_label} %3%4",
"CONTROL_EXIT_STAGE": "${brick_finish_stage}",
"CONTROL_FOR_VARIABLE_FROM_TO": "${brick_loop_for_values_from} %1%2 ${brick_loop_to} %3%4 ${brick_loop_in} %5%6",
"CONTROL_OPEN_URL": "${brick_open} %1%2 ${brick_in_browser}",
"CONTROL_TOUCH_AND_SLIDE": "${brick_touch_slide} ${brick_touch_from_x} %1%2 ${y_label} %3%4 ${brick_glide_to_x} %5%6 ${y_label} %7%8 ${brick_loop_in} %9%10 ${phiro_seconds}",
"USER_DEFINED_SCRIPT_DEFINE": "${brick_user_defined_script_define}",
"USER_DEFINED_SCRIPT_AS": "${brick_user_defined_script_as}",
"CONTROL_FOR_VARIABLE_IN_USER_LIST": "${brick_loop_for_each_value_from} %1%2 ${brick_loop_in} %3%4",
Expand Down Expand Up @@ -259,6 +269,7 @@
"@CLEAN_UP": "Clean up Blocks",
"HELP": "${main_menu_help}",
"EMBROIDERY_STITCH": "${brick_stitch}",
"EMBRIODERY_SEW_UP": "${brick_sew_up}",
"UNDO": "${undo}",
"REDO": "${redo}",
"@unknown": "unknown, skipt so far",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"clean": "rimraf dist ; rimraf release",
"release:dev": "cross-env-shell NODE_ENV=development \"yarn initiate && webpack-dev-server --config webpack.release.dev.config.js\"",
"release:build": "cross-env-shell NODE_ENV=production \"yarn initiate && webpack --config webpack.release.build.config.js\"",
"release:builddev": "cross-env-shell NODE_ENV=development \"yarn initiate && webpack --config webpack.release.build.config.js\"",
"lint:es": "yarn eslint --ext .js ./",
"lint:pr": "yarn prettier -c src test",
"lint": "yarn lint:es --max-warnings 0 && yarn lint:pr",
Expand All @@ -29,7 +30,7 @@
"@babel/preset-env": "^7.6.3",
"async": "^3.2.0",
"babel-loader": "^8.0.6",
"blockly": "^3.20200123.1",
"blockly": "^3.20200924.4",
"copy-webpack-plugin": "^5.0.4",
"core-js": "^3.3.4",
"cross-env": "^7.0.2",
Expand Down
22 changes: 19 additions & 3 deletions src/common/js/parser/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ class File {
}

class Script {
constructor(name) {
constructor(name, id, posX, posY) {
this.name = name;
this.brickList = [];
this.posX = posX;
this.posY = posY;
this.id = id;
this.formValues = new Map();
}
}
Expand Down Expand Up @@ -141,7 +144,8 @@ function getCatroidProgramObject(xml) {
for (let i = 0; i < scenes.length; i++) {
sceneList.push(parseScenes(scenes[i]));
}
return { scenes: sceneList };
const name = xml.getElementsByTagName('header')[0].getElementsByTagName('programName')[0].innerHTML;
return { scenes: sceneList, programName: name };
}
/**
* Flat/dereference xml nodes
Expand Down Expand Up @@ -300,7 +304,18 @@ function parseScripts(script) {
catLog(script);

const name = escapeName(script.getAttribute('type'));
const currentScript = new Script(name);
let posX = undefined;
let posY = undefined;
if (script.hasAttribute('posX') && script.hasAttribute('posY')) {
posX = script.getAttribute('posX');
posY = script.getAttribute('posY');
}
const scriptIdTag = script.getElementsByTagName('scriptId');
let scriptId = undefined;
if (scriptIdTag.length > 0) {
scriptId = scriptIdTag[0].innerHTML;
}
const currentScript = new Script(name, scriptId, posX, posY);
const brickList = script.getElementsByTagName('brickList')[0].children;
for (let i = 0; i < script.childNodes.length; i++) {
checkUsage(script.childNodes[i], currentScript);
Expand Down Expand Up @@ -519,6 +534,7 @@ function parseBrick(brick) {
catLog(brick);

const name = (brick.getAttribute('type') || 'emptyBlockName').match(/[a-zA-Z]+/)[0];

const currentBrick = new Brick(name);

for (let i = 0; i < brick.childNodes.length; i++) {
Expand Down
29 changes: 4 additions & 25 deletions src/intern/html/testing.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,11 @@

<body>
<main id="root">
<div id="playground">
<h2>Playground testing</h2>
<div id="playworkspace" style="height: 500px; width: 100%"></div>
</div>
<div id="share">
<h2>Share testing</h2>
<div id="shareprogs">
<div class="modal" id="modalForImg">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<span id="modalHeader"></span>
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>

<div class="modal-body">
<img src="" id="modalImg" class="imagepreview" style="width: 100%; height: 100%" />
</div>

<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
<div id="shareprogs"></div>
</div>
<div id="playground">
<div id="playworkspace"></div>
</div>
</main>

Expand Down
3 changes: 2 additions & 1 deletion src/intern/js/render/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ export async function initShareAndRenderPrograms(programPath, language, isRtl) {
noImageFound: 'No_Image_Available.jpg',
renderScripts: true,
renderLooks: true,
renderSounds: true
renderSounds: true,
readOnly: true
});

try {
Expand Down
19 changes: 19 additions & 0 deletions src/library/css/share.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ img {
cursor: pointer;
}

.catblocks-tab-script {
height: 2rem;
}

.catblocks-tab-icon {
height: 2rem;
font-size: 2rem;
}

.catblocks-script {
padding: 0 20px;
}
Expand Down Expand Up @@ -145,3 +154,13 @@ img {
#formulaPopupContent {
word-wrap: break-word;
}

.catblocks-script-modifiable {
height: 80vh;
width: 100%;
}

.catblocks-script-modifiable.blocklySvg {
height: 80vh;
width: 100%;
}
83 changes: 0 additions & 83 deletions src/library/js/blocks/categories/assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,9 @@
'use strict';

export default {
TapAtBrick: {
message0: '%{BKY_ASSERTION_TAP_AT}',
args0: [
{
type: 'field_input',
name: 'X_POSITION',
text: 'unset'
},
{
type: 'field_image',
src: `${document.location.pathname}media/info_icon.svg`,
height: 24,
width: 24,
alt: '(i)',
flip_rtl: true,
name: 'X_POSITION_INFO'
},
{
type: 'field_input',
name: 'Y_POSITION',
text: 'unset'
},
{
type: 'field_image',
src: `${document.location.pathname}media/info_icon.svg`,
height: 24,
width: 24,
alt: '(i)',
flip_rtl: true,
name: 'Y_POSITION_INFO'
}
]
},
FinishStageBrick: {
message0: '%{BKY_ASSERTION_FINISH_STAGE}'
},
WaitTillIdleBrick: {
message0: '%{BKY_ASSERTION_WAIT_TILL_IDLE}'
},
AssertEqualsBrick: {
message0: '%{BKY_ASSERTION_ASSERT_EQUALS}',
args0: [
Expand Down Expand Up @@ -166,52 +130,5 @@ export default {
name: 'DROPDOWN_INFO'
}
]
},
TapForBrick: {
message0: '%{BKY_ASSERTION_TAP_FOR}',
args0: [
{
type: 'field_input',
name: 'X_POSITION',
text: 'unset'
},
{
type: 'field_image',
src: `${document.location.pathname}media/info_icon.svg`,
height: 24,
width: 24,
alt: '(i)',
flip_rtl: true,
name: 'X_POSITION_INFO'
},
{
type: 'field_input',
name: 'Y_POSITION',
text: 'unset'
},
{
type: 'field_image',
src: `${document.location.pathname}media/info_icon.svg`,
height: 24,
width: 24,
alt: '(i)',
flip_rtl: true,
name: 'Y_POSITION_INFO'
},
{
type: 'field_input',
name: 'FOR_DURATION',
text: 'unset'
},
{
type: 'field_image',
src: `${document.location.pathname}media/info_icon.svg`,
height: 24,
width: 24,
alt: '(i)',
flip_rtl: true,
name: 'FOR_DURATION_INFO'
}
]
}
};
Loading

0 comments on commit c38b4e2

Please sign in to comment.