Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} catch (error) {
return; // Ignore calls to dismiss the dialog if there is no dialog.
}
const node = host.getElementsByClassName('jp-Dialog')[0];
if (node) {
simulate(node as HTMLElement, 'keydown', { keyCode: 27 });
}
}
/**
* A namespace for private data.
*/
namespace Private {
export const manager = new ServiceManager();
export const textFactory = new TextModelFactory();
export const notebookFactory = new NotebookModelFactory({});
class JSONRenderer extends RenderedHTML {
mimeType = 'text/html';
renderModel(model: IRenderMime.IMimeModel): Promise {
let source = model.data['application/json'];
model.setData({ data: { 'text/html': json2html(source) } });
return super.renderModel(model);
}
}
const jsonRendererFactory = {
before(async () => {
const opener: DocumentManager.IWidgetOpener = {
open: widget => {
/* no op */
}
};
registry = new DocumentRegistry({
textModelFactory: new TextModelFactory()
});
serviceManager = new ServiceManager({ standby: 'never' });
iconRegistry = defaultIconRegistry;
manager = new DocumentManager({
registry,
opener,
manager: serviceManager
});
const contents = serviceManager.contents;
let cModel = await contents.newUntitled({ type: 'directory' });
first = cModel.name;
cModel = await contents.newUntitled({
path: cModel.path,
type: 'directory'
});
second = cModel.name;
cModel = await contents.newUntitled({
// let opener = {
// open: (widget: Widget) => {
// if (widgets.indexOf(widget) === -1) {
// dock.addWidget(widget, { mode: 'tab-after' });
// widgets.push(widget);
// }
// dock.activateWidget(widget);
// activeWidget = widget;
// widget.disposed.connect((w: Widget) => {
// let index = widgets.indexOf(w);
// widgets.splice(index, 1);
// });
// }
// };
let serviceManager = new ServiceManager();
// let docRegistry = new DocumentRegistry();
// let docManager = new DocumentManager({
// registry: docRegistry,
// manager: serviceManager,
// opener
// });
// let context = new Context({
// manager: serviceManager
// })
// let widget = new Widget()
// docManager
// docRegistry.addWidgetExtension('Notebook', new NBWidgetExtension())
export function getManager(): ServiceManager {
if (!manager) {
manager = new ServiceManager({ standby: 'never' });
}
return manager;
}
}
beforeAll(() => {
manager = new ServiceManager({ standby: 'never' });
return manager.ready;
});
beforeAll(() => {
manager = new ServiceManager({ standby: 'never' });
return manager.ready;
});
before((done) => {
const manager = new ServiceManager();
contents = manager.contents;
manager.ready.then(() => {
return manager.sessions.startNew({ path: './urlresolver' });
}).then(s => {
session = s;
resolver = new RenderMime.UrlResolver({
session,
contents: manager.contents
});
}).then(done, done);
});
before((done) => {
const manager = new ServiceManager();
contents = manager.contents;
manager.ready.then(() => {
return manager.sessions.startNew({ path: './urlresolver' });
}).then(s => {
session = s;
resolver = new RenderMime.UrlResolver({
session,
contents: manager.contents
});
}).then(done, done);
});
before(() => {
manager = new ServiceManager();
return manager.ready.then(() => {
return manager.contents.save(FILE.path, FILE);
});
});
function main(): void {
let manager = new ServiceManager();
void manager.ready.then(() => {
createApp(manager);
});
}