Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e48dcbd
Fix Steering Block
May 28, 2026
668c3d6
[fix] 블록 prototype pollution 기반 Stored XSS 취약점 차단
May 29, 2026
4d9a3dc
Merge pull request #3073 from entrylabs/issue/147
Tnks2U Jun 2, 2026
f20621d
[fix] Sortable 리스트 순서 변경 시 스크롤 위치 초기화 문제 수정
Jun 15, 2026
4c9637f
Update src/util/utils.js
kimorkim Jun 15, 2026
0f30001
[fix] 전체화면에서 묻고 답하기 텍스트 입력이 안 되는 문제 수정
Jun 25, 2026
ba4acee
Update src/util/utils.js
kimorkim Jun 25, 2026
ca612ca
Merge pull request #3078 from entrylabs/jira/165
kimorkim Jun 25, 2026
aa8ad72
Merge pull request #3075 from entrylabs/jira/163
kimorkim Jul 2, 2026
ad79679
feat: add CodingBox V2 hardware blocks
Cognix-TeamRnD Jul 7, 2026
dfb06f8
Add CodingBox V2 block helpers
Cognix-TeamRnD Jul 8, 2026
498fcf6
Update PLAYCODING BOX V2.0 display name
Cognix-TeamRnD Jul 8, 2026
e70fa3b
Add individual rainbow LED color block
Cognix-TeamRnD Jul 9, 2026
3638679
Update CodingBox V2 hardware id
Cognix-TeamRnD Jul 10, 2026
944aacf
Revert common utility changes
Cognix-TeamRnD Jul 10, 2026
175016a
Add CodingBox V2 hardware image
Cognix-TeamRnD Jul 10, 2026
4684cfd
Add RGB rainbow LED block
Cognix-TeamRnD Jul 13, 2026
5fa1b4f
Merge pull request #3082 from Cognix-TeamRnD/develop-hw
Tnks2U Jul 15, 2026
5696669
Merge pull request #3071 from myunghwahong/develop-hw
Tnks2U Jul 15, 2026
303f05e
fix: 변수 표시창 좌표를 유한 범위로 보정해 커서 오작동 방지
Jul 20, 2026
74a7f91
Merge pull request #3083 from entrylabs/jira/181
kimorkim Jul 20, 2026
53e1215
Merge pull request #3084 from entrylabs/develop-hw
Tnks2U Jul 21, 2026
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
45 changes: 25 additions & 20 deletions extern/util/CanvasInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* MIT License
*/
(function() {
(function () {
// create a buffer that stores all inputs so that tabbing
// between them is made possible.
var inputs = []; // initialize the Canvas Input
Expand Down Expand Up @@ -46,15 +46,15 @@
self._placeHolder = o.placeHolder || '';
self._value = o.value || self._placeHolder;

self._onsubmit = o.onsubmit || function() {};
self._onsubmit = o.onsubmit || function () {};

self._onkeydown = o.onkeydown || function() {};
self._onkeydown = o.onkeydown || function () {};

self._onkeyup = o.onkeyup || function() {};
self._onkeyup = o.onkeyup || function () {};

self._onfocus = o.onfocus || function() {};
self._onfocus = o.onfocus || function () {};

self._onblur = o.onblur || function() {};
self._onblur = o.onblur || function () {};

self._cursor = false;
self._cursorPos = 0;
Expand Down Expand Up @@ -95,7 +95,7 @@
if (self._canvas) {
self._canvas.addEventListener(
'mousemove',
function(e) {
function (e) {
e = e || window.event;
self.mousemove(e, self);
},
Expand All @@ -104,7 +104,7 @@

self._canvas.addEventListener(
'mousedown',
function(e) {
function (e) {
e = e || window.event;
self.mousedown(e, self);
},
Expand All @@ -113,7 +113,7 @@

self._canvas.addEventListener(
'touchstart',
function(e) {
function (e) {
e = e || window.event;
self.mousedown(e, self);
},
Expand All @@ -122,7 +122,7 @@

self._canvas.addEventListener(
'mouseup',
function(e) {
function (e) {
e = e || window.event;
self.mouseup(e, self);
},
Expand All @@ -132,7 +132,7 @@

window.addEventListener(
'mouseup',
function(e) {
function (e) {
//e = e || window.event;
//if (self._hasFocus && !self._mouseDown) {
//self.blur();
Expand Down Expand Up @@ -160,15 +160,15 @@
document.body.appendChild(self._hiddenInput);
self._hiddenInput.value = self._value; // setup the keydown listener

self._hiddenInput.addEventListener('keydown', function(e) {
self._hiddenInput.addEventListener('keydown', function (e) {
e = e || window.event;

if (self._hasFocus) {
self.keydown(e, self);
}
}); // setup the keyup listener

self._hiddenInput.addEventListener('keyup', function(e) {
self._hiddenInput.addEventListener('keyup', function (e) {
e = e || window.event; // update the canvas input state information from the hidden input

self._value = self._hiddenInput.value;
Expand Down Expand Up @@ -726,8 +726,8 @@
clearInterval(self._cursorInterval);
}

requestAnimationFrame(function() {
self._cursorInterval = setInterval(function() {
requestAnimationFrame(function () {
self._cursorInterval = setInterval(function () {
self._cursor = !self._cursor;
self.render();
}, 500); // check if this is Chrome for Android (there is a bug with returning incorrect character key codes)
Expand All @@ -741,6 +741,8 @@

var isMobile = typeof window.orientation !== 'undefined';
var hasHiddenFocus = false;
var inputParent =
document.fullscreenElement || document.webkitFullscreenElement || document.body;
if (
isMobile &&
!isChromeMobile &&
Expand All @@ -763,11 +765,11 @@
input.style.height = 0;
const form = document.createElement('form');
form.appendChild(input);
document.body.appendChild(form);
inputParent.appendChild(form);
input.focus();
input.addEventListener(
'blur',
function() {
function () {
if (!hasHiddenFocus) {
self.blur(self);
}
Expand All @@ -787,6 +789,9 @@

var hasSelection = self._selection[0] > 0 || self._selection[1] > 0;
hasHiddenFocus = true;
if (self._hiddenInput.parentNode !== inputParent) {
inputParent.appendChild(self._hiddenInput);
}
self._hiddenInput.focus();
hasHiddenFocus = false;
self._hiddenInput.selectionStart = hasSelection ? self._selection[0] : self._cursorPos;
Expand Down Expand Up @@ -869,7 +874,7 @@
if (inputs.length > 1) {
var next = inputs[self._inputsIndex + 1] ? self._inputsIndex + 1 : 0;
self.blur();
setTimeout(function() {
setTimeout(function () {
inputs[next].focus();
}, 5);
}
Expand Down Expand Up @@ -1088,7 +1093,7 @@
ctx.shadowBlur = 0;
} // draw the text box background

self._drawTextBox(function() {
self._drawTextBox(function () {
// make sure all shadows are reset
ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 0;
Expand Down Expand Up @@ -1234,7 +1239,7 @@
var img = new Image();
img.src = self._backgroundImage;

img.onload = function() {
img.onload = function () {
ctx.drawImage(
img,
0,
Expand Down
Binary file added images/hardware/codingboxv2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"jest": "^24.9.0",
"khaiii": "^0.0.2",
"libsvm-js": "^0.2.1",
"lodash": "^4.17.15",
"lodash": "^4.17.21",
"mathjs": "^7.1.0",
"ml-cart": "^2.1.1",
"pixi.js": "5.3.12",
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

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

35 changes: 20 additions & 15 deletions src/class/pixi/etc/PIXICanvasInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
* MIT License
*/
import * as PIXI from 'pixi.js';
(function() {
(function () {
// create a buffer that stores all inputs so that tabbing
// between them is made possible.
const inputs = [];

// initialize the Canvas Input
// eslint-disable-next-line no-multi-assign
const CanvasInput = (window.PIXICanvasInput = function(o) {
const CanvasInput = (window.PIXICanvasInput = function (o) {
const self = this;

o = o ? o : {};
Expand Down Expand Up @@ -48,11 +48,11 @@ import * as PIXI from 'pixi.js';
self._selectionColor = o.selectionColor || 'rgba(179, 212, 253, 0.8)';
self._placeHolder = o.placeHolder || '';
self._value = `${o.value || self._placeHolder}`;
self._onsubmit = o.onsubmit || function() {};
self._onkeydown = o.onkeydown || function() {};
self._onkeyup = o.onkeyup || function() {};
self._onfocus = o.onfocus || function() {};
self._onblur = o.onblur || function() {};
self._onsubmit = o.onsubmit || function () {};
self._onkeydown = o.onkeydown || function () {};
self._onkeyup = o.onkeyup || function () {};
self._onfocus = o.onfocus || function () {};
self._onblur = o.onblur || function () {};
self._cursor = false;
self._cursorPos = 0;
self._hasFocus = false;
Expand Down Expand Up @@ -772,6 +772,8 @@ import * as PIXI from 'pixi.js';
// add support for mobile
const isMobile = typeof window.orientation !== 'undefined';
var hasHiddenFocus = false;
const inputParent =
document.fullscreenElement || document.webkitFullscreenElement || document.body;
if (
isMobile &&
!isChromeMobile &&
Expand All @@ -782,17 +784,17 @@ import * as PIXI from 'pixi.js';
input.type = 'text';
input.style.opacity = 0;
input.style.position = 'absolute';
input.style.left = `${self._x +
self._extraX +
(self._canvas ? self._canvas.offsetLeft : 0)}px`;
input.style.top = `${self._y +
self._extraY +
(self._canvas ? self._canvas.offsetTop : 0)}px`;
input.style.left = `${
self._x + self._extraX + (self._canvas ? self._canvas.offsetLeft : 0)
}px`;
input.style.top = `${
self._y + self._extraY + (self._canvas ? self._canvas.offsetTop : 0)
}px`;
input.style.width = self._width;
input.style.height = 0;
const form = document.createElement('form');
form.appendChild(input);
document.body.appendChild(form);
inputParent.appendChild(form);
input.focus();
input.addEventListener(
'blur',
Expand All @@ -817,6 +819,9 @@ import * as PIXI from 'pixi.js';
// move the real focus to the hidden input
const hasSelection = self._selection[0] > 0 || self._selection[1] > 0;
hasHiddenFocus = true;
if (self._hiddenInput.parentNode !== inputParent) {
inputParent.appendChild(self._hiddenInput);
}
self._hiddenInput.focus();
hasHiddenFocus = false;
self._hiddenInput.selectionStart = hasSelection ? self._selection[0] : self._cursorPos;
Expand Down Expand Up @@ -1284,7 +1289,7 @@ import * as PIXI from 'pixi.js';
} else {
const img = new Image();
img.src = self._backgroundImage;
img.onload = function() {
img.onload = function () {
ctx.drawImage(
img,
0,
Expand Down
14 changes: 9 additions & 5 deletions src/class/playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -704,9 +704,11 @@ Entry.Playground = class Playground {

updatePictureView() {
if (this.pictureSortableListWidget) {
this.pictureSortableListWidget.setData({ items: [] });
this.pictureSortableListWidget.setData({
items: this._getSortablePictureList(),
Entry.Utils.runWithScrollPreserved(this.pictureListView_, () => {
this.pictureSortableListWidget.setData({ items: [] });
this.pictureSortableListWidget.setData({
items: this._getSortablePictureList(),
});
});
}
this.reloadPlayground();
Expand Down Expand Up @@ -1102,8 +1104,10 @@ Entry.Playground = class Playground {

updateSoundsView() {
if (this.soundSortableListWidget) {
this.soundSortableListWidget.setData({
items: this._getSortableSoundList(),
Entry.Utils.runWithScrollPreserved(this.soundListView_, () => {
this.soundSortableListWidget.setData({
items: this._getSortableSoundList(),
});
});
}

Expand Down
6 changes: 5 additions & 1 deletion src/class/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ Entry.Scene = class {
updateSceneView() {
const items = this._getSortableSceneList();
if (this.sceneSortableListWidget) {
setTimeout(() => this.sceneSortableListWidget.setData({ items }), 0);
setTimeout(() => {
Entry.Utils.runWithScrollPreserved(this.listView_, () => {
this.sceneSortableListWidget.setData({ items });
});
}, 0);
}
}

Expand Down
28 changes: 28 additions & 0 deletions src/class/stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,8 @@ Entry.Stage = class Stage {
this.inputField.show();
this.canvas.addChild(this.inputSubmitButton);

this._bindInputFieldFullScreenChange();

Entry.requestUpdateTwice = true;

function _createInputField() {
Expand Down Expand Up @@ -664,6 +666,32 @@ Entry.Stage = class Stage {
Entry.requestUpdate = true;
}

_bindInputFieldFullScreenChange() {
if (this._inputFieldFullScreenChangeBound) {
return;
}
this._inputFieldFullScreenChangeBound = true;

const relocate = () => {
const inputField = this.inputField;
const hiddenInput = inputField && inputField._hiddenInput;
if (!hiddenInput) {
return;
}
const inputParent =
document.fullscreenElement || document.webkitFullscreenElement || document.body;
if (hiddenInput.parentNode !== inputParent) {
inputParent.appendChild(hiddenInput);
if (inputField._hasFocus) {
hiddenInput.focus();
}
}
};

document.addEventListener('fullscreenchange', relocate);
document.addEventListener('webkitfullscreenchange', relocate);
}

/**
* init object containers
*/
Expand Down
Loading
Loading