feat: improve ArtCraft integration and configurable file opening
This commit is contained in:
1 parent
3bc62d2b69
commit
80bc2c458d
60 files changed
+1738
-232
No files matched your search
+20
-3
@@ -1,7 +1,12 @@
|
||||
package fbhttp
|
||||
|
||||
import _ "embed"
|
||||
import "github.com/filebrowser/filebrowser/v2/internal/addons"
|
||||
import (
|
||||
_ "embed"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/filebrowser/filebrowser/v2/internal/addons"
|
||||
)
|
||||
|
||||
//go:embed craft_bridge.js
|
||||
var officeBridge []byte
|
||||
@@ -18,7 +23,19 @@ func deckcraftNeedsCompat(id, build string) bool {
|
||||
return id == "deckcraft" && build == "v0.9.0-38076027b9c1"
|
||||
}
|
||||
|
||||
func needsOfficeBridge(id string) bool {
|
||||
func needsOfficeBridge(id string, build ...string) bool {
|
||||
// WordCraft 0.14 added the official parent protocol. Injecting the drop
|
||||
// adapter too announces readiness before Rust is listening and loses the file.
|
||||
if id == "wordcraft" && len(build) > 0 {
|
||||
parts := strings.Split(strings.TrimPrefix(build[0], "v"), ".")
|
||||
if len(parts) >= 2 {
|
||||
major, _ := strconv.Atoi(parts[0])
|
||||
minor, _ := strconv.Atoi(parts[1])
|
||||
if major > 0 || minor >= 14 {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
tool, ok := addons.Find(id)
|
||||
return ok && tool.Bridge == "drop"
|
||||
}
|
||||
Reference in new issue
Block a user