User data are included in data archive

This commit is contained in:
Pierre 2018-05-14 16:53:11 +02:00
parent e06a658422
commit 4ec6213877
4 changed files with 14 additions and 8 deletions

View File

@ -80,6 +80,9 @@ JSZipUtils.getBinaryContent = function(path, callback) {
xhr.overrideMimeType("text/plain; charset=x-user-defined"); xhr.overrideMimeType("text/plain; charset=x-user-defined");
} }
//Allow big files download
xhr.setRequestHeader("Range", "bytes=0-9999999999999999999999999999999");
xhr.onreadystatechange = function(evt) { xhr.onreadystatechange = function(evt) {
var file, err; var file, err;
// use `xhr` and not `this`... thanks IE // use `xhr` and not `this`... thanks IE

View File

@ -60,7 +60,7 @@ ComunicWeb.components.account.export.ui = {
var closeModal = function(){ var closeModal = function(){
$(modal).modal('hide'); $(modal).modal('hide');
emptyElem(modal); emptyElem(modal);
remove(); modal.remove();
} }
this._exportModal.close = closeModal; this._exportModal.close = closeModal;
this._exportModal.closeModal.onclick = closeModal; this._exportModal.closeModal.onclick = closeModal;

View File

@ -82,12 +82,12 @@ ComunicWeb.components.account.export.worker = {
//Add raw json file //Add raw json file
zip.file("source.json", JSON.stringify(data)); zip.file("source.json", JSON.stringify(data));
//Add the files to download //Add the files to download
/*files_list.forEach(function(url){ files_list.forEach(function(url){
var path = urlToPath(url); var path = urlToPath(url);
zip.file(path, urlToPromise(url), {binary:true}); zip.file(path, urlToPromise(url), {binary:true});
});*/ });
//Generated zip archive //Generated zip archive
zip.generateAsync({type:"blob"}, function updateCallback(metadata) { zip.generateAsync({type:"blob"}, function updateCallback(metadata) {
@ -147,9 +147,12 @@ ComunicWeb.components.account.export.worker = {
* @param {Object} info Information about the post to parse * @param {Object} info Information about the post to parse
*/ */
var parsePost = function(post){ var parsePost = function(post){
if(post.file_path_url != null){
if(!files.includes(post.file_path_url)) if(post.kind != "youtube"){
files.push(post.file_path_url); if(post.file_path_url != null){
if(!files.includes(post.file_path_url))
files.push(post.file_path_url);
}
} }
//Parse comments //Parse comments

View File

@ -139,7 +139,7 @@ class Dev {
"3rdparty/jszip/jszip.min.js", "3rdparty/jszip/jszip.min.js",
//JSZip utils //JSZip utils
"3rdparty/jszip-utils/jszip-utils.min.js", "3rdparty/jszip-utils/jszip-utils.js",
); );
/** /**