This repository has been archived on 2024-04-03. You can view files and clone it, but cannot push or open issues or pull requests.
OLD-GZod01.fr_Source_Code-OLD/api/scripts/tranform.js
2023-03-25 10:26:41 +01:00

26 lines
823 B
JavaScript

function transformpage(docstr, titleofdoc){
let toreturn = `
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="//api.gzod01.fr/pictures/gzod01.png">
<link rel="stylesheet" href="//api.gzod01.fr/css/style.css">
<script src="//api.gzod01.fr/scripts/main.js"></script>
<title>${titleofdoc}</title>
</head>
<body>
<div id="header"></div>
<div class=content>
${docstr}
</div>
<div id="footer"></div>
</body>
</html>
`
return toreturn
}
function transform() {document.querySelector(':root').innerHTML = transformpage(document.getElementById('content'),document.title)}
window.onload = () =>{transform()}