Skip to content

Commit 4be4129

Browse files
authored
Merge pull request #2705 from element-hq/feature/bma/ghPagesFix
Gh pages fix and Localazy fix
2 parents e19cd28 + 5150c77 commit 4be4129

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

screenshots/html/script.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ function addForm() {
149149
};
150150
label2.appendChild(input2);
151151
form.appendChild(label2);
152+
/*
152153
// Add a date picker to input the minimum date of modification
153154
const label3 = document.createElement('label');
154155
label3.textContent = 'If modified since:';
@@ -168,6 +169,7 @@ function addForm() {
168169
addTable();
169170
};
170171
form.appendChild(dateInput);
172+
*/
171173
// Add a span with id result to display the number of lines
172174
const lines = document.createElement('span');
173175
lines.id = 'lines';
@@ -191,6 +193,13 @@ function createMissingImageElement() {
191193
return text;
192194
}
193195

196+
function createUpToDateImageElement() {
197+
const text = document.createElement('p');
198+
text.className = "missing";
199+
text.textContent = 'Image not updated';
200+
return text;
201+
}
202+
194203
function convertToHumanReadableDate(modifiedDayTime) {
195204
var date = new Date(modifiedDayTime * 86400000);
196205
return date.toLocaleDateString();
@@ -270,6 +279,8 @@ function addTable() {
270279
const foreignFile = englishFile.replace("en]", `${dataLanguages[languageIndex]}]`).replace("_S_", "_T_")
271280
const fullForeignFile = `${dataLanguages[languageIndex]}/${foreignFile}.png`;
272281
td.appendChild(createImageElement(fullForeignFile, modifiedDayTime));
282+
} else {
283+
td.appendChild(createUpToDateImageElement());
273284
}
274285
}
275286
tr.appendChild(td);

tools/test/generateAllScreenshots.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import os
1919
import re
2020
import sys
21+
import time
2122
from util import compare
2223

2324

@@ -134,6 +135,9 @@ def generateJavascriptFile():
134135
if os.path.exists(translatedFile):
135136
# Get the last modified date of the file in seconds and round to days
136137
date = os.popen("git log -1 --format=%ct -- \"" + translatedFile + "\"").read().strip()
138+
# if date is empty, use today's date
139+
if date == "":
140+
date = time.time()
137141
dateDay = int(date) // 86400
138142
dataForFile.append(dateDay)
139143
else:

0 commit comments

Comments
 (0)