/* * 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 trackingcoderegex = /^[0-9a-zA-Z]{5,40}$/; function openTrackingInfoPage(code) { if (typeof code == "undefined" || code == null || code.trim() == "") { app.input.validate("#trackingcode"); app.toast.show({ text: "Please enter a tracking code.", position: "bottom", closeTimeout: 2000 }); return; } router.navigate("/track/" + code); } function addTrackingSuggestions() { $("#tracking-history-list ul").html(""); $("#tracking-history-list-empty").addClass("display-none"); $("#tracking-history-list .list").removeClass("display-none"); var history = getTrackingHistory(); if (history == false || history.length == 0) { $("#tracking-history-list-empty").removeClass("display-none"); $("#tracking-history-list .list").addClass("display-none"); } else { for (var i = history.length - 1; i >= 0; i--) { $("#tracking-history-list ul").append('