Members
DIRTY
Set to 1 if a form was altered (set "dirty"),
ask for confirmation before leaving.
- Deprecated:
- Since 2.10.0, use lwtFormCheck instead
- Source:
RTL
Right-to-left indicator, deprecated in 2.10.0 use LWT_DATA.language.rtl
TID
Text ID (int), deprecated Since 2.10.0, use LWT_DATA.text.id
WBLINK1
First dictionary URL, deprecated in 2.10.0 use LWT_DATA.language.dict_link1
WBLINK2
Second dictionary URL, deprecated in 2.10.0 use LWT_DATA.language.dict_link2
WBLINK3
Translator URL, deprecated in 2.10.0 use LWT_DATA.language.translator_link
WID
Word ID, deprecated Since 2.10.0, use LWT_DATA.word.id instead
(constant) lwtFormCheck
Keeps track of a modified form.
- Source:
(constant) lwt_audio_controller
An audio controller.
- Source:
ol_textfont
OVERLIB text font
- Source:
sl :string
Source language
Type:
- string
- Source:
v :int
Number of terms in the text
Type:
- int
Methods
addTermTranslation(txid, word, lang)
Add (new word) a word translation.
Parameters:
Name | Type | Description |
---|---|---|
txid |
string | Text HTML ID or unique HTML selector |
word |
string | Word text |
lang |
int | Language ID |
alertFirstCharacterOutsideBasicMultilingualPlane(s) → {boolean}
Alert if characters are outside the multilingual plane.
Parameters:
Name | Type | Description |
---|---|---|
s |
string | Input string |
Returns:
true is some characters are outside the plane
- Type
- boolean
areCookiesEnabled() → {boolean}
Check if cookies are enabled by setting a cookie.
Returns:
true if cookies are enabled, false otherwise
- Type
- boolean
askConfirmIfDirty() → {string}
Check the DIRTY status and ask before leaving.
- Deprecated:
- Since 2.10.0, use return lwtFormCheck.isDirtyMessage instead
- Source:
Returns:
Confirmation string
- Type
- string
ask_before_exiting() → {undefined}
Call this function if you want to ask the user
before exiting the form.
- Deprecated:
- Since 2.10.0, use return lwtFormCheck.askBeforeExit instead
- Source:
Returns:
- Type
- undefined
changeImprAnnRadio()
Change the annotation for a term by setting its text.
changeImprAnnText()
Change the annotation for a term by setting its text.
changeTableTestStatus(wordid, up)
Set a new status for a word in the test table.
Parameters:
Name | Type | Description |
---|---|---|
wordid |
string | Word ID |
up |
bool | true if status sould be increased, false otherwise |
change_example_sentences_zone(sentences, click_target) → {HTMLElement}
Prepare am HTML element that formats the sentences
Parameters:
Name | Type | Description |
---|---|---|
sentences |
JSON | A list of sentences to display. |
click_target |
string | The selector for the element that should change value on click |
Returns:
A formatted group of sentences
- Type
- HTMLElement
check() → {boolean}
Check if there is no problem with the text.
Returns:
true if all checks were successfull
- Type
- boolean
check_table_prefix(p) → {boolean}
Check is the table prefix is a valid alphanumeric character.
Create an alert if not.
Parameters:
Name | Type | Description |
---|---|---|
p |
string | Table prefix |
Returns:
true is the prefix is valid
- Type
- boolean
cleanupRightFrames() → {undefined}
Hide the right frame and any popups.
Called from several places: insert_word_ignore.php,
set_word_status.php, delete_word.php, etc.
Returns:
- Type
- undefined
containsCharacterOutsideBasicMultilingualPlane(s) → {boolean}
Return whether characters are outside the multilingual plane.
Parameters:
Name | Type | Description |
---|---|---|
s |
string | Input string |
Returns:
true is some characters are outside the plane
- Type
- boolean
createSentLookupLink(torder, txid, url, txt) → {string}
Create a sentence lookup link.
Parameters:
Name | Type | Description |
---|---|---|
torder |
int | Text order |
txid |
int | Text ID |
url |
string | Translator URL |
txt |
string | Word text |
Returns:
HTML-formatted link.
- Type
- string
createTheDictLink(u, w, t, b) → {string}
Create an HTML link for a dictionary.
Parameters:
Name | Type | Description |
---|---|---|
u |
string | Dictionary URL |
w |
string | Word or sentence to be translated |
t |
string | Text to display |
b |
string | Some other text to display before the link |
Returns:
HTML-formatted link
- Type
- string
createTheDictUrl(u, w) → {string}
Create a dictionary URL.
JS alter ego of the createTheDictLink PHP function.
Case 1: url without any ### or "lwt_term": append term
Case 2: url with one ### or "lwt_term": substitute term
Parameters:
Name | Type | Description |
---|---|---|
u |
string | Dictionary URL |
w |
string | Term to be inserted in the URL |
- Since:
- 2.7.0-fork Using "###" is deprecated, "lwt_term" recommended instead
- Source:
Returns:
A link to external dictionary to get a translation of the word
- Type
- string
deepFindValue(obj, searchValue)
Find the first string starting with searchValue in object.
Parameters:
Name | Type | Description |
---|---|---|
obj |
dict | Object to search in |
searchValue |
string | Value to search |
- Source:
deepReplace(obj, searchValue, replaceValue)
Replace any searchValue on object value by replaceValue with deepth.
Parameters:
Name | Type | Description |
---|---|---|
obj |
dict | Object to search in |
searchValue |
string | Value to find |
replaceValue |
string | Value to replace with |
- Source:
deleteCookie(name, path, domain) → {void}
Delete a cookie.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Cookie name |
path |
string | Cookie path |
domain |
string | Cookie domain |
Returns:
- Type
- void
deleteTranslation()
Standard JS interface to get translations
- Since:
- 1.6.16-fork
- License:
- Unlicense
- Unlicense
- Source:
display_example_sentences(sentences, click_target) → {HTMLElement}
Prepare am HTML element that formats the sentences
Parameters:
Name | Type | Description |
---|---|---|
sentences |
JSON | A list of sentences to display. |
click_target |
string | The selector for the element that should change value on click |
Returns:
A formatted group of sentences
- Type
- HTMLElement
do_ajax_edit_impr_text(pagepos, word, term_id)
Load the possible translations for a word.
Parameters:
Name | Type | Description |
---|---|---|
pagepos |
int | Position to scroll to |
word |
string | Word in lowercase to get annotations |
term_id |
int | Term ID |
do_ajax_req_sim_terms(lg_id, word_text) → {JSON}
Send an AJAX request to get similar terms to a term.
Parameters:
Name | Type | Description |
---|---|---|
lg_id |
number | Language ID |
word_text |
string | Text to match |
Returns:
Request used
- Type
- JSON
do_ajax_save_impr_text(textid, elem_name, form_data)
Set an existing translation as annotation for a term.
Parameters:
Name | Type | Description |
---|---|---|
textid |
int | Text ID |
elem_name |
string | Name of the element of which to change annotation (e. g.: "rg1") |
form_data |
Object | All the data from the form (e. g. {"rg0": "foo", "rg1": "bar"}) |
do_ajax_save_setting(k, v)
Save a setting to the database.
Parameters:
Name | Type | Description |
---|---|---|
k |
string | Setting name as a key |
v |
string | Setting value |
do_ajax_show_sentences(lang, word, ctl, woid) → {undefined}
Get and display the sentences containing specific word.
Parameters:
Name | Type | Description |
---|---|---|
lang |
int | Language ID |
word |
string | Term text (the looked for term) |
ctl |
string | Selector for the element to edit on click |
woid |
int | Term id (word or multi-word) |
Returns:
- Type
- undefined
do_ajax_show_similar_terms()
Display the terms similar to a specific term with AJAX.
do_ajax_update_media_select()
Perform an AJAX query to retrieve and display the media files path.
do_ajax_word_counts() → {undefined}
Update WORDCOUNTS in with an AJAX request.
Returns:
- Type
- undefined
edit_term_ann_translations(trans_data, text_id)
When a term translation is edited, recreate it's annotations.
Parameters:
Name | Type | Description |
---|---|---|
trans_data |
Object | Useful data for this term |
text_id |
int | Text ID |
escape_apostrophes(s) → {string}
Escape only single apostrophe ("'") from string
Parameters:
Name | Type | Description |
---|---|---|
s |
string | String to be escaped |
Returns:
Escaped string
- Type
- string
escape_html_chars(s) → {string}
Replace html characters with encodings
See https://stackoverflow.com/questions/1787322/what-is-the-htmlspecialchars-equivalent-in-javascript
Parameters:
Name | Type | Description |
---|---|---|
s |
string | String to be escaped |
Returns:
Escaped string
- Type
- string
escape_html_chars_2(title, ann) → {string}
Escape the HTML characters, with an eventual annotation
Parameters:
Name | Type | Description |
---|---|---|
title |
string | String to be escaped |
ann |
string | An annotation to show in red |
Returns:
Escaped string
- Type
- string
extend_adv_xpath()
To be added to jQuery $.fn.get_adv_xpath, makes various unknown things.
- Source:
failureSound() → {object}
Play the failure sound.
Returns:
Promise on the status of sound
- Type
- object
feedwizard_prepare_interaction()
A mess of different things for preparing interactions with feed wizard.
- Deprecated:
- Since 2.9.1, use lwt_feed_wizard.prepareInteractions
- Source:
getCookie(check_name) → {string|null}
Get a specific cookie by its name.
Parameters:
Name | Type | Description |
---|---|---|
check_name |
string | Cookie name |
Returns:
Value of the cookie if found, null otherwise
- Type
- string | null
getLangFromDict(wblink3) → {string}
Get the language name from the Google Translate URL.
Parameters:
Name | Type | Description |
---|---|---|
wblink3 |
string | Google Translate Dictionary URL |
Returns:
Language name
- Type
- string
(async) getLibreTranslateTranslation(libre_url, text, lang, dest) → {string}
Main wrapper for LibreTranslate translation.
Parameters:
Name | Type | Description |
---|---|---|
libre_url |
URL | URL of LibreTranslate. |
text |
string | Text to translate |
lang |
string | Source language (language of the text, two letters or "auto") |
dest |
string | Destination language (two language) |
- Source:
Returns:
Translation
- Type
- string
(async) getLibreTranslateTranslationBase(text, lang, dest, key, url) → {string}
Base function to get a translation from LibreTranslate.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
text |
string | Text to translate | |
lang |
string | Source language (language of the text, two letters or "auto") | |
dest |
string | Destination language (two language) | |
key |
string | undefined | Optional API key | |
url |
string | http://localhost:5000/translate | API URL |
- Source:
Returns:
Translation
- Type
- string
getPhoneticText(text, lang)
Get the phonetic version of a text.
Parameters:
Name | Type | Description |
---|---|---|
text |
string | Text to convert to phonetics. |
lang |
string | Language, either two letters code or four letters (BCP 47). |
- Deprecated:
- Since 2.10.0 use getPhoneticTextAsync
- Source:
(async) getPhoneticTextAsync(text, lang)
Get the phonetic version of a text, asynchronous.
Parameters:
Name | Type | Description |
---|---|---|
text |
string | Text to convert to phonetics. |
lang |
string | number | Language, either two letters code or four letters (BCP 47), or language ID |
- Source:
getStatusAbbr(status) → {string}
Return the abbreviation of a status
Parameters:
Name | Type | Description |
---|---|---|
status |
int | Status number (int<1, 5>|98|99) |
Returns:
Abbreviation
- Type
- string
getStatusName(status) → {string}
Return the name of a given status.
Parameters:
Name | Type | Description |
---|---|---|
status |
int | Status number (int<1, 5>|98|99) |
Returns:
- Type
- string
getUTF8Length(s) → {number}
Return the memory size of an UTF8 string.
Parameters:
Name | Type | Description |
---|---|---|
s |
string | String to evaluate |
Returns:
Size in bytes
- Type
- number
goToLastPosition()
Scroll to a specific reading position
- Since:
- 2.0.3-fork
- Source:
hideRightFrames() → {boolean}
Hide the right frames if found.
Returns:
true if frames were found, false otherwise
- Type
- boolean
iknowall(t)
Prepare a window to make all words from a text well-known
Parameters:
Name | Type | Description |
---|---|---|
t |
string | Text ID |
keydown_event_do_test_test(e) → {bool}
Handle keyboard interaction when testing a word.
Parameters:
Name | Type | Description |
---|---|---|
e |
object | A keystroke object |
Returns:
true if nothing was done, false otherwise
- Type
- bool
makeDirty()
Set the DIRTY variable to 1.
- Deprecated:
- Since 2.10.0, use return lwtFormCheck.makeDirty instead
- Source:
make_overlib_audio(txt, lang) → {string}
Create a clickable button to read a word aloud.
Parameters:
Name | Type | Description |
---|---|---|
txt |
string | Word to say |
lang |
string | Language name (two letters or four letters separated with a caret) |
- Source:
Returns:
HTML-formatted clickable icon
- Type
- string
make_overlib_link_change_status(txid, torder, wid, oldstat, newstat) → {string}
Return a link to change the status of a word.
Parameters:
Name | Type | Description |
---|---|---|
txid |
int | Text ID |
torder |
* | |
wid |
int | Word ID |
oldstat |
int | Old word status |
newstat |
int | New word status |
- Source:
Returns:
HTML formatted link to change word status
- Type
- string
make_overlib_link_change_status_all(txid, torder, wid, oldstat) → {string}
Change the status of a word multiple time.
Parameters:
Name | Type | Description |
---|---|---|
txid |
int | Text ID |
torder |
* | |
wid |
int | Word ID |
oldstat |
int | Old word status |
- Source:
Returns:
Multiple links for a new word status.
- Type
- string
make_overlib_link_change_status_alltest(wid, oldstat) → {string}
Return a list of links to change word status
Parameters:
Name | Type | Description |
---|---|---|
wid |
int | Word ID |
oldstat |
int | Current status of the word |
- Source:
Returns:
An HTML-formatted list of links.
- Type
- string
make_overlib_link_change_status_test(wid, plusminus, text) → {string}
Make a link for a word status change
Parameters:
Name | Type | Description |
---|---|---|
wid |
int | ID of the word |
plusminus |
int | Amplitude of the change (normally 1 or -1) |
text |
string | Text to be embed |
- Source:
Returns:
A tag containing formatted text
- Type
- string
make_overlib_link_change_status_test2(wid, oldstat, newstat) → {string}
Prepare an HTML-formated string containing the new statuses choices
Parameters:
Name | Type | Description |
---|---|---|
wid |
int | ID of the word |
oldstat |
int | Old status |
newstat |
int | New status |
- Source:
Returns:
HTML-formatted link
- Type
- string
make_overlib_link_create_edit_multiword(len, txid, torder, txt) → {string}
Create or edit a multiword with overlib.
Parameters:
Name | Type | Description |
---|---|---|
len |
int | Number of words in the multi-word |
txid |
int | Text ID |
torder |
* | |
txt |
string | Multi-word text |
- Source:
Returns:
- Type
- string
make_overlib_link_create_edit_multiword_rtl(len, txid, torder, txt) → {string}
Create or edit a right-to-left multiword with overlib.
Parameters:
Name | Type | Description |
---|---|---|
len |
int | Number of words in the multi-word |
txid |
int | Text ID |
torder |
* | |
txt |
string | Multi-word text |
- Source:
Returns:
- Type
- string
make_overlib_link_delete_multiword(txid, wid) → {string}
Make a link to delete a multiword.
Parameters:
Name | Type | Description |
---|---|---|
txid |
int | Text ID |
wid |
int | Word ID |
- Source:
Returns:
HTML-formatted string
- Type
- string
make_overlib_link_delete_word(txid, wid) → {string}
Make a link to delete a word with overlib.
Parameters:
Name | Type | Description |
---|---|---|
txid |
int | Text ID |
wid |
int | Word ID |
- Source:
Returns:
HTML-formatted link.
- Type
- string
make_overlib_link_edit_multiword(txid, torder, wid) → {string}
Create a link to edit a multiword.
Parameters:
Name | Type | Description |
---|---|---|
txid |
int | Text ID |
torder |
* | |
wid |
int | Word ID |
- Source:
Returns:
- Type
- string
make_overlib_link_edit_multiword_title(text, txid, torder, wid) → {string}
Create an overlib title for a multiword edition.
Parameters:
Name | Type | Description |
---|---|---|
text |
* | |
txid |
int | |
torder |
* | |
wid |
int |
- Source:
Returns:
- Type
- string
make_overlib_link_edit_word(txid, torder, wid) → {string}
Make a link to edit a word, displaying "Edit term"
Parameters:
Name | Type | Description |
---|---|---|
txid |
int | |
torder |
* | |
wid |
int |
- Source:
Returns:
- Type
- string
make_overlib_link_edit_word_title(text, txid, torder, wid) → {string}
Make a link to edit a word for an overlib title, displaying the word's text.
Parameters:
Name | Type | Description |
---|---|---|
text |
string | Word text |
txid |
int | Text ID |
torder |
* | |
wid |
int | Word ID |
- Source:
Returns:
HTML-formatted link
- Type
- string
make_overlib_link_ignore_word(txid, torder) → {string}
Return a link to ignore a word.
Parameters:
Name | Type | Description |
---|---|---|
txid |
int | |
torder |
* |
- Source:
Returns:
HTML string to ignore the word
- Type
- string
make_overlib_link_new_multiword(txid, torder, multi_words, rtl) → {string}
Return all multiwords
Parameters:
Name | Type | Description |
---|---|---|
txid |
int | Text ID |
torder |
any | |
multi_words |
array.<string> | A list of 8 string elements |
rtl |
boolean | Right-to-left indicator |
- Since:
- 2.8.0-fork LTR texts were wrongly displayed
- Source:
Returns:
All multiwords
- Type
- string
make_overlib_link_new_word(txid, torder, wid) → {string}
Make a link to learn a new word.
Parameters:
Name | Type | Description |
---|---|---|
txid |
int | Text ID |
torder |
* | |
wid |
int | Word ID |
- Source:
Returns:
- Type
- string
make_overlib_link_wb(wblink1, wblink2, wblink3, txt, txid, torder) → {string}
Make link to translations through dictionaries or all sentences lookup.
Parameters:
Name | Type | Description |
---|---|---|
wblink1 |
string | Dictionary 1 URI |
wblink2 |
string | Dictionary 2 URI |
wblink3 |
string | Google Translate URI |
txt |
string | Word string |
txid |
int | Text ID |
torder |
int |
- Source:
Returns:
- Type
- string
make_overlib_link_wbnl(wblink1, wblink2, wblink3, txt, txid, torder) → {string}
Create a list of links for dictionary translation.
Parameters:
Name | Type | Description |
---|---|---|
wblink1 |
string | Dictionary 1 URI |
wblink2 |
string | Dictionary 2 URI |
wblink3 |
string | Google Translate URI |
txt |
string | Word string |
txid |
int | Text ID |
torder |
int |
- Source:
Returns:
HTML-formatted list of dictionaries link, and sentece link
- Type
- string
make_overlib_link_wbnl2(wblink1, wblink2, wblink3, txt, sent) → {string}
Create link to dictionaries.
Parameters:
Name | Type | Description |
---|---|---|
wblink1 |
string | Dictionary 1 URI |
wblink2 |
string | Dictionary 2 URI |
wblink3 |
string | Google Translate URI |
txt |
string | Word string |
sent |
string | Complete sentence |
- Source:
Returns:
HTML-formatted list of links
- Type
- string
make_overlib_link_wellknown_word(txid, torder) → {string}
Return a link to a word well-known.
Parameters:
Name | Type | Description |
---|---|---|
txid |
int | |
torder |
* |
- Source:
Returns:
HTML link to mark the word well knwown
- Type
- string
make_tooltip(word, trans, roman, status) → {string}
Return a tooltip, a short string describing the word (word, translation,
romanization and learning status)
Parameters:
Name | Type | Description |
---|---|---|
word |
string | The word |
trans |
string | Translation of the word |
roman |
string | Romanized version |
status |
int | Learning status of the word |
Returns:
Tooltip for this word
- Type
- string
media_select_receive_data(data)
Process the received data from media selection query
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | Received data as a JSON object |
newExpressionInteractable(text, attrs, length, hex, showallwords) → {undefined}
Create an interactable to add a new expression.
WARNING! This function was not properly tested!
Parameters:
Name | Type | Description |
---|---|---|
text |
Array.<string> | An array of words forming the expression |
attrs |
string | A group of attributes to add |
length |
int | Number of words, should correspond to WoWordCount |
hex |
string | Lowercase formatted version of the text. |
showallwords |
bool | true: multi-word is a superscript, show mw index + words false: only show the multiword, hide the words |
- Since:
- 2.5.2-fork Don't hide multi-word index when inserting new multi-word.
- Source:
Returns:
- Type
- undefined
new_pos(p)
Change the position of the audio player head.
Parameters:
Name | Type | Description |
---|---|---|
p |
Number | New player head |
- Deprecated:
- Since LWT 2.9.1, use lwt_audio_controller.newPosition
- Source:
oewin(url)
Open a window in edit mode.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | Window URL |
owin(url)
Open a window.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | URL of the window |
prepareMainAreas()
Do a lot of different DOM manipulations
prepareTextInteractions()
Prepare the interaction events with the text.
- Since:
- 2.0.3-fork
- Source:
quickMenuRedirection()
Redirect the user to a specific page depending on the value
- Source:
quick_select_to_input(select_elem, input_elem)
Assign the display value of a select element to the value element of another input.
Parameters:
Name | Type | Description |
---|---|---|
select_elem |
elem | |
input_elem |
elem |
readRawTextAloud(text, lang, rate, pitch) → {SpeechSynthesisUtterance}
Read a text aloud, works with a phonetic version only.
Parameters:
Name | Type | Description |
---|---|---|
text |
string | Text to read, won't be parsed further. |
lang |
string | Language code with BCP 47 convention (e. g. "en-US" for English with an American accent) |
rate |
number | Reading rate |
pitch |
number | Pitch value |
- Since:
- 2.9.0 Accepts "voice" as a new optional argument
- Source:
Returns:
The spoken message object
- Type
- SpeechSynthesisUtterance
readTextAloud(text, lang, rate, pitch, voice)
Read a text aloud, may parse the text to get a phonetic version.
Parameters:
Name | Type | Description |
---|---|---|
text |
string | Text to read, do not need to be phonetic |
lang |
string | Language code with BCP 47 convention (e. g. "en-US" for English with an American accent) |
rate |
number | Reading rate |
pitch |
number | Pitch value |
voice |
string | Optional voice, the result will depend on the browser used |
- Since:
- 2.9.0 Accepts "voice" as a new optional argument
- Source:
resetAll(url) → {void}
Reset current language to default.
Parameters:
Name | Type | Description |
---|---|---|
url |
string |
Returns:
- Type
- void
resetDirty()
Set the DIRTY variable to 0.
- Deprecated:
- Since 2.10.0, use return lwtFormCheck.resetDirty instead
- Source:
run_overlib_multiword(wblink1, wblink2, wblink3, hints, txid, torder, txt, wid, rtl) → {boolean}
Handle click event on a multi-word.
Parameters:
Name | Type | Description |
---|---|---|
wblink1 |
string | First dictionary URL |
wblink2 |
string | Second dictionary URL |
wblink3 |
string | Google Translate dictionary URL |
hints |
string | Hint for the word |
txid |
int | Text ID |
torder |
* | |
txt |
string | Text |
wid |
int | Word ID |
rtl |
int | 1 if right-to-left language |
- Source:
Returns:
- Type
- boolean
run_overlib_status_1_to_5(wblink1, wblink2, wblink3, hints, txid, torder, txt, wid, stat, multi_words, rtl, ann) → {boolean}
Handle click event on learning words (levels 1 to 5)
Parameters:
Name | Type | Description |
---|---|---|
wblink1 |
string | First dictionary URL |
wblink2 |
string | Second dictionary URL |
wblink3 |
string | Google Translate dictionary URL |
hints |
string | Hint for the word |
txid |
int | Text ID |
torder |
* | |
txt |
string | Text |
wid |
int | Word ID |
stat |
int | |
multi_words |
* | |
rtl |
boolean | Right-to-left text indicator |
ann |
* | Unused |
- Source:
Returns:
- Type
- boolean
run_overlib_status_98(wblink1, wblink2, wblink3, hints, txid, torder, txt, wid, multi_words, rtl, ann) → {boolean}
Handle click event on ignored words
Parameters:
Name | Type | Description |
---|---|---|
wblink1 |
string | First dictionary URL |
wblink2 |
string | Second dictionary URL |
wblink3 |
string | Google Translate dictionary URL |
hints |
string | Hint for the word |
txid |
int | Text ID |
torder |
* | |
txt |
string | Text |
wid |
int | Word ID |
multi_words |
* | |
rtl |
boolean | Right-to-left text indicator |
ann |
* |
- Source:
Returns:
- Type
- boolean
run_overlib_status_99(wblink1, wblink2, wblink3, hints, txid, torder, txt, wid, multi_words, rtl, ann) → {boolean}
Handle click event on well-known words
Parameters:
Name | Type | Description |
---|---|---|
wblink1 |
string | First dictionary URL |
wblink2 |
string | Second dictionary URL |
wblink3 |
string | Google Translate dictionary URL |
hints |
string | Hint for the word |
txid |
int | Text ID |
torder |
* | |
txt |
string | Text |
wid |
int | Word ID |
multi_words |
* | |
rtl |
boolean | Right-to-left text indicator |
ann |
* |
- Source:
Returns:
- Type
- boolean
run_overlib_status_unknown(wblink1, wblink2, wblink3, hints, txid, torder, txt, multi_words, rtl) → {boolean}
Handle click event on unknown words.
Parameters:
Name | Type | Description |
---|---|---|
wblink1 |
string | First dictionary URL |
wblink2 |
string | Second dictionary URL |
wblink3 |
string | Google Translate dictionary URL |
hints |
string | Hint for the word |
txid |
int | Text ID |
torder |
* | |
txt |
string | Text |
multi_words |
array.<string> | |
rtl |
int | 1 if right-to-left language |
- Source:
Returns:
- Type
- boolean
run_overlib_test(wblink1, wblink2, wblink3, wid, txt, trans, roman, stat, sent, todo, oldstat) → {*}
Make an overlib dialog so that the user can say if he knows the word or not.
Parameters:
Name | Type | Description |
---|---|---|
wblink1 |
string | Dictionary 1 URI |
wblink2 |
string | Dictionary 2 URI |
wblink3 |
string | Google Translate URI |
wid |
int | Word ID |
txt |
string | Word text |
trans |
string | Word translation |
roman |
string | Word romanization |
stat |
string | Word learning status |
sent |
string | Lookup sentence in Google Translate |
todo |
int | If 1, the user should say if he knows the word. |
oldstat |
* | Old status, unused |
- Source:
Returns:
An overlib object
- Type
- *
saveAudioPosition()
Save audio position
- Source:
saveReadingPosition(text_id, position)
Save the current reading position.
Parameters:
Name | Type | Description |
---|---|---|
text_id |
int | Text id |
position |
int | Position to save |
- Since:
- 2.9.0-fork
- Source:
scrollToAnchor(aid)
Force the user scrolling to an anchor.
Parameters:
Name | Type | Description |
---|---|---|
aid |
string | Anchor ID |
select_media_path(paths, folders, base_path) → {Array.<HTMLOptionElement>}
Return an HTML group of options to add to a select field.
Parameters:
Name | Type | Description |
---|---|---|
paths |
Array.<string> | All paths (files and folders) |
folders |
Array.<string> | Folders paths, should be a subset of paths |
base_path |
string | Base path for LWT to append |
Returns:
List of options to append to the select.
- Type
- Array.<HTMLOptionElement>
setCookie(name, value, expires, path, domain, secure) → {void}
Set a new cookie.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of the cookie |
value |
string | Cookie value |
expires |
number | Number of DAYS before the cookie expires. |
path |
string | Cookie path |
domain |
string | Cookie domain |
secure |
boolean | If it should only be sent through secure connection |
Returns:
- Type
- void
setLang(ctl, url) → {void}
Set the current language.
Parameters:
Name | Type | Description |
---|---|---|
ctl |
string | Current language name |
url |
string |
Returns:
- Type
- void
setTheFocus()
Set the focus on an element with the "focus" class.
setTransRoman(tra, rom)
Set translation and romanization in a form when possible.
Marj the form as edited if something was changed.
Parameters:
Name | Type | Description |
---|---|---|
tra |
string | Translation |
rom |
string | Romanization |
set_barchart_item() → {undefined}
Set a unique item in barchart to reflect how many words are known.
Returns:
- Type
- undefined
set_word_counts() → {undefined}
Set the number of words known in a text (in edit_texts.php main page).
Returns:
- Type
- undefined
showAllwordsClick()
Enable/disable words hint.
Function called when clicking on "Show All".
showRightFrames(roUrl, ruUrl) → {boolean}
Show the right frames if found, and can load an URL in those frames
Parameters:
Name | Type | Description |
---|---|---|
roUrl |
string | undefined | Upper-right frame URL to laod |
ruUrl |
string | undefined | Lower-right frame URL to load |
Returns:
true if frames were found, false otherwise
- Type
- boolean
successSound() → {object}
Play the success sound.
Returns:
Promise on the status of sound
- Type
- object
tagChanged(_, ui) → {true}
Set DIRTY to 1 if tag object changed.
Parameters:
Name | Type | Description |
---|---|---|
_ |
* | An event, unused |
ui |
object | UI object |
- Deprecated:
- Since 2.10.0, use return lwtFormCheck.tagChanged instead
- Source:
Returns:
Always return true
- Type
- true
translateSentence(url, sentctl) → {void}
Translate a sentence.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | Translation URL with "{term}" marking the interesting term |
sentctl |
object | Textarea contaning sentence |
Returns:
- Type
- void
translateSentence2(url, sentctl) → {void}
Translate a sentence.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | Translation URL with "{term}" marking the interesting term |
sentctl |
object | Textarea contaning sentence |
Returns:
- Type
- void
translateWord(url, wordctl) → {void}
Open a new window with the translation of the word.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | Dictionary URL |
wordctl |
object | Textarea containing word to translate. |
Returns:
- Type
- void
translateWord2(url, wordctl) → {void}
Open a new window with the translation of the word.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | Dictionary URL |
wordctl |
object | Textarea containing word to translate. |
Returns:
- Type
- void
translateWord3(url, word) → {void}
Open a new window with the translation of the word.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | Dictionary URL |
word |
string | Word to translate. |
Returns:
- Type
- void
translation_radio(curr_trans, trans_data) → {string}
Create a radio button with a candidate choice for a term annotation.
Parameters:
Name | Type | Description |
---|---|---|
curr_trans |
string | Current anotation (translation) set for the term |
trans_data |
string | All the useful data for the term |
Returns:
An HTML-formatted option
- Type
- string
updateTermTranslation(wordid, txid)
Update a word translation.
Parameters:
Name | Type | Description |
---|---|---|
wordid |
int | Word ID |
txid |
string | Text HTML ID or unique HTML selector |
word_click_event_do_test_test() → {false}
Prepare a dialog when the user clicks a word during a test.
Returns:
- Type
- false
word_click_event_do_text_text() → {bool}
Do a word edition window. Usually called when the user clicks on a word.
- Since:
- 2.9.10-fork Read word aloud if LWT_DATA.settings.hts equals 2.
- Source:
Returns:
false
- Type
- bool
word_count_click() → {undefined}
Handle the click event to switch between total and
unique words count in edit_texts.php.
Returns:
- Type
- undefined
word_each_do_text_text(_)
Add annotations to a word.
Parameters:
Name | Type | Description |
---|---|---|
_ |
* | Unused, usually word number |
- Source:
wrapRadioButtons()
Wrap the radio buttons into stylised elements.