Skip to content

Commit

Permalink
Merge branch 'pr/1612' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel Laské committed Apr 24, 2024
2 parents 7f0919c + b158df8 commit 924c807
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Adding Drag to fill Cells Functionality in Game of Life #1150
- Undismissable palletes in Dollar street #1605
- Localization error in FoodChain #1608
- Alignment issue in Abacus #1607

## [1.8.0] - 2024-04-10
### Added
Expand Down
51 changes: 35 additions & 16 deletions activities/Abacus.activity/js/custompalette.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,64 +11,88 @@ define(["sugar-web/graphics/palette"], function (palette) {
palette.Palette.call(this, invoker, primaryText);

var div = document.createElement('div');
div.setAttribute("style", "padding: 5px 13px;")

var rodsdiv = document.createElement('div'); //
rodsdiv.setAttribute("style", "display: flex;justify-content:space-between;align-items: center;margin-top:10px;");
var lrods = document.createElement("label");
lrods.innerHTML = "Rods:";
lrods.setAttribute("for","rods");
var rods = document.createElement("INPUT");
rods.setAttribute("type", "number");
rods.setAttribute("min","1");
rods.setAttribute("style","width:40px;margin:5px;");
rods.setAttribute("style","width:40px;");
rods.setAttribute("id","rods");
rods.value=g.customarr[0];
rodsdiv.append(lrods);
rodsdiv.append(rods);

var topdiv = document.createElement('div');
topdiv.setAttribute("style", "display: flex;justify-content:space-between;align-items: center;margin-top:5px;");
var ltop = document.createElement("label");
ltop.innerHTML = "Top:";
ltop.setAttribute("for","top");
var top = document.createElement("INPUT");
top.setAttribute("type", "number");
top.setAttribute("min","1");
top.setAttribute("style","width:40px;margin:5px;");
top.setAttribute("style","width:40px;");
top.setAttribute("id","top");
top.value=g.customarr[1];
topdiv.append(ltop);
topdiv.append(top);

var bottomdiv = document.createElement('div');
bottomdiv.setAttribute("style", "display: flex;justify-content:space-between;align-items: center;margin-top:5px;");
var lbottom = document.createElement("label");
lbottom.innerHTML = "Bottom:";
lbottom.setAttribute("for","bottom");
var bottom = document.createElement("INPUT");
bottom.setAttribute("type", "number");
bottom.setAttribute("min","1");
bottom.setAttribute("style","width:40px;margin:5px;");
bottom.setAttribute("style","width:40px;");
bottom.setAttribute("id","bottom");
bottom.value=g.customarr[2];
bottomdiv.append(lbottom);
bottomdiv.append(bottom);

var factordiv = document.createElement('div');
factordiv.setAttribute("style", "display: flex;justify-content:space-between;align-items: center;margin-top:5px;");
var lfactor = document.createElement("label");
lfactor.innerHTML = "Factor:";
lfactor.setAttribute("for","factor");
var factor = document.createElement("INPUT");
factor.setAttribute("type", "number");
factor.setAttribute("min","1");
factor.setAttribute("style","width:40px;margin:5px;");
factor.setAttribute("style","width:40px;");
factor.setAttribute("id","factor");
factor.value=g.customarr[3];
factordiv.append(lfactor);
factordiv.append(factor);

var basediv = document.createElement('div');
basediv.setAttribute("style", "display: flex;justify-content:space-between;align-items: center;margin-top:5px;");
var lbase = document.createElement("label");
lbase.innerHTML = "Base:";
lbase.setAttribute("for","base");
var base = document.createElement("INPUT");
base.setAttribute("type", "number");
base.setAttribute("min","1");
base.setAttribute("style","width:40px;margin:5px;");
base.setAttribute("style","width:40px;");
base.setAttribute("id","base");
base.value=g.customarr[4];
basediv.append(lbase);
basediv.append(base);

var submitdiv = document.createElement("div");
submitdiv.setAttribute("style", "display: flex;justify-content:space-between;align-items: center;margin-top:5px;");
var submit = document.createElement('button');
submit.className = 'toolbutton';
submit.setAttribute('id','new-button');
submit.setAttribute('title','Create');
submit.onclick = function() {
that.setAbacus();
}
submitdiv.append(submit);

function isNormalInteger(str) {
var n = Math.floor(Number(str));
Expand All @@ -83,17 +107,12 @@ define(["sugar-web/graphics/palette"], function (palette) {
}
}

div.appendChild(lrods);
div.appendChild(rods);
div.appendChild(ltop);
div.appendChild(top);
div.appendChild(lbottom);
div.appendChild(bottom);
div.appendChild(lfactor);
div.appendChild(factor);
div.appendChild(lbase);
div.appendChild(base);
div.appendChild(submit);
div.appendChild(rodsdiv);
div.appendChild(topdiv);
div.appendChild(bottomdiv);
div.appendChild(factordiv);
div.appendChild(basediv);
div.appendChild(submitdiv);

this.setContent([div]);
var that = this;
Expand Down

0 comments on commit 924c807

Please sign in to comment.