Namespace with helpers that turn portal detail data into displayable HTML or parts thereof.
Members
-
static historyMissingTemplate :String
-
Template shown when a portal has no history data
-
static historyTemplate :String
-
Template of the portal history block (visited / captured / scout controlled)
-
static modEmptyTemplate :String
-
Template of an empty mod slot
-
static modTemplate :String
-
Template of a single portal mod entry ({titleAttr} is a pre-built
title="..."attribute or empty) -
static nicknameTemplate :String
-
Template of a player nickname span
-
static posLinksTemplate :String
-
Template of the map-service links dialog shown by showPosLinks ({text:'...'} is a literal script object, only lat/lng/encodedName are placeholders)
-
static rangeLinkTemplate :String
-
Template of the clickable portal range link
-
static resoDetailsTemplate :String
-
Template wrapping the resonator details table
-
static resonatorFillTemplate :String
-
Template of the resonator fill bar
-
static resonatorLevelTemplate :String
-
Template of the resonator level label
-
static resonatorMeterTemplate :String
-
Template of a resonator meter cell
Methods
-
static getAttackApGainText(d, fieldCount, linkCount) → {Array}
-
Calculates the AP gain from destroying and then capturing a portal by deploying resonators.
Parameters:
Name Type Description dObject The portal detail object containing portal information.
fieldCountnumber The number of fields linked to the portal.
linkCountnumber The number of links connected to the portal.
Returns:
Array -An array containing the label 'AP Gain', total AP gain, and a breakdown tooltip.
-
static getEnergyText(d) → {Array}
-
Generates text representing the current and total energy of a portal.
Parameters:
Name Type Description dObject The portal detail object containing energy information.
Returns:
Array -An array containing the energy label, formatted energy values, and a tooltip title.
-
static getHackDetailsText(d) → {Array}
-
Provides details about the hack count and cooldown time of a portal.
Parameters:
Name Type Description dObject The portal detail object containing hack information.
Returns:
Array -An array containing the label 'hacks', short hack info, and a detailed tooltip.
-
static getHistoryDetails(d) → {string}
-
Provides historical details about a portal including visitation, capture, and scout control status.
Parameters:
Name Type Description dObject The portal detail object containing the history properties.
Returns:
string -HTML string representing the historical details of the portal.
-
static getMitigationText(d, linkCount) → {Array}
-
Generates text representing the total mitigation provided by shields and links on a portal.
Parameters:
Name Type Description dObject The portal detail object containing mitigation information.
linkCountnumber The number of links connected to the portal.
Returns:
Array -An array containing the label 'shielding', short mitigation info, and a detailed tooltip.
-
static getModDetails(d) → {string}
-
Given portal details, returns HTML code to display mod details.
Parameters:
Name Type Description dObject The portal detail object containing mod information.
Returns:
string -HTML string representing the mod details of the portal.
-
static getRangeText(d) → {Array}
-
Returns displayable text and link about portal range including base range, link amp boost, and total range.
Parameters:
Name Type Description dObject The portal detail object containing range information.
Returns:
Array -An array containing the range label, HTML content, and a tooltip title.
-
static getResonatorDetails(d) → {string}
-
Generates HTML details for resonators deployed on a portal.
Parameters:
Name Type Description dObject The portal detail object containing resonator information.
Returns:
string -HTML string representing the resonator details of the portal.
-
static renderResonatorDetails(slot, level, nrg, nick) → {Array}
-
Helper function that renders the HTML for a given resonator.
Parameters:
Name Type Description slotnumber The slot number where the resonator is deployed. Starts with 0 (east) and rotates clockwise. So, last one is 7 (southeast).
levelnumber The level of the resonator.
nrgnumber The energy of the resonator.
nickstring | null The nickname of the owner of the resonator, or null if not applicable.
Returns:
Array -An array containing the HTML content of the resonator and the owner's nickname.
-
static showPosLinks(lat, lng, name)
-
Displays a dialog with links to show the specified location on various map services.
Parameters:
Name Type Description latnumber Latitude of the location.
lngnumber Longitude of the location.
namestring Name of the location.