Skip to content

Commit 98af8da

Browse files
author
Masaharu Hayashi
committed
fix v1.0.7b admin
1 parent 0df7d29 commit 98af8da

File tree

9 files changed

+1045
-845
lines changed

9 files changed

+1045
-845
lines changed

weko/v1.0.7b/admin/GLOSSARY.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title> · システム管理マニュアル</title>
77
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
88
<meta name="description" content="">
9-
<meta name="generator" content="HonKit 5.1.4">
9+
<meta name="generator" content="HonKit 6.1.4">
1010
<meta name="author" content="Research Center for Open Science and Data Platform, National Institute of Informatics">
1111

1212

@@ -32,7 +32,7 @@
3232

3333

3434

35-
<link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
35+
<link rel="stylesheet" href="gitbook/@honkit/honkit-plugin-fontsettings/website.css">
3636

3737

3838

@@ -185,7 +185,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
185185
<script>
186186
var gitbook = gitbook || [];
187187
gitbook.push(function() {
188-
gitbook.page.hasChanged({"page":{"dir":"neutral"},"config":{"plugins":["intopic-toc","back-to-top-button"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"intopic-toc":{"selector":".markdown-section h1, .markdown-section h2, .markdown-section h3, .markdown-section h4, .markdown-section h5, .markdown-section h6","mode":"nested","maxDepth":6,"isCollapsed":true,"isScrollspyActive":true,"visible":true,"label":"In this article"},"back-to-top-button":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"Research Center for Open Science and Data Platform, National Institute of Informatics","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56},"embedFonts":false},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"システム管理マニュアル","language":"ja","gitbook":"*","description":""},"file":{"path":"GLOSSARY.md","mtime":"2024-08-27T03:35:31.811Z","type":"markdown"},"gitbook":{"version":"5.1.4","time":"2024-11-18T01:15:45.427Z"},"basePath":".","book":{"language":""}});
188+
gitbook.page.hasChanged({"page":{"dir":"neutral"},"config":{"plugins":["intopic-toc","back-to-top-button"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"intopic-toc":{"selector":".markdown-section h1, .markdown-section h2, .markdown-section h3, .markdown-section h4, .markdown-section h5, .markdown-section h6","mode":"nested","maxDepth":6,"isCollapsed":true,"isScrollspyActive":true,"visible":true,"label":"In this article"},"back-to-top-button":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"Research Center for Open Science and Data Platform, National Institute of Informatics","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56},"embedFonts":false},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"システム管理マニュアル","language":"ja","gitbook":"*","description":""},"file":{"path":"GLOSSARY.md","mtime":"2024-08-27T03:35:31.811Z","type":"markdown"},"gitbook":{"version":"6.1.4","time":"2025-11-07T00:49:28.305Z"},"basePath":".","book":{"language":""}});
189189
});
190190
</script>
191191
</div>
@@ -271,7 +271,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
271271

272272

273273

274-
<script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
274+
<script src="gitbook/@honkit/honkit-plugin-fontsettings/fontsettings.js"></script>
275275

276276

277277

weko/v1.0.7b/admin/gitbook/gitbook-plugin-fontsettings/fontsettings.js renamed to weko/v1.0.7b/admin/gitbook/@honkit/honkit-plugin-fontsettings/fontsettings.js

Lines changed: 64 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
require(['gitbook', 'jquery'], function(gitbook, $) {
1+
require(["gitbook", "jquery"], (gitbook, $) => {
22
// Configuration
3-
var MAX_SIZE = 4,
4-
MIN_SIZE = 0,
5-
BUTTON_ID;
3+
const MAX_SIZE = 4;
4+
const MIN_SIZE = 0;
5+
let BUTTON_ID;
66

77
// Current fontsettings state
8-
var fontState;
8+
let fontState;
99

1010
// Default themes
11-
var THEMES = [
11+
let THEMES = [
1212
{
13-
config: 'white',
14-
text: 'White',
13+
config: "white",
14+
text: "White",
1515
id: 0
1616
},
1717
{
18-
config: 'sepia',
19-
text: 'Sepia',
18+
config: "sepia",
19+
text: "Sepia",
2020
id: 1
2121
},
2222
{
23-
config: 'night',
24-
text: 'Night',
23+
config: "night",
24+
text: "Night",
2525
id: 2
2626
}
2727
];
2828

2929
// Default font families
30-
var FAMILIES = [
30+
let FAMILIES = [
3131
{
32-
config: 'serif',
33-
text: 'Serif',
32+
config: "serif",
33+
text: "Serif",
3434
id: 0
3535
},
3636
{
37-
config: 'sans',
38-
text: 'Sans',
37+
config: "sans",
38+
text: "Sans",
3939
id: 1
4040
}
4141
];
@@ -64,7 +64,7 @@ require(['gitbook', 'jquery'], function(gitbook, $) {
6464

6565
// Save current font settings
6666
function saveFontSettings() {
67-
gitbook.storage.set('fontState', fontState);
67+
gitbook.storage.set("fontState", fontState);
6868
update();
6969
}
7070

@@ -92,7 +92,7 @@ require(['gitbook', 'jquery'], function(gitbook, $) {
9292
e.preventDefault();
9393
}
9494

95-
var familyId = getFontFamilyId(configName);
95+
const familyId = getFontFamilyId(configName);
9696
fontState.family = familyId;
9797
saveFontSettings();
9898
}
@@ -103,17 +103,15 @@ require(['gitbook', 'jquery'], function(gitbook, $) {
103103
e.preventDefault();
104104
}
105105

106-
var $book = gitbook.state.$book;
106+
const $book = gitbook.state.$book;
107107

108108
// Remove currently applied color theme
109-
if (fontState.theme !== 0)
110-
$book.removeClass('color-theme-'+fontState.theme);
109+
if (fontState.theme !== 0) $book.removeClass(`color-theme-${fontState.theme}`);
111110

112111
// Set new color theme
113-
var themeId = getThemeId(configName);
112+
const themeId = getThemeId(configName);
114113
fontState.theme = themeId;
115-
if (fontState.theme !== 0)
116-
$book.addClass('color-theme-'+fontState.theme);
114+
if (fontState.theme !== 0) $book.addClass(`color-theme-${fontState.theme}`);
117115

118116
saveFontSettings();
119117
}
@@ -122,88 +120,90 @@ require(['gitbook', 'jquery'], function(gitbook, $) {
122120
// Default to first font-family
123121
function getFontFamilyId(configName) {
124122
// Search for plugin configured font family
125-
var configFamily = $.grep(FAMILIES, function(family) {
123+
const configFamily = $.grep(FAMILIES, (family) => {
126124
return family.config == configName;
127125
})[0];
126+
128127
// Fallback to default font family
129-
return (!!configFamily)? configFamily.id : 0;
128+
return (configFamily && configFamily.id) || 0;
130129
}
131130

132131
// Return the correct id for a theme config key
133132
// Default to first theme
134133
function getThemeId(configName) {
135134
// Search for plugin configured theme
136-
var configTheme = $.grep(THEMES, function(theme) {
135+
const configTheme = $.grep(THEMES, (theme) => {
137136
return theme.config == configName;
138137
})[0];
138+
139139
// Fallback to default theme
140-
return (!!configTheme)? configTheme.id : 0;
140+
return (configTheme && configTheme.id) || 0;
141141
}
142142

143143
function update() {
144-
var $book = gitbook.state.$book;
144+
const $book = gitbook.state.$book;
145145

146-
$('.font-settings .font-family-list li').removeClass('active');
147-
$('.font-settings .font-family-list li:nth-child('+(fontState.family+1)+')').addClass('active');
146+
$(".font-settings .font-family-list li").removeClass("active");
147+
$(`.font-settings .font-family-list li:nth-child(${fontState.family + 1})`).addClass("active");
148148

149-
$book[0].className = $book[0].className.replace(/\bfont-\S+/g, '');
150-
$book.addClass('font-size-'+fontState.size);
151-
$book.addClass('font-family-'+fontState.family);
149+
$book[0].className = $book[0].className.replace(/\bfont-\S+/g, "");
150+
$book.addClass(`font-size-${fontState.size}`);
151+
$book.addClass(`font-family-${fontState.family}`);
152152

153-
if(fontState.theme !== 0) {
154-
$book[0].className = $book[0].className.replace(/\bcolor-theme-\S+/g, '');
155-
$book.addClass('color-theme-'+fontState.theme);
153+
if (fontState.theme !== 0) {
154+
$book[0].className = $book[0].className.replace(/\bcolor-theme-\S+/g, "");
155+
$book.addClass(`color-theme-${fontState.theme}`);
156156
}
157157
}
158158

159159
function init(config) {
160160
// Search for plugin configured font family
161-
var configFamily = getFontFamilyId(config.family),
162-
configTheme = getThemeId(config.theme);
161+
const configFamily = getFontFamilyId(config.family);
162+
const configTheme = getThemeId(config.theme);
163163

164164
// Instantiate font state object
165-
fontState = gitbook.storage.get('fontState', {
166-
size: config.size || 2,
165+
fontState = gitbook.storage.get("fontState", {
166+
size: config.size || 2,
167167
family: configFamily,
168-
theme: configTheme
168+
theme: configTheme
169169
});
170170

171171
update();
172172
}
173173

174174
function updateButtons() {
175175
// Remove existing fontsettings buttons
176-
if (!!BUTTON_ID) {
176+
if (BUTTON_ID) {
177177
gitbook.toolbar.removeButton(BUTTON_ID);
178178
}
179179

180180
// Create buttons in toolbar
181181
BUTTON_ID = gitbook.toolbar.createButton({
182-
icon: 'fa fa-font',
183-
label: 'Font Settings',
184-
className: 'font-settings',
182+
icon: "fa fa-font",
183+
label: "Font Settings",
184+
className: "font-settings",
185185
dropdown: [
186186
[
187187
{
188-
text: 'A',
189-
className: 'font-reduce',
188+
text: "A",
189+
className: "font-reduce",
190190
onClick: reduceFontSize
191191
},
192192
{
193-
text: 'A',
194-
className: 'font-enlarge',
193+
text: "A",
194+
className: "font-enlarge",
195195
onClick: enlargeFontSize
196196
}
197197
],
198-
$.map(FAMILIES, function(family) {
199-
family.onClick = function(e) {
198+
$.map(FAMILIES, (family) => {
199+
family.onClick = function (e) {
200200
return changeFontFamily(family.config, e);
201201
};
202202

203203
return family;
204204
}),
205-
$.map(THEMES, function(theme) {
206-
theme.onClick = function(e) {
205+
$.map(THEMES, (theme) => {
206+
theme.onClick = function (e) {
207207
return changeColorTheme(theme.config, e);
208208
};
209209

@@ -214,8 +214,8 @@ require(['gitbook', 'jquery'], function(gitbook, $) {
214214
}
215215

216216
// Init configuration at start
217-
gitbook.events.bind('start', function(e, config) {
218-
var opts = config.fontsettings;
217+
gitbook.events.bind("start", (e, config) => {
218+
const opts = config.fontsettings;
219219

220220
// Generate buttons at start
221221
updateButtons();
@@ -227,14 +227,12 @@ require(['gitbook', 'jquery'], function(gitbook, $) {
227227
// Expose API
228228
gitbook.fontsettings = {
229229
enlargeFontSize: enlargeFontSize,
230-
reduceFontSize: reduceFontSize,
231-
setTheme: changeColorTheme,
232-
setFamily: changeFontFamily,
233-
getThemes: getThemes,
234-
setThemes: setThemes,
235-
getFamilies: getFamilies,
236-
setFamilies: setFamilies
230+
reduceFontSize: reduceFontSize,
231+
setTheme: changeColorTheme,
232+
setFamily: changeFontFamily,
233+
getThemes: getThemes,
234+
setThemes: setThemes,
235+
getFamilies: getFamilies,
236+
setFamilies: setFamilies
237237
};
238238
});
239-
240-

0 commit comments

Comments
 (0)