opening_hours 3.8.0-dev → 3.9.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.rst +90 -7
- package/LICENSES/AGPL-3.0-only.txt +149 -517
- package/LICENSES/CC0-1.0.txt +121 -0
- package/LICENSES/LGPL-3.0-only.txt +304 -0
- package/Makefile +24 -22
- package/README.md +54 -27
- package/build/opening_hours.js +4831 -2137
- package/package.json +37 -33
- package/site/js/helpers.js +17 -11
- package/site/js/i18n-resources.js +409 -180
- package/site/js/opening_hours_table.js +129 -113
- package/types/index.d.ts +8 -11
package/package.json
CHANGED
|
@@ -4,15 +4,18 @@
|
|
|
4
4
|
"typings": "./types/index.d.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"description": "Library to parse and process opening_hours tag from OpenStreetMap data",
|
|
7
|
-
"version": "3.
|
|
7
|
+
"version": "3.9.0-beta.0",
|
|
8
8
|
"homepage": "https://github.com/opening-hours/opening_hours.js",
|
|
9
9
|
"author": "Dmitry Marakasov <amdmi3@amdmi3.ru>",
|
|
10
10
|
"maintainers": [
|
|
11
11
|
"Robin Schneider <ypid@riseup.net>"
|
|
12
12
|
],
|
|
13
|
+
"contributors": [
|
|
14
|
+
"https://github.com/opening-hours/opening_hours.js/graphs/contributors"
|
|
15
|
+
],
|
|
13
16
|
"repository": {
|
|
14
17
|
"type": "git",
|
|
15
|
-
"url": "https://github.com/opening-hours/opening_hours.js"
|
|
18
|
+
"url": "git+https://github.com/opening-hours/opening_hours.js.git"
|
|
16
19
|
},
|
|
17
20
|
"bugs": "https://github.com/opening-hours/opening_hours.js/issues?state=open",
|
|
18
21
|
"keywords": [
|
|
@@ -36,52 +39,53 @@
|
|
|
36
39
|
"build": "make build",
|
|
37
40
|
"test-quick": "make check",
|
|
38
41
|
"test": "make check-full",
|
|
39
|
-
"
|
|
42
|
+
"lint": "eslint",
|
|
43
|
+
"lint:fix": "eslint --fix",
|
|
40
44
|
"osm-tag-data-check": "make osm-tag-data-check",
|
|
41
45
|
"benchmark": "make benchmark",
|
|
42
46
|
"interactive_testing": "make run-interactive_testing",
|
|
43
47
|
"regex_search": "make run-regex_search",
|
|
44
|
-
"
|
|
48
|
+
"prepare": "husky",
|
|
45
49
|
"prepublishOnly": "pinst --disable",
|
|
46
50
|
"postpublish": "pinst --enable",
|
|
47
51
|
"readme": "doctoc README.md --title \"## Table of Contents\"",
|
|
48
|
-
"check-updates": "
|
|
52
|
+
"check-updates": "npm-check-updates --reject colors --upgrade"
|
|
49
53
|
},
|
|
50
54
|
"dependencies": {
|
|
51
|
-
"i18next": "^
|
|
52
|
-
"i18next-browser-languagedetector": "^
|
|
53
|
-
"suncalc": "^1.
|
|
55
|
+
"i18next": "^24.2.3",
|
|
56
|
+
"i18next-browser-languagedetector": "^8.0.4",
|
|
57
|
+
"suncalc": "^1.9.0"
|
|
54
58
|
},
|
|
55
59
|
"devDependencies": {
|
|
56
|
-
"@
|
|
57
|
-
"@rollup/plugin-
|
|
58
|
-
"@rollup/plugin-
|
|
59
|
-
"@rollup/plugin-
|
|
60
|
-
"@
|
|
61
|
-
"@
|
|
62
|
-
"
|
|
63
|
-
"colors": "^0.6.2",
|
|
60
|
+
"@eslint/js": "^9.24.0",
|
|
61
|
+
"@rollup/plugin-commonjs": "^28.0.3",
|
|
62
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
63
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
64
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
65
|
+
"@rollup/plugin-yaml": "^4.1.2",
|
|
66
|
+
"colors": "^1.4.0",
|
|
64
67
|
"country-language": "^0.1.7",
|
|
65
|
-
"doctoc": "^2.
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"husky": "^7.0.1",
|
|
72
|
-
"js-yaml": "^4.1.0",
|
|
68
|
+
"doctoc": "^2.2.1",
|
|
69
|
+
"eslint": "^9.24.0",
|
|
70
|
+
"full-icu": "^1.5.0",
|
|
71
|
+
"glob": "^11.0.1",
|
|
72
|
+
"globals": "^16.0.0",
|
|
73
|
+
"husky": "^9.1.7",
|
|
73
74
|
"line-reader": "^0.4.0",
|
|
74
|
-
"
|
|
75
|
+
"moment": "^2.30.1",
|
|
76
|
+
"npm-check-updates": "^17.1.16",
|
|
75
77
|
"optimist": "^0.6.1",
|
|
76
|
-
"package-json-validator": "^0.
|
|
77
|
-
"pinst": "^
|
|
78
|
-
"rollup": "^
|
|
79
|
-
"sprintf-js": "1.1.
|
|
80
|
-
"terser": "^5.
|
|
81
|
-
"timekeeper": "^2.
|
|
82
|
-
"typescript": "^
|
|
78
|
+
"package-json-validator": "^0.10.1",
|
|
79
|
+
"pinst": "^3.0.0",
|
|
80
|
+
"rollup": "^4.39.0",
|
|
81
|
+
"sprintf-js": "1.1.3",
|
|
82
|
+
"terser": "^5.39.0",
|
|
83
|
+
"timekeeper": "^2.3.1",
|
|
84
|
+
"typescript": "^5.8.3",
|
|
85
|
+
"typescript-eslint": "^8.29.0",
|
|
86
|
+
"yaml": "^2.7.1"
|
|
83
87
|
},
|
|
84
88
|
"engines": {
|
|
85
|
-
"node": ">=
|
|
89
|
+
"node": ">=12"
|
|
86
90
|
}
|
|
87
91
|
}
|
package/site/js/helpers.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* global $, , default_lat, default_lon, i18next, jQuery, mapCountryToLanguage, opening_hours, OpeningHoursTable, specification_url, YoHoursChecker */
|
|
2
|
+
|
|
1
3
|
/* Constants {{{ */
|
|
2
4
|
var nominatim_api_url = 'https://nominatim.openstreetmap.org/reverse';
|
|
3
5
|
// var nominatim_api_url = 'https://open.mapquestapi.com/nominatim/v1/reverse.php';
|
|
@@ -15,7 +17,7 @@ var evaluation_tool_colors = {
|
|
|
15
17
|
// FIXME: Warning in console. Encoding stuff.
|
|
16
18
|
function josm(url_param) {
|
|
17
19
|
var xhr = new XMLHttpRequest();
|
|
18
|
-
xhr.open('GET', '
|
|
20
|
+
xhr.open('GET', 'http://localhost:8111/' + url_param, true); // true makes this call asynchronous
|
|
19
21
|
xhr.onreadystatechange = function () { // need eventhandler since our call is async
|
|
20
22
|
if ( xhr.status !== 200 ) {
|
|
21
23
|
alert(i18next.t('texts.JOSM remote conn error'));
|
|
@@ -189,9 +191,10 @@ function Evaluate (offset, reset) {
|
|
|
189
191
|
var it = oh.getIterator(date);
|
|
190
192
|
} catch (err) {
|
|
191
193
|
crashed = err;
|
|
192
|
-
show_warnings_or_errors.innerHTML =
|
|
193
|
-
|
|
194
|
-
|
|
194
|
+
show_warnings_or_errors.innerHTML = `
|
|
195
|
+
<div class="error"> ${i18next.t('texts.filter.error')}
|
|
196
|
+
<div class="warning_error_message"> ${crashed} </div>
|
|
197
|
+
</div>`;
|
|
195
198
|
show_time_table.innerHTML = '';
|
|
196
199
|
show_results.innerHTML = '';
|
|
197
200
|
}
|
|
@@ -268,7 +271,7 @@ function Evaluate (offset, reset) {
|
|
|
268
271
|
}
|
|
269
272
|
value_explanation += '</p></div>';
|
|
270
273
|
if (YoHoursChecker.canRead(value)) {
|
|
271
|
-
value_explanation = i18next.t('texts.refer to yohours', { href: '
|
|
274
|
+
value_explanation = i18next.t('texts.refer to yohours', { href: 'https://projets.pavie.info/yohours/?oh=' + value })
|
|
272
275
|
+ '<br>'
|
|
273
276
|
+ value_explanation;
|
|
274
277
|
}
|
|
@@ -331,15 +334,18 @@ function Evaluate (offset, reset) {
|
|
|
331
334
|
|
|
332
335
|
var warnings = oh.getWarnings();
|
|
333
336
|
if (warnings.length > 0) {
|
|
334
|
-
show_warnings_or_errors.innerHTML +=
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
337
|
+
show_warnings_or_errors.innerHTML += `
|
|
338
|
+
<div class="warning"> ${i18next.t('texts.filter.error')}
|
|
339
|
+
<div class="warning_error_message"> ${warnings.join('\n')} </div>
|
|
340
|
+
</div>`;
|
|
338
341
|
}
|
|
339
342
|
|
|
340
343
|
if (prettified.length > 255) {
|
|
341
|
-
show_warnings_or_errors.innerHTML +=
|
|
342
|
-
|
|
344
|
+
show_warnings_or_errors.innerHTML += `
|
|
345
|
+
<div class="warning"> ${i18next.t('texts.filter.error')}
|
|
346
|
+
<div class="warning_error_message"> ${i18next.t('texts.value to long for osm',
|
|
347
|
+
{ pretLength: prettified.length, valLength: value.length, maxLength: 255 })} </div>
|
|
348
|
+
</div>`;
|
|
343
349
|
}
|
|
344
350
|
|
|
345
351
|
show_time_table.innerHTML += OpeningHoursTable.drawTableAndComments(oh, it);
|