File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,16 @@ const info = document.getElementById('info');
44
55themes . 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+
717function 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
You can’t perform that action at this time.
0 commit comments