pyret-embed 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -902,6 +902,27 @@ body.hideFooter .replContainer {
902
902
  padding-bottom: 0rem;
903
903
  }
904
904
 
905
+ /* Unobtrusive compiler-flavor indicator, pinned to the REPL's corner just
906
+ above the footer padding. Hidden unless the page resolved to the ts
907
+ flavor (editor.html adds .ts-mode to <html> in the same branch that
908
+ swaps PYRET), so the stock editor shows nothing new. */
909
+ #compilerFlavorBadge {
910
+ display: none;
911
+ position: absolute;
912
+ right: 8px;
913
+ bottom: calc(2.5rem + 4px);
914
+ font-size: 11px;
915
+ color: #999;
916
+ z-index: 1;
917
+ user-select: none;
918
+ }
919
+ html.ts-mode #compilerFlavorBadge {
920
+ display: block;
921
+ }
922
+ body.hideFooter #compilerFlavorBadge {
923
+ bottom: 4px;
924
+ }
925
+
905
926
  body.hideHeader .replContainer {
906
927
  padding-top: 0px;
907
928
  }
@@ -25,6 +25,9 @@
25
25
  if(m) { window.CPO_COMPILER = decodeURIComponent(m[1]); }
26
26
  if(window.CPO_COMPILER === "ts" && window.PYRET_TS) {
27
27
  window.PYRET = window.PYRET_TS;
28
+ // Lets pure CSS show ts-only chrome (the "(ts mode)" badge in the
29
+ // REPL corner) without another script running at DOM-ready.
30
+ document.documentElement.classList.add("ts-mode");
28
31
  // In gzipped mode the host may serve assets without an executable MIME
29
32
  // type (nosniff), which refuses a <script src> load outright --
30
33
  // beforePyret.js fetches the compiler bundle alongside the jarr instead.
@@ -391,6 +394,7 @@
391
394
  </div>
392
395
  <div id="REPL" class="replContainer" role="region" aria-label="Interactions">
393
396
  <div id="handle" class="ui-resizable-handle ui-resizable-w"></div>
397
+ <div id="compilerFlavorBadge" title="This session uses the TypeScript version of Pyret. Visit /settings/clear-ts to turn it off.">(ts mode)</div>
394
398
  </div>
395
399
  <div id="help-keys">
396
400
  <p><b>Press <kbd>Esc</kbd> to close this help window</b></p>
@@ -25,6 +25,9 @@
25
25
  if(m) { window.CPO_COMPILER = decodeURIComponent(m[1]); }
26
26
  if(window.CPO_COMPILER === "ts" && window.PYRET_TS) {
27
27
  window.PYRET = window.PYRET_TS;
28
+ // Lets pure CSS show ts-only chrome (the "(ts mode)" badge in the
29
+ // REPL corner) without another script running at DOM-ready.
30
+ document.documentElement.classList.add("ts-mode");
28
31
  // In gzipped mode the host may serve assets without an executable MIME
29
32
  // type (nosniff), which refuses a <script src> load outright --
30
33
  // beforePyret.js fetches the compiler bundle alongside the jarr instead.
@@ -391,6 +394,7 @@
391
394
  </div>
392
395
  <div id="REPL" class="replContainer" role="region" aria-label="Interactions">
393
396
  <div id="handle" class="ui-resizable-handle ui-resizable-w"></div>
397
+ <div id="compilerFlavorBadge" title="This session uses the TypeScript version of Pyret. Visit /settings/clear-ts to turn it off.">(ts mode)</div>
394
398
  </div>
395
399
  <div id="help-keys">
396
400
  <p><b>Press <kbd>Esc</kbd> to close this help window</b></p>