Gitlab CSE Unil

understand.html 12.5 KB
Newer Older
M. Chardon's avatar
M. Chardon committed
1
2
3
4
5
6
7
8
<!DOCTYPE html>
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>@lea</title>
        <meta name="author" content="Marion CHARDON for ESC/RISET - University of Lausanne" />
        <meta name="description" content="Free Web tool for guess data" />
        <meta name="keywords" content="Cipher, Bigdata, Guess" />
        <meta charset="UTF-8" />
M. Chardon's avatar
M. Chardon committed
9
10
11
12
        <link rel="stylesheet" href="../node_modules/bootstrap3/dist/css/bootstrap.min.css" /> 
        <link rel="stylesheet" href="css/dashboard.css" />
        <link rel="stylesheet" href="../node_modules/font-awesome/css/font-awesome.min.css" />
        <link rel="stylesheet" href="../css/logo_unil.css" />
M. Chardon's avatar
M. Chardon committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
        <link rel="stylesheet" href="../css/main.css" />
        <style>

            .axis--x path {
                display: none;
            }

            .line {
                fill: none;
                stroke: steelblue;
                stroke-width: 1.5px;
            }

        </style>
M. Chardon's avatar
M. Chardon committed
27
28
        <script src="../node_modules/jquery/dist/jquery.min.js"></script>
        <script src="../node_modules/bootstrap3/dist/js/bootstrap.min.js"></script>
M. Chardon's avatar
M. Chardon committed
29
30
31
32
33
34
35
36
37
        <script src="js/crypto/asmcrypto.js"></script>
        <script src="js/controleur.js"></script>
        <script src="js/entities/global.js"></script>
        <script src="js/entities/modeleTwo.js"></script>
        <script src="js/entities/modeleThree.js"></script>
        <script src="js/entities/modeleFour.js"></script>
        <script src="js/entities/modeleMaskEight.js"></script>
        <script src="js/entities/resultat.js"></script>
        <script src="js/graph/d3.v4.min.js"></script>
M. Chardon's avatar
M. Chardon committed
38
39
40
41
42
43
44
45
46
        <script src="js/graph.js"></script>        
        <script src="../js/jquery.i18n/libs/CLDRPluralRuleParser/src/CLDRPluralRuleParser.js"></script>
        <script src="../js/jquery.i18n/jquery.i18n/src/jquery.i18n.js"></script>
        <script src="../js/jquery.i18n/jquery.i18n/src/jquery.i18n.messagestore.js"></script>
        <script src="../js/jquery.i18n/jquery.i18n/src/jquery.i18n.fallbacks.js"></script>
        <script src="../js/jquery.i18n/jquery.i18n/src/jquery.i18n.parser.js"></script>
        <script src="../js/jquery.i18n/jquery.i18n/src/jquery.i18n.emitter.js"></script>
        <script src="../js/jquery.i18n/jquery.i18n/src/jquery.i18n.language.js"></script>
        <script src="js/languages.js"></script>
M. Chardon's avatar
M. Chardon committed
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
    </head>
    <body>
        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="../index.html"><img src="../img/g3761.png" alt="" style="height:28px;display: inline;"/>Cryptex - @lea</a>
                </div>
                <div id="navbar" class="navbar-collapse collapse">
                    <ul class="nav navbar-nav navbar-right">
M. Chardon's avatar
M. Chardon committed
62
63
                        <li><a onclick="initLang('en');"><img style="background: white; height:25px;" alt="English" src="../img/flags/english.png"/></a></li>
                        <li><a onclick="initLang('fr');"><img style="background: white;height:25px;" alt="Français" src="../img/flags/french.png"/></a></li>
M. Chardon's avatar
M. Chardon committed
64
                        <li><a href="#" data-toggle="modal" data-target="#help"><span class="i18n" data-lang="help"></span></a></li>
M. Chardon's avatar
M. Chardon committed
65
66
67
68
69
70
71
72
73
                    </ul>
                </div>
            </div>
        </nav>   
        <div class="container" style="margin-bottom: 70px; margin-top: 20px;">

            <div class="row">
                <div class="col-sm-3">
                    <ul class="nav nav-pills nav-stacked">
