<commit_before>/**
 * This is the entry point for the Narrative's front-end. It initializes
 * the login session, fires up the data and function widgets, and creates
 * the kbaseNarrativeWorkspace wrapper around the IPython notebook that 
 * does fun things like manage widgets and cells and kernel events to talk to them.
 */
"use strict";


var narrative = {};
narrative.init = function() {
    var token = null;
    var narr_ws = null;

    var versionStr = 'KBase Narrative<br>Alpha version';
    if (window.kbconfig && 
        window.kbconfig.name && 
        window.kbconfig.version)
        versionStr = window.kbconfig.name + '<br>' + window.kbconfig.version;
    $('.version-stamp').empty().html(versionStr);

    var dataWidget = $('#kb-ws').kbaseWorkspaceDataDeluxe();
    dataWidget.showLoadingMessage('Waiting for Narrative to finish loading...');

    var functionWidget = $('#kb-function-panel').kbaseNarrativeFunctionPanel({ autopopulate: false });
    functionWidget.refreshAJAX();

    /*
     * Once everything else is loaded and the Kernel is idle,
     * Go ahead and fill in the rest of the Javascript stuff.
     */
    $([IPython.events]).one('status_started.Kernel', function() {
        // NAR-271 - Firefox needs to be told where the top of the page is. :P
        window.scrollTo(0,0);

        var workspaceId = null;
        if (IPython && IPython.notebook && IPython.notebook.metadata) {
            workspaceId = IPython.notebook.metadata.ws_name;                
        }

        IPython.notebook.set_autosave_interval(0);

        if (workspaceId) {
            $('a#workspace-link').attr('href', $('a#workspace-link').attr('href') + 'objtable/' + workspaceId);
            dataWidget.setWorkspace(workspaceId);
        }

        // Should be renamed.... eventually?
        narr_ws = $('#notebook_panel').kbaseNarrativeWorkspace({
            loadingImage: "/static/kbase/images/ajax-loader.gif",
            ws_id: IPython.notebook.metadata.ws_name
        });
    });
};<commit_msg>Updated workspace link within Narrative<commit_after>/**
 * This is the entry point for the Narrative's front-end. It initializes
 * the login session, fires up the data and function widgets, and creates
 * the kbaseNarrativeWorkspace wrapper around the IPython notebook that 
 * does fun things like manage widgets and cells and kernel events to talk to them.
 */
"use strict";


var narrative = {};
narrative.init = function() {
    var token = null;
    var narr_ws = null;

    var versionStr = 'KBase Narrative<br>Alpha version';
    if (window.kbconfig && 
        window.kbconfig.name && 
        window.kbconfig.version)
        versionStr = window.kbconfig.name + '<br>' + window.kbconfig.version;
    $('.version-stamp').empty().html(versionStr);

    var dataWidget = $('#kb-ws').kbaseWorkspaceDataDeluxe();
    dataWidget.showLoadingMessage('Waiting for Narrative to finish loading...');

    var functionWidget = $('#kb-function-panel').kbaseNarrativeFunctionPanel({ autopopulate: false });
    functionWidget.refreshAJAX();

    /*
     * Once everything else is loaded and the Kernel is idle,
     * Go ahead and fill in the rest of the Javascript stuff.
     */
    $([IPython.events]).one('status_started.Kernel', function() {
        // NAR-271 - Firefox needs to be told where the top of the page is. :P
        window.scrollTo(0,0);

        var workspaceId = null;
        if (IPython && IPython.notebook && IPython.notebook.metadata) {
            workspaceId = IPython.notebook.metadata.ws_name;                
        }

        IPython.notebook.set_autosave_interval(0);

        if (workspaceId) {
            $('a#workspace-link').attr('href', $('a#workspace-link').attr('href') + 'objects/' + workspaceId);
            dataWidget.setWorkspace(workspaceId);
        }

        // Should be renamed.... eventually?
        narr_ws = $('#notebook_panel').kbaseNarrativeWorkspace({
            loadingImage: "/static/kbase/images/ajax-loader.gif",
            ws_id: IPython.notebook.metadata.ws_name
        });
    });
};
{'fraction_non_alphanumeric': 0.12429378531073447, 'fraction_numerical': 0.0029476787030213707, 'mean_word_length': 2.7949673811742777, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3756439', 'n_tokens_mistral': 1208, 'n_tokens_neox': 1173, 'n_words': 310}