mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-16 08:04:45 -04:00
Added document max length limit, enforceMaxLength on change and show modal when reach the limit.
This commit is contained in:
parent
57253d28a7
commit
d14c5bdc9c
6 changed files with 59 additions and 9 deletions
|
@ -207,6 +207,7 @@ function emitRefresh(socket) {
|
|||
if (!notename || !notes[notename]) return;
|
||||
var note = notes[notename];
|
||||
socket.emit('refresh', {
|
||||
docmaxlength: config.documentmaxlength,
|
||||
owner: note.owner,
|
||||
permission: note.permission,
|
||||
updatetime: note.updatetime
|
||||
|
@ -218,13 +219,12 @@ var connectionSocketQueue = [];
|
|||
var isDisconnectBusy = false;
|
||||
var disconnectSocketQueue = [];
|
||||
|
||||
function finishConnection(socket, notename) {
|
||||
var note = notes[notename];
|
||||
note.users[socket.id] = users[socket.id];
|
||||
function finishConnection(socket, note, user) {
|
||||
note.users[socket.id] = user;
|
||||
note.socks.push(socket);
|
||||
note.server.addClient(socket);
|
||||
note.server.setName(socket, users[socket.id].name);
|
||||
note.server.setColor(socket, users[socket.id].color);
|
||||
note.server.setName(socket, user.name);
|
||||
note.server.setColor(socket, user.color);
|
||||
|
||||
emitOnlineUsers(socket);
|
||||
emitRefresh(socket);
|
||||
|
@ -240,8 +240,9 @@ function finishConnection(socket, notename) {
|
|||
startConnection(connectionSocketQueue[0]);
|
||||
|
||||
if (config.debug) {
|
||||
var notename = getNotenameFromSocket(socket);
|
||||
logger.info('SERVER connected a client to [' + notename + ']:');
|
||||
logger.info(JSON.stringify(users[socket.id]));
|
||||
logger.info(JSON.stringify(user));
|
||||
//logger.info(notes);
|
||||
getStatus(function (data) {
|
||||
logger.info(JSON.stringify(data));
|
||||
|
@ -293,11 +294,11 @@ function startConnection(socket) {
|
|||
updatetime: moment(updatetime).valueOf(),
|
||||
server: server
|
||||
};
|
||||
finishConnection(socket, notename);
|
||||
finishConnection(socket, notes[notename], users[socket.id]);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
finishConnection(socket, notename);
|
||||
finishConnection(socket, notes[notename], users[socket.id]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue