mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
semi working requires browser refresh
This commit is contained in:
parent
565097efb4
commit
3773b6346b
7 changed files with 91 additions and 42 deletions
|
@ -21,6 +21,7 @@
|
|||
var ERR = require("async-stacktrace");
|
||||
var exporthtml = require("../utils/ExportHtml");
|
||||
var exporttxt = require("../utils/ExportTxt");
|
||||
var exportEtherpad = require("../utils/ExportEtherpad");
|
||||
var async = require("async");
|
||||
var fs = require("fs");
|
||||
var settings = require('../utils/Settings');
|
||||
|
@ -52,14 +53,21 @@ exports.doExport = function(req, res, padId, type)
|
|||
// if fileName is set then set it to the padId, note that fileName is returned as an array.
|
||||
if(hookFileName.length) fileName = hookFileName;
|
||||
|
||||
|
||||
//tell the browser that this is a downloadable file
|
||||
res.attachment(fileName + "." + type);
|
||||
|
||||
//if this is a plain text export, we can do this directly
|
||||
// We have to over engineer this because tabs are stored as attributes and not plain text
|
||||
|
||||
if(type == "txt")
|
||||
if(type == "etherpad"){
|
||||
console.log("Exporting Etherpad");
|
||||
exportEtherpad.getPadRaw(padId, function(err, pad){
|
||||
if(!err){
|
||||
res.send(pad);
|
||||
// return;
|
||||
}
|
||||
});
|
||||
}
|
||||
else if(type == "txt")
|
||||
{
|
||||
var txt;
|
||||
var randNum;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue