Browse Source

Chatlist menu footer

master
morethanwords 4 years ago
parent
commit
411c7a8d9c
  1. 25
      src/components/sidebarLeft/index.ts
  2. 3
      src/components/sidebarRight/tabs/sharedMedia.ts
  3. 2
      src/config/app.ts
  4. 2
      src/lang.ts
  5. 4
      src/lib/appManagers/appImManager.ts
  6. 20
      src/scss/partials/_button.scss

25
src/components/sidebarLeft/index.ts

@ -36,6 +36,7 @@ import findUpClassName from "../../helpers/dom/findUpClassName";
import findUpTag from "../../helpers/dom/findUpTag"; import findUpTag from "../../helpers/dom/findUpTag";
import PeerTitle from "../peerTitle"; import PeerTitle from "../peerTitle";
import { replaceContent } from "../../helpers/dom"; import { replaceContent } from "../../helpers/dom";
import App from "../../config/app";
export const LEFT_COLUMN_ACTIVE_CLASSNAME = 'is-left-column-shown'; export const LEFT_COLUMN_ACTIVE_CLASSNAME = 'is-left-column-shown';
@ -135,12 +136,34 @@ export class AppSidebarLeft extends SidebarSlider {
}) })
}, { }, {
icon: 'help', icon: 'help',
text: 'SettingsHelp', text: 'TelegramFeatures',
onClick: () => { onClick: () => {
appImManager.openUsername('TelegramTips'); appImManager.openUsername('TelegramTips');
} }
}, {
icon: 'help',
text: 'ReportBug',
onClick: () => {
const a = document.createElement('a');
a.target = '_blank';
a.href = 'https://bugs.telegram.org/?tag_ids=40&sort=time';
document.body.append(a);
a.click();
setTimeout(() => {
a.remove();
}, 0);
}
}]); }]);
const btnMenuFooter = document.createElement('div');
btnMenuFooter.classList.add('btn-menu-footer');
const t = document.createElement('span');
t.classList.add('btn-menu-footer-text');
t.innerHTML = 'Telegram WebK alpha ' + App.version;
btnMenuFooter.append(t);
btnMenu.classList.add('has-footer');
btnMenu.append(btnMenuFooter);
btnMenu.classList.add('bottom-right'); btnMenu.classList.add('bottom-right');
this.toolsBtn.append(btnMenu); this.toolsBtn.append(btnMenu);

3
src/components/sidebarRight/tabs/sharedMedia.ts

@ -224,7 +224,8 @@ class PeerProfileAvatars {
const x = e.pageX; const x = e.pageX;
const clickX = x - rect.left; const clickX = x - rect.left;
if(clickX > (rect.width * SWITCH_ZONE) && clickX < (rect.width - rect.width * SWITCH_ZONE)) { if((!this.listLoader.previous.length && !this.listLoader.next.length)
|| (clickX > (rect.width * SWITCH_ZONE) && clickX < (rect.width - rect.width * SWITCH_ZONE))) {
const peerId = this.peerId; const peerId = this.peerId;
const targets: {element: HTMLElement, item: string | Message.messageService}[] = []; const targets: {element: HTMLElement, item: string | Message.messageService}[] = [];

2
src/config/app.ts

@ -13,7 +13,7 @@ const App = {
id: 1025907, id: 1025907,
hash: '452b0359b988148995f22ff0f4229750', hash: '452b0359b988148995f22ff0f4229750',
version: '0.4.0', version: '0.4.0',
langPackVersion: '0.1.2', langPackVersion: '0.1.3',
langPack: 'macos', langPack: 'macos',
langPackCode: 'en', langPackCode: 'en',
domains: [] as string[], domains: [] as string[],

2
src/lang.ts

@ -90,6 +90,7 @@ const lang = {
"MediaViewer.Context.Download": "Download", "MediaViewer.Context.Download": "Download",
"Profile": "Profile", "Profile": "Profile",
"Saved": "Saved", "Saved": "Saved",
"ReportBug": "Report Bug",
// * android // * android
"ActionCreateChannel": "Channel created", "ActionCreateChannel": "Channel created",
@ -390,6 +391,7 @@ const lang = {
"other_value": "%1$d stickers" "other_value": "%1$d stickers"
}, },
"HidAccount": "The account was hidden by the user", "HidAccount": "The account was hidden by the user",
"TelegramFeatures": "Telegram Features",
// * macos // * macos
"AccountSettings.Filters": "Chat Folders", "AccountSettings.Filters": "Chat Folders",

4
src/lib/appManagers/appImManager.ts

@ -261,6 +261,10 @@ export class AppImManager {
} }
public getChatSavedPosition(chat: Chat): ChatSavedPosition { public getChatSavedPosition(chat: Chat): ChatSavedPosition {
if(!(['chat', 'discussion'] as ChatType[]).includes(chat.type) || !chat.peerId) {
return;
}
const key = chat.peerId + (chat.threadId ? '_' + chat.threadId : ''); const key = chat.peerId + (chat.threadId ? '_' + chat.threadId : '');
return sessionStorage.getFromCache('chatPositions')[key]; return sessionStorage.getFromCache('chatPositions')[key];
} }

20
src/scss/partials/_button.scss

@ -227,6 +227,26 @@
width: auto !important; width: auto !important;
max-width: none !important; max-width: none !important;
} }
&.has-footer {
padding-bottom: 0;
}
&-footer {
height: 2.5rem;
background: var(--background-color-true);
display: flex;
align-items: center;
justify-content: center;
border-bottom-left-radius: inherit;
border-bottom-right-radius: inherit;
font-size: .875rem;
cursor: default;
&-text {
margin-top: -.125rem;
}
}
} }
.btn-primary { .btn-primary {

Loading…
Cancel
Save