Skip to content

Commit c9bdac6

Browse files
committed
refactor: remove unused files and update app.js for JSON handling
1 parent 7d23db3 commit c9bdac6

File tree

6 files changed

+7
-18
lines changed

6 files changed

+7
-18
lines changed

archetypes/default.md

-6
This file was deleted.

assets/js/app.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ require(['vs/editor/editor.main'], function() {
1515
});
1616

1717
src = monaco.editor.create(document.getElementById('src'), {
18-
value: example,
18+
value: '',
1919
language: 'text',
2020
theme: 'error',
2121
minimap: {
@@ -43,7 +43,6 @@ require(['vs/editor/editor.main'], function() {
4343
minimap: {
4444
enabled: false
4545
},
46-
readOnly: true
4746
});
4847
dst.onDidFocusEditorText(() => setTimeout(() => dst.setSelection(dst.getModel().getFullModelRange()), 100));
4948

@@ -53,6 +52,7 @@ require(['vs/editor/editor.main'], function() {
5352
src.getModel().onDidChangeContent(() => {
5453
if (settingSrc) return;
5554
settingDst = true;
55+
monaco.editor.setModelLanguage(src.getModel(), "text");
5656
dst.getModel().setValue(JSON.stringify(src.getModel().getValue()));
5757
settingDst = false;
5858
});
@@ -62,11 +62,12 @@ require(['vs/editor/editor.main'], function() {
6262
settingSrc = true;
6363
try {
6464
monaco.editor.setModelLanguage(src.getModel(), "text");
65-
src.getModel().setValue(ts);
65+
src.getModel().setValue(JSON.parse(dst.getModel().getValue()));
6666
} catch (e) {
6767
monaco.editor.setModelLanguage(src.getModel(), "error")
6868
src.getModel().setValue(err);
69+
} finally {
70+
settingSrc = false;
6971
}
70-
settingSrc = false;
7172
});
7273
});

content/_index.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: JSON Escaper and Unescaper
3-
type: index
43
---
54

65
This tool is designed to help you escape and unescape JSON strings. It is useful for escaping strings that will be used in JSON files or for unescaping strings that have been escaped in JSON files.

config.toml hugo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
baseURL = "https://stirlingmarketinggroup.github.io/json-escaper/"
22
languageCode = "en-us"
33
title = "JSON Escaper"
4+
5+
disableKinds = ['taxonomy', 'term']
File renamed without changes.

layouts/_default/single.html

-7
This file was deleted.

0 commit comments

Comments
 (0)