Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69b6055353 | ||
|
|
1bdd0449e0 | ||
|
|
a6fdf9010b | ||
|
|
941dae0625 | ||
|
|
4a715bfd17 |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "cinny",
|
"name": "cinny",
|
||||||
"version": "2.0.1",
|
"version": "2.0.3",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "cinny",
|
"name": "cinny",
|
||||||
"version": "2.0.1",
|
"version": "2.0.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/inter": "^4.5.10",
|
"@fontsource/inter": "^4.5.10",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cinny",
|
"name": "cinny",
|
||||||
"version": "2.0.1",
|
"version": "2.0.3",
|
||||||
"description": "Yet another matrix client",
|
"description": "Yet another matrix client",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
@@ -33,22 +33,25 @@ function listenKeyboard(event) {
|
|||||||
// open search modal
|
// open search modal
|
||||||
if (event.code === 'KeyK') {
|
if (event.code === 'KeyK') {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (navigation.isRawModalVisible) {
|
if (navigation.isRawModalVisible) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
openSearch();
|
openSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
// focus message field on paste
|
// focus message field on paste
|
||||||
if (event.code === 'KeyV') {
|
if (event.code === 'KeyV') {
|
||||||
|
if (navigation.isRawModalVisible) return;
|
||||||
const msgTextarea = document.getElementById('message-textarea');
|
const msgTextarea = document.getElementById('message-textarea');
|
||||||
|
const { activeElement } = document;
|
||||||
|
if (activeElement !== msgTextarea
|
||||||
|
&& ['input', 'textarea'].includes(activeElement.tagName.toLowerCase())
|
||||||
|
) return;
|
||||||
msgTextarea?.focus();
|
msgTextarea?.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!event.ctrlKey && !event.altKey && !event.metaKey) {
|
if (!event.ctrlKey && !event.altKey && !event.metaKey) {
|
||||||
if (navigation.isRawModalVisible) return;
|
if (navigation.isRawModalVisible) return;
|
||||||
if (['text', 'textarea'].includes(document.activeElement.type)) {
|
if (['input', 'textarea'].includes(document.activeElement.tagName.toLowerCase())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const cons = {
|
const cons = {
|
||||||
version: '2.0.1',
|
version: '2.0.3',
|
||||||
secretKey: {
|
secretKey: {
|
||||||
ACCESS_TOKEN: 'cinny_access_token',
|
ACCESS_TOKEN: 'cinny_access_token',
|
||||||
DEVICE_ID: 'cinny_device_id',
|
DEVICE_ID: 'cinny_device_id',
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class Navigation extends EventEmitter {
|
|||||||
this.isRoomSettings = false;
|
this.isRoomSettings = false;
|
||||||
this.recentRooms = [];
|
this.recentRooms = [];
|
||||||
|
|
||||||
this.isRawModalVisible = false;
|
this.rawModelStack = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
_setSpacePath(roomId) {
|
_setSpacePath(roomId) {
|
||||||
@@ -47,8 +47,13 @@ class Navigation extends EventEmitter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isRawModalVisible() {
|
||||||
|
return this.rawModelStack.length > 0;
|
||||||
|
}
|
||||||
|
|
||||||
setIsRawModalVisible(visible) {
|
setIsRawModalVisible(visible) {
|
||||||
this.isRawModalVisible = visible;
|
if (visible) this.rawModelStack.push(true);
|
||||||
|
else this.rawModelStack.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
navigate(action) {
|
navigate(action) {
|
||||||
|
|||||||
Reference in New Issue
Block a user