345 lines
7.9 KiB
JavaScript
345 lines
7.9 KiB
JavaScript
|
|
// ============
|
||
|
|
// Content Page
|
||
|
|
// ============
|
||
|
|
|
||
|
|
$(document).ready(function () {
|
||
|
|
|
||
|
|
var $application = $("#APPLICATION_MNEMONIC").val(), $sessionStorage = JSON.parse(sessionStorage.getItem($application) || "{}");
|
||
|
|
|
||
|
|
// ============
|
||
|
|
// Navbar Links
|
||
|
|
// ============
|
||
|
|
|
||
|
|
// -------------
|
||
|
|
// Search Voters
|
||
|
|
// -------------
|
||
|
|
|
||
|
|
$(".search-voters").on("click", function () {
|
||
|
|
|
||
|
|
$sessionStorage.action = "VoterSearch.searchVoters";
|
||
|
|
|
||
|
|
sessionStorage.setItem($application, JSON.stringify($sessionStorage));
|
||
|
|
|
||
|
|
formSubmit($sessionStorage);
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// -----------------------------
|
||
|
|
// Search Recreational Licensing
|
||
|
|
// -----------------------------
|
||
|
|
|
||
|
|
$(".search-recreational-licenses").on("click", function () {
|
||
|
|
|
||
|
|
$sessionStorage.action = "FWCLicenses.searchRecreationalLicenses";
|
||
|
|
|
||
|
|
sessionStorage.setItem($application, JSON.stringify($sessionStorage));
|
||
|
|
|
||
|
|
formSubmit($sessionStorage);
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// ---------------------------
|
||
|
|
// Search Commercial Licensing
|
||
|
|
// ---------------------------
|
||
|
|
|
||
|
|
$(".search-commercial-licenses").on("click", function () {
|
||
|
|
|
||
|
|
$sessionStorage.action = "FWCLicenses.searchCommercialLicenses";
|
||
|
|
|
||
|
|
sessionStorage.setItem($application, JSON.stringify($sessionStorage));
|
||
|
|
|
||
|
|
formSubmit($sessionStorage);
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// ============
|
||
|
|
// Manage Links
|
||
|
|
// ============
|
||
|
|
|
||
|
|
// ------
|
||
|
|
// Voters
|
||
|
|
// ------
|
||
|
|
|
||
|
|
$(".manage-voter-records").on("click", function () {
|
||
|
|
|
||
|
|
$sessionStorage.action = "Voters.manageVoters";
|
||
|
|
|
||
|
|
sessionStorage.setItem($application, JSON.stringify($sessionStorage));
|
||
|
|
|
||
|
|
formSubmit($sessionStorage);
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// ------
|
||
|
|
// Voters
|
||
|
|
// ------
|
||
|
|
|
||
|
|
$(".manage-voter-history-records").on("click", function () {
|
||
|
|
|
||
|
|
$sessionStorage.action = "VoterHistory.manageVoterHistory";
|
||
|
|
|
||
|
|
sessionStorage.setItem($application, JSON.stringify($sessionStorage));
|
||
|
|
|
||
|
|
formSubmit($sessionStorage);
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// =============
|
||
|
|
// Reports Links
|
||
|
|
// =============
|
||
|
|
|
||
|
|
// -------------
|
||
|
|
// Select Report
|
||
|
|
// -------------
|
||
|
|
|
||
|
|
$(".select-report").on("click", function () {
|
||
|
|
|
||
|
|
$sessionStorage.action = "Reports.selectReport";
|
||
|
|
$sessionStorage.pagination = "first";
|
||
|
|
$sessionStorage.find_report = "";
|
||
|
|
|
||
|
|
sessionStorage.setItem($application, JSON.stringify($sessionStorage));
|
||
|
|
|
||
|
|
formSubmit($sessionStorage);
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// ===========
|
||
|
|
// Setup Links
|
||
|
|
// ===========
|
||
|
|
|
||
|
|
// ------------
|
||
|
|
// County Codes
|
||
|
|
// ------------
|
||
|
|
|
||
|
|
$(".setup-county-codes").on("click", function () {
|
||
|
|
|
||
|
|
$sessionStorage.action = "CountyCodes.setupCountyCodes";
|
||
|
|
$sessionStorage.pagination = "first";
|
||
|
|
$sessionStorage.find_county_code = "";
|
||
|
|
|
||
|
|
sessionStorage.setItem($application, JSON.stringify($sessionStorage));
|
||
|
|
|
||
|
|
formSubmit($sessionStorage);
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// -------------
|
||
|
|
// History Codes
|
||
|
|
// -------------
|
||
|
|
|
||
|
|
$(".setup-history-codes").on("click", function () {
|
||
|
|
|
||
|
|
$sessionStorage.action = "HistoryCodes.setupHistoryCodes";
|
||
|
|
$sessionStorage.pagination = "first";
|
||
|
|
$sessionStorage.find_history_code = "";
|
||
|
|
|
||
|
|
sessionStorage.setItem($application, JSON.stringify($sessionStorage));
|
||
|
|
|
||
|
|
formSubmit($sessionStorage);
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// -----------------
|
||
|
|
// Political Parties
|
||
|
|
// -----------------
|
||
|
|
|
||
|
|
$(".setup-political-parties").on("click", function () {
|
||
|
|
|
||
|
|
$sessionStorage.action = "PoliticalParties.setupPoliticalParties";
|
||
|
|
$sessionStorage.pagination = "first";
|
||
|
|
$sessionStorage.find_political_party = "";
|
||
|
|
|
||
|
|
sessionStorage.setItem($application, JSON.stringify($sessionStorage));
|
||
|
|
|
||
|
|
formSubmit($sessionStorage);
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// ----------
|
||
|
|
// Race Codes
|
||
|
|
// ----------
|
||
|
|
|
||
|
|
$(".setup-race-codes").on("click", function () {
|
||
|
|
|
||
|
|
$sessionStorage.action = "RaceCodes.setupRaceCodes";
|
||
|
|
$sessionStorage.pagination = "first";
|
||
|
|
$sessionStorage.find_race_code = "";
|
||
|
|
|
||
|
|
sessionStorage.setItem($application, JSON.stringify($sessionStorage));
|
||
|
|
|
||
|
|
formSubmit($sessionStorage);
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// -----
|
||
|
|
// Users
|
||
|
|
// -----
|
||
|
|
|
||
|
|
$(".setup-users").on("click", function () {
|
||
|
|
|
||
|
|
$sessionStorage.action = "Users.setupUsers";
|
||
|
|
$sessionStorage.pagination = "first";
|
||
|
|
$sessionStorage.find_user = "";
|
||
|
|
|
||
|
|
sessionStorage.setItem($application, JSON.stringify($sessionStorage));
|
||
|
|
|
||
|
|
formSubmit($sessionStorage);
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// -------------
|
||
|
|
// Subscriptions
|
||
|
|
// -------------
|
||
|
|
|
||
|
|
$(".setup-subscriptions").on("click", function () {
|
||
|
|
|
||
|
|
$sessionStorage.action = "Subscriptions.setupSubscriptions";
|
||
|
|
$sessionStorage.pagination = "first";
|
||
|
|
$sessionStorage.find_subscription = "";
|
||
|
|
|
||
|
|
sessionStorage.setItem($application, JSON.stringify($sessionStorage));
|
||
|
|
|
||
|
|
formSubmit($sessionStorage);
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// ---------
|
||
|
|
// Dropdowns
|
||
|
|
// ---------
|
||
|
|
|
||
|
|
$(".setup-dropdowns").on("click", function () {
|
||
|
|
|
||
|
|
sessionStorage.removeItem($application);
|
||
|
|
|
||
|
|
formSubmit({action: "Dropdowns.setupDropdowns"});
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
// ===================
|
||
|
|
// User Dropdown Links
|
||
|
|
// ===================
|
||
|
|
|
||
|
|
// -----------------------
|
||
|
|
// Toggle Dark/Light Theme
|
||
|
|
// -----------------------
|
||
|
|
|
||
|
|
$(".toggle-theme").on("click", function () {
|
||
|
|
|
||
|
|
formPost({action: "toggleTheme"});
|
||
|
|
|
||
|
|
if (document.documentElement.getAttribute("data-bs-theme") === "dark") {
|
||
|
|
document.documentElement.setAttribute("data-bs-theme", "light");
|
||
|
|
} else {
|
||
|
|
document.documentElement.setAttribute("data-bs-theme", "dark");
|
||
|
|
}
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// ---------------
|
||
|
|
// Sign out system
|
||
|
|
// ---------------
|
||
|
|
|
||
|
|
$(".sign-out").on("click", function () {
|
||
|
|
|
||
|
|
formPost({action: "signout"});
|
||
|
|
|
||
|
|
window.location.reload();
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// --------------------
|
||
|
|
// Setup Dropdown Types
|
||
|
|
// --------------------
|
||
|
|
|
||
|
|
$(".setup-dropdowntypes").on("click", function () {
|
||
|
|
|
||
|
|
$sessionStorage.action = "Dropdowns.setupDropdowntypes";
|
||
|
|
$sessionStorage.pagination = "first";
|
||
|
|
|
||
|
|
sessionStorage.setItem($application, JSON.stringify($sessionStorage));
|
||
|
|
|
||
|
|
formSubmit($sessionStorage);
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// ------------
|
||
|
|
// View Journal
|
||
|
|
// ------------
|
||
|
|
|
||
|
|
$(".view-journal").on("click", function () {
|
||
|
|
|
||
|
|
$sessionStorage.action = "Journal.viewJournal";
|
||
|
|
$sessionStorage.pagination = "first";
|
||
|
|
|
||
|
|
sessionStorage.setItem($application, JSON.stringify($sessionStorage));
|
||
|
|
|
||
|
|
formSubmit($sessionStorage);
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// --------------
|
||
|
|
// Setup Popovers
|
||
|
|
// --------------
|
||
|
|
|
||
|
|
$(".setup-popovers").on("click", function () {
|
||
|
|
|
||
|
|
$sessionStorage.action = "Popovers.setupPopovers";
|
||
|
|
$sessionStorage.pagination = "first";
|
||
|
|
$sessionStorage.find_popover = "";
|
||
|
|
|
||
|
|
sessionStorage.setItem($application, JSON.stringify($sessionStorage));
|
||
|
|
|
||
|
|
formSubmit($sessionStorage);
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// -------------
|
||
|
|
// Setup Reports
|
||
|
|
// -------------
|
||
|
|
|
||
|
|
$(".setup-reports").on("click", function () {
|
||
|
|
|
||
|
|
$sessionStorage.action = "Reports.setupReports";
|
||
|
|
$sessionStorage.pagination = "first";
|
||
|
|
$sessionStorage.find_report = "";
|
||
|
|
|
||
|
|
sessionStorage.setItem($application, JSON.stringify($sessionStorage));
|
||
|
|
|
||
|
|
formSubmit($sessionStorage);
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// --------------
|
||
|
|
// Setup Statuses
|
||
|
|
// --------------
|
||
|
|
|
||
|
|
$(".setup-statuses").on("click", function () {
|
||
|
|
|
||
|
|
$sessionStorage.action = "Statuses.setupStatuses";
|
||
|
|
$sessionStorage.pagination = "first";
|
||
|
|
$sessionStorage.find_status = "";
|
||
|
|
|
||
|
|
sessionStorage.setItem($application, JSON.stringify($sessionStorage));
|
||
|
|
|
||
|
|
formSubmit($sessionStorage);
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
// --------------
|
||
|
|
// Developer Stub
|
||
|
|
// --------------
|
||
|
|
|
||
|
|
$(".run-developer-stub").on("click", function () {
|
||
|
|
|
||
|
|
$sessionStorage.action = "testing";
|
||
|
|
|
||
|
|
sessionStorage.setItem($application, JSON.stringify($sessionStorage));
|
||
|
|
|
||
|
|
formSubmit($sessionStorage);
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
});
|