Skip to content
This repository was archived by the owner on Aug 12, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
9e30b90
ios and android log event action as event type
benjiwheeler Apr 14, 2020
caa7aed
log more events to analytics
benjiwheeler Apr 14, 2020
2762cdf
refactor toggleGrid to be clearer, only send analytics in response to…
benjiwheeler Apr 20, 2020
abd8a1b
added project_editor_open and _close analytics events
benjiwheeler Apr 20, 2020
2727807
Update CONTRIBUTING.md
chrisgarrity Jun 16, 2020
6e25da1
Add default templates to repo
chrisgarrity Jun 17, 2020
dc8990f
Merge pull request #260 from benjiwheeler/analytics
benjiwheeler Jun 24, 2020
0a91dee
update new_block event
chrisgarrity Jul 7, 2020
fc8fdce
Merge pull request #279 from LLK/newblock-analytics
chrisgarrity Jul 9, 2020
1420a59
Split iOS and Android interfaces
chrisgarrity Aug 6, 2020
09c52f3
Android studio changes
chrisgarrity Aug 10, 2020
dd1f48f
Remove dead code for real
chrisgarrity Aug 10, 2020
d6e1a77
Merge pull request #284 from LLK/issue/274-refactor-os-interface
chrisgarrity Aug 10, 2020
c301a10
add generic setAnalyticsPref functions for iOS and Android
benjiwheeler Aug 13, 2020
dcd4222
Move json stringify and parsing into interface
benjiwheeler Aug 14, 2020
685389b
only call setAnalyticsPref with a valid key, value pair
benjiwheeler Aug 14, 2020
d73abf1
Merge pull request #287 from LLK/set-analytics-pref
benjiwheeler Aug 14, 2020
62a6513
add support for custom options questions at app start; refactor index.js
benjiwheeler Aug 14, 2020
927ebc9
Make iOS 9.3 the minimum
chrisgarrity Aug 14, 2020
6c737f5
[WIP] Initial version with WKWebView
chrisgarrity Aug 14, 2020
eb21e8d
Merge branch 'issue/274-wkwebview' into develop
chrisgarrity Aug 17, 2020
64019e6
fix to showing/hiding logo
benjiwheeler Aug 19, 2020
19cb492
localize initial options, set analytics prefs every time
benjiwheeler Aug 20, 2020
0cb154e
Merge pull request #290 from LLK/custom-option-questions
benjiwheeler Aug 24, 2020
eb37208
added callback lines in two places in JsBridge.m
benjiwheeler Aug 24, 2020
45b06ee
asset saving patch
chrisgarrity Sep 2, 2020
c5b5796
Fix Firebase warnings
chrisgarrity Sep 4, 2020
64b0b7c
Apply translations in ca
transifex-integration[bot] Sep 4, 2020
e0cc4dd
Apply translations in zh_CN
transifex-integration[bot] Sep 4, 2020
e2b5144
Apply translations in zh_TW
transifex-integration[bot] Sep 4, 2020
0665d9e
Apply translations in fr
transifex-integration[bot] Sep 4, 2020
ead2a6b
Apply translations in el
transifex-integration[bot] Sep 4, 2020
4835981
Apply translations in it
transifex-integration[bot] Sep 4, 2020
e12e459
Apply translations in ja
transifex-integration[bot] Sep 4, 2020
720d045
Apply translations in no
transifex-integration[bot] Sep 4, 2020
5459e64
Apply translations in pl
transifex-integration[bot] Sep 4, 2020
3df92e8
Apply translations in pt
transifex-integration[bot] Sep 4, 2020
3197e5a
Apply translations in pt_BR
transifex-integration[bot] Sep 4, 2020
6d0741e
Apply translations in es
transifex-integration[bot] Sep 4, 2020
b6411a8
Apply translations in th
transifex-integration[bot] Sep 4, 2020
a5d873c
Apply translations in tr
transifex-integration[bot] Sep 4, 2020
c89e95d
Apply translations in cy
transifex-integration[bot] Sep 4, 2020
187e765
Merge pull request #296 from LLK/translations_editions-free-src-local…
chrisgarrity Sep 4, 2020
8824bf6
Merge pull request #297 from LLK/translations_editions-free-src-local…
chrisgarrity Sep 4, 2020
4ac90bf
Merge pull request #298 from LLK/translations_editions-free-src-local…
chrisgarrity Sep 4, 2020
5479b3a
Merge pull request #301 from LLK/translations_editions-free-src-local…
chrisgarrity Sep 4, 2020
ea13cff
Merge pull request #303 from LLK/translations_editions-free-src-local…
chrisgarrity Sep 4, 2020
fbc5ae0
Merge pull request #304 from LLK/translations_editions-free-src-local…
chrisgarrity Sep 4, 2020
929720c
Merge pull request #305 from LLK/translations_editions-free-src-local…
chrisgarrity Sep 4, 2020
f03100e
Merge pull request #306 from LLK/translations_editions-free-src-local…
chrisgarrity Sep 4, 2020
27f33a7
Merge pull request #307 from LLK/translations_editions-free-src-local…
chrisgarrity Sep 4, 2020
309a47c
Merge pull request #308 from LLK/translations_editions-free-src-local…
chrisgarrity Sep 4, 2020
dddeae8
Merge pull request #309 from LLK/translations_editions-free-src-local…
chrisgarrity Sep 4, 2020
7ee0a1f
Merge pull request #310 from LLK/translations_editions-free-src-local…
chrisgarrity Sep 4, 2020
b1f64b5
Merge pull request #312 from LLK/translations_editions-free-src-local…
chrisgarrity Sep 4, 2020
16e09fd
Merge pull request #313 from LLK/translations_editions-free-src-local…
chrisgarrity Sep 4, 2020
698cdae
Merge pull request #314 from LLK/translations_editions-free-src-local…
chrisgarrity Sep 4, 2020
d573a01
fix buzz bug when initialOptions missing from settings
benjiwheeler Sep 9, 2020
201d82f
Add new languages to menu
chrisgarrity Sep 10, 2020
1b51c43
Merge pull request #291 from LLK/issue/274-wkwebview-rebase
chrisgarrity Sep 14, 2020
ddcd876
Merge pull request #316 from LLK/fix-buzz-on-missing-settings
benjiwheeler Sep 14, 2020
b3d800e
Merge pull request #317 from LLK/language-settings-update
chrisgarrity Sep 14, 2020
7f9ddab
Merge pull request #323 from LLK/develop
chrisgarrity Sep 14, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
## Contributing
The development of ScratchJr is an ongoing process, and we love to have people in the ScratchJr and open source communities help us along the way.

