pull/1/head
yflory 6 years ago
parent b4c294565e
commit 6143bceabb

@ -387,6 +387,7 @@ define(function () {
out.fm_newFolder = "Nouveau dossier"; out.fm_newFolder = "Nouveau dossier";
out.fm_newFile = "Nouveau pad"; out.fm_newFile = "Nouveau pad";
out.fm_folder = "Dossier"; out.fm_folder = "Dossier";
out.fm_sharedFolder = "Dossier partagé";
out.fm_folderName = "Nom du dossier"; out.fm_folderName = "Nom du dossier";
out.fm_numberOfFolders = "# de dossiers"; out.fm_numberOfFolders = "# de dossiers";
out.fm_numberOfFiles = "# de fichiers"; out.fm_numberOfFiles = "# de fichiers";
@ -447,6 +448,7 @@ define(function () {
out.fm_tags_used = "Nombre d'utilisations"; out.fm_tags_used = "Nombre d'utilisations";
// File - Context menu // File - Context menu
out.fc_newfolder = "Nouveau dossier"; out.fc_newfolder = "Nouveau dossier";
out.fc_newsharedfolder = "Nouveau dossier partagé";
out.fc_rename = "Renommer"; out.fc_rename = "Renommer";
out.fc_open = "Ouvrir"; out.fc_open = "Ouvrir";
out.fc_open_ro = "Ouvrir (lecture seule)"; out.fc_open_ro = "Ouvrir (lecture seule)";
@ -460,7 +462,7 @@ define(function () {
out.fc_hashtag = "Mots-clés"; out.fc_hashtag = "Mots-clés";
out.fc_sizeInKilobytes = "Taille en kilo-octets"; out.fc_sizeInKilobytes = "Taille en kilo-octets";
// fileObject.js (logs) // fileObject.js (logs)
out.fo_moveUnsortedError = "La liste des éléments non triés ne peut pas contenir de dossiers."; out.fo_moveUnsortedError = "La liste des modèles ne peut pas contenir de dossiers.";
out.fo_existingNameError = "Ce nom est déjà utilisé dans ce répertoire. Veuillez en choisir un autre."; out.fo_existingNameError = "Ce nom est déjà utilisé dans ce répertoire. Veuillez en choisir un autre.";
out.fo_moveFolderToChildError = "Vous ne pouvez pas déplacer un dossier dans un de ses descendants"; out.fo_moveFolderToChildError = "Vous ne pouvez pas déplacer un dossier dans un de ses descendants";
out.fo_unableToRestore = "Impossible de restaurer ce fichier à son emplacement d'origine. Vous pouvez essayer de le déplacer à un nouvel emplacement."; out.fo_unableToRestore = "Impossible de restaurer ce fichier à son emplacement d'origine. Vous pouvez essayer de le déplacer à un nouvel emplacement.";

@ -387,6 +387,7 @@ define(function () {
out.fm_newFolder = "New folder"; out.fm_newFolder = "New folder";
out.fm_newFile = "New pad"; out.fm_newFile = "New pad";
out.fm_folder = "Folder"; out.fm_folder = "Folder";
out.fm_sharedFolder = "Shared folder";
out.fm_folderName = "Folder name"; out.fm_folderName = "Folder name";
out.fm_numberOfFolders = "# of folders"; out.fm_numberOfFolders = "# of folders";
out.fm_numberOfFiles = "# of files"; out.fm_numberOfFiles = "# of files";
@ -447,6 +448,7 @@ define(function () {
out.fm_tags_used = "Number of uses"; out.fm_tags_used = "Number of uses";
// File - Context menu // File - Context menu
out.fc_newfolder = "New folder"; out.fc_newfolder = "New folder";
out.fc_newsharedfolder = "New shared folder";
out.fc_rename = "Rename"; out.fc_rename = "Rename";
out.fc_open = "Open"; out.fc_open = "Open";
out.fc_open_ro = "Open (read-only)"; out.fc_open_ro = "Open (read-only)";
@ -460,7 +462,7 @@ define(function () {
out.fc_hashtag = "Tags"; out.fc_hashtag = "Tags";
out.fc_sizeInKilobytes = "Size in Kilobytes"; out.fc_sizeInKilobytes = "Size in Kilobytes";
// fileObject.js (logs) // fileObject.js (logs)
out.fo_moveUnsortedError = "You can't move a folder to the list of unsorted pads"; out.fo_moveUnsortedError = "You can't move a folder to the list of templates";
out.fo_existingNameError = "Name already used in that directory. Please choose another one."; out.fo_existingNameError = "Name already used in that directory. Please choose another one.";
out.fo_moveFolderToChildError = "You can't move a folder into one of its descendants"; out.fo_moveFolderToChildError = "You can't move a folder into one of its descendants";
out.fo_unableToRestore = "Unable to restore that file to its original location. You can try to move it to a new location."; out.fo_unableToRestore = "Unable to restore that file to its original location. You can try to move it to a new location.";
@ -1200,5 +1202,14 @@ define(function () {
out.loading_drive_2 = "Updating data format"; out.loading_drive_2 = "Updating data format";
out.loading_drive_3 = "Verifying data integrity"; out.loading_drive_3 = "Verifying data integrity";
// Shared folders
// XXX
out.sharedFolders_forget = "This pad is only stored in a shared folder, you can't move it to the trash. You can use your CryptDrive if you want to delete it from the folder.";
out.sharedFolders_duplicate = "Some of the pads you were trying to move were already stored.";
out.sharedFolders_create = "Create a shared folder";
out.sharedFolders_create_name = "Folder name";
out.sharedFolders_create_owned = "Owned folder";
out.sharedFolders_create_password = "Folder password";
return out; return out;
}); });

@ -683,7 +683,7 @@ define([
if (err || res.error) { return void console.log(err || res.error); } if (err || res.error) { return void console.log(err || res.error); }
var msg = Messages.forgetPrompt; var msg = Messages.forgetPrompt;
if (res) { if (res) {
UI.alert("WIP: This pad is only in a shared folder. You can't move it to the trash. You can use your CryptDrive if you want to delete it from the folder."); // XXX UI.alert(Messages.sharedFolders_forget);
return; return;
} else if (!common.isLoggedIn()) { } else if (!common.isLoggedIn()) {
msg = Messages.fm_removePermanentlyDialog; msg = Messages.fm_removePermanentlyDialog;

@ -220,14 +220,14 @@ define([
// Remove existing pads from the "element" variable // Remove existing pads from the "element" variable
if (exp.isFile(element) && toRemove.indexOf(element) !== -1) { if (exp.isFile(element) && toRemove.indexOf(element) !== -1) {
// XXX display error in the UI exp.log(Messages.sharedFolders_duplicate);
return; return;
} else if (exp.isFolder(element)) { } else if (exp.isFolder(element)) {
var _removeExisting = function (root) { var _removeExisting = function (root) {
for (var k in root) { for (var k in root) {
if (exp.isFile(root[k])) { if (exp.isFile(root[k])) {
if (toRemove.indexOf(root[k]) !== -1) { if (toRemove.indexOf(root[k]) !== -1) {
// XXX display message in UI exp.log(Messages.sharedFolders_duplicate);
delete root[k]; delete root[k];
} }
} else if (exp.isFolder(root[k])) { } else if (exp.isFolder(root[k])) {

@ -252,7 +252,7 @@ define([
var resolved = _resolvePaths(Env, data.paths); var resolved = _resolvePaths(Env, data.paths);
var newResolved = _resolvePath(Env, data.newPath); var newResolved = _resolvePath(Env, data.newPath);
if (!newResolved.userObject.isFolder(newResolved.path)) { return void cb(); } // XXX if (!newResolved.userObject.isFolder(newResolved.path)) { return void cb(); }
nThen(function (waitFor) { nThen(function (waitFor) {
if (resolved.main.length) { if (resolved.main.length) {
@ -384,7 +384,7 @@ define([
// 2b. load the proxy // 2b. load the proxy
Env.loadSharedFolder(id, folderData, waitFor(function (rt, metadata) { Env.loadSharedFolder(id, folderData, waitFor(function (rt, metadata) {
if (!rt.proxy.metadata) { // Creating a new shared folder if (!rt.proxy.metadata) { // Creating a new shared folder
rt.proxy.metadata = {title: data.name || Messages.fm_newFolder}; // XXX rt.proxy.metadata = { title: data.name || Messages.fm_newFolder };
} }
// If we're importing a folder, check its serverside metadata // If we're importing a folder, check its serverside metadata
if (data.folderData && metadata) { if (data.folderData && metadata) {

@ -37,7 +37,7 @@ define([
var logging = function () { var logging = function () {
console.log.apply(console, arguments); console.log.apply(console, arguments);
}; };
var log = config.log || logging; var log = exp.log = config.log || logging;
var logError = config.logError || logging; var logError = config.logError || logging;
var debug = exp.debug = config.debug || logging; var debug = exp.debug = config.debug || logging;
@ -143,7 +143,7 @@ define([
// Data from filesData // Data from filesData
var getTitle = exp.getTitle = function (file, type) { var getTitle = exp.getTitle = function (file, type) {
if (isSharedFolder(file)) { if (isSharedFolder(file)) {
return '??'; // XXX return '??';
} }
var data = getFileData(file); var data = getFileData(file);
if (!file || !data || !(data.href || data.roHref)) { if (!file || !data || !(data.href || data.roHref)) {

@ -267,7 +267,7 @@ define([
h('li', h('a.cp-app-drive-context-newsharedfolder.dropdown-item.cp-app-drive-context-editable', { h('li', h('a.cp-app-drive-context-newsharedfolder.dropdown-item.cp-app-drive-context-editable', {
'tabindex': '-1', 'tabindex': '-1',
'data-icon': faSharedFolder, 'data-icon': faSharedFolder,
}, 'New SF')), // XXX }, Messages.fc_newsharedfolder)),
h('li', h('a.cp-app-drive-context-hashtag.dropdown-item.cp-app-drive-context-editable', { h('li', h('a.cp-app-drive-context-hashtag.dropdown-item.cp-app-drive-context-editable', {
'tabindex': '-1', 'tabindex': '-1',
'data-icon': faTags, 'data-icon': faTags,
@ -1706,17 +1706,16 @@ define([
}; };
// Ask for name, password and owner // Ask for name, password and owner
// XXX
var content = h('div', [ var content = h('div', [
h('h4', "NEW SF TITLE"), h('h4', Messages.sharedFolders_create),
h('label', {for: 'cp-app-drive-sf-name'}, 'SF NAME'), h('label', {for: 'cp-app-drive-sf-name'}, Messages.sharedFolders_create_name),
h('input#cp-app-drive-sf-name', {type: 'text', placeholder: "NEW FOLDER NAME"}), h('input#cp-app-drive-sf-name', {type: 'text', placeholder: Messages.fm_newFolder}),
//h('label', {for: 'cp-app-drive-sf-password'}, 'SF PASSWORD'), //h('label', {for: 'cp-app-drive-sf-password'}, Messages.sharedFolders_create_password),
//UI.passwordInput({id: 'cp-app-drive-sf-password'}), //UI.passwordInput({id: 'cp-app-drive-sf-password'}),
h('span', { h('span', {
style: 'display:flex;align-items:center;justify-content:space-between' style: 'display:flex;align-items:center;justify-content:space-between'
}, [ }, [
UI.createCheckbox('cp-app-drive-sf-owned', "OWNED?", true), UI.createCheckbox('cp-app-drive-sf-owned', Messages.sharedFolders_create_owned, true),
createHelper('/faq.html#keywords-owned', Messages.creation_owned1) // TODO createHelper('/faq.html#keywords-owned', Messages.creation_owned1) // TODO
]), ]),
]); ]);
@ -1774,6 +1773,7 @@ define([
$block.find('a.cp-app-drive-new-shared-folder, li.cp-app-drive-new-shared-folder') $block.find('a.cp-app-drive-new-shared-folder, li.cp-app-drive-new-shared-folder')
.click(function () { .click(function () {
addSharedFolderModal(function (obj) { addSharedFolderModal(function (obj) {
if (!obj) { return; }
manager.addSharedFolder(currentPath, obj, refresh); manager.addSharedFolder(currentPath, obj, refresh);
}); });
}); });
@ -1821,7 +1821,7 @@ define([
options.push({ options.push({
tag: 'a', tag: 'a',
attributes: {'class': 'cp-app-drive-new-shared-folder'}, attributes: {'class': 'cp-app-drive-new-shared-folder'},
content: $('<div>').append($folderIcon.clone()).html() + "NEW SF" // XXX content: $('<div>').append($folderIcon.clone()).html() + Messages.fm_sharedFolder
}); });
} }
options.push({tag: 'hr'}); options.push({tag: 'hr'});
@ -2079,7 +2079,7 @@ define([
'cp-app-drive-element-grid' 'cp-app-drive-element-grid'
}).prepend($folderIcon.clone()).appendTo($container); }).prepend($folderIcon.clone()).appendTo($container);
$element3.append($('<span>', { 'class': 'cp-app-drive-new-name' }) $element3.append($('<span>', { 'class': 'cp-app-drive-new-name' })
.text("SF")); // XXX .text(Messages.fm_sharedFolder));
} }
// File // File
var $element2 = $('<li>', { var $element2 = $('<li>', {
@ -2922,6 +2922,10 @@ define([
data.roHref = base + data.roHref; data.roHref = base + data.roHref;
} }
if (manager.isSharedFolder(el)) {
delete data.roHref;
}
UIElements.getProperties(common, data, cb); UIElements.getProperties(common, data, cb);
}; };
@ -3002,6 +3006,7 @@ define([
else if ($(this).hasClass('cp-app-drive-context-newsharedfolder')) { else if ($(this).hasClass('cp-app-drive-context-newsharedfolder')) {
if (paths.length !== 1) { return; } if (paths.length !== 1) { return; }
addSharedFolderModal(function (obj) { addSharedFolderModal(function (obj) {
if (!obj) { return; }
manager.addSharedFolder(paths[0].path, obj, refresh); manager.addSharedFolder(paths[0].path, obj, refresh);
}); });
} }

Loading…
Cancel
Save