How to use the base/js/utils.url_join_encode function in base

To help you get started, we’ve selected a few base 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 jupyter / notebook / notebook / static-src / services / kernels / kernel.js View on Github external
Kernel.prototype.interrupt = function (success, error) {
        this.events.trigger('kernel_interrupting.Kernel', {kernel: this});

        var that = this;
        var on_success = function (data, status, xhr) {
            /**
             * get kernel info so we know what state the kernel is in
             */
            that.kernel_info();
            if (success) {
                success(data, status, xhr);
            }
        };

        var url = utils.url_join_encode(this.kernel_url, 'interrupt');
        $.ajax(url, {
            processData: false,
            cache: false,
            type: "POST",
            contentType: false,  // there's no data with this
            dataType: "json",
            success: this._on_success(on_success),
            error: this._on_error(error)
        });
    };
github jupyter / notebook / notebook / static-src / edit / js / savewidget.js View on Github external
SaveWidget.prototype.update_address_bar = function (path) {
        var state = {path : path};
        window.history.replaceState(state, "", utils.url_join_encode(
            this.editor.base_url,
            "edit",
            path)
        );
    };
github jupyter / notebook / notebook / static-src / tree / js / terminallist.js View on Github external
TerminalList.prototype.load_terminals = function() {
        var url = utils.url_join_encode(this.base_url, 'api/terminals');
        $.ajax(url, {
            type: "GET",
            cache: false,
            dataType: "json",
            success: $.proxy(this.terminals_loaded, this),
            error : utils.log_ajax_error
        });
    };
github jupyter / notebook / notebook / static-src / tree / js / terminallist.js View on Github external
TerminalList.prototype.add_link = function(name, item) {
        item.data('term-name', name);
        item.find(".item_name").text("terminals/" + name);
        item.find(".item_icon").addClass("fa fa-terminal");
        var link = item.find("a.item_link")
            .attr('href', utils.url_join_encode(this.base_url, "terminals", name));
        link.attr('target', IPython._target||'_blank');
        this.add_shutdown_button(name, item);
    };
github jupyter / notebook / notebook / static-src / notebook / js / menubar.js View on Github external
MenuBar.prototype._nbconvert = function (format, download) {
        download = download || false;
        var notebook_path = this.notebook.notebook_path;
        var url = utils.url_join_encode(
            this.base_url,
            'nbconvert',
            format,
            notebook_path
        ) + "?download=" + download.toString();
        
        var w = window.open('', IPython._target);
        if (this.notebook.dirty) {
            this.notebook.save_notebook().then(function() {
                w.location = url;
            });
        } else {
            w.location = url;
        }
    };
github ipython / ipython / IPython / html / static / notebook / js / notebook.js View on Github external
function (data) {
                w.location = utils.url_join_encode(
                    base_url, 'notebooks', data.path
                );
            },
            function(error) {
github jupyter / notebook / notebook / static-src / notebook / js / kernelselector.js View on Github external
function (data) {
                var url = utils.url_join_encode(
                    that.notebook.base_url, 'notebooks', data.path
                );
                url += "?kernel_name=" + kernel_name;
                w.location = url;
            },
            function(error) {
github jupyter / notebook / notebook / static-src / notebook / js / savewidget.js View on Github external
SaveWidget.prototype.update_address_bar = function(){
        var base_url = this.notebook.base_url;
        var path = this.notebook.notebook_path;
        var state = {path : path};
        window.history.replaceState(state, "", utils.url_join_encode(
            base_url,
            "notebooks",
            path)
        );
    };
github jupyter / notebook / notebook / static-src / services / sessions / session.js View on Github external
Session.prototype._update_model = function (data) {
        if (data && data.id) {
            this.id = data.id;
            this.session_url = utils.url_join_encode(this.session_service_url, this.id);
        }
        if (data && data.notebook) {
            this.notebook_model.path = data.notebook.path;
        }
        if (data && data.kernel) {
            this.kernel_model.name = data.kernel.name;
            this.kernel_model.id = data.kernel.id;
        }
    };
github jupyter / notebook / notebook / static-src / services / config.js View on Github external
ConfigSection.prototype.api_url = function() {
        return utils.url_join_encode(this.base_url, 'api/config', this.section_name);
    };