@jupyter/docprovider-extension 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/filebrowser.js +27 -17
- package/package.json +3 -3
package/lib/filebrowser.js
CHANGED
|
@@ -105,21 +105,23 @@ export const statusBarTimeline = {
|
|
|
105
105
|
let sliderItem = null;
|
|
106
106
|
let timelineWidget = null;
|
|
107
107
|
const updateTimelineForDocument = async (documentPath, documentId) => {
|
|
108
|
-
if (
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
timelineWidget
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
108
|
+
if (documentId && documentPath.split(':')[0] === 'RTC') {
|
|
109
|
+
if (drive) {
|
|
110
|
+
// Remove 'RTC:' from document path
|
|
111
|
+
documentPath = documentPath.slice(drive.name.length + 1);
|
|
112
|
+
// Dispose of the previous timelineWidget if it exists
|
|
113
|
+
if (timelineWidget) {
|
|
114
|
+
timelineWidget.dispose();
|
|
115
|
+
timelineWidget = null;
|
|
116
|
+
}
|
|
117
|
+
const [format, type] = documentId.split(':');
|
|
118
|
+
const provider = drive.providers.get(`${format}:${type}:${documentPath}`);
|
|
119
|
+
const fullPath = URLExt.join(app.serviceManager.serverSettings.baseUrl, DOCUMENT_TIMELINE_URL, documentPath);
|
|
120
|
+
timelineWidget = new TimelineWidget(fullPath, provider, provider.contentType, provider.format, DOCUMENT_TIMELINE_URL);
|
|
121
|
+
const elt = document.getElementById('jp-slider-status-bar');
|
|
122
|
+
if (elt && !timelineWidget.isAttached) {
|
|
123
|
+
Widget.attach(timelineWidget, elt);
|
|
124
|
+
}
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
127
|
};
|
|
@@ -148,8 +150,16 @@ export const statusBarTimeline = {
|
|
|
148
150
|
align: 'left',
|
|
149
151
|
rank: 4,
|
|
150
152
|
isActive: () => {
|
|
151
|
-
const currentWidget = app.shell
|
|
152
|
-
|
|
153
|
+
const currentWidget = app.shell
|
|
154
|
+
.currentWidget;
|
|
155
|
+
if (currentWidget &&
|
|
156
|
+
currentWidget.context &&
|
|
157
|
+
typeof currentWidget.context.path === 'string') {
|
|
158
|
+
const documentPath = currentWidget.context.path;
|
|
159
|
+
const documentId = currentWidget.context.model.sharedModel.getState('document_id');
|
|
160
|
+
return !!documentId && documentPath.split(':')[0] === 'RTC';
|
|
161
|
+
}
|
|
162
|
+
return false;
|
|
153
163
|
}
|
|
154
164
|
});
|
|
155
165
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter/docprovider-extension",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "JupyterLab - Collaborative Shared Models",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"watch:labextension": "jupyter labextension watch ."
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@jupyter/collaborative-drive": "^3.0.
|
|
57
|
-
"@jupyter/docprovider": "^3.0.
|
|
56
|
+
"@jupyter/collaborative-drive": "^3.0.1",
|
|
57
|
+
"@jupyter/docprovider": "^3.0.1",
|
|
58
58
|
"@jupyter/ydoc": "^2.0.0 || ^3.0.0",
|
|
59
59
|
"@jupyterlab/application": "^4.2.0",
|
|
60
60
|
"@jupyterlab/apputils": "^4.2.0",
|