jupyter-js-filebrowser
Advanced tools
Comparing version 0.6.2 to 0.7.1
@@ -15,6 +15,2 @@ import { IContentsModel, IContentsManager } from 'jupyter-js-services'; | ||
/** | ||
* Get the currently focused widget, or `null`. | ||
*/ | ||
currentWidget: Widget; | ||
/** | ||
* Get the list of file extensions explicitly supported by the handler. | ||
@@ -28,2 +24,16 @@ */ | ||
/** | ||
* Get the current set of widgets managed by the handler. | ||
* | ||
* #### Notes | ||
* This is a read-only property | ||
*/ | ||
widgets: Widget[]; | ||
/** | ||
* Get the contents manager used by the handler. | ||
* | ||
* #### Notes | ||
* This is a read-only property | ||
*/ | ||
manager: IContentsManager; | ||
/** | ||
* A signal emitted when the file handler has finished loading the | ||
@@ -88,4 +98,4 @@ * contents of the widget. | ||
protected titleChanged(title: Title, args: IChangedArgs<any>): void; | ||
protected manager: IContentsManager; | ||
protected widgets: Widget[]; | ||
private _manager; | ||
private _widgets; | ||
} | ||
@@ -92,0 +102,0 @@ /** |
@@ -35,11 +35,11 @@ // Copyright (c) Jupyter Development Team. | ||
function AbstractFileHandler(manager) { | ||
this.widgets = []; | ||
this.manager = manager; | ||
this._widgets = []; | ||
this._manager = manager; | ||
} | ||
Object.defineProperty(AbstractFileHandler.prototype, "currentWidget", { | ||
Object.defineProperty(AbstractFileHandler.prototype, "fileExtensions", { | ||
/** | ||
* Get the currently focused widget, or `null`. | ||
* Get the list of file extensions explicitly supported by the handler. | ||
*/ | ||
get: function () { | ||
return arrays.find(this.widgets, function (w) { return w.node.contains(document.activeElement); }); | ||
return []; | ||
}, | ||
@@ -49,5 +49,5 @@ enumerable: true, | ||
}); | ||
Object.defineProperty(AbstractFileHandler.prototype, "fileExtensions", { | ||
Object.defineProperty(AbstractFileHandler.prototype, "mimeTypes", { | ||
/** | ||
* Get the list of file extensions explicitly supported by the handler. | ||
* Get the list of mime types explicitly supported by the handler. | ||
*/ | ||
@@ -60,8 +60,11 @@ get: function () { | ||
}); | ||
Object.defineProperty(AbstractFileHandler.prototype, "mimeTypes", { | ||
Object.defineProperty(AbstractFileHandler.prototype, "widgets", { | ||
/** | ||
* Get the list of mime types explicitly supported by the handler. | ||
* Get the current set of widgets managed by the handler. | ||
* | ||
* #### Notes | ||
* This is a read-only property | ||
*/ | ||
get: function () { | ||
return []; | ||
return this._widgets.slice(); | ||
}, | ||
@@ -71,2 +74,15 @@ enumerable: true, | ||
}); | ||
Object.defineProperty(AbstractFileHandler.prototype, "manager", { | ||
/** | ||
* Get the contents manager used by the handler. | ||
* | ||
* #### Notes | ||
* This is a read-only property | ||
*/ | ||
get: function () { | ||
return this._manager; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(AbstractFileHandler.prototype, "finished", { | ||
@@ -99,3 +115,3 @@ /** | ||
AbstractFileHandler.modelProperty.set(widget, model); | ||
this.widgets.push(widget); | ||
this._widgets.push(widget); | ||
phosphor_messaging_1.installMessageFilter(widget, this); | ||
@@ -142,3 +158,3 @@ this.getContents(model).then(function (contents) { | ||
widget.dispose(); | ||
this.widgets.splice(index, 1); | ||
this._widgets.splice(index, 1); | ||
return true; | ||
@@ -145,0 +161,0 @@ }; |
{ | ||
"name": "jupyter-js-filebrowser", | ||
"version": "0.6.2", | ||
"version": "0.7.1", | ||
"description": "File browser widget for Jupyter", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
133360
3826