aboutsummaryrefslogtreecommitdiff
path: root/src/ClientUtils.ts
diff options
context:
space:
mode:
authoralyssaf16 <alyssa_feinberg@brown.edu>2024-10-30 23:18:17 -0400
committeralyssaf16 <alyssa_feinberg@brown.edu>2024-10-30 23:18:17 -0400
commitd1fc9d98172210090f5ed1aa8aaa8512f5afd0eb (patch)
treeb996e6a0c07ec902a45c77548afc3492ebd5d846 /src/ClientUtils.ts
parentcd54cba6269dbc4e10b457fe7eddd5114a9d301e (diff)
parentc92e9af531b6277de4e838d75d65c3d1d1efa11d (diff)
Merge branch 'master' of https://github.com/brown-dash/Dash-Web into alyssa-agent
Diffstat (limited to 'src/ClientUtils.ts')
-rw-r--r--src/ClientUtils.ts11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/ClientUtils.ts b/src/ClientUtils.ts
index e7aee1c2a..baad9a06c 100644
--- a/src/ClientUtils.ts
+++ b/src/ClientUtils.ts
@@ -107,12 +107,12 @@ export namespace ClientUtils {
default: return type.charAt(0).toUpperCase() + type.substring(1,3);
} // prettier-ignore
}
- export function cleanDocumentType(type: DocumentType, colType: CollectionViewType) {
+ 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:'+colType;
+ case DocumentType.COL: return 'Collection:'+ (colType ?? "");
case DocumentType.RTF: return 'Text';
default: return type.charAt(0).toUpperCase() + type.slice(1);
} // prettier-ignore
@@ -212,7 +212,7 @@ export namespace ClientUtils {
return { r: r, g: g, b: b, a: a };
}
- const isTransparentFunctionHack = 'isTransparent(__value__)';
+ export const isTransparentFunctionHack = 'isTransparent(__value__)';
export const noRecursionHack = '__noRecursion';
// special case filters
@@ -223,11 +223,6 @@ export namespace ClientUtils {
export function IsRecursiveFilter(val: string) {
return !val.includes(noRecursionHack);
}
- export function HasFunctionFilter(val: string) {
- if (val.includes(isTransparentFunctionHack)) return (color: string) => color !== '' && DashColor(color).alpha() !== 1;
- // add other function filters here...
- return undefined;
- }
export function toRGBAstr(col: { r: number; g: number; b: number; a?: number }) {
return 'rgba(' + col.r + ',' + col.g + ',' + col.b + (col.a !== undefined ? ',' + col.a : '') + ')';