mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-10-27 11:35:04 +08: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
16 lines
419 B
JavaScript
16 lines
419 B
JavaScript
// feature detection if we're using Filestash as a standalone app or as an SDK
|
|
// see: ../index.js
|
|
|
|
export function isSDK() {
|
|
const importURL = new URL(import.meta.url);
|
|
return location.origin !== importURL.origin;
|
|
}
|
|
|
|
export function urlSDK(url) {
|
|
const importURL = new URL(import.meta.url);
|
|
if (new RegExp("^/").test(url) === false) {
|
|
url = "/" + url
|
|
}
|
|
return importURL.origin + url;
|
|
}
|