-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
92 lines (83 loc) · 3.14 KB
/
index.html
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
<!--apple-->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<!--apple-->
<title>ChinaExcel HTML5 版</title>
<meta name="Description" content="采用HTML5技术来展现ChinaExcelWeb控件的所有功能,从而实现报表的跨平台应用,包括手机,平板电脑以及IPAD等移动终端上的业务需求。"/>
<link href="css/css.css" rel="stylesheet" />
<style type="text/css">
.rightview{float: left; margin-left: 100px;}
#showmessage,#showmovespeed{line-height: 25px; font-size: 14px;}
#canvas{float: left;position: relative;}
#main{float: left;}
#canvasshadow,#canvaseffect{position: absolute;left: 0px;top: 0px;}
</style>
</head>
<body style="width:100%; margin:0px">
<div id="canvas" class="canvas"></div>
<button id="redraw">重绘</button>
<div class='rightview'> <div id="showmessage"></div>
<div id="showfirstspeed"></div>
<div id="showmovespeed"></div></div>
</body>
</html>
<script type="text/javascript" src="src/util/require.js"></script>
<script type="text/javascript">
if (!Array.prototype.find) {
Array.prototype.find = function(predicate) {
if (this == null) {
throw new TypeError('Array.prototype.find called on null or undefined');
}
if (typeof predicate !== 'function') {
throw new TypeError('predicate must be a function');
}
var list = Object(this);
var length = list.length >>> 0;
var thisArg = arguments[1];
var value;
for (var i = 0; i < length; i++) {
value = list[i];
if (predicate.call(thisArg, value, i, list)) {
return value;
}
}
return undefined;
};
}
require.config({
baseUrl: "src/util",
paths: {
/***基础组件***/
"base" :"base",/***继承类函数***/
"config" :"config",/***配置信息类***/
"utils":"utils",/****工具类*****/
"draw" :"draw",/***图形描绘的函数库****/
"canvas":"canvas",
"canvasshadow":"canvasshadow",/**影子画布**/
"canvaseffect":"canvaseffect",/**影子画布**/
"canvasList" :"canvasList",
"eventController" :"eventController",
"event" :"event",
"cell" :'cell'
}
});
require(["canvasList","event" ],function(canvasList,event){
console.log(canvasList,canvasList.find({elem: "id",dest:"yaxis"}));
var mainCanvas = canvasList.find({elem: "id",dest:"main"}).canvas;
mainCanvas.init();
var mainCanvaseffect = canvasList.find({elem: "id",dest:"effect"}).canvas;
mainCanvaseffect.init();
var mainCanvasshadow = canvasList.find({elem: "id",dest:"shadow"}).canvas;
mainCanvasshadow.init();
canvasList.find({elem: "id",dest:"yaxis"}).canvas.init();
document.getElementById("redraw").addEventListener("click", function(){
mainCanvas.redraw();
}, false);
event.setContext(mainCanvas).initialize();
});
</script>