PageSourceSearch

https://novelia.ai/javascript/decision-checklist.js

js novelia.ai collected 2026-10-05 14:32:44 UTC 1,641 bytes, 54 lines download raw bytes

1(() => {
2    const instances = new Map();
3
4    function destroy() {
5        instances.forEach((instance) => instance.destroy());
6        instances.clear();
7    }
8
9    function buildOrderMap() {
10        const orderMap = {};
11        const lists = document.querySelectorAll(".decision-act-list");
12        lists.forEach((list) => {
13            const actKey = list.getAttribute("data-decision-act") || "";
14            const ids = Array.from(list.querySelectorAll(".decision-item"))
15                .map((item) => item.getAttribute("data-decision-id"))
16                .filter((id) => id);
17            orderMap[actKey] = ids;
18        });
19        return orderMap;
20    }
21
22    function init(dotNetRef) {
23        if (!window.Sortable) {
24            console.warn("SortableJS is not loaded.");
25            return;
26        }
27
28        destroy();
29
30        const lists = document.querySelectorAll(".decision-act-list");
31        lists.forEach((list) => {
32            const actKey = list.getAttribute("data-decision-act") || "";
33            const sortable = new Sortable(list, {
34                group: "decision-acts",
35                animation: 150,
36                draggable: ".decision-item",
37                filter: ".dropdown-menu, .dropdown-item",
38                preventOnFilter: false,
39                onEnd: () => {
40                    if (dotNetRef) {
41                        dotNetRef.invokeMethodAsync("ApplyDecisionOrder", buildOrderMap());
42                    }
43                }
44            });
45
46            instances.set(actKey, sortable);
47        });
48    }
49
50    window.decisionChecklistSortable = {
51        init,
52        destroy
53    };
54})();

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.