mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 00:46:16 -04:00
lint: Fix some straightforward ESLint errors
This commit is contained in:
parent
ac086c7925
commit
ff19181cd1
10 changed files with 154 additions and 153 deletions
|
@ -1,9 +1,11 @@
|
|||
const eejs = require('ep_etherpad-lite/node/eejs');
|
||||
const settings = require('ep_etherpad-lite/node/utils/Settings');
|
||||
const hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
|
||||
const fs = require('fs');
|
||||
'use strict';
|
||||
|
||||
exports.expressCreateServer = function (hook_name, args, cb) {
|
||||
const eejs = require('../../eejs');
|
||||
const fs = require('fs');
|
||||
const hooks = require('../../../static/js/pluginfw/hooks');
|
||||
const settings = require('../../utils/Settings');
|
||||
|
||||
exports.expressCreateServer = (hookName, args, cb) => {
|
||||
args.app.get('/admin/settings', (req, res) => {
|
||||
res.send(eejs.require('ep_etherpad-lite/templates/admin/settings.html', {
|
||||
req,
|
||||
|
@ -14,10 +16,11 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
|||
return cb();
|
||||
};
|
||||
|
||||
exports.socketio = function (hook_name, args, cb) {
|
||||
exports.socketio = (hookName, args, cb) => {
|
||||
const io = args.io.of('/settings');
|
||||
io.on('connection', (socket) => {
|
||||
if (!socket.conn.request.session || !socket.conn.request.session.user || !socket.conn.request.session.user.is_admin) return;
|
||||
const {session: {user: {is_admin: isAdmin} = {}} = {}} = socket.conn.request;
|
||||
if (!isAdmin) return;
|
||||
|
||||
socket.on('load', (query) => {
|
||||
fs.readFile('settings.json', 'utf8', (err, data) => {
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
'use strict';
|
||||
|
||||
const express = require('../express');
|
||||
const proxyaddr = require('proxy-addr');
|
||||
const settings = require('../../utils/Settings');
|
||||
const socketio = require('socket.io');
|
||||
const socketIORouter = require('../../handler/SocketIORouter');
|
||||
const hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
|
||||
const hooks = require('../../../static/js/pluginfw/hooks');
|
||||
|
||||
const padMessageHandler = require('../../handler/PadMessageHandler');
|
||||
|
||||
exports.expressCreateServer = function (hook_name, args, cb) {
|
||||
exports.expressCreateServer = (hookName, args, cb) => {
|
||||
// init socket.io and redirect all requests to the MessageHandler
|
||||
// there shouldn't be a browser that isn't compatible to all
|
||||
// transports in this list at once
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue