getting there..
This commit is contained in:
parent
ff7906260f
commit
d7ce98e276
5 changed files with 27 additions and 11 deletions
|
@ -93,3 +93,11 @@ textarea {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tierline {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttons {
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
|
@ -39,13 +39,15 @@
|
||||||
relpermalink = repo.relpermalink
|
relpermalink = repo.relpermalink
|
||||||
protocol = document.location.protocol.substring(0,4)
|
protocol = document.location.protocol.substring(0,4)
|
||||||
|
|
||||||
let xastiers = Object.keys(repo.frontmatter).filter(t => t.startsWith("has_"))
|
|
||||||
let tkey = Object.keys(repo.frontmatter).filter(t => t.toLowerCase() == "title")[0]
|
let tkey = Object.keys(repo.frontmatter).filter(t => t.toLowerCase() == "title")[0]
|
||||||
title = repo.frontmatter[tkey]
|
title = repo.frontmatter[tkey]
|
||||||
hastiers = xastiers[0].substr(4)
|
let xastiers = Object.keys(repo.frontmatter).filter(t => t.startsWith("has_"))
|
||||||
tiers = METASP[xastiers[0].split("has_")[1]].tiers.filter(t => repo.frontmatter[xastiers].includes(t.file)).reverse()
|
if (xastiers.length > 0) {
|
||||||
if (xastiers.length == 1) {
|
hastiers = xastiers[0].substr(4)
|
||||||
candidates = diffArrr(METASP[xastiers[0].split("has_")[1]].tiers, tiers)
|
tiers = METASP[xastiers[0].split("has_")[1]].tiers.filter(t => repo.frontmatter[xastiers].includes(t.file)).reverse()
|
||||||
|
if (xastiers.length == 1) {
|
||||||
|
candidates = diffArrr(METASP[xastiers[0].split("has_")[1]].tiers, tiers)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
el.src = `../js/repo/${location.hash.substring(1)}.js`
|
el.src = `../js/repo/${location.hash.substring(1)}.js`
|
||||||
|
@ -78,8 +80,10 @@
|
||||||
<main id="sandpoints">
|
<main id="sandpoints">
|
||||||
<form>
|
<form>
|
||||||
<SpTitle title={title} />
|
<SpTitle title={title} />
|
||||||
|
{#if hastiers}
|
||||||
<SpHasTiers on:addToCandidatesRemoveFromTiers={addToCandidatesRemoveFromTiers} hastiers={hastiers} candidates={candidates} tiers={tiers}/>
|
<SpHasTiers on:addToCandidatesRemoveFromTiers={addToCandidatesRemoveFromTiers} hastiers={hastiers} candidates={candidates} tiers={tiers}/>
|
||||||
<SpHasCandidates on:addToTiersRemoveFromCandidates={addToTiersRemoveFromCandidates} candidates={candidates} />
|
<SpHasCandidates on:addToTiersRemoveFromCandidates={addToTiersRemoveFromCandidates} candidates={candidates} />
|
||||||
|
{/if}
|
||||||
<label for="content">Content:</label>
|
<label for="content">Content:</label>
|
||||||
<textarea bind:value={v} oninput='this.style.height = "";this.style.height = this.scrollHeight + 3 + "px"'></textarea>
|
<textarea bind:value={v} oninput='this.style.height = "";this.style.height = this.scrollHeight + 3 + "px"'></textarea>
|
||||||
{#if document.location.protocol.substring(0,4) != "file"}
|
{#if document.location.protocol.substring(0,4) != "file"}
|
||||||
|
|
|
@ -23,6 +23,6 @@
|
||||||
<select class="selecttier" bind:value>
|
<select class="selecttier" bind:value>
|
||||||
<option id="addnew" value="1" disabled selected>Add new...</option>
|
<option id="addnew" value="1" disabled selected>Add new...</option>
|
||||||
{#each candidates as tier (tier.file)}
|
{#each candidates as tier (tier.file)}
|
||||||
<option value={tier.file}>{tier.file}</option>
|
<option title="{tier.title}" value={tier.file}>{tier.file} ({tier.title})</option>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -24,10 +24,14 @@
|
||||||
<div class="tierbox">
|
<div class="tierbox">
|
||||||
{#each tiers as tier, i (tier.file)}
|
{#each tiers as tier, i (tier.file)}
|
||||||
<div class="tierline">
|
<div class="tierline">
|
||||||
<input type="text" name="has_{hastiers}[]" class="hasinput" value="{tier.file}">
|
<div class="filetitle">
|
||||||
<button type="button" class="buttondown" on:click="{swapTier(tier, 1)}" disabled={i+1 == tiers.length ? true:false}>⇓</button>
|
<input type="text" name="has_{hastiers}[]" class="hasinput" value="{tier.file}"><span class="tiertitle">({tier.title})</span>
|
||||||
<button type="button" class="buttonup" on:click="{swapTier(tier, -1)}" disabled={i == 0 ? true:false}>⇑</button>
|
</div>
|
||||||
<button type="button" on:click="{removeTier(tier)}">×</button>
|
<div class="buttons">
|
||||||
|
<button type="button" class="buttondown" on:click="{swapTier(tier, 1)}" disabled={i+1 == tiers.length ? true:false}>⇓</button>
|
||||||
|
<button type="button" class="buttonup" on:click="{swapTier(tier, -1)}" disabled={i == 0 ? true:false}>⇑</button>
|
||||||
|
<button type="button" on:click="{removeTier(tier)}">×</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,4 +3,4 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<label for="title">Title:</label>
|
<label for="title">Title:</label>
|
||||||
<input type="text" value="{title}">
|
<input type="text" name="title" value="{title}">
|
||||||
|
|
Loading…
Add table
Reference in a new issue