44 * This source code is licensed under the MIT license found in the
55 * LICENSE file in the root directory of this source tree.
66 */
7-
7+ const https = require ( 'https' ) ;
88const React = require ( 'react' ) ;
99
1010class Footer extends React . Component {
11- docUrl ( doc , language ) {
12- const baseUrl = this . props . config . baseUrl ;
13- return baseUrl + 'docs/' + ( language ? language + '/' : '' ) + doc ;
11+ /*constructor(props) {
12+ super(props);
13+ this.state = {footerHTML: ''};
14+ }
15+
16+ componentWillMount() {
17+ this.getFooter();
1418 }
1519
16- pageUrl ( doc , language ) {
17- const baseUrl = this . props . config . baseUrl ;
18- return baseUrl + ( language ? language + '/' : '' ) + doc ;
20+ setFooter(data) {
21+ this.setState({footerHTML: data});
1922 }
2023
24+ getFooter() {
25+ const self = this;
26+ let store = '';
27+ https
28+ .get(
29+ `https://www.sqlgate.com/getFooter?langauge=${this.props.language}`,
30+ res => {
31+ res.on('data', d => {
32+ store += d;
33+ //process.stdout.write(d);
34+ });
35+ res.on('end', function() {
36+ self.setFooter(store);
37+ self.forceUpdate();
38+ });
39+ }
40+ )
41+ .on('error', e => {
42+ console.error(e);
43+ });
44+ }*/
45+
2146 render ( ) {
22- const currentYear = new Date ( ) . getFullYear ( ) ;
2347 return (
2448 < footer className = "nav-footer" id = "footer" >
25- < section className = "sitemap wrapper" >
26- < div >
27- < img
28- src = { this . props . config . baseUrl + this . props . config . footerIcon }
29- alt = { this . props . config . title }
30- width = "89"
31- />
32- CHEQUER | Database Driven Innovation Company Copyright © 2018
33- CHEQUER Inc. All rights reserved.
34- </ div >
49+ < section className = "wrapper" >
50+ < div id = "common-footer-wrapper" />
3551 </ section >
3652
3753 < script
@@ -47,6 +63,22 @@ gtag('js', new Date());
4763gtag('config', 'UA-26882913-4');` ,
4864 } }
4965 />
66+ < script
67+ dangerouslySetInnerHTML = { {
68+ __html : `
69+ var xhttp = new XMLHttpRequest();
70+ xhttp.onreadystatechange = function() {
71+ if (this.readyState == 4 && this.status == 200) {
72+ document.querySelector("#common-footer-wrapper").innerHTML = this.responseText;
73+ }
74+ };
75+ xhttp.open("GET", "https://www.sqlgate.com/getFooter?language=${
76+ this . props . language
77+ } ", true);
78+ xhttp.send();
79+ ` ,
80+ } }
81+ />
5082 </ footer >
5183 ) ;
5284 }
0 commit comments