webassets/scripts.js
// artist's info doesn't match any predetermined formats. Otherwise, return null.
artist's info doesn't match any predetermined formats. Otherwise, return null.
artist ' s info doesn ' t match any predetermined formats . Otherwise return null .
function artistContactInfo(artist, displayRawLink, defaultToName) {
    try {
        let [name, discordID, contact] = artist;
        name = name || "";
        discordID = discordID || "";
        contact = contact || "";
        if (!name) {
            return document.createTextNode("Discord ID: " + discordID);
        } else if (contact.toLowerCase().startsWith("http") ||
                   contact.toLowerCase().startsWith("@")) {
            let text = displayRawLink ? contact : name;
            return createAnchor(text, contact);
        } else if (contact.toLowerCase().startsWith("/u/") ||
                   contact.toLowerCase().startsWith("u/")) {
            if (!contact.startsWith("/")) {
                contact = "/" + contact;
            }
            let uri = "https://www.reddit.com" + contact;
            let text = displayRawLink ? uri : name;
            return createAnchor(text, uri);
        } else if (contact.includes("@")) {
            let text = displayRawLink ? contact : name;
            return createAnchor(text, "mailto:" + contact);
        } else if (contact.includes("#")) {
            return document.createTextNode(name + " (Discord ID: " + contact + ")");
        }
        return defaultToName ? document.createTextNode(name) : null;
    } catch {
        return null;
    }
}
function artistContactInfo ( artist , displayRawLink , defaultToName ) { try { let [ name , discordID , contact ] = artist ; name = name || "" ; discordID = discordID || "" ; contact = contact || "" ; if ( ! name ) { return document . createTextNode ( "Discord ID: " + discordID ) ; } else if ( contact . toLowerCase ( ) . startsWith ( "http" ) || contact . toLowerCase ( ) . startsWith ( "@" ) ) { let text = displayRawLink ? contact : name ; return createAnchor ( text , contact ) ; } else if ( contact . toLowerCase ( ) . startsWith ( "/u/" ) || contact . toLowerCase ( ) . startsWith ( "u/" ) ) { if ( ! contact . startsWith ( "/" ) ) { contact = "/" + contact ; } let uri = "https://www.reddit.com" + contact ; let text = displayRawLink ? uri : name ; return createAnchor ( text , uri ) ; } else if ( contact . includes ( "@" ) ) { let text = displayRawLink ? contact : name ; return createAnchor ( text , "mailto:" + contact ) ; } else if ( contact . includes ( "#" ) ) { return document . createTextNode ( name + " (Discord ID: " + contact + ")" ) ; } return defaultToName ? document . createTextNode ( name ) : null ; } catch { return null ; } }
artist's info doesn't match any predetermined formats.
artist ' s info doesn ' t match any predetermined formats .
// Convert from undefined to "" (note: `||=` is unsupported on some mobile browsers)