diff options
author | bobzel <zzzman@gmail.com> | 2023-12-06 20:46:23 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-12-06 20:46:23 -0500 |
commit | dd1db35513257abc6f36da5f8608afdde1bc4dd8 (patch) | |
tree | a4050d7fc6616fd5c71c2b82420e57be0b406141 /src | |
parent | c30a5b644458a7ab03a4dabe93face035aa0a21b (diff) |
final cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/Utils.ts | 6 | ||||
-rw-r--r-- | src/client/util/Scripting.ts | 28 | ||||
-rw-r--r-- | src/client/views/collections/CollectionDockingView.scss | 15 | ||||
-rw-r--r-- | src/client/views/search/IconButton.tsx | 36 | ||||
-rw-r--r-- | src/fields/ScriptField.ts | 4 |
5 files changed, 17 insertions, 72 deletions
diff --git a/src/Utils.ts b/src/Utils.ts index 0bda615d8..26514622c 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -406,7 +406,7 @@ export namespace Utils { }; } - export function Emit<T>(socket: { emit: (msg: string, args: T) => void }, message: Message<T>, args: T) { + export function Emit<T>(socket: Socket, message: Message<T>, args: T) { log('Emit', message.Name, args, false); socket.emit(message.Message, args); } @@ -422,11 +422,11 @@ export namespace Utils { } } - export function AddServerHandler<T>(socket: { on: (event: string, cb: (args: any) => void) => void }, message: Message<T>, handler: (args: T) => any) { + export function AddServerHandler<T>(socket: Socket, message: Message<T>, handler: (args: T) => any) { socket.on(message.Message, loggingCallback('Incoming', handler, message.Name)); } - export function AddServerHandlerCallback<T>(socket: { on: (event: string, cb: (arg: T, fn: (res: any) => any) => void) => void }, message: Message<T>, handler: (args: [T, (res: any) => any]) => any) { + export function AddServerHandlerCallback<T>(socket: Socket, message: Message<T>, handler: (args: [T, (res: any) => any]) => any) { socket.on(message.Message, (arg: T, fn: (res: any) => any) => { log('S receiving', message.Name, arg, true); handler([arg, loggingCallback('S sending', fn, message.Name)]); diff --git a/src/client/util/Scripting.ts b/src/client/util/Scripting.ts index b3c694024..f0a5f9ed9 100644 --- a/src/client/util/Scripting.ts +++ b/src/client/util/Scripting.ts @@ -120,34 +120,6 @@ class ScriptingCompilerHost { } return undefined; } - resolveModuleNames(moduleNames: string[], containingFile: string): any { - const resolvedModules: ts.ResolvedModule[] = []; - for (const moduleName of moduleNames) { - // try to use standard resolution - let result = ts.resolveModuleName( - moduleName, - containingFile, - {}, - { - fileExists: (fileName: string) => true as any, - readFile: (fileName: string) => 'true', - } - ); - if (result.resolvedModule) { - resolvedModules.push(result.resolvedModule); - } else { - // check fallback locations, for simplicity assume that module at location - // should be represented by '.d.ts' file - // for (const location of moduleSearchLocations) { - // const modulePath = path.join(location, moduleName + ".d.ts"); - // if (fileExists(modulePath)) { - // resolvedModules.push({ resolvedFileName: modulePath }); - // } - // } - } - } - return resolvedModules; - } // getDefaultLibFileName(options: ts.CompilerOptions): string { getDefaultLibFileName(options: any): string { diff --git a/src/client/views/collections/CollectionDockingView.scss b/src/client/views/collections/CollectionDockingView.scss index a654596bd..11543bbe5 100644 --- a/src/client/views/collections/CollectionDockingView.scss +++ b/src/client/views/collections/CollectionDockingView.scss @@ -276,8 +276,6 @@ z-index: 20; } /*# sourceMappingURL=goldenlayout-base.css.map */ -// @import '../../../../node_modules/golden-layout/src/css/goldenlayout-dark-theme.css'; - .lm_title { -webkit-appearance: none; display: inline-block; @@ -681,11 +679,6 @@ ul.lm_tabs::before { height: 8px; } - .flexlayout__tab_button:hover .flexlayout__tab_button_trailing, - .flexlayout__tab_button--selected .flexlayout__tab_button_trailing { - // background: transparent url('../../../../node_modules/flexlayout-react/images/close_white.png') no-repeat center; - } - .flexlayout__tab_button_overflow { float: left; width: 20px; @@ -696,7 +689,6 @@ ul.lm_tabs::before { font-size: 10px; color: lightgray; font-family: Arial, sans-serif; - // background: transparent url('../../../../node_modules/flexlayout-react/images/more.png') no-repeat left; } .flexlayout__tabset_header { @@ -751,7 +743,6 @@ ul.lm_tabs::before { height: 20px; border: none; outline-width: 0; - // background: transparent url('../../../../node_modules/flexlayout-react/images/maximize.png') no-repeat center; } .flexlayout__tab_toolbar_button-max { @@ -759,7 +750,6 @@ ul.lm_tabs::before { height: 20px; border: none; outline-width: 0; - // background: transparent url('../../../../node_modules/flexlayout-react/images/restore.png') no-repeat center; } .flexlayout__popup_menu_item { @@ -877,11 +867,6 @@ ul.lm_tabs::before { height: 8px; } - .flexlayout__border_button:hover .flexlayout__border_button_trailing, - .flexlayout__border_button--selected .flexlayout__border_button_trailing { - // background: transparent url('../../../../node_modules/flexlayout-react/images/close_white.png') no-repeat center; - } - .flexlayout__border_toolbar_left { position: absolute; display: flex; diff --git a/src/client/views/search/IconButton.tsx b/src/client/views/search/IconButton.tsx index 9aae347e7..e12e4511c 100644 --- a/src/client/views/search/IconButton.tsx +++ b/src/client/views/search/IconButton.tsx @@ -8,7 +8,6 @@ import '../global/globalCssVariables.scss'; import { IconBar } from './IconBar'; import './IconButton.scss'; import './SearchBox.scss'; -import { Font } from '@react-pdf/renderer'; interface iconButtonProps { type: string; @@ -60,29 +59,18 @@ export class IconButton extends React.Component<iconButtonProps> { @action.bound getIcon() { switch (this.props.type) { - case DocumentType.NONE: - return 'ban'; - case DocumentType.AUDIO: - return 'music'; - case DocumentType.COL: - return 'object-group'; - case DocumentType.IMG: - return 'image'; - case DocumentType.LINK: - return 'link'; - case DocumentType.PDF: - return 'file-pdf'; - case DocumentType.RTF: - return 'sticky-note'; - case DocumentType.VID: - return 'video'; - case DocumentType.WEB: - return 'globe-asia'; - case DocumentType.MAP: - return 'map-marker-alt'; - default: - return 'caret-down'; - } + case DocumentType.NONE: return 'ban'; + case DocumentType.AUDIO: return 'music'; + case DocumentType.COL: return 'object-group'; + case DocumentType.IMG: return 'image'; + case DocumentType.LINK: return 'link'; + case DocumentType.PDF: return 'file-pdf'; + case DocumentType.RTF: return 'sticky-note'; + case DocumentType.VID: return 'video'; + case DocumentType.WEB: return 'globe-asia'; + case DocumentType.MAP: return 'map-marker-alt'; + default: return 'caret-down'; + } // prettier-ignore } @action.bound diff --git a/src/fields/ScriptField.ts b/src/fields/ScriptField.ts index 03dc71c48..85cc88a87 100644 --- a/src/fields/ScriptField.ts +++ b/src/fields/ScriptField.ts @@ -45,12 +45,12 @@ const scriptSchema = createSimpleSchema({ function finalizeScript(script: ScriptField) { const comp = CompileScript(script.script.originalScript, script.script.options); if (!comp.compiled) { - // throw new Error("Couldn't compile loaded script"); + throw new Error("Couldn't compile loaded script"); } if (script.setterscript) { const compset = CompileScript(script.setterscript?.originalScript, script.setterscript.options); if (!compset.compiled) { - // throw new Error("Couldn't compile setter script"); + throw new Error("Couldn't compile setter script"); } (script as any).setterscript = compset; } |