@jupyterlab/docmanager
Advanced tools
Comparing version 0.17.0-0 to 0.17.0-1
@@ -90,3 +90,3 @@ "use strict"; | ||
let ext = coreutils_1.PathExt.extname(oldPath); | ||
let value = this.inputNode.value = coreutils_1.PathExt.basename(oldPath); | ||
let value = (this.inputNode.value = coreutils_1.PathExt.basename(oldPath)); | ||
this.inputNode.setSelectionRange(0, value.length - ext.length); | ||
@@ -93,0 +93,0 @@ } |
@@ -5,3 +5,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const coreutils_1 = require("@jupyterlab/coreutils"); | ||
const coreutils_1 = require("@phosphor/coreutils"); | ||
const docregistry_1 = require("@jupyterlab/docregistry"); | ||
@@ -182,5 +182,8 @@ const algorithm_1 = require("@phosphor/algorithm"); | ||
deleteFile(path) { | ||
return this.services.sessions.stopIfNeeded(path).then(() => { | ||
return this.services.sessions | ||
.stopIfNeeded(path) | ||
.then(() => { | ||
return this.services.contents.delete(path); | ||
}).then(() => { | ||
}) | ||
.then(() => { | ||
this._contextsForPath(path).forEach(context => this._widgetManager.deleteWidgets(context)); | ||
@@ -284,7 +287,9 @@ return Promise.resolve(void 0); | ||
// not exist, and then renaming to the new path. | ||
const tempPath = `${newPath}.${coreutils_1.uuid()}`; | ||
const tempPath = `${newPath}.${coreutils_1.UUID.uuid4()}`; | ||
const cb = () => this.rename(tempPath, newPath); | ||
return this.rename(oldPath, tempPath).then(() => { | ||
return this.rename(oldPath, tempPath) | ||
.then(() => { | ||
return this.deleteFile(newPath); | ||
}).then(cb, cb); | ||
}) | ||
.then(cb, cb); | ||
} | ||
@@ -421,3 +426,5 @@ /** | ||
// If the initial opening of the context fails, dispose of the widget. | ||
ready.catch(err => { widget.close(); }); | ||
ready.catch(err => { | ||
widget.close(); | ||
}); | ||
return widget; | ||
@@ -424,0 +431,0 @@ } |
@@ -110,3 +110,5 @@ "use strict"; | ||
let start = new Date().getTime(); | ||
context.save().then(() => { | ||
context | ||
.save() | ||
.then(() => { | ||
if (this.isDisposed) { | ||
@@ -120,3 +122,4 @@ return; | ||
this._setTimer(); | ||
}).catch(err => { | ||
}) | ||
.catch(err => { | ||
// If the user canceled the save, do nothing. | ||
@@ -123,0 +126,0 @@ if (err.message === 'Cancel') { |
@@ -214,3 +214,5 @@ "use strict"; | ||
} | ||
context.listCheckpoints().then((checkpoints) => { | ||
context | ||
.listCheckpoints() | ||
.then((checkpoints) => { | ||
if (widget.isDisposed) { | ||
@@ -226,4 +228,5 @@ return; | ||
else { | ||
caption += (`Last Saved: ${coreutils_1.Time.format(model.last_modified)}\n` + | ||
`Last Checkpoint: ${checkpoint}`); | ||
caption += | ||
`Last Saved: ${coreutils_1.Time.format(model.last_modified)}\n` + | ||
`Last Checkpoint: ${checkpoint}`; | ||
} | ||
@@ -242,3 +245,4 @@ widget.title.caption = caption; | ||
// Handle dirty state. | ||
return this._maybeClose(widget).then(result => { | ||
return this._maybeClose(widget) | ||
.then(result => { | ||
if (widget.isDisposed) { | ||
@@ -251,3 +255,4 @@ return true; | ||
return result; | ||
}).catch(error => { | ||
}) | ||
.catch(error => { | ||
widget.dispose(); | ||
@@ -335,3 +340,5 @@ throw error; | ||
let widgets = Private.widgetsProperty.get(context); | ||
algorithm_1.each(widgets, widget => { this.setCaption(widget); }); | ||
algorithm_1.each(widgets, widget => { | ||
this.setCaption(widget); | ||
}); | ||
} | ||
@@ -343,3 +350,5 @@ /** | ||
let widgets = Private.widgetsProperty.get(context); | ||
algorithm_1.each(widgets, widget => { this.setCaption(widget); }); | ||
algorithm_1.each(widgets, widget => { | ||
this.setCaption(widget); | ||
}); | ||
} | ||
@@ -346,0 +355,0 @@ } |
{ | ||
"name": "@jupyterlab/docmanager", | ||
"version": "0.17.0-0", | ||
"version": "0.17.0-1", | ||
"description": "JupyterLab - Document Manager", | ||
@@ -32,6 +32,6 @@ "homepage": "https://github.com/jupyterlab/jupyterlab", | ||
"dependencies": { | ||
"@jupyterlab/apputils": "^0.17.0-0", | ||
"@jupyterlab/coreutils": "^2.0.0-0", | ||
"@jupyterlab/docregistry": "^0.17.0-0", | ||
"@jupyterlab/services": "^3.0.0-0", | ||
"@jupyterlab/apputils": "^0.17.0-1", | ||
"@jupyterlab/coreutils": "^2.0.0-1", | ||
"@jupyterlab/docregistry": "^0.17.0-1", | ||
"@jupyterlab/services": "^3.0.0-1", | ||
"@phosphor/algorithm": "^1.1.2", | ||
@@ -38,0 +38,0 @@ "@phosphor/coreutils": "^1.3.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
123654
1723