mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
chat: Move chat-specific option processing to chat.js
This commit is contained in:
parent
1cbba4ea3a
commit
a1388b7876
2 changed files with 12 additions and 24 deletions
|
@ -292,6 +292,18 @@ exports.chat = (() => {
|
||||||
pad.collabClient.sendMessage({type: 'GET_CHAT_MESSAGES', start, end});
|
pad.collabClient.sendMessage({type: 'GET_CHAT_MESSAGES', start, end});
|
||||||
this.historyPointer = start;
|
this.historyPointer = start;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const {searchParams} = new URL(window.location.href);
|
||||||
|
const {showChat = true, alwaysShowChat = false, chatAndUsers = false} = clientVars.padOptions;
|
||||||
|
const settings = this._pad.settings;
|
||||||
|
settings.hideChat = showChat.toString() === 'false';
|
||||||
|
if (settings.hideChat) this.hide();
|
||||||
|
if (alwaysShowChat.toString() === 'true' && !settings.hideChat) this.stickToScreen();
|
||||||
|
if (chatAndUsers.toString() === 'true') this.chatAndUsers();
|
||||||
|
settings.hideChat = searchParams.get('showChat') === 'false';
|
||||||
|
if (settings.hideChat) this.hide();
|
||||||
|
if (searchParams.get('alwaysShowChat') === 'true' && !settings.hideChat) this.stickToScreen();
|
||||||
|
if (searchParams.get('chatAndUsers') === 'true') this.chatAndUsers();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -70,16 +70,6 @@ const getParameters = [
|
||||||
$('#editbar').css('display', 'flex');
|
$('#editbar').css('display', 'flex');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'showChat',
|
|
||||||
checkVal: null,
|
|
||||||
callback: (val) => {
|
|
||||||
if (val === 'false') {
|
|
||||||
settings.hideChat = true;
|
|
||||||
chat.hide();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'showLineNumbers',
|
name: 'showLineNumbers',
|
||||||
checkVal: 'false',
|
checkVal: 'false',
|
||||||
|
@ -117,20 +107,6 @@ const getParameters = [
|
||||||
settings.rtlIsTrue = true;
|
settings.rtlIsTrue = true;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'alwaysShowChat',
|
|
||||||
checkVal: 'true',
|
|
||||||
callback: (val) => {
|
|
||||||
if (!settings.hideChat) chat.stickToScreen();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'chatAndUsers',
|
|
||||||
checkVal: 'true',
|
|
||||||
callback: (val) => {
|
|
||||||
chat.chatAndUsers();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'lang',
|
name: 'lang',
|
||||||
checkVal: null,
|
checkVal: null,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue