Ingress Intel Total Conversion (Community Edition)

repository·master·Indexed 43 days ago

https://github.com/iitc-ce/ingress-intel-total-conversion

A community-driven modification of the Ingress Intel map that provides enhanced features and improved performance. It functions as a browser add-on for desktop and is available via mobile applications for Android and iOS. The project provides an API for developers to build custom plugins, including mobile-specific functions for file saving, clipboard access, and intent-based location sharing.

Tokens
1.5K
Snippets
5
Records
13
Agent score
56%

What's inside IITC

  1. Detect if running in standalone app mode

    master

    The window.isApp boolean flag indicates whether the IITC environment is running as a standalone mobile application or within a standard web browser. This is determined by the presence of the app or android global objects.

    Use this flag to conditionally execute code that relies on mobile-specific APIs or to adjust UI behavior for mobile users.

    if (window.isApp) {
      // Execute mobile-specific logic
    }
  2. Reference Leaflet-related external dependencies

    master

    The following Leaflet-related libraries and versions are used within the IITC-CE project:

  3. Save files to the mobile device

    master

    When running in a standalone app environment, you can use window.saveFile to trigger a file save operation on the device. This wraps the underlying window.app.saveFile method.

    Parameters:

    • data: The content to be saved.
    • filename (optional): The desired name of the file.
    • dataType (optional): The MIME type (defaults to */*).
    window.saveFile('Hello World', 'hello.txt', 'text/plain');
  4. Share portal or map location via intent links

    master

    The standalone app provides mechanisms to share locations using intentPosLink. This allows the app to provide interfaces for sharing URLs, navigating via Google Maps, or other geo-intents.

    Usage in Portal Display: If window.app.intentPosLink is available, a 'Share portal' link is automatically appended to the .linkdetails container in the portal display. This link uses the portal's coordinates and GUID.

    Usage for Map View: If window.app.intentPosLink is available, clicking the #permalink element will trigger a share intent for the current map center and zoom level.

  5. Determine if app panes should be used

    master

    The window.useAppPanes() function returns a boolean indicating whether the application should utilize mobile app panes. It returns true only if:

    1. The environment is a standalone app (isApp is true).
    2. The app.addPane method is available.
    3. The device is identified as a smartphone via IITC.utils.isSmartphone().

    window.useAndroidPanes is provided as a compatibility alias for useAppPanes.

    if (window.useAppPanes()) {
      // Use mobile panes
    }
  6. Deprecated: Request files via callback

    master

    The window.requestFile(callback) function is deprecated. It uses L.FileListLoader to load files and passes the filename and file content to the provided callback.

    Note: Use modern file handling methods instead of this legacy wrapper.

    window.requestFile(function(name, content) {
      console.log('Loaded:', name);
    });