Repository navigation
Expand file tree
/
Copy pathbundle.js
More file actions
109 lines (100 loc) · 3.94 KB
/
Copy pathbundle.js
File metadata and controls
109 lines (100 loc) · 3.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
window.$ = window.jQuery = require('jquery');
const { Spinner } = require('spin.js');
window.Spinner = Spinner;
require('ace-builds/src-min-noconflict/ace');
require('ace-builds/src-min-noconflict/ext-language_tools');
// mode / theme / worker は html/bundle/ace に静的配置している。
// サブディレクトリに設置した場合でも解決できるよう、このバンドル自身の URL を基準にする。
const bundleSrc = document.currentScript ? document.currentScript.src : window.location.href;
const acePath = new URL('ace/', bundleSrc).href;
// ace は読み込み時に自身の置き場 (= このバンドルの位置) を basePath だけでなく
// modePath / themePath / workerPath にも入れる。config.moduleUrl() は
// options[component + 'Path'] を basePath より優先するため、basePath だけ上書きしても
// mode / theme / worker は html/bundle 直下を見て 404 になる。4 つとも設定する。
// snippetsPath は設定しないこと: 設定すると moduleUrl() が component と区切り文字を落とし、
// ace/snippets/foo が ace/foo.js に解決されて逆に壊れる (未設定なら basePath へフォールバックする)。
['basePath', 'modePath', 'themePath', 'workerPath'].forEach((key) => window.ace.config.set(key, acePath));
require('jquery.qrcode');
// 並び替え (ドラッグ & ドロップ) は SortableJS を使う。jQuery UI は撤去した (#6943)。
// 管理画面のテンプレートとプラグインから window.Sortable で参照する。
// package.json の module フィールド経由で ESM 版が解決されるため default を取り出す。
const SortableModule = require('sortablejs');
window.Sortable = SortableModule.default || SortableModule;
// jQuery UI の $.fn.sortable / $.fn.resizable に依存するプラグイン向けの互換 shim (非推奨、4.5 で削除)。
// window.Sortable の後に読み込むこと。
require('./jquery-ui-compat');
const {
Chart,
ArcElement,
LineElement,
BarElement,
PointElement,
BarController,
BubbleController,
DoughnutController,
LineController,
PieController,
PolarAreaController,
RadarController,
ScatterController,
CategoryScale,
LinearScale,
LogarithmicScale,
RadialLinearScale,
TimeScale,
TimeSeriesScale,
Decimation,
Filler,
Legend,
Title,
Tooltip,
SubTitle
} = require('chart.js');
Chart.register(
ArcElement,
LineElement,
BarElement,
PointElement,
BarController,
BubbleController,
DoughnutController,
LineController,
PieController,
PolarAreaController,
RadarController,
ScatterController,
CategoryScale,
LinearScale,
LogarithmicScale,
RadialLinearScale,
TimeScale,
TimeSeriesScale,
Decimation,
Filler,
Legend,
Title,
Tooltip,
SubTitle
);
window.Chart = Chart;
require('ladda/dist/ladda-themeless.min.css');
const Ladda = require('ladda');
window.Ladda = Ladda;
const bootstrap = require('bootstrap');
window.bootstrap = bootstrap;
require('filepond/dist/filepond.min.css');
require('filepond-plugin-image-preview/dist/filepond-plugin-image-preview.min.css');
const FilePondPluginImagePreview = require('filepond-plugin-image-preview/dist/filepond-plugin-image-preview');
const FilePondPluginFileValidateType = require('filepond-plugin-file-validate-type/dist/filepond-plugin-file-validate-type');
const FilePondPluginFileValidateSize = require('filepond-plugin-file-validate-size/dist/filepond-plugin-file-validate-size');
const FilePond = require('filepond');
FilePond.registerPlugin(
FilePondPluginImagePreview,
FilePondPluginFileValidateType,
FilePondPluginFileValidateSize
);
window.FilePond = FilePond;
const FilePondLocale_en = require('filepond/locale/en-en.js');
window.FilePondLocale_en = FilePondLocale_en.default;
const FilePondLocale_ja = require('filepond/locale/ja-ja.js');
window.FilePondLocale_ja = FilePondLocale_ja.default;