@@ -14,11 +14,7 @@ window._escapeHtml = (text) => {
14
14
return text . replace ( / [ & < > " ' ] / g, m => { return map [ m ] ; } ) ;
15
15
} ;
16
16
window . _purifyCSS = ( str ) => {
17
- let map = {
18
- '<' : '<' ,
19
- '>' : '>'
20
- } ;
21
- return str . replace ( / [ & < > " ' ] / g, m => { return map [ m ] ; } ) ;
17
+ return str . replace ( / [ < ] / g, "" ) ;
22
18
} ;
23
19
24
20
// Initiate basic error handling
@@ -46,7 +42,7 @@ window._loadTheme = (theme) => {
46
42
document . querySelector ( "style.theming" ) . remove ( ) ;
47
43
}
48
44
49
- document . querySelector ( "head" ) . innerHTML += `<style class="theming" id="theme_${ settings . theme } _css">
45
+ document . querySelector ( "head" ) . innerHTML += `<style class="theming" id="theme_${ theme } _css">
50
46
@font-face {
51
47
font-family: "${ theme . cssvars . font_main } ";
52
48
src: url("${ path . join ( fontsDir , theme . cssvars . font_main . toLowerCase ( ) . replace ( / / g, '_' ) + '.woff2' ) } ") format("woff2");
@@ -297,7 +293,11 @@ initGreeter = () => {
297
293
} ;
298
294
299
295
window . themeChanger = ( theme ) => {
300
- window . _loadTheme ( require ( path . join ( themesDir , theme || settings . theme + ".json" ) ) ) ;
296
+ let src = path . join ( themesDir , theme + ".json" || settings . theme + ".json" ) ;
297
+ // Always get fresh theme files
298
+ delete require . cache [ src ] ;
299
+
300
+ window . _loadTheme ( require ( src ) ) ;
301
301
for ( let i ; i < 99999 ; i ++ ) {
302
302
clearInterval ( i ) ;
303
303
}
@@ -320,6 +320,10 @@ window.themeChanger = (theme) => {
320
320
window . fsDisp = new FilesystemDisplay ( {
321
321
parentId : "filesystem"
322
322
} ) ;
323
+
324
+ setTimeout ( ( ) => {
325
+ window . term . fit ( ) ;
326
+ } , 2700 ) ;
323
327
} ;
324
328
325
329
// Prevent showing menu, exiting fullscreen or app with keyboard shortcuts
0 commit comments