danoniplus 40.4.2 → 40.5.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/js/danoni_main.js +11 -3
- package/js/lib/danoni_constants.js +9 -4
- package/js/template/danoni_cdn.js +23 -0
- package/package.json +1 -1
package/js/danoni_main.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* https://github.com/cwtickle/danoniplus
|
|
10
10
|
*/
|
|
11
|
-
const g_version = `Ver 40.
|
|
11
|
+
const g_version = `Ver 40.5.0`;
|
|
12
12
|
const g_revisedDate = `2025/03/12`;
|
|
13
13
|
|
|
14
14
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
@@ -2431,7 +2431,7 @@ const initialControl = async () => {
|
|
|
2431
2431
|
|
|
2432
2432
|
// 共通設定ファイルの指定
|
|
2433
2433
|
let tmpSettingType = g_rootObj.settingType ?? ``;
|
|
2434
|
-
if (g_remoteFlg &&
|
|
2434
|
+
if (g_remoteFlg && !tmpSettingType.includes(`(..)`)) {
|
|
2435
2435
|
tmpSettingType = `(..)../js/${tmpSettingType}`;
|
|
2436
2436
|
};
|
|
2437
2437
|
let [settingType, settingRoot] = getFilePath(tmpSettingType);
|
|
@@ -3146,7 +3146,7 @@ const preheaderConvert = _dosObj => {
|
|
|
3146
3146
|
const skinName = match[1] || match[2] || match[3];
|
|
3147
3147
|
|
|
3148
3148
|
// デフォルトセット以外はリモート先のデータを使用しない
|
|
3149
|
-
return
|
|
3149
|
+
return g_defaultSets.skinType.findIndex(val => val === skinName) < 0 ?
|
|
3150
3150
|
convLocalPath(file, `skin`) : file;
|
|
3151
3151
|
});
|
|
3152
3152
|
obj.defaultSkinFlg = tmpSkinTypes.includes(`default`) && setBoolVal(_dosObj.bgCanvasUse ?? g_presetObj.bgCanvasUse, true);
|
|
@@ -3907,6 +3907,14 @@ const updateImgType = (_imgType, _initFlg = false) => {
|
|
|
3907
3907
|
resetImgs(_imgType.name, _imgType.extension);
|
|
3908
3908
|
reloadImgObj();
|
|
3909
3909
|
Object.keys(g_imgObj).forEach(key => g_imgObj[key] = `${g_rootPath}${g_imgObj[key]}`);
|
|
3910
|
+
|
|
3911
|
+
// リモート時は作品ページ側にある画像を優先し、リモートに存在するもののみリモートから取得する
|
|
3912
|
+
if (g_remoteFlg) {
|
|
3913
|
+
Object.keys(g_imgObj).forEach(key => g_imgObj[key] = `${g_workPath}${g_imgObj[key]}`);
|
|
3914
|
+
if (g_defaultSets.imgType.findIndex(val => val === _imgType.name) >= 0) {
|
|
3915
|
+
Object.keys(g_defaultSets.imgList).forEach(key => g_imgObj[key] = `${g_rootPath}${g_imgObj[key]}`);
|
|
3916
|
+
}
|
|
3917
|
+
}
|
|
3910
3918
|
if (_imgType.extension === undefined && g_presetObj.overrideExtension !== undefined) {
|
|
3911
3919
|
Object.keys(g_imgObj).forEach(key => g_imgObj[key] = `${g_imgObj[key].slice(0, -3)}${g_presetObj.overrideExtension}`);
|
|
3912
3920
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Source by tickle
|
|
7
7
|
* Created : 2019/11/19
|
|
8
|
-
* Revised : 2025/03/12 (v40.
|
|
8
|
+
* Revised : 2025/03/12 (v40.5.0)
|
|
9
9
|
*
|
|
10
10
|
* https://github.com/cwtickle/danoniplus
|
|
11
11
|
*/
|
|
@@ -585,6 +585,13 @@ const C_DIR_SKIN = `../skin/`;
|
|
|
585
585
|
// カレントディレクトリマーク
|
|
586
586
|
const C_MRK_CURRENT_DIRECTORY = `(..)`;
|
|
587
587
|
|
|
588
|
+
// デフォルトセット(リモート取得対象)
|
|
589
|
+
const g_defaultSets = {
|
|
590
|
+
skinType: [`default`, `light`, `skyblue`],
|
|
591
|
+
imgType: [``, `classic`, `classic-thin`, `note`],
|
|
592
|
+
imgList: [],
|
|
593
|
+
};
|
|
594
|
+
|
|
588
595
|
/**
|
|
589
596
|
* カスタム画像セットの設定(サーバ上の場合のみ有効)
|
|
590
597
|
*
|
|
@@ -679,6 +686,7 @@ const reloadImgObj = () => {
|
|
|
679
686
|
g_imgObj.titleArrow = C_IMG_TITLE_ARROW;
|
|
680
687
|
};
|
|
681
688
|
reloadImgObj();
|
|
689
|
+
Object.keys(g_imgObj).forEach(key => g_defaultSets.imgList.push(key));
|
|
682
690
|
|
|
683
691
|
// g_imgObjのうち、初期読込するリスト
|
|
684
692
|
const g_imgInitList = [
|
|
@@ -3202,9 +3210,6 @@ const g_titleLists = {
|
|
|
3202
3210
|
|
|
3203
3211
|
};
|
|
3204
3212
|
|
|
3205
|
-
// デフォルトスキンセット(リモート取得対象)
|
|
3206
|
-
const g_defaultSkinSet = [`default`, `light`, `skyblue`];
|
|
3207
|
-
|
|
3208
3213
|
const g_animationData = [`back`, `mask`, `style`];
|
|
3209
3214
|
const g_animationFunc = {
|
|
3210
3215
|
make: {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* jsdelivrのdanoni_main.jsを取得するスクリプトサンプル
|
|
4
|
+
*
|
|
5
|
+
* - このファイルを danoni_main.js と差し替えて、
|
|
6
|
+
* jsフォルダに「version.txt」を格納することで jsdelivr のファイルを取りに行くようになります。
|
|
7
|
+
* - version.txt にはバージョン名 (x.y.z形式) を入れて下さい。
|
|
8
|
+
* - カレントパス指定には対応していないので、version.txtのパスは必要に応じて変えてください。
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// バージョン情報を取得してスクリプトタグを生成
|
|
12
|
+
const randTime = Date.now();
|
|
13
|
+
fetch(`../js/version.txt?${randTime}`)
|
|
14
|
+
.then(response => response.text())
|
|
15
|
+
.then(version => {
|
|
16
|
+
const script = document.createElement('script');
|
|
17
|
+
script.src = `https://cdn.jsdelivr.net/npm/danoniplus@${version}/js/danoni_main.min.js`;
|
|
18
|
+
document.head.appendChild(script); // スクリプトをヘッダーに追加
|
|
19
|
+
console.log(`Loaded version: ${version}`);
|
|
20
|
+
})
|
|
21
|
+
.catch(error => {
|
|
22
|
+
console.error('Failed to load version:', error);
|
|
23
|
+
});
|