Skip to content

Commit

Permalink
Merge branch 'pr/1692' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel Laské committed Jan 8, 2025
2 parents 9782764 + 1c35c10 commit 3c14f0d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Vertical bar are broken in Chart/Gears activities on Windows #1646
- In the activity of food chain, the picture of frog shows incomplete #1191
- Unusual Draw in Chess Activity #1678
- Pressing the start button in ColorMyWorld activity immediately shows "Congratulations! You finished!" #1691

## [1.8.0] - 2024-04-10
### Added
Expand Down
14 changes: 14 additions & 0 deletions activities/ColorMyWorld.activity/css/activity.css
Original file line number Diff line number Diff line change
Expand Up @@ -451,3 +451,17 @@ body {
background-color: #808080;
border: 2px solid #808080;
}


.loader {
position: fixed;
top: 55px;
left: 0;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.227);
z-index: 1000;
display: flex;
justify-content: center;
align-items: center;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions activities/ColorMyWorld.activity/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
</div>
-->

<div id="loader" class="loader">
<img id="spinner" src="img/spinner-light.gif"/>
</div>

<!-- The content of your activity goes inside the canvas -->
<div id="canvas">
Expand Down
13 changes: 13 additions & 0 deletions activities/ColorMyWorld.activity/lib/colormyworld.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ define(["activity/ol","util","print","l10n","flag"],function(ol,util,print,l10n,
me.mode=COLORING;
me.DELAY=1500.;
me.RUNNING=false;
me.LOADING=true;

me.saveStateCB=function(){
print("saveStateCB");
Expand Down Expand Up @@ -351,6 +352,11 @@ define(["activity/ol","util","print","l10n","flag"],function(ol,util,print,l10n,
me.fill_all_features=function(){
print("fill_all_features");
var categories=me.CATEGORIES['keys'];
var loader = document.getElementById('loader');
if(!me.LOADING){
loader.style.display = 'flex'; // Show the loader
me.LOADING=true;
}
for(var cidx=0;cidx<categories.length;cidx++){
var category=categories[cidx];
var layer_names=me.CATEGORIES[category]['keys'];
Expand Down Expand Up @@ -378,6 +384,10 @@ define(["activity/ol","util","print","l10n","flag"],function(ol,util,print,l10n,
}
}
}
if(me.LOADING){
loader.style.display = 'none'; // Hide the loader
me.LOADING=false;
}
// window.control_panel.rebuild();
}

Expand Down Expand Up @@ -471,6 +481,9 @@ define(["activity/ol","util","print","l10n","flag"],function(ol,util,print,l10n,
me.RUNNING=val;
}
me.toggleRunning=function(){
if (me.LOADING) {
return;
}
if (me.mode==COLORING) {
me.setMode(TOUR);
document.getElementById("modelabel").innerHTML=l10n.get(MODE_NAMES[me.mode]);
Expand Down

0 comments on commit 3c14f0d

Please sign in to comment.