Change tab size

This commit is contained in:
Lorem Ipsum 2020-12-16 16:55:29 +00:00
parent 5220eb9822
commit 1a38e43b67
2 changed files with 40 additions and 41 deletions

View file

@ -15,7 +15,10 @@ window.onload = () => {
foldGutter: true,
gutters: ["CodeMirror-foldgutter", "CodeMirror-lint-markers"],
matchBrackets: true,
lint: true
lint: true,
extraKeys: {
"Tab": cm => cm.replaceSelection(" ", "end")
}
});
editor.focus();
@ -63,14 +66,12 @@ window.onload = () => {
dateArray = date.toLocaleString('en-US', { hour: 'numeric', hour12: true, minute: 'numeric' }),
today = new Date(),
yesterday = new Date(new Date().setDate(today.getDate() - 1));
return today.toDateString() === date.toDateString() ? `Today at ${dateArray}` :
yesterday.toDateString() === date.toDateString() ? `Yesterday at ${dateArray}` :
`${String(date.getMonth() + 1).padStart(2, '0')}/${String(date.getDate()).padStart(2, '0')}/${date.getFullYear()}`;
}, display = (el, data, displayType) => {
if (data) el.innerHTML = data;
el.style.display = displayType || "unset";
}, hide = el => el.style.removeProperty('display'),
regEscape = str => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'),
toObj = jsonString => JSON.parse(jsonString.replace(/\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g, (x, y) => y ? "" : x)),

View file

@ -32,63 +32,61 @@
<div class="top item">
<textarea style="display: none;">
{
"content": "You can~~not~~ do `this`.```py\nAnd this.\nprint('Hi')```\n*italics* or _italics_ __*underline italics*__\n**bold** __**underline bold**__\n***bold italics*** __***underline bold italics***__\n__underline__ ~~Strikethrough~~",
"embed": {
"title": "Hello ~~people~~ world :wave:",
"description": "You can use [links](https://discord.com) or emojis :smile: 😎\n```\nAnd also code blocks```",
"color": 4321431,
"timestamp": "2020-12-08T13:37:35.401Z",
"url": "https://discord.com",
"author": {
"content": "You can~~not~~ do `this`.```py\nAnd this.\nprint('Hi')```\n*italics* or _italics_ __*underline italics*__\n**bold** __**underline bold**__\n***bold italics*** __***underline bold italics***__\n__underline__ ~~Strikethrough~~",
"embed": {
"title": "Hello ~~people~~ world :wave:",
"description": "You can use [links](https://discord.com) or emojis :smile: 😎\n```\nAnd also code blocks```",
"color": 4321431,
"timestamp": "2020-12-08T13:37:35.401Z",
"url": "https://discord.com",
"author": {
"name": "Name",
"url": "https://discord.com",
"icon_url": "https://unsplash.it/100"
},
"thumbnail": {
},
"thumbnail": {
"url": "https://unsplash.it/200"
},
"image": {
},
"image": {
"url": "https://unsplash.it/380/200"
},
"footer": {
},
"footer": {
"text": "Footer text",
"icon_url": "https://unsplash.it/100"
},
"fields": [
},
"fields": [
{
"name": "Field 1, *lorem* **ipsum**, ~~dolor~~",
"value": "Field value"
"name": "Field 1, *lorem* **ipsum**, ~~dolor~~",
"value": "Field value"
},
{
"name": "Field 2",
"value": "You can use custom emojis &lt;:Kekwlaugh:722088222766923847&gt;. &lt;:GangstaBlob:742256196295065661&gt;",
"inline": false
"name": "Field 2",
"value": "You can use custom emojis &lt;:Kekwlaugh:722088222766923847&gt;. &lt;:GangstaBlob:742256196295065661&gt;",
"inline": false
},
{
"name": "Inline field",
"value": "Fields can be inline",
"inline": true
"name": "Inline field",
"value": "Fields can be inline",
"inline": true
},
{
"name": "Inline field",
"value": "*Lorem ipsum*",
"inline": true
"name": "Inline field",
"value": "*Lorem ipsum*",
"inline": true
},
{
"name": "Inline field",
"value": "value",
"inline": true
"name": "Inline field",
"value": "value",
"inline": true
},
{
"name": "Another field",
"value": "> Nope, didn't forget about code blocks",
"inline": false
"name": "Another field",
"value": "> Nope, didn't forget about code blocks",
"inline": false
}
]
}
}
]
}
}
</textarea>
</div>
<div class="bottom item"></div>