Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tareqimbasher committed Nov 16, 2023
1 parent a388f97 commit 96210dc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
17 changes: 10 additions & 7 deletions src/Apps/NetPad.Apps.App/App/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,25 @@ import {AppLifeCycle} from "./main.app-lifecycle";
import {IPlatform} from "@application/platforms/iplatform";
import {SettingsBackgroundService} from "@application/background-services/settings-background-service";

// Register common dependencies shared for all windows
// Register common dependencies shared for all windows/apps
const builder = Aurelia.register(
Registration.instance(String, window.location.origin),
Registration.instance(URLSearchParams, new URLSearchParams(window.location.search)),
Registration.instance(Settings, new Settings()),
Registration.singleton(IAppService, AppService),
Registration.singleton(IIpcGateway, SignalRIpcGateway),
Registration.singleton(IEventBus, EventBus),
Registration.singleton(ISession, Session),
Registration.singleton(ISettingsService, SettingsService),
Registration.singleton(AppMutationObserver, AppMutationObserver),
Registration.singleton(IBackgroundService, SettingsBackgroundService),

// The default main IPC gateway the app will use. Can be configured for each platform separately
Registration.singleton(IIpcGateway, SignalRIpcGateway),

DialogDefaultConfiguration.customize((config) => {
config.lock = true;
}),

LogConfig.register({
colorOptions: ColorOptions.colors,
level: Env.isProduction ? LogLevel.info : LogLevel.debug,
Expand Down Expand Up @@ -103,10 +110,6 @@ const builder = Aurelia.register(

]
}),
DialogDefaultConfiguration.customize((config) => {
config.lock = true;
}),


// Global Custom Attributes
ExternalLinkCustomAttribute,
Expand Down Expand Up @@ -162,6 +165,6 @@ const app = builder.app(entryPoint);

await app.start();

window.addEventListener("beforeunload", (e) => app.stop(true));
window.addEventListener("beforeunload", () => app.stop(true));

logger.debug("App started");
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
<div class="actions pe-1">
<div repeat.for="action of options.actions"
class="action ${action.actions ? 'has-actions': ''}"
show.bind="!action.show || action.show()"
show.bind="action.show === undefined || action.show"
title.bind="action.label">
<i class="${action.icon} ${action.clicked ? 'action-icon' : ''} ${action.active ? 'active' : ''}"
if.bind="!action.actions"
click.trigger="actionClicked(action, $event)"></i>
<div if.bind="!action.actions" click.trigger="actionClicked(action, $event)">
<i class="${action.icon} ${action.clicked ? 'action-icon' : ''} ${action.active ? 'active' : ''}"
if.bind="action.icon"></i>
<span else>
${action.label}
</span>
</div>
<div else class="p-2 ps-3 pe-3 me-1" data-bs-toggle="dropdown">
<span class="dropdown-toggle">
${action.label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export interface IToolbarTab {
text: string;
icon?: string;
active?: boolean;
show?: () => boolean;
clicked?: (event: MouseEvent) => Promise<void>;
view: OutputViewBase
}
Expand All @@ -19,7 +18,7 @@ export interface IToolbarAction {
icon?: string;
label?: string;
active?: boolean;
show?: () => boolean;
show?: boolean;
clicked?: (event: MouseEvent) => Promise<void>;
actions?: IToolbarAction[];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<span show.bind="activeEnvironment.status !== 'Running' && activeEnvironment.runDurationMilliseconds"
title="The time it took to run the script (in milliseconds).
This includes the time it took to start the host process.">
(Took: ${activeEnvironment.runDurationMilliseconds} ms)
(Took: ${activeEnvironment.runDurationMilliseconds}ms)
</span>
</div>
<div class="middle-column">
Expand Down

0 comments on commit 96210dc

Please sign in to comment.