Some improvements and new internal-code features
* We can use fediloveUI.toast(msg) to send a message using the React toast * I couldnt manage to export formatIntl function to the outside, and the only option was to set the desired keys at the _layout.html initial load * Some little fixes and localizations
This commit is contained in:
parent
8d2194af4b
commit
51f318e1a4
|
@ -276,4 +276,5 @@ export async function showMoreItemsForThread (instanceName, timelineName) {
|
||||||
|
|
||||||
if (process.browser) {
|
if (process.browser) {
|
||||||
window.__database = database;
|
window.__database = database;
|
||||||
|
window.__toast = toast;
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,6 +79,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { store } from './_store/store'
|
import { store } from './_store/store'
|
||||||
import { observe } from 'svelte-extras'
|
import { observe } from 'svelte-extras'
|
||||||
|
import { formatIntl } from './_utils/formatIntl'
|
||||||
import { importShowEmojiDialog } from './_components/dialog/asyncDialogs/importShowEmojiDialog'
|
import { importShowEmojiDialog } from './_components/dialog/asyncDialogs/importShowEmojiDialog'
|
||||||
import { updateCustomEmojiForInstance } from './_actions/emoji'
|
import { updateCustomEmojiForInstance } from './_actions/emoji'
|
||||||
|
|
||||||
|
@ -102,6 +103,10 @@
|
||||||
document.body.appendChild(script);
|
document.body.appendChild(script);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
window.__intl = {
|
||||||
|
'nothingToShow': formatIntl('intl.nothingToShow'),
|
||||||
|
};
|
||||||
|
|
||||||
loadScript('/jquery-3.5.1.min.js');
|
loadScript('/jquery-3.5.1.min.js');
|
||||||
loadScript("/fedilove-no-react.js?v="+Date.now(), true);
|
loadScript("/fedilove-no-react.js?v="+Date.now(), true);
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.8 KiB |
|
@ -198,7 +198,8 @@ var fediloveUI = {
|
||||||
count++;
|
count++;
|
||||||
var newLen = $('div.the-list > div').length;
|
var newLen = $('div.the-list > div').length;
|
||||||
if (count >= 100 || newLen != startLen) {
|
if (count >= 100 || newLen != startLen) {
|
||||||
document.querySelector('div.the-list > div:last-child').scrollIntoView();
|
const elem = document.querySelector('div.the-list > div:last-child');
|
||||||
|
if (elem !== null) elem.scrollIntoView();
|
||||||
clearInterval(_this);
|
clearInterval(_this);
|
||||||
}
|
}
|
||||||
}, 150);
|
}, 150);
|
||||||
|
@ -268,6 +269,10 @@ var fediloveUI = {
|
||||||
countMax++;
|
countMax++;
|
||||||
}, 100);
|
}, 100);
|
||||||
},
|
},
|
||||||
|
toast: function(whatToSay) {
|
||||||
|
if (window.__toast !== undefined)
|
||||||
|
window.__toast.say(whatToSay);
|
||||||
|
},
|
||||||
animateMainContentSwipe: function(animName, cback) {
|
animateMainContentSwipe: function(animName, cback) {
|
||||||
$('div.virtual-list')[0].style.animation = `${animName} .25s linear 1`;
|
$('div.virtual-list')[0].style.animation = `${animName} .25s linear 1`;
|
||||||
setTimeout(cback, 220);
|
setTimeout(cback, 220);
|
||||||
|
@ -473,8 +478,15 @@ function fedilove_customization() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fediloveData.myAccountId === undefined && window.__store.get().verifyCredentials !== undefined)
|
if (fediloveData.myAccountId === undefined && window.__store.get().verifyCredentials !== undefined) {
|
||||||
fediloveData.myAccountId = window.__store.get().verifyCredentials[fediloveApi.getCurrentInstance()].id;
|
var aCountMax = 0;
|
||||||
|
const _a = setInterval(function() {
|
||||||
|
const theData = window.__store.get().verifyCredentials[fediloveApi.getCurrentInstance()];
|
||||||
|
if (aCountMax > 20 || theData !== null)
|
||||||
|
fediloveData.myAccountId = theData !== null ? theData.id : undefined;
|
||||||
|
aCountMax++;
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
|
||||||
if (document.querySelector('#main-nav > div#dummy-nav') != null) {
|
if (document.querySelector('#main-nav > div#dummy-nav') != null) {
|
||||||
document.querySelector('#main-nav > div#dummy-nav').remove();
|
document.querySelector('#main-nav > div#dummy-nav').remove();
|
||||||
|
@ -545,7 +557,7 @@ function fedilove_customization() {
|
||||||
if (!e.ctrlKey && !e.shiftKey) {
|
if (!e.ctrlKey && !e.shiftKey) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setTimeout(function() { api_send_message() }, 100);
|
setTimeout(function() { fediloveMastodon.API.sendMessage() }, 100);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
if (!e.shiftKey && e.ctrlKey) {
|
if (!e.shiftKey && e.ctrlKey) {
|
||||||
|
@ -740,7 +752,7 @@ function fedilove_customization() {
|
||||||
|
|
||||||
// added when there is no more profiles to Meet
|
// added when there is no more profiles to Meet
|
||||||
if ($('div#noone-to-meet').length === 0)
|
if ($('div#noone-to-meet').length === 0)
|
||||||
$('div.timeline').parent().append('<div id="noone-to-meet" style="display: none"><span>Nothing to show</span></div>');
|
$('div.timeline').parent().append('<div id="noone-to-meet" style="display: none"><span>'+window.__intl.nothingToShow+'</span></div>');
|
||||||
|
|
||||||
// remove discarded accounts from timeline (temporal,
|
// remove discarded accounts from timeline (temporal,
|
||||||
// if /meet is reloaded, blocked accounts won't show either)
|
// if /meet is reloaded, blocked accounts won't show either)
|
||||||
|
|
Loading…
Reference in New Issue