mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-21 15:53:14 +01:00
This contains a bunch of things packaged in 1: 1) UI improvements for the 3D viewer to support all sort of file types and create a nice rendering in a clean way with all sort of options 2) enable people to use Filestash as an SDK so we can embed the 3d viewer elsewhere
20 lines
716 B
JavaScript
20 lines
716 B
JavaScript
import { fromHref } from "../../lib/skeleton/router.js";
|
|
import { transition as transitionLib, slideYIn } from "../../lib/animate.js";
|
|
import { basename, forwardURLParams } from "../../lib/path.js";
|
|
|
|
export function transition($node) {
|
|
return transitionLib($node, { timeEnter: 150, enter: slideYIn(2) });
|
|
}
|
|
|
|
export function getFilename() {
|
|
return basename(getCurrentPath()) || " ";
|
|
}
|
|
|
|
export function getDownloadUrl() {
|
|
return forwardURLParams("api/files/cat?path=" + encodeURIComponent(getCurrentPath()), ["share"]);
|
|
}
|
|
|
|
export function getCurrentPath() {
|
|
const fullpath = fromHref(location.pathname + location.hash);
|
|
return decodeURIComponent(fullpath.replace(new RegExp("^/view"), ""));
|
|
}
|