Include save file path in "Successfully Saved" popup. Show full save path under the save button. Hide the "save to browser" portion of the save panel when running in desktop mode.

This commit is contained in:
Lee Grey
2015-03-26 20:32:27 +13:00
parent 0ec3787fc4
commit f114676db7
4 changed files with 37 additions and 12 deletions

View File

@@ -31,6 +31,8 @@
if (pskl.utils.Environment.detectNodeWebkit()) {
// running in Node-Webkit...
this.saveFileButton.click(this.saveFileDesktop_.bind(this));
// hide the "save in browser" part of the gui
$('#save-in-browser').css('display', 'none');
} else {
// running in browser...
this.saveFileButton.click(this.saveFileBrowser_.bind(this));
@@ -61,9 +63,18 @@
};
ns.SaveController.prototype.updateLocalStatusFilename_ = function () {
this.saveFileStatus.html(pskl.utils.Template.getAndReplace('save-file-status-template', {
name : this.getLocalFilename_()
}));
if (pskl.utils.Environment.detectNodeWebkit()) {
var fileName = this.piskelController.getSavePath();
if (fileName !== null) {
this.saveFileStatus.html(pskl.utils.Template.getAndReplace('save-file-status-desktop-template', {
name : this.piskelController.getSavePath()
}));
}
} else {
this.saveFileStatus.html(pskl.utils.Template.getAndReplace('save-file-status-template', {
name : this.getLocalFilename_()
}));
}
};
ns.SaveController.prototype.getLocalFilename_ = function () {

View File

@@ -58,13 +58,14 @@
};
ns.DesktopStorageService.prototype.onSaveSuccess_ = function () {
var savePath = this.piskelController.getSavePath();
$.publish(Events.CLOSE_SETTINGS_DRAWER);
$.publish(Events.SHOW_NOTIFICATION, [{"content": "Successfully saved !"}]);
$.publish(Events.SHOW_NOTIFICATION, [{"content": "Successfully saved: " + savePath}]);
$.publish(Events.PISKEL_SAVED);
// clear the old time out, if any.
window.clearTimeout(this.hideNotificationTimeoutID);
this.hideNotificationTimeoutID =
window.setTimeout($.publish.bind($, Events.HIDE_NOTIFICATION), 2000);
window.setTimeout($.publish.bind($, Events.HIDE_NOTIFICATION), 3000);
};
})();