danoniplus 39.6.1 → 39.7.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.
- package/js/danoni_main.js +51 -10
- package/js/lib/danoni_constants.js +4 -3
- 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/02/
|
|
7
|
+
* Revised : 2025/02/20
|
|
8
8
|
*
|
|
9
9
|
* https://github.com/cwtickle/danoniplus
|
|
10
10
|
*/
|
|
11
|
-
const g_version = `Ver 39.
|
|
12
|
-
const g_revisedDate = `2025/02/
|
|
11
|
+
const g_version = `Ver 39.7.1`;
|
|
12
|
+
const g_revisedDate = `2025/02/20`;
|
|
13
13
|
|
|
14
14
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
15
15
|
let g_localVersion = ``;
|
|
@@ -457,25 +457,66 @@ const viewKeyStorage = (_name, _key = ``) => {
|
|
|
457
457
|
* オブジェクトのネスト表示処理
|
|
458
458
|
* @param {Object} _obj
|
|
459
459
|
* @param {Number} _indent
|
|
460
|
-
* @param {WeakSet}
|
|
460
|
+
* @param {WeakSet} [seen=new WeakSet()]
|
|
461
|
+
* @param {boolean} [colorFmt=true]
|
|
462
|
+
* @param {string} [key='']
|
|
461
463
|
* @returns {string}
|
|
462
464
|
*/
|
|
463
|
-
const formatObject = (_obj, _indent = 0,
|
|
465
|
+
const formatObject = (_obj, _indent = 0, { seen = new WeakSet(), colorFmt = true, key } = {}) => {
|
|
464
466
|
if (_obj === null || typeof _obj !== 'object') {
|
|
465
467
|
return JSON.stringify(_obj);
|
|
466
468
|
}
|
|
467
|
-
if (
|
|
469
|
+
if (seen.has(_obj)) {
|
|
468
470
|
return '[Circular]';
|
|
469
471
|
}
|
|
470
|
-
|
|
472
|
+
seen.add(_obj);
|
|
471
473
|
const baseIndent = getIndent(_indent);
|
|
472
474
|
const nestedIndent = getIndent(_indent + 1);
|
|
475
|
+
|
|
476
|
+
// カラーコード、対応キーの色付け処理
|
|
477
|
+
const colorCodePattern = /^#(?:[A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}(?:[A-Fa-f0-9]{2})?|[A-Fa-f0-9]{4})$/;
|
|
478
|
+
const formatValue = _value => {
|
|
479
|
+
if (colorFmt) {
|
|
480
|
+
if (typeof _value === 'string' && colorCodePattern.test(_value)) {
|
|
481
|
+
return `"<span style="color:${_value}">◆</span>${_value}"`;
|
|
482
|
+
}
|
|
483
|
+
if (Array.isArray(_value)) {
|
|
484
|
+
let formattedArray = _value.map(item => formatValue(item));
|
|
485
|
+
if (key.startsWith(`keyCtrl`)) {
|
|
486
|
+
formattedArray = formattedArray.filter(item => item !== `0`)
|
|
487
|
+
.map(item => g_kCd[item] ? `${item}|<span style="color:#ffff66">${g_kCd[item]}</span>` : item);
|
|
488
|
+
}
|
|
489
|
+
return `[${formattedArray.join(`, `)}]`;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
return JSON.stringify(_value);
|
|
493
|
+
};
|
|
494
|
+
|
|
495
|
+
// 二次元配列の整形処理
|
|
496
|
+
if (Array.isArray(_obj)) {
|
|
497
|
+
if (_obj.length === 0) {
|
|
498
|
+
return '[]';
|
|
499
|
+
}
|
|
500
|
+
const isArrayOfArrays = _obj.every(item => Array.isArray(item));
|
|
501
|
+
const formattedArray = _obj
|
|
502
|
+
.map(item => isArrayOfArrays
|
|
503
|
+
? `${nestedIndent}${formatValue(item)}`
|
|
504
|
+
: formatValue(item)
|
|
505
|
+
).join(isArrayOfArrays ? `,<br>` : `, `);
|
|
506
|
+
|
|
507
|
+
return `[${isArrayOfArrays ? `<br>` : ``}${formattedArray}${isArrayOfArrays ? `<br>${baseIndent}` : ''}]`;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
// オブジェクトのネスト整形処理
|
|
473
511
|
const formattedEntries = Object.entries(_obj)
|
|
474
512
|
.map(([key, value]) => {
|
|
475
|
-
const isNestedObject = typeof value === 'object' && value !== null
|
|
476
|
-
const formattedValue = isNestedObject
|
|
513
|
+
const isNestedObject = typeof value === 'object' && value !== null;
|
|
514
|
+
const formattedValue = isNestedObject
|
|
515
|
+
? formatObject(value, _indent + 1, { seen, colorFmt, key })
|
|
516
|
+
: formatValue(value);
|
|
477
517
|
return `<br>${nestedIndent}"${key}": ${formattedValue}`;
|
|
478
518
|
}).join(`,`);
|
|
519
|
+
|
|
479
520
|
return `{${formattedEntries}<br>${baseIndent}}`;
|
|
480
521
|
}
|
|
481
522
|
|
|
@@ -4790,7 +4831,7 @@ const dataMgtInit = () => {
|
|
|
4790
4831
|
);
|
|
4791
4832
|
|
|
4792
4833
|
// 各ボタン用のスプライトを作成
|
|
4793
|
-
const optionsprite = createEmptySprite(divRoot, `optionsprite`, g_windowObj.
|
|
4834
|
+
const optionsprite = createEmptySprite(divRoot, `optionsprite`, g_windowObj.dataSprite);
|
|
4794
4835
|
|
|
4795
4836
|
let reloadFlg = false;
|
|
4796
4837
|
const list = [C_FLG_OFF, C_FLG_ON];
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Source by tickle
|
|
7
7
|
* Created : 2019/11/19
|
|
8
|
-
* Revised : 2025/02/
|
|
8
|
+
* Revised : 2025/02/20 (v39.7.0)
|
|
9
9
|
*
|
|
10
10
|
* https://github.com/cwtickle/danoniplus
|
|
11
11
|
*/
|
|
@@ -193,6 +193,7 @@ const getScMsg = {
|
|
|
193
193
|
const updateWindowSiz = () => {
|
|
194
194
|
Object.assign(g_windowObj, {
|
|
195
195
|
optionSprite: { x: (g_sWidth - 450) / 2, y: 65, w: 450, h: 325 },
|
|
196
|
+
dataSprite: { x: (g_sWidth - Math.max(g_sWidth - 100, 450)) / 2, y: 65, w: Math.max(g_sWidth - 100, 450), h: 325 },
|
|
196
197
|
difList: { x: 165, y: 60, w: 280, h: 270 + g_sHeight - 500, overflow: C_DIS_AUTO, pointerEvents: C_DIS_AUTO },
|
|
197
198
|
difCover: { x: 20, y: 60, w: 145, h: 270 + g_sHeight - 500, opacity: 0.95, pointerEvents: C_DIS_AUTO },
|
|
198
199
|
difFilter: { x: 0, y: 66, w: 140, h: 204 + g_sHeight - 500, overflow: C_DIS_AUTO, pointerEvents: C_DIS_AUTO },
|
|
@@ -258,12 +259,12 @@ const updateWindowSiz = () => {
|
|
|
258
259
|
x: g_btnX(2 / 3), y: g_sHeight - 100, w: g_btnWidth(1 / 3), h: g_limitObj.btnHeight,
|
|
259
260
|
},
|
|
260
261
|
lblWorkDataView: {
|
|
261
|
-
x: g_btnX(
|
|
262
|
+
x: g_btnX(1 / 3) + 10, y: 100, w: g_btnWidth(7 / 12), h: g_sHeight / 4, siz: 12, align: C_ALIGN_LEFT,
|
|
262
263
|
overflow: C_DIS_AUTO, background: `#222222`, color: `#cccccc`,
|
|
263
264
|
whiteSpace: `nowrap`,
|
|
264
265
|
},
|
|
265
266
|
lblKeyDataView: {
|
|
266
|
-
x: g_btnX(
|
|
267
|
+
x: g_btnX(1 / 3) + 10, y: 100 + g_sHeight / 4 + 10, w: g_btnWidth(7 / 12), h: g_sHeight / 3 - 10, siz: 12, align: C_ALIGN_LEFT,
|
|
267
268
|
overflow: C_DIS_AUTO, background: `#222222`, color: `#cccccc`,
|
|
268
269
|
whiteSpace: `nowrap`,
|
|
269
270
|
},
|