ATLYSS TechPendium

Viewing old revision of Module:Wiki

You are viewing an old revision of this page from 2/22/2026, 3:30:48 PM.

View latest version
This Module contains Wiki logic and must be loaded using require keyword inside other logic modules.
Note that require supports only static imports.
This module can be {{#invoke}}-ed to render dynamic parts of the page.
const Utils = await require("Utils");
const Versions = await requireData("Versions");

function wikiRarity(props) {
	const args = Utils.resolveArgs(props);
    
    const rarity = String(args["rarity"] ?? args[0]);
    
    switch (rarity?.toLowerCase()) {
        case "rare": case "1": return `<span class="rarity-rare">Rare</span>`;
        case "exotic": case "2": return `<span class="rarity-exotic">Exotic</span>`;
    	case "cosmetic": case "3": return `<span class="rarity-cosmetic">Cosmetic</span>`;
 	    default: return `<span class="rarity-common">Common</span>`;
    }
}

function versionCode(version, tooltip) {
    return `<code class="${version === Versions.latest ? 'latest' : 'outdated'}" data-tooltip-id="${tooltip.id}">${version}</code>${tooltip.build()}`;
}

function versionSelector(version, module, func, args = []) {
    return `<select name="versionSelector" class="version-select" data-module="${module}" data-function="${func}" data-args="${args.join("--")}"><option>Latest</option>${Versions.versions.map(v => `<option ${v == version ? "selected" : ""}>${v.id}</option>`).join("")}</select>`;
}

exports = {
  wikiRarity,
  versionCode,
  versionSelector
}
Last Edited by LiveGobe on 2/22/2026, 3:30:48 PM

This page categories: