@@ -25,7 +25,7 @@ function compileShaderSource(gl, source, shaderType) {
25
25
gl . shaderSource ( shader , source ) ;
26
26
gl . compileShader ( shader ) ;
27
27
if ( ! gl . getShaderParameter ( shader , gl . COMPILE_STATUS ) ) {
28
- throw new Error ( "Could not compile " + shaderTypeToString ( ) + " shader: " + gl . getShaderInfoLog ( shader ) ) ;
28
+ throw new Error ( "Could not compile " . concat ( shaderTypeToString ( ) , " shader: " ) . concat ( gl . getShaderInfoLog ( shader ) ) ) ;
29
29
}
30
30
return shader ;
31
31
}
@@ -43,7 +43,7 @@ function linkShaderProgram(gl, shaders, vertexAttribs) {
43
43
}
44
44
gl . linkProgram ( program ) ;
45
45
if ( ! gl . getProgramParameter ( program , gl . LINK_STATUS ) ) {
46
- throw new Error ( "Could not link shader program: " + gl . getProgramInfoLog ( program ) ) ;
46
+ throw new Error ( "Could not link shader program: " . concat ( gl . getProgramInfoLog ( program ) ) ) ;
47
47
}
48
48
return program ;
49
49
}
@@ -77,36 +77,36 @@ function loadFilterProgram(gl, filter, vertexAttribs) {
77
77
var paramsInputs = { } ;
78
78
var _loop_1 = function ( paramName ) {
79
79
if ( paramName in uniforms ) {
80
- throw new Error ( "Redefinition of existing uniform parameter " + paramName ) ;
80
+ throw new Error ( "Redefinition of existing uniform parameter " . concat ( paramName ) ) ;
81
81
}
82
82
switch ( filter . params [ paramName ] . type ) {
83
83
case "float" :
84
84
{
85
85
var valuePreview_1 = span ( filter . params [ paramName ] . init . toString ( ) ) ;
86
86
var valueInput = input ( "range" ) ;
87
87
if ( filter . params [ paramName ] . min !== undefined ) {
88
- valueInput . att$ ( "min" , filter . params [ paramName ] . min ) ;
88
+ valueInput . att$ ( "min" , filter . params [ paramName ] . min . toString ( ) ) ;
89
89
}
90
90
if ( filter . params [ paramName ] . max !== undefined ) {
91
- valueInput . att$ ( "max" , filter . params [ paramName ] . max ) ;
91
+ valueInput . att$ ( "max" , filter . params [ paramName ] . max . toString ( ) ) ;
92
92
}
93
93
if ( filter . params [ paramName ] . step !== undefined ) {
94
- valueInput . att$ ( "step" , filter . params [ paramName ] . step ) ;
94
+ valueInput . att$ ( "step" , filter . params [ paramName ] . step . toString ( ) ) ;
95
95
}
96
96
if ( filter . params [ paramName ] . init !== undefined ) {
97
- valueInput . att$ ( "value" , filter . params [ paramName ] . init ) ;
97
+ valueInput . att$ ( "value" , filter . params [ paramName ] . init . toString ( ) ) ;
98
98
}
99
99
paramsInputs [ paramName ] = valueInput ;
100
- valueInput . oninput = function ( ) {
101
- valuePreview_1 . innerText = this . value ;
100
+ valueInput . oninput = function ( e ) {
101
+ valuePreview_1 . innerText = e . currentTarget . value ;
102
102
paramsPanel . dispatchEvent ( new CustomEvent ( "paramsChanged" ) ) ;
103
103
} ;
104
104
var label = ( _a = filter . params [ paramName ] . label ) !== null && _a !== void 0 ? _a : paramName ;
105
- paramsPanel . appendChild ( div ( span ( label + ": " ) , valuePreview_1 , div ( valueInput ) ) ) ;
105
+ paramsPanel . appendChild ( div ( span ( "" . concat ( label , ": " ) ) , valuePreview_1 , div ( valueInput ) ) ) ;
106
106
}
107
107
break ;
108
108
default : {
109
- throw new Error ( "Filter parameters do not support type " + filter . params [ paramName ] . type ) ;
109
+ throw new Error ( "Filter parameters do not support type " . concat ( filter . params [ paramName ] . type ) ) ;
110
110
}
111
111
}
112
112
uniforms [ paramName ] = gl . getUniformLocation ( id , paramName ) ;
@@ -136,7 +136,7 @@ function ImageSelector() {
136
136
var imageInput = input ( "file" ) ;
137
137
var imagePreview = img ( "img/tsodinClown.png" )
138
138
. att$ ( "class" , "widget-element" )
139
- . att$ ( "width" , CANVAS_WIDTH ) ;
139
+ . att$ ( "width" , String ( CANVAS_WIDTH ) ) ;
140
140
var root = div ( div ( imageInput ) . att$ ( "class" , "widget-element" ) , imagePreview ) . att$ ( "class" , "widget" ) ;
141
141
root . selectedImage$ = function ( ) {
142
142
return imagePreview ;
@@ -155,7 +155,7 @@ function ImageSelector() {
155
155
} ;
156
156
root . updateFiles$ = function ( files ) {
157
157
imageInput . files = files ;
158
- imageInput . onchange ( ) ;
158
+ imageInput . dispatchEvent ( new UIEvent ( "change" , { view : window , bubbles : true } ) ) ;
159
159
} ;
160
160
imagePreview . addEventListener ( 'load' , function ( ) {
161
161
root . dispatchEvent ( new CustomEvent ( "imageSelected" , {
@@ -168,8 +168,8 @@ function ImageSelector() {
168
168
imageInput . value = '' ;
169
169
this . src = 'img/error.png' ;
170
170
} ) ;
171
- imageInput . onchange = function ( ) {
172
- imagePreview . src = URL . createObjectURL ( this . files [ 0 ] ) ;
171
+ imageInput . onchange = function ( e ) {
172
+ imagePreview . src = URL . createObjectURL ( e . currentTarget . files [ 0 ] ) ;
173
173
} ;
174
174
return root ;
175
175
}
@@ -196,15 +196,15 @@ function FilterList() {
196
196
if ( e . deltaY > 0 ) {
197
197
root . selectedIndex = Math . min ( root . selectedIndex + 1 , root . length - 1 ) ;
198
198
}
199
- root . onchange ( ) ;
199
+ root . dispatchEvent ( new UIEvent ( "change" , { view : window , bubbles : true } ) ) ;
200
200
} ) ;
201
201
return root ;
202
202
}
203
203
function FilterSelector ( ) {
204
204
var filterList_ = FilterList ( ) ;
205
205
var filterPreview = canvas ( )
206
- . att$ ( "width" , CANVAS_WIDTH )
207
- . att$ ( "height" , CANVAS_HEIGHT ) ;
206
+ . att$ ( "width" , String ( CANVAS_WIDTH ) )
207
+ . att$ ( "height" , String ( CANVAS_HEIGHT ) ) ;
208
208
var root = div ( div ( "Filter: " , filterList_ )
209
209
. att$ ( "class" , "widget-element" ) , filterPreview . att$ ( "class" , "widget-element" ) ) . att$ ( "class" , "widget" ) ;
210
210
var gl = filterPreview . getContext ( "webgl" , { antialias : false , alpha : false } ) ;
@@ -348,7 +348,7 @@ function FilterSelector() {
348
348
delay : dt * 1000 ,
349
349
dispose : 2 ,
350
350
} ) ;
351
- renderProgress . style . width = ( t / duration ) * 50 + "%" ;
351
+ renderProgress . style . width = "" . concat ( ( t / duration ) * 50 , "%" ) ;
352
352
t += dt ;
353
353
}
354
354
gif . on ( 'finished' , function ( blob ) {
@@ -360,7 +360,7 @@ function FilterSelector() {
360
360
renderSpinner . style . display = "none" ;
361
361
} ) ;
362
362
gif . on ( 'progress' , function ( p ) {
363
- renderProgress . style . width = 50 + p * 50 + "%" ;
363
+ renderProgress . style . width = "" . concat ( 50 + p * 50 , "%" ) ;
364
364
} ) ;
365
365
gif . render ( ) ;
366
366
return gif ;
@@ -416,6 +416,6 @@ window.onload = function () {
416
416
gif . abort ( ) ;
417
417
}
418
418
var fileName = imageSelector . selectedFileName$ ( ) ;
419
- gif = filterSelector . render$ ( fileName + ".gif" ) ;
419
+ gif = filterSelector . render$ ( "" . concat ( fileName , ".gif" ) ) ;
420
420
} ;
421
421
} ;
0 commit comments