mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
chat: Move chatHead
client var to clientVars
hook
This commit is contained in:
parent
8d5fdd7dc9
commit
2e684476cb
5 changed files with 14 additions and 4 deletions
|
@ -96,6 +96,7 @@
|
|||
* The `sendChatMessageToPadClients()` function in
|
||||
`src/node/handler/PadMessageHandler.js` is deprecated.
|
||||
* Client-side:
|
||||
* The `chat` global variable is deprecated.
|
||||
* The `pad.determineChatVisibility()` method was removed.
|
||||
* The `pad.determineChatAndUsersVisibility()` method was removed.
|
||||
* Returning `true` from a `handleMessageSecurity` hook function is deprecated;
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
"postAceInit": "ep_etherpad-lite/static/js/chat"
|
||||
},
|
||||
"hooks": {
|
||||
"clientVars": "ep_etherpad-lite/node/chat",
|
||||
"eejsBlock_mySettings": "ep_etherpad-lite/node/chat",
|
||||
"eejsBlock_stickyContainer": "ep_etherpad-lite/node/chat",
|
||||
"handleMessage": "ep_etherpad-lite/node/chat",
|
||||
|
|
|
@ -23,6 +23,8 @@ const sendChatMessageToPadClients = async (message, padId) => {
|
|||
await promise;
|
||||
};
|
||||
|
||||
exports.clientVars = (hookName, {pad: {chatHead}}) => ({chatHead});
|
||||
|
||||
exports.eejsBlock_mySettings = (hookName, context) => {
|
||||
context.content += `
|
||||
<p class="hide-for-mobile">
|
||||
|
|
|
@ -903,9 +903,6 @@ const handleClientReady = async (socket, message) => {
|
|||
padShortcutEnabled: settings.padShortcutEnabled,
|
||||
initialTitle: `Pad: ${sessionInfo.auth.padID}`,
|
||||
opts: {},
|
||||
// tell the client the number of the latest chat-message, which will be
|
||||
// used to request the latest 100 chat-messages later (GET_CHAT_MESSAGES)
|
||||
chatHead: pad.chatHead,
|
||||
numConnectedUsers: roomSockets.length,
|
||||
readOnlyId: sessionInfo.readOnlyPadId,
|
||||
readonly: sessionInfo.readonly,
|
||||
|
|
|
@ -467,9 +467,18 @@
|
|||
|
||||
/* TODO: These globals shouldn't exist. */
|
||||
pad = require('ep_etherpad-lite/static/js/pad').pad;
|
||||
chat = require('ep_etherpad-lite/static/js/chat').chat;
|
||||
padeditbar = require('ep_etherpad-lite/static/js/pad_editbar').padeditbar;
|
||||
padimpexp = require('ep_etherpad-lite/static/js/pad_impexp').padimpexp;
|
||||
|
||||
Object.defineProperty(window, 'chat', {
|
||||
get: () => {
|
||||
const {padutils: {warnDeprecated}} = require('ep_etherpad-lite/static/js/pad_utils');
|
||||
warnDeprecated(
|
||||
'window.chat is deprecated and will be removed in a future version of Etherpad');
|
||||
return require('ep_etherpad-lite/static/js/chat').chat;
|
||||
},
|
||||
});
|
||||
|
||||
require('ep_etherpad-lite/static/js/skin_variants');
|
||||
|
||||
}());
|
||||
|
|
Loading…
Reference in a new issue