mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
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:
parent
34ee77993f
commit
0362d3b05d
11 changed files with 512 additions and 459 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue