mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -04:00
Delete dead SERVER_MESSAGE and guest handling code
None of this code seems to be reachable. Hopefully no plugins expect it to exist.
This commit is contained in:
parent
794dfb1863
commit
7e50fc2ab5
7 changed files with 11 additions and 242 deletions
|
@ -247,90 +247,6 @@ const padutils = {
|
|||
};
|
||||
return {scheduleAnimation};
|
||||
},
|
||||
makeShowHideAnimator: (funcToArriveAtState, initiallyShown, fps, totalMs) => {
|
||||
let animationState = (initiallyShown ? 0 : -2); // -2 hidden, -1 to 0 fade in, 0 to 1 fade out
|
||||
const animationFrameDelay = 1000 / fps;
|
||||
const animationStep = animationFrameDelay / totalMs;
|
||||
|
||||
const animateOneStep = () => {
|
||||
if (animationState < -1 || animationState === 0) {
|
||||
return false;
|
||||
} else if (animationState < 0) {
|
||||
// animate show
|
||||
animationState += animationStep;
|
||||
if (animationState >= 0) {
|
||||
animationState = 0;
|
||||
funcToArriveAtState(animationState);
|
||||
return false;
|
||||
} else {
|
||||
funcToArriveAtState(animationState);
|
||||
return true;
|
||||
}
|
||||
} else if (animationState > 0) {
|
||||
// animate hide
|
||||
animationState += animationStep;
|
||||
if (animationState >= 1) {
|
||||
animationState = 1;
|
||||
funcToArriveAtState(animationState);
|
||||
animationState = -2;
|
||||
return false;
|
||||
} else {
|
||||
funcToArriveAtState(animationState);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const scheduleAnimation =
|
||||
padutils.makeAnimationScheduler(animateOneStep, animationFrameDelay).scheduleAnimation;
|
||||
|
||||
return {
|
||||
show: () => {
|
||||
animationState = -1;
|
||||
funcToArriveAtState(animationState);
|
||||
scheduleAnimation();
|
||||
},
|
||||
quickShow: () => { // start showing without losing any fade-in progress
|
||||
if (animationState < -1) {
|
||||
animationState = -1;
|
||||
} else if (animationState > 0) {
|
||||
animationState = Math.max(-1, Math.min(0, -animationState));
|
||||
}
|
||||
funcToArriveAtState(animationState);
|
||||
scheduleAnimation();
|
||||
},
|
||||
hide: () => {
|
||||
if (animationState >= -1 && animationState <= 0) {
|
||||
animationState = 1e-6;
|
||||
scheduleAnimation();
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
_nextActionId: 1,
|
||||
uncanceledActions: {},
|
||||
getCancellableAction: (actionType, actionFunc) => {
|
||||
let o = padutils.uncanceledActions[actionType];
|
||||
if (!o) {
|
||||
o = {};
|
||||
padutils.uncanceledActions[actionType] = o;
|
||||
}
|
||||
const actionId = (padutils._nextActionId++);
|
||||
o[actionId] = true;
|
||||
return () => {
|
||||
const p = padutils.uncanceledActions[actionType];
|
||||
if (p && p[actionId]) {
|
||||
actionFunc();
|
||||
}
|
||||
};
|
||||
},
|
||||
cancelActions: (actionType) => {
|
||||
const o = padutils.uncanceledActions[actionType];
|
||||
if (o) {
|
||||
// clear it
|
||||
delete padutils.uncanceledActions[actionType];
|
||||
}
|
||||
},
|
||||
makeFieldLabeledWhenEmpty: (field, labelText) => {
|
||||
field = $(field);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue