MCPcopy Create free account
hub / github.com/RocketMap/RocketMap / pokemonLabel

Function pokemonLabel

static/js/map.js:310–343  ·  view source on GitHub ↗
(name, rarity, types, disappearTime, id, latitude, longitude, encounterId)

Source from the content-addressed store, hash-verified

308}
309
310function pokemonLabel (name, rarity, types, disappearTime, id, latitude, longitude, encounterId) {
311 var disappearDate = new Date(disappearTime)
312 var rarityDisplay = rarity ? '(' + rarity + ')' : ''
313 var typesDisplay = ''
314 $.each(types, function (index, type) {
315 typesDisplay += getTypeSpan(type)
316 })
317
318 var contentstring = `
319 <div>
320 <b>${name}</b>
321 <span> - </span>
322 <small>
323 <a href='http://www.pokemon.com/us/pokedex/${id}' target='_blank' title='View in Pokedex'>#${id}</a>
324 </small>
325 <span> ${rarityDisplay}</span>
326 <span> - </span>
327 <small>${typesDisplay}</small>
328 </div>
329 <div>
330 Disappears at ${pad(disappearDate.getHours())}:${pad(disappearDate.getMinutes())}:${pad(disappearDate.getSeconds())}
331 <span class='label-countdown' disappears-at='${disappearTime}'>(00m00s)</span>
332 </div>
333 <div>
334 Location: ${latitude.toFixed(6)}, ${longitude.toFixed(7)}
335 </div>
336 <div>
337 <a href='javascript:excludePokemon(${id})'>Exclude</a>&nbsp;&nbsp
338 <a href='javascript:notifyAboutPokemon(${id})'>Notify</a>&nbsp;&nbsp
339 <a href='javascript:removePokemonMarker("${encounterId}")'>Remove</a>&nbsp;&nbsp
340 <a href='javascript:void(0);' onclick='javascript:openMapDirections(${latitude},${longitude});' title='View in Maps'>Get directions</a>
341 </div>`
342 return contentstring
343}
344
345function gymLabel (teamName, teamId, gymPoints, latitude, longitude, lastScanned = null, name = null, members = []) {
346 var memberStr = ''

Callers 1

customizePokemonMarkerFunction · 0.85

Calls 2

getTypeSpanFunction · 0.85
padFunction · 0.85

Tested by

no test coverage detected