Files
remark42/frontend/templates/iframe.ejs
T
2021-08-08 14:25:10 -05:00

102 lines
2.9 KiB
Plaintext

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="modulepreload" href="remark.mjs" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Comments</title>
<base target="_blank" />
<script>
if (window.location.search === '?selfClose') {
window.close();
}
(function () {
function isCSSVariablesSupported() {
if (typeof window === `undefined`) {
return true;
}
return window.CSS && window.CSS.supports && window.CSS.supports('color', 'var(--fake-var)');
}
if (isCSSVariablesSupported()) {
var name;
try {
name = JSON.parse(window.name);
if (name.__colors__) {
const colors = name.__colors__;
for (var color in colors) {
var root = document.documentElement;
root.style.setProperty(color, colors[color]);
}
}
} catch (e) {}
}
})();
</script>
<% if (htmlWebpackPlugin.options.env === 'production') { %>
<link rel="stylesheet" href="remark.css" />
<% } %>
</head>
<body>
<div id="remark42">
<div class="preloader preloader_view_iframe"></div>
</div>
<% if (htmlWebpackPlugin.options.env === 'development') { %>
<script>
if (window.parent !== window) {
try {
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;
} catch (e) {}
}
</script>
<% } %>
<script>
window.addEventListener('message', function receiveMessages(event) {
try {
const data = event.data;
const isObj = typeof data === 'object' && data !== null && !Array.isArray(data);
if (!isObj) return;
const isItHash = data.hash && data.hash.indexOf('#') === 0;
if (isItHash) {
location.replace(data.hash);
}
if (data.title) {
document.title = data.title;
}
} catch (e) {}
});
var remark_config =
window.location.search.length < 2
? {}
: window.location.search
.substr(1)
.split('&')
.reduce(function (c, x) {
var splitted = x.split('=');
if (!splitted[1]) {
splitted[1] = '';
}
c[splitted[0]] = decodeURIComponent(splitted[1]);
return c;
}, {});
window.parent.postMessage({ inited: true }, '*');
</script>
<script>
(function (d) {
var r = d.head || d.body;
var s = d.createElement('script');
var m = 'noModule' in s;
s.src = 'remark' + (m ? '.mjs' : '.js');
m && (s.type = 'module');
s.async = true;
s.defer = true;
r.appendChild(s);
})(document);
</script>
</body>
</html>