Skip to content

Commit 970cbcb

Browse files
sunflatmugi-unohidakatsuya
committed
Integrate as an application
Co-authored-by: mugi-uno <mugi.uno@gmail.com> Co-authored-by: Katsuya HIDAKA <hidakatsuya@gmail.com>
1 parent d39d2db commit 970cbcb

15 files changed

Lines changed: 481 additions & 0 deletions

File tree

section_report/public/favicon.ico

7.23 KB
Binary file not shown.

section_report/public/fonts/IPAfont00303/IPA_Font_License_Agreement_v1.0.txt

Lines changed: 117 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
IPA�t�H���g�iIPA�t�H���g4���̃p�b�N�j
2+
�\ �͂��߂ɂ��ǂ݂������� �\
3+
4+
IPA�t�H���g(Ver.3)�́AJIS X 0213:2004�ɏ�������TrueType�A�E�g���C���x�[�X��OpenType�t�H���g�ł��B
5+
6+
IPA�t�H���g(Ver.3)�̎g�p�܂��͗��p�ɓ������ẮA�Y�t�́uIPA�t�H���g���C�Z���Xv1.0�v�ɒ�߂�����ɏ]���Ă��������B
7+
IPA�t�H���g(Ver.3)���g�p���A�������A�܂��͔Еz����s�ׁA���̑��A�uIPA�t�H���g���C�Z���Xv1.0�v�ɒ�߂錠���̗��p���s�����ꍇ�A��̎҂́uIPA�t�H���g���C�Z���Xv1.0�v�ɓ��ӂ������̂ƌ��Ȃ��܂��B
8+
9+
10+
IPA�t�H���g�iIPA�t�H���g4���̃p�b�N�j IPAfont00303.zip
11+
|--�͂��߂ɂ��ǂ݂������� Readme_IPAfont00303.txt
12+
|--IPA�t�H���g���C�Z���Xv1.0 IPA_Font_License_Agreement_v1.0.txt
13+
|--IPA �S�V�b�N ipag.ttf
14+
|--IPA P�S�V�b�N ipagp.ttf
15+
|--IPA���� ipam.ttf
16+
|--IPA P���� ipamp.ttf
17+
18+
19+
�uIPA�t�H���g�v�́AIPA�̓o�^���W�ł��B
20+
21+
=========================
22+
IPA Font (IPA Fonts 4 fonts package)
23+
-- Readme --
24+
25+
IPA Fonts are JIS X 0213:2004 compliant OpenType fonts based on TrueType outlines.
26+
27+
In using IPA fonts, please comply with the terms and conditions set out in "IPA Font License Agreement v1.0" included in this package.
28+
Any use, reproduction or distribution of the IPA Font or any exercise of rights under "IPA Font License Agreement v1.0" by a Recipient constitutes the Recipient's acceptance of the License Agreement.
29+
30+
31+
IPA Font (IPA Fonts 4 fonts package) IPAfont00303.zip
32+
|--Readme Readme_IPAfont00303.txt
33+
|--IPA Font License Agreement v1.0 IPA_Font_License_Agreement_v1.0.txt
34+
|--IPAGothic ipag.ttf
35+
|--IPAPGothic ipagp.ttf
36+
|--IPAMincho ipam.ttf
37+
|--IPAPMincho ipamp.ttf
38+
39+
40+
"IPA Font" is a registered trademark of IPA in Japan.
5.95 MB
Binary file not shown.
5.95 MB
Binary file not shown.
7.67 MB
Binary file not shown.
7.67 MB
Binary file not shown.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
const showFileOpenDialog = (accepts) => {
2+
return new Promise((resolve, reject) => {
3+
const input = document.createElement('input');
4+
5+
input.type = 'file';
6+
input.accept = accepts.join(',');
7+
input.value = '';
8+
input.onchange = e => {
9+
const input = e.target;
10+
11+
if (input && input.files) {
12+
resolve(input.files[0]);
13+
} else {
14+
reject(new Error('Missing InputElement'));
15+
}
16+
};
17+
input.click();
18+
});
19+
};
20+
21+
const saveFile = (content, { filename, type }) => {
22+
const data = new Blob([content], { type });
23+
const dummyLink = document.createElement('a');
24+
dummyLink.href = window.URL.createObjectURL(data);
25+
dummyLink.download = filename;
26+
dummyLink.click();
27+
};
28+
29+
const readAsText = file => {
30+
return new Promise(resolve => {
31+
const reader = new FileReader();
32+
reader.readAsText(file);
33+
reader.onload = () => { resolve(reader.result); };
34+
});
35+
};
36+
37+
window.handlers = {
38+
async schemaOpen (onSuccess) {
39+
const file = await showFileOpenDialog(['.tlf', 'text/plain']);
40+
const schema = await readAsText(file);
41+
42+
if (typeof schema === 'string') {
43+
onSuccess(schema, file.name);
44+
} else {
45+
throw new Error('Unknown Error');
46+
}
47+
},
48+
49+
schemaSave (schema, filename, onSuccess) {
50+
saveFile(schema, { filename, type: 'application/json' });
51+
onSuccess();
52+
},
53+
54+
schemaSaveAs (schema, filename, onSuccess) {
55+
const newFilename = filename || 'template.tlf';
56+
saveFile(schema, { filename: newFilename, type: 'application/json' });
57+
onSuccess(newFilename);
58+
}
59+
};
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
const fs = require('fs');
2+
const os = require('os');
3+
const path = require('path');
4+
const { dialog } = require('electron').remote;
5+
6+
window.handlers = {
7+
schemaOpen (onSuccess) {
8+
const filenames = dialog.showOpenDialogSync({
9+
filters: [{ name: 'Thinreports Layout File', extensions: ['tlf'] }],
10+
properties: ['openFile'],
11+
defaultPath: os.homedir()
12+
});
13+
14+
if (!filenames) return;
15+
16+
const filename = filenames[0];
17+
const schema = fs.readFileSync(filename, { encoding: 'utf-8' });
18+
19+
onSuccess(schema, filename);
20+
},
21+
22+
schemaSave (schema, filename, onSuccess) {
23+
fs.writeFileSync(filename, schema, { encoding: 'utf-8' });
24+
onSuccess();
25+
},
26+
27+
schemaSaveAs (schema, filename, onSuccess) {
28+
const defaultPath = filename || path.join(os.homedir(), 'template.tlf');
29+
const newFilename = dialog.showSaveDialogSync({
30+
filters: [{ name: 'Thinreports Layout File', extensions: ['tlf'] }],
31+
defaultPath
32+
});
33+
34+
if (!newFilename) return;
35+
36+
fs.writeFileSync(newFilename, schema, { encoding: 'utf-8' });
37+
38+
onSuccess(newFilename);
39+
}
40+
};

section_report/public/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
8+
<script src="handlers/<%= VUE_APP_HANDLERS %>.js"></script>
9+
<title>Thinreports Editor</title>
10+
</head>
11+
<body>
12+
<noscript>
13+
<strong>We're sorry but thinreports-editor doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
14+
</noscript>
15+
<div id="app"></div>
16+
<!-- built files will be auto injected -->
17+
</body>
18+
</html>

0 commit comments

Comments
 (0)