diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js
index 4b5b9f825..d8757cc46 100644
--- a/customize.dist/translations/messages.fr.js
+++ b/customize.dist/translations/messages.fr.js
@@ -395,6 +395,7 @@ define(function () {
out.fm_recentPadsName = "Pads récents";
out.fm_ownedPadsName = "Pads en votre possession";
out.fm_tagsName = "Mots-clés";
+ out.fm_sharedFolderName = "Dossier partagé";
out.fm_searchPlaceholder = "Rechercher...";
out.fm_newButton = "Nouveau";
out.fm_newButtonTitle = "Créer un nouveau pad ou un dossier, importer un fichier dans le dossier courant";
@@ -437,6 +438,8 @@ define(function () {
out.fm_info_anonymous = 'Vous n\'êtes pas connecté, ces pads seront donc supprimés après 3 mois d\'inactivité (découvrez pourquoi). ' +
'Ils sont stockés dans votre navigateur donc nettoyer votre historique peut les faire disparaître.
' +
'Inscrivez-vous ou connectez-vous pour les maintenir en vie.';
+ out.fm_info_sharedFolder = "Voici le contenu d'un dossier partagé. Il n'est accessible qu'en lecture seule car vous n'êtes pas connecté.
" +
+ 'Inscrivez-vous ou connectez-vous pour pouvoir l\'importer dans votre CryptDrive et le modifier.';
out.fm_info_owned = "Vous êtes propriétaire des pads affichés dans cette catégorie. Cela signifie que vous pouvez choisir de les supprimer définitivement du serveur à n'importe quel moment. Ils seront alors inaccessibles pour tous les autres utilisateurs.";
out.fm_alert_backupUrl = "Lien de secours pour ce CryptDrive.
" +
"Il est fortement recommandé de garder ce lien pour vous-même.
" +
diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js
index 0a6ec0e5c..5b660d0eb 100644
--- a/customize.dist/translations/messages.js
+++ b/customize.dist/translations/messages.js
@@ -397,6 +397,7 @@ define(function () {
out.fm_recentPadsName = "Recent pads";
out.fm_ownedPadsName = "Owned";
out.fm_tagsName = "Tags";
+ out.fm_sharedFolderName = "Shared folder";
out.fm_searchPlaceholder = "Search...";
out.fm_newButton = "New";
out.fm_newButtonTitle = "Create a new pad or folder, import a file in the current folder";
@@ -439,6 +440,8 @@ define(function () {
out.fm_info_anonymous = 'You are not logged in so your pads will expire after 3 months (find out more). ' +
'They are stored in your browser so clearing history may make them disappear.
' +
'Sign up or Log in to keep them alive.
';
+ out.fm_info_sharedFolder = "This is a shared folder. You're not logged in so you can only access it in read-only mode.
" +
+ 'Sign up or Log in to be able to import it to your CryptDrive and to modify it.';
out.fm_info_owned = "You are the owner of the pads displayed here. This means you can remove them permanently from the server whenever you want. If you do so, other users won't be able to access them anymore.";
out.fm_alert_backupUrl = "Backup link for this drive.
" +
"It is highly recommended that you keep it secret.
" +
diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js
index cd16309e7..84e7d1a01 100644
--- a/www/common/cryptpad-common.js
+++ b/www/common/cryptpad-common.js
@@ -89,6 +89,12 @@ define([
cb(obj);
});
};
+ common.loadSharedFolder = function (id, data, cb) {
+ postMessage("LOAD_SHARED_FOLDER", {
+ id: id,
+ data: data
+ }, cb);
+ };
// Settings and ready
common.mergeAnonDrive = function (cb) {
var data = {
diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js
index da5edd951..ca42a7645 100644
--- a/www/common/outer/async-store.js
+++ b/www/common/outer/async-store.js
@@ -1239,6 +1239,11 @@ define([
}
return rt;
};
+ Store.loadSharedFolderAnon = function (clientId, data, cb) {
+ loadSharedFolder(data.id, data.data, function () {
+ cb();
+ });
+ };
Store.addSharedFolder = function (clientId, data, cb) {
Store.userObjectCommand(clientId, {
cmd: 'addSharedFolder',
diff --git a/www/common/outer/store-rpc.js b/www/common/outer/store-rpc.js
index a724fbd06..1c37be12c 100644
--- a/www/common/outer/store-rpc.js
+++ b/www/common/outer/store-rpc.js
@@ -56,6 +56,7 @@ define([
INCREMENT_TEMPLATE_USE: Store.incrementTemplateUse,
GET_SHARED_FOLDER: Store.getSharedFolder,
ADD_SHARED_FOLDER: Store.addSharedFolder,
+ LOAD_SHARED_FOLDER: Store.loadSharedFolderAnon,
// Messaging
INVITE_FROM_USERLIST: Store.inviteFromUserlist,
ADD_DIRECT_MESSAGE_HANDLERS: Store.addDirectMessageHandlers,
diff --git a/www/common/proxy-manager.js b/www/common/proxy-manager.js
index 3a6028ab1..b35e6c742 100644
--- a/www/common/proxy-manager.js
+++ b/www/common/proxy-manager.js
@@ -838,7 +838,8 @@ define([
var getFileData = _getFileData;
var getUserObjectPath = _getUserObjectPath;
- var find = function (Env, path) {
+ var find = function (Env, path, fId) {
+ if (fId) { return Env.folders[fId].userObject.find(path); }
var resolved = _resolvePath(Env, path);
return resolved.userObject.find(resolved.path);
};
diff --git a/www/common/sframe-common-title.js b/www/common/sframe-common-title.js
index dcbf6288a..b406a5dd0 100644
--- a/www/common/sframe-common-title.js
+++ b/www/common/sframe-common-title.js
@@ -23,7 +23,6 @@ define([
var $title;
exp.setToolbar = function (toolbar) {
$title = toolbar && (toolbar.title || toolbar.pageTitle);
- console.log('SET TOOLBAR');
};
exp.getTitle = function () { return exp.title; };
diff --git a/www/drive/inner.js b/www/drive/inner.js
index fa43a550d..80634bd67 100644
--- a/www/drive/inner.js
+++ b/www/drive/inner.js
@@ -67,6 +67,8 @@ define([
var OWNED_NAME = Messages.fm_ownedPadsName;
var TAGS = "tags";
var TAGS_NAME = Messages.fm_tagsName;
+ var SHARED_FOLDER = 'sf';
+ var SHARED_FOLDER_NAME = Messages.fm_sharedFolderName;
// Icons
var faFolder = 'fa-folder';
@@ -123,7 +125,7 @@ define([
var FOLDER_CONTENT_ID = "cp-app-drive-content-folder";
var config = {};
- var DEBUG = config.DEBUG = true;
+ var DEBUG = config.DEBUG = false;
var debug = config.debug = DEBUG ? function () {
console.log.apply(console, arguments);
} : function () { return; };
@@ -239,6 +241,10 @@ define([
var updateObject = function (sframeChan, obj, cb) {
sframeChan.query('Q_DRIVE_GETOBJECT', null, function (err, newObj) {
copyObjectValue(obj, newObj);
+ if (!APP.loggedIn && APP.newSharedFolder) {
+ obj.drive.sharedFolders = obj.drive.sharedFolders || {};
+ obj.drive.sharedFolders[APP.newSharedFolder] = {};
+ }
cb();
});
};
@@ -410,16 +416,22 @@ define([
// Tags used: display Tags category
if (Object.keys(manager.getTagsList()).length) { displayedCategories.push(TAGS); }
- var virtualCategories = [SEARCH, RECENT, OWNED, TAGS];
+ var virtualCategories = [SEARCH, RECENT, OWNED, TAGS, SHARED_FOLDER];
if (!APP.loggedIn) {
- displayedCategories = [FILES_DATA];
- currentPath = [FILES_DATA];
$tree.hide();
- if (Object.keys(files.root).length && !proxy.anonymousAlert) {
- var msg = common.fixLinks($('