### Ways to Help

* **Documenting bugs**
* If you've identified a bug in ScratchJr you should first check to see if it's been filed as an issue, if not you can file one. Make sure you follow the issue template.
* It's important that we can consistently reproduce issues. When writing an issue, be sure to follow our [reproduction step guidelines](https://github.com/LLK/scratch-gui/wiki/Writing-good-repro-steps). The example is based on Scratch, but the same principles apply to ScratchJr.
* Some issues are marked "Needs Repro". Adding a comment with good reproduction steps to those issues is a great way to help.

* **Fixing bugs**
* You can request to fix a bug in a comment on the issue if you at mention the repo coordinator, who for this repo is @chrisgarrity.
* If the issue is marked "Help Wanted" you can go ahead and start working on it!
* **We will only accept Pull Requests for bugs that have an issue filed that has a priority label**
* If you're interested in fixing a bug with no issue, file the issue first and wait for it to have a priority added to it.

* We are not looking for Pull Requests ("PR") for every issue and may deny a PR if it doesn't fit our criteria.
* We are far more likely to accept a PR if it is for an issue marked with Help Wanted.
* We will not accept PRs for issues marked with "Needs Discussion" or "Needs Design."

### Learning Git and Github

If you want to work on fixing issues, you should be familiar with Git and Github.

