shared file enable

This commit is contained in:
Xuan Sang LE 2018-02-19 16:52:05 +01:00
parent e50cdc3620
commit d26e8d281c
2 changed files with 5 additions and 4 deletions

View File

@ -282,7 +282,8 @@ class FileDiaLog extends BaseDialog
location.set "items", ( i for i in @systemsetting.VFS.mountpoints when i.type isnt "app" )
location.set "selected", 0 unless location.get "selected"
fileview.set "onfileselect", (f) ->
($ filename).val f.filename if f.type is "file"
($ filename).val f.filename if f.type is "file"
(@find "bt-ok").set "onbtclick", (e) ->
f = fileview.get "selectedFile"
return me.notify "Please select a file" unless f
@ -296,7 +297,7 @@ class FileDiaLog extends BaseDialog
return me.notify "Only #{me.data.mimes.join(",")} could be selected" unless m
d = f.path
d = f.path.asFileHandler().parent() if f.type is "file"
me.handler d, ($ filename).val() if me.handler
me.handler d, ($ filename).val(), f.path if me.handler
#sel = if me.data and me.data.selection then me.data.selection else "file"
#me.handler f, ($ filename).val() if me.handler and ((f.type is sel) or (sel is "*"))
me.quit()

View File

@ -130,8 +130,8 @@ class Blogger extends this.OS.GUI.BaseApplication
name: "image",
className: "fa fa-file-image-o",
action: (e) ->
me.openDialog "FileDiaLog", (d, n) ->
"#{d}/#{n}".asFileHandler().publish (r) ->
me.openDialog "FileDiaLog", (d, n, p) ->
p.asFileHandler().publish (r) ->
return me.error "Cannot export file for embeding to text" if r.error
doc = me.editor.codemirror.getDoc()
doc.replaceSelection "![](#{me._api.handler.shared}/#{r.result})"