refactor: establish standalone application boundary
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
window.XiaobaiPageModules.register("dragon_tiger", ["dragonView"], {
|
||||
bind: bindDragonTigerEvents,
|
||||
enter: ["loadDragonTiger"],
|
||||
});
|
||||
|
||||
/* PRESERVATION-SOURCE-BEGIN app.js:2660-3028 */
|
||||
function selectDragonViewMode(mode) {
|
||||
state.dragonViewMode = mode === "profiles" ? "profiles" : "daily";
|
||||
document.querySelectorAll("[data-dragon-view-mode]").forEach((button) => {
|
||||
@@ -372,4 +372,45 @@ async function saveSeatAlias(event) {
|
||||
}
|
||||
}
|
||||
|
||||
/* PRESERVATION-SOURCE-END app.js:2660-3028 */
|
||||
|
||||
function bindDragonTigerEvents() {
|
||||
document.querySelector("#dragonRefreshButton").addEventListener("click", () => {
|
||||
if (state.dragonViewMode === "profiles") loadHotMoneyProfiles(true);
|
||||
else loadDragonTiger(true);
|
||||
});
|
||||
document.querySelector("#dragonEmptyRefreshButton").addEventListener("click", () => loadDragonTiger(true));
|
||||
document.querySelector("#dragonPreviousButton").addEventListener("click", () => shiftDate(-1));
|
||||
document.querySelector("#dragonExportButton").addEventListener("click", () => {
|
||||
if (state.dragonViewMode === "profiles") exportHotMoneyProfiles();
|
||||
else exportDragonTiger();
|
||||
});
|
||||
document.querySelectorAll("[data-dragon-view-mode]").forEach((button) => {
|
||||
button.addEventListener("click", () => selectDragonViewMode(button.dataset.dragonViewMode));
|
||||
});
|
||||
document.querySelector("#dragonSearch").addEventListener("input", (event) => {
|
||||
state.dragonQuery = event.target.value.trim().toLowerCase();
|
||||
renderDragonTraderList();
|
||||
});
|
||||
document.querySelectorAll("[data-dragon-filter]").forEach((button) => {
|
||||
button.addEventListener("click", () => {
|
||||
state.dragonFilter = button.dataset.dragonFilter;
|
||||
document.querySelectorAll("[data-dragon-filter]").forEach((item) => {
|
||||
item.classList.toggle("active", item === button);
|
||||
});
|
||||
renderDragonTraderList();
|
||||
});
|
||||
});
|
||||
document.querySelector("#hotMoneyProfileSearch").addEventListener("input", (event) => {
|
||||
state.hotMoneyProfileQuery = event.target.value.trim().toLocaleLowerCase("zh-CN");
|
||||
renderHotMoneyProfiles();
|
||||
});
|
||||
document.querySelector("#hotMoneyProfileList").addEventListener("click", (event) => {
|
||||
const button = event.target.closest("[data-hot-money-profile]");
|
||||
if (!button) return;
|
||||
state.selectedHotMoneyProfileId = button.dataset.hotMoneyProfile;
|
||||
renderHotMoneyProfiles();
|
||||
});
|
||||
window.addEventListener("resize", () => {
|
||||
if (state.activeView === "dragonView") layoutDragonCards();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user