367 lines
		
	
	
		
			11 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			367 lines
		
	
	
		
			11 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
/*
 | 
						|
 * This Source Code Form is subject to the terms of the Mozilla Public
 | 
						|
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 | 
						|
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 | 
						|
 */
 | 
						|
 | 
						|
var SETTINGS = {
 | 
						|
    cacheversion: "v1.5.0_0",
 | 
						|
    activitylog_maxlength: 500,
 | 
						|
    maptileurls: {
 | 
						|
        liberty: {
 | 
						|
            url: "https://maps.netsyms.net/styles/osm-liberty/{z}/{x}/{y}.png",
 | 
						|
            json: "https://maps.netsyms.net/styles/osm-liberty/style.json",
 | 
						|
            name: "Liberty",
 | 
						|
            bgcolor: "#EFEFEF"
 | 
						|
        },
 | 
						|
        terrain: {
 | 
						|
            url: "https://maps.netsyms.net/styles/klokantech-terrain/{z}/{x}/{y}.png",
 | 
						|
            json: "https://maps.netsyms.net/styles/klokantech-terrain/style.json",
 | 
						|
            name: "Terrain",
 | 
						|
            bgcolor: "#EDF5F3"
 | 
						|
        },
 | 
						|
        fiord: {
 | 
						|
            url: "https://maps.netsyms.net/styles/fiord-color/{z}/{x}/{y}.png",
 | 
						|
            json: "https://maps.netsyms.net/styles/fiord-color/style.json",
 | 
						|
            name: "Dark Fiord",
 | 
						|
            bgcolor: "#45516E"
 | 
						|
        },
 | 
						|
        oledblack: {
 | 
						|
            url: "https://maps.netsyms.net/styles/oled-black/{z}/{x}/{y}.png",
 | 
						|
            json: "https://maps.netsyms.net/styles/oled-black/style.json",
 | 
						|
            name: "OLED Black",
 | 
						|
            bgcolor: "#000000"
 | 
						|
        }
 | 
						|
    },
 | 
						|
    alertsounds: {
 | 
						|
        coin: {
 | 
						|
            name: "Coin",
 | 
						|
            file: "alert.coin.mp3"
 | 
						|
        },
 | 
						|
        jump: {
 | 
						|
            name: "Jump",
 | 
						|
            file: "alert.jump.mp3"
 | 
						|
        },
 | 
						|
        robot: {
 | 
						|
            name: "Robot",
 | 
						|
            file: "alert.robot.mp3"
 | 
						|
        },
 | 
						|
        sonar: {
 | 
						|
            name: "Sonar",
 | 
						|
            file: "alert.sonar.mp3"
 | 
						|
        }
 | 
						|
    },
 | 
						|
    /*
 | 
						|
     * id = key: internal type ID
 | 
						|
     * name: human-readable type label
 | 
						|
     * icon: CSS classes for displaying an icon with <i class="[icon]"></i>
 | 
						|
     * mapicon: assets/images/[mapicon].png
 | 
						|
     * pluralmapicon: same as mapicon but when there's more than one of the type
 | 
						|
     * selected: true for the default type, not present for other entries
 | 
						|
     * allowedlocationtypes: Pipe-seperated list of location types this item can be delivered to. Should include "address" somewhere to keep the server happy.
 | 
						|
     */
 | 
						|
    itemtypes: {
 | 
						|
        package: {
 | 
						|
            id: "package",
 | 
						|
            name: "Package",
 | 
						|
            icon: "fas fa-box fa-fw",
 | 
						|
            mapicon: "box",
 | 
						|
            pluralmapicon: "boxes",
 | 
						|
            selected: true,
 | 
						|
            allowedlocationtypes: "locker|address"
 | 
						|
        },
 | 
						|
        large: {
 | 
						|
            id: "large",
 | 
						|
            name: "Large Package",
 | 
						|
            icon: "fas fa-pallet fa-fw",
 | 
						|
            mapicon: "largebox",
 | 
						|
            pluralmapicon: "largeboxes",
 | 
						|
            allowedlocationtypes: "address"
 | 
						|
        },
 | 
						|
        small: {
 | 
						|
            id: "small",
 | 
						|
            name: "Small Package",
 | 
						|
            icon: "fas fa-envelope-square fa-fw",
 | 
						|
            mapicon: "smallpackage",
 | 
						|
            pluralmapicon: "smallpackages",
 | 
						|
            allowedlocationtypes: "mailbox|locker|address"
 | 
						|
        },
 | 
						|
        letter: {
 | 
						|
            id: "letter",
 | 
						|
            name: "Letter",
 | 
						|
            icon: "fas fa-envelope fa-fw",
 | 
						|
            mapicon: "envelope",
 | 
						|
            pluralmapicon: "envelopes",
 | 
						|
            allowedlocationtypes: "mailbox|address"
 | 
						|
        },
 | 
						|
        signature: {
 | 
						|
            id: "signature",
 | 
						|
            name: "Signature Item",
 | 
						|
            icon: "fas fa-file-signature fa-fw",
 | 
						|
            mapicon: "signature",
 | 
						|
            pluralmapicon: "signatures",
 | 
						|
            allowedlocationtypes: "address"
 | 
						|
        },
 | 
						|
        express: {
 | 
						|
            id: "express",
 | 
						|
            name: "Express Item",
 | 
						|
            icon: "fas fa-shipping-fast fa-fw",
 | 
						|
            mapicon: "express",
 | 
						|
            pluralmapicon: "multiple-items",
 | 
						|
            allowedlocationtypes: "address"
 | 
						|
        }
 | 
						|
    },
 | 
						|
    weathericons: [
 | 
						|
        "clear",
 | 
						|
        "cloudy",
 | 
						|
        "partly-cloudy",
 | 
						|
        "rain",
 | 
						|
        "snow",
 | 
						|
        "windy",
 | 
						|
        "none"
 | 
						|
    ],
 | 
						|
    scannerevents: [
 | 
						|
        {
 | 
						|
            button: 1,
 | 
						|
            title: "Delivered",
 | 
						|
            type: "event",
 | 
						|
            after: [
 | 
						|
                {
 | 
						|
                    button: 1,
 | 
						|
                    title: "In/At Mailbox",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 2,
 | 
						|
                    title: "Front Door/Porch",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 3,
 | 
						|
                    title: "Left with Individual at Address",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 4,
 | 
						|
                    title: "Front Desk/Reception/Mail Room",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 5,
 | 
						|
                    title: "Parcel Locker",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 6,
 | 
						|
                    title: "Garage or Other Location at Address",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 7,
 | 
						|
                    title: "Left with Neighbor",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 'G',
 | 
						|
                    title: "Authorized Agent",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 'U',
 | 
						|
                    title: "Tendered to Authorized Agent",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                }
 | 
						|
            ]
 | 
						|
        },
 | 
						|
        {
 | 
						|
            button: 2,
 | 
						|
            title: "Attempted",
 | 
						|
            type: "event",
 | 
						|
            after: [
 | 
						|
                {
 | 
						|
                    button: 2,
 | 
						|
                    title: "No Secure Location Available",
 | 
						|
                    type: "type",
 | 
						|
                    after: "3849"
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 3,
 | 
						|
                    title: "No Access or Business Closed",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 4,
 | 
						|
                    title: "Receptacle Full/Item Oversized",
 | 
						|
                    type: "type",
 | 
						|
                    after: "3849"
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 5,
 | 
						|
                    title: "Customer Hold",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 6,
 | 
						|
                    title: "Animal Interference",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                }
 | 
						|
            ]
 | 
						|
        },
 | 
						|
        {
 | 
						|
            button: 3,
 | 
						|
            title: "Return to Sender or Forward",
 | 
						|
            type: "event",
 | 
						|
            after: [
 | 
						|
                {
 | 
						|
                    button: 1,
 | 
						|
                    title: "Forwarded",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 2,
 | 
						|
                    title: "Insufficient Address",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 3,
 | 
						|
                    title: "No Such Number",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 4,
 | 
						|
                    title: "Addressee Unknown",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 5,
 | 
						|
                    title: "Vacant",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 6,
 | 
						|
                    title: "Unable to Forward / Forward Order Expired",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 7,
 | 
						|
                    title: "Deceased",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 8,
 | 
						|
                    title: "Refused",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 9,
 | 
						|
                    title: "Returned for Other Reason",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                }
 | 
						|
            ]
 | 
						|
        },
 | 
						|
        {
 | 
						|
            button: 4,
 | 
						|
            title: "Other",
 | 
						|
            type: "event",
 | 
						|
            after: [
 | 
						|
                {
 | 
						|
                    button: 'X',
 | 
						|
                    title: "Dispatch to Military/Diplomatic PO",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 1,
 | 
						|
                    title: "Return to Post Office Not Attempted / Delivery Delay",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 2,
 | 
						|
                    title: "Local Weather Delay",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 3,
 | 
						|
                    title: "Visible Damage",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                },
 | 
						|
                {
 | 
						|
                    button: 4,
 | 
						|
                    title: "Out for Delivery",
 | 
						|
                    type: "type",
 | 
						|
                    after: false
 | 
						|
                }
 | 
						|
            ]
 | 
						|
        }
 | 
						|
    ],
 | 
						|
    routenotetoggles: [
 | 
						|
        {
 | 
						|
            name: "Vacant",
 | 
						|
            id: "vacant",
 | 
						|
            preventsDelivery: true,
 | 
						|
            reason: "is vacant",
 | 
						|
            icon: "far fa-circle"
 | 
						|
        },
 | 
						|
        {
 | 
						|
            name: "No Mail Receptacle",
 | 
						|
            id: "nmr",
 | 
						|
            preventsDelivery: true,
 | 
						|
            reason: "has no mailbox",
 | 
						|
            icon: "far fa-times-circle"
 | 
						|
        },
 | 
						|
        {
 | 
						|
            name: "Outside delivery radius",
 | 
						|
            id: "undeliverable",
 | 
						|
            preventsDelivery: true,
 | 
						|
            reason: "is too far from the route",
 | 
						|
            icon: "fas fa-route"
 | 
						|
        },
 | 
						|
        {
 | 
						|
            name: "On hold",
 | 
						|
            id: "hold",
 | 
						|
            preventsDelivery: true,
 | 
						|
            reason: "is on hold",
 | 
						|
            icon: "fas fa-pause-circle"
 | 
						|
        }
 | 
						|
    ],
 | 
						|
    synckeyblacklist: [
 | 
						|
        "username", "password", "trackingcodehistory", "packages",
 | 
						|
        "user_latitude", "user_longitude", "geocode_cache", "scanevents",
 | 
						|
        "lastsync", "lastchange"
 | 
						|
    ],
 | 
						|
    geocodecacheexpiry: 604800, // One week
 | 
						|
    geocodeapi: "https://apis.netsyms.net/packagehelper/geocode.php",
 | 
						|
    trackingapi: "https://apis.netsyms.net/packagehelper/track.php",
 | 
						|
    weatherapi: "https://apis.netsyms.net/packagehelper/weather.php",
 | 
						|
    geoipapi: "https://apis.netsyms.net/packagehelper/geoip.php",
 | 
						|
    sharelistapi: "https://apis.netsyms.net/packagehelper/sharepackagelist.php",
 | 
						|
    loginurl: "https://apis.netsyms.net/packagehelper/login/",
 | 
						|
    syncapi: "https://apis.netsyms.net/packagehelper/sync.php",
 | 
						|
    mapfixapi: "https://apis.netsyms.net/packagehelper/contribgeocode.php",
 | 
						|
    addrlookupapi: "https://apis.netsyms.net/packagehelper/addresslookup.php"
 | 
						|
}
 |