Skip to content

Commit

Permalink
Resolve static file to full path using the baseUrl (jupyter-server#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
sathishlxg authored and GitHub Enterprise committed Mar 7, 2022
1 parent 06864a4 commit 7520575
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/pixiedustshim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { ICellModel, ICodeCellModel } from '@jupyterlab/cells';
import { INotebookTracker, NotebookPanel } from '@jupyterlab/notebook';
import { ExperimentalRenderedJavascript } from '@jupyterlab/javascript-extension';
import { resourceLoader, overrideCssScope, findStyleSheetByUrl } from './utils';
import { PageConfig, URLExt } from '@jupyterlab/coreutils';

const PIXIEDUST = 'pixiedust';

Expand Down Expand Up @@ -474,12 +475,19 @@ export const NotebookPixiedustShimPlugin: JupyterFrontEndPlugin<void> = {
autoStart: true,
requires: [INotebookTracker],
activate: (app: JupyterFrontEnd, tracker: INotebookTracker) => {
const scripts = ['/static/notebook/components/requirejs/require.js'];
const baseUrl = PageConfig.getBaseUrl();
const getFullPath = (path: string) => URLExt.join(baseUrl, path);

const scripts = [
getFullPath('/static/notebook/components/requirejs/require.js')
];

// Important: Do not change the css load order
const css = [
'/static/notebook/style/style.min.css',
'/static/notebook/components/jquery-ui/themes/smoothness/jquery-ui.min.css'
getFullPath('/static/notebook/style/style.min.css'),
getFullPath(
'/static/notebook/components/jquery-ui/themes/smoothness/jquery-ui.min.css'
)
];

_addNotebookShim(tracker);
Expand Down

0 comments on commit 7520575

Please sign in to comment.