Methods
-
createChannelTab(channelDesc)
-
Create and insert into the DOM/Mobile app the channel tab
Parameters:
Name Type Description channelDescChannelDescription channel description
-
createDefaultBaseMapLayers() → {Object.<String, Object>}
-
Initializes and returns a collection of default basemap layers. The function creates a set of base layers including CartoDB (both dark and light themes), and various Google Maps layers (Default Ingress Map, Roads, Roads with Traffic, Satellite, Hybrid, and Terrain).
Returns:
Object.<String, Object> -An object containing different basemap layers ready to be added to a map. Each property of the object is a named map layer, with its value being the corresponding Leaflet tile layer object.
-
createDefaultOverlays() → {Object.<String, L.LayerGroup>}
-
Creates and returns the default overlay layers for the map. Sets up various overlay layers including portals, links, fields, and faction-specific layers.
Returns:
Object.<String, L.LayerGroup> -An object containing overlay layers for portals, links, fields, and factions
-
createPaneButton(pane) → {jQuery}
-
Creates one of the pane buttons shown in the chat controls.
Bound through jQuery, not addEventListener: plugins switch panes by calling
.click()on the jQuery objectwindow.smartphonepublishes, and that runs jQuery-registered handlers only.Parameters:
Name Type Description panestring The pane it opens, used as both label and channel id.
Returns:
jQuery -The button.
-
fillTemplate(template, data) → {string}
-
Fills a template with data, accepting both the modern
{key}and the legacy{{ key }}placeholderParameters:
Name Type Description templatestring Template string with
{key}(or legacy{{ key }}) placeholdersdataObject Values keyed by placeholder name
Returns:
string -The filled template string
-
getPosition() → {Object}
-
Retrieves the last known map position from the URL parameters or cookies. Prioritizes URL parameters over cookies. Extracts and normalizes the latitude, longitude, and zoom level.
Returns:
Object -An object containing the map's position and zoom level, or undefined if not found.
-
normLL(lat, lng, zoom) → {Object}
-
Normalizes latitude, longitude, and zoom values. Ensures that the values are valid numbers, providing defaults if necessary.
Parameters:
Name Type Description latnumber | string Latitude value or string that can be converted to a number.
lngnumber | string Longitude value or string that can be converted to a number.
zoomnumber | string Zoom level value or string that can be converted to a number.
Returns:
Object -An object containing normalized center (latitude and longitude) and zoom level.
-
withJQueryCallbacks(promise) → {Promise}
-
Decorates a native promise with jQuery-Deferred-style
.done/.fail/.alwaysmethods, so plugins can keep chainingrequest(guid).done(...)while core code usesawait/.thenOnly these three consumption methods are provided (not
.state/.progress/.pipe/.promise); each forwards the resolved value or rejection reason to its callbacks and returns the same promise, so calls can be chained as in jQueryParameters:
Name Type Description promisePromise Native promise to decorate
Returns:
Promise -The same promise instance, with
.done,.failand.alwaysattached
Type Definitions
-
ButtonArgs
-
Properties:
Name Type Attributes Description idstring <optional>
Optional. The ID of the button.
labelstring | undefined The label text of the button.
actionfunction | undefined The onclick action for the button.
classstring | null <optional>
Optional. The class(es) for the button.
titlestring | null <optional>
Optional. The title (tooltip) for the button.
accessKeystring | null <optional>
Optional. The access key for the button.
mouseoverfunction | null <optional>
Optional. The mouseover event for the button.
iconstring | null <optional>
Optional. Icon name from FontAwesome for the button.
-
ChannelDescription
-
Hold channel description
See comm.js for examples
Properties:
Name Type Attributes Description idstring uniq id, matches 'tab' parameter for server requests
namestring visible name
inputPromptstring <optional>
(optional) string for the input prompt
inputClassstring <optional>
(optional) class to apply to #chatinput
sendMessageChannelSendMessageFn <optional>
(optional) function to send the message
requestChannelRequestFn <optional>
(optional) function to call to request new message
renderChannelRenderFn <optional>
(optional) function to render channel content,, called on tab change
localBoundsboolean <optional>
(optional) if true, reset on view change
-
ChannelRenderFn(id, oldMsgsWereAdded) → {void}
-
Parameters:
Name Type Description idstring channel id
oldMsgsWereAddedboolean true if data has been added at the top (to preserve scroll position)
Returns:
void -
ChannelRequestFn(id, getOlderMsgs, isRetry) → {void}
-
Parameters:
Name Type Description idstring channel id
getOlderMsgsboolean true if request data from a scroll to top
isRetryboolean Returns:
void -
ChannelSendMessageFn(id, message) → {void}
-
Parameters:
Name Type Description idstring channel id
messagestring input message
Returns:
void