M. Chardon's avatar
M. Chardon committed
74
75
76
77
                        <li><a href="index.html"><span class="i18n" data-lang="step1"></span></a></li>
                        <li><a href="pasapas.html"><span class="i18n" data-lang="step2"></span></a></li>
                        <li class="active"><a href="understand.html"><span class="i18n" data-lang="step3"></span></a></li>
                        <li><a href="games.html"><span class="i18n" data-lang="step4"></span></a></li>
M. Chardon's avatar
M. Chardon committed
78
79
80
81
82
                    </ul>
                </div>
                <div class="col-sm-9" style="padding-left: 20px;">

                    <ul class="nav nav-tabs">
M. Chardon's avatar
M. Chardon committed
83
84
                        <li class="active"><a href="understand.html"><span class="i18n" data-lang="step3_titleA"></span></a></li>
                        <li><a href="understandA.html"><span class="i18n" data-lang="step3_titleB"></span></a></li>
M. Chardon's avatar
M. Chardon committed
85
86
87
88
89
90
91
                    </ul>

                    <div class="row" style='margin-top:20px;'>
                        <div class="col-sm-12">
                            <div class="alert alert-info alert-dismissable">
                                <strong>Info!</strong>
                                <p>
M. Chardon's avatar
M. Chardon committed
92
                                    <span class="i18n" data-lang="step3_A_info1"></span>
M. Chardon's avatar
M. Chardon committed
93
94
                                </p>
                                <p>
M. Chardon's avatar
M. Chardon committed
95
                                    <span class="i18n" data-lang="step3_A_info2"></span>
M. Chardon's avatar
M. Chardon committed
96
97
                                </p>
                                <p>
M. Chardon's avatar
M. Chardon committed
98
                                    <span class="i18n" data-lang="step3_A_info3"></span>
M. Chardon's avatar
M. Chardon committed
99
100
101
102
103
104
105
106
                                </p>
                            </div>
                        </div>
                    </div>

                    <div class="row" style='margin-top:20px;'>
                        <div class="col-sm-5">
                            <div class="panel panel-info">
M. Chardon's avatar
M. Chardon committed
107
                                <div class="panel-heading"><span class="i18n" data-lang="step3_A_parameters"></span></div>
M. Chardon's avatar
M. Chardon committed
108
109
110
                                <div class="panel-body">
                                    <div class="row">
                                        <div class="col-sm-6">
M. Chardon's avatar
M. Chardon committed
111
                                            <span class="i18n" data-lang="step3_A_coef_att"></span>
M. Chardon's avatar
M. Chardon committed
112
113
114
                                            <input class="form-control" type="number" id="lambda" value="0.99" />
                                        </div>
                                        <div class="col-sm-6">
M. Chardon's avatar
M. Chardon committed
115
                                            <span class="i18n" data-lang="step3_A_mask_size"></span>
M. Chardon's avatar
M. Chardon committed
116
117
118
119
120
121
122
                                            <input class="form-control" type="number" id="taillemask" value="8" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-7">
M. Chardon's avatar
M. Chardon committed
123
                            <span class="i18n" data-lang="step1_instru"></span>.
M. Chardon's avatar
M. Chardon committed
124
125
                            <div class="row" style="padding-bottom: 10px;padding-top: 10px;">
                                <div class="col-sm-10">
M. Chardon's avatar
M. Chardon committed
126
127
                                    <button class="btn btn-default" onclick="reset();"><span class="i18n" data-lang="btn_reset"></span></button>
                                    <button class="btn btn-success" onclick="valide();$(this).hide();"><span class="i18n" data-lang="btn_valid"></span></button>
M. Chardon's avatar
M. Chardon committed
128
129
130
131
132
133
134
135
136
137
138
139
140
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <textarea class="form-control" id="userinput" style="font-size: large;"></textarea>
                                    <div id="userinputdiv" style="width: 100%;"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row" id='propositionPanel' style="display:none;">
                        <div class="col-sm-4">
                            <div class="panel panel-primary">
