danoniplus 41.3.2 → 41.4.1

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.
Files changed (2) hide show
  1. package/js/danoni_main.js +15 -8
  2. package/package.json +1 -1
package/js/danoni_main.js CHANGED
@@ -4,12 +4,12 @@
4
4
  *
5
5
  * Source by tickle
6
6
  * Created : 2018/10/08
7
- * Revised : 2025/05/15
7
+ * Revised : 2025/05/17
8
8
  *
9
9
  * https://github.com/cwtickle/danoniplus
10
10
  */
11
- const g_version = `Ver 41.3.2`;
12
- const g_revisedDate = `2025/05/15`;
11
+ const g_version = `Ver 41.4.1`;
12
+ const g_revisedDate = `2025/05/17`;
13
13
 
14
14
  // カスタム用バージョン (danoni_custom.js 等で指定可)
15
15
  let g_localVersion = ``;
@@ -71,6 +71,8 @@ const hasRemoteDomain = _path => g_referenceDomains.some(domain => _path.match(`
71
71
  const g_remoteFlg = hasRemoteDomain(g_rootPath);
72
72
 
73
73
  const g_randTime = Date.now();
74
+ const g_versionForUrl = g_version.slice(4); // URL用に先頭の"Ver "を削除
75
+
74
76
  const g_isFile = location.href.match(/^file/);
75
77
  const g_isLocal = location.href.match(/^file/) || location.href.indexOf(`localhost`) !== -1;
76
78
  const g_isDebug = g_isLocal ||
@@ -95,13 +97,14 @@ const waitUntilLoaded = () => {
95
97
  g_currentPage = `initial`;
96
98
  const links = document.querySelectorAll(`link`);
97
99
  if (Array.from(links).filter(elem => elem.getAttribute(`href`).indexOf(`danoni_main.css`) !== -1).length === 0) {
98
- await importCssFile2(`${g_rootPath}../css/danoni_main.css?${g_randTime}`);
100
+ await importCssFile2(`${g_rootPath}../css/danoni_main.css?${g_versionForUrl}`);
99
101
  }
100
102
 
101
103
  // ロード直後に定数・初期化ファイル、旧バージョン定義関数を読込
102
- await loadScript2(`${g_rootPath}../js/lib/danoni_localbinary.js?${g_randTime}`, false);
103
- await loadScript2(`${g_rootPath}../js/lib/danoni_constants.js?${g_randTime}`);
104
- await loadScript2(`${g_rootPath}../js/lib/legacy_functions.js?${g_randTime}`, false);
104
+ // 旧バージョン定義関数はメジャーバージョンが変わった場合にのみ再ロードが掛かるようにする
105
+ await loadScript2(`${g_rootPath}../js/lib/danoni_localbinary.js`, false);
106
+ await loadScript2(`${g_rootPath}../js/lib/danoni_constants.js?${g_versionForUrl}`);
107
+ await loadScript2(`${g_rootPath}../js/lib/legacy_functions.js?${g_versionForUrl.split(`.`)[0]}`, false);
105
108
  initialControl();
106
109
  })();
107
110
 
@@ -1097,7 +1100,11 @@ const importCssFile2 = (_href, { crossOrigin = `anonymous` } = {}) => {
1097
1100
  */
1098
1101
  const loadMultipleFiles2 = async (_fileData, _loadType) => {
1099
1102
  await Promise.all(_fileData.map(async filePart => {
1100
- const filePath = `${filePart[1]}${filePart[0]}?${g_randTime}`;
1103
+
1104
+ // ファイルが属するドメインがリモートの場合は、キャッシュが使えるようにする
1105
+ const urlCacheName = listMatching(filePart[1], g_referenceDomains)
1106
+ ? g_versionForUrl : g_randTime;
1107
+ const filePath = `${filePart[1]}${filePart[0]}?${urlCacheName}`;
1101
1108
  if (filePart[0].endsWith(`.css`)) {
1102
1109
  _loadType = `css`;
1103
1110
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "41.3.2",
3
+ "version": "41.4.1",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "./js/danoni_main.js",
6
6
  "scripts": {