Skip to content

Commit

Permalink
Merge branch 'dev': one-word texts, version 2.6.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoFara committed Jan 1, 2023
2 parents a14fcfa + 764a7c7 commit 4a912ea
Show file tree
Hide file tree
Showing 23 changed files with 879 additions and 468 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create and publish a Docker image
name: Docker image

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,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.5.3-fork
PROJECT_NUMBER = 2.6.0-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
Expand Down
2 changes: 1 addition & 1 deletion backup_restore.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,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:00',
`WoStatusChanged` timestamp NOT NULL DEFAULT '0000-00-00 00:00:01',
`WoTodayScore` double NOT NULL DEFAULT '0',
`WoTomorrowScore` double NOT NULL DEFAULT '0',
`WoRandom` double NOT NULL DEFAULT '0',
Expand Down
232 changes: 117 additions & 115 deletions composer.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions do_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function do_test_mobile_page_content($property)
*
* @return void
*
* @since 2.5.4-fork Function rewrote and no longer deprecated
* @since 2.6.0-fork Function rewrote and no longer deprecated
*/
function do_test_mobile_page($property)
{
Expand Down Expand Up @@ -221,7 +221,7 @@ function do_test_desktop_page($property)
* @param string $p Some property to add to the URL of do_test_test.php.
*
* @since 2.2.1 The $mobile parameter is no longer required.
* @since 2.5.4 Mobile interface is back and self-set.
* @since 2.6.0 Mobile interface is back and self-set.
*
* @return void
*/
Expand Down
4 changes: 2 additions & 2 deletions do_test_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ function get_test_type()
/**
* Prepare the css code for tests.
*
* @deprecated 2.5.4-fork Do not use this function since it was acusing wrong
* display. Will be removed in 2.6.0.
* @deprecated 2.6.0-fork Do not use this function since it was causing wrong
* display. Will be removed in 3.0.0.
*
* @return void
*/
Expand Down
2 changes: 1 addition & 1 deletion do_text.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function get_text_id()
* @return void
*
* @since 2.2.1 It also calls do_frameset_mobile_css and do_frameset_mobile_js
* @since 2.5.4-fork Rewrote to match the desktop version (between 2.2.1 and 2.5.4)
* @since 2.6.0-fork Rewrote to match the desktop version (between 2.2.1 and 2.6.0)
*/
function do_text_mobile_content($textid, $audio)
{
Expand Down
19 changes: 17 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ Changelog
This project's changelog. Versions marked with "-fork" come from the community, other versions come from the canonical LWT ("official" branch on Git).
For git tags, official releases are marked like "v1.0.0", while unofficial ones are marked like "v1.0.0-fork".

## [Unreleased]
## 2.6.0-fork (January 01 2023)
### Added
* Frames resizing is back! The text reading and test interfaces updated in several ways. Based several suggestions as [#60](https://github.com/HugoFara/lwt/issues/60).
* The desktop interface is now much similar to what it was before 2.2.1-fork.
* The mobile interface for texts unchanged (2.2.1-fork to 2.5.3-fork).
* You can resize frames on desktop.
* You can resize frames on desktop.
* Many new functions officially introduced in PHP and JS. Some of these function were already present in the code but undocumented.

### Changed
* UX: Faster testing: you do no longer need to enter "Space" first for speed testing, except for status down and change. Related to [#71](https://github.com/HugoFara/lwt/pull/71).
Expand All @@ -20,7 +21,14 @@ For git tags, official releases are marked like "v1.0.0", while unofficial ones
* ``do_test.php``, ``edit_texts.php``, ``edit_words.php`` and ``set_test_status.php`` now explicitly require a running session. They were silently failing before this release.
* ``save_setting_redirect.php`` moved to ``inc/save_setting_redirect.php``.
* Psalm static code analysis of all PHP files.
* We use "EOP" for end-of-paragraph markers instead of misleading "EOS" (MeCab).
* Slightly changed how a connection is established with SQL. It makes messages more relevant when SQL is not running.
* Not-japanese texts now always use the PHP parser. The SQL parser is no longer used.
* JS: Some deprecated functions ``escape`` and ``unescape`` were replaced by modern equivalents ``encodeURIcomponent`` and ``decodeURIcomponent``. This may lead to changes in cookies, notably making them work better.
* DB: the NO_ZERO_DATE mode is no longer required, see [#78](https://github.com/HugoFara/lwt/issues/78).
* In the ``words`` table, replaced the default timestamp ``0000-00-00 00:00:00`` by ``0000-00-00 00:00:01``.
* The demo database underwent the same change.
* Updated ``composer.lock``.
* Docker: more default options, documentation updated.

### Deprecated
Expand All @@ -37,6 +45,8 @@ For git tags, official releases are marked like "v1.0.0", while unofficial ones
* The *audio* player was no longer working since 2.1.0-fork since the play button was hidden.
* Save text position (``inc/ajax_save_text_position.php``) was broken for all texts. This is fixed.
* Right frames should hide automatically but they often don't ([#61](https://github.com/HugoFara/lwt/issues/61)). Merged PR (#62)[https://github.com/HugoFara/lwt/pull/62].
* Japanese parsing is now better, and uses PHP only (the local_infile SQL functionality is no longer used). Related to PR (#43)[https://github.com/HugoFara/lwt/pull/43].
* One-word not-Japanese texts do no longer result in a crash ([#80](https://github.com/HugoFara/lwt/issues/80)), whoever uses them.
* Tests:
* Header was hidden during tests on Chrome-based browsers.
* Testing specific terms was broken ([#66](https://github.com/HugoFara/lwt/issues/66)) and tests were sometimes not counting score. Solution inspired from PR [#67](https://github.com/HugoFara/lwt/issues/67) from [@jzohrab](https://github.com/jzohrab).
Expand All @@ -50,9 +60,14 @@ For git tags, official releases are marked like "v1.0.0", while unofficial ones
* Unconsistent option in ``inc/ajax_save_setting.php``.
* Since 2.2.2-fork, you had to use a GET request to use it, resulting in authorization errors.
* POST requests are now again the default way to use it.
* PHP tries to set the allow_local_infile option during the connection with SQL ([#20](https://github.com/HugoFara/lwt/issues/20), [#40](https://github.com/HugoFara/lwt/issues/40)).
* UI
* Audio in ``edit_texts.php`` was never shown.
* When adding text, the user was ask to create a ``media`` folder in ``...``, corrected to ``..``.
* DB:
* For some users it was impossible to install the default database due to the use of a ZERO date ([#78](https://github.com/HugoFara/lwt/issues/78)).
* Deleted wrong database instructions ``ADD DROP INDEX TiTextLC`` altering ``temptextitems`` in ``update_database`` of ``database_connect.php``.


## 2.5.3-fork (November 06 2022)
### Added
Expand Down
26 changes: 23 additions & 3 deletions docs/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ <h2 name="current" id="current">
</h2>

<p>
The current version is 2.5.3-fork (November 06 2022).
The current version is 2.6.0-fork (January 01 2023).
<br>
<a href="#CHANGELOG">View the Changelog.</a>
</p>
Expand Down Expand Up @@ -1926,16 +1926,17 @@ <h2 id="database" name="database">▶ Database Information - <a href="#">[↑]</
<h2 id="CHANGELOG" name="CHANGELOG">▶ Changelog - <a href="#">[↑]</a></h2>
<p>This project's changelog. Versions marked with "-fork" come from the community, other versions come from the canonical LWT ("official" branch on Git).
For git tags, official releases are marked like "v1.0.0", while unofficial ones are marked like "v1.0.0-fork".</p>
<h3>[Unreleased]</h3>
<h3>2.6.0-fork (January 01 2023)</h3>
<h4>Added</h4>
<ul>
<li>Frames resizing is back! The text reading and test interfaces updated in several ways. Based several suggestions as <a href="https://github.com/HugoFara/lwt/issues/60">#60</a>.
<ul>
<li>The desktop interface is now much similar to what it was before 2.2.1-fork.</li>
<li>The mobile interface for texts unchanged (2.2.1-fork to 2.5.3-fork).</li>
<li>You can resize frames on desktop.</li>
</ul>
</li>
<li>You can resize frames on desktop.</li>
<li>Many new functions officially introduced in PHP and JS. Some of these function were already present in the code but undocumented.</li>
</ul>
<h4>Changed</h4>
<ul>
Expand All @@ -1953,9 +1954,19 @@ <h4>Changed</h4>
<li>
<code>save_setting_redirect.php</code> moved to <code>inc/save_setting_redirect.php</code>.</li>
<li>Psalm static code analysis of all PHP files.</li>
<li>We use "EOP" for end-of-paragraph markers instead of misleading "EOS" (MeCab).</li>
<li>Slightly changed how a connection is established with SQL. It makes messages more relevant when SQL is not running.</li>
<li>Not-japanese texts now always use the PHP parser. The SQL parser is no longer used.</li>
</ul>
</li>
<li>JS: Some deprecated functions <code>escape</code> and <code>unescape</code> were replaced by modern equivalents <code>encodeURIcomponent</code> and <code>decodeURIcomponent</code>. This may lead to changes in cookies, notably making them work better.</li>
<li>DB: the NO_ZERO_DATE mode is no longer required, see <a href="https://github.com/HugoFara/lwt/issues/78">#78</a>.
<ul>
<li>In the <code>words</code> table, replaced the default timestamp <code>0000-00-00 00:00:00</code> by <code>0000-00-00 00:00:01</code>.</li>
<li>The demo database underwent the same change.</li>
</ul>
</li>
<li>Updated <code>composer.lock</code>.</li>
<li>Docker: more default options, documentation updated.</li>
</ul>
<h4>Deprecated</h4>
Expand All @@ -1980,6 +1991,8 @@ <h4>Fixed</h4>
<li>The <em>audio</em> player was no longer working since 2.1.0-fork since the play button was hidden.</li>
<li>Save text position (<code>inc/ajax_save_text_position.php</code>) was broken for all texts. This is fixed.</li>
<li>Right frames should hide automatically but they often don't (<a href="https://github.com/HugoFara/lwt/issues/61">#61</a>). Merged PR (#62)[https://github.com/HugoFara/lwt/pull/62].</li>
<li>Japanese parsing is now better, and uses PHP only (the local_infile SQL functionality is no longer used). Related to PR (#43)[https://github.com/HugoFara/lwt/pull/43].</li>
<li>One-word not-Japanese texts do no longer result in a crash (<a href="https://github.com/HugoFara/lwt/issues/80">#80</a>), whoever uses them.</li>
</ul>
</li>
<li>Tests:
Expand Down Expand Up @@ -2008,6 +2021,7 @@ <h4>Fixed</h4>
<ul>
<li>Since 2.2.2-fork, you had to use a GET request to use it, resulting in authorization errors.</li>
<li>POST requests are now again the default way to use it.</li>
<li>PHP tries to set the allow_local_infile option during the connection with SQL (<a href="https://github.com/HugoFara/lwt/issues/20">#20</a>, <a href="https://github.com/HugoFara/lwt/issues/40">#40</a>).</li>
</ul>
</li>
</ul>
Expand All @@ -2018,6 +2032,12 @@ <h4>Fixed</h4>
<li>When adding text, the user was ask to create a <code>media</code> folder in <code>...</code>, corrected to <code>..</code>.</li>
</ul>
</li>
<li>DB:
<ul>
<li>For some users it was impossible to install the default database due to the use of a ZERO date (<a href="https://github.com/HugoFara/lwt/issues/78">#78</a>).</li>
<li>Deleted wrong database instructions <code>ADD DROP INDEX TiTextLC</code> altering <code>temptextitems</code> in <code>update_database</code> of <code>database_connect.php</code>.</li>
</ul>
</li>
</ul>
<h3>2.5.3-fork (November 06 2022)</h3>
<h4>Added</h4>
Expand Down
21 changes: 1 addition & 20 deletions edit_texts.php
Original file line number Diff line number Diff line change
Expand Up @@ -904,30 +904,11 @@ function edit_texts_other_pages($recno)
*
* @return void
*
* @since 2.5.4-fork Audio was never shown
* @since 2.6.0-fork Audio was never shown
*/
function edit_texts_show_text_row($txrecord, $currentlang, $statuses)
{
$txid = $txrecord['TxID'];
/*
Added by merge and makes statistics crash. To be removed?
if ($showCounts) {
flush();
echo "ID" . $record['TxID'];
$txttotalwords = textwordcount($record['TxID']);
$txtworkedwords = textworkcount($record['TxID']);
$txtworkedexpr = textexprcount($record['TxID']);
$txtworkedall = $txtworkedwords + $txtworkedexpr;
$txttodowords = $txttotalwords - $txtworkedwords;
$percentunknown = 0;
if ($txttotalwords != 0) {
$percentunknown =
round(100*$txttodowords/$txttotalwords,0);
if ($percentunknown > 100) $percentunknown = 100;
if ($percentunknown < 0) $percentunknown = 0;
}
}
*/
if (isset($txrecord['TxAudioURI'])) {
$audio = trim($txrecord['TxAudioURI']);
} else {
Expand Down
2 changes: 1 addition & 1 deletion inc/ajax_save_setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @link https://hugofara.github.io/lwt/docs/html/ajax__save__setting_8php.html
* @since 1.2.1
* @since 2.2.2-fork Refactored, use will GET methods
* @since 2.5.4-fork Use POST method in priority
* @since 2.6.0-fork Use POST method in priority
*/

require_once __DIR__ . '/session_utility.php';
Expand Down
Loading

0 comments on commit 4a912ea

Please sign in to comment.