Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
currentdate.getMinutes() +
":" +
currentdate.getSeconds();
let element = document.createElement("div");
element.innerHTML = `
<style>
@media print {
body {
padding: 0 15px 5px;
color: #000;
background-color: #ffffff;
border-top: 1px solid #aaa;
}
}
</style>
<h1>${store.siteTitle}</h1>
<p>${datetime}</p>
${content}`;
// From https://stackoverflow.com/questions/1071962/how-do-i-print-part-of-a-rendered-html-page-in-javascript#answer-1072151
let print = window.open(
"",
"",
"left=0,top=0,width=800,height=800,toolbar=0,scrollbars=0,status =0"
);
// ensure base tag moves with it if set
if (document.head.getElementsByTagName("base")) {
let base = document.createElement("base");
base.href = document.head
.getElementsByTagName("base")[0]
.getAttribute("href");
print.document.head.appendChild(base);
autorun(reaction => {
this.siteTitle = toJS(store.siteTitle);
this.__disposer.push(reaction);
});
autorun(reaction => {
autorun(reaction => {
this.siteTitle = toJS(store.siteTitle);
this.__disposer.push(reaction);
});
}