jupyter-js-filebrowser
Advanced tools
Comparing version 0.2.2 to 0.2.3
// Copyright (c) Jupyter Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||
'use strict'; | ||
var jupyter_js_editor_1 = require('jupyter-js-editor'); | ||
var jupyter_js_services_1 = require('jupyter-js-services'); | ||
@@ -22,2 +23,3 @@ var jupyter_js_utils_1 = require('jupyter-js-utils'); | ||
FileBrowserHandler.prototype.run = function () { | ||
var _this = this; | ||
var baseUrl = jupyter_js_utils_1.getConfigOption('baseUrl'); | ||
@@ -29,2 +31,11 @@ var contents = new jupyter_js_services_1.ContentsManager(baseUrl); | ||
fileBrowser.title.text = 'File Browser'; | ||
fbModel.changed.connect(function (fb, change) { | ||
if (change.name === 'open' && change.newValue.type === 'file') { | ||
var options = { filename: change.newValue.name, | ||
text: change.newValue.content }; | ||
var editorModel = new jupyter_js_editor_1.EditorViewModel(options); | ||
var editor = new jupyter_js_editor_1.CodeMirrorWidget(editorModel); | ||
_this._shell.addToMainArea(editor); | ||
} | ||
}); | ||
this._shell.addToLeftArea(fileBrowser, { rank: 10 }); | ||
@@ -31,0 +42,0 @@ }; |
{ | ||
"name": "jupyter-js-filebrowser", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "File browser widget for Jupyter", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
94122
2676