Change tab size
This commit is contained in:
parent
5220eb9822
commit
1a38e43b67
2 changed files with 40 additions and 41 deletions
|
@ -15,7 +15,10 @@ window.onload = () => {
|
||||||
foldGutter: true,
|
foldGutter: true,
|
||||||
gutters: ["CodeMirror-foldgutter", "CodeMirror-lint-markers"],
|
gutters: ["CodeMirror-foldgutter", "CodeMirror-lint-markers"],
|
||||||
matchBrackets: true,
|
matchBrackets: true,
|
||||||
lint: true
|
lint: true,
|
||||||
|
extraKeys: {
|
||||||
|
"Tab": cm => cm.replaceSelection(" ", "end")
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.focus();
|
editor.focus();
|
||||||
|
@ -63,14 +66,12 @@ window.onload = () => {
|
||||||
dateArray = date.toLocaleString('en-US', { hour: 'numeric', hour12: true, minute: 'numeric' }),
|
dateArray = date.toLocaleString('en-US', { hour: 'numeric', hour12: true, minute: 'numeric' }),
|
||||||
today = new Date(),
|
today = new Date(),
|
||||||
yesterday = new Date(new Date().setDate(today.getDate() - 1));
|
yesterday = new Date(new Date().setDate(today.getDate() - 1));
|
||||||
|
|
||||||
return today.toDateString() === date.toDateString() ? `Today at ${dateArray}` :
|
return today.toDateString() === date.toDateString() ? `Today at ${dateArray}` :
|
||||||
yesterday.toDateString() === date.toDateString() ? `Yesterday at ${dateArray}` :
|
yesterday.toDateString() === date.toDateString() ? `Yesterday at ${dateArray}` :
|
||||||
`${String(date.getMonth() + 1).padStart(2, '0')}/${String(date.getDate()).padStart(2, '0')}/${date.getFullYear()}`;
|
`${String(date.getMonth() + 1).padStart(2, '0')}/${String(date.getDate()).padStart(2, '0')}/${date.getFullYear()}`;
|
||||||
}, display = (el, data, displayType) => {
|
}, display = (el, data, displayType) => {
|
||||||
if (data) el.innerHTML = data;
|
if (data) el.innerHTML = data;
|
||||||
el.style.display = displayType || "unset";
|
el.style.display = displayType || "unset";
|
||||||
|
|
||||||
}, hide = el => el.style.removeProperty('display'),
|
}, hide = el => el.style.removeProperty('display'),
|
||||||
regEscape = str => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'),
|
regEscape = str => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'),
|
||||||
toObj = jsonString => JSON.parse(jsonString.replace(/\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g, (x, y) => y ? "" : x)),
|
toObj = jsonString => JSON.parse(jsonString.replace(/\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g, (x, y) => y ? "" : x)),
|
||||||
|
|
72
index.html
72
index.html
|
@ -32,63 +32,61 @@
|
||||||
<div class="top item">
|
<div class="top item">
|
||||||
<textarea style="display: none;">
|
<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~~",
|
"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": {
|
"embed": {
|
||||||
"title": "Hello ~~people~~ world :wave:",
|
"title": "Hello ~~people~~ world :wave:",
|
||||||
"description": "You can use [links](https://discord.com) or emojis :smile: 😎\n```\nAnd also code blocks```",
|
"description": "You can use [links](https://discord.com) or emojis :smile: 😎\n```\nAnd also code blocks```",
|
||||||
"color": 4321431,
|
"color": 4321431,
|
||||||
"timestamp": "2020-12-08T13:37:35.401Z",
|
"timestamp": "2020-12-08T13:37:35.401Z",
|
||||||
"url": "https://discord.com",
|
"url": "https://discord.com",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
"url": "https://discord.com",
|
"url": "https://discord.com",
|
||||||
"icon_url": "https://unsplash.it/100"
|
"icon_url": "https://unsplash.it/100"
|
||||||
},
|
},
|
||||||
"thumbnail": {
|
"thumbnail": {
|
||||||
"url": "https://unsplash.it/200"
|
"url": "https://unsplash.it/200"
|
||||||
},
|
},
|
||||||
"image": {
|
"image": {
|
||||||
"url": "https://unsplash.it/380/200"
|
"url": "https://unsplash.it/380/200"
|
||||||
},
|
},
|
||||||
"footer": {
|
"footer": {
|
||||||
"text": "Footer text",
|
"text": "Footer text",
|
||||||
"icon_url": "https://unsplash.it/100"
|
"icon_url": "https://unsplash.it/100"
|
||||||
},
|
},
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"name": "Field 1, *lorem* **ipsum**, ~~dolor~~",
|
"name": "Field 1, *lorem* **ipsum**, ~~dolor~~",
|
||||||
"value": "Field value"
|
"value": "Field value"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Field 2",
|
"name": "Field 2",
|
||||||
"value": "You can use custom emojis <:Kekwlaugh:722088222766923847>. <:GangstaBlob:742256196295065661>",
|
"value": "You can use custom emojis <:Kekwlaugh:722088222766923847>. <:GangstaBlob:742256196295065661>",
|
||||||
"inline": false
|
"inline": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Inline field",
|
"name": "Inline field",
|
||||||
"value": "Fields can be inline",
|
"value": "Fields can be inline",
|
||||||
"inline": true
|
"inline": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Inline field",
|
"name": "Inline field",
|
||||||
"value": "*Lorem ipsum*",
|
"value": "*Lorem ipsum*",
|
||||||
"inline": true
|
"inline": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Inline field",
|
"name": "Inline field",
|
||||||
"value": "value",
|
"value": "value",
|
||||||
"inline": true
|
"inline": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Another field",
|
"name": "Another field",
|
||||||
"value": "> Nope, didn't forget about code blocks",
|
"value": "> Nope, didn't forget about code blocks",
|
||||||
"inline": false
|
"inline": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</textarea>
|
</textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom item"></div>
|
<div class="bottom item"></div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue