diff --git a/.dockerignore b/.dockerignore index ccc6132fc..cadee0a9d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -11,12 +11,12 @@ tools/* # phpDocumentor cache .phpdoc/* -*.md .dockerignore .git .gitignore # MarkDown and PHP documentation generation Doxyfile + # Media files for LWT media/* diff --git a/Doxyfile b/Doxyfile index 27fd683ba..07d973702 100644 --- a/Doxyfile +++ b/Doxyfile @@ -48,7 +48,7 @@ PROJECT_NAME = "Learning with Texts - Fork" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 2.9.0-fork +PROJECT_NUMBER = 2.9.1-fork # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/INSTALL.sh b/INSTALL.sh old mode 100644 new mode 100755 diff --git a/all_words_wellknown.php b/all_words_wellknown.php index 81e2dab4a..828641ffe 100644 --- a/all_words_wellknown.php +++ b/all_words_wellknown.php @@ -15,7 +15,7 @@ * @package Lwt * @author LWT Project * @license Unlicense - * @link https://hugofara.github.io/lwt/docs/html/all__words__wellknown_8php.html + * @link https://hugofara.github.io/lwt/docs/php/files/all-words-wellknown.html * @since 1.0.3 */ diff --git a/api.php b/api.php index 040de12ce..1e3818858 100644 --- a/api.php +++ b/api.php @@ -14,6 +14,16 @@ require_once __DIR__ . '/inc/ajax_edit_impr_text.php'; +/** + * @var string Version of this current LWT API. + */ +define('LWT_API_VERSION', "0.1.1"); + +/** + * @var string Date of the last released change of the LWT API. + */ +define('LWT_API_RELEASE_DATE', "2023-12-29"); + /** * Send JSON response and exit. * @@ -121,13 +131,13 @@ function endpoint_exits($method, $requestUri) * * @return string[] JSON-encoded version * - * @psalm-return array{version: '0.1.0', release_date: '2023-12-24'} + * @psalm-return array{version: '0.1.1', release_date: '2023-12-29'} */ function rest_api_version($get_req): array { return array( - "version" => "0.1.0", - "release_date" => "2023-12-24" + "version" => LWT_API_VERSION, + "release_date" => LWT_API_RELEASE_DATE ); } @@ -596,7 +606,12 @@ function request_handler($method, $requestUri, $post_param) { // Process endpoint request if ($method === 'GET') { // Handle GET request for each endpoint - parse_str(parse_url($requestUri, PHP_URL_QUERY), $req_param); + $uri_query = parse_url($requestUri, PHP_URL_QUERY); + if ($uri_query == null) { + $req_param = array(); + } else { + parse_str($uri_query, $req_param); + } switch ($endpoint_fragments[0]) { case 'media-files': $answer = media_files($req_param); diff --git a/backup_restore.php b/backup_restore.php index b691f5cf2..c7169f37a 100644 --- a/backup_restore.php +++ b/backup_restore.php @@ -16,7 +16,7 @@ * @package Lwt * @author LWT Project * @license Unlicense - * @link https://hugofara.github.io/lwt/docs/html/backup__restore_8php.html + * @link https://hugofara.github.io/lwt/docs/php/files/backup-restore.html * @since 1.0.3 */ @@ -266,7 +266,7 @@ `WoRomanization` varchar(100) DEFAULT NULL, `WoSentence` varchar(1000) DEFAULT NULL, `WoCreated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `WoStatusChanged` timestamp NOT NULL DEFAULT '0000-00-00 00:00:01', + `WoStatusChanged` timestamp NOT NULL DEFAULT '1970-01-01 01:00:01', `WoTodayScore` double NOT NULL DEFAULT '0', `WoTomorrowScore` double NOT NULL DEFAULT '0', `WoRandom` double NOT NULL DEFAULT '0', diff --git a/bulk_translate_words.php b/bulk_translate_words.php index 36e675b0c..ca6fc1b59 100644 --- a/bulk_translate_words.php +++ b/bulk_translate_words.php @@ -17,7 +17,7 @@ * @package Lwt * @author LWT Project * @license Unlicense - * @link https://hugofara.github.io/lwt/docs/html/bulk__translate__words_8php.html + * @link https://hugofara.github.io/lwt/docs/php/files/bulk-translate-words.html * @since 1.6.1 */ @@ -168,6 +168,44 @@ function bulk_do_content($tid, $sl, $tl, $pos): void WBLINK3 = ''; $('h3,h4,title').addClass('notranslate'); + function clickDictionary() { + if ($(this).hasClass( "dict1" )) + WBLINK = WBLINK1; + if ($(this).hasClass( "dict2" )) + WBLINK = WBLINK2; + if ($(this).hasClass( "dict3" )) + WBLINK = WBLINK3; + let dict_link = WBLINK; + let popup; + if (dict_link.startsWith('*')) { + popup = true; + dict_link = dict_link.substring(1); + } + try { + let final_url = new URL(dict_link); + popup = popup || final_url.searchParams.has("lwt_popup"); + } catch (err) { + if (!(err instanceof TypeError)) { + throw err; + } + } + if (popup) { + owin(createTheDictUrl( + dict_link, $(this).parent().prev().text() + )); + } else { + window.parent.frames['ru'].location.href = createTheDictUrl( + dict_link, $(this).parent().prev().text() + ); + } + $('[name="WoTranslation"]') + .attr('name',$('[name="WoTranslation"]') + .attr('data_name')); + const el = $(this).parent().parent().next().children(); + el.attr('data_name', el.attr('name')); + el.attr('name','WoTranslation'); + } + const bulk_interactions = function() { $('[name="form1"]').submit(function() { $('[name="WoTranslation"]').attr('name',$('[name="WoTranslation"]') @@ -179,43 +217,7 @@ function bulk_do_content($tid, $sl, $tl, $pos): void $('td').on( 'click', 'span.dict1, span.dict2, span.dict3', - function() { - if ($(this).hasClass( "dict1" )) - WBLINK = WBLINK1; - if ($(this).hasClass( "dict2" )) - WBLINK = WBLINK2; - if ($(this).hasClass( "dict3" )) - WBLINK = WBLINK3; - let dict_link = WBLINK; - let popup; - if (dict_link.startsWith('*')) { - popup = true; - dict_link = dict_link.substring(1); - } - try { - let final_url = new URL(dict_link); - popup = popup || final_url.searchParams.has("lwt_popup"); - } catch (err) { - if (!(err instanceof TypeError)) { - throw err; - } - } - if (popup) { - owin(createTheDictUrl( - dict_link, $(this).parent().prev().text() - )); - } else { - window.parent.frames['ru'].location.href = createTheDictUrl( - dict_link, $(this).parent().prev().text() - ); - } - $('[name="WoTranslation"]') - .attr('name',$('[name="WoTranslation"]') - .attr('data_name')); - el = $(this).parent().parent().next().children(); - el.attr('data_name', el.attr('name')); - el.attr('name','WoTranslation'); - } + clickDictionary ).on( 'click', '.del_trans', diff --git a/check_text.php b/check_text.php index b92af00a6..e5a56e0f4 100644 --- a/check_text.php +++ b/check_text.php @@ -13,7 +13,7 @@ * @package Lwt * @author LWT Project * @license Unlicense - * @link https://hugofara.github.io/lwt/docs/html/check__text_8php.html + * @link https://hugofara.github.io/lwt/docs/php/files/check-text.html * @since 1.0.3 */ @@ -74,7 +74,7 @@ function change_textboxes_language() { $('#TxText').attr('lang', language_data[lid]); } - $(document).ready(ask_before_exiting); + $(document).ready(lwt_form_check.askBeforeExit); $(document).ready(change_textboxes_language);
diff --git a/composer.json b/composer.json index fba002159..93ef4eb24 100644 --- a/composer.json +++ b/composer.json @@ -37,14 +37,11 @@ ], "minify": "php -r \"require 'src/php/minifier.php';minify_everything();\"", "no-minify": [ - "cp -r src/js/ .", - "cp src/js/third_party/* js/", - "cp src/js/pgm.js js/", - "cat src/js/* >> pgm/js", + "rm js/pgm.js", "cat src/js/third_party/* >> js/pgm.js", - "rm -rf js/third_party", + "cat src/js/*.js >> js/pgm.js", "cp -r src/css .", - "cp -r src/themes/ ." + "cp -r src/themes ." ], "clean-doc": [ "rm docs/info.html", diff --git a/database_wizard.php b/database_wizard.php index 831119ddc..94243fa89 100644 --- a/database_wizard.php +++ b/database_wizard.php @@ -12,7 +12,7 @@ * @package Lwt * @author HugoFara * @license Unlicense - * @link https://hugofara.github.io/lwt/docs/html/database__wizard_8php.html + * @link https://hugofara.github.io/lwt/docs/php/files/database-wizard.html * @since 2.5.0-fork */ @@ -27,7 +27,7 @@ * @package Lwt * @author HugoFara * @license Unlicense - * @link https://hugofara.github.io/lwt/docs/html/database__wizard_8php.html + * @link https://hugofara.github.io/lwt/docs/php/files/database-wizard.html */ class Database_Connection { @@ -140,16 +140,18 @@ function writeToFile($conn) function doOperation($op) { $message = null; - $dbname = null; - $passwd = null; $server = null; - $socket = null; $userid = null; + $passwd = null; + $dbname = null; + $socket = null; if ($op == "Autocomplete") { - $_SERVER['SERVER_ADDR']; - $_SERVER['SERVER_NAME']; + $server = (string) $_SERVER['SERVER_ADDR']; + $userid = ""; + $passwd = ""; + $dbname = (string) $_SERVER['SERVER_NAME']; + $socket = ""; } else if ($op == "Check") { - //require_once 'inc/database_connect.php'; $server = getreq("server"); $userid = getreq("userid"); $passwd = getreq("passwd"); @@ -183,11 +185,11 @@ function doOperation($op) } } } else if ($op == "Change") { - getreq("server"); - getreq("userid"); - getreq("passwd"); - getreq("dbname"); - getreq("socket"); + $server = getreq("server"); + $userid = getreq("userid"); + $passwd = getreq("passwd"); + $dbname = getreq("dbname"); + $socket = getreq("socket"); } $conn = new Database_Connection( $server, $userid, $passwd, $dbname, $socket diff --git a/delete_mword.php b/delete_mword.php index 9a34d8fa9..543d8929f 100644 --- a/delete_mword.php +++ b/delete_mword.php @@ -12,7 +12,7 @@ * @package Lwt * @author LWT Project * @license Unlicense - * @link https://hugofara.github.io/lwt/docs/html/delete__mword_8php.html + * @link https://hugofara.github.io/lwt/docs/php/files/delete-mword.html * @since 1.0.3 */ diff --git a/display_impr_text.php b/display_impr_text.php index 6742a879d..fbe1eed99 100644 --- a/display_impr_text.php +++ b/display_impr_text.php @@ -12,7 +12,7 @@ * @package Lwt * @author LWT Project * @license Unlicense - * @link https://hugofara.github.io/lwt/docs/html/display__impr__text_8php.html + * @link https://hugofara.github.io/lwt/docs/php/files/display-impr-text.html * @since 1.5.0 */ diff --git a/display_impr_text_header.php b/display_impr_text_header.php index a70549138..5e8b0aec3 100644 --- a/display_impr_text_header.php +++ b/display_impr_text_header.php @@ -10,7 +10,7 @@ * @package Lwt * @author LWT Project * @license Unlicense - * @link https://hugofara.github.io/lwt/docs/html/display__impr__text__header_8php.html + * @link https://hugofara.github.io/lwt/docs/php/files/display-impr-text-header.html * @since 1.5.0 */ diff --git a/display_impr_text_text.php b/display_impr_text_text.php index 7d2c9e754..d24e15ff3 100644 --- a/display_impr_text_text.php +++ b/display_impr_text_text.php @@ -11,7 +11,7 @@ * @package Lwt * @author LWT Project * @license Unlicense - * @link https://hugofara.github.io/lwt/docs/html/display__impr__text__text_8php.html + * @link https://hugofara.github.io/lwt/docs/php/files/display-impr-text-text.html * @since 1.5.0 */ diff --git a/do_feeds.php b/do_feeds.php index 4315ca761..e2a79ef2b 100644 --- a/do_feeds.php +++ b/do_feeds.php @@ -658,6 +658,7 @@ function dummy_function_2($currentlang, $currentfeed): void function do_page(): void { + session_start(); $currentlang = validateLang( (string) processDBParam("filterlang", 'currentlanguage', '', false) ); diff --git a/do_test.php b/do_test.php index bb879ff68..9574121c6 100644 --- a/do_test.php +++ b/do_test.php @@ -17,7 +17,7 @@ * @package Lwt * @author LWT Project * @license Unlicense - * @link https://hugofara.github.io/lwt/docs/html/do__test_8php.html + * @link https://hugofara.github.io/lwt/docs/php/files/do-test.html * @since 1.0.3 */ diff --git a/do_test_header.php b/do_test_header.php index 8499c87da..6a2f425bf 100644 --- a/do_test_header.php +++ b/do_test_header.php @@ -15,7 +15,7 @@ * @package Lwt * @author LWT Project * @license Unlicense - * @link https://hugofara.github.io/lwt/docs/html/do__test__header_8php.html + * @link https://hugofara.github.io/lwt/docs/php/files/do-test-header.html * @since 1.0.3 */ diff --git a/do_test_table.php b/do_test_table.php index 33473d952..29edf99b1 100644 --- a/do_test_table.php +++ b/do_test_table.php @@ -13,7 +13,7 @@ * @package Lwt * @author LWT Project * @license Unlicense - * @link https://hugofara.github.io/lwt/docs/html/do__test__table_8php.html + * @link https://hugofara.github.io/lwt/docs/php/files/do-test-table.html * @since 1.5.4 */ diff --git a/do_test_test.php b/do_test_test.php index a321543be..bbf560be4 100644 --- a/do_test_test.php +++ b/do_test_test.php @@ -14,7 +14,7 @@ * @package Lwt * @author LWT Project * @license Unlicense - * @link https://hugofara.github.io/lwt/docs/html/do__test__test_8php.html + * @link https://hugofara.github.io/lwt/docs/php/files/do-test-test.html * @since 1.0.3 */ @@ -702,9 +702,14 @@ function do_test_test_interaction_globals($wb1, $wb2, $wb3) */ function do_test_test_javascript_clickable($wo_record, $solution) { + global $tbpref; $wid = $wo_record['WoID']; $abbr = getLanguageCode($wo_record['WoLgID'], LWT_LANGUAGES_ARRAY); $phoneticText = phonetic_reading($wo_record['WoText'], $abbr); + $voiceApi = get_first_value( + "SELECT LgTTSVoiceAPI AS value FROM {$tbpref}languages + WHERE LgID = " . $wo_record['WoLgID'] + ); ?> diff --git a/docs/js/global.html b/docs/js/global.html index 9a5602d80..ee8b4eff4 100644 --- a/docs/js/global.html +++ b/docs/js/global.html @@ -659,7 +659,7 @@
Type:
Source:
@@ -731,7 +731,7 @@
Type:
Source:
@@ -1888,7 +1888,7 @@
Parameters:
Source:
@@ -2271,7 +2271,7 @@

cle
Source:
@@ -3556,7 +3556,7 @@

Parameters:
Source:
@@ -3764,7 +3764,7 @@
Parameters:
Source:
@@ -3924,7 +3924,7 @@
Parameters:
Source:
@@ -4290,7 +4290,7 @@
Parameters:
Source:
@@ -4496,7 +4496,7 @@
Parameters:
Source:
@@ -4602,7 +4602,7 @@

Source:
@@ -4690,7 +4690,7 @@

<
Source:
@@ -4778,7 +4778,7 @@

do
Source:
@@ -4956,7 +4956,7 @@

Parameters:
Source:
@@ -5634,7 +5634,7 @@

failureSo
Source:
@@ -5700,7 +5700,7 @@

- A mess of different things for preparing interactions with feed wizard + A mess of different things for preparing interactions with feed wizard. @@ -5732,6 +5732,8 @@

Deprecated:
  • Since 2.9.1, use lwt_feed_wizard.prepareInteractions
+ @@ -5744,7 +5746,7 @@

Source:
@@ -7549,7 +7551,7 @@

hideRi
Source:
@@ -12832,7 +12834,7 @@

Parameters:
Source:
@@ -13210,6 +13212,8 @@
Parameters:
+
Deprecated:
  • Since LWT 2.9.1, use lwt_audio_controller.newPosition
+ @@ -13222,7 +13226,7 @@
Parameters:
Source:
@@ -13584,7 +13588,7 @@

prepa
Source:
@@ -13923,7 +13927,7 @@

Parameters:
Source:
@@ -17423,6 +17427,9 @@
Parameters:
+
Since:
+
  • 2.9.1-fork Base path is no longer used
+ @@ -17447,7 +17454,7 @@
Parameters:
Source:
@@ -18258,7 +18265,7 @@

set_
Source:
@@ -18364,7 +18371,7 @@

set_wo
Source:
@@ -18637,7 +18644,7 @@

Parameters:
Source:
@@ -18747,7 +18754,7 @@

successSo
Source:
@@ -20001,7 +20008,7 @@

Parameters:
Source:
@@ -20377,7 +20384,7 @@

Source:
@@ -20488,7 +20495,7 @@

word_
Source:
@@ -20731,7 +20738,7 @@

wrapR
Source:
@@ -20783,7 +20790,7 @@

Home

Global