Skip to content

Commit

Permalink
0.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
averrin committed Nov 10, 2022
1 parent e059390 commit 20d008a
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 55 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file. Dates are displayed in UTC.

## [Unreleased]
## [0.4.4 - 0.4.5](https://github.com/averrin/alpha-suit/compare/0.4.4...0.4.5)
Fixed:
* Tokens layout is broken if they dont fit into one line

Added:
* Button for starting file indexing right next to the search field
* A little color tweak for the light theme


## [0.4.3 - 0.4.4](https://github.com/averrin/alpha-suit/compare/0.4.3...0.4.4)
Fixed:
* Broken s3 in the File Manager
Expand Down
2 changes: 0 additions & 2 deletions src/modules/file_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,11 @@ export async function startCache() {
if (isGood) {
indexPath.set(`${source}/${node}`);
} else {
// logger.info(node, "filtered")
}
return isGood;
},
});
// n = 1;
// logger.info(`${source} Indexed`);
console.timeEnd("Alpha | Indexing " + source);
}
logger.info(`Indexed: ${index.length} files. Depth: ${depthLimit}`);
Expand Down
1 change: 0 additions & 1 deletion src/modules/stores.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export function addSystem(system) {
s[system.id] = system;
return s;
})
// logger.info(`System added: ${system.id}`);
}

