Skip to content

Commit 1d4c2ee

Browse files
authored
Update footer.js
1 parent b20ab3d commit 1d4c2ee

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

js/footer.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ const info = document.getElementById('info');
44

55
themes.value = theme;
66

7+
const writeupsContext = {
8+
sharedContext:
9+
'This is an webapp infomation security bug writeup intended for a tech-savvy audience.',
10+
format: 'plain-text',
11+
length: 'long',
12+
expectedInputLanguages: ['en'],
13+
outputLanguage: 'en',
14+
expectedContextLanguages: ['en']
15+
}
16+
717
function getRandomIntInclusive(min, max) {
818
const randomBuffer = new Uint32Array(1);
919

@@ -84,6 +94,7 @@ themes.onchange = async () => {
8494
)
8595
) {
8696
localStorage.setItem('theme', themes.value);
97+
if (themes.value == 'summarizer.css') await Summarizer.create(writeupsContext);
8798
reloadAll();
8899
} else {
89100
// Revert UI
@@ -213,15 +224,8 @@ async function summarizer() {
213224
location.pathname === '/writeups/'
214225
)
215226
return;
216-
const summarizer = await Summarizer.create({
217-
sharedContext:
218-
'This is an webapp infomation security bug writeup intended for a tech-savvy audience.',
219-
format: 'plain-text',
220-
length: 'long',
221-
expectedInputLanguages: ['en'],
222-
outputLanguage: 'en',
223-
expectedContextLanguages: ['en']
224-
});
227+
228+
const summarizer = await Summarizer.create(writeupsContext);
225229

226230
content.innerText = '';
227231

0 commit comments

Comments
 (0)