summaryrefslogtreecommitdiff
path: root/src/node/handler
diff options
context:
space:
mode:
authorMatthias Bartelmeß <mba@fourplusone.de>2012-04-05 21:47:59 +0200
committerMatthias Bartelmeß <mba@fourplusone.de>2012-04-05 21:47:59 +0200
commit9e042ee942a4a3cce7fc89270833b72fd6bfb74a (patch)
treefe1115383b869cc73528465a55c60670bf5b343d /src/node/handler
parent35c0a38a01e65981cb03bd67a717693ec7549b9d (diff)
parentbe5aec7e20e7abeb1da0df3f836974178e960667 (diff)
downloadetherpad-lite-9e042ee942a4a3cce7fc89270833b72fd6bfb74a.zip
Merge branch 'develop' into timeslider_authors
Conflicts: src/static/css/pad.css src/templates/timeslider.html
Diffstat (limited to 'src/node/handler')
-rw-r--r--src/node/handler/PadMessageHandler.js22
-rw-r--r--src/node/handler/TimesliderMessageHandler.js7
2 files changed, 29 insertions, 0 deletions
diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js
index c3ee231c..866edeb0 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 da859779..a6cf8f4d 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)
{