-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact-clock.html
630 lines (530 loc) · 28.2 KB
/
react-clock.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
<!DOCTYPE html>
<html>
<head id="documentHead">
<meta charset="UTF-8" />
<title>Live Import Test</title>
<script src="js/react.min.js"></script>
<script src="js/react-dom.min.js"></script>
<script src="js/moment.min.js"></script>
<script src="js/moment-timezone.min.js"></script>
<script src="js/moment-timezone-with-data.js"></script>
<script src="js/babel.min.js"></script>
<link rel="stylesheet" type="text/css" href="/css/default.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
</head>
<body id="body-main">
<noscript>
<div style="width:80%; padding: 20px 10% 20px 10%; text-align: center; background-color:#dc1818; color:#ffffff;">
Warning: Your JavaScript is turned off or not working correctly. This may cause the site to run differently than we intended.
</div>
</noscript>
<div id="react-main"></div>
<script type="text/babel">
//https://stackoverflow.com/questions/7389328/detect-if-browser-tab-has-focus
//window.onfocus and window.onblur - allows detection if the current tab is selected.
//https://stackoverflow.com/questions/1060008/is-there-a-way-to-detect-if-a-browser-window-is-not-currently-active
var hasFocus=false;
var loaded = false;
// window.onload = function() {
// if (hasFocus) alert('example');
// loaded = true;
// };
// window.onfocus = function() {
// if (loaded) alert('example');
// hasFocus = true;
// };
// window.onblur = function() { hasFocus = false; };
// var NTPtime = 0;//global variable to pass NTP time between components.//not needed
//software tech readiness level
//https://www.nasa.gov/pdf/458490main_TRL_Definitions.pdf
var AddAlertBox = React.createClass({
getInitialState: function() {
return {
src: 'thing'
};
},
componentDidMount: function() {
const s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
// s.innerHTML = "document.write('This is output by document.write()!')";
s.innerHTML = `
var ntpAlertBox = {};
ntpAlertBox.elem = document.getElementById('ntp-alert-box');
ntpAlertBox.elem.className += " alert-box-animation";
document.getElementById('time-report').style.height = parseInt(ntpAlertBox.elem.offsetHeight) +'px';
setTimeout(function () {
ntpAlertBox.temp = ntpAlertBox.elem.className.split(" ");
ntpAlertBox.elem.className = ntpAlertBox.temp[0]+' '+ntpAlertBox.temp[1];
// ntpAlertBox.elem.className = ntpAlertBox.elem.className.split(" ")[0];
}.bind(this), 1000);
`;
this.instance.appendChild(s);
},
handleClick: function() {
console.log('clicked');
ReactDOM.unmountComponentAtNode(document.getElementById('time-report'));
},
render: function() {
return (
<div id="ntp-alert-box" className={"alert-box " + this.props.colour}>
<p className="alert-p">{this.props.text}</p>
<div className="close-alert-box" onClick={this.handleClick}> x </div>
<div ref={(el) => (this.instance = el)} />
</div>
)
}
});
//alert-box-animation - add via js as soon as it comes in, then remove to see the animation, cannot be there on entry as if js off it will always remain off screen
var AddJS = React.createClass({
getInitialState: function() {
return {
src: 'thing'
};
},
componentDidMount: function() {
console.log('addJS: componentDidMount');
this.setState({src: this.props.src}, () => {
console.log(this.state.src);
let s = document.createElement('script');
s.id = 'theme-js';
s.type = 'text/javascript';
s.src = this.state.src;
s.setAttribute("data-ref", this.props.refVar);
s.setAttribute("data-codeVar", this.props.codeVar);
this.instance.appendChild(s);
});
},
render: function() {
return (
<div ref={(el) => (this.instance = el)} />
)
}
});
//the list prop has json file in it
var ThemeListOutput = React.createClass({
getInitialState: function() {
return {
selectValue:'AnalogueClock'
};
},
componentWillMount: function() {
console.log('theme list:');
console.log(this.props.list);
},
formAction: function() {
console.log('***form action***');
//cannot move all this out to a removeTheme function in timerMain as there is a call to this.renderTheme for the callback
timerMain.hideThemeSelector();
var params = {
"scriptSrc" : '/js/'+this.props.list[this.state.selectValue].fileName,
"refName" : this.props.list[this.state.selectValue].refName,
"varName" : this.props.list[this.state.selectValue].varName
};
var domRef = document.getElementById('theme-js').getAttribute("data-ref");
var codeRef = document.getElementById('theme-js').getAttribute("data-codevar");
window[String(domRef)]['halt'](params, this.renderTheme);//try this.renderTheme ??? -- ThemeListOutput.renderTheme - didn't work
},
renderTheme: function(params) {
ReactDOM.unmountComponentAtNode(document.getElementById('js-import'));
ReactDOM.unmountComponentAtNode(document.getElementById('clock-display'));
document.getElementById('documentHead').removeChild(document.getElementById('themeCSS'));
console.log('params:');
console.log(params);
// <AddJS src={scriptSrc} refVar={this.props.list[this.state.selectValue].refName} codeVar={this.props.list[this.state.selectValue].varName} />
ReactDOM.render(
<AddJS src={params.scriptSrc} refVar={params.refName} codeVar={params.varName} />,
document.getElementById('js-import')
);
},
handleChange: function(e) {
this.setState({selectValue: e.target.value}, () => {
console.log('from change handle: '+this.state.selectValue);
console.log(this.state);
});
},
render: function() {
return (
<form action="javascript:void(0);">
<select name="themeOptions" onChange={this.handleChange} >
{Object.keys(this.props.list).map(function(key) {
return <option value={key}>{this.props.list[key].name}</option>
console.log('key: '+key);
console.log('list[key]: '+this.props.list[key]);
}.bind(this))}
</select>
<input type="button" value="Submit" onClick={this.formAction.bind(this)} />
</form>
)
}
});
var TimezoneListOutput = React.createClass({
getInitialState: function() {
return {
themes: [{}]
};
},
componentWillMount: function() {
// var self = this;
// this.setState(this.props.list);//not required....
},
formAction: function() {
console.log('***TimezoneListOutput form action***');
var domRef = document.getElementById('theme-js').getAttribute("data-ref");
window[String(domRef)]['timeZoneSetter'](this.state.selectValue,this.props.list[this.state.selectValue]['UTCoffset']);
},
handleChange: function(e) {
console.log(this.state);
this.setState({selectValue: e.target.value}, () => {
console.log('from change handle: '+this.state.selectValue);
});
console.log(this.state);
},
render: function() {
return (
<form action="javascript:void(0);">
<select name="themeOptions" onChange={this.handleChange} >
{Object.keys(this.props.list).map(function(key) {
return <option value={key}>{key} {this.props.list[key]['UTCoffset']}</option>
}.bind(this))}
</select>
<input type="button" value="Submit" onClick={this.formAction.bind(this)} />
</form>
)
}
});
//MAKE IT SO THAT USES CAN CHNE THE TIME ZONE OF THE CLOCK
//Dispaly the timezone they have selected under the clock
//allow multiple clocks displaying multiple timezones?
//notes:
//each theme needs a different var name for both the code containing the component and the ReactDOM reference that calls it
//this way calls can be make to this code when the js is removed and this can take action during the time waiting for a settimeout to call
//immediately a new js theme can be added to the page without waiting for the old one to finish
//becaue of the callback this can now be factored out so that they all use a single function
//slowness of the flip clock at beginning could just be the images loading.
var Timer3 = React.createClass({
getInitialState: function() {
return {
timezones : null,
themes : null
};
},
componentWillMount: function () {
this.xhttpGetTimezones();
},
componentDidMount: function() {
this.xhttpGetThemesInit();
this.xhttpGetTime();//checks the timezone is correct
},
checkDST: function(timeZone) {
// moment.tz("2017-11-31", "Australia/Yancowinna").format();
// "Invalid date"
// moment.tz("2017-11-01", "Australia/Yancowinna").format();
// "2017-11-01T00:00:00+10:30"
// moment.tz("2017-11-01", "Europe/London").format();
// "2017-11-01T00:00:00Z"
// moment.tz("2017-07-01", "Europe/London").format();
// "2017-07-01T00:00:00+01:00"
var currentDate = new Date();
// console.log(currentDate.getUTCFullYear() );
// console.log(currentDate.getUTCMonth() );
// console.log(currentDate.getUTCDay() );
//current date: 31/07/2017
// new Date().getUTCFullYear()//2017
// new Date().getUTCMonth()//6
// new Date().getUTCDay()//1
//LIST IS 0-11 for months for example.
console.log('from checkDST: timezone: ' + timeZone);
var year = currentDate.getUTCFullYear();
var month = parseInt(currentDate.getUTCMonth()) + 1;//retuns the month where jan is 0 and dec is 11 +1
var day = currentDate.getUTCDate();//retuns the date of the month
if (month.toString().length < 2) {
// console.log('month is < 2');
month = '0'+month;
}
if (day.toString().length < 2) {
// console.log('day is < 2');
day = '0'+day;
}
// console.log('from checkDST: date: '+year+'-'+month+'-'+day);
// console.log('from checkDST: date: ' + moment.tz(year+'-'+month+'-'+day, timeZone).format().substring(19) );
// console.log('from checkDST: date: ' + moment.tz(year+'-'+month+'-'+day, timeZone).format() );
console.log('from checkDST: date: ' + moment.tz(year+'-'+month+'-'+day, timeZone).format('Z') );
// console.log('from checkDST: date: ' + moment.tz(year+'-'+month+'-'+day, timeZone).isValid() );
//return moment.tz("2017-07-01", "Europe/London").format().substring(19);
// return moment.tz(year+'-'+month+'-'+day, timeZone).format().substring(19);
//above was returning 'Z': 2017-09-05T00:00:00Z when timezone was +00:00 - expecting something like 2017-09-05T00:00:00+03:00, substring extracts the +03:00
return moment.tz(year+'-'+month+'-'+day, timeZone).format('Z');
},
timezoneTheme: function(timeZone,hours,minutes) {
//Australia has the opposite DST, because their summer happens at a different time. So when it is DST in the UK it is NOT DST in Australia.
//here times are different to that found in my chart on wikipedia:
//http://www.australia.gov.au/about-australia/facts-and-figures/time-zones-and-daylight-saving
// console.log('timezoneTheme: hours: '+hours);
// console.log('timezoneTheme: minutes: '+minutes);
var timeZoneValue = this.checkDST(timeZone);//a change in time happens here!
// get current date
// get time that is required to be + or -
//+ or - that form current time and set as the state value.
// console.log('++ timezoneTheme ++');
// console.log('timeZone: '+timeZoneValue);
// console.log('timezoneTheme: hours: '+hours);
// console.log('timezoneTheme: minutes: '+minutes);
// console.log('++ ++ ++ ++ ++ ++ ++');
//NaN error happens here!
// console.log('hours before changed: ' + hours);
// console.log('mins before changed: ' + minutes);
if ( timeZoneValue.match(/\+/g) ) {
// console.log('contains +');//works
// this.state.timeZone.charAt(2);
hours = hours + parseInt(timeZoneValue.substring(1, 3));
minutes = minutes + parseInt(timeZoneValue.substring(4));
} else {
// console.log('contains -');//works
hours = hours - parseInt(timeZoneValue.substring(1, 3));
minutes = minutes - parseInt(timeZoneValue.substring(4));
}
// console.log('hours changed: ' + hours);
// console.log('mins changed: ' + minutes);
if ( parseInt(minutes) >= 60 ) {
// console.log('parseInt(minutes) >= 60: ' + minutes);
minutes = parseInt(minutes) - 60;
hours = parseInt(hours) + 1;
}//end if
if ( parseInt(hours) < 0 ) {
// console.log('hours < 0: ' + hours);
// console.log('new hours: ' + (24 - parseInt(hours)));
hours = 24 - parseInt(hours);
} else if ( parseInt(hours) >= 24 ) {
// console.log('hours >= 24: ' + hours);
// console.log('new hours: ' + (parseInt(hours) - 24));
hours = parseInt(hours) - 24;
}
// console.log('hours changed: ' + hours);
//no need to return, use setter
return {
'hours' : hours,
'minutes' : minutes
}
},
displayTime: function(xhttp,recieveTime,sentTime) {
//https://github.com/hueniverse/sntp/blob/master/lib/index.js
// Timestamp Name ID When Generated
// ------------------------------------------------------------
// Originate Timestamp T1 time request sent by client
// Receive Timestamp T2 time request received by server
// Transmit Timestamp T3 time reply sent by server
// Destination Timestamp T4 time reply received by client
// The roundtrip delay d and system clock offset t are defined as:
// d = (T4 - T1) - (T3 - T2) t = ((T2 - T1) + (T3 - T4)) / 2
//var unix = Math.round(+new Date()/1000);//unix time stamp
var T1 = Math.round(sentTime/1000);//taken from local time
// console.log('T1: '+T1);
var T4 = Math.round(recieveTime/1000);//taken from local time
// console.log('T4: '+T4);
var totalTrip = Math.round(T4 - T1);//round trip total in seconds, both taken from current local time
console.log('totalTrip: '+totalTrip);
// var response = '';
// var T2, T3, output, outputString;
var response, outputString, colour;
//if it doesn't take longer than 15 seconds
if (totalTrip <= 10) {
// console.log('totalTrip was <= 15');
//this means that the total trip was less than 15 seconds.
//the request needs to be made at around 15-20 seconds past the current minute, this allows a safe passage of time.
//then, when it gets recived, within ths function the current time local time can be checked and the current minute and hour compared.
//the whole date can also be compared, and of course of local time zones need to be taken into consideration.
//BUT - HERE THE WHOLE DATE IS COMPARED ALREADY
//
//response = xhttp.responseText;
response = JSON.parse(xhttp.responseText);
// T2 = parseInt(response['T2'], 10);
// // console.log('T2: '+T2);
// T3 = parseInt(response['T3'], 10);
// // console.log('T3: '+T3);
// // console.log('T1: '+typeof T1);
// // console.log('T2: '+typeof T2);
// // console.log('T3: '+typeof T3);
// // console.log('T4: '+typeof T4);
// var d = (T4 - T1) - (T3 - T2);
// console.log('d: '+ d);
// var t = ((T2 - T1) + (T3 - T4)) / 2;
// console.log('t: '+ t);
console.log( JSON.parse(xhttp.responseText) );
//docs on date formats:
//http://momentjs.com/docs/#/parsing/
var ntpTime = response.ntp.match(/\d\d:\d\d:\d\d/g);
console.log( 'ntpTime: '+ ntpTime );
//https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
//https://www.iana.org/time-zones
var timeZone = JSON.parse(response.timeZone);
// console.log('timezone: '+timeZone.time_zone);
//gets the correct time according to the timezone got from the ip address server side
// console.log('*** NTP Conversion using timezone of IP ***');
var dateString = String(response.date)+' '+String(ntpTime);//NTP time WITHOUT statement of time zone
//console.log('dateString: '+dateString);
var momentNTPtime = moment( new Date( String(dateString) ).toString() );
// console.log( momentNTPtime.tz(timeZone.time_zone).format('YYYY-MM-DD HH:mm:ss') );//doesn't give the right time as we are in summer time +1 hr, there is no indication of this being passed in.
console.log('*******');
var currentLocalTime = new Date();
console.log('Your time zone is: ' + timeZone.time_zone);
console.log('NTP time is: ' + String(ntpTime) );
// console.log('NTP time converted using timezone: ' + momentNTPtime.tz(timeZone.time_zone).format('YYYY-MM-DD HH:mm:ss') );
//utc does not work in british summer time.
//console.log('Local time on computer is: ' + currentLocalTime.getUTCHours()+':'+currentLocalTime.getUTCMinutes()+':'+currentLocalTime.getUTCSeconds() );
console.log('Local time on computer is: ' + currentLocalTime );
//remember unix time is universal throught the world. the same second ticks on every pc.
var convertedLocalTime = Math.round(currentLocalTime/1000);
// console.log('convertedLocalTime: '+convertedLocalTime);
var convertedNTPTime = momentNTPtime.tz(timeZone.time_zone).unix();
// console.log('convertedNTPTime: '+convertedNTPTime);
console.log('timezone test: '+ moment( currentLocalTime.toString() ).tz(timeZone.time_zone).format('YYYY-MM-DD HH:mm:ss') );//but current local time is already set! so this isn't setting it according to the timezone!
console.log('--- *** ---');
var timeoutputTest = momentNTPtime.tz(timeZone.time_zone).format('YYYY-MM-DD HH:mm:ss');
console.log('timeoutputTest: '+timeoutputTest);
timeoutputTest = new Date(timeoutputTest);
console.log('timeoutputTest: '+timeoutputTest);
timeoutputTest = Math.round(timeoutputTest/1000);
console.log('timeoutputTest: '+timeoutputTest);
console.log('--- *** ---');
// var localDifference = timeoutputTest - convertedNTPTime;//local time will always be later than the NTP time recieved.
var localDifference = convertedNTPTime - timeoutputTest;//local time will always be later than the NTP time recieved.
console.log('Difference in seconds NTP to local machine: '+localDifference);
var differenceHours = localDifference/3600;
if ( String(localDifference).match(/-/g) === null ) {
console.log('this is not a negative number');
localDifference = '+' + String(localDifference);
differenceHours = '+' + String(differenceHours);
}
// outputString = 'Time difference in seconds between NTP time and the time on your machine is: ' + localDifference + ' seconds ('+ differenceHours +' hours).';//60*60 = 3600 ... then divide new time by this to get hours
//outputString += 'This was gathered by comparing the IP address of the country your computer was located against the time currently set on your machine. You might need to adjust your time zone settings or the time your machine is set to.';
if ( localDifference < -50 || localDifference > 50 ) {
// outputString += ' localDifference < -50 || localDifference > 50';
outputString = 'Time difference in seconds between NTP time and the time on your machine is: ' + localDifference + ' seconds ('+ differenceHours +' hours). You might need to adjust your time zone settings or the time your machine is set to.';
colour = 'red';
} else {
outputString = 'Your computer time is set correctly against your current geographic location.';
colour = 'green';
}
} else {
//this means any part of the date could be wrong as the seconds since 1st Jan 1970 were measured. - it doesn't as the two measurements were taken from the local time
//but - could the timezone do this?
outputString = 'There was greater than 10 seconds between the transmission and the receipt of data from the server.';
colour = 'red';
}
// ReactDOM.render(
// React.createElement('div', {id : 'time-report-content'}, outputString),
// document.getElementById('time-report')
// );
ReactDOM.render(
<AddAlertBox text={outputString} colour={colour} />,
document.getElementById('time-report')
);
// return outputString;
},
handleTheme: function(xhttp) {
ReactDOM.render(
<ThemeListOutput list={JSON.parse(xhttp.responseText)} />,
document.getElementById('theme-list')
);
},
handleThemeInit: function(xhttp) {
// var themes = JSON.parse(xhttp.responseText);
this.setState({ themes: JSON.parse(xhttp.responseText) }, () => {
ReactDOM.render(
<AddJS src={'/js/'+this.state.themes.DigitalClock.fileName} refVar={this.state.themes.DigitalClock.refName} codeVar={this.state.themes.DigitalClock.varName} />,
document.getElementById('js-import')
);
});
},
handleTimezone: function(xhttp) {
ReactDOM.render(
<TimezoneListOutput list={JSON.parse(xhttp.responseText)} />,
document.getElementById('timezone-display')
);
},
getJSON: function(url,cFunction) {
var self = this;
var xhttp, sentTime;
xhttp=new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState === 4 && this.status === 200) {
var recievedTime = new Date();
cFunction(this,recievedTime, sentTime);
// console.log(this.responseText);
} else if(this.readyState === 4 && this.status === 500) {
console.log('500 error...');
console.log(this.readyState);
console.log(this.responseText);
console.log('*********');
}//end else if
};
xhttp.open("GET", url, true);
xhttp.send();
sentTime = new Date();
},
xhttpGetTime: function(state) {
// this.getJSON('https://aqueous-meadow-38089.herokuapp.com/time', this.displayTime);
this.getJSON('https://aqueous-meadow-38089.herokuapp.com/time', this.requestTimeLoop);
},
xhttpGetThemes: function(state) {
// this.getJSON('http://localhost:3001/themes', this.handleTheme);
this.getJSON('https://aqueous-meadow-38089.herokuapp.com/themes', this.handleTheme);
},
xhttpGetThemesInit: function(state) {
this.getJSON('https://aqueous-meadow-38089.herokuapp.com/themes', this.handleThemeInit);
},
xhttpGetTimezones: function(state) {
this.getJSON('https://aqueous-meadow-38089.herokuapp.com/timezones', this.handleTimezone);
},
requestTimeLoop: function(xhttp,recieveTime,sentTime) {
console.log('from requestTimeLoop:');
console.log(xhttp);
if ( xhttp.responseText === 'Unable to complete NTP request.' ) {
console.log('complete request NOT returned');
setTimeout(function(){
this.getJSON('https://aqueous-meadow-38089.herokuapp.com/time', this.requestTimeLoop);
}.bind(this), 5000);//result should run 4.5 seconds into the next minute.
} else {
console.log('complete request returned');
this.displayTime(xhttp,recieveTime,sentTime);
}//end else
},
addThemeCSS: function (fileHref) {
var node = document.createElement("link");
node.setAttribute("id", "themeCSS");
node.setAttribute("rel", "stylesheet");
node.setAttribute("type", "text/css");
node.setAttribute("href", String(fileHref));
document.getElementById("documentHead").appendChild(node);
},
hideThemeSelector: function() {
ReactDOM.unmountComponentAtNode(document.getElementById('theme-list'));
},
render: function() {
return (
<div id="App-Root" className="App">
<div id="clock-display"></div>
<div> </div>
<div id="timezone-display"></div>
<div id="change-theme-button">
<button type="button" onClick={this.xhttpGetThemes.bind(this)}>Change Theme</button>
<div id="theme-list"></div>
</div>
<div> </div>
<div id="time-report"></div>
<div id="js-import"></div>
</div>
);
}
});
let timerMain = ReactDOM.render(React.createElement(Timer3, null), document.getElementById('react-main'));
//timerMain.xhttpGetTime()
//timerMain.removeTheme()
//timerMain.checkDST()
//<div id="time-display"></div>
//<div> </div>
// myRegistrationModal.timeZoneGetter()
</script>
</body>
</html>