diff --git a/node_modules/gui.js b/node_modules/gui.js index ac3be111..6616c634 100644 --- a/node_modules/gui.js +++ b/node_modules/gui.js @@ -7,7 +7,7 @@ var gui = { Menu: Menu, MenuItem: MenuItem, remote: remote, - + app: remote.require('app'), dialog: dialog, getSeparatorMenu: function() { diff --git a/public/js/app/native.js b/public/js/app/native.js index 1eb62c12..7354e0b7 100644 --- a/public/js/app/native.js +++ b/public/js/app/native.js @@ -118,7 +118,7 @@ function Menu() { downloadImgPath = curPath; // title不能设置 - gui.dialog.showSaveDialog(gui.getCurrentWindow(), {title: name, defaultPath: name}, function(targetPath) { + gui.dialog.showSaveDialog(gui.getCurrentWindow(), {title: name, defaultPath: gui.app.getPath('userDesktop') + '/' + name}, function(targetPath) { if(targetPath) { FileService.download(curPath, targetPath, function(ok, msg) { diff --git a/public/js/app/note.js b/public/js/app/note.js index d3d965c4..b6a14364 100644 --- a/public/js/app/note.js +++ b/public/js/app/note.js @@ -2304,7 +2304,7 @@ var Attach = { var attachId = $li.data("id"); var title = $li.find('.attach-title').text(); - gui.dialog.showSaveDialog(gui.getCurrentWindow(), {title: title, defaultPath: title}, function(targetPath) { + gui.dialog.showSaveDialog(gui.getCurrentWindow(), {title: title, defaultPath: gui.app.getPath('userDesktop') + '/' + title}, function(targetPath) { if(targetPath) { var curAttach = me.getAttach(attachId); if(curAttach) { @@ -2364,6 +2364,7 @@ var Attach = { $('#chooseFile').click(function() { gui.dialog.showOpenDialog(gui.getCurrentWindow(), { + defaultPath: gui.app.getPath('userDesktop'), properties: ['openFile', 'multiSelections'] }, function(paths) { diff --git a/public/js/common.js b/public/js/common.js index d7edf5b9..3f84b3da 100644 --- a/public/js/common.js +++ b/public/js/common.js @@ -474,10 +474,12 @@ function pasteImage(e) { } // 插入本地图片 +// tinymce image插件调用 function insertLocalImage() { gui.dialog.showOpenDialog(gui.getCurrentWindow(), { properties: ['openFile', 'multiSelections'], + defaultPath: gui.app.getPath('userDesktop'), filters: [ { name: 'Images', extensions: ['jpg', 'jpeg', 'png', 'gif', 'bmp'] } ]