Cleanup links

This commit is contained in:
djmaze 2021-02-04 11:25:00 +01:00
parent 6a92912a3d
commit 32c3f1f059
8 changed files with 25 additions and 133 deletions

View file

@ -3,10 +3,7 @@ import ko from 'ko';
import { File, FileType } from 'Common/File';
import {
attachmentDownload,
attachmentPreview,
attachmentFramed,
attachmentPreviewAsPlain,
attachmentThumbnailPreview
serverRequestRaw
} from 'Common/Links';
import { AbstractModel } from 'Knoin/AbstractModel';
@ -140,14 +137,14 @@ export class AttachmentModel extends AbstractModel {
* @returns {string}
*/
linkPreview() {
return attachmentPreview(this.download);
return serverRequestRaw('View', this.download);
}
/**
* @returns {string}
*/
linkThumbnail() {
return this.hasThumbnail() ? attachmentThumbnailPreview(this.download) : '';
return this.hasThumbnail() ? serverRequestRaw('ViewThumbnail', this.download) : '';
}
/**
@ -158,18 +155,11 @@ export class AttachmentModel extends AbstractModel {
return link ? 'background:url(' + link + ')' : '';
}
/**
* @returns {string}
*/
linkFramed() {
return attachmentFramed(this.download);
}
/**
* @returns {string}
*/
linkPreviewAsPlain() {
return attachmentPreviewAsPlain(this.download);
return serverRequestRaw('ViewAsPlain', this.download);
}
/**