Changed layout image, removed emoticons
This commit is contained in:
parent
fe12fe15c6
commit
9e32bc20a6
4 changed files with 6 additions and 64 deletions
|
@ -1,59 +1,4 @@
|
||||||
var emoticons = {
|
var emojis = {
|
||||||
">=-(": "😠",
|
|
||||||
"=\")": "😊",
|
|
||||||
"=-\")": "😊",
|
|
||||||
"<\\3": "💔",
|
|
||||||
"=-/": "😕",
|
|
||||||
":'(": "😢",
|
|
||||||
":'-(": "😢",
|
|
||||||
":,(": "😢",
|
|
||||||
":,-(": "cr😢y",
|
|
||||||
"='(": "😢",
|
|
||||||
"='-(": "😢",
|
|
||||||
"=,(": "😢",
|
|
||||||
"=,-(": "😢",
|
|
||||||
"=-(": "😦",
|
|
||||||
"♡": "heart❤️",
|
|
||||||
"]=-(": "👿",
|
|
||||||
"0=-)": "😇",
|
|
||||||
":')": "😂",
|
|
||||||
":'-)": "😂",
|
|
||||||
":,)": "😂",
|
|
||||||
":,-)": "😂",
|
|
||||||
":'D": "😂",
|
|
||||||
":'-D": "😂",
|
|
||||||
":,D": "😂",
|
|
||||||
":,-D": "😂",
|
|
||||||
"=')": "😂",
|
|
||||||
"='-)": "😂",
|
|
||||||
"=,)": "😂",
|
|
||||||
"=,-)": "😂",
|
|
||||||
"='D": "😂",
|
|
||||||
"='-D": "😂",
|
|
||||||
"=-*": "😗",
|
|
||||||
"X-)": "😆",
|
|
||||||
"=-|": "😐",
|
|
||||||
"=-O": "😮",
|
|
||||||
"=-@": "😡",
|
|
||||||
"=-D": "😄",
|
|
||||||
":)": "🙂",
|
|
||||||
":-)": "🙂",
|
|
||||||
"=-)": "🙂",
|
|
||||||
"]=-)": "😈",
|
|
||||||
":,'(": "😭",
|
|
||||||
":,'-(": "😭",
|
|
||||||
";(": "😭",
|
|
||||||
";-(": "😭",
|
|
||||||
"=,'(": "😭",
|
|
||||||
"=,'-(": "😭",
|
|
||||||
"=-P": "😛",
|
|
||||||
"B-)": "😎",
|
|
||||||
",=-(": "😓",
|
|
||||||
",=-)": "😅",
|
|
||||||
"=-$": "😒",
|
|
||||||
";)": "😉",
|
|
||||||
";-)": "😉"
|
|
||||||
}, emojis = {
|
|
||||||
"open_hands": "👐",
|
"open_hands": "👐",
|
||||||
"open_hands_tone1": "👐🏻",
|
"open_hands_tone1": "👐🏻",
|
||||||
"open_hands_tone2": "👐🏼",
|
"open_hands_tone2": "👐🏼",
|
||||||
|
|
|
@ -42,10 +42,7 @@ window.onload = () => {
|
||||||
if (opts.inlineBlock) txt = txt.replace(/\`([^\`]+?)\`|\`\`([^\`]+?)\`\`|\`\`\`((?:\n|.)+?)\`\`\`/g, (m, x, y, z) => x ? `<code class="inline">${x}</code>` : y ? `<code class="inline">${y}</code>` : z ? `<code class="inline">${z}</code>` : m);
|
if (opts.inlineBlock) txt = txt.replace(/\`([^\`]+?)\`|\`\`([^\`]+?)\`\`|\`\`\`((?:\n|.)+?)\`\`\`/g, (m, x, y, z) => x ? `<code class="inline">${x}</code>` : y ? `<code class="inline">${y}</code>` : z ? `<code class="inline">${z}</code>` : m);
|
||||||
else txt = txt.replace(/\`\`\`(\w{1,15})?\n((?:\n|.)+?)\`\`\`|\`\`(.+?)\`\`(?!\`)|\`([^\`]+?)\`/g, (m, w, x, y, z) => w && x ? `<pre><code class="${w}">${x}</code></pre>` : x ? `<pre><code class="hljs nohighlight">${x}</code></pre>` : y || z ? `<code class="inline">${y || z}</code>` : m);
|
else txt = txt.replace(/\`\`\`(\w{1,15})?\n((?:\n|.)+?)\`\`\`|\`\`(.+?)\`\`(?!\`)|\`([^\`]+?)\`/g, (m, w, x, y, z) => w && x ? `<pre><code class="${w}">${x}</code></pre>` : x ? `<pre><code class="hljs nohighlight">${x}</code></pre>` : y || z ? `<code class="inline">${y || z}</code>` : m);
|
||||||
if (opts.inEmbed) txt = txt.replace(/\[([^\[\]]+)\]\((.+?)\)/g, `<a title="$1" target="_blank" class="anchor" href="$2">$1</a>`);
|
if (opts.inEmbed) txt = txt.replace(/\[([^\[\]]+)\]\((.+?)\)/g, `<a title="$1" target="_blank" class="anchor" href="$2">$1</a>`);
|
||||||
if (opts.replaceEmojis) {
|
if (opts.replaceEmojis) txt = txt.replace(/(?<!code(?: \w+=".+")?>[^>]+)(?<!\/[^\s"]+?):((?!\/)\w+):/g, (match, x) => x && emojis[x] ? emojis[x] : match);
|
||||||
txt = txt.replace(/(?<!code(?: \w+=".+")?>[^>]+)(?<!\/[^\s"]+?):((?!\/)\w+):/g, (match, x) => x && emojis[x] ? emojis[x] : match);
|
|
||||||
!opts.noEmoticons && Object.keys(emoticons).forEach(e => txt = txt.replace(new RegExp(`(?<=^|\\s)${regEscape(e)}(?=$|\\s)`, 'g'), emoticons[e]));
|
|
||||||
}
|
|
||||||
txt = txt
|
txt = txt
|
||||||
.replace(/(?<=\n|^)\s*>\s+([^\n]+)/g, '<div class="blockquote"><div class="blockquoteDivider"></div><blockquote>$1</blockquote></div>')
|
.replace(/(?<=\n|^)\s*>\s+([^\n]+)/g, '<div class="blockquote"><div class="blockquoteDivider"></div><blockquote>$1</blockquote></div>')
|
||||||
.replace(/\n/g, '<br>');
|
.replace(/\n/g, '<br>');
|
||||||
|
@ -82,7 +79,7 @@ window.onload = () => {
|
||||||
content.innerHTML = data.content ? markup(data.content, { replaceEmojis: true }) : '';
|
content.innerHTML = data.content ? markup(data.content, { replaceEmojis: true }) : '';
|
||||||
if (data.embed) {
|
if (data.embed) {
|
||||||
let e = data.embed;
|
let e = data.embed;
|
||||||
if (e.title) display(embedTitle, markup(`${e.url ? '<a class="anchor" target="_blank" href="' + url(e.url) + '">' + e.title + '</a>' : e.title}`, { replaceEmojis: true, noEmoticons: true, inlineBlock: true }));
|
if (e.title) display(embedTitle, markup(`${e.url ? '<a class="anchor" target="_blank" href="' + url(e.url) + '">' + e.title + '</a>' : e.title}`, { replaceEmojis: true, inlineBlock: true }));
|
||||||
else hide(embedTitle);
|
else hide(embedTitle);
|
||||||
if (e.description) display(embedDescription, markup(e.description, { inEmbed: true, replaceEmojis: true }));
|
if (e.description) display(embedDescription, markup(e.description, { inEmbed: true, replaceEmojis: true }));
|
||||||
else hide(embedDescription);
|
else hide(embedDescription);
|
||||||
|
@ -133,7 +130,7 @@ window.onload = () => {
|
||||||
} else hide(fields);
|
} else hide(fields);
|
||||||
embed.classList.remove('empty');
|
embed.classList.remove('empty');
|
||||||
let re = /"((icon_)?url")(: *)("(?!https?:\/\/).+?")/g.exec(editor.getValue())
|
let re = /"((icon_)?url")(: *)("(?!https?:\/\/).+?")/g.exec(editor.getValue())
|
||||||
if (re) error(`URLs should start with <code>https://</code> or <code>http://</code> on this line <span class="inline full">${makeShort(re[0], 30, 600)}</span>`, true);
|
if (re) error(`URL should start with <code>https://</code> or <code>http://</code> on this line <span class="inline full">${makeShort(re[0], 30, 600)}</span>`, true);
|
||||||
else notif.animate({ opacity: '0', bottom: '-50px', offset: 1 }, { easing: 'ease', duration: 500 }).onfinish = () => notif.style.removeProperty('display');
|
else notif.animate({ opacity: '0', bottom: '-50px', offset: 1 }, { easing: 'ease', duration: 500 }).onfinish = () => notif.style.removeProperty('display');
|
||||||
twemoji.parse(msgEmbed);
|
twemoji.parse(msgEmbed);
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 381 KiB After Width: | Height: | Size: 327 KiB |
|
@ -32,10 +32,10 @@
|
||||||
<div class="top item">
|
<div class="top item">
|
||||||
<textarea style="display: none;">
|
<textarea style="display: none;">
|
||||||
{
|
{
|
||||||
"content": "You can~~not~~ do `this`.```\nAnd :laughing:this.\nprint('Hi') :) ```\n*italics* or _italics_ __*underline italics*__\n**bold** __**underline bold**__\n***bold italics*** __***underline bold italics***__\n__underline__ ~~Strikethrough~~\n> Hi",
|
"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), emojis 😎 :smile:, emoticons :-)\n```\nAlso 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",
|
||||||
|
|
Loading…
Add table
Reference in a new issue