Skip to content

Commit

Permalink
Merge pull request #401 from Lenni009/web-dev
Browse files Browse the repository at this point in the history
Bugfixes
  • Loading branch information
Lenni009 authored Aug 15, 2023
2 parents 2bf4d35 + 704ab57 commit cd93470
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion fauna.html
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ <h1 class="title is-3">Hub Wiki Page Creator - Fauna</h1>
</div>

<div>==Location==</div>
<div>It can be found on the [[<output id="celestialBody"></output>]] in the [[<output id="locSystem"
<div>It can be found on the <output id="celestialBody"></output> in the [[<output id="locSystem"
name="system"></output>]] [[star system]].</div>
<br>
<div>{{CoordGlyphConvert|<output id="portalglyphs1" name="portalglyphs"></output>}}
Expand Down
1 change: 1 addition & 0 deletions src/datalists/mineralDatalists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ const mineralDatalists = {
'Copper',
'Silver',
'Tritium',
'Carbon',
]
}

Expand Down
7 changes: 4 additions & 3 deletions src/miscLogic/locationLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ export function planetMoon(moon = pageData.moon) {
* @returns {string} - The description sentence, or "" if `globalElements.output.celestialBody`
* is falsy.
*/
export function planetMoonSentence(planet: string = pageData.planet as string, moon: string = pageData.moon as string) {
export function planetMoonSentence(planet: string = pageData.planet as string, moon: string = pageData.moon as string, link: boolean = false) {
const dest = globalElements.output.celestialBody as HTMLOutputElement;
const body = planetMoon(moon);
const text = body == 'Moon' ? `moon [[${sanitiseString(moon)}]]` : `planet [[${sanitiseString(planet)}]]`;
const linkedText = link ? `[[${text.split(' ')[0]}]] ${text.split(' ').slice(1)}` : text;

if (!dest) return text;
dest.innerText = text;
if (!dest) return linkedText;
dest.innerText = linkedText;
return '';
}

Expand Down
1 change: 1 addition & 0 deletions src/modules/gallery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export function galleryUpload() {
const p = document.createElement('p');
const span = document.createElement('span');
p.innerText = name;
p.style.wordBreak = 'break-all'
span.classList.add('has-text-weight-bold');
span.innerText = 'Name: ';
p.insertAdjacentElement('afterbegin', span);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/fauna/elementFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const creatureElementFunctions: ElementFunctions = [
},
{
element: ['planetInput', 'moonInput'],
func: () => planetMoonSentence()
func: () => planetMoonSentence(undefined, undefined, true)
},
{
element: 'ecosystemInput',
Expand Down
2 changes: 2 additions & 0 deletions src/pages/fauna/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import creatureElementFunctions from "./elementFunctions";
import creatureElements from "./elementStore";
import { albumOtherExternal, albumCivExternal, addInfo, albumDropdown, bundlePropFunctions, genderDropdown, genusDropdown, genusProduces, hideAlbumEntry, hideCreaturePrio, hideSecGenderProps, noLineBreak, pageName, specialNotes, specialNotesTextFunc, generateGalleryArray, resetExternal } from "./fauna";
import { globalFunctions } from "../../variables/objects";
import { planetMoonSentence } from "../../miscLogic/locationLogic";
import '../../startup';

globalFunctions.albumOtherExternal = () => albumOtherExternal();
Expand Down Expand Up @@ -36,6 +37,7 @@ datalists(creatureDatalists);
updateGlobalElements(creatureElements);
assignElementFunctions(creatureElementFunctions);

planetMoonSentence(undefined, undefined, true);
genusDropdown();
genderDropdown();
albumDropdown();
Expand Down
3 changes: 3 additions & 0 deletions src/scss/components/_gallery.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
flex-grow: 1;
padding: .5em;
position: relative;
display: flex;
flex-direction: column;
gap: .5rem;

input {
min-height: 25px;
Expand Down

0 comments on commit cd93470

Please sign in to comment.