From 11f0a9ae5fa9e21e4beb998a9d129c8a92a1a64e Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 25 Jan 2017 15:33:22 +0100 Subject: [PATCH] Revert the changes adding anonymous pads --- npm-debug.log | 49 ----------------------------------- www/common/cryptpad-common.js | 3 --- www/common/fileObject.js | 16 ++---------- www/drive/main.js | 11 +++----- 4 files changed, 5 insertions(+), 74 deletions(-) delete mode 100644 npm-debug.log diff --git a/npm-debug.log b/npm-debug.log deleted file mode 100644 index 69610cda2..000000000 --- a/npm-debug.log +++ /dev/null @@ -1,49 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/home/yflory/.nvm/versions/node/v7.0.0/bin/node', -1 verbose cli '/home/yflory/.nvm/versions/node/v7.0.0/bin/npm', -1 verbose cli 'run', -1 verbose cli 'lint' ] -2 info using npm@3.10.8 -3 info using node@v7.0.0 -4 verbose run-script [ 'prelint', 'lint', 'postlint' ] -5 info lifecycle cryptpad@0.1.0~prelint: cryptpad@0.1.0 -6 silly lifecycle cryptpad@0.1.0~prelint: no script for prelint, continuing -7 info lifecycle cryptpad@0.1.0~lint: cryptpad@0.1.0 -8 verbose lifecycle cryptpad@0.1.0~lint: unsafe-perm in lifecycle true -9 verbose lifecycle cryptpad@0.1.0~lint: PATH: /home/yflory/.nvm/versions/node/v7.0.0/lib/node_modules/npm/bin/node-gyp-bin:/home/yflory/XWiki/cryptpad/node_modules/.bin:/home/yflory/.nvm/versions/node/v7.0.0/bin:/usr/lib/jvm/java-8-openjdk-amd64/bin:/usr/local/apache-maven/apache-maven-3.3.9/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/yflory/android-sdk-linux/tools -10 verbose lifecycle cryptpad@0.1.0~lint: CWD: /home/yflory/XWiki/cryptpad -11 silly lifecycle cryptpad@0.1.0~lint: Args: [ '-c', -11 silly lifecycle 'jshint --config .jshintrc --exclude-path .jshintignore .' ] -12 silly lifecycle cryptpad@0.1.0~lint: Returned: code: 2 signal: null -13 info lifecycle cryptpad@0.1.0~lint: Failed to exec lint script -14 verbose stack Error: cryptpad@0.1.0 lint: `jshint --config .jshintrc --exclude-path .jshintignore .` -14 verbose stack Exit status 2 -14 verbose stack at EventEmitter. (/home/yflory/.nvm/versions/node/v7.0.0/lib/node_modules/npm/lib/utils/lifecycle.js:255:16) -14 verbose stack at emitTwo (events.js:106:13) -14 verbose stack at EventEmitter.emit (events.js:191:7) -14 verbose stack at ChildProcess. (/home/yflory/.nvm/versions/node/v7.0.0/lib/node_modules/npm/lib/utils/spawn.js:40:14) -14 verbose stack at emitTwo (events.js:106:13) -14 verbose stack at ChildProcess.emit (events.js:191:7) -14 verbose stack at maybeClose (internal/child_process.js:877:16) -14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) -15 verbose pkgid cryptpad@0.1.0 -16 verbose cwd /home/yflory/XWiki/cryptpad -17 error Linux 4.4.0-59-generic -18 error argv "/home/yflory/.nvm/versions/node/v7.0.0/bin/node" "/home/yflory/.nvm/versions/node/v7.0.0/bin/npm" "run" "lint" -19 error node v7.0.0 -20 error npm v3.10.8 -21 error code ELIFECYCLE -22 error cryptpad@0.1.0 lint: `jshint --config .jshintrc --exclude-path .jshintignore .` -22 error Exit status 2 -23 error Failed at the cryptpad@0.1.0 lint script 'jshint --config .jshintrc --exclude-path .jshintignore .'. -23 error Make sure you have the latest version of node.js and npm installed. -23 error If you do, this is most likely a problem with the cryptpad package, -23 error not with npm itself. -23 error Tell the author that this fails on your system: -23 error jshint --config .jshintrc --exclude-path .jshintignore . -23 error You can get information on how to open an issue for this project with: -23 error npm bugs cryptpad -23 error Or if that isn't available, you can get their info via: -23 error npm owner ls cryptpad -23 error There is likely additional logging output above. -24 verbose exit [ 1, true ] diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index b49210517..4c68dcd03 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -576,9 +576,6 @@ define([ if (!contains) { var data = makePad(href, name); - if (common.initialPath) { - data.owner = getStore().getLoginName(); // TODO use owner id here? - } renamed.push(data); if (USE_FS_STORE && common.initialPath && typeof(getStore().addPad) === "function") { getStore().addPad(href, common.initialPath, name); diff --git a/www/common/fileObject.js b/www/common/fileObject.js index 1d16cef93..f19bdc2d4 100644 --- a/www/common/fileObject.js +++ b/www/common/fileObject.js @@ -713,11 +713,6 @@ define([ }); }; - var isAnonFile = exp.isAnonFile = function (file) { - var data = getFileData(file); - return !data.owner; - }; - var fixFiles = exp.fixFiles = function () { // Explore the tree and check that everything is correct: // * 'root', 'trash', 'unsorted' and 'filesData' exist and are objects @@ -739,11 +734,6 @@ define([ debug("An element in ROOT was not a folder nor a file. ", element[el]); element[el] = undefined; delete element[el]; - } else if (isFile(element[el])) { - if (isAnonFile(element[el])) { - debug("An element in ROOT was an anonymous file. ", element[el]); - delete element[el]; - } } else if (isFolder(element[el])) { fixRoot(element[el]); } @@ -756,7 +746,6 @@ define([ var addToClean = function (obj, idx) { if (typeof(obj) !== "object") { toClean.push(idx); return; } if (!isFile(obj.element) && !isFolder(obj.element)) { toClean.push(idx); return; } - if (isFile(obj.element) && isAnonFile(obj.element)) { toClean.push(idx); return; } if (!$.isArray(obj.path)) { toClean.push(idx); return; } }; for (var el in tr) { @@ -781,7 +770,7 @@ define([ var templateFiles = getTemplateFiles(); var toClean = []; us.forEach(function (el, idx) { - if (!isFile(el) || rootFiles.indexOf(el) !== -1 || templateFiles.indexOf(el) !== -1 || isAnonFile(el)) { + if (!isFile(el) || rootFiles.indexOf(el) !== -1 || templateFiles.indexOf(el) !== -1) { toClean.push(idx); } }); @@ -797,7 +786,7 @@ define([ var unsortedFiles = getUnsortedFiles(); var toClean = []; us.forEach(function (el, idx) { - if (!isFile(el) || rootFiles.indexOf(el) !== -1 || unsortedFiles.indexOf(el) !== -1 || isAnonFile(el)) { + if (!isFile(el) || rootFiles.indexOf(el) !== -1 || unsortedFiles.indexOf(el) !== -1) { toClean.push(idx); } }); @@ -812,7 +801,6 @@ define([ var unsortedFiles = getUnsortedFiles(); var templateFiles = getTemplateFiles(); var trashFiles = getTrashFiles(); - //var anonFiles = getAnonFiles(); var toClean = []; fd.forEach(function (el, idx) { if (typeof(el) !== "object") { diff --git a/www/drive/main.js b/www/drive/main.js index 42d8a3fbc..6b7fe7849 100644 --- a/www/drive/main.js +++ b/www/drive/main.js @@ -648,17 +648,12 @@ define([ var getFileIcon = function (href) { var $icon = $fileIcon.clone(); - var data = filesOp.getFileData(href); - if (!data) { return $icon; } if (href.indexOf('/pad/') !== -1) { $icon = $padIcon.clone() } else if (href.indexOf('/code/') !== -1) { $icon = $codeIcon.clone() } else if (href.indexOf('/slide/') !== -1) { $icon = $slideIcon.clone() } else if (href.indexOf('/poll/') !== -1) { $icon = $pollIcon.clone() } - if (!data.owner) { - $icon = $('').append($anonIcon.clone()).append($icon); - } return $icon; }; @@ -1249,7 +1244,7 @@ define([ var $fileHeader = getFileListHeader(true); if (isUnsorted || isTemplate) { - displayHrefArray($list, path[0]); + displayHrefArray($list, path[0], true); } else if (isAllFiles) { displayAllFiles($list); } else if (isTrashRoot) { @@ -1676,7 +1671,7 @@ define([ var path = arguments[2]; if (path[0] !== 'drive') { return false; } path = path.slice(1); - var cPath = filesOp.isPathInAnon(currentPath) ? [FILES_DATA] : currentPath.slice(); + var cPath = currentPath.slice(); if ((filesOp.isPathInUnsorted(cPath) && filesOp.isPathInUnsorted(path)) || (filesOp.isPathInTemplate(cPath) && filesOp.isPathInTemplate(path)) || (path.length >= cPath.length && filesOp.isSubpath(path, cPath)) || @@ -1684,7 +1679,7 @@ define([ // Reload after a few ms to make sure all the change events have been received onRefresh.refresh(); } else if (path.length && path[0] === FILES_DATA) { - if (filesOp.isPathInHrefArray(cPath) || filesOp.isPathInAnon(path)) { + if (filesOp.isPathInHrefArray(cPath)) { onRefresh.refresh(); } else { refreshFilesData();