@@ -181,7 +181,25 @@ function run_overlib_multiword (wblink1, wblink2, wblink3, hints, txid, torder,
181181 ) ;
182182}
183183
184- function run_overlib_test ( wblink1 , wblink2 , wblink3 , wid , txt , trans , roman , stat , sent , todo , oldstat ) {
184+ /**
185+ * Make an overlib dialog so that the user can say if he knows the word or not.
186+ *
187+ * @param {string } wblink1 Dictionary 1 URI
188+ * @param {string } wblink2 Dictionary 2 URI
189+ * @param {string } wblink3 Google Translate URI
190+ * @param {* } wid Word ID
191+ * @param {string } txt Word text
192+ * @param {string } trans Word translation
193+ * @param {string } roman Word romanization
194+ * @param {string } stat Word learning status
195+ * @param {string } sent Lookup sentence in Google Translate
196+ * @param {int } todo If 1, the user should say if he knows the word.
197+ * @param {* } oldstat
198+ * @returns
199+ */
200+ function run_overlib_test (
201+ wblink1 , wblink2 , wblink3 , wid , txt , trans , roman , stat , sent , todo , oldstat
202+ ) {
185203 const s = parseInt ( stat , 10 ) ;
186204 let c = s + 1 ;
187205 if ( c > 5 ) c = 5 ;
@@ -191,12 +209,11 @@ function run_overlib_test (wblink1, wblink2, wblink3, wid, txt, trans, roman, st
191209 if ( c == s ) cc = c ;
192210 let ww = stat + ' ▶ ' + w ;
193211 if ( w == s ) ww = w ;
194- return overlib (
195- (
196- todo == 1
197- ? '<center><hr noshade size=1 /><b>' +
198- ( ( stat >= 1 && stat <= 5 )
199- ? (
212+ let overlib_string = '' ;
213+ if ( todo == 1 ) {
214+ overlib_string += '<center><hr noshade size=1 /><b>' ;
215+ if ( stat >= 1 && stat <= 5 ) {
216+ overlib_string +=
200217 make_overlib_link_change_status_test (
201218 wid ,
202219 1 ,
@@ -208,23 +225,22 @@ function run_overlib_test (wblink1, wblink2, wblink3, wid, txt, trans, roman, st
208225 - 1 ,
209226 '<img src="icn/thumb.png" title="Oops!" alt="Oops!" /> Oops! [' + ww + ']'
210227 ) +
211- '<hr noshade size=1 />'
212- )
213- : '' ) +
228+ '<hr noshade size=1 />' ;
229+ }
230+ overlib_string +=
214231 make_overlib_link_change_status_alltest ( wid , stat ) +
215- '</b></center><hr noshade size=1 />'
216- : '' ) +
217- '<b>' + escape_html_chars ( make_tooltip ( txt , trans , roman , stat ) ) +
218- '</b><br />' +
219- ' <a href="edit_tword.php?wid=' + wid +
220- '" onclick="showRightFrames();">Edit term</a><br />' +
221- createTheDictLink ( wblink1 , txt , 'Dict1' , 'Lookup Term: ' ) +
222- createTheDictLink ( wblink2 , txt , 'Dict2' , '' ) +
223- createTheDictLink ( wblink3 , txt , 'GTr' , '' ) +
224- createTheDictLink ( wblink3 , sent , 'GTr' , '<br />Lookup Sentence:' ) ,
225- CAPTION ,
226- 'Got it?'
227- ) ;
232+ '</b></center><hr noshade size=1 />' ;
233+ }
234+ overlib_string += '<b>' + escape_html_chars ( make_tooltip ( txt , trans , roman , stat ) ) +
235+ '</b><br />' +
236+ ' <a href="edit_tword.php?wid=' + wid +
237+ '" onclick="showRightFrames();">Edit term</a><br />' +
238+ createTheDictLink ( wblink1 , txt , 'Dict1' , 'Lookup Term: ' ) +
239+ createTheDictLink ( wblink2 , txt , 'Dict2' , '' ) +
240+ createTheDictLink ( wblink3 , txt , 'GTr' , '' ) +
241+ createTheDictLink ( wblink3 , sent , 'GTr' , '<br />Lookup Sentence:' ) ;
242+
243+ return overlib ( overlib_string , CAPTION , 'Got it?' ) ;
228244}
229245
230246/**
0 commit comments