Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
Fixes a bug in Firefox related to switching sections in the documentation.
  • Loading branch information
PeterShaggyNoble committed Mar 21, 2019
1 parent 6fe6696 commit 20284f3
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 14 deletions.
2 changes: 1 addition & 1 deletion css/default.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/flags.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"type":"flags","title":"Flags","object":"","intro":"Flags can be entered either in the dedicated field or directly in the input box. Some flags may be combined in the form `-mR`. When a flag runs the programme on each element in the first input and that input is a number then it is first converted to the range `[0,N)` or, if that input is a string, it is first split into an array of characters and rejoined again afterwards.","flags":{"!":{"description":"Outputs the logical `NOT` of the value returned by the programme; i.e., `true` if falsey, or `false` if truthy.","version":"1.4.5"},"N":{"description":"Converts the value returned by the programme to a number. If that value is an array, it is first joined to a string.","version":"1.4.5"},"P":{"description":"Joins the value returned by the programme to a string if that value is an array.","version":"1.4.5"},"Q":{"description":"\"Prettyprints\" the output.","version":"1.4.5"},"R":{"description":"Joins the value returned by the programme to a string with newlinews if that value is an array.","version":"1.4.5"},"S":{"description":"Joins the value returned by the programme to a string with spaces if that value is an array.","version":"1.4.5"},"d":{"description":"Runs the program on each element in the first input, outputting `true` if any returns a truthy value, or `false` if not.","version":"1.4.5"},"e":{"description":"Runs the program on each element in the first input, outputting `true` if all return a truthy value, or `false` if not.","version":"1.4.5"},"f":{"description":"Runs the program on each element in the first input, outputting an array of those that return a truthy value.","version":"1.4.5"},"g":{"description":"If the programme returns a number then outputs its sign; `-1` if negative, `1` if positive, `0` if `0`, or `NaN` if `NaN`.","version":"1.4.5"},"gn":{"description":"If the programme returns a string or an array, outputs the character or element at index `n`, with `n` defaulting to `0`.","version":"1.4.5"},"h":{"description":"If the programme returns a string or an array, outputs the last character or element.","version":"1.4.5"},"m":{"description":"Runs the program on each element in the first input, outputting an array of the results.","version":"1.4.5"},"x":{"description":"Runs the `.x()` method for the relevant type on the value returned by the programme, trimming a string, reducing an array by addition, or rounding a number to the nearest whole number.","version":"1.4.5"},"¡":{"description":"Outputs the value returned by the programme as a boolean; i.e., `true` if truthy, or `false` if falsey.","version":"1.4.5"},"æ":{"description":"Runs the program on each element in the first input, outputting the first to return a truthy value.","version":"1.4.5"}}}
{"type":"flags","title":"Flags","object":"","intro":"Flags can be entered either in the dedicated field or directly in the input box. Some flags may be combined in the form `-mR`. When a flag runs the programme on each element in the first input and that input is a number then it is first converted to the range `[0,N)` or, if that input is a string, it is first split into an array of characters and rejoined again afterwards.","flags":{"!":{"description":"Outputs the logical `NOT` of the value returned by the programme; i.e., `true` if falsey, or `false` if truthy.","version":"1.4.5"},"E\"s\"":{"description":"Outputs `s` if the programme throws an error. Considered to be a \"cheating\" flag - use at your own discretion.","version":"1.4.6"},"F\"s\"":{"description":"Outputs `s` if the programme returns a falsey value. Considered to be a \"cheating\" flag - use at your own discretion.","version":"1.4.6"},"N":{"description":"Converts the value returned by the programme to a number. If that value is an array, it is first joined to a string.","version":"1.4.5"},"P":{"description":"Joins the value returned by the programme to a string if that value is an array.","version":"1.4.5"},"Q":{"description":"\"Prettyprints\" the output.","version":"1.4.5"},"R":{"description":"Joins the value returned by the programme to a string with newlinews if that value is an array.","version":"1.4.5"},"S":{"description":"Joins the value returned by the programme to a string with spaces if that value is an array.","version":"1.4.5"},"d":{"description":"Runs the program on each element in the first input, outputting `true` if any returns a truthy value, or `false` if not.","version":"1.4.5"},"e":{"description":"Runs the program on each element in the first input, outputting `true` if all return a truthy value, or `false` if not.","version":"1.4.5"},"f":{"description":"Runs the program on each element in the first input, outputting an array of those that return a truthy value.","version":"1.4.5"},"g":{"description":"If the programme returns a number then outputs its sign; `-1` if negative, `1` if positive, `0` if `0`, or `NaN` if `NaN`.","version":"1.4.5"},"gn":{"description":"If the programme returns a string or an array, outputs the character or element at index `n`, with `n` defaulting to `0`.","version":"1.4.5"},"h":{"description":"If the programme returns a string or an array, outputs the last character or element.","version":"1.4.5"},"m":{"description":"Runs the program on each element in the first input, outputting an array of the results.","version":"1.4.5"},"x":{"description":"Runs the `.x()` method for the relevant type on the value returned by the programme, trimming a string, reducing an array by addition, or rounding a number to the nearest whole number.","version":"1.4.5"},"¡":{"description":"Outputs the value returned by the programme as a boolean; i.e., `true` if truthy, or `false` if falsey.","version":"1.4.5"},"æ":{"description":"Runs the program on each element in the first input, outputting the first to return a truthy value.","version":"1.4.5"}}}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><head><title>Japt Interpreter</title><meta charset="utf-8"><meta content="initial-scale=1,width=device-width" name="viewport"><meta content="#212121" name="theme-color"><link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500|Roboto:400,500" rel="stylesheet"><link href="css/default.css" rel="stylesheet"></head><body><header class="df pf" id="header"><h1>Japt</h1><ol class="df oh pr" id="versions" tabindex="-1"></ol><div class="pa wsnw" id="tools"><label class="dib pr vat" data-title="Flag(s)" for="flags"><svg class="vam" data-mdi="flag" viewBox="0 0 24 24"></svg></label><input class="dib vat" id="flags" spellcheck="false" value=""><p class="dib pr vat" data-title="Run (Ctrl+Enter)"><svg class="cp vam" data-mdi="play-circle" id="run" viewBox="0 0 24 24"><circle cx="12" cy="12" r="12"></circle><circle cx="12" cy="12" r="11.625"></circle><rect height="17.325" width="24" x="0" y="0"></rect></svg></p><p class="dib pr vat" data-title="Copy Link"><svg class="cp vam" data-copy="url" data-mdi="link-variant,check" id="copy-link" viewBox="0 0 24 24"></svg></p><p class="dib pr vat" data-title="Copy Markdown"><svg class="cp vam" data-copy="markdown" data-mdi="clipboard-text-outline,check" id="copy-post" viewBox="0 0 24 24"></svg></p></div><ul class="pr" id="links"><li class="dib pr" data-title="Light Theme"><svg class="cp vam" data-mdi="invert-colors" id="theme" viewBox="0 0 24 24"></svg></li><li class="dib pr" data-title="PPCG Chat"><a href="https://chat.stackexchange.com/rooms/34018/japt"><svg class="vam" data-mdi="stack-exchange" viewBox="0 0 24 24"></svg></a></li><li class="dib"><a href="https://github.com/PeterShaggyNoble/Japt-Interpreter/"><svg class="vam" data-mdi="github-circle" viewBox="0 0 24 24"></svg></a></li></ul></header><main class="pr" id="interpreter"><h2 class="dib"><label class="dib fwm" for="code">Code:</label></h2><p class="fr pr" data-title="Copy Code"><svg class="cp vam" data-copy="code" data-mdi="clipboard-text-outline,check" id="copy-code" viewBox="0 0 24 24"></svg></p><p class="fr pr" data-title="Auto-Golf"><svg class="cp vam" data-mdi="golf" id="golf" viewBox="0 0 24 24"></svg></p><p class="fr pr" data-title="Redo"><svg class="cp vam" data-mdi="redo" id="redo" viewBox="0 0 24 24"></svg></p><p class="fr pr" data-title="Undo"><svg class="cp vam" data-mdi="undo" id="undo" viewBox="0 0 24 24"></svg></p><p class="fr" id="counter"></p><textarea autocomplete="off" class="oh" id="code" spellcheck="false" rows="1"></textarea><h2 class="dib fwm">Transpiled JS:</h2><p class="fr pr" data-title="Copy Code"><svg class="cp vam" data-copy="transpiled" data-mdi="clipboard-text-outline,check" id="copy-js" viewBox="0 0 24 24"></svg></p><textarea autocomplete="off" class="oh" id="transpiled" spellcheck="false" rows="1" readonly></textarea><h2 class="dib"><label class="dib fwm" for="input">Input:</label></h2><p class="fr pr" data-title="Copy Input"><svg class="cp vam" data-copy="input" data-mdi="clipboard-text-outline,check" id="copy-input" viewBox="0 0 24 24"></svg></p><textarea autocomplete="off" class="oh" id="input" spellcheck="false" rows="1"></textarea><h2 class="dib fwm">Output:</h2><p class="fr pr" data-title="Copy Output"><svg class="cp vam" data-copy="output" data-mdi="clipboard-text-outline,check" id="copy-output" viewBox="0 0 24 24"></svg></p><p class="fr pr" data-title="Enable Caching"><svg class="cp vam" data-mdi="checkbox-blank-outline,check-box-outline" id="cache" viewBox="0 0 24 24"></svg></p><p class="dn fr pr" data-title="Clear Cache"><svg class="cp vam" data-mdi="delete" id="clear" viewBox="0 0 24 24"></svg></p><p class="fr" id="timer"></p><textarea autocomplete="off" class="oh" id="output" spellcheck="false" rows="1" readonly></textarea><p class="dn" id="error"><svg class="vat" data-mdi="alert" viewBox="0 0 24 24"></svg> <span class="di vam"></span></p><h2 class="dib"><label class="dib fwm" for="explanation">Explanation:</label></h2><p class="fr pr" data-title="Copy Explanation"><svg class="cp vam" data-copy="explanation" data-mdi="clipboard-text-outline,check" id="copy-explanation" viewBox="0 0 24 24"></svg></p><textarea autocomplete="off" class="oh" id="explanation" spellcheck="false" rows="1"></textarea><h2 class="dib"><label class="dib fwm vam" for="compressor">Compressor:</label></h2><p class="fr pr" data-title="Compress"><svg class="cp vam" data-mdi="play" id="compress" viewBox="0 0 24 24"></svg></p><p class="fr pr" data-title="Enable Permutations"><svg class="cp vam" data-mdi="shuffle,shuffle-disabled" id="permute" viewBox="0 0 24 24"></svg></p><p class="fr dn pr" data-title="Reset"><svg class="cp vam" data-mdi="autorenew" id="reset" viewBox="0 0 24 24"></svg></p><p class="fr dn pr" data-title="Copy Result"><svg class="cp vam" data-copy="compressor" data-mdi="clipboard-text-outline,check" id="copy-compressed" viewBox="0 0 24 24"></svg></p><textarea autocomplete="off" class="oh" id="compressor" spellcheck="false" rows="1"></textarea><textarea autocomplete="off" class="mz oh oz pen" id="clipboard" readonly spellcheck="false" rows="1"></textarea></main><aside id="docs"><h2 class="ch pa"><svg class="pen vam" data-mdi="file-document" viewBox="0 0 24 24"><title>Documentation</title></svg></h2><p class="pa" id="loading"><svg class="spin pen vam" data-mdi="loading" viewBox="0 0 24 24"></svg> Loading &hellip;</p></aside><aside class="pf" id="keyboard"><h2 class="cp pa"><svg class="pen vam" data-mdi="keyboard" viewBox="0 0 24 24"><title>Character Map</title></svg></h2><ol class="dg"></ol></aside><script src="js/default.js"></script></body>
<!DOCTYPE html><head><title>Japt Interpreter</title><meta charset="utf-8"><meta content="initial-scale=1,width=device-width" name="viewport"><meta content="#212121" name="theme-color"><link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500|Roboto:400,500" rel="stylesheet"><link href="css/default.css" rel="stylesheet"></head><body><header class="df pf" id="header"><h1>Japt</h1><ol class="df oh pr" id="versions" tabindex="-1"></ol><div class="pa wsnw" id="tools"><label class="dib pr vat" data-title="Flag(s)" for="flags"><svg class="vam" data-mdi="flag" viewBox="0 0 24 24"></svg></label><input class="dib vat" id="flags" spellcheck="false" value=""><p class="dib pr vat" data-title="Run (Ctrl+Enter)"><svg class="cp vam" data-mdi="play-circle" id="run" viewBox="0 0 24 24"><circle cx="12" cy="12" r="12"></circle><circle cx="12" cy="12" r="11.625"></circle><rect height="17.325" width="24" x="0" y="0"></rect></svg></p><p class="dib pr vat" data-title="Copy Link"><svg class="cp vam" data-copy="url" data-mdi="link-variant,check" id="copy-link" viewBox="0 0 24 24"></svg></p><p class="dib pr vat" data-title="Copy Markdown"><svg class="cp vam" data-copy="markdown" data-mdi="clipboard-text-outline,check" id="copy-post" viewBox="0 0 24 24"></svg></p></div><ul class="pr" id="links"><li class="dib pr" data-title="Light Theme"><svg class="cp vam" data-mdi="invert-colors" id="theme" viewBox="0 0 24 24"></svg></li><li class="dib pr" data-title="PPCG Chat"><a href="https://chat.stackexchange.com/rooms/34018/japt"><svg class="vam" data-mdi="stack-exchange" viewBox="0 0 24 24"></svg></a></li><li class="dib"><a href="https://github.com/PeterShaggyNoble/Japt-Interpreter/"><svg class="vam" data-mdi="github-circle" viewBox="0 0 24 24"></svg></a></li></ul></header><main class="pr" id="interpreter"><h2 class="dib"><label class="dib fwm" for="code">Code:</label></h2><p class="fr pr" data-title="Copy Code"><svg class="cp vam" data-copy="code" data-mdi="clipboard-text-outline,check" id="copy-code" viewBox="0 0 24 24"></svg></p><p class="fr pr" data-title="Auto-Golf"><svg class="cp vam" data-mdi="golf" id="golf" viewBox="0 0 24 24"></svg></p><p class="fr pr" data-title="Redo"><svg class="cp vam" data-mdi="redo" id="redo" viewBox="0 0 24 24"></svg></p><p class="fr pr" data-title="Undo"><svg class="cp vam" data-mdi="undo" id="undo" viewBox="0 0 24 24"></svg></p><p class="fr" id="counter"></p><textarea autocomplete="off" class="oh" id="code" spellcheck="false" rows="1"></textarea><h2 class="dib fwm">Transpiled JS:</h2><p class="fr pr" data-title="Copy Code"><svg class="cp vam" data-copy="transpiled" data-mdi="clipboard-text-outline,check" id="copy-js" viewBox="0 0 24 24"></svg></p><textarea autocomplete="off" class="oh" id="transpiled" spellcheck="false" rows="1" readonly></textarea><h2 class="dib"><label class="dib fwm" for="input">Input:</label></h2><p class="fr pr" data-title="Copy Input"><svg class="cp vam" data-copy="input" data-mdi="clipboard-text-outline,check" id="copy-input" viewBox="0 0 24 24"></svg></p><textarea autocomplete="off" class="oh" id="input" spellcheck="false" rows="1"></textarea><h2 class="dib fwm">Output:</h2><p class="fr pr" data-title="Copy Output"><svg class="cp vam" data-copy="output" data-mdi="clipboard-text-outline,check" id="copy-output" viewBox="0 0 24 24"></svg></p><p class="fr pr" data-title="Enable Caching"><svg class="cp vam" data-mdi="checkbox-blank-outline,check-box-outline" id="cache" viewBox="0 0 24 24"></svg></p><p class="dn fr pr" data-title="Clear Cache"><svg class="cp vam" data-mdi="delete" id="clear" viewBox="0 0 24 24"></svg></p><p class="fr" id="timer"></p><textarea autocomplete="off" class="oh" id="output" spellcheck="false" rows="1" readonly></textarea><p class="dn" id="error"><svg class="vat" data-mdi="alert" viewBox="0 0 24 24"></svg> <span class="di vam"></span></p><h2 class="dib"><label class="dib fwm" for="explanation">Explanation:</label></h2><p class="fr pr" data-title="Copy Explanation"><svg class="cp vam" data-copy="explanation" data-mdi="clipboard-text-outline,check" id="copy-explanation" viewBox="0 0 24 24"></svg></p><textarea autocomplete="off" class="oh" id="explanation" spellcheck="false" rows="1"></textarea><h2 class="dib"><label class="dib fwm vam" for="compressor">Compressor:</label></h2><p class="fr pr" data-title="Compress"><svg class="cp vam" data-mdi="play" id="compress" viewBox="0 0 24 24"></svg></p><p class="fr pr" data-title="Enable Permutations"><svg class="cp vam" data-mdi="shuffle,shuffle-disabled" id="permute" viewBox="0 0 24 24"></svg></p><p class="fr dn pr" data-title="Reset"><svg class="cp vam" data-mdi="autorenew" id="reset" viewBox="0 0 24 24"></svg></p><p class="fr dn pr" data-title="Copy Result"><svg class="cp vam" data-copy="compressor" data-mdi="clipboard-text-outline,check" id="copy-compressed" viewBox="0 0 24 24"></svg></p><textarea autocomplete="off" class="oh" id="compressor" spellcheck="false" rows="1"></textarea><textarea autocomplete="off" class="mz oh oz pen" id="clipboard" readonly spellcheck="false" rows="1"></textarea></main><aside id="docs"><h2 class="ch pa" data-title="Documentation"><svg class="pen vam" data-mdi="file-document" viewBox="0 0 24 24"><title>Documentation</title></svg></h2><p class="pa" id="loading"><svg class="spin pen vam" data-mdi="loading" viewBox="0 0 24 24"></svg> Loading &hellip;</p></aside><aside class="pf" id="keyboard"><h2 class="cp pa" data-title="Character Map"><svg class="pen vam" data-mdi="keyboard" viewBox="0 0 24 24"><title>Character Map</title></svg></h2><ol class="dg"></ol></aside><script src="js/default.js"></script></body>
2 changes: 1 addition & 1 deletion js/default.js

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions src/css/default.css
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
*,*::before,*::after{
-moz-appearance:none;
-webkit-appearance:none;
appearance:none;
background:none;
background-clip:padding-box;
border:0;
border-radius:0;
box-sizing:border-box;
-webkit-font-smoothing:antialiased;
font-style:normal;
font-size:0px;
font-weight:400;
list-style:none;
margin:0;
outline:0;
padding:0;
scrollbar-width:none;
-webkit-tap-highlight-color:rgba(0,0,0,0);
text-align:left;
text-decoration:none;
text-indent:0;
text-rendering:auto;
}
*>*,*::before,*::after{
color:inherit;
Expand Down Expand Up @@ -269,6 +269,9 @@ body.light #tools::after{
resize:none;
width:100%;
}
#interpreter>textarea:-moz-read-only{
border-color:var(--primary);
}
#interpreter>textarea:read-only{
border-color:var(--primary);
}
Expand Down Expand Up @@ -461,6 +464,11 @@ body.dark>#keyboard>h2{
body.light>#keyboard>h2{
background:url('data:image/svg+xml;utf-8,<svg height="32" viewBox="0 0 72 32" width="72" xmlns="http://www.w3.org/2000/svg"><path fill="%23bdbdbd" d="M0,32L16,0H56L72,32"/><path fill="%23fff" d="M1,32L17,1H55L71,32"/></svg>') no-repeat;
}
#keyboard>h2[data-title]::after{
left:50%;
bottom:36px;
transform:translate(-50%);
}
#keyboard>ol{
grid-auto-rows:1fr;
grid-gap:2px;
Expand Down Expand Up @@ -528,6 +536,10 @@ body.light>#keyboard>h2{
body.light>#docs>h2{
background:url('data:image/svg+xml;utf-8,<svg height="72" viewBox="0 0 32 72" width="32" xmlns="http://www.w3.org/2000/svg"><path fill="%23bdbdbd" d="M32,0L0,16V56L32,72"/><path fill="%23fff" d="M32,1L1,17V55L32,71"/></svg>') no-repeat;
}
#docs>h2[data-title]::after{
right:2px;
bottom:0;
}
#keyboard{
left:0;
transform:translatey(100%);
Expand Down
8 changes: 8 additions & 0 deletions src/docs/flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
"description":"Outputs the logical `NOT` of the value returned by the programme; i.e., `true` if falsey, or `false` if truthy.",
"version":"1.4.5"
},
"E\"s\"":{
"description":"Outputs `s` if the programme throws an error. Considered to be a \"cheating\" flag - use at your own discretion.",
"version":"1.4.6"
},
"F\"s\"":{
"description":"Outputs `s` if the programme returns a falsey value. Considered to be a \"cheating\" flag - use at your own discretion.",
"version":"1.4.6"
},
"N":{
"description":"Converts the value returned by the programme to a number. If that value is an array, it is first joined to a string.",
"version":"1.4.5"
Expand Down
Loading

0 comments on commit 20284f3

Please sign in to comment.