joplin-plugin-minimap 1.1.6 → 1.1.7
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 +1 -1
- package/publish/index.js +63 -6
- package/publish/manifest.json +1 -1
- package/publish/plugin.jpl +0 -0
package/package.json
CHANGED
package/publish/index.js
CHANGED
|
@@ -7,8 +7,65 @@
|
|
|
7
7
|
// SettingItemType numeric values: Int=1, String=2, Bool=3 (no 'api' import in plain JS)
|
|
8
8
|
const TYPE_INT = 1;
|
|
9
9
|
|
|
10
|
+
// Settings-screen strings, resolved from the app locale at registration time
|
|
11
|
+
// (matching Joplin's own restart-on-language-switch behavior).
|
|
12
|
+
const SETTINGS_I18N = {
|
|
13
|
+
en_US: {
|
|
14
|
+
minHeadings: 'Minimum headings',
|
|
15
|
+
minHeadingsDesc: 'Hide the minimap when the note has fewer headings than this. Default: 2.',
|
|
16
|
+
panelWidth: 'Expanded panel width (px)',
|
|
17
|
+
panelWidthDesc: 'Maximum width of the hover-expanded table of contents. Default: 240.',
|
|
18
|
+
rightOffset: 'Distance from right edge (px)',
|
|
19
|
+
rightOffsetDesc: 'Gap between the minimap and the right edge of the viewer. Default: 6.',
|
|
20
|
+
},
|
|
21
|
+
zh_CN: {
|
|
22
|
+
minHeadings: '最少标题数',
|
|
23
|
+
minHeadingsDesc: '笔记标题数少于此值时隐藏小地图。默认 2。',
|
|
24
|
+
panelWidth: '展开面板宽度(px)',
|
|
25
|
+
panelWidthDesc: '悬停展开的目录面板最大宽度。默认 240。',
|
|
26
|
+
rightOffset: '距右边缘距离(px)',
|
|
27
|
+
rightOffsetDesc: '小地图与阅读器右边缘的间距。默认 6。',
|
|
28
|
+
},
|
|
29
|
+
zh_TW: {
|
|
30
|
+
minHeadings: '最少標題數',
|
|
31
|
+
minHeadingsDesc: '筆記標題數少於此值時隱藏小地圖。預設 2。',
|
|
32
|
+
panelWidth: '展開面板寬度(px)',
|
|
33
|
+
panelWidthDesc: '懸停展開的目錄面板最大寬度。預設 240。',
|
|
34
|
+
rightOffset: '距右邊緣距離(px)',
|
|
35
|
+
rightOffsetDesc: '小地圖與檢視器右邊緣的間距。預設 6。',
|
|
36
|
+
},
|
|
37
|
+
ru: {
|
|
38
|
+
minHeadings: 'Минимум заголовков',
|
|
39
|
+
minHeadingsDesc: 'Скрывать миникарту, если заголовков в заметке меньше. По умолчанию: 2.',
|
|
40
|
+
panelWidth: 'Ширина развёрнутой панели (px)',
|
|
41
|
+
panelWidthDesc: 'Максимальная ширина оглавления при наведении. По умолчанию: 240.',
|
|
42
|
+
rightOffset: 'Отступ от правого края (px)',
|
|
43
|
+
rightOffsetDesc: 'Зазор между миникартой и правым краем просмотра. По умолчанию: 6.',
|
|
44
|
+
},
|
|
45
|
+
ja_JP: {
|
|
46
|
+
minHeadings: '最小見出し数',
|
|
47
|
+
minHeadingsDesc: 'ノートの見出しがこの数より少ない場合はミニマップを隠します。既定値:2。',
|
|
48
|
+
panelWidth: '展開パネルの幅(px)',
|
|
49
|
+
panelWidthDesc: 'ホバーで展開する目次の最大幅。既定値:240。',
|
|
50
|
+
rightOffset: '右端からの距離(px)',
|
|
51
|
+
rightOffsetDesc: 'ミニマップとビューアー右端の間隔。既定値:6。',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
function settingsI18n(locale) {
|
|
56
|
+
if (SETTINGS_I18N[locale]) return SETTINGS_I18N[locale];
|
|
57
|
+
const lang = String(locale || '').split('_')[0];
|
|
58
|
+
if (lang === 'zh') return SETTINGS_I18N.zh_CN;
|
|
59
|
+
if (lang === 'ru') return SETTINGS_I18N.ru;
|
|
60
|
+
if (lang === 'ja') return SETTINGS_I18N.ja_JP;
|
|
61
|
+
return SETTINGS_I18N.en_US;
|
|
62
|
+
}
|
|
63
|
+
|
|
10
64
|
joplin.plugins.register({
|
|
11
65
|
onStart: async function () {
|
|
66
|
+
const locale = (await joplin.settings.globalValue('locale')) || 'en_US';
|
|
67
|
+
const t = settingsI18n(locale);
|
|
68
|
+
|
|
12
69
|
await joplin.settings.registerSection('minimap', {
|
|
13
70
|
label: 'Joplin Minimap',
|
|
14
71
|
iconName: 'fas fa-list',
|
|
@@ -22,8 +79,8 @@ joplin.plugins.register({
|
|
|
22
79
|
type: TYPE_INT,
|
|
23
80
|
section: 'minimap',
|
|
24
81
|
public: true,
|
|
25
|
-
label:
|
|
26
|
-
description:
|
|
82
|
+
label: t.minHeadings,
|
|
83
|
+
description: t.minHeadingsDesc,
|
|
27
84
|
},
|
|
28
85
|
'minimapPanelWidth': {
|
|
29
86
|
value: 240,
|
|
@@ -31,8 +88,8 @@ joplin.plugins.register({
|
|
|
31
88
|
type: TYPE_INT,
|
|
32
89
|
section: 'minimap',
|
|
33
90
|
public: true,
|
|
34
|
-
label:
|
|
35
|
-
description:
|
|
91
|
+
label: t.panelWidth,
|
|
92
|
+
description: t.panelWidthDesc,
|
|
36
93
|
},
|
|
37
94
|
'minimapRightOffset': {
|
|
38
95
|
value: 6,
|
|
@@ -40,8 +97,8 @@ joplin.plugins.register({
|
|
|
40
97
|
type: TYPE_INT,
|
|
41
98
|
section: 'minimap',
|
|
42
99
|
public: true,
|
|
43
|
-
label:
|
|
44
|
-
description:
|
|
100
|
+
label: t.rightOffset,
|
|
101
|
+
description: t.rightOffsetDesc,
|
|
45
102
|
},
|
|
46
103
|
});
|
|
47
104
|
} catch (error) {
|
package/publish/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"manifest_version": 1,
|
|
3
3
|
"id": "com.github.joplin-minimap",
|
|
4
4
|
"app_min_version": "2.8",
|
|
5
|
-
"version": "1.1.
|
|
5
|
+
"version": "1.1.7",
|
|
6
6
|
"name": "Joplin Minimap",
|
|
7
7
|
"description": "A hover-to-expand table of contents minimap for the note viewer. Shows heading tick marks on the right edge; hover to expand into a full ToC, click to jump.",
|
|
8
8
|
"author": "lim0513",
|
package/publish/plugin.jpl
CHANGED
|
Binary file
|