Skip to content

Commit 464ef18

Browse files
Fixing several problems with entities and side effects.
1 parent 07f5b22 commit 464ef18

29 files changed

+802
-2081
lines changed

.idea/php.xml

+4-486
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

+87-873
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+16-25
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,25 @@
11
// @ts-ignore
2-
import VanillaCalendar, { Options } from 'vanilla-calendar-pro';
3-
import 'vanilla-calendar-pro/build/vanilla-calendar.min.css';
2+
import { Calendar, type Options } from 'vanilla-calendar-pro';
3+
import 'vanilla-calendar-pro/styles/index.css';
44

55
const options: Options = {
6-
input: true,
6+
inputMode: true,
77
type: 'default',
8-
actions: {
9-
changeToInput(e, calendar, self) {
10-
if (!self.HTMLInputElement) return;
11-
if (self.selectedDates[0]) {
12-
self.HTMLInputElement.value = self.selectedDates[0] + " " + self.selectedTime;
13-
} else {
14-
self.HTMLInputElement.value = '';
15-
}
16-
},
17-
},
18-
settings: {
19-
range: {
20-
disablePast: true,
21-
},
22-
selection: {
23-
time: 24,
24-
},
25-
visibility: {
26-
positionToInput: 'center',
27-
theme: 'light',
28-
},
8+
onChangeToInput(self) {
9+
if (!self.context.inputElement) return;
10+
if (self.context.selectedDates[0]) {
11+
self.context.inputElement.value = self.context.selectedDates[0] + " " + self.context.selectedTime;
12+
self.hide();
13+
} else {
14+
self.context.inputElement.value = '';
15+
}
2916
},
17+
disableDatesPast: true,
18+
selectionTimeMode: 24,
19+
positionToInput: 'auto',
20+
selectedTheme: 'light',
3021
};
3122

3223
const expires = document.getElementById('login_message_expires');
33-
const calendar = new VanillaCalendar(expires, options);
24+
const calendar = new Calendar(expires, options);
3425
calendar.init();

assets/js/password/showhide.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
const passwordField = document.querySelector('.js-password-input');
2-
const showHidePasswordButton = document.querySelector('.js-password-show-hide');
1+
const showHidePasswordButtons = document.querySelectorAll('.js-password-show-hide');
32

43
const showHidePassword = (event) => {
4+
const showHidePasswordButton = event.target.closest('button');
5+
const passwordField = showHidePasswordButton.parentNode.querySelector('input');
6+
57
if (passwordField.type === 'text') {
68
passwordField.type = 'password';
79
showHidePasswordButton.innerHTML="<svg class=\"\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n" +
@@ -19,4 +21,6 @@ const showHidePassword = (event) => {
1921
}
2022
}
2123

22-
showHidePasswordButton.addEventListener("click", showHidePassword);
24+
showHidePasswordButtons.forEach((element) => {
25+
element.addEventListener("click", showHidePassword);
26+
})

assets/js/signup/finalize.js

+19-32
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import VanillaCalendar from 'vanilla-calendar-pro';
2-
import 'vanilla-calendar-pro/build/vanilla-calendar.min.css';
1+
import { Calendar } from 'vanilla-calendar-pro';
2+
import 'vanilla-calendar-pro/styles/index.css';
33
import * as dayjs from 'dayjs'
44

55
import 'leaflet';
@@ -16,41 +16,28 @@ const minimumAge = dayjs().subtract(18, 'year');
1616
const maximumAge = minimumAge.subtract(122, 'year');
1717

1818
const options = {
19-
input: true,
19+
inputMode: true,
2020
type: 'default',
21-
date: {
22-
max: minimumAge.format('YYYY-MM-DD'),
23-
min: maximumAge.format('YYYY-MM-DD'),
24-
today: minimumAge.toDate(),
25-
},
26-
actions: {
27-
changeToInput(e, calendar, self) {
28-
if (!self.HTMLInputElement) return;
29-
if (self.selectedDates[0]) {
30-
self.HTMLInputElement.value = self.selectedDates[0];
31-
calendar.hide();
32-
} else {
33-
self.HTMLInputElement.value = '';
34-
}
35-
},
36-
},
37-
settings: {
38-
lang: lang,
39-
range: {
40-
max: minimumAge.format('YYYY-MM-DD'),
41-
min: maximumAge.format('YYYY-MM-DD'),
42-
},
43-
visibility: {
44-
positionToInput: 'center',
45-
theme: 'light',
46-
disabled: false,
47-
weekend: false,
48-
today: false, },
21+
onChangeToInput(self) {
22+
if (!self.context.inputElement) return;
23+
if (self.context.selectedDates[0]) {
24+
self.context.inputElement.value = self.context.selectedDates[0];
25+
self.hide();
26+
} else {
27+
self.context.inputElement.value = '';
28+
}
4929
},
30+
lang: lang,
31+
dateMin: maximumAge.format('YYYY-MM-DD'),
32+
dateMax: minimumAge.format('YYYY-MM-DD'),
33+
positionToInput: 'auto',
34+
selectedTheme: 'light',
35+
disabledDates: [],
36+
dateToday: minimumAge.toDate(),
5037
};
5138

5239
const birthDate = document.getElementById('signup_form_finalize_birthdate');
53-
const calendar = new VanillaCalendar(birthDate, options);
40+
const calendar = new Calendar(birthDate, options);
5441
calendar.init();
5542

5643
const labelText = 'marker-label'; // document.getElementById('marker_label_text').value;

build/forums/forums.model.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ public function DofTradUpdate($IdForumTrads,$P_Sentence,$P_IdLanguage=0) {
722722
$Sentence= $this->dao->escape($P_Sentence);
723723

724724
MOD_log::get()->write("Updating data for IdForumTrads=#".$id." Before [".addslashes($rBefore->Sentence)."] IdLanguage=".$rBefore->IdLanguage." <br />\nAfter [".$Sentence."] IdLanguage=".$IdLanguage, "ForumModerator");
725-
$sUpdate="update forum_trads set Sentence='".$Sentence."',IdLanguage=".$IdLanguage.",IdTranslator=".$this->session->get("IdMember")." where id=".$id ;
725+
$sUpdate="update forum_trads set Sentence='".$Sentence."',IdLanguage=".$IdLanguage.",IdTranslator=".$this->session->get("IdMember").", updated=NOW() where id=".$id ;
726726
$s=$this->dao->query($sUpdate);
727727
if (!$s) {
728728
throw new PException('Failed for Update forum_trads.id=#'.$id);

build/forums/templates/singlepost.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@
6969
for ($jj = 0; (($jj < $max) and ($topic->WithDetail)); $jj++) { // Not optimized, it is a bit stupid to look in all the trads here
7070
if (($post->Trad[$jj]->trad_created != $post->Trad[$jj]->trad_updated)) { // If one of the trads have been updated
7171
if ($post->Trad[$jj]->IdLanguage == $this->session->get("IdLanguage")) {
72-
echo '<div class="mr-1"><em><i class="fa fa-edit fa-w-16 mr-1" title="edited"></i>' . date($words->getFormatted('DateHHMMShortFormat'), ServerToLocalDateTime($post->Trad[$jj]->trad_updated, $this->getSession())), ' by ', $post->Trad[$jj]->TranslatorUsername . '</em></div>';
72+
if (null !== $post->Trad[$jj]->trad_updated) {
73+
echo '<div class="mr-1"><em><i class="fa fa-edit fa-w-16 mr-1" title="edited"></i>' . date($words->getFormatted('DateHHMMShortFormat'), ServerToLocalDateTime($post->Trad[$jj]->trad_updated, $this->getSession())), ' by ', $post->Trad[$jj]->TranslatorUsername . '</em></div>';
74+
}
7375
}
7476
}
7577
}

0 commit comments

Comments
 (0)