PageSourceSearch

https://tallymint.app/guides-search.js

js tallymint.app collected 2026-10-03 20:07:16 UTC 5,856 bytes, 102 lines download raw bytes

1// Guides hub live search: filters guide cards in place and surfaces matching
2// FAQ entries. Keep the FAQ list below in sync with the FAQ section on
3// /faq (ids are the faq-item anchors there).
4//
5// ⛔ THE TARGET PAGE IS /faq, NOT THE HOMEPAGE, as of r175. The homepage keeps
6// only five of the twenty questions (with their ids unchanged); all twenty live
7// on /faq. A hit that still built "/#" + id would land on the homepage and, for
8// fifteen of the twenty, scroll to an anchor that is no longer there.
9(function () {
10  const input = document.getElementById("guideSearch");
11  if (!input) return;
12
13  const cards = Array.from(document.querySelectorAll(".guide-cards .guide-card"));
14  const groups = Array.from(document.querySelectorAll(".guide-group"));
15  const start = document.getElementById("guideStart");
16  const faqBox = document.getElementById("faqResults");
17  const faqList = document.getElementById("faqResultsList");
18  const noRes = document.getElementById("guideNoResults");
19  const noResQ = document.getElementById("guideNoResultsQ");
20
21  // Mirrors the FAQ accordions on /faq, ids included. The FAQPage JSON-LD lives
22  // on that page and is generated from the same accordions, so when the FAQ
23  // changes: update this list too or the hub search silently stops finding the
24  // new answers.
25  const FAQS = [
26    { q: "What is TallyMint?", id: "faq-what-is", tags: "about overview app windows web what is" },
27    { q: "What is the difference between TallyMint Desktop and TallyMint Web?", id: "faq-desktop-vs-web", tags: "difference desktop web compare versus vs subscription one time which one browser" },
28    { q: "How do I sign up for TallyMint Web?", id: "faq-web-signup", tags: "sign up signup subscribe web account create login sign in plan checkout start trial" },
29    { q: "How much does TallyMint Web cost?", id: "faq-web-price", tags: "price cost subscription monthly yearly standard plus plan extra bank connections addon" },
30    { q: "What are the system requirements?", id: "faq-requirements", tags: "windows 10 11 64-bit offline install requirements browser" },
31    { q: "Can I import my data from another finance app?", id: "faq-import", tags: "qif ofx csv quicken import migrate another app" },
32    { q: "Can I organize accounts into groups?", id: "faq-account-groups", tags: "sidebar groups organize accounts subtotal collapse drag order" },
33    { q: "Which banks are supported?", id: "faq-banks", tags: "simplefin bridge plaid ofx direct connect chase bank of america sync supported banks" },
34    { q: "Is my data in the cloud?", id: "faq-cloud", tags: "privacy local encrypted file offline cloud google drive server database web" },
35    { q: "Can I cancel TallyMint Web any time?", id: "faq-web-cancel", tags: "cancel cancellation subscription end read only unsubscribe stop billing" },
36    { q: "Can I move my data between the desktop app and the web app?", id: "faq-move-data", tags: "move data desktop web transfer export import qif switch between sync workspace budgets recurring holdings" },
37    { q: "Does TallyMint have dark mode?", id: "faq-dark-mode", tags: "dark mode theme light night appearance" },
38    { q: "What if I forget my master password?", id: "faq-password", tags: "reset recover encryption locked out forgot password" },
39    { q: "What happens after the trial?", id: "faq-trial", tags: "30 day 7 day free trial license buy price purchase read only" },
40    { q: "Does TallyMint require a credit card?", id: "faq-credit-card", tags: "credit card required trial free account sign up no card payment billing" },
41    { q: "Can I move TallyMint to a new computer?", id: "faq-new-pc", tags: "transfer new pc computer license reinstall" },
42    { q: "What if I buy it and change my mind?", id: "faq-refund", tags: "refund money back guarantee return subscription charge" },
43    { q: "What happens to my data if TallyMint shuts down?", id: "faq-shutdown", tags: "shuts down sunset export qif lock-in future" },
44    { q: "Do I get future updates?", id: "faq-updates", tags: "updates auto update free new versions" },
45    { q: "Does it work on Mac, Linux, or my phone?", id: "faq-mac-linux", tags: "mac linux windows platform phone iphone android mobile tablet browser" }
46  ];
47
48  cards.forEach((c) => {
49    c.dataset.text = (c.textContent + " " + (c.dataset.tags || "")).toLowerCase();
50  });
51
52  function matches(text, toks) {
53    return toks.every((t) => text.indexOf(t) !== -1);
54  }
55
56  function apply() {
57    const q = input.value.trim();
58    const toks = q.toLowerCase().split(/\s+/).filter(Boolean);
59    const searching = toks.length > 0;
60
61    start.hidden = searching;
62
63    let visible = 0;
64    cards.forEach((c) => {
65      const show = !searching || matches(c.dataset.text, toks);
66      c.hidden = !show;
67      if (show) visible++;
68    });
69    groups.forEach((g) => {
70      g.hidden = !Array.from(g.querySelectorAll(".guide-card")).some((c) => !c.hidden);
71    });
72
73    let faqMatches = [];
74    if (searching) {
75      faqMatches = FAQS.filter((f) => matches((f.q + " " + f.tags).toLowerCase(), toks));
76      faqList.innerHTML = "";
77      faqMatches.forEach((f) => {
78        const a = document.createElement("a");
79        a.className = "faq-result";
80        a.href = "/faq#" + f.id;
81        a.textContent = f.q;
82        faqList.appendChild(a);
83      });
84    }
85    faqBox.hidden = !searching || faqMatches.length === 0;
86
87    const none = searching && visible === 0 && faqMatches.length === 0;
88    noRes.hidden = !none;
89    if (none) noResQ.textContent = q;
90  }
91
92  input.addEventListener("input", apply);
93  input.addEventListener("keydown", (e) => {
94    if (e.key === "Escape") {
95      input.value = "";
96      apply();
97    } else if (e.key === "Enter" && input.value.trim()) {
98      const first = cards.find((c) => !c.hidden) || faqList.querySelector("a");
99      if (first) first.click();
100    }
101  });
102})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.