Change new map to use dialog

This allows setting additional properties
This commit is contained in:
Max Berger
2026-03-07 20:19:54 +01:00
parent 76abbf3115
commit ef30d89452
7 changed files with 610 additions and 432 deletions

View File

@@ -21,7 +21,7 @@
import { CreateEditCollectionScene } from "./CreateEditCollectionScene.js";
import { DeleteCollectionScene } from "./DeleteCollectionScene.js";
import { LoadingScene } from "./LoadingScene.js";
import { CreateShareCollectionScene, maybe_enable_sharing_options } from "./ShareCollectionScene.js";
import { ShareCollectionScene, maybe_enable_sharing_options } from "./ShareCollectionScene.js";
import { UploadCollectionScene } from "./UploadCollectionScene.js";
import { discover_server_features, get_collections } from "./api.js";
import { SERVER } from "./constants.js";
@@ -30,15 +30,16 @@ import { Scene, pop_scene, push_scene, scene_stack } from "./scene_manager.js";
import { bytesToHumanReadable } from "./utils.js";
/**
* @constructor
* @implements {Scene}
* @param {string} user
* @param {string} password
* @param {Collection} collection The principal collection.
* @param {function(string):void} onerror Called when an error occurs, before the
* scene is popped.
*/
export class CollectionsScene {
/**
* @param {string} user
* @param {string} password
* @param {Collection} collection The collection to show sharing options for.
* @param {function(string):void} onerror Called when an error occurs, before the
* scene is popped.
*/
constructor(user, password, collection, onerror) {
/** @type {HTMLElement} */ let html_scene = document.getElementById("collectionsscene");
/** @type {HTMLElement} */ let template = html_scene.querySelector("[data-name=collectiontemplate]");
@@ -82,7 +83,7 @@ export class CollectionsScene {
function onshare(collection) {
try {
let share_collection_scene = new CreateShareCollectionScene(user, password, collection);
let share_collection_scene = new ShareCollectionScene(user, password, collection);
push_scene(share_collection_scene, false);
} catch (err) {
console.error(err);
@@ -189,7 +190,7 @@ export class CollectionsScene {
upload_btn.onclick = onupload;
if (collections === null) {
update();
discover_server_features(user, password, maybe_enable_sharing_options);
discover_server_features(user, password, maybe_enable_sharing_options);
} else {
// from update loading scene
show_collections(collections);