mirror of
https://github.com/NohamR/Code-to-PDF.git
synced 2026-05-25 04:07:17 +00:00
Improve performance
This commit is contained in:
@@ -27,9 +27,9 @@
|
|||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link defer href="https://fonts.googleapis.com/css2?family=Fira+Code&family=Roboto&display=swap" rel="stylesheet">
|
<link defer href="https://fonts.googleapis.com/css2?family=Fira+Code&family=Roboto&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
<link rel="stylesheet" id="theme-style"
|
<link rel="stylesheet" id="theme-style" defer
|
||||||
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/github-dark.min.css">
|
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/github-dark.min.css">
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
|
<script defer src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
|
||||||
|
|
||||||
<link rel="stylesheet" href="styles.css">
|
<link rel="stylesheet" href="styles.css">
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
6
index.js
6
index.js
@@ -12,12 +12,6 @@ let selectedTheme = localStorage.getItem('theme') || 'github-dark';
|
|||||||
let codeText = localStorage.getItem('code') || 'console.log("Hello World")';
|
let codeText = localStorage.getItem('code') || 'console.log("Hello World")';
|
||||||
|
|
||||||
// Set up the initial state
|
// Set up the initial state
|
||||||
document.addEventListener('securitypolicyviolation', function (event) {
|
|
||||||
if (event.violatedDirective === 'expect-ct') {
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
themeStylesheet.setAttribute('href', getStylesheet(selectedTheme));
|
themeStylesheet.setAttribute('href', getStylesheet(selectedTheme));
|
||||||
themeSelector.value = selectedTheme;
|
themeSelector.value = selectedTheme;
|
||||||
code.classList.add('hljs', `language-${selectedLanguage}`);
|
code.classList.add('hljs', `language-${selectedLanguage}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user