scripting: expose Image()

canvas: typo
This commit is contained in:
jean-emmanuel 2022-05-22 12:58:49 +02:00
parent c84067c456
commit 23dadaaf7d
4 changed files with 7 additions and 2 deletions

View file

@ -180,7 +180,7 @@ class CanvasWidget extends Canvas {
if (!this.getProp('onResize')) return
this.scripts.onDraw.run({
this.scripts.onResize.run({
value: this.value,
width: this.width,
height: this.height,

View file

@ -506,9 +506,11 @@ class ScriptVm extends Vm {
}
this.sandbox.contentWindow.Image = Image
for (var imports of ['set', 'get', 'getProp', 'getIndex', 'updateProp', 'send', 'httpGet', 'stateGet', 'stateSet', 'storage',
'setInterval', 'clearInterval', 'setTimeout', 'clearTimeout', 'setFocus', 'unfocus', 'setScroll', 'getScroll', 'toolbar',
'openUrl', 'getVar', 'setVar', 'runAs']) {
'openUrl', 'getVar', 'setVar', 'runAs', 'Image']) {
this.sanitize(this.sandbox.contentWindow[imports])
}