mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-16 16:14:43 -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
|
@ -1,3 +1,5 @@
|
|||
var config = require('../../config');
|
||||
|
||||
if (typeof ot === 'undefined') {
|
||||
var ot = {};
|
||||
}
|
||||
|
@ -28,7 +30,10 @@ ot.Server = (function (global) {
|
|||
}
|
||||
|
||||
// ... and apply that on the document.
|
||||
this.document = operation.apply(this.document);
|
||||
var newDocument = operation.apply(this.document);
|
||||
// ignore if exceed the max length of document
|
||||
if(newDocument.length > config.documentmaxlength) return;
|
||||
this.document = newDocument;
|
||||
// Store operation in history.
|
||||
this.operations.push(operation);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue