forked from MapComplete/MapComplete
Chore: housekeeping
This commit is contained in:
parent
cd9e03dd6f
commit
b300fffdc5
156 changed files with 4436 additions and 1318 deletions
|
|
@ -23,10 +23,15 @@
|
|||
>([])
|
||||
|
||||
tileToFetch.addCallbackAndRun(async (url) => {
|
||||
const data = await Utils.downloadJsonCached<FeatureCollection<Polygon, {
|
||||
nameEn: string,
|
||||
resources: Record<string, CommunityResource>
|
||||
}>>(url, 24 * 60 * 60)
|
||||
const data = await Utils.downloadJsonCached<
|
||||
FeatureCollection<
|
||||
Polygon,
|
||||
{
|
||||
nameEn: string
|
||||
resources: Record<string, CommunityResource>
|
||||
}
|
||||
>
|
||||
>(url, 24 * 60 * 60)
|
||||
if (data === undefined) {
|
||||
return
|
||||
}
|
||||
|
|
@ -39,9 +44,13 @@
|
|||
[location]
|
||||
)
|
||||
|
||||
const globalResources: UIEventSource<Record<string, CommunityResource>> = UIEventSource.FromPromise(Utils.downloadJsonCached<Record<string, CommunityResource>>(
|
||||
Constants.communityIndexHost + "/global.json", 24 * 60 * 60 * 1000
|
||||
))
|
||||
const globalResources: UIEventSource<Record<string, CommunityResource>> =
|
||||
UIEventSource.FromPromise(
|
||||
Utils.downloadJsonCached<Record<string, CommunityResource>>(
|
||||
Constants.communityIndexHost + "/global.json",
|
||||
24 * 60 * 60 * 1000
|
||||
)
|
||||
)
|
||||
</script>
|
||||
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -26,10 +26,7 @@
|
|||
{/if}
|
||||
{#each resources as resource}
|
||||
<div class="link-underline my-4 flex items-center">
|
||||
<img
|
||||
class="m-2 h-8 w-8"
|
||||
src={`${Constants.communityIndexHost}${resource.type}.svg`}
|
||||
/>
|
||||
<img class="m-2 h-8 w-8" src={`${Constants.communityIndexHost}${resource.type}.svg`} />
|
||||
<div class="flex flex-col">
|
||||
<a
|
||||
href={resource.resolved?.url}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<div class="border-box m-2 flex flex-wrap border-b border-gray-300">
|
||||
<img
|
||||
class={twJoin(
|
||||
"min-h-12 mr-2 mb-2 w-12",
|
||||
"mb-2 mr-2 min-h-12 w-12",
|
||||
license["mostly_white"] && "h-12 rounded-full bg-slate-400"
|
||||
)}
|
||||
src={iconPath}
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@
|
|||
{#if theme.official}
|
||||
<a
|
||||
class="flex"
|
||||
href={"https://source.mapcomplete.org/MapComplete/MapComplete/src/branch/develop/Docs/Themes" +
|
||||
href={"https://source.mapcomplete.org/MapComplete/MapComplete/src/branch/develop/Docs/Themes/" +
|
||||
theme.id +
|
||||
".md"}
|
||||
target="_blank"
|
||||
|
|
|
|||
|
|
@ -45,10 +45,10 @@
|
|||
|
||||
let linkPrefix = `${path}/${layout.id.toLowerCase()}.html?`
|
||||
if (
|
||||
!isAndroid && (
|
||||
location.hostname === "localhost" ||
|
||||
location.hostname === "127.0.0.1" ||
|
||||
location.port === "1234")
|
||||
!isAndroid &&
|
||||
(location.hostname === "localhost" ||
|
||||
location.hostname === "127.0.0.1" ||
|
||||
location.port === "1234")
|
||||
) {
|
||||
// Redirect to 'theme.html?layout=* instead of 'layout.html'. This is probably a debug run, where the routing does not work
|
||||
linkPrefix = `${path}/theme.html?layout=${layout.id}&`
|
||||
|
|
@ -66,7 +66,9 @@
|
|||
return `${linkPrefix}${hash}`
|
||||
}
|
||||
|
||||
let href = AndroidPolyfill.inAndroid.map(isAndroid => createUrlDirect(theme, isCustom, isAndroid, state))
|
||||
let href = AndroidPolyfill.inAndroid.map((isAndroid) =>
|
||||
createUrlDirect(theme, isCustom, isAndroid, state)
|
||||
)
|
||||
</script>
|
||||
|
||||
<a class="low-interaction my-1 flex w-full items-center text-ellipsis rounded p-1" href={$href}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue