Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
Fixes a bug related to the saving the value of the compressor to a project.
  • Loading branch information
PeterShaggyNoble committed Apr 1, 2019
1 parent cd97c48 commit 0bc8edf
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 28 deletions.
20 changes: 10 additions & 10 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,13 @@ The following lists are in no particular order other than what was most likely t
- [ ] Investigate the viability of an offline version.

## HEADER
- [x] Reduce `height`.
- [ ] Change the style of or animate the `play` icon while programme is running.
- [ ] Pick an alternative icon for copying Markdown (see: https://materialdesignicons.com/ or https://petershaggynoble.github.io/MDI-Sandbox/).
- [ ] Change icon order to be: copy link, undo, run, redo, copy Markdown.
- [ ] Clip or redraw background `circle`s in `play` icon.
- [ ] Replace chat icon & link with Slack.

## INTERPRETER
- [x] Remove `min-height` from code & input fields.
- [x] Replace checkbox for output caching with `cached` icon (or similar).
- [x] Reduce the `opacity` of the icon when caching is disabled.
- [ ] Add `information` icon to open the documentation on flags.
- [ ] Decide whether to continue using `localStorage` for output caching, switch to `sessionStorage` or use neither at all.

Expand All @@ -35,12 +31,6 @@ The following lists are in no particular order other than what was most likely t
- [ ] Add clipping path to tab.

## COMPRESSOR
- [x] Separate output from the `textarea` and restyle it.
- [x] Add support for multi-line strings.
- [x] Add the ability to insert the compressed string directly into code.
- [x] Reduce the `opacity` of the icon when permutations are disabled.
- [x] Override Ctrl+Enter when compressor field has focus.
- [x] Disable and reduce the `opacity` of the `play` icon while input is invalid.
- [ ] Add byte counter above the `textarea`, similar to the code's.
- [ ] Replace icon for permutations with `shuffle-variant`?
- [ ] Add support for arrays of strings of equal length.
Expand Down Expand Up @@ -91,12 +81,22 @@ The following lists are in no particular order other than what was most likely t
- [x] Add `notranslate` `meta` tag for Google.

### HEADER
- [x] Reduce `height`.
- [x] Move `undo` & `redo` to header.

### INTERPRETER
- [x] Reduce the `opacity` of the icon when caching is disabled.
- [x] Replace checkbox for output caching with `cached` icon (or similar).
- [x] Remove `min-height` from code & input fields.
- [x] Move flags field from header.

### COMPRESSOR
- [x] Disable and reduce the `opacity` of the `play` icon while input is invalid.
- [x] Override Ctrl+Enter when compressor field has focus.
- [x] Reduce the `opacity` of the icon when permutations are disabled.
- [x] Add the ability to insert the compressed string directly into code.
- [x] Add support for multi-line strings.
- [x] Separate output from the `textarea` and restyle it.
- [x] Update byte counts in results to factor in multi-byte characters.

### DOCUMENTATION
Expand Down
2 changes: 1 addition & 1 deletion css/default.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/default.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions src/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ body.light #tools::after{
max-width:400px;
}
#projects[data-open=true]{
transform:translatex(0%);
transform:none;
}
#projects>h2[data-title]::after{
left:2px;
Expand Down Expand Up @@ -777,10 +777,10 @@ input#filter{
@media(max-width:1204px){
#keyboard{
left:50%;
transform:translatex(-50%) translatey(100%)
transform:translatex(-50%) translatey(100%);
}
#keyboard[data-open=true]{
transform:translatex(-50%) translatey(0%)
transform:translatex(-50%);
}
}
@media(max-width:800px){
Expand All @@ -797,7 +797,7 @@ input#filter{
z-index:3;
}
#keyboard[data-open=true]{
transform:translatey(0%);
transform:none;
}
#docs{
position:fixed;
Expand All @@ -809,7 +809,7 @@ input#filter{
z-index:4;
}
#docs[data-open=true]{
transform:translatex(0%);
transform:none;
z-index:5;
}
#docs>h2[data-title]::after{
Expand Down Expand Up @@ -948,10 +948,10 @@ input#filter{
@media(min-width:1205px){
#keyboard{
left:50%;
transform:translatex(-50%) translatex(-200px) translatey(100%)
transform:translatex(-50%) translatex(-200px) translatey(100%);
}
#keyboard[data-open=true]{
transform:translatex(-50%) translatex(-200px) translatey(0%)
transform:translatex(-50%) translatex(-200px);
}
}
@keyframes spin{
Expand Down
21 changes: 12 additions & 9 deletions src/js/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ projects={
if(compressor.permutations.enabled)
projects.data[key].permutations=1;
if(compress)
projects.data[key].compressor=compress;
projects.data[key].compressor=general.encode(compress);
l.setItem(projects.storage,JSON.stringify(projects.data));
if(!link)
general.icons(projects.add(key));
Expand Down Expand Up @@ -1080,7 +1080,7 @@ projects={
compressor.buttons.permute.dispatchEvent(general.events.click);
if(project.compressor){
compressor.fields.input.value=general.decode(project.compressor);
general.resize(compressor.fields.input);
compressor.fields.input.dispatchEvent(general.events.input);
}
projects.fields.name.value=key;
if(project.url)
Expand Down Expand Up @@ -1109,7 +1109,9 @@ general={
buttons:{
theme:i(`theme`)
},
clipboard:i(`clipboard`),
fields:{
clipboard:i(`clipboard`)
},
meta:q(`meta[name=theme-color]`),
mdi:{
"alert":`M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z`,
Expand Down Expand Up @@ -1148,7 +1150,8 @@ general={
"upload":`M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z`
},
events:{
click:new Event(`click`)
click:new Event(`click`),
input:new Event(`input`)
},
init(){
general.theme();
Expand Down Expand Up @@ -1199,8 +1202,8 @@ general={
text=interpreter.url()+`#`+target;
if(target===`explanation`)
text=text.replace(/^/gm,` `);
general.clipboard.value=text;
general.clipboard.select();
general.fields.clipboard.value=text;
general.fields.clipboard.select();
d.execCommand(`copy`,false);
general.confirm(event.target);
},
Expand Down Expand Up @@ -1316,9 +1319,9 @@ general={
general.resize(interpreter.fields.output);
general.resize(interpreter.fields.explanation);
general.resize(compressor.fields.input);
}else if(target!==general.clipboard&&target.constructor===HTMLTextAreaElement){
general.clipboard.value=target.value;
target.style.height=2+general.clipboard.scrollHeight+`px`;
}else if(target!==general.fields.clipboard&&target.constructor===HTMLTextAreaElement){
general.fields.clipboard.value=target.value;
target.style.height=2+general.fields.clipboard.scrollHeight+`px`;
}
},
theme(loaded=false){
Expand Down

0 comments on commit 0bc8edf

Please sign in to comment.