forked from ether/ep_offline_edit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
35 lines (28 loc) · 897 Bytes
/
index.js
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
'use strict';
const eejs = require('ep_etherpad-lite/node/eejs');
exports.eejsBlock_disconnected = (hookName, args, cb) => {
cb();
};
exports.eejsBlock_styles = (hookName, args, cb) => {
cb();
};
exports.eejsBlock_scripts = (hookName, args, cb) => {
args.content +=
'<script src="/static/plugins/ep_offline_edit/static/js/offline_edit.js"></script>' +
'<script src="/static/plugins/ep_offline_edit/static/js/lib/localForage.js"></script>';
cb();
};
exports.eejsBlock_htmlHead = (hookName, args, cb) => {
cb();
};
exports.expressConfigure = (hookName, args, cb) => {
cb();
};
exports.expressServer = (hookName, args, cb) => {
args.app.get('/serviceWorker.js', (req, res) => {
const serviceWorker = eejs.require('ep_offline_edit/static/js/serviceWorker.js');
res.setHeader('Content-Type', 'application/javascript');
res.send(serviceWorker);
});
cb();
};