mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-23 00:32:18 +01:00
Merge 0c7cf16e72 into d69e75cbb6
This commit is contained in:
commit
2d23efaa8f
2 changed files with 21 additions and 5 deletions
|
|
@ -196,13 +196,24 @@ func (this Get) FrontendOverrides() []string {
|
|||
return overrides
|
||||
}
|
||||
|
||||
var xdg_open []string
|
||||
var xdg_open []func() string
|
||||
|
||||
func (this Register) XDGOpen(jsString string) {
|
||||
xdg_open = append(xdg_open, jsString)
|
||||
xdg_open = append(xdg_open, func() string {
|
||||
return jsString
|
||||
})
|
||||
}
|
||||
|
||||
func (this Register) XDGOpenFunc(fn func() string) {
|
||||
xdg_open = append(xdg_open, fn)
|
||||
}
|
||||
|
||||
func (this Get) XDGOpen() []string {
|
||||
return xdg_open
|
||||
var s []string
|
||||
for i := 0; i < len(xdg_open); i++ {
|
||||
s = append(s, xdg_open[i]())
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
var cssOverride []func() string
|
||||
|
|
|
|||
|
|
@ -192,14 +192,19 @@ func init() {
|
|||
).Methods("GET")
|
||||
return nil
|
||||
})
|
||||
Hooks.Register.XDGOpen(`
|
||||
Hooks.Register.XDGOpenFunc(func() string {
|
||||
if plugin_enable() == false {
|
||||
return ""
|
||||
}
|
||||
return `
|
||||
if(mime === "application/word" || mime === "application/msword" ||
|
||||
mime === "application/vnd.oasis.opendocument.text" || mime === "application/vnd.oasis.opendocument.spreadsheet" ||
|
||||
mime === "application/excel" || mime === "application/vnd.ms-excel" || mime === "application/powerpoint" ||
|
||||
mime === "application/vnd.ms-powerpoint" || mime === "application/vnd.oasis.opendocument.presentation" ) {
|
||||
return ["appframe", {"endpoint": "/api/onlyoffice/iframe"}];
|
||||
}
|
||||
`)
|
||||
`
|
||||
})
|
||||
}
|
||||
|
||||
func StaticHandler(res http.ResponseWriter, req *http.Request) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue