Hand any of these functions the details-hash of a portal, and they will return pretty, displayable HTML or parts thereof.
Methods
-
inner getAttackApGainText(d, fieldCount, linkCount) → {Array}
-
Calculates the AP gain from destroying and then capturing a portal by deploying resonators.
Parameters:
Name Type Description d
Object The portal detail object containing portal information.
fieldCount
number The number of fields linked to the portal.
linkCount
number The number of links connected to the portal.
Returns:
Array -An array containing the label 'AP Gain', total AP gain, and a breakdown tooltip.
-
inner getEnergyText(d) → {Array}
-
Generates text representing the current and total energy of a portal.
Parameters:
Name Type Description d
Object The portal detail object containing energy information.
Returns:
Array -An array containing the energy label, formatted energy values, and a tooltip title.
-
inner getHackDetailsText(d) → {Array}
-
Provides details about the hack count and cooldown time of a portal.
Parameters:
Name Type Description d
Object The portal detail object containing hack information.
Returns:
Array -An array containing the label 'hacks', short hack info, and a detailed tooltip.
-
inner getMitigationText(d, linkCount) → {Array}
-
Generates text representing the total mitigation provided by shields and links on a portal.
Parameters:
Name Type Description d
Object The portal detail object containing mitigation information.
linkCount
number The number of links connected to the portal.
Returns:
Array -An array containing the label 'shielding', short mitigation info, and a detailed tooltip.
-
inner getModDetails(d) → {string}
-
Given portal details, returns HTML code to display mod details.
Parameters:
Name Type Description d
Object The portal detail object containing mod information.
Returns:
string -HTML string representing the mod details of the portal.
-
inner getPortalHistoryDetails(d) → {string}
-
Provides historical details about a portal including visitation, capture, and scout control status.
Parameters:
Name Type Description d
Object The portal detail object containing the history properties.
Returns:
string -HTML string representing the historical details of the portal.
-
inner getRangeText(d) → {Array}
-
Returns displayable text and link about portal range including base range, link amp boost, and total range.
Parameters:
Name Type Description d
Object The portal detail object containing range information.
Returns:
Array -An array containing the range label, HTML content, and a tooltip title.
-
inner getResonatorDetails(d) → {string}
-
Generates HTML details for resonators deployed on a portal.
Parameters:
Name Type Description d
Object The portal detail object containing resonator information.
Returns:
string -HTML string representing the resonator details of the portal.
-
inner renderResonatorDetails(slot, level, nrg, nick) → {Array}
-
Helper function that renders the HTML for a given resonator.
Parameters:
Name Type Description slot
number The slot number where the resonator is deployed. Starts with 0 (east) and rotates clockwise. So, last one is 7 (southeast).
level
number The level of the resonator.
nrg
number The energy of the resonator.
nick
string | 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.
-
inner showPortalPosLinks(lat, lng, name)
-
Displays a dialog with links to show the specified location on various map services.
Parameters:
Name Type Description lat
number Latitude of the location.
lng
number Longitude of the location.
name
string Name of the location.