Undid some stuff due to rodent bitching
parent
a9adaf6d2a
commit
620a6b5f1a
|
@ -6559,7 +6559,7 @@ g {
|
|||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.quick-emoji-dropdown
|
||||
.speed-carot-modal
|
||||
{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
|
@ -6576,7 +6576,7 @@ g {
|
|||
flex-direction: column;
|
||||
}
|
||||
|
||||
.quick-emoji-dropdown .quick-emoji-option
|
||||
.speed-carot-modal .speed-modal-option
|
||||
{
|
||||
text-align: left;
|
||||
border-bottom: 1px solid #606060;
|
||||
|
@ -6584,22 +6584,22 @@ g {
|
|||
cursor: pointer;
|
||||
}
|
||||
|
||||
.quick-emoji-dropdown .quick-emoji-option:hover,
|
||||
.quick-emoji-dropdown .quick-emoji-option:focus,
|
||||
.quick-emoji-dropdown .quick-emoji-option.selected
|
||||
.speed-carot-modal .speed-modal-option:hover,
|
||||
.speed-carot-modal .speed-modal-option:focus,
|
||||
.speed-carot-modal .speed-modal-option.selected
|
||||
{
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
|
||||
.quick-emoji-dropdown .quick-emoji-image
|
||||
.speed-carot-modal .speed-modal-image
|
||||
{
|
||||
object-fit: contain;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.quick-emoji-dropdown .quick-emoji-option span
|
||||
.speed-carot-modal .speed-modal-option span
|
||||
{
|
||||
overflow: hidden;
|
||||
display: inline-block;
|
||||
|
@ -6712,7 +6712,7 @@ div.markdown {
|
|||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.quick-emoji-dropdown .quick-emoji-image
|
||||
.speed-carot-modal .speed-modal-image
|
||||
{
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
|
|
|
@ -12,7 +12,7 @@ function getMessageFromJsonData(success, json) {
|
|||
}
|
||||
|
||||
function showToast(success, message) {
|
||||
const oldToast = bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-' + (success ? 'error' : 'success'))); // intentionally reversed here: this is the old toast
|
||||
const oldToast = bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-' + (success ? 'error': 'success'))); // intentionally reversed here: this is the old toast
|
||||
oldToast.hide();
|
||||
let element = success ? "toast-post-success" : "toast-post-error";
|
||||
let textElement = element + "-text";
|
||||
|
@ -23,7 +23,7 @@ function showToast(success, message) {
|
|||
bootstrap.Toast.getOrCreateInstance(document.getElementById(element)).show();
|
||||
}
|
||||
|
||||
function createXhrWithFormKey(url, form = new FormData(), method = 'POST') {
|
||||
function createXhrWithFormKey(url, form=new FormData(), method='POST') {
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open(method, url);
|
||||
xhr.setRequestHeader('xhr', 'xhr');
|
||||
|
@ -38,12 +38,12 @@ function postToast(t, url, data, extraActionsOnSuccess, extraActionsOnFailure) {
|
|||
|
||||
let form = new FormData();
|
||||
if (typeof data === 'object' && data !== null) {
|
||||
for (let k of Object.keys(data)) {
|
||||
for(let k of Object.keys(data)) {
|
||||
form.append(k, data[k]);
|
||||
}
|
||||
}
|
||||
const xhr = createXhrWithFormKey(url, form);
|
||||
xhr[0].onload = function () {
|
||||
xhr[0].onload = function() {
|
||||
const success = xhr[0].status >= 200 && xhr[0].status < 300;
|
||||
|
||||
if (!(extraActionsOnSuccess == reload && success)) {
|
||||
|
@ -88,18 +88,19 @@ function postToastSwitch(t, url, button1, button2, cls, extraActionsOnSuccess) {
|
|||
{
|
||||
},
|
||||
(xhr) => {
|
||||
if (button1) {
|
||||
if (button1)
|
||||
{
|
||||
if (typeof button1 == 'boolean') {
|
||||
location.reload()
|
||||
} else {
|
||||
try {
|
||||
document.getElementById(button1).classList.toggle(cls);
|
||||
}
|
||||
catch (e) { }
|
||||
catch (e) {}
|
||||
try {
|
||||
document.getElementById(button2).classList.toggle(cls);
|
||||
}
|
||||
catch (e) { }
|
||||
catch (e) {}
|
||||
}
|
||||
}
|
||||
if (typeof extraActionsOnSuccess == 'function')
|
||||
|
|
|
@ -127,13 +127,13 @@ class EmojiEngine {
|
|||
}
|
||||
|
||||
const emojiEl = document.createElement('button');
|
||||
emojiEl.classList.add('quick-emoji-option', 'emoji-option');
|
||||
emojiEl.classList.add('speed-modal-option', 'emoji-option');
|
||||
emojiEl.addEventListener('click', (e) => {
|
||||
this.onInsert(emojiName);
|
||||
});
|
||||
|
||||
const emojiImgEl = document.createElement('img');
|
||||
emojiImgEl.classList.add('quick-emoji-image', 'emoji-option-image');
|
||||
emojiImgEl.classList.add('speed-modal-image', 'emoji-option-image');
|
||||
emojiImgEl.src = emojiEngine.src(emojiName);
|
||||
emojiEl.appendChild(emojiImgEl);
|
||||
|
||||
|
@ -155,7 +155,7 @@ const emojiEngine = new EmojiEngine();
|
|||
// Quick emoji dropdown & emoji insertion
|
||||
{
|
||||
const emojiDropdownEl = document.createElement('div');
|
||||
emojiDropdownEl.classList.add('quick-emoji-dropdown');
|
||||
emojiDropdownEl.classList.add('speed-carot-modal');
|
||||
/** @type {null | HTMLTextAreaElement} */
|
||||
let inputEl = null;
|
||||
let visible = false;
|
||||
|
|
Loading…
Reference in New Issue