diff options
author | John McLear <john@mclear.co.uk> | 2014-05-12 15:08:32 +0100 |
---|---|---|
committer | John McLear <john@mclear.co.uk> | 2014-05-12 15:08:32 +0100 |
commit | d09e66e271cde2c80f9a0bcebdea5d5f286ba7a6 (patch) | |
tree | 77ae24da6a76201658f3c756c904d329b36db94a | |
parent | ec6dc4fa0ee785c7d80420ef706af7b87dab3218 (diff) | |
download | etherpad-lite-d09e66e271cde2c80f9a0bcebdea5d5f286ba7a6.zip |
use call first and update docs
-rw-r--r-- | doc/api/hooks_server-side.md | 4 | ||||
-rw-r--r-- | src/node/handler/ExportHandler.js | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/doc/api/hooks_server-side.md b/doc/api/hooks_server-side.md index 0c251c3e..51026140 100644 --- a/doc/api/hooks_server-side.md +++ b/doc/api/hooks_server-side.md @@ -259,7 +259,7 @@ This hook will allow a plug-in developer to modify the file name of an exported Example: ``` -exports.exportFileName = function(hook, padId){ - return "newFileName"+padId; +exports.exportFileName = function(hook, padId, callback){ + callback("newFileName"+padId); } ``` diff --git a/src/node/handler/ExportHandler.js b/src/node/handler/ExportHandler.js index 54b41c46..11d247d6 100644 --- a/src/node/handler/ExportHandler.js +++ b/src/node/handler/ExportHandler.js @@ -49,10 +49,10 @@ exports.doExport = function(req, res, padId, type) var fileName = padId; // allow fileName to be overwritten by a hook, the type type is kept static for security reasons - hooks.aCallAll("exportFileName", padId, + hooks.aCallFirst("exportFileName", padId, function(err, hookFileName){ // if fileName is set then set it to the padId, note that fileName is returned as an array. - if(fileName[0]) fileName = hookFileName; + if(hookFileName[0]) fileName = hookFileName[0]; } ); |