* [Learn Git branching](https://learngitbranching.js.org/) includes an introduction to basic git commands and useful branching features.
* Here's a general introduction to [contributing to an open source project](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github).

**Important:** we follow the [Github Flow process](https://guides.github.com/introduction/flow/) as our development process.

### How to Fix Bugs
1. Identify which Github issue you are working on. Leave a comment on the issue to let us (and other contributors) know you're working on it.
2. Make sure you have a fork of this repo (see [Github's forking a repo](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) for details)
3. Switch to the `develop` branch, and pull down the latest changes from upstream
4. Run the code, and reproduce the problem
5. Create your branch from the `develop` branch
6. Make code changes to fix the problem
7. Run `npm test` to make sure that your changes pass our tests
8. Commit your changes
9. Push your branch to your fork
10. Create your pull request
1. Make sure to follow the template in the PR description
1. Remember to check the “[Allow edits from maintainers](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork)” box

When submitting pull requests keep in mind:
* please be patient -- it can take a while to find time to review them
* try to change the least amount of code necessary to fix the bug
* the code can't be radically changed without significant coordination with the Scratch Team, so these types of changes should be avoided
* if you find yourself changing a substantial amount of code or considering radical changes, please ask for clarification -- we may have envisioned a different approach, or underestimated the amount of effort

### Suggestions
![Block sketch](https://user-images.githubusercontent.com/3431616/77192550-1dcebe00-6ab3-11ea-9606-8ecd8500c958.png)

Please note: **_we are unlikely to accept PRs with new features that haven't been thought through and discussed as a group_**.

Why? Because we have a strong belief in the value of keeping things simple for new users. It's been said that the Scratch Team spends about one hour of design discussion for every pixel in Scratch or ScratchJr. To learn more about our design philosophy, see [the Scratch Developers page](https://scratch.mit.edu/developers), or [this paper](https://ase.tufts.edu/DevTech/publications/scratchjr_idc_2013.pdf).

### Other resources
Beyond this repo, there are also some other resources that you might want to take a look at:
* [Community Guidelines](https://github.com/LLK/scratch-www/wiki/Community-Guidelines) (we find it important to maintain a constructive and welcoming community for ScratchJr, just like on Scratch)
* [Open Source forum](https://scratch.mit.edu/discuss/49/) on Scratch
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### Expected Behavior

_Please describe what should happen_

### Actual Behavior

_Describe what actually happens, screenshots are helpful._

### Steps to Reproduce

_Explain what someone needs to do in order to see what's described in *Actual behavior* above_

### Device and Operating System

_e.g. iPad mini, iOS 10.3 or Samsung Galaxy Tab S6, Android 10_
18 changes: 18 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### Resolves

_What Github issue does this resolve (please include link)? Please make sure that the PR title reflects what the PR will do, not what is changing.
Please do not submit PRs that are not associated with a Github issue, or that only partially implement an issue._

- Resolves #

### Proposed Changes

_Describe what this Pull Request does_

### Reason for Changes

_Explain why these changes should be made_

### Test Coverage

_Please show how you have added tests to cover your changes, or provide the testing steps to verify the change. Screenshots that show the change are also helpful._
10 changes: 0 additions & 10 deletions CONTRIBUTING.md

This file was deleted.

116 changes: 116 additions & 0 deletions android/ScratchJr/.idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions android/ScratchJr/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -629,4 +629,24 @@ public void setAnalyticsPlacePref(String place) {
_activity.setAnalyticsPlacePref(place);
}
}

/**
* Record a user property
* @param prefObjStr single key-value JSON string, like "{\"school\": \"Central High\"}"
*/
@JavascriptInterface
public void setAnalyticsPref(String prefObjStr) {
if (prefObjStr != null) {
try {
JSONObject jsonObject = new JSONObject(prefObjStr);
JSONArray jsonArray = jsonObject.names();
String key = jsonArray.getString(0);
String value = jsonObject.getString(key);
_activity.setAnalyticsPref(key, value);
} catch (JSONException e) {
Log.e(LOG_TAG, "JSON error: " + e.getMessage(), e);
return;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ private void receiveProject(Uri projectUri) {
}
// We send the project Base64-encoded to JavaScript where it's processed and unpacked
String base64Project = Base64.encodeToString(projectData.toByteArray(), Base64.DEFAULT);
runJavaScript("iOS.loadProjectFromSjr('" + base64Project + "');");
runJavaScript("OS.loadProjectFromSjr('" + base64Project + "');");
}

public RelativeLayout getContainer() {
Expand Down Expand Up @@ -507,10 +507,9 @@ public void run() {
*/
public void logAnalyticsEvent(String category, String action, String label) {
Bundle params = new Bundle();
params.putString(FirebaseAnalytics.Param.ITEM_ID, action);
params.putString(FirebaseAnalytics.Param.ITEM_CATEGORY, category);
params.putString(FirebaseAnalytics.Param.ITEM_NAME, label);
_FirebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM, params);
_FirebaseAnalytics.logEvent(action, params);
}

/**
Expand All @@ -521,6 +520,15 @@ public void setAnalyticsPlacePref(String place) {
_FirebaseAnalytics.setUserProperty("place_preference", place);
}

/**
* Record a user property
* @param key like "school"
* @param value like "Central High"
*/
public void setAnalyticsPref(String key, String value) {
_FirebaseAnalytics.setUserProperty(key, value);
}

public void translateAndScaleRectToContainerCoords(RectF rect, float devicePixelRatio) {
float wx = _webView.getX();
float wy = _webView.getY();
Expand Down
Binary file modified editions/free/ios-resources/Default-Landscape@2x~ipad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified editions/free/ios-resources/Default-Landscape~ipad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions editions/free/src/css/start.css
Original file line number Diff line number Diff line change
Expand Up @@ -344,3 +344,44 @@ div.frame {
text-align: right;
}

.optionsInstruction {
position: absolute;
width: 96%;
top: 0;
padding: 2%;
color: #ffdd44;
font-size: 2.75rem;
font-weight: 500;
text-align: center;
text-shadow: 1px 1px 4px #333333;
list-style-type: none;
}

.optionsInstruction.hide {display: none;}
.optionsInstruction.show {display: block;}

.optionsList {
position: absolute;
width: 92%;
height: 86%;
padding: 4%;
top: 6%;
column-count: 3;
column-fill: auto; /* use first column up first */
color: white;
font-size: 2.25rem;
font-weight: 500;
text-align: left;
text-shadow: 1px 1px 4px #333333;
list-style-type: none;
z-index: 1000;
}

.optionsList.hide {display: none;}
.optionsList.show {display: block;}

.optionsList > div {
display: block;
padding: .25em;
break-inside: avoid-column; /* don't allow column to break inside item */
}
5 changes: 5 additions & 0 deletions editions/free/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
<div class="usageNoanswer hide" id="usageNoanswer">
<div class="usageNoanswerText" id="usageNoanswerText"></div>
</div>

<div class="optionsInstruction hide" id="optionsInstruction">
</div>
<div class="optionsList hide" id="optionsList">
</div>
</div>
</body>
</html>
5 changes: 3 additions & 2 deletions editions/free/src/localizations/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"BLOCKS_MOVE_DOWN": "Mou-te avall",
"BLOCKS_MOVE_DOWN_DESCRIPTION": "Mou el personatge el nombre de quadrícules indicat cap a avall.",
"BLOCKS_TURN_RIGHT": "Gira a la dreta",
"BLOCKS_TURN_RIGHT_DESCRIPTION": "Gira el personatge la quantitat indicada en el sentit de les agulles del rellotge. Per a fer una volta completa, cal especificar 12 en la quantitat. ",
"BLOCKS_TURN_RIGHT_DESCRIPTION": "Gira el personatge la quantitat indicada en el sentit de les agulles del rellotge. Per a fer una volta completa, cal especificar 12 en la quantitat.",
"BLOCKS_TURN_LEFT": "Gira a l'esquerra",
"BLOCKS_TURN_LEFT_DESCRIPTION": "Gira el personatge la quantitat indicada en el sentit contrari al de les agulles del rellotge. Per a fer una volta completa, cal especificar 12 en la quantitat. ",
"BLOCKS_TURN_LEFT_DESCRIPTION": "Gira el personatge la quantitat indicada en el sentit contrari al de les agulles del rellotge. Per a fer una volta completa, cal especificar 12 en la quantitat.",
"BLOCKS_HOP": "Salta",
"BLOCKS_HOP_DESCRIPTION": "Mou el personatge el nombre de quadrícules indicat cap a amunt i després cap a avall.",
"BLOCKS_GO_HOME": "Torna a l'inici",
Expand Down Expand Up @@ -362,6 +362,7 @@
"SHARING_BY_AIRDROP": "Comparteix per Airdrop",
"SHARING_EMAIL_SUBJECT": "Projecte ScratchJr: {PROJECT_NAME}",
"SHARING_EMAIL_TEXT": "Fes clic a la icona per provar el meu projecte a la tauleta iPad o Android!<br><br>Si no tens l'app ScratchJr, pots <a href='http://www.scratchjr.org'>descarregar-la</a> a la botiga d'apps Apple o Google Play Store.<br><br>Amb ScratchJr, els infants poden crear les seves pròpies històries interactives i jocs. Per saber-ne més, visita <a href='http://www.scratchjr.org'>scratchjr.org</a>.",
"FOR_PARENTS": "Per als pares",
"PARENTAL_GATE_EXPLANATION": "Per què us preguntem això? Un adult ha d'aprobar la compartició en línia.",
"GRID_NUMBER": "{N, number}",
"NEW_PROJECT_PREFIX": "Projecte",
Expand Down
Loading