Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions python/jupytergis_core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"access": "public"
},
"jupyterlab": {
"schemaDir": "schema",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 17 of this file, you want to list the schema folder as part of the package file

"discovery": {
"server": {
"managers": [
Expand Down
13 changes: 13 additions & 0 deletions python/jupytergis_core/schema/jupytergis-settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"title": "JupyterGIS Settings",
"description": "Settings for the JupyterGIS extension.",
"type": "object",
"properties": {
"proxyUrl": {
"type": "string",
"title": "Proxy URL",
"description": "The proxy URL to use for external requests.",
"default": "https://corsproxy.io/"
}
}
}
15 changes: 12 additions & 3 deletions python/jupytergis_core/src/jgisplugin/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { PageConfig } from '@jupyterlab/coreutils';
import { IFileBrowserFactory } from '@jupyterlab/filebrowser';
import { ILauncher } from '@jupyterlab/launcher';
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
import { ISettingRegistry } from '@jupyterlab/settingregistry';

import { CommandIDs, logoIcon, logoMiniIcon } from '@jupytergis/base';
import { JupyterGISDocumentWidgetFactory } from '../factory';
Expand All @@ -36,8 +37,9 @@ const FACTORY = 'JupyterGIS .jgis Viewer';
const CONTENT_TYPE = 'jgis';
const PALETTE_CATEGORY = 'JupyterGIS';
const MODEL_NAME = 'jupytergis-jgismodel';
const SETTINGS_ID = 'jupytergis_core:jupytergis-settings';

const activate = (
const activate = async (
app: JupyterFrontEnd,
tracker: WidgetTracker<IJupyterGISWidget>,
themeManager: IThemeManager,
Expand All @@ -48,13 +50,19 @@ const activate = (
rendermime: IRenderMimeRegistry,
consoleTracker: IConsoleTracker,
annotationModel: IAnnotationModel,
settingRegistry: ISettingRegistry,
launcher: ILauncher | null,
palette: ICommandPalette | null,
drive: ICollaborativeDrive | null
): void => {
): Promise<void> => {
if (PageConfig.getOption('jgis_expose_maps')) {
window.jupytergisMaps = {};
}
const setting = await settingRegistry.load(SETTINGS_ID);
setting.changed.connect(() => {
const newSettings = setting.composite as any;
console.log('Settings updated:', newSettings);
});

const widgetFactory = new JupyterGISDocumentWidgetFactory({
name: FACTORY,
Expand Down Expand Up @@ -270,7 +278,8 @@ const jGISPlugin: JupyterFrontEndPlugin<void> = {
IEditorServices,
IRenderMimeRegistry,
IConsoleTracker,
IAnnotationToken
IAnnotationToken,
ISettingRegistry
],
optional: [ILauncher, ICommandPalette, ICollaborativeDrive],
autoStart: true,
Expand Down
Loading