File tree Expand file tree Collapse file tree 3 files changed +13
-12
lines changed
Expand file tree Collapse file tree 3 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -154,8 +154,9 @@ <h2 data-i18n="index_h2_tracked">Am I being tracked?</h2>
154154 < script type ="application/javascript " src ="questions.js "> </ script >
155155 < script type ="application/javascript " src ="i18n.js "> </ script >
156156 < script type ="text/javascript ">
157- loadTranslation ( )
158- document . getElementById ( "numOfQuestions" ) . innerHTML = questions . length
157+ loadTranslation ( ) . then ( ( ) => {
158+ document . getElementById ( "numOfQuestions" ) . innerHTML = Object . size ( questions )
159+ } )
159160 </ script >
160161</ body >
161162
Original file line number Diff line number Diff line change @@ -648,4 +648,13 @@ const questions = { // eslint-disable-line no-unused-vars
648648 f : 0 ,
649649 g : - 10
650650 }
651- }
651+ }
652+
653+ Object . size = function ( obj ) {
654+ let size = 0
655+ let key
656+ for ( key in obj ) {
657+ if ( obj . hasOwnProperty ( key ) ) size ++
658+ }
659+ return size
660+ }
Original file line number Diff line number Diff line change @@ -58,15 +58,6 @@ <h2 data-i18n="quiz_loading" style="text-align:center;" id="question-number">Loa
5858 let qn = 0 // Question number
5959 let prevAnswer = null
6060
61- Object . size = function ( obj ) {
62- let size = 0
63- let key
64- for ( key in obj ) {
65- if ( obj . hasOwnProperty ( key ) ) size ++
66- }
67- return size
68- }
69-
7061 function initQuestion ( ) {
7162 document . getElementById ( 'question-text' ) . innerHTML = i18n . getString ( `question_${ qn } ` )
7263 document . getElementById ( 'question-number' ) . innerHTML = i18n . getString ( 'quiz_question_of' , {
You can’t perform that action at this time.
0 commit comments