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/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.8.0-dev",
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
- "eslint": "eslint src/**/*.js types/*.d.ts",
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
- "_postinstall": "husky install",
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": " npm-check-updates --reject colors --upgrade"
52
+ "check-updates": "npm-check-updates --reject colors --upgrade"
49
53
  },
50
54
  "dependencies": {
51
- "i18next": "^20.3.4",
52
- "i18next-browser-languagedetector": "^6.1.2",
53
- "suncalc": "^1.8.0"
55
+ "i18next": "^24.2.3",
56
+ "i18next-browser-languagedetector": "^8.0.4",
57
+ "suncalc": "^1.9.0"
54
58
  },
55
59
  "devDependencies": {
56
- "@rollup/plugin-commonjs": "^19.0.1",
57
- "@rollup/plugin-json": "^4.1.0",
58
- "@rollup/plugin-node-resolve": "^13.0.3",
59
- "@rollup/plugin-yaml": "^3.0.0",
60
- "@typescript-eslint/eslint-plugin": "^4.28.4",
61
- "@typescript-eslint/parser": "^4.28.4",
62
- "assert": "^2.0.0",
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.0.1",
66
- "esbuild": "^0.12.15",
67
- "eslint": "^7.31.0",
68
- "full-icu": "^1.3.4",
69
- "glob": "^7.1.7",
70
- "https": "^1.0.0",
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
- "npm-check-updates": "^11.8.3",
75
+ "moment": "^2.30.1",
76
+ "npm-check-updates": "^17.1.16",
75
77
  "optimist": "^0.6.1",
76
- "package-json-validator": "^0.6.3",
77
- "pinst": "^2.1.6",
78
- "rollup": "^2.53.3",
79
- "sprintf-js": "1.1.2",
80
- "terser": "^5.7.1",
81
- "timekeeper": "^2.2.0",
82
- "typescript": "^4.3.5"
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": ">=10.0.0"
89
+ "node": ">=12"
86
90
  }
87
91
  }
@@ -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', 'https://localhost:8111/' + url_param, true); // true makes this call asynchronous
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 = '<p class="error">' + i18next.t('texts.filter.error') + ':<br />'
193
- + '<textarea rows="' + crashed.split('\n').length + 1 + '" style="width: 100%" name="WarnErrors" readonly="readonly">' + crashed
194
- + '</textarea></p>';
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: 'http://github.pavie.info/yohours/?oh=' + value })
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 += '<p class="warning">' + i18next.t('texts.filter.error') + ':<br />'
335
- + '<textarea rows="' + (warnings.length + 1)
336
- + '" style="width: 100%" name="WarnErrors" readonly="readonly">' + warnings.join('\n')
337
- + '</textarea></p>';
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 += '<p>' + i18next.t('texts.value to long for osm',
342
- { pretLength: prettified.length, valLength: value.length, maxLength: 255 }) + '</p>';
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);