How to use the @jupyterlab/application.ILayoutRestorer function in @jupyterlab/application

To help you get started, we’ve selected a few @jupyterlab/application 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
github plotly / jupyterlab-dash / lib / index.js View on Github external
app.shell.activateById(widget.id);
            }
            else if (msgData.type === 'url_request') {
                const baseUrl = coreutils_1.PageConfig.getBaseUrl();
                comm.send({ type: 'url_response', url: baseUrl });
            }
        };
    });
}
/**
 * Initialization data for the jupyterlab-dash extension.
 */
const extension = {
    id: 'jupyterlab-dash',
    autoStart: true,
    requires: [application_1.ILayoutRestorer, notebook_1.INotebookTracker, console_1.IConsoleTracker],
    activate: activate
};
exports.default = extension;
github ParaToolsInc / taucmdr / jupyterlab / taucmdr_tam_pane / lib / index.js View on Github external
restorer.restore(proj_tracker, {
        command: open_project_command,
        args: function () { return coreutils_1.JSONExt.emptyObject; },
        name: function () { return 'project-view'; }
    });
    var exp_tracker = new apputils_1.InstanceTracker({ namespace: trial_widget_id });
    restorer.restore(exp_tracker, {
        command: open_experiment_command,
        args: function () { return coreutils_1.JSONExt.emptyObject; },
        name: function () { return 'experiment-view'; }
    });
}
var extension = {
    id: tam_widget_id,
    autoStart: true,
    requires: [apputils_1.ICommandPalette, application_1.ILayoutRestorer],
    activate: activate
};
exports.default = extension;