Browse Source

Home commit

master
morethanwords 4 years ago
parent
commit
1f9eb95bdb
  1. 2
      src/components/appMediaViewer.ts
  2. 1411
      src/components/appMediaViewerNew.ts
  3. 40
      src/components/sidebarLeft/tabs/settings.ts
  4. 2
      src/lib/mtproto/mtprotoworker.ts
  5. 12
      src/scss/partials/_mediaViewer.scss

2
src/components/appMediaViewer.ts

@ -1109,7 +1109,7 @@ class AppMediaViewerBase<ContentAdditionType extends string, ButtonsAdditionType @@ -1109,7 +1109,7 @@ class AppMediaViewerBase<ContentAdditionType extends string, ButtonsAdditionType
return cancellablePromise;
};
this.lazyLoadQueue.unshift({load});
//this.lazyLoadQueue.unshift({load});
});
}

1411
src/components/appMediaViewerNew.ts

File diff suppressed because it is too large Load Diff

40
src/components/sidebarLeft/tabs/settings.ts

@ -5,6 +5,7 @@ import appSidebarLeft, { AppSidebarLeft } from ".."; @@ -5,6 +5,7 @@ import appSidebarLeft, { AppSidebarLeft } from "..";
import appUsersManager from "../../../lib/appManagers/appUsersManager";
import ButtonMenuToggle from "../../buttonMenuToggle";
import Button from "../../button";
import AppMediaViewer from "../../appMediaViewer";
export default class AppSettingsTab extends SliderSuperTab {
private avatarElem: AvatarElement;
@ -41,6 +42,45 @@ export default class AppSettingsTab extends SliderSuperTab { @@ -41,6 +42,45 @@ export default class AppSettingsTab extends SliderSuperTab {
this.avatarElem = new AvatarElement();
this.avatarElem.setAttribute('clickable', '');
this.avatarElem.classList.add('profile-avatar', 'avatar-120');
/* const div = document.createElement('div');
div.style.cssText = 'border-radius: 8px; overflow: hidden; width: 396px; height: 264px; flex: 0 0 auto; position: relative; margin: 10rem 0 10rem auto;';
div.style.width = '135px';
div.style.height = '100px';
const img = document.createElement('img');
img.src = 'assets/img/PinnedMessages.png';
img.classList.add('media-photo');
img.style.cssText = 'max-width: 100%;max-height: 100%;';
div.append(img);
div.addEventListener('click', () => {
new AppMediaViewer().setSearchContext({peerId: 61004386, inputFilter: 'inputMessagesFilterPhotos'}).openMedia({
_: 'message',
mid: 1,
peerId: 61004386,
fromId: 61004386,
message: '',
media: {
_: 'messageMediaPhoto',
photo: {
_: 'photo',
url: img.src,
downloaded: 111,
sizes: [{
_: 'photoSize',
type: 'x',
w: 618,
h: 412
}]
}
},
date: Date.now() / 1000 | 0
}, img);
});
this.scrollable.append(div); */
this.nameDiv = document.createElement('div');
this.nameDiv.classList.add('profile-name');

2
src/lib/mtproto/mtprotoworker.ts

@ -115,7 +115,7 @@ export class ApiManagerProxy extends CryptoWorkerMethods { @@ -115,7 +115,7 @@ export class ApiManagerProxy extends CryptoWorkerMethods {
}
private registerWorker() {
//return;
return;
const worker = new MTProtoWorker();
worker.addEventListener('message', (e) => {

12
src/scss/partials/_mediaViewer.scss

@ -205,21 +205,15 @@ @@ -205,21 +205,15 @@
}
}
&-mover {
&-mover, &-canvas {
position: fixed!important;
z-index: 4;
display: flex;
justify-content: center;
align-items: center; // mb net
min-height: auto!important;
//transition: .5s all;
left: 0;
top: 0;
/* left: 50%;
top: 50%; */
transform-origin: top left;
//transform-origin: top left;
transform-origin: bottom right;
overflow: hidden;
//border-radius: 0;
// эти значения должны быть такими же, как при установке maxWidth и maxHeight в openMedia!
//max-width: 100%;

Loading…
Cancel
Save