lint: pad prefix files (#4577)

* lint: pad_connectionstatus

* lint: pad_utils

* lint: pad_userlist.js -- still WIP

* shift underscore not to be in require but to be used from window

* lint: pad_modals

* pad_impexp.js

* lint: more errors done

* lint: auto reconn

* lint: pad_editor

* lint: finish auto reconn

* lint: imp exp rework

* lint: import

* lint: pad.js nearly done but pizza here...

* lint: clientVars global query

* put clientVars in window

* Revert incorrect lint fixes

* Properly fix guard-for-in lint errors

* Properly fix no-unused-vars error regarding `gritter`

* Refine lint fixes

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
This commit is contained in:
John McLear 2020-12-20 07:15:58 +00:00 committed by GitHub
parent 34ee77993f
commit 0362d3b05d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 512 additions and 459 deletions

View file

@ -1,3 +1,5 @@
'use strict';
/**
* This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it.
@ -22,25 +24,25 @@
const padmodals = require('./pad_modals').padmodals;
const padconnectionstatus = (function () {
const padconnectionstatus = (() => {
let status = {
what: 'connecting',
};
const self = {
init() {
init: () => {
$('button#forcereconnect').click(() => {
window.location.reload();
});
},
connected() {
connected: () => {
status = {
what: 'connected',
};
padmodals.showModal('connected');
padmodals.hideOverlay();
},
reconnecting() {
reconnecting: () => {
status = {
what: 'reconnecting',
};
@ -48,8 +50,8 @@ const padconnectionstatus = (function () {
padmodals.showModal('reconnecting');
padmodals.showOverlay();
},
disconnected(msg) {
if (status.what == 'disconnected') return;
disconnected: (msg) => {
if (status.what === 'disconnected') return;
status = {
what: 'disconnected',
@ -81,14 +83,10 @@ const padconnectionstatus = (function () {
padmodals.showModal(k);
padmodals.showOverlay();
},
isFullyConnected() {
return status.what == 'connected';
},
getStatus() {
return status;
},
isFullyConnected: () => status.what === 'connected',
getStatus: () => status,
};
return self;
}());
})();
exports.padconnectionstatus = padconnectionstatus;