PageSourceSearch

https://barssport-factory.ru/js/quest.js

js barssport-factory.ru collected 2026-10-08 13:57:38 UTC 1,873 bytes, 56 lines download raw bytes

1$(document).ready(function () {
2    let qjson = {}
3    let questIndex = 1
4    $(".quest .steps .step").each(function (index) {
5        $(this).attr("data-n", index + 1)
6    })
7    $(".quest .status .event").each(function (index) {
8        $(this).attr("data-n", index + 1)
9    })
10    function setQuestValues(n, name, value) {
11        qjson[n] = {
12            q: name,
13            a: value
14        }
15    }
16    // Пометка на пройденые шаги чтобы на них можно вернуться
17    function setStepCompleate(n) {
18        $(".quest .event-" + n).addClass("compleate")
19    }
20    // установка активного шага
21    function setQuestActive(n) {
22        $(".quest .step").removeClass("active")
23        $(".quest .step-" + n).addClass("active")
24        $(".quest .event").removeClass("active")
25        $(".quest .event-" + n).addClass("active")
26    }
27
28    // выбор варианта
29    $(".quest .item").on("click", function () {
30        
31        $step = $(this).closest(".step")
32        $step.find(".item").removeClass("active")
33        $(this).addClass("active")
34        index = $step.attr("data-n")
35        name = $step.find(".name").text();
36        value = $(this).find(".value").text();
37        qjson[index] = {
38            q: name,
39            a: value
40        }
41        
42        setStepCompleate(questIndex)
43        questIndex++
44        setQuestActive(questIndex)
45        // вставляем в форму
46        $(".quest .feedback input[name='value[json]']").val(JSON.stringify(qjson))
47        $(".quest .develop").text(JSON.stringify(qjson))
48    })
49
50    $(".quest .event").on("click", function () {
51        if ($(this).hasClass("compleate")) {
52            questIndex = $(this).attr("data-n")
53            setQuestActive(questIndex)
54        }
55    })
56})

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.