45 lines
1.5 KiB
JavaScript
45 lines
1.5 KiB
JavaScript
'use strict';
|
|
|
|
const { Component, Fragment } = require('inferno');
|
|
const { cacheComponent } = require('../util/cache');
|
|
|
|
class OutdatedBrowser extends Component {
|
|
render() {
|
|
const { head, cdn } = this.props;
|
|
|
|
const js = `document.addEventListener("DOMContentLoaded", function () {
|
|
outdatedBrowser({
|
|
bgColor: '#f25648',
|
|
color: '#ffffff',
|
|
lowerThan: 'flex'
|
|
});
|
|
});`;
|
|
|
|
if (head) {
|
|
return <link rel="stylesheet" href={cdn('outdatedbrowser', '1.1.5', 'outdatedbrowser/outdatedbrowser.min.css')} />;
|
|
}
|
|
return <Fragment>
|
|
<div id="outdated">
|
|
<h6>Your browser is out-of-date!</h6>
|
|
<p>
|
|
Update your browser to view this website correctly.&npsb;
|
|
<a id="btnUpdateBrowser" href="http://outdatedbrowser.com/">Update my browser now </a>
|
|
</p>
|
|
<p className="last"><a href="#" id="btnCloseUpdateBrowser" title="Close">×</a></p>
|
|
</div>
|
|
<script src={cdn('outdatedbrowser', '1.1.5', 'outdatedbrowser/outdatedbrowser.min.js')} async={true}></script>
|
|
<script dangerouslySetInnerHTML={{ __html: js }}></script>
|
|
</Fragment>;
|
|
|
|
}
|
|
}
|
|
|
|
module.exports = cacheComponent(OutdatedBrowser, 'plugin.outdatedbrowser', props => {
|
|
return {
|
|
head: props.head,
|
|
cdn: props.cdn,
|
|
// for cache purpose only
|
|
_providers: props.providers.cdn
|
|
};
|
|
});
|