async function initCompendiumTreeCF() {
Expand Down
53 changes: 26 additions & 27 deletions src/view/FilesUI.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import Tag from "crew-components/tags";
import Intro from "./components/Intro.svelte";
import HelpFilesControls from "../view/help/HelpFilesControls.svelte";
import { fileIndex, indexInProcess } from "../modules/file_index.js";
import { fileIndex, indexInProcess, rebuildIndex } from "../modules/file_index.js";
import SelectedFiles from "./components/SelectedFiles.svelte";
import { isImage, isVideo, showFile } from "crew-components/helpers";
Expand Down Expand Up @@ -64,7 +64,6 @@
function onTagClick(_, tag) {
const fav = $favs.find((f) => f.text == tag);
// logger.info(fav);
openFolder(fav.data);
}
Expand Down Expand Up @@ -152,34 +151,32 @@
function fetchFolder(node) {
if (!node) return;
const store = node.id.split("/")[0];
const options = {};
let bucket;
if (store == "s3" && node.id.split("/").length > 1) {
bucket = node.id.split("/")[1];
options.bucket = bucket;
}
const options = {};
let bucket;
if (store == "s3" && node.id.split("/").length > 1) {
bucket = node.id.split("/")[1];
options.bucket = bucket;
}
let path = ".";
let picker = FilePicker;
if (location.host.includes("forge-vtt")) {
path = "";
picker = ForgeVTT_FilePicker;
}
if (node.id != store) {
let rest = node.id.replace(store + "/", "")
logger.info(rest, bucket)
if (bucket) {
if (node.id.split("/").length == 2) {
rest = rest.replace(bucket,"")
let rest = node.id.replace(store + "/", "");
if (bucket) {
if (node.id.split("/").length == 2) {
rest = rest.replace(bucket, "");
} else {
rest = rest.replace(bucket + "/", "");
}
}
if (store == "s3") {
path = rest;
} else {
rest = rest.replace(bucket+"/","")
path = path + "/" + rest;
}
}
if (store == "s3") {
path = rest
} else {
path = path + "/" + rest;
}
logger.info("resulting path", path)
}
return picker.browse(store, path, options).then((res) => {
return {
Expand Down Expand Up @@ -347,15 +344,14 @@
}
function openFolder(path, record = true, soft = false) {
logger.info("open folder", path, record);
// logger.info("open folder", path, record);
const storage = path.split("/")[0];
if (!storages.includes(storage)) {
logger.error("Storage isnt specified!", path, storages);
return;
}
if (!$filesTree[path]) {
// logger.error("path isnt loaded yet", path);
const chain = path.split("/").map((s, i) =>
path
.split("/")
Expand All @@ -380,9 +376,6 @@
});
}
// tick().then((_) => {
// logger.info($navHistory, $navIndex);
// });
return toggleExpanded($filesTree[path], !soft);
}
Expand Down Expand Up @@ -528,7 +521,13 @@
width="18rem"
on:change={foundry.utils.debounce(searchFile, 500)}
clearable={true}
/>
>
<svelte:fragment slot="right">
{#if $fileIndex.length == 0}
<IconButton icon="mdi:database" on:click={rebuildIndex} type="primary" title="Start indexing" />
{/if}
</svelte:fragment>
</ArgInput>
{/if}
<div class="ui-flex ui-flex-1 ui-w-full">
Expand Down
1 change: 0 additions & 1 deletion src/view/SettingsUI.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
selectedSetting.subscribe((s) => {
settingsTopic.set(s[0]);
topic = $settingsTree[s[0]];
logger.info(topic);
})
);
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/view/components/ActorTokens.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</script>
{#if tokens?.length > 0}
<div class="ui-input-group ui-input-group-md ui-w-auto">
<div class="ui-input-group ui-input-group-md ui-w-auto !ui-h-auto">
<span>Tokens</span>
<div class="ui-border ui-flex ui-flex-row ui-gap-1 ui-p-1 ui-bg-base-300 ui-flex-wrap">
{#each tokens as token (token.id)}
Expand Down
1 change: 0 additions & 1 deletion src/view/components/AdvancedRightPane.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
async function itemClick(e) {
const { node, event } = e.detail;
logger.info(node);
const item = await node.compendium.getDocument(node.source._id);
item.sheet.render(true);
}
Expand Down
1 change: 0 additions & 1 deletion src/view/components/BrowserRightPane.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@
const { node, event } = e.detail;
const isFolder = node.source.contents;
if (!isFolder) {
logger.info(node);
const item = await compendium.getDocument(node.source._id);
item.sheet.render(true);
} else {
Expand Down
2 changes: 0 additions & 2 deletions src/view/components/DocumentThumb.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
async function drag(e) {
let id = $item.id;
let type = $currentCollection.documentName;
logger.info($item);
let data = { type, id, data: $item.data, uuid: $item.uuid };
let sData = { data: JSON.stringify(data) };
e.dataTransfer.setData("text/plain", sData.data);
Expand All @@ -25,7 +24,6 @@
sData.data = JSON.stringify({ type, id });
ui.notifications.info(`Imported: ${doc.name}`);
e.dataTransfer.setData("text/plain", sData.data);
logger.info("imported", sData, e.dataTransfer);
}
}
let thumb;
Expand Down
1 change: 0 additions & 1 deletion src/view/components/FilterPanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
);
function addFilter(filter, e) {
// logger.info(filter, "|", e.detail);
let val = e.detail;
if (val === undefined) return;
cache[filter.label] = val;
Expand Down
1 change: 0 additions & 1 deletion src/view/components/SelectedActor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
if (i && getTokens(i).length > 0) {
token = getTokens(i)[0];
}
logger.info(token);
if (i) {
ts.set(token || { actor: i });
}
Expand Down
1 change: 0 additions & 1 deletion src/view/components/SelectedFiles.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
height: img.height,
quality: 1,
});
logger.info(i);
await navigator.clipboard.write([
new ClipboardItem({
"image/png": dataURItoBlob(i.thumb),
Expand Down
1 change: 0 additions & 1 deletion src/view/hud/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export function isLiving(token) {
}

export function findItems(token, itemsToFind) {
// logger.info(`find items for: ${token.data.name}`, token, itemsToFind);
const items = [];
const i1 = token?.document?.actor?.items.filter(i => itemsToFind.some(itf => itf == i.name || itf == i.id));
items.push(...i1);
Expand Down
14 changes: 0 additions & 14 deletions src/view/settings/HUDSettings.svelte
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
<script>
import ArgInput from "crew-components/ArgInput";
import { logger, setting } from "crew-components/helpers";
import { moduleId, SETTINGS } from "../../modules/constants.js";
function saveSetting(key, e) {
logger.info(key, e.detail);
globalThis.game.settings.set(moduleId, key, e.detail);
}
</script>

<div class="ui-bg-base ui-p-2 browser-settings ui-flex ui-flex-col ui-gap-2 ui-h-full">
<div class="ui-text-center ui-text-base-content ui-text-lg ui-font-bold">HUD Settings</div>

<!-- <ArgInput -->
<!-- type="bool" -->
<!-- label="Director's widget" -->
<!-- value={setting(SETTINGS.USE_DIRECTOR_TAGS)} -->
<!-- on:change={(e) => saveSetting(SETTINGS.USE_DIRECTOR_TAGS, e)} -->
<!-- size="md" -->
<!-- /> -->
<!-- <span class="ui-label-text ui-text-xs ui-ml-2">Sync tag colors between modules. Requires the Director module</span> -->
</div>
1 change: 0 additions & 1 deletion src/view/settings/SettingsInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
function saveSetting(key, e) {
if (premium && !isPremium()) return;
logger.info(key, e.detail);
globalThis.game.settings.set(mid, key, e.detail);
dispatch("change", { key, value: e.detail });
}
Expand Down
1 change: 1 addition & 0 deletions src/view/settings/SupportSettings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<h1>Premium Access</h1>
<ul>
<li>iotech</li>
<li>Christopher Allbritton</li>
</ul>

<h1>Special Thanks</h1>
Expand Down

0 comments on commit 20d008a

Please sign in to comment.