aboutsummaryrefslogtreecommitdiff
path: root/src/ClientUtils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/ClientUtils.ts')
-rw-r--r--src/ClientUtils.ts17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/ClientUtils.ts b/src/ClientUtils.ts
index 57e0373c4..402f6613a 100644
--- a/src/ClientUtils.ts
+++ b/src/ClientUtils.ts
@@ -3,7 +3,7 @@ import * as React from 'react';
import { ColorResult } from 'react-color';
import * as rp from 'request-promise';
import { numberRange, decimalToHexString } from './Utils';
-import { DocumentType } from './client/documents/DocumentTypes';
+import { CollectionViewType, DocumentType } from './client/documents/DocumentTypes';
import { Colors } from './client/views/global/globalEnums';
export function DashColor(color: string) {
@@ -100,11 +100,22 @@ export namespace ClientUtils {
return Date.now() - downTime < ClientUtils.CLICK_TIME && Math.abs(x - downX) < ClientUtils.DRAG_THRESHOLD && Math.abs(y - downY) < ClientUtils.DRAG_THRESHOLD;
}
- export function cleanDocumentType(type: DocumentType) {
+ export function cleanDocumentTypeExt(type: DocumentType) {
switch (type) {
+ case DocumentType.PDF: return 'PDF';
+ case DocumentType.IMG: return 'Img';
+ case DocumentType.AUDIO: return 'Aud';
+ case DocumentType.COL: return 'Col';
+ case DocumentType.RTF: return 'Rtf';
+ default: return type.charAt(0).toUpperCase() + type.substring(1,3);
+ } // prettier-ignore
+ }
+ export function cleanDocumentType(type: DocumentType, colType: CollectionViewType) {
+ switch (type) {
+ case DocumentType.PDF: return 'PDF';
case DocumentType.IMG: return 'Image';
case DocumentType.AUDIO: return 'Audio';
- case DocumentType.COL: return 'Collection';
+ case DocumentType.COL: return 'Collection:'+colType;
case DocumentType.RTF: return 'Text';
default: return type.charAt(0).toUpperCase() + type.slice(1);
} // prettier-ignore