Skip to content

Commit

Permalink
Merge pull request #2750 from entrylabs/feature/aidt_example
Browse files Browse the repository at this point in the history
iframeDomAccess option 추가
  • Loading branch information
kimorkim authored May 22, 2024
2 parents 0ee1d50 + 73268bd commit d22d85f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@entrylabs/entry",
"title": "EntryJS",
"description": "JavaScript library for visual programming",
"version": "4.0.5",
"version": "4.0.6",
"main": "dist/entry.min.js",
"homepage": "https://playentry.org",
"author": {
Expand Down
36 changes: 22 additions & 14 deletions src/class/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1046,23 +1046,31 @@ Entry.Engine = class Engine {
}

if (window.top !== window.self) {
window.top.addEventListener('pointermove', this.copyEvent);
window.top.addEventListener('pointerdown', this.copyEvent);
window.top.addEventListener('pointerup', this.copyEvent);
window.top.addEventListener('pointerupoutside', this.copyEvent);
window.top.addEventListener('pointercancel', this.copyEvent);
window.top.addEventListener('mouseup', this.copyEvent);
window.top.addEventListener('mousemove', this.copyEvent);
if (Entry.iframeDomAccess === 'direct') {
window.top.addEventListener('pointermove', this.copyEvent);
window.top.addEventListener('pointerdown', this.copyEvent);
window.top.addEventListener('pointerup', this.copyEvent);
window.top.addEventListener('pointerupoutside', this.copyEvent);
window.top.addEventListener('pointercancel', this.copyEvent);
window.top.addEventListener('mouseup', this.copyEvent);
window.top.addEventListener('mousemove', this.copyEvent);
} else if (Entry.iframeDomAccess === 'message') {
window.top.postMessage({ type: 'toggleFullScreen', value: 'addEvent' }, '*');
}
}
} else {
if (window.top !== window.self) {
window.top.removeEventListener('pointermove', this.copyEvent);
window.top.removeEventListener('pointerdown', this.copyEvent);
window.top.removeEventListener('pointerup', this.copyEvent);
window.top.removeEventListener('pointerupoutside', this.copyEvent);
window.top.removeEventListener('pointercancel', this.copyEvent);
window.top.removeEventListener('mouseup', this.copyEvent);
window.top.removeEventListener('mousemove', this.copyEvent);
if (Entry.iframeDomAccess === 'direct') {
window.top.removeEventListener('pointermove', this.copyEvent);
window.top.removeEventListener('pointerdown', this.copyEvent);
window.top.removeEventListener('pointerup', this.copyEvent);
window.top.removeEventListener('pointerupoutside', this.copyEvent);
window.top.removeEventListener('pointercancel', this.copyEvent);
window.top.removeEventListener('mouseup', this.copyEvent);
window.top.removeEventListener('mousemove', this.copyEvent);
} else if (Entry.iframeDomAccess === 'message') {
window.top.postMessage({ type: 'toggleFullScreen', value: 'removeEvent' }, '*');
}
}
this.popup.remove();
this.popup = null;
Expand Down
6 changes: 6 additions & 0 deletions src/util/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,12 @@ Entry.parseOptions = function (options) {
this.exportObjectEnable = true;
}

this.iframeDomAccess = options.iframeDomAccess;
if (this.iframeDomAccess === undefined) {
//direct, message, none
this.iframeDomAccess = 'direct';
}

this.hasVariableManager = options.hasvariablemanager;
if (!(this.variableEnable || this.messageEnable || this.listEnable || this.functionEnable)) {
this.hasVariableManager = false;
Expand Down

0 comments on commit d22d85f

Please sign in to comment.