Ability to burn an anonymous drive from the browser
parent
4b5abdecbe
commit
9795ac32cb
|
@ -395,6 +395,9 @@ define(function () {
|
|||
out.fm_viewGridButton = "Grille";
|
||||
out.fm_renamedPad = "Vous avez renommé ce pad dans votre Drive. Son titre est:<br><b>{0}</b>";
|
||||
out.fm_prop_tagsList = "Mots-clés";
|
||||
out.fm_burnThisDriveButton = "Effacer toutes les informations stockées par CryptPad dans votre navigateur";
|
||||
out.fm_burnThisDrive = "Êtes-vous sûr de vouloir supprimmer tout ce qui est stocké par CryptPad dans votre navigateur ?<br>" +
|
||||
"Cette action supprimera votre CryptDrive et son historique de votre navigateur, mais les pads existeront toujours (de manière chiffrée) sur notre serveur.";
|
||||
// File - Context menu
|
||||
out.fc_newfolder = "Nouveau dossier";
|
||||
out.fc_rename = "Renommer";
|
||||
|
|
|
@ -397,6 +397,9 @@ define(function () {
|
|||
out.fm_viewGridButton = "Grid view";
|
||||
out.fm_renamedPad = "You've set a custom name for this pad. Its shared title is:<br><b>{0}</b>";
|
||||
out.fm_prop_tagsList = "Tags";
|
||||
out.fm_burnThisDriveButton = "Erase all information stored by CryptPad in your browser";
|
||||
out.fm_burnThisDrive = "Are you sure you want to remove everything stored by CryptPad in your browser?<br>" +
|
||||
"This will remove your CryptDrive and its history from your browser, but your pads will still exist (encrypted) on our server.";
|
||||
// File - Context menu
|
||||
out.fc_newfolder = "New folder";
|
||||
out.fc_rename = "Rename";
|
||||
|
|
|
@ -194,4 +194,7 @@ define({
|
|||
|
||||
// Store the language selected in the iframe into localStorage outside
|
||||
'Q_LANGUAGE_SET': true,
|
||||
|
||||
// Anonymous users can empty their drive and remove FS_hash from localStorage
|
||||
'EV_BURN_ANON_DRIVE': true,
|
||||
});
|
||||
|
|
|
@ -1826,6 +1826,9 @@ define([
|
|||
.appendTo($toolbar);
|
||||
var $hist = common.createButton('history', true, {histConfig: APP.histConfig});
|
||||
$rightside.append($hist);
|
||||
if (APP.$burnThisDrive) {
|
||||
$rightside.append(APP.$burnThisDrive);
|
||||
}
|
||||
return $toolbar;
|
||||
};
|
||||
|
||||
|
@ -2989,10 +2992,12 @@ define([
|
|||
APP.$displayName = APP.$bar.find('.' + Toolbar.constants.username);
|
||||
|
||||
/* add the usage */
|
||||
common.createUsageBar(function (err, $limitContainer) {
|
||||
if (err) { return void logError(err); }
|
||||
APP.$limit = $limitContainer;
|
||||
}, true);
|
||||
if (APP.loggedIn) {
|
||||
common.createUsageBar(function (err, $limitContainer) {
|
||||
if (err) { return void logError(err); }
|
||||
APP.$limit = $limitContainer;
|
||||
}, true);
|
||||
}
|
||||
|
||||
/* add a history button */
|
||||
APP.histConfig = {
|
||||
|
@ -3009,6 +3014,18 @@ define([
|
|||
$toolbar: APP.$bar,
|
||||
};
|
||||
|
||||
// Add a "Burn this drive" button
|
||||
if (!APP.loggedIn) {
|
||||
APP.$burnThisDrive = common.createButton(null, true).click(function () {
|
||||
UI.confirm(Messages.fm_burnThisDrive, function (yes) {
|
||||
if (!yes) { return; }
|
||||
common.getSframeChannel().event('EV_BURN_ANON_DRIVE');
|
||||
}, null, true);
|
||||
}).attr('title', Messages.fm_burnThisDriveButton)
|
||||
.removeClass('fa-question')
|
||||
.addClass('fa-ban');
|
||||
}
|
||||
|
||||
metadataMgr.onChange(function () {
|
||||
var name = metadataMgr.getUserData().name || Messages.anonymous;
|
||||
APP.$displayName.text(name);
|
||||
|
|
|
@ -43,11 +43,20 @@ define([
|
|||
Utils.LocalStore.getFSHash();
|
||||
return Utils.Hash.getSecrets('drive', hash);
|
||||
};
|
||||
var addRpc = function (sframeChan, Cryptpad, Utils) {
|
||||
sframeChan.on('EV_BURN_ANON_DRIVE', function () {
|
||||
if (Utils.LocalStore.isLoggedIn()) { return; }
|
||||
Utils.LocalStore.setFSHash('');
|
||||
Utils.LocalStore.clearThumbnail();
|
||||
window.location.reload();
|
||||
});
|
||||
};
|
||||
Netflux.connect(NetConfig.getWebsocketURL()).then(function (network) {
|
||||
SFCommonO.start({
|
||||
getSecrets: getSecrets,
|
||||
newNetwork: network,
|
||||
noHash: true
|
||||
noHash: true,
|
||||
addRpc: addRpc
|
||||
});
|
||||
}, function (err) { console.error(err); });
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue