-
Notifications
You must be signed in to change notification settings - Fork 0
/
catalog.js
57 lines (44 loc) · 1.59 KB
/
catalog.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
function getURIParameter(name)
{
var half = location.search.split(name+'=')[1];
return half? decodeURIComponent(half.split('&')[0]):null;
}
function generateParameterizedCanvas()
{
var canvasWidth;
var canvasHeight;
var drawingSurface;
if (!!window.HTMLCanvasElement)
{
canvasWidth = getURIParameter("canvasWidth");
canvasWidth = canvasWidth == null ? 200 : canvasWidth;
canvasHeight = getURIParameter("canvasHeight");
canvasHeight = canvasHeight == null ? 200 : canvasHeight;
drawingSurface = document.createElement('canvas');
drawingSurface.width = canvasWidth;
drawingSurface.height = canvasHeight;
}
else
{
drawingSurface = null;
}
return drawingSurface;
}
function showDefaultProductImage()
{
var canvasWidth;
var canvasHeight;
var error;
var image;
canvasWidth = getURIParameter("canvasWidth");
canvasWidth = canvasWidth == null ? 200 : canvasWidth;
canvasHeight = getURIParameter("canvasHeight");
canvasHeight = canvasHeight == null ? 200 : canvasHeight;
image = new Image();
image.src = "image.png";
image.style.height = canvasHeight;
image.style.width = canvasWidth;
document.body.appendChild(image);
error = document.getElementById("nowebgl");
error.style.display="block";
}