Add chat enter to send + chat ctrl or shift enter to keep writing
This commit is contained in:
parent
cc04ede6f2
commit
7649f30323
|
@ -20,6 +20,14 @@
|
|||
|
||||
<!-- inline CSS -->
|
||||
|
||||
<style id="fedilove" media="all">
|
||||
@media (max-width: 500px) {
|
||||
div.timeline > div.the-list div.list-item article.status-article {
|
||||
max-width: 18em !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style id="theGrayscaleStyle" media="only x">
|
||||
/* Firefox doesn't seem to like applying filter: grayscale() to
|
||||
* the entire body, so we apply individually.
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
<StatusToolbar {...params} {replyShown} on:recalculateHeight />
|
||||
<div class="like-div"><a class="status-favs-reblogs status-favs"
|
||||
rel="prefetch"
|
||||
href="/statuses/{originalStatusId}"
|
||||
onclick="return api_status_fav(this,'{originalStatusId}');"
|
||||
aria-label={favoritesLabel}>
|
||||
<svg class="status-favs-reblogs-svg"><path d="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z"></path></svg>
|
||||
|
|
|
@ -84,6 +84,7 @@ div#chat-party-global {
|
|||
width: 100%;
|
||||
padding-left: 1em;
|
||||
a {
|
||||
display: flex;
|
||||
font-weight: bold;
|
||||
margin: auto 0;
|
||||
color: #000;
|
||||
|
@ -96,7 +97,12 @@ div#chat-party-global {
|
|||
}
|
||||
|
||||
div#back {
|
||||
background: #fff;
|
||||
display: flex;
|
||||
padding-left: 1em;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: .6em;
|
||||
|
||||
a {
|
||||
display: flex;
|
||||
|
@ -211,9 +217,18 @@ div.main-content.direct {
|
|||
}
|
||||
|
||||
div.timeline div.virtual-list-item {
|
||||
|
||||
article.status-article {
|
||||
cursor: pointer;
|
||||
}
|
||||
article.status-article:focus {
|
||||
background: #f7f7f7;
|
||||
}
|
||||
|
||||
a.status-favs-reblogs.status-favs {
|
||||
display: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
div.timeline > div.the-list {
|
||||
|
@ -221,6 +236,7 @@ div.timeline > div.the-list {
|
|||
div.list-item {
|
||||
|
||||
article.status-article.mymsg {
|
||||
|
||||
background: #fbfbfb;
|
||||
float: right;
|
||||
|
||||
|
@ -235,9 +251,17 @@ div.timeline > div.the-list {
|
|||
}
|
||||
|
||||
article.status-article.partymsg {
|
||||
|
||||
a.status-favs-reblogs.status-favs.liked-msg > svg {
|
||||
fill: red !important;
|
||||
}
|
||||
|
||||
div.like-div {
|
||||
a.status-favs-reblogs.status-favs {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
article.status-article {
|
||||
|
@ -273,6 +297,11 @@ div.timeline > div.the-list {
|
|||
display: none;
|
||||
}
|
||||
|
||||
a.status-relative-date {
|
||||
position: relative;
|
||||
left: 1.5em;
|
||||
}
|
||||
|
||||
a.external-link.status-absolute-date {
|
||||
text-decoration: none;
|
||||
cursor: initial;
|
||||
|
|
|
@ -87,6 +87,10 @@ var fediloveUI = {
|
|||
id: accid, acct: acct,
|
||||
avatar: avatar, name: name
|
||||
};
|
||||
// add domain part on acct on painting it to be clear
|
||||
if (acct.split('@').length-1 === 1) {
|
||||
acct += `@${fediloveApi.getCurrentInstance()}`;
|
||||
}
|
||||
}
|
||||
|
||||
// to-do: check is it XSS safe to add it like this :) ??
|
||||
|
@ -123,7 +127,8 @@ var fediloveApi = {
|
|||
var fediloveFunctions = {};
|
||||
var fediloveData = {
|
||||
chatAvatarCache: undefined,
|
||||
gotEmojifyTextFunction: false
|
||||
gotEmojifyTextFunction: false,
|
||||
composeTxtKeypressEvent: false
|
||||
};
|
||||
var fediloveEvents = {
|
||||
onGotEmojifyTextFunction: function() {
|
||||
|
@ -205,6 +210,25 @@ function fedilove_customization() {
|
|||
document.querySelector('#chat-party-hide').style = '';
|
||||
document.querySelector('nav#main-nav > ul.main-nav-ul').style = 'display: none !important';
|
||||
|
||||
if (!fediloveData.composeTxtKeypressEvent) {
|
||||
$('div#chat-compose-global textarea').keypress(function(e) {
|
||||
const keycode = (e.keyCode ? e.keyCode : e.which);
|
||||
if (keycode == '13') {
|
||||
if (!e.ctrlKey && !e.shiftKey) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
setTimeout(function() { api_send_message() }, 100);
|
||||
return true;
|
||||
} else {
|
||||
if (!e.shiftKey && e.ctrlKey) {
|
||||
$(this).val($(this).val()+'\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
fediloveData.composeTxtKeypressEvent = true;
|
||||
}
|
||||
|
||||
// *******
|
||||
// load cached avatars or paint it empty (automated process after this will fill it)
|
||||
if (fediloveData.chatAvatarCache !== undefined) {
|
||||
|
|
Loading…
Reference in New Issue