shared file enable

This commit is contained in:
Xuan Sang LE
2018-02-19 16:45:18 +01:00
parent 564df6c815
commit e50cdc3620
6 changed files with 82 additions and 10 deletions

View File

@ -131,8 +131,10 @@ class Blogger extends this.OS.GUI.BaseApplication
className: "fa fa-file-image-o",
action: (e) ->
me.openDialog "FileDiaLog", (d, n) ->
doc = me.editor.codemirror.getDoc()
doc.replaceSelection "![](#{me._api.handler.get}/#{d}/#{n})"
"#{d}/#{n}".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})"
, "Select image file", { mimes: ["image/.*"] }
},
"|",

View File

@ -21,6 +21,9 @@ afx-list-view[data-id = "notifylist"] li{
border:1px solid #a6a6a6;
border-radius: 6px;
margin-bottom: 2px;
-ms-word-break: break-all;
word-break: break-all;
word-break: break-word;
}
afx-overlay[data-id = "feedzone"]{
@ -42,4 +45,7 @@ afx-list-view[data-id = "notifeed"] li{
border-radius: 6px;
margin-bottom: 2px;
z-index: 99999;
-ms-word-break: break-all;
word-break: break-all;
word-break: break-word;
}

View File

@ -80,7 +80,7 @@ class Files extends this.OS.GUI.BaseApplication
dir.read (d) ->
if(d.error)
return me.error "Resource not found #{p}"
console.log "error"
me.currdir = dir
if not dir.isRoot()
p = dir.parent().asFileHandler()
@ -103,6 +103,7 @@ class Files extends this.OS.GUI.BaseApplication
{ text: "Open with", dataid: "#{@name}-open", child:@apps },
{ text: "Upload", dataid: "#{@name}-upload" },
{ text: "Download", dataid: "#{@name}-download" },
{ text: "Share file", dataid: "#{@name}-share" },
{ text: "Properties", dataid: "#{@name}-info" }
], onmenuselect: (e) -> me.actionFile e
}
@ -251,6 +252,13 @@ class Files extends this.OS.GUI.BaseApplication
@currdir.upload (r) ->
me.error "Faile to upload to: #{d}: #{r.error}" if r.error
when "#{@name}-share"
me = @
return unless file and file.type is "file"
file.path.asFileHandler().publish (r) ->
return me.error "Cannot share file: #{r.error}" if r.error
return me.notify "Shared url: #{r.result}"
when "#{@name}-download"
return unless file
file.path.asFileHandler().download ()->