How to use the @jupyterlab/docmanager.IDocumentManager function in @jupyterlab/docmanager

To help you get started, we’ve selected a few @jupyterlab/docmanager examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github timkpaine / knowledgelab / jlab / lib / index.js View on Github external
extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
var disposable_1 = require("@phosphor/disposable");
var application_1 = require("@jupyterlab/application");
var apputils_1 = require("@jupyterlab/apputils");
var docmanager_1 = require("@jupyterlab/docmanager");
var widgets_1 = require("@phosphor/widgets");
require("../style/index.css");
var extension = {
    id: 'jupyterlab_kr',
    autoStart: true,
    requires: [docmanager_1.IDocumentManager, apputils_1.ICommandPalette, application_1.ILayoutRestorer],
    activate: activate
};
var ButtonExtension = /** @class */ (function () {
    function ButtonExtension(lab) {
        this.lab = lab;
    }
    ButtonExtension.prototype.createNew = function (panel, context) {
        var _this = this;
        var callback = function () {
            var xhr = new XMLHttpRequest();
            xhr.open("GET", "/knowledge/submit?notebook=" + panel.context.path, true);
            xhr.onload = function (e) {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        // check if exists, if so populate fields
                        //TODO