diff options
author | Egil Moeller <egil.moller@freecode.no> | 2012-04-01 13:27:38 +0200 |
---|---|---|
committer | Egil Moeller <egil.moller@freecode.no> | 2012-04-01 13:27:38 +0200 |
commit | 33c53e61c2d467b41009b573588bb15553cbf538 (patch) | |
tree | ae97569b0fa9c88eb9e49c83d72dd771d952f21c /src/node/handler | |
parent | b74447aa3cc550eb2e20034b1a56ea47c20c7b09 (diff) | |
parent | aaad7d1428bad099b60a90f5a706607d99c3ec15 (diff) | |
download | etherpad-lite-33c53e61c2d467b41009b573588bb15553cbf538.zip |
Merge branch 'johnyma22'
Conflicts:
node/utils/Minify.js
src/static/js/pad.js
src/static/js/pad_docbar.js
src/static/js/pad_editbar.js
src/static/js/pad_savedrevs.js
static/css/timeslider.css
static/pad.html
Diffstat (limited to 'src/node/handler')
-rw-r--r-- | src/node/handler/PadMessageHandler.js | 22 | ||||
-rw-r--r-- | src/node/handler/TimesliderMessageHandler.js | 7 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index 26748517..e1786b2a 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -191,6 +191,11 @@ exports.handleMessage = function(client, message) handleChatMessage(client, message); } else if(message.type == "COLLABROOM" && + message.data.type == "SAVE_REVISION") + { + handleSaveRevisionMessage(client, message); + } + else if(message.type == "COLLABROOM" && message.data.type == "CLIENT_MESSAGE" && message.data.payload.type == "suggestUserName") { @@ -204,6 +209,23 @@ exports.handleMessage = function(client, message) } /** + * Handles a save revision message + * @param client the client that send this message + * @param message the message from the client + */ +function handleSaveRevisionMessage(client, message){ + var padId = session2pad[client.id]; + var userId = sessioninfos[client.id].author; + + padManager.getPad(padId, function(err, pad) + { + if(ERR(err)) return; + + pad.addSavedRevision(pad.head, userId); + }); +} + +/** * Handles a Chat Message * @param client the client that send this message * @param message the message from the client diff --git a/src/node/handler/TimesliderMessageHandler.js b/src/node/handler/TimesliderMessageHandler.js index 0081e645..9c063acd 100644 --- a/src/node/handler/TimesliderMessageHandler.js +++ b/src/node/handler/TimesliderMessageHandler.js @@ -166,6 +166,7 @@ function createTimesliderClientVars (padId, callback) hooks: [], initialStyledContents: {} }; + var pad; var initialChangesets = []; @@ -180,6 +181,12 @@ function createTimesliderClientVars (padId, callback) callback(); }); }, + //get all saved revisions and add them + function(callback) + { + clientVars.savedRevisions = pad.getSavedRevisions(); + callback(); + }, //get all authors and add them to function(callback) { |