Skip to content

Commit

Permalink
JS code linting with ESLint, renames lwt_form_check to lwtFormCheck.
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoFara committed Jan 3, 2024
2 parents 09e31a7 + af20ce9 commit e31d838
Show file tree
Hide file tree
Showing 23 changed files with 1,095 additions and 1,132 deletions.
2 changes: 1 addition & 1 deletion check_text.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function change_textboxes_language() {
$('#TxText').attr('lang', language_data[lid]);
}

$(document).ready(lwt_form_check.askBeforeExit);
$(document).ready(lwtFormCheck.askBeforeExit);
$(document).ready(change_textboxes_language);
</script>
<form class="validate" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Expand Down
4 changes: 2 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ones are marked like "v1.0.0-fork".
* On `inc/kernel_utility.php`: `LWT_APP_VERSION` and `LWT_RELEASE_DATE`.
* On `api.php`: `LWT_API_VERSION` and `LWT_API_RELEASE_DATE`.
* `src/js/jq_pgm.js`: `LWT_DATA`.
* `unloadformcheck.js` now declares a new object `lwt_form_check` that contains
* `unloadformcheck.js` now declares a new object `lwtFormCheck` that contains
all the functions needed.
* Important additions to Text-To-Speech (TTS):
* Word can be read on hover or on click.
Expand Down Expand Up @@ -96,7 +96,7 @@ missing in `INSTALL.sh` (and `composer.json`), as stated in

### Deprecated

* Using any function from `unloadformcheck.js` without using `lwt_form_check` is deprecated.
* Using any function from `unloadformcheck.js` without using `lwtFormCheck` is deprecated.
* `get_database_prefixes` is deprecated, superseded by `getDatabasePrefix` which is much cleaner.
* Globals defined in `jq_pgm.js` are going into a single global `LWT_DATA`.

Expand Down
4 changes: 2 additions & 2 deletions docs/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -2231,7 +2231,7 @@ <h4>Added</h4>
<li>
<code>src/js/jq_pgm.js</code>: <code>LWT_DATA</code>.</li>
<li>
<code>unloadformcheck.js</code> now declares a new object <code>lwt_form_check</code> that contains
<code>unloadformcheck.js</code> now declares a new object <code>lwtFormCheck</code> that contains
all the functions needed.</li>
</ul>
</li>
Expand Down Expand Up @@ -2338,7 +2338,7 @@ <h4>Fixed</h4>
</ul>
<h4>Deprecated</h4>
<ul>
<li>Using any function from <code>unloadformcheck.js</code> without using <code>lwt_form_check</code> is deprecated.</li>
<li>Using any function from <code>unloadformcheck.js</code> without using <code>lwtFormCheck</code> is deprecated.</li>
<li>
<code>get_database_prefixes</code> is deprecated, superseded by <code>getDatabasePrefix</code> which is much cleaner.</li>
<li>Globals defined in <code>jq_pgm.js</code> are going into a single global <code>LWT_DATA</code>.</li>
Expand Down
4 changes: 2 additions & 2 deletions edit_archivedtexts.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
?>

<script type="text/javascript" charset="utf-8">
$(document).ready(lwt_form_check.askBeforeExit);
$(document).ready(lwtFormCheck.askBeforeExit);
</script>
<h2>Edit Archived Text</h2>
<form class="validate" action="<?php echo $_SERVER['PHP_SELF']; ?>#rec<?php echo $_REQUEST['chg']; ?>" method="post">
Expand Down Expand Up @@ -389,7 +389,7 @@
</tr>
<tr>
<td class="td1 right" colspan="2">
<input type="button" value="Cancel" onclick="{lwt_form_check.resetDirty(); location.href='edit_archivedtexts.php#rec<?php echo $_REQUEST['chg']; ?>';}" />
<input type="button" value="Cancel" onclick="{lwtFormCheck.resetDirty(); location.href='edit_archivedtexts.php#rec<?php echo $_REQUEST['chg']; ?>';}" />
<input type="submit" name="op" value="Change" />
</td>
</tr>
Expand Down
6 changes: 3 additions & 3 deletions edit_languages.php
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ class="respinput" />
<tr>
<td class="td1 right" colspan="2">
<input type="button" value="Cancel"
onclick="{lwt_form_check.resetDirty(); location.href='edit_languages.php';}" />
onclick="{lwtFormCheck.resetDirty(); location.href='edit_languages.php';}" />
<?php
if ($language->id == 0) {
echo '<input type="submit" name="op" value="Save" />';
Expand Down Expand Up @@ -1205,7 +1205,7 @@ function edit_languages_new()
}
};

$(document).ready(lwt_form_check.askBeforeExit);
$(document).ready(lwtFormCheck.askBeforeExit);
</script>
<div class="td1 center">
<div class="center" style="border: 1px solid black;">
Expand Down Expand Up @@ -1281,7 +1281,7 @@ function edit_languages_change($lid)
<script type="text/javascript" charset="utf-8">
const LANGDEFS = <?php echo json_encode(LWT_LANGUAGES_ARRAY); ?>;

$(document).ready(lwt_form_check.askBeforeExit);
$(document).ready(lwtFormCheck.askBeforeExit);
</script>
<h2>Edit Language
<a target="_blank" href="docs/info.html#howtolang">
Expand Down
4 changes: 2 additions & 2 deletions edit_mword.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ function edit_mword_display_new($term, $tid, $ord, $len)
?>

<script type="text/javascript">
$(document).ready(lwt_form_check.askBeforeExit);
$(document).ready(lwtFormCheck.askBeforeExit);
$(window).on('beforeunload',function() {
setTimeout(function() {
window.parent.frames['ru'].location.href = 'empty.html';
Expand Down Expand Up @@ -458,7 +458,7 @@ function edit_mword_display_change($term, $tid, $ord)
?>

<script type="text/javascript">
$(document).ready(lwt_form_check.askBeforeExit);
$(document).ready(lwtFormCheck.askBeforeExit);
$(window).on('beforeunload',function() {
setTimeout(function() {
window.parent.frames['ru'].location.href = 'empty.html';
Expand Down
8 changes: 4 additions & 4 deletions edit_tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
?>
<h2>New Tag</h2>
<script type="text/javascript" charset="utf-8">
$(document).ready(lwt_form_check.askBeforeExit);
$(document).ready(lwtFormCheck.askBeforeExit);
</script>
<form name="newtag" class="validate" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table class="tab1" cellspacing="0" cellpadding="5">
Expand All @@ -149,7 +149,7 @@
</tr>
<tr>
<td class="td1 right" colspan="2">
<input type="button" value="Cancel" onclick="{lwt_form_check.resetDirty(); location.href='edit_tags.php';}" />
<input type="button" value="Cancel" onclick="{lwtFormCheck.resetDirty(); location.href='edit_tags.php';}" />
<input type="submit" name="op" value="Save" />
</td>
</tr>
Expand All @@ -166,7 +166,7 @@
?>
<h2>Edit Tag</h2>
<script type="text/javascript" charset="utf-8">
$(document).ready(lwt_form_check.askBeforeExit);
$(document).ready(lwtFormCheck.askBeforeExit);
</script>
<form name="edittag" class="validate" action="<?php echo $_SERVER['PHP_SELF']; ?>#rec<?php echo $_REQUEST['chg']; ?>" method="post">
<input type="hidden" name="TgID" value="<?php echo $record['TgID']; ?>" />
Expand All @@ -187,7 +187,7 @@
</tr>
<tr>
<td class="td1 right" colspan="2">
<input type="button" value="Cancel" onclick="{lwt_form_check.resetDirty(); location.href='edit_tags.php#rec<?php echo $_REQUEST['chg']; ?>';}" />
<input type="button" value="Cancel" onclick="{lwtFormCheck.resetDirty(); location.href='edit_tags.php#rec<?php echo $_REQUEST['chg']; ?>';}" />
<input type="submit" name="op" value="Change" /></td>
</tr>
</table>
Expand Down
4 changes: 2 additions & 2 deletions edit_texts.php
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ function change_textboxes_language() {
$('#TxText').attr('lang', language_data[lid]);
}

$(document).ready(lwt_form_check.askBeforeExit);
$(document).ready(lwtFormCheck.askBeforeExit);
$(document).ready(change_textboxes_language);
</script>
<div class="flex-spaced">
Expand Down Expand Up @@ -712,7 +712,7 @@ class="notempty checkbytes checkoutsidebmp respinput"
<tr>
<td class="td1 right" colspan="2">
<input type="button" value="Cancel"
onclick="{lwt_form_check.resetDirty(); location.href='edit_texts.php<?php echo ($new_text ? '' : '#rec' . $text->id); ?>';}" />
onclick="{lwtFormCheck.resetDirty(); location.href='edit_texts.php<?php echo ($new_text ? '' : '#rec' . $text->id); ?>';}" />
<input type="submit" name="op" value="Check" />
<input type="submit" name="op"
value="<?php echo ($new_text ? 'Save' : 'Change') ?>" />
Expand Down
8 changes: 4 additions & 4 deletions edit_texttags.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@

<h2>New Tag</h2>
<script type="text/javascript" charset="utf-8">
$(document).ready(lwt_form_check.askBeforeExit);
$(document).ready(lwtFormCheck.askBeforeExit);
</script>
<form name="newtag" class="validate" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table class="tab1" cellspacing="0" cellpadding="5">
Expand All @@ -131,7 +131,7 @@
</tr>
<tr>
<td class="td1 right" colspan="2">
<input type="button" value="Cancel" onclick="{lwt_form_check.resetDirty(); location.href='edit_texttags.php';}" />
<input type="button" value="Cancel" onclick="{lwtFormCheck.resetDirty(); location.href='edit_texttags.php';}" />
<input type="submit" name="op" value="Save" /></td>
</tr>
</table>
Expand All @@ -148,7 +148,7 @@
?>
<h2>Edit Tag</h2>
<script type="text/javascript" charset="utf-8">
$(document).ready(lwt_form_check.askBeforeExit);
$(document).ready(lwtFormCheck.askBeforeExit);
</script>
<form name="edittag" class="validate" action="<?php echo $_SERVER['PHP_SELF']; ?>#rec<?php echo $_REQUEST['chg']; ?>" method="post">
<input type="hidden" name="T2ID" value="<?php echo $record['T2ID']; ?>" />
Expand All @@ -169,7 +169,7 @@
</tr>
<tr>
<td class="td1 right" colspan="2">
<input type="button" value="Cancel" onclick="{lwt_form_check.resetDirty(); location.href='edit_texttags.php#rec<?php echo $_REQUEST['chg']; ?>'};" />
<input type="button" value="Cancel" onclick="{lwtFormCheck.resetDirty(); location.href='edit_texttags.php#rec<?php echo $_REQUEST['chg']; ?>'};" />
<input type="submit" name="op" value="Change" /></td>
</tr>
</table>
Expand Down
2 changes: 1 addition & 1 deletion edit_tword.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@

?>
<script type="text/javascript">
$(document).ready(lwt_form_check.askBeforeExit);
$(document).ready(lwtFormCheck.askBeforeExit);
$(window).on('beforeunload',function() {
setTimeout(function() {window.parent.frames['ru'].location.href = 'empty.html';}, 0);
});
Expand Down
2 changes: 1 addition & 1 deletion edit_word.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ function edit_word_do_form($wid, $text_id, $ord, $fromAnn)
pagestart_nobody($titletext);
?>
<script type="text/javascript">
$(document).ready(lwt_form_check.askBeforeExit);
$(document).ready(lwtFormCheck.askBeforeExit);
$(window).on('beforeunload',function() {
setTimeout(function() {window.parent.frames['ru'].location.href = 'empty.html';}, 0);
});
Expand Down
8 changes: 4 additions & 4 deletions edit_words.php
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@

<h2>New Term</h2>
<script type="text/javascript" charset="utf-8">
$(document).ready(lwt_form_check.askBeforeExit);
$(document).ready(lwtFormCheck.askBeforeExit);
</script>
<form name="newword" class="validate" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="hidden" name="WoLgID" id="langfield" value="<?php echo $_REQUEST['lang']; ?>" />
Expand Down Expand Up @@ -732,7 +732,7 @@
'document.forms[\'newword\'].WoSentence',
'document.forms[\'newword\'].WoText'); ?>
&nbsp; &nbsp;
<input type="button" value="Cancel" onclick="{lwt_form_check.resetDirty(); location.href='edit_words.php';}" />
<input type="button" value="Cancel" onclick="{lwtFormCheck.resetDirty(); location.href='edit_words.php';}" />
<input type="submit" name="op" value="Save" /></td>
</tr>
</table>
Expand All @@ -759,7 +759,7 @@

<h2>Edit Term</h2>
<script type="text/javascript" charset="utf-8">
$(document).ready(lwt_form_check.askBeforeExit);
$(document).ready(lwtFormCheck.askBeforeExit);
</script>
<form name="editword" class="validate" action="<?php echo $_SERVER['PHP_SELF']; ?>#rec<?php echo $_REQUEST['chg']; ?>" method="post">
<input type="hidden" name="WoID" value="<?php echo $record['WoID']; ?>" />
Expand Down Expand Up @@ -809,7 +809,7 @@
<td class="td1 right" colspan="2"> &nbsp;
<?php echo createDictLinksInEditWin2($record['WoLgID'], 'document.forms[\'editword\'].WoSentence', 'document.forms[\'editword\'].WoText'); ?>
&nbsp; &nbsp;
<input type="button" value="Cancel" onclick="{lwt_form_check.resetDirty(); location.href='edit_words.php#rec<?php echo $_REQUEST['chg']; ?>';}" />
<input type="button" value="Cancel" onclick="{lwtFormCheck.resetDirty(); location.href='edit_words.php#rec<?php echo $_REQUEST['chg']; ?>';}" />
<input type="submit" name="op" value="Change" />
</td>
</tr>
Expand Down
Loading

0 comments on commit e31d838

Please sign in to comment.