mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
update pad clients
This commit is contained in:
parent
46bc328896
commit
9d39c9591a
1 changed files with 88 additions and 82 deletions
|
@ -586,6 +586,7 @@ exports.deletePad = function(padID, callback)
|
|||
exports.restoreRevision = function (padID, rev, callback)
|
||||
{
|
||||
var Changeset = require("ep_etherpad-lite/static/js/Changeset");
|
||||
var padMessage = require("ep_etherpad-lite/node/handler/PadMessageHandler.js");
|
||||
|
||||
//check if rev is a number
|
||||
if (rev !== undefined && typeof rev != "number")
|
||||
|
@ -663,9 +664,11 @@ exports.restoreRevision = function(padID, rev, callback)
|
|||
});
|
||||
|
||||
var lastNewlinePos = oldText.lastIndexOf('\n');
|
||||
if (lastNewlinePos < 0) {
|
||||
if (lastNewlinePos < 0)
|
||||
{
|
||||
builder.remove(oldText.length - 1, 0);
|
||||
} else {
|
||||
} else
|
||||
{
|
||||
builder.remove(lastNewlinePos, oldText.match(/\n/g).length - 1);
|
||||
builder.remove(oldText.length - lastNewlinePos - 1, 0);
|
||||
}
|
||||
|
@ -675,6 +678,9 @@ exports.restoreRevision = function(padID, rev, callback)
|
|||
//append the changeset
|
||||
pad.appendRevision(changeset);
|
||||
//
|
||||
padMessage.updatePadClients(pad, function ()
|
||||
{
|
||||
});
|
||||
callback(null, null);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue