PageSourceSearch

https://app.avenria.com/js/parcours.js

js avenria.com collected 2026-10-06 17:08:05 UTC 7,054 bytes, 174 lines download raw bytes

1$(document).ready(function () {
2    "use strict";
3    const user = isUser();
4
5    let firstBlocIsNull = $('#parcours-confidence-first').attr('data-value');
6
7    if ((user) && (!firstBlocIsNull)){
8        $('.js-confidence-box').each(function() {
9            $(this).attr('data-choice', 'first');
10        })
11        $('#ModalConfidence').modal('show');
12    }
13
14    $('#parcours-confidence-second').on('click', function () {
15         let val = $(this).attr('data-value');
16            $('.js-confidence-box').each(function() {
17                $(this).attr('data-choice', 'second');
18                $(this).attr('data-parcours-name', 'Deuxième ressenti');
19                $(this).css('background-color', '#705d9e');
20            })
21            if (val === '') {
22                $('#ModalConfidence').modal('show');
23            }
24    })
25    $('#parcours-confidence-voie').on('click', function () {
26        let thirdBlocIsNull = $('#parcours-confidence-second').attr('data-value');
27        let hasDataValue = $(this).attr('data-value');
28        if ((thirdBlocIsNull) && (hasDataValue === "")) {
29            $('#ModalConfidenceVoie').modal('show');
30        }
31    })
32    $('.js-confidence-box, .js-confidence-box-voie, .has-find-way').on("click", function ()
33    {
34        const id = $(this).attr('data-user');
35        const confidenceValue = $(this).attr('data-confidence-value');
36        const analyseData = $('#parcours-analyse').attr('data-count-analyse');
37        const likedJobs = $('#parcours-liked-jobs').attr('data-liked-jobs');
38        let choiceState = $(this).attr('data-choice');
39        let path = $(this).attr('data-path');
40        path = path.replace('P1', id);
41        let parcoursName = $(this).attr('data-parcours-name');
42        let pathParcours = $(this).parent().attr('data-path-parcours');
43        let libelle = null;
44        if (choiceState === 'voie') {
45            libelle = $(this).attr('data-libelle');
46        }
47
48        $.ajax({
49            method: "post",
50            url: path,
51            data: {idUser: id, value: confidenceValue, choice: choiceState },
52            success: function(response){
53                if (response === 'success')
54                {
55                    if (choiceState === 'second') {
56                        $('#parcours-confidence-second').attr('data-value', confidenceValue);
57                        $('#ModalConfidence').modal('hide');
58                        return false;
59                    }
60                    let parent = $("#parcours-confidence-" + choiceState);
61                    let pathUnlockImg = parent.find('img').attr('data-unlock');
62                    parent.attr('data-value', confidenceValue);
63
64                    $("#confidence-" + choiceState)
65                        .fadeOut(400, function() {
66                            parent.find('img').attr('src', pathUnlockImg);
67                            parent.removeClass('parcours-bloc-lock')
68
69                            if (choiceState === 'voie') {
70                                $('#confidence-' + choiceState).text(libelle);
71                                if (confidenceValue === 'Trouvé'){
72                                    $(".voie-confidence-choice" ).fadeOut( "slow", function() {
73                                        $(".has-find-way-parcours").removeClass('d-none');
74                                        showUserIdentifier();
75                                    });
76                                } else {
77                                    $(".voie-confidence-choice" ).fadeOut( "slow", function() {
78                                        $(".has-notFind-way-parcours").removeClass('d-none');
79                                    });
80                                    $('.has-find-way').on('click', function (){
81                                        $(".has-notFind-way-parcours").fadeOut( "slow", function() {
82                                            $(".has-find-way-parcours").removeClass('d-none');
83                                            showUserIdentifier();
84                                        });
85                                    })
86                                    needHelp();
87                                }
88
89                                setTimeout(function() {
90                                    $('.parcours-fully-complete').removeClass('d-none');
91                                }, 2000)
92
93                            } else {
94
95                                $('#ModalConfidence').modal('hide');
96                                $('#confidence-' + choiceState).text("Je suis " + confidenceValue + '.e');
97                                if ((analyseData > 0) && (likedJobs > 0)) {
98                                    window.location.reload(true);
99                                }
100                            }
101
102                        })
103                        .fadeIn(400);
104
105
106
107                } else if (response === 'error') {
108                    messager.error('', 'Une erreur est survenue :(');
109                }
110            }
111        })
112    });
113
114    $('.download-numeric-book').on('click', function () {
115        let attr = $(this).attr('href');
116        console.log(attr)
117        if (typeof attr !== 'undefined' && attr !== false && isUser()) {
118            let path = $(this).attr('data-path');
119            let pathToParcours = $(this).attr('data-pathToParcours');
120            $.ajax({
121                method: 'POST',
122                url: path,
123                success: function(response) {
124                    if (response === 'success')
125                    {
126                        unlockParcours('Livret Numérique', pathToParcours)
127                    }
128                }
129            })
130        }
131    });
132
133    $('.parcours-school-ressources').on('click', function () {
134        if (isUser()) {
135            let path = $(this).attr('data-path');
136            let pathToParcours = $(this).attr('data-pathToParcours');
137            $.ajax({
138                method: 'POST',
139                url: path,
140                success: function(response) {
141                    if (response === 'success')
142                    {
143                        unlockParcours('Ressources Pédagogiques', pathToParcours)
144                    }
145                }
146            })
147        }
148    });
149});
150
151    function showUserIdentifier() {
152    $('.show-user-identifiant').on('click', function (){
153        let identifier = $(this).attr('data-user-identifiant');
154        $(this).html(identifier);
155    })
156}
157
158    function needHelp() {
159        $('.parcours-help').on('click', function (){
160            let path = $(this).attr('data-path');
161            $.ajax({
162                method: 'POST',
163                url: path,
164                success: function(response) {
165                    if (response === 'success')
166                    {
167                        $(".has-notFind-way-parcours").fadeOut( "slow", function() {
168                            $(".parcours-help-done").removeClass('d-none');
169                        });
170                    }
171                }
172            })
173        })
174    }

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.