M. Chardon's avatar
M. Chardon committed
141
                                <div class="panel-heading"><span class="i18n" data-lang="perc_correct"></span></div>
M. Chardon's avatar
M. Chardon committed
142
143
144
                                <div class="panel-body">
                                    <div class="row">
                                        <ul>
M. Chardon's avatar
M. Chardon committed
145
146
                                            <li><span style="color:orange;"><span class="i18n" data-lang="orange_wrong"></span></span></li>
                                            <li><span style="color:blue;"><span class="i18n" data-lang="blue_right"></span></span></li>
M. Chardon's avatar
M. Chardon committed
147
148
                                        </ul>
                                        <div class="col-sm-6">
M. Chardon's avatar
M. Chardon committed
149
                                            <span class="i18n" data-lang="tot_right"></span>:
M. Chardon's avatar
M. Chardon committed
150
151
152
                                            <input class="form-control" readonly="readonly" id="guessValueCorrect" />
                                        </div>
                                        <div class="col-sm-6">
M. Chardon's avatar
M. Chardon committed
153
                                            <span class="i18n" data-lang="10_res"></span>:
M. Chardon's avatar
M. Chardon committed
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
                                            <input class="form-control" readonly="readonly" id="guessValueCorrect10" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-7">
                            <svg id="graphic" width="860" height="500"></svg>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <div id="contacts" class="modal fade" role="dialog"></div>
        <div id="credits" class="modal fade" role="dialog"></div>
M. Chardon's avatar
M. Chardon committed
171
        <div id="help" class="modal fade" role="dialog"></div>
M. Chardon's avatar
M. Chardon committed
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
        <footer class="footer"></footer>

        <script>

            var controleur = new Controleur();

            function insertVal(val) {
                $("#userinput").val($("#userinput").val() + val);
                controleur.registerVal(val);
                var res = controleur.guestNextValue();
                if (res) {
                    $("#guessValue").val(res.valeur);
                    $("#guessValueP").val(res.probabilite);
                    $("#guessValueHash").val(controleur.getBitCommitment());
                    var controlelastValue = controleur.getControlelastValue();
                    if (controlelastValue !== null) {
                        if (controlelastValue > 0)
                            $('#userinputdiv').append('<span style="color:blue;">' + val + '</span> ');
                        else
                            $('#userinputdiv').append('<span style="color:orange;">' + val + '</span> ');
                    }
                }
                controleur.majIndices();
                if (res) {
                    var arrayGraph = controleur.getArrayGraph();
                    if (arrayGraph)
                        construireGraph(arrayGraph);
                }
                $("#propositionPanel").show();
            }

            function reset() {
                $("textarea").each(function () {
                    $(this).val(controleur.suite);
                });
                $("input").each(function () {
                    $(this).val("");
                });
                $("#graphic").html("");
                $("#lambda").val(controleur.modeleME.lambda);
                $("#taillemask").val(controleur.modeleME.tailleMask);
                $("#lambda").prop('disabled', false);
                $("#taillemask").prop('disabled', false);
                controleur.resetApi();
                $("#propositionPanel").hide();
                $("#userinput").show();
                $("#userinputdiv").html("");
                $("button").show();
                controleur.majIndices();
            }

            function valide() {
                var suiteTotal = $("#userinput").val();
                $("#userinput").hide();
                for (var i = 0; i < suiteTotal.length; i++) {
                    if (i === delaiRentention) {
                        $("#userinputdiv").html("");
                        for (var j = 0; j < controleur.suite.length; j++) {
                            $("#userinputdiv").append(controleur.suite[j] + " ");
                        }
                    }
                    insertVal(suiteTotal[i]);
                }
            }
        </script>
M. Chardon's avatar
M. Chardon committed
237

M. Chardon's avatar
M. Chardon committed
238
        <script src="../js/main.js"></script>
M. Chardon's avatar
M. Chardon committed
239

M. Chardon's avatar
M. Chardon committed
240
241
    </body>
</html>