diff options
author | geireann <geireann.lindfield@gmail.com> | 2024-10-31 10:45:12 -0400 |
---|---|---|
committer | geireann <geireann.lindfield@gmail.com> | 2024-10-31 10:45:12 -0400 |
commit | d234aebe441aced1b6d947653a1b36c226439103 (patch) | |
tree | 237f69defbcbdec1a3f3e10225d1613dc261531a /src/ClientUtils.ts | |
parent | 6b070202843e1e2a11c09c4d29aee4ab8750f31f (diff) | |
parent | 311836b7a013d37dccb7b74d7ce787cea448de38 (diff) |
Merge branch 'master' of https://github.com/brown-dash/Dash-Web
Diffstat (limited to 'src/ClientUtils.ts')
-rw-r--r-- | src/ClientUtils.ts | 11 |
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 : '') + ')'; |