mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-16 16:04:56 +00:00
选择图片时总是打开安装的目录, 附件, save as
https://github.com/leanote/desktop-app/issues/62
This commit is contained in:
2
node_modules/gui.js
generated
vendored
2
node_modules/gui.js
generated
vendored
@@ -7,7 +7,7 @@ var gui = {
|
|||||||
Menu: Menu,
|
Menu: Menu,
|
||||||
MenuItem: MenuItem,
|
MenuItem: MenuItem,
|
||||||
remote: remote,
|
remote: remote,
|
||||||
|
app: remote.require('app'),
|
||||||
dialog: dialog,
|
dialog: dialog,
|
||||||
|
|
||||||
getSeparatorMenu: function() {
|
getSeparatorMenu: function() {
|
||||||
|
@@ -118,7 +118,7 @@ function Menu() {
|
|||||||
downloadImgPath = curPath;
|
downloadImgPath = curPath;
|
||||||
|
|
||||||
// title不能设置
|
// 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) {
|
if(targetPath) {
|
||||||
|
|
||||||
FileService.download(curPath, targetPath, function(ok, msg) {
|
FileService.download(curPath, targetPath, function(ok, msg) {
|
||||||
|
@@ -2304,7 +2304,7 @@ var Attach = {
|
|||||||
var attachId = $li.data("id");
|
var attachId = $li.data("id");
|
||||||
var title = $li.find('.attach-title').text();
|
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) {
|
if(targetPath) {
|
||||||
var curAttach = me.getAttach(attachId);
|
var curAttach = me.getAttach(attachId);
|
||||||
if(curAttach) {
|
if(curAttach) {
|
||||||
@@ -2364,6 +2364,7 @@ var Attach = {
|
|||||||
$('#chooseFile').click(function() {
|
$('#chooseFile').click(function() {
|
||||||
gui.dialog.showOpenDialog(gui.getCurrentWindow(),
|
gui.dialog.showOpenDialog(gui.getCurrentWindow(),
|
||||||
{
|
{
|
||||||
|
defaultPath: gui.app.getPath('userDesktop'),
|
||||||
properties: ['openFile', 'multiSelections']
|
properties: ['openFile', 'multiSelections']
|
||||||
},
|
},
|
||||||
function(paths) {
|
function(paths) {
|
||||||
|
@@ -474,10 +474,12 @@ function pasteImage(e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 插入本地图片
|
// 插入本地图片
|
||||||
|
// tinymce image插件调用
|
||||||
function insertLocalImage() {
|
function insertLocalImage() {
|
||||||
gui.dialog.showOpenDialog(gui.getCurrentWindow(),
|
gui.dialog.showOpenDialog(gui.getCurrentWindow(),
|
||||||
{
|
{
|
||||||
properties: ['openFile', 'multiSelections'],
|
properties: ['openFile', 'multiSelections'],
|
||||||
|
defaultPath: gui.app.getPath('userDesktop'),
|
||||||
filters: [
|
filters: [
|
||||||
{ name: 'Images', extensions: ['jpg', 'jpeg', 'png', 'gif', 'bmp'] }
|
{ name: 'Images', extensions: ['jpg', 'jpeg', 'png', 'gif', 'bmp'] }
|
||||||
]
|
]
|
||||||
|
Reference in New Issue
Block a user