Revert the changes adding anonymous pads
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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") {
|
||||
|
||||
@@ -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 = $('<span>').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();
|
||||
|
||||
Reference in New Issue
Block a user