1
- < ?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4
- < html version ="-//W3C//DTD XHTML 1.1//EN "
5
- xmlns ="http://www.w3.org/1999/xhtml " xml:lang ="en "
6
- xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance "
7
- xsi:schemaLocation ="http://www.w3.org/1999/xhtml
8
- http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd ">
9
- < head >
1
+ <!doctype html>
2
+ 02.
3
+ 03.<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
4
+ 04.<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
5
+ 05.<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
6
+ 06.<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
7
+ 07.<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
8
+ 08.<!--[if (gt IE 9)|!(IE)]><!--> < html lang ="en " class ="no-js "> <!--<![endif]-->
9
+ 09.< head >
10
+ < meta charset ="utf-8 ">
11
+
12
+ <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
13
+ Remove this if you use the .htaccess -->
14
+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge,chrome=1 ">
15
+
10
16
< title > Easymeter</ title >
17
+ < meta name ="description " content ="">
18
+ < meta name ="author " content ="">
11
19
12
- < link type ="text/css " href ="css/bootstrap.min.css " rel ="stylesheet " />
20
+ <!-- Optimierungen für mobile Browser: j.mp/bplateviewport -->
21
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
13
22
14
- < script src ="/socket.io/socket.io.js "> </ script >
15
- < script src ="/js/xdate.js "> </ script >
16
- <!--Load the AJAX API-->
17
- < script type ="text/javascript " src ="https://www.google.com/jsapi "> </ script >
18
- < script type ="text/javascript ">
23
+ <!-- Place favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
24
+ < link rel ="shortcut icon " href ="/favicon.ico ">
25
+ < link rel ="apple-touch-icon " href ="/apple-touch-icon.png ">
19
26
20
- var socket = io . connect ( ) ;
27
+ <!-- CSS : implied media="all" -->
28
+ < link type ="text/css " href ="/css/bootstrap.min.css " rel ="stylesheet " />
21
29
22
- // Load the Visualization API and the piechart package.
23
- google . load ( 'visualization' , '1.1' , { 'packages' :[ 'corechart' ] } ) ;
30
+ <!-- All JavaScript at the bottom, except for Modernizr which enables HTML5 elements & feature detects -->
31
+ < script src ="/js/libs/modernizr-1.6.min.js "> </ script >
32
+ </ head >
33
+ < body >
34
+ < div id ="chart_div "> </ div >
24
35
25
- // Set a callback to run when the Google Visualization library is loaded.
26
- google . setOnLoadCallback ( drawChart ) ;
36
+ < script src =" //ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js " > </ script >
37
+ < script > window . jQuery || document . write ( '<script src="/js/libs/jquery-1.7.1.min.js"><\/script>' ) </ script >
27
38
28
- // Callback that creates and populates a data table,
29
- // instantiates the pie chart, passes in the data and
30
- // draws it.
31
- var options = {
32
- title : 'Verbrauch der letzten zwei Minuten' ,
33
- width : 960 ,
34
- height : 440 ,
35
- animation : {
36
- duration : 1000 ,
37
- easing : 'in'
38
- }
39
- } ;
39
+ < script src ="/js/plugins.js "> </ script >
40
+ < script src ="/js/script.js "> </ script >
40
41
41
- var chart ;
42
- var data = [
43
- [ 'Uhrzeit' , 'Verbrauch' ]
44
- ] ;
42
+ < script src ="/socket.io/socket.io.js "> </ script >
43
+ < script src ="/js/xdate.js "> </ script >
45
44
46
- function drawChart ( ) {
47
- chart = new google . visualization . LineChart ( document . getElementById ( 'chart_div' ) ) ;
45
+ < script type =" text/javascript " src =" https://www.google.com/jsapi " > </ script >
46
+ < script type =" text/javascript " >
48
47
49
- socket . on ( 'data' , function ( rawData ) {
50
- var date = new XDate ( new Date ( rawData . date ) ) ;
51
- data . push ( [ date . toString ( "HH:mm:ss" ) , rawData . counter ] ) ;
48
+ var socket = io . connect ( ) ;
52
49
53
- if ( data . length >= 60 ) {
54
- data . splice ( 1 , 1 ) ;
55
- }
50
+ // Load the Visualization API and the piechart package.
51
+ google . load ( 'visualization' , '1.1' , { 'packages' :[ 'corechart' ] } ) ;
56
52
57
- renderData ( ) ;
58
- } ) ;
59
- }
53
+ // Set a callback to run when the Google Visualization library is loaded.
54
+ google . setOnLoadCallback ( drawChart ) ;
60
55
61
- function renderData ( ) {
62
- var gData = google . visualization . arrayToDataTable ( data ) ;
63
- chart . draw ( gData , options ) ;
56
+ // Callback that creates and populates a data table,
57
+ // instantiates the pie chart, passes in the data and
58
+ // draws it.
59
+ var options = {
60
+ title : 'Verbrauch der letzten zwei Minuten' ,
61
+ width : 960 ,
62
+ height : 440 ,
63
+ animation : {
64
+ duration : 1000 ,
65
+ easing : 'in'
64
66
}
65
- </ script >
66
- </ head >
67
- < body >
68
- < div id ="chart_div "> </ div >
67
+ } ;
68
+
69
+ var chart ;
70
+ var data = [
71
+ [ 'Uhrzeit' , 'Verbrauch' ]
72
+ ] ;
73
+
74
+ function drawChart ( ) {
75
+ chart = new google . visualization . LineChart ( document . getElementById ( 'chart_div' ) ) ;
76
+
77
+ socket . on ( 'data' , function ( rawData ) {
78
+ var date = new XDate ( new Date ( rawData . date ) ) ;
79
+ data . push ( [ date . toString ( "HH:mm:ss" ) , rawData . counter ] ) ;
80
+
81
+ if ( data . length >= 60 ) {
82
+ data . splice ( 1 , 1 ) ;
83
+ }
84
+
85
+ renderData ( ) ;
86
+ } ) ;
87
+ }
88
+
89
+ function renderData ( ) {
90
+ var gData = google . visualization . arrayToDataTable ( data ) ;
91
+ chart . draw ( gData , options ) ;
92
+ }
93
+ </ script >
69
94
</ body >
70
95
</ html >
0